Skip to content

Commit

Permalink
hLCDCPointer and InitList
Browse files Browse the repository at this point in the history
  • Loading branch information
PikalaxALT committed Jun 14, 2016
1 parent ca01a92 commit 4e2487c
Show file tree
Hide file tree
Showing 20 changed files with 103 additions and 101 deletions.
60 changes: 30 additions & 30 deletions battle/bg_effects.asm
Expand Up @@ -933,7 +933,7 @@ BattleBGEffect_Surf: ; c8545 (32:4545)
call InitSurfWaves

.one
ld a, [hFFC6]
ld a, [hLCDCPointer]
and a
ret z
push bc
Expand Down Expand Up @@ -997,8 +997,8 @@ BattleBGEffect_Whirlpool: ; c8599 (32:4599)
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $42
ld [hFFC6], a
ld a, rSCY - $ff00
ld [hLCDCPointer], a
xor a
ld [hLYOverrideStart], a
ld a, $5e
Expand All @@ -1017,7 +1017,7 @@ BattleBGEffect_Whirlpool: ; c8599 (32:4599)

BattleBGEffect_30: ; c85c2 (32:45c2)
call BattleBGEffects_ClearLYOverrides
ld a, $42
ld a, rSCY - $ff00
call BattleBGEffect_SetLCDStatCustoms1
call EndBattleBGEffect
ret
Expand Down Expand Up @@ -1071,8 +1071,8 @@ BattleBGEffect_Psychic: ; c8607 (32:4607)
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
ld [hFFC6], a
ld a, rSCX - $ff00
ld [hLCDCPointer], a
xor a
ld [hLYOverrideStart], a
ld a, $5f
Expand Down Expand Up @@ -1109,7 +1109,7 @@ BattleBGEffect_Teleport: ; c863f (32:463f)
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
ld a, rSCX - $ff00
call BattleBGEffect_SetLCDStatCustoms1
lb de, 6, 5
call Functionc8f2e
Expand All @@ -1134,7 +1134,7 @@ BattleBGEffect_NightShade: ; c8662 (32:4662)
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $42
ld a, rSCY - $ff00
call BattleBGEffect_SetLCDStatCustoms1
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
Expand Down Expand Up @@ -1165,7 +1165,7 @@ BattleBGEffect_DoubleTeam: ; c8689 (32:4689)
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
ld a, rSCX - $ff00
call BattleBGEffect_SetLCDStatCustoms1
ld a, [hLYOverrideEnd]
inc a
Expand Down Expand Up @@ -1257,7 +1257,7 @@ BattleBGEffect_AcidArmor: ; c8709 (32:4709)
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $42
ld a, rSCY - $ff00
call BattleBGEffect_SetLCDStatCustoms1
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
Expand Down Expand Up @@ -1320,7 +1320,7 @@ BattleBGEffect_Withdraw: ; c8761 (32:4761)
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $42
ld a, rSCY - $ff00
call BattleBGEffect_SetLCDStatCustoms1
ld a, [hLYOverrideEnd]
inc a
Expand Down Expand Up @@ -1370,7 +1370,7 @@ BattleBGEffect_Dig: ; c87a7 (32:47a7)
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $42
ld a, rSCY - $ff00
call BattleBGEffect_SetLCDStatCustoms1
ld a, [hLYOverrideEnd]
inc a
Expand Down Expand Up @@ -1437,7 +1437,7 @@ BattleBGEffect_Tackle: ; c8805 (32:4805)
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
ld a, rSCX - $ff00
call BattleBGEffect_SetLCDStatCustoms1
ld a, [hLYOverrideEnd]
inc a
Expand Down Expand Up @@ -1472,7 +1472,7 @@ BattleBGEffect_25: ; c8837 (32:4837)
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
ld a, rSCX - $ff00
call BattleBGEffect_SetLCDStatCustoms2
ld a, [hLYOverrideEnd]
inc a
Expand Down Expand Up @@ -1604,7 +1604,7 @@ BattleBGEffect_2d: ; c88e7 (32:48e7)
BGEffect2d_2f_zero:
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
ld a, rSCX - $ff00
call BattleBGEffect_SetLCDStatCustoms1
ld a, [hLYOverrideEnd]
inc a
Expand Down Expand Up @@ -1648,7 +1648,7 @@ BattleBGEffect_26: ; c892a (32:492a)
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
ld a, rSCX - $ff00
call BattleBGEffect_SetLCDStatCustoms1
ld a, [hLYOverrideEnd]
inc a
Expand Down Expand Up @@ -1687,7 +1687,7 @@ BattleBGEffect_2c: ; c8964 (32:4964)
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
ld a, rSCX - $ff00
call BattleBGEffect_SetLCDStatCustoms1
ld a, [hLYOverrideEnd]
inc a
Expand Down Expand Up @@ -1742,7 +1742,7 @@ BattleBGEffect_28: ; c89b5 (32:49b5)
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
ld a, rSCX - $ff00
call BattleBGEffect_SetLCDStatCustoms1
ret

Expand Down Expand Up @@ -1785,7 +1785,7 @@ BattleBGEffect_BounceDown: ; c89ee (32:49ee)
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $42
ld a, rSCY - $ff00
call BattleBGEffect_SetLCDStatCustoms2
ld a, [hLYOverrideEnd]
inc a
Expand Down Expand Up @@ -1944,7 +1944,7 @@ BattleBGEffect_2b: ; c8acc (32:4acc)
.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
ld a, rSCX - $ff00
call BattleBGEffect_SetLCDStatCustoms1
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
add hl, bc
Expand Down Expand Up @@ -1986,8 +1986,8 @@ BattleBGEffect_1c: ; c8b00 (32:4b00)
call BattleBGEffects_IncrementJumptable
ld a, $e4
call BattleBGEffects_SetLYOverrides
ld a, $47
ld [hFFC6], a
ld a, rBGP - $ff00
ld [hLCDCPointer], a
xor a
ld [hLYOverrideStart], a
ld a, $60
Expand Down Expand Up @@ -2221,7 +2221,7 @@ BattleBGEffect_VibrateMon: ; c8c61 (32:4c61)
.zero ; c8c68 (32:4c68)
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
ld a, rSCX - $ff00
call BattleBGEffect_SetLCDStatCustoms1
ld a, [hLYOverrideEnd]
inc a
Expand Down Expand Up @@ -2267,8 +2267,8 @@ BattleBGEffect_WobbleMon: ; c8ca2 (32:4ca2)
.zero ; c8cab (32:4cab)
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
ld [hFFC6], a
ld a, rSCX - $ff00
ld [hLCDCPointer], a
xor a
ld [hLYOverrideStart], a
ld a, $37
Expand Down Expand Up @@ -2655,7 +2655,7 @@ BattleBGEffect_GetNextDMGPal: ; c8eb2 (32:4eb2)
BattleBGEffects_ClearLYOverrides: ; c8eca (32:4eca)
xor a
BattleBGEffects_SetLYOverrides: ; c8ecb (32:4ecb)
ld hl, LYOverrides ; wd100
ld hl, LYOverrides ; wListPointer
ld e, $99
.loop1
ld [hli], a
Expand All @@ -2670,7 +2670,7 @@ BattleBGEffects_SetLYOverrides: ; c8ecb (32:4ecb)
ret

BattleBGEffect_SetLCDStatCustoms1: ; c8ede (32:4ede)
ld [hFFC6], a
ld [hLCDCPointer], a
call BGEffect_CheckBattleTurn
jr nz, .player_turn
lb de, $00, $36
Expand All @@ -2686,7 +2686,7 @@ BattleBGEffect_SetLCDStatCustoms1: ; c8ede (32:4ede)
ret

BattleBGEffect_SetLCDStatCustoms2: ; c8ef4 (32:4ef4)
ld [hFFC6], a
ld [hLCDCPointer], a
call BGEffect_CheckBattleTurn
jr nz, .player_turn
lb de, $00, $36
Expand All @@ -2707,13 +2707,13 @@ BattleAnim_ResetLCDStatCustom: ; c8f0a (32:4f0a)
ld [hLYOverrideEnd], a
call BattleBGEffects_ClearLYOverrides
xor a
ld [hFFC6], a
ld [hLCDCPointer], a
call EndBattleBGEffect
ret

BattleBGEffects_ResetVideoHRAM: ; c8f19 (32:4f19)
xor a
ld [hFFC6], a
ld [hLCDCPointer], a
ld a, %11100100
ld [rBGP], a
ld [wBGP], a
Expand Down
1 change: 0 additions & 1 deletion battle/core.asm
Expand Up @@ -5124,7 +5124,6 @@ BattleMenu: ; 3e139
jr z, .skip_dude_pack_select
callba _DudeAutoInput_DownA
.skip_dude_pack_select

call LoadBattleMenu2
ret c

Expand Down
6 changes: 3 additions & 3 deletions battle/objects/functions.asm
Expand Up @@ -1150,8 +1150,8 @@ BattleAnimFunction_0D: ; cd66a (33:566a)
dw .four
.zero
call BattleAnim_IncAnonJumptableIndex
ld a, $42
ld [hFFC6], a
ld a, rSCY - $ff00
ld [hLCDCPointer], a
ld a, $58
ld [hLYOverrideStart], a
ld a, $5e
Expand Down Expand Up @@ -1209,7 +1209,7 @@ BattleAnimFunction_0D: ; cd66a (33:566a)
cp $70
jr c, asm_cd6da
xor a
ld [hFFC6], a
ld [hLCDCPointer], a
ld [hLYOverrideStart], a
ld [hLYOverrideEnd], a
.four
Expand Down
4 changes: 2 additions & 2 deletions battle/sliding_intro.asm
Expand Up @@ -5,10 +5,10 @@ BattleIntroSlidingPics: ; 4e980
ld [rSVBK], a
call .subfunction1
ld a, rSCX - $ff00
ld [hFFC6], a
ld [hLCDCPointer], a
call .subfunction2
xor a
ld [hFFC6], a
ld [hLCDCPointer], a
pop af
ld [rSVBK], a
ret
Expand Down
6 changes: 6 additions & 0 deletions constants/misc_constants.asm
Expand Up @@ -253,3 +253,9 @@ FISHSWARM_REMORAID EQU 2
const FISHGROUP_QWILFISH
const FISHGROUP_REMORAID
const FISHGROUP_QWILFISH_NO_SWARM

INIT_ENEMYOT_LIST EQU 1
INIT_BAG_ITEM_LIST EQU 2
INIT_OTHER_ITEM_LIST EQU 3
INIT_PLAYEROT_LIST EQU 4
INIT_MON_LIST EQU 5
6 changes: 3 additions & 3 deletions engine/battle_start.asm
Expand Up @@ -39,7 +39,7 @@ Predef_StartBattle: ; 8c20f
call DmgToCgbBGPals
call DelayFrame
xor a
ld [hFFC6], a
ld [hLCDCPointer], a
ld [hLYOverrideStart], a
ld [hLYOverrideEnd], a
ld [hSCY], a
Expand Down Expand Up @@ -302,8 +302,8 @@ StartTrainerBattle_SetUpForWavyOutro: ; 8c3e8 (23:43e8)

call StartTrainerBattle_NextScene

ld a, $43
ld [hFFC6], a
ld a, rSCX - $ff00
ld [hLCDCPointer], a
xor a
ld [hLYOverrideStart], a
ld a, $90
Expand Down
4 changes: 2 additions & 2 deletions engine/credits.asm
Expand Up @@ -183,7 +183,7 @@ Credits:: ; 109847
call ByteFill

ld a, rSCX - $ff00
ld [hFFC6], a
ld [hLCDCPointer], a

call GetCreditsPalette
call SetPalettes
Expand Down Expand Up @@ -211,7 +211,7 @@ Credits:: ; 109847
.exit_credits
call ClearBGPalettes
xor a
ld [hFFC6], a
ld [hLCDCPointer], a
ld [hBGMapAddress], a
pop af
ld [hVBlank], a
Expand Down
10 changes: 5 additions & 5 deletions engine/crystal_intro.asm
Expand Up @@ -621,7 +621,7 @@ IntroScene5: ; e4a7a (39:4a7a)
call ClearTileMap
xor a
ld [hBGMapMode], a
ld [hFFC6], a
ld [hLCDCPointer], a
ld a, $1
ld [rVBK], a
ld hl, IntroTilemap005
Expand Down Expand Up @@ -815,7 +815,7 @@ IntroScene8: ; e4bd3 (39:4bd3)
IntroScene9: ; e4c04 (39:4c04)
; Set up the next scene (same bg).
xor a
ld [hFFC6], a
ld [hLCDCPointer], a
call ClearSprites
hlcoord 0, 0, AttrMap
; first 12 rows have palette 1
Expand Down Expand Up @@ -889,7 +889,7 @@ IntroScene11: ; e4c86 (39:4c86)
call ClearTileMap
xor a
ld [hBGMapMode], a
ld [hFFC6], a
ld [hLCDCPointer], a
ld a, $1
ld [rVBK], a
ld hl, IntroTilemap007
Expand Down Expand Up @@ -2093,8 +2093,8 @@ Intro_ResetLYOverrides: ; e5516 (39:5516)

pop af
ld [rSVBK], a
ld a, $43
ld [hFFC6], a
ld a, rSCX - $ff00
ld [hLCDCPointer], a
ret

Intro_PerspectiveScrollBG: ; e552f (39:552f)
Expand Down
4 changes: 2 additions & 2 deletions engine/events_3.asm
Expand Up @@ -55,7 +55,7 @@ ReturnFromMapSetupScript:: ; b8000
ld [rWY], a
ld [hWY], a
xor a
ld [hFFC6], a
ld [hLCDCPointer], a
ret
; b8064

Expand Down Expand Up @@ -126,7 +126,7 @@ PlaceMapNameSign:: ; b8098 (2e:4098)
ld [rWY], a
ld [hWY], a
xor a
ld [hFFC6], a
ld [hLCDCPointer], a
ret


Expand Down

0 comments on commit 4e2487c

Please sign in to comment.