actually thsi adds the interrupt update loop
This commit is contained in:
		
							parent
							
								
									a68812698b
								
							
						
					
					
						commit
						e44d7e492b
					
				@ -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 
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										17
									
								
								main.asm
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								main.asm
									
									
									
									
									
								
							@ -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
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								source.zip
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								source.zip
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
		Loading…
	
		Reference in New Issue
	
	Block a user