Oops! All bugs!

This commit is contained in:
Randy Thiemann 2023-10-18 04:45:58 +02:00
parent 8e8e5b0a48
commit 6b644665cf
5 changed files with 27 additions and 18 deletions

View File

@ -17,8 +17,9 @@ INCLUDE "structs.asm"
; We don't wait for 2 because it's super short and impractical to do much of anything in. ; We don't wait for 2 because it's super short and impractical to do much of anything in.
MACRO wait_vram MACRO wait_vram
ld hl, rSTAT ld hl, rSTAT
: bit 1, [hl] .wvr\@
jr nz, :- bit 1, [hl]
jr nz, .wvr\@
ENDM ENDM
@ -26,17 +27,21 @@ ENDM
; We do this by checking for scanline 144. ; We do this by checking for scanline 144.
MACRO wait_vblank MACRO wait_vblank
ld b, 144 ld b, 144
: ldh a, [rLY] .wvb\@
ldh a, [rLY]
cp a, b cp a, b
jr nz, :- jr nz, .wvb\@
ENDM ENDM
; Waits for PPU mode to be at the end of mode 1. ; Waits for PPU mode to be at the end of mode 1.
; We do this by checking for scanline 0. ; We do this by checking for scanline 0.
MACRO wait_vblank_end MACRO wait_vblank_end
: ldh a, [rLY] ld b, 0
jr nz, :- .wvbe\@
ldh a, [rLY]
cp a, b
jr nz, .wvbe\@
ENDM ENDM

View File

@ -64,7 +64,9 @@ EventLoop::
call HandleTimers call HandleTimers
; Call the current state's event handler. ; Call the current state's event handler.
ld b, 0
ldh a, [hGameState] ldh a, [hGameState]
cp a, b
jp nz, GamePlayEventLoopHandler jp nz, GamePlayEventLoopHandler
EventLoopPostHandler:: EventLoopPostHandler::

View File

@ -12,7 +12,7 @@ wNextPiece:: ds 1
section "RNG Functions", ROM0 section "RNG Functions", ROM0
StartNewGame:: RNGInit::
; Do some bit fuckery on the seed using the gameboy's free-running timers. ; Do some bit fuckery on the seed using the gameboy's free-running timers.
ld hl, wRNGSeed ld hl, wRNGSeed
ldh a, [rDIV] ldh a, [rDIV]

View File

@ -49,7 +49,9 @@ OAMDMA::
jr nz, :- jr nz, :-
; Jump to the current state's vblank handler. ; Jump to the current state's vblank handler.
ld b, 0
ldh a, [hGameState] ldh a, [hGameState]
cp a, b
jp nz, BlitField jp nz, BlitField
jp EventLoop jp EventLoop
ENDL ENDL

View File

@ -1,7 +1,7 @@
#Emulicious settings file #Emulicious settings file
#Tue Oct 17 13:52:17 CEST 2023 #Wed Oct 18 04:45:41 CEST 2023
WindowEventViewerWindowHeight=861 WindowEventViewerWindowHeight=1416
WindowEventViewerWindowDivider=309 WindowEventViewerWindowDivider=876
WindowMemoryTracerWindowY=631 WindowMemoryTracerWindowY=631
WindowMemoryTracerWindowX=383 WindowMemoryTracerWindowX=383
Update=2 Update=2
@ -16,7 +16,7 @@ GBGamepadThreshold=50
GameBoyErrorBreakpointEnabled20=false GameBoyErrorBreakpointEnabled20=false
StretchToWindow=false StretchToWindow=false
WindowTileViewerOpen=false WindowTileViewerOpen=false
DebuggerWestPanelSelectedTab=0 DebuggerWestPanelSelectedTab=1
WindowMemoryTracerWindowWidth=243 WindowMemoryTracerWindowWidth=243
WindowPaletteViewerOpen=false WindowPaletteViewerOpen=false
Key37=-1 Key37=-1
@ -126,9 +126,9 @@ Key1=75
Key0=74 Key0=74
Gamepad1Key19=-1 Gamepad1Key19=-1
Gamepad1Key18=-1 Gamepad1Key18=-1
WindowEventViewerWindowY=293 WindowEventViewerWindowY=24
Gamepad1Key17=-1 Gamepad1Key17=-1
WindowEventViewerWindowX=1480 WindowEventViewerWindowX=0
Gamepad1Key16=-1 Gamepad1Key16=-1
Gamepad1Key15=-1 Gamepad1Key15=-1
Gamepad1Key14=-1 Gamepad1Key14=-1
@ -199,8 +199,8 @@ GameBoyErrorBreakpointMessage32=
InterruptBreakpointCondition= InterruptBreakpointCondition=
Recent0=C\:\\workspace\\dmgtris\\bin\\out.gb Recent0=C\:\\workspace\\dmgtris\\bin\\out.gb
GameBoyErrorBreakpointMessage20= GameBoyErrorBreakpointMessage20=
WindowEmuliciousY=513 WindowEmuliciousY=322
WindowEmuliciousX=97 WindowEmuliciousX=900
GameBoyErrorBreakpointEnabled9=false GameBoyErrorBreakpointEnabled9=false
GameBoyErrorBreakpointEnabled8=false GameBoyErrorBreakpointEnabled8=false
GameBoyErrorBreakpointEnabled7=false GameBoyErrorBreakpointEnabled7=false
@ -264,14 +264,14 @@ Gamepad0Key3=-1
Gamepad0Key2=-1 Gamepad0Key2=-1
Gamepad0Key1=-1 Gamepad0Key1=-1
Gamepad0Key0=-1 Gamepad0Key0=-1
WindowDebuggerY=369 WindowDebuggerY=388
WindowDebuggerX=830 WindowDebuggerX=417
InterruptBreakpointSuspend=true InterruptBreakpointSuspend=true
SMSGamepadAKeyboard=false SMSGamepadAKeyboard=false
GameBoyErrorBreakpointSuspend32=true GameBoyErrorBreakpointSuspend32=true
SMSGamepadB=-1 SMSGamepadB=-1
SMSGamepadA=-1 SMSGamepadA=-1
WindowEventViewerWindowWidth=930 WindowEventViewerWindowWidth=2576
BankSwapAtPCBreakpointCondition= BankSwapAtPCBreakpointCondition=
GameBoyErrorBreakpointSuspend20=true GameBoyErrorBreakpointSuspend20=true
SouthPanelHeight=635 SouthPanelHeight=635