diff --git a/example/gdrom_test.cpp b/example/gdrom_test.cpp index 353066b..21efcd1 100644 --- a/example/gdrom_test.cpp +++ b/example/gdrom_test.cpp @@ -1,6 +1,7 @@ #include "gdrom.hpp" #include "gdrom_bits.hpp" #include "memorymap.hpp" +#include "systembus.hpp" #include "sh7091/serial.hpp" @@ -234,7 +235,7 @@ void cd_read() void main() { // gdrom unlock undocumented register - *((volatile unsigned long *)0xa05f74e4) = 0x1fffff; + g1_if.GDUNLOCK = 0x1fffff; // Without this read from system_boot_rom, the read value of // gdrom_if.status is always 0xff diff --git a/regs/systembus.csv b/regs/systembus.csv index 09244e7..4ed3745 100644 --- a/regs/systembus.csv +++ b/regs/systembus.csv @@ -83,6 +83,7 @@ "G1_IF","b4","4","G1CRDYC","W","G1IORDY signal control" "G1_IF","b8","4","GDAPRO","W","GD-DMA address range" ,,,,, +"G1_IF","e4","4","GDUNLOCK","W","(undocumented unlock register)" "G1_IF","f4","4","GDSTARD","R","GD-DMA address count (on Root Bus)" "G1_IF","f8","4","GDLEND","R","GD-DMA transfer counter" ,,,,, diff --git a/regs/systembus.ods b/regs/systembus.ods index 90f79c2..a486842 100644 Binary files a/regs/systembus.ods and b/regs/systembus.ods differ diff --git a/systembus.hpp b/systembus.hpp index 9190727..0eb9117 100644 --- a/systembus.hpp +++ b/systembus.hpp @@ -142,7 +142,9 @@ struct g1_if_reg { reg32 G1SYSM; /* System mode */ reg32 G1CRDYC; /* G1IORDY signal control */ reg32 GDAPRO; /* GD-DMA address range */ - reg8 _pad5[56]; + reg8 _pad5[40]; + reg32 GDUNLOCK; /* (undocumented unlock register) */ + reg8 _pad6[12]; reg32 GDSTARD; /* GD-DMA address count (on Root Bus) */ reg32 GDLEND; /* GD-DMA transfer counter */ }; @@ -163,6 +165,7 @@ static_assert((offsetof (struct g1_if_reg, G1GDWC)) == 0xa4); static_assert((offsetof (struct g1_if_reg, G1SYSM)) == 0xb0); static_assert((offsetof (struct g1_if_reg, G1CRDYC)) == 0xb4); static_assert((offsetof (struct g1_if_reg, GDAPRO)) == 0xb8); +static_assert((offsetof (struct g1_if_reg, GDUNLOCK)) == 0xe4); static_assert((offsetof (struct g1_if_reg, GDSTARD)) == 0xf4); static_assert((offsetof (struct g1_if_reg, GDLEND)) == 0xf8);