Skip to content

Commit

Permalink
Crystal-only jumptable exit bits
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Dec 2, 2024
1 parent e1e7cbd commit 41045d0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions engine/events/battle_tower/battle_tower.asm
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ Function1704e1:
.loop
call JoyTextDelay
ld a, [wJumptableIndex]
bit 7, a
bit JUMPTABLE_EXIT_F, a
jr nz, .done
call .DoJumptable
farcall HDMATransferTilemapAndAttrmap_Overworld
Expand Down Expand Up @@ -693,7 +693,7 @@ Function1704e1:

.pressed_a_or_b
ld hl, wJumptableIndex
set 7, [hl]
set JUMPTABLE_EXIT_F, [hl]
ret

.NextJumptableFunction:
Expand Down
4 changes: 2 additions & 2 deletions engine/events/celebi.asm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CelebiShrineEvent:
ld d, $0
.loop
ld a, [wJumptableIndex]
bit 7, a
bit JUMPTABLE_EXIT_F, a
jr nz, .done
push bc
call GetCelebiSpriteTile
Expand Down Expand Up @@ -96,7 +96,7 @@ CelebiEvent_CountDown:

.done
ld hl, wJumptableIndex
set 7, [hl]
set JUMPTABLE_EXIT_F, [hl]
ret

CelebiEvent_SpawnLeaf: ; unreferenced
Expand Down
12 changes: 6 additions & 6 deletions engine/gfx/pic_animation.asm
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ SetUpPokeAnim:
pop af
ldh [rSVBK], a
ld a, c
and $80
and JUMPTABLE_EXIT
ret z
scf
ret
Expand Down Expand Up @@ -196,7 +196,7 @@ PokeAnim_Idle:
PokeAnim_Play:
call PokeAnim_DoAnimScript
ld a, [wPokeAnimJumptableIndex]
bit 7, a
bit JUMPTABLE_EXIT_F, a
ret z
call PokeAnim_PlaceGraphic
ld a, [wPokeAnimSceneIndex]
Expand All @@ -207,7 +207,7 @@ PokeAnim_Play:
PokeAnim_Play2:
call PokeAnim_DoAnimScript
ld a, [wPokeAnimJumptableIndex]
bit 7, a
bit JUMPTABLE_EXIT_F, a
ret z
ld a, [wPokeAnimSceneIndex]
inc a
Expand All @@ -224,7 +224,7 @@ PokeAnim_BasePic:
PokeAnim_Finish:
call PokeAnim_DeinitFrames
ld hl, wPokeAnimSceneIndex
set 7, [hl]
set JUMPTABLE_EXIT_F, [hl]
ret

PokeAnim_Cry:
Expand Down Expand Up @@ -358,7 +358,7 @@ PokeAnim_DoAnimScript:
ldh [hBGMapMode], a
.loop
ld a, [wPokeAnimJumptableIndex]
and $7f
and JUMPTABLE_INDEX_MASK
ld hl, .Jumptable
rst JumpTable
ret
Expand Down Expand Up @@ -407,7 +407,7 @@ PokeAnim_DoAnimScript:

PokeAnim_End:
ld hl, wPokeAnimJumptableIndex
set 7, [hl]
set JUMPTABLE_EXIT_F, [hl]
ret

PokeAnim_GetDuration:
Expand Down
2 changes: 1 addition & 1 deletion engine/overworld/map_objects.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2898,7 +2898,7 @@ InitSprites:
and ~(1 << 7)
ldh [hCurSpriteTile], a
xor a
bit 7, [hl]
bit 7, [hl] ; tiles $80+ are in VRAM bank 0
jr nz, .not_vram1
or VRAM_BANK_1
.not_vram1
Expand Down
10 changes: 5 additions & 5 deletions engine/pokemon/stats_screen.asm
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ StatsScreenMain:
rst JumpTable
call StatsScreen_WaitAnim
ld a, [wJumptableIndex]
bit 7, a
bit JUMPTABLE_EXIT_F, a
jr z, .loop
ret

Expand All @@ -97,14 +97,14 @@ StatsScreenMobile:
.loop
farcall Mobile_SetOverworldDelay
ld a, [wJumptableIndex]
and $7f
and JUMPTABLE_INDEX_MASK
ld hl, StatsScreenPointerTable
rst JumpTable
call StatsScreen_WaitAnim
farcall MobileComms_CheckInactivityTimer
jr c, .exit
ld a, [wJumptableIndex]
bit 7, a
bit JUMPTABLE_EXIT_F, a
jr z, .loop

.exit
Expand Down Expand Up @@ -142,14 +142,14 @@ StatsScreen_WaitAnim:

StatsScreen_SetJumptableIndex:
ld a, [wJumptableIndex]
and $80
and JUMPTABLE_EXIT
or h
ld [wJumptableIndex], a
ret

StatsScreen_Exit:
ld hl, wJumptableIndex
set 7, [hl]
set JUMPTABLE_EXIT_F, [hl]
ret

MonStatsInit:
Expand Down

0 comments on commit 41045d0

Please sign in to comment.