tridoraemu: enable debug display via F12

This commit is contained in:
slederer 2025-09-13 22:59:21 +02:00
parent d2cae9480c
commit b2c2e8dc0c
3 changed files with 29 additions and 6 deletions

View file

@ -17,6 +17,12 @@ const IOSlotSize = 128
const IOSlotCount = 16
const DRAMStart = 65536
const CacheAddrShift = 8
const CacheWriteThrough = true
type Mem struct {
ram [] word
iohandler [IOSlotCount] IOHandler
@ -79,7 +85,7 @@ func (m *Mem) attachIO(h IOHandler, slot int) {
m.iohandler[slot] = h
}
func (m *Mem) read(byteaddr word) (word, error) {
func (m *Mem) readRaw(byteaddr word) (word, error) {
if byteaddr >= IOStartAddr && byteaddr < RAMStartAddr {
ioslot := (byteaddr - IOStartAddr) / IOSlotSize
if m.iohandler[ioslot] != nil {
@ -96,6 +102,14 @@ func (m *Mem) read(byteaddr word) (word, error) {
}
}
func (m *Mem) read(byteaddr word) (word, error) {
return m.readRaw(byteaddr);
}
func (m *Mem) readIns(byteaddr word) (word, error) {
return m.readRaw(byteaddr);
}
func (m *Mem) write(value word, byteaddr word) error {
if byteaddr < IOStartAddr {
return fmt.Errorf("Write to ROM area at %08X value %08X", byteaddr, value)