Previous 15994 Revisions Next

r1050 Saturday 29th September, 2007 at 16:24:59 UTC by Wilbert Pol
[GAMEBOY] Some documentation updates
[src/mess/drivers]gb.c

src/mess/drivers/gb.c
r1049r1050
5151Interrupts
5252==========
5353
54Taking an interrupt seems to take around 12(?) clock cycles.
54Taking an interrupt seems to take around 20 clock cycles.
5555
5656
5757Stat timing
r1049r1050
7676
7777For lines 1 - 143 when stat changes to 2 the line counter is incremented.
7878
79Line 153 is little odd timing wise. The line counter stays 153 for ~16-32 clock cycles
79Line 153 is little odd timing wise. The line counter stays 153 for ~4 clock cycles
8080and is then rolls over to 0.
8181
8282When the line counter is changed it gets checked against the lyc register.
8383
84Here is a detailed run of the STAT and LY register together with LYC set to 3 on a
85dmg and mgb. The time between each sample is 4 clock cycles:
86STAT:
8722222222 22233333 33333333 33333333 33333333 33333333 33333300 00000000 00000000 00000000
8800000000 00000000 00000000 06666666 66666666 66666777 77777777 77777777 77777777 77777777
8977777777 44444444 44444444 44444444 44444444 44444444 44444444 44022222 22222222
8490
91  LY:
9233333333 33333333 33333333 33333333 33333333 33333333 33333333 33333333 33333333 33333333
9333333333 33333333 33333333 44444444 44444444 44444444 44444444 44444444 44444444 44444444
9444444444 44444444 44444444 44444444 44444444 44444444 44444444 44555555 55555555
95                           ^                                     ^
96
97As you can see, it seems as though the LY register is incremented slightly before the STAT
98register is changed, resulting in a short period where STAT goes 0 before going to 2. This
99bug/feature has been fixed in the CGB and AGB.
100
101
102
85103Mappers used in the gameboy
86104===========================
87105

Previous 15994 Revisions Next


© 1998-2018 The MESS Team