rewrote main loop, cleaned up stuff, B button to step one frame

This commit is contained in:
2019-01-09 00:19:55 +01:00
parent 25d999968e
commit 3cd2f3d126
7 changed files with 175 additions and 194 deletions

View File

@@ -282,20 +282,11 @@ SwapBuffers:
; set old and rendered pointers to buffer1
ld a, HIGH(Buffer1)
ldh [Old], a
ldh [Rendered + 1], a
; set new pointer to buffer0
ld a, HIGH(Buffer0)
ldh [New], a
; set video pointer to first tilemap
ld a, HIGH(_SCRN1)
ldh [Video + 1], a
; display bg 9800 that has just been filled
ld a, LCDCF_ON | LCDCF_BGON | LCDCF_BG9800
ld [rLCDC], a
jr InitAutomata.resetLow
.newToBuffer1
@@ -303,20 +294,11 @@ InitAutomata:
; set old and rendered pointers to buffer0
ld a, HIGH(Buffer0)
ldh [Old], a
ldh [Rendered + 1], a
; set new pointer to buffer1
ld a, HIGH(Buffer1)
ldh [New], a
; set video pointer to second tilemap
ld a, HIGH(_SCRN0)
ldh [Video + 1], a
; display bg 9C00 that has just been filled
ld a, LCDCF_ON | LCDCF_BGON | LCDCF_BG9C00
ld [rLCDC], a
.resetLow
; reset low bytes of pointers
xor a