Timer pause.

This commit is contained in:
Randy Thiemann 2023-11-03 01:20:40 +01:00
parent 0ec8427fb6
commit df9b65e78f
7 changed files with 93 additions and 84 deletions

Binary file not shown.

View File

@ -357,46 +357,46 @@ ROM0 bank #0:
$27eb = EventLoopPostHandler
$27ed = EventLoopPostHandler.wvb_u3
$27ff = EventLoopPostHandler.vblankjumps
SECTION: $2808-$2875 ($006e bytes) ["Title Function Trampolines"]
$2808 = SwitchToTitle
$2812 = TitleEventLoopHandler
$281c = TitleVBlankHandler
$2826 = DrawOption6
SECTION: $2876-$28de ($0069 bytes) ["Time Functions"]
$2876 = TimeInit
$288b = ResetGameTime
$2896 = CheckTorikan
$28ad = CheckTorikan.failure
$28af = CheckTorikan.success
$28b2 = HandleTimers
SECTION: $28df-$2930 ($0052 bytes) ["Tile Functions"]
$28df = LoadTitleTiles
$28fd = LoadGameplayTiles
$2913 = LoadGameplayTiles.gbc
$2922 = LoadGameplayTiles.dmg
SECTION: $2931-$295e ($002e bytes) ["Memory Functions"]
$2931 = UnsafeMemCopy
$293a = SafeMemCopy.wvr_u1
$293a = SafeMemCopy
$2949 = UnsafeMemSet
$2951 = SafeMemSet
$2951 = SafeMemSet.wvr_u2
SECTION: $295f-$2986 ($0028 bytes) ["Gameplay Function Trampolines"]
$295f = SwitchToGameplay
$2969 = SwitchToGameplayBig
$2973 = GamePlayEventLoopHandler
$297d = GamePlayBigEventLoopHandler
SECTION: $2987-$29a8 ($0022 bytes) ["OAM Functions"]
$2987 = CopyOAMHandler
$2993 = ClearOAM
SECTION: $29a9-$29c1 ($0019 bytes) ["Interrupt Initialization Functions"]
$29a9 = IntrInit
$29ad = InitializeLCDCInterrupt
SECTION: $29c2-$29cb ($000a bytes) ["OAM DMA Code"]
$29c2 = OAMDMA
$29cc = OAMDMAEnd
EMPTY: $29cc-$3fff ($1634 bytes)
TOTAL EMPTY: $163f bytes
SECTION: $2808-$287b ($0074 bytes) ["Time Functions"]
$2808 = TimeInit
$281d = ResetGameTime
$2828 = CheckTorikan
$283f = CheckTorikan.failure
$2841 = CheckTorikan.success
$2844 = HandleTimers
SECTION: $287c-$28e9 ($006e bytes) ["Title Function Trampolines"]
$287c = SwitchToTitle
$2886 = TitleEventLoopHandler
$2890 = TitleVBlankHandler
$289a = DrawOption6
SECTION: $28ea-$293b ($0052 bytes) ["Tile Functions"]
$28ea = LoadTitleTiles
$2908 = LoadGameplayTiles
$291e = LoadGameplayTiles.gbc
$292d = LoadGameplayTiles.dmg
SECTION: $293c-$2969 ($002e bytes) ["Memory Functions"]
$293c = UnsafeMemCopy
$2945 = SafeMemCopy.wvr_u1
$2945 = SafeMemCopy
$2954 = UnsafeMemSet
$295c = SafeMemSet
$295c = SafeMemSet.wvr_u2
SECTION: $296a-$2991 ($0028 bytes) ["Gameplay Function Trampolines"]
$296a = SwitchToGameplay
$2974 = SwitchToGameplayBig
$297e = GamePlayEventLoopHandler
$2988 = GamePlayBigEventLoopHandler
SECTION: $2992-$29b3 ($0022 bytes) ["OAM Functions"]
$2992 = CopyOAMHandler
$299e = ClearOAM
SECTION: $29b4-$29cc ($0019 bytes) ["Interrupt Initialization Functions"]
$29b4 = IntrInit
$29b8 = InitializeLCDCInterrupt
SECTION: $29cd-$29d6 ($000a bytes) ["OAM DMA Code"]
$29cd = OAMDMA
$29d7 = OAMDMAEnd
EMPTY: $29d7-$3fff ($1629 bytes)
TOTAL EMPTY: $1634 bytes
ROMX bank #1:
SECTION: $4000-$4007 ($0008 bytes) ["Bank ID BANK_OTHER"]
@ -2408,7 +2408,7 @@ HRAM bank #0:
TOTAL EMPTY: $0006 bytes
SUMMARY:
ROM0: 10689 bytes used / 5695 free
ROM0: 10700 bytes used / 5684 free
ROMX: 56508 bytes used / 41796 free in 6 banks
SRAM: 14 bytes used / 8178 free in 1 bank
WRAM0: 3503 bytes used / 593 free

Binary file not shown.

View File

@ -256,36 +256,36 @@
00:27eb EventLoopPostHandler
00:27ed EventLoopPostHandler.wvb_u3
00:27ff EventLoopPostHandler.vblankjumps
00:2808 SwitchToTitle
00:2812 TitleEventLoopHandler
00:281c TitleVBlankHandler
00:2826 DrawOption6
00:2876 TimeInit
00:288b ResetGameTime
00:2896 CheckTorikan
00:28ad CheckTorikan.failure
00:28af CheckTorikan.success
00:28b2 HandleTimers
00:28df LoadTitleTiles
00:28fd LoadGameplayTiles
00:2913 LoadGameplayTiles.gbc
00:2922 LoadGameplayTiles.dmg
00:2931 UnsafeMemCopy
00:293a SafeMemCopy.wvr_u1
00:293a SafeMemCopy
00:2949 UnsafeMemSet
00:2951 SafeMemSet
00:2951 SafeMemSet.wvr_u2
00:295f SwitchToGameplay
00:2969 SwitchToGameplayBig
00:2973 GamePlayEventLoopHandler
00:297d GamePlayBigEventLoopHandler
00:2987 CopyOAMHandler
00:2993 ClearOAM
00:29a9 IntrInit
00:29ad InitializeLCDCInterrupt
00:29c2 OAMDMA
00:29cc OAMDMAEnd
00:2808 TimeInit
00:281d ResetGameTime
00:2828 CheckTorikan
00:283f CheckTorikan.failure
00:2841 CheckTorikan.success
00:2844 HandleTimers
00:287c SwitchToTitle
00:2886 TitleEventLoopHandler
00:2890 TitleVBlankHandler
00:289a DrawOption6
00:28ea LoadTitleTiles
00:2908 LoadGameplayTiles
00:291e LoadGameplayTiles.gbc
00:292d LoadGameplayTiles.dmg
00:293c UnsafeMemCopy
00:2945 SafeMemCopy.wvr_u1
00:2945 SafeMemCopy
00:2954 UnsafeMemSet
00:295c SafeMemSet
00:295c SafeMemSet.wvr_u2
00:296a SwitchToGameplay
00:2974 SwitchToGameplayBig
00:297e GamePlayEventLoopHandler
00:2988 GamePlayBigEventLoopHandler
00:2992 CopyOAMHandler
00:299e ClearOAM
00:29b4 IntrInit
00:29b8 InitializeLCDCInterrupt
00:29cd OAMDMA
00:29d7 OAMDMAEnd
01:4008 sDMGTSpeedCurve
01:4210 sDMGTSpeedCurveEnd
01:4212 sTGM1SpeedCurve

View File

@ -360,4 +360,17 @@ DEF GRADE_MM EQU 35
DEF GRADE_GM EQU 36
DEF GRADE_NONE EQU 255
; Game mode
DEF MODE_LEADY EQU 0
DEF MODE_GO EQU 3
DEF MODE_POSTGO EQU 6
DEF MODE_PREFETCHED_PIECE EQU 9
DEF MODE_SPAWN_PIECE EQU 12
DEF MODE_PIECE_IN_MOTION EQU 15
DEF MODE_DELAY EQU 18
DEF MODE_GAME_OVER EQU 21
DEF MODE_PRE_GAME_OVER EQU 24
DEF MODE_PAUSED EQU 27
ENDC

View File

@ -24,18 +24,6 @@ INCLUDE "res/gameplay_data.inc"
INCLUDE "res/gameplay_big_data.inc"
DEF MODE_LEADY EQU 0
DEF MODE_GO EQU 3
DEF MODE_POSTGO EQU 6
DEF MODE_PREFETCHED_PIECE EQU 9
DEF MODE_SPAWN_PIECE EQU 12
DEF MODE_PIECE_IN_MOTION EQU 15
DEF MODE_DELAY EQU 18
DEF MODE_GAME_OVER EQU 21
DEF MODE_PRE_GAME_OVER EQU 24
DEF MODE_PAUSED EQU 27
SECTION "High Gameplay Variables", HRAM
hCurrentPiece:: ds 1
hCurrentPieceX:: ds 1
@ -43,7 +31,7 @@ hCurrentPieceY:: ds 1
hCurrentPieceRotationState:: ds 1
hHeldPiece:: ds 1
hHoldSpent:: ds 1
hMode: ds 1
hMode:: ds 1
hModeCounter: ds 1
hPrePause: ds 1
hRequestedJingle: ds 1

View File

@ -98,6 +98,14 @@ HandleTimers::
and 1
ldh [hEvenFrame], a
ldh a, [hMode]
cp a, MODE_PAUSED
ret z
cp a, MODE_GAME_OVER
ret z
cp a, MODE_PRE_GAME_OVER
ret z
ld a, [wFrames]
inc a
ld [wFrames], a