actually thsi adds the interrupt update loop

This commit is contained in:
Shoofle 2025-03-30 10:53:51 -04:00
parent a68812698b
commit e44d7e492b
3 changed files with 16 additions and 5 deletions

View File

@ -118,7 +118,7 @@ Async_Spawn:
ld [INTERRUPT_LCD + 1], a; set interrupt handler to "ENTER THREAD"
ld a, SAFE_ASYNC_START ; CHANGE ME TO ADJUST SAFE TRANSFER TIMING
ld [rLYC], a ; set LYC
ld hl, rIE
ld hl, rIE
set 1, [hl] ; enable vblank
ld hl, rSTAT
set 6, [hl] ; set the stat interrupt to LYC mode
@ -272,7 +272,7 @@ Async_EarlyReturn:
; unset next call
ld hl, rIE
res 1, [hl] ; disable vblank
res 1, [hl] ; disable stat interrupt
ld hl, rIF
res 1, [hl] ; clear the interrupt

View File

@ -56,10 +56,15 @@ def VARIABLE_TILES_START equ 26
INCLUDE "hardware.inc"
SECTION "Interrupts", ROM0[$0]
ds $48 - @, 0
ds INT_HANDLER_VBLANK - @, 0
reti
ds INT_HANDLER_STAT - @, 0
call INTERRUPT_LCD - 1
ret
SECTION "Header", ROM0[$100]
jp EntryPoint
@ -270,9 +275,14 @@ Loop:
call SoundUpdate
println "scene update is ", SCENE_UPDATE - 1
call SCENE_UPDATE - 1 ; hope this takes not too many scanlines!
ld b, 144
call AwaitLine
di
ld a, [rIE]
or a, IEF_VBLANK
ld [rIE], a
ei
halt
println "scene draw is ", SCENE_DRAW - 1
call SCENE_DRAW - 1 ; hope this takes fewer than 9 scanlines!
@ -286,6 +296,7 @@ println "scene draw is ", SCENE_DRAW - 1
jp Loop
SoundUpdate:
ret
ChangeScene: ; hl should be a pointer to, in sequence, setup update draw teardown
;call SCENE_TEARDOWN - 1

Binary file not shown.