Refactor leftovers from #53

This commit is contained in:
earthoul 2026-01-27 18:00:39 +09:00
parent 324944f56d
commit 09162211bd
No known key found for this signature in database
GPG Key ID: 9049439C902677E4
3 changed files with 12 additions and 10 deletions

View File

@ -30,5 +30,3 @@ DEF NUM_GAME_EVENTS EQU const_value ; 6
const OWMODE_MUSIC_POSTLOAD ; $10
const OWMODE_AFTER_DUEL_PRELOAD ; $11
const OWMODE_PAUSE_MENU ; $12
; DEF NUM_OWMODES EQU const_value ; $13

View File

@ -1284,18 +1284,20 @@ Func_31447:
farcall ZeroOutVarValue
pop af
jr nz, .done
; cup winner, so switch the cup state from start to end/inactive
; by incrementing if cup 1, 2
; or by (verbosely) decremmenting if cup 3
; due to the constants' ordering
ld a, VAR_GR_CHALLENGE_CUP_STATE
farcall GetVarValue
cp CHALLENGE_CUP_3_START
jr z, .adjust
jr z, .won_cup3
inc a
ld c, a
ld a, VAR_GR_CHALLENGE_CUP_STATE
farcall SetVarValue
jr .done
; keep the state var < 7
; verbose: dec a between inc a :: ld c, a above should suffice
.adjust
.won_cup3
ld a, VAR_GR_CHALLENGE_CUP_STATE
ld c, CHALLENGE_CUP_3_UNLOCKED
farcall SetVarValue

View File

@ -2326,18 +2326,20 @@ Func_3d210:
farcall ZeroOutVarValue
pop af
jr nz, .done
; cup winner, so switch the cup state from start to end
; by incrementing if cup 1, 2
; or by (verbosely) decremmenting if cup 3
; due to the constants' ordering
ld a, VAR_TCG_CHALLENGE_CUP_STATE
farcall GetVarValue
cp CHALLENGE_CUP_3_START
jr z, .adjust
jr z, .won_cup3
inc a
ld c, a
ld a, VAR_TCG_CHALLENGE_CUP_STATE
farcall SetVarValue
jr .done
; keep the state var < 7
; verbose: dec a between inc a :: ld c, a above should suffice
.adjust
.won_cup3
ld a, VAR_TCG_CHALLENGE_CUP_STATE
ld c, CHALLENGE_CUP_3_UNLOCKED
farcall SetVarValue