Closed NicholasBHubbard closed 1 year ago
There is actually an error in that comment: D0 corresponds to Z80 /RESET state and D1 to Z80 bus request state.
The value 0x1 corresponds to the state where Z80 /RESET is not asserted (it is active low) and Z80 has access to its bus.
See also https://github.com/ekeeke/Genesis-Plus-GX/blob/master/core/genesis.c#L462 https://github.com/ekeeke/Genesis-Plus-GX/blob/master/core/genesis.c#L502
The zstate variable is defined as so in genesis.c:
I am a bit confused however on what d0 and d1 actually mean. Based on the comment, I assume that if d0 == 1 then BUSACK is set, otherwise BUSACK is not set. And if d1 == 1 then RESET is not set, otherwise it is set. However throughout system.c, z80 execution is guarded by
zstate == 1
, for example here:If I understand correctly then that would mean we only run the z80 when BUSACK and RESET are both set. However it seems quite strange to me that we would run the Z80 only under such conditions.
I would appreciate clarification on what d0 and d1 stand for.