src/mess/drivers/gb.c
| r1049 | r1050 | |
| 51 | 51 | Interrupts |
| 52 | 52 | ========== |
| 53 | 53 | |
| 54 | | Taking an interrupt seems to take around 12(?) clock cycles. |
| 54 | Taking an interrupt seems to take around 20 clock cycles. |
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | Stat timing |
| r1049 | r1050 | |
| 76 | 76 | |
| 77 | 77 | For lines 1 - 143 when stat changes to 2 the line counter is incremented. |
| 78 | 78 | |
| 79 | | Line 153 is little odd timing wise. The line counter stays 153 for ~16-32 clock cycles |
| 79 | Line 153 is little odd timing wise. The line counter stays 153 for ~4 clock cycles |
| 80 | 80 | and is then rolls over to 0. |
| 81 | 81 | |
| 82 | 82 | When the line counter is changed it gets checked against the lyc register. |
| 83 | 83 | |
| 84 | Here is a detailed run of the STAT and LY register together with LYC set to 3 on a |
| 85 | dmg and mgb. The time between each sample is 4 clock cycles: |
| 86 | STAT: |
| 87 | 22222222 22233333 33333333 33333333 33333333 33333333 33333300 00000000 00000000 00000000 |
| 88 | 00000000 00000000 00000000 06666666 66666666 66666777 77777777 77777777 77777777 77777777 |
| 89 | 77777777 44444444 44444444 44444444 44444444 44444444 44444444 44022222 22222222 |
| 84 | 90 | |
| 91 | LY: |
| 92 | 33333333 33333333 33333333 33333333 33333333 33333333 33333333 33333333 33333333 33333333 |
| 93 | 33333333 33333333 33333333 44444444 44444444 44444444 44444444 44444444 44444444 44444444 |
| 94 | 44444444 44444444 44444444 44444444 44444444 44444444 44444444 44555555 55555555 |
| 95 | ^ ^ |
| 96 | |
| 97 | As you can see, it seems as though the LY register is incremented slightly before the STAT |
| 98 | register is changed, resulting in a short period where STAT goes 0 before going to 2. This |
| 99 | bug/feature has been fixed in the CGB and AGB. |
| 100 | |
| 101 | |
| 102 | |
| 85 | 103 | Mappers used in the gameboy |
| 86 | 104 | =========================== |
| 87 | 105 | |