summaryrefslogtreecommitdiff
path: root/engine/bank3c
diff options
context:
space:
mode:
authorluckytyphlosion <alan.rj.huang@gmail.com>2015-12-31 15:24:54 -0500
committerluckytyphlosion <alan.rj.huang@gmail.com>2015-12-31 15:24:54 -0500
commit94eee4e89ef5c0857599c2951befee9dc709ae85 (patch)
tree463218b7b459d0f1d90f0e488cd026e7a2da27dc /engine/bank3c
parentd3cd6e1e1a64a0093128918f9e02a79dc6d510cb (diff)
Cleanup with yellow-exclusive banks
Also introduce charmap for $ec (unfilled menu arrow cursor)
Diffstat (limited to 'engine/bank3c')
-rw-r--r--engine/bank3c/main.asm279
-rw-r--r--engine/bank3c/overworld.asm241
2 files changed, 0 insertions, 520 deletions
diff --git a/engine/bank3c/main.asm b/engine/bank3c/main.asm
deleted file mode 100644
index 468a6412..00000000
--- a/engine/bank3c/main.asm
+++ /dev/null
@@ -1,279 +0,0 @@
-PlayPikachuSoundClip:: ; f0000 (3c:4000)
- ld a, e
- ld e, a
- ld d, $0
- ld hl, PikachuCriesPointerTable
- add hl, de
- add hl, de
- add hl, de
- ld b, [hl] ; bank of pikachu cry data
- inc hl
- ld a, [hli] ; cry data pointer
- ld h, [hl]
- ld l, a
- ld c, $4
-.loop
- dec c
- jr z, .asm_f0019
- call DelayFrame
- jr .loop
-.asm_f0019
- di
- push bc
- push hl
- ld a, $80
- ld [rNR52], a
- ld a, $77
- ld [rNR50], a
- xor a
- ld [rNR30], a
- ld hl, $ff30 ; wave data
- ld de, wRedrawRowOrColumnSrcTiles
-.saveWaveDataLoop
- ld a, [hl]
- ld [de], a
- inc de
- ld a, $ff
- ld [hli], a
- ld a, l
- cp $40 ; end of wave data
- jr nz, .saveWaveDataLoop
- ld a, $80
- ld [rNR30], a
- ld a, [rNR51]
- or $44
- ld [rNR51], a
- ld a, $ff
- ld [rNR31], a
- ld a, $20
- ld [rNR32], a
- ld a, $ff
- ld [rNR33], a
- ld a, $87
- ld [rNR34], a
- pop hl
- pop bc
- call PlayPikachuPCM
- xor a
- ld [wc0f3], a
- ld [wc0f4], a
- ld a, $80
- ld [rNR52], a
- xor a
- ld [rNR30], a
- ld hl, $ff30
- ld de, wRedrawRowOrColumnSrcTiles
-.reloadWaveDataLoop
- ld a, [de]
- inc de
- ld [hli], a
- ld a, l
- cp $40 ; end of wave data
- jr nz, .reloadWaveDataLoop
- ld a, $80
- ld [rNR30], a
- ld a, [rNR51]
- and $bb
- ld [rNR51], a
- xor a
- ld [wChannelSoundIDs+CH4], a
- ld [wChannelSoundIDs+CH5], a
- ld [wChannelSoundIDs+CH6], a
- ld [wChannelSoundIDs+CH7], a
- ld a, [H_LOADEDROMBANK]
- ei
- ret
-
-PikachuCriesPointerTable: ; f008e (3c:408e)
-; format:
-; db bank
-; dw pointer to cry
-
-; bank 21
- dbw BANK(PikachuCry1), PikachuCry1 ; 21:4000
- dbw BANK(PikachuCry2), PikachuCry2 ; 21:491a
- dbw BANK(PikachuCry3), PikachuCry3 ; 21:4fdc
- dbw BANK(PikachuCry4), PikachuCry4 ; 21:59ee
-
-; bank 22
- dbw BANK(PikachuCry5), PikachuCry5 ; 22:4000
- dbw BANK(PikachuCry6), PikachuCry6 ; 22:5042
- dbw BANK(PikachuCry7), PikachuCry7 ; 22:6254
-
-; bank 23
- dbw BANK(PikachuCry8), PikachuCry8 ; 23:4000
- dbw BANK(PikachuCry9), PikachuCry9 ; 23:50ca
- dbw BANK(PikachuCry10), PikachuCry10 ; 23:5e0c
-
-; bank 24
- dbw BANK(PikachuCry11), PikachuCry11 ; 24:4000
- dbw BANK(PikachuCry12), PikachuCry12 ; 24:4722
- dbw BANK(PikachuCry13), PikachuCry13 ; 24:54a4
-
-; bank 25
- dbw BANK(PikachuCry14), PikachuCry14 ; 25:4000
- dbw BANK(PikachuCry15), PikachuCry15 ; 25:589a
-
-; banks 31-34, in no particular order
-
- dbw BANK(PikachuCry16), PikachuCry16 ; 31:4000
- dbw BANK(PikachuCry17), PikachuCry17 ; 34:4000
- dbw BANK(PikachuCry18), PikachuCry18 ; 31:549a
- dbw BANK(PikachuCry19), PikachuCry19 ; 33:4000
- dbw BANK(PikachuCry20), PikachuCry20 ; 32:4000
- dbw BANK(PikachuCry21), PikachuCry21 ; 32:6002
- dbw BANK(PikachuCry22), PikachuCry22 ; 31:63a4
- dbw BANK(PikachuCry23), PikachuCry23 ; 34:4862
- dbw BANK(PikachuCry24), PikachuCry24 ; 33:5632
- dbw BANK(PikachuCry25), PikachuCry25 ; 34:573c
- dbw BANK(PikachuCry26), PikachuCry26 ; 33:725c
-
-; bank 35
- dbw BANK(PikachuCry27), PikachuCry27 ; 35:4000
- dbw BANK(PikachuCry28), PikachuCry28 ; 35:4b5a
- dbw BANK(PikachuCry29), PikachuCry29 ; 35:5da4
- dbw BANK(PikachuCry30), PikachuCry30 ; 35:69ce
- dbw BANK(PikachuCry31), PikachuCry31 ; 35:6e80
-
-; bank 36
- dbw BANK(PikachuCry32), PikachuCry32 ; 36:4000
- dbw BANK(PikachuCry33), PikachuCry33 ; 36:458a
- dbw BANK(PikachuCry34), PikachuCry34 ; 36:523c
-
-; bank 37
- dbw BANK(PikachuCry35), PikachuCry35 ; 37:4000
- dbw BANK(PikachuCry36), PikachuCry36 ; 37:522a
-
-; banks 36-38
- dbw BANK(PikachuCry37), PikachuCry37 ; 38:4000
- dbw BANK(PikachuCry38), PikachuCry38 ; 38:4dfa
- dbw BANK(PikachuCry39), PikachuCry39 ; 37:6e0c
- dbw BANK(PikachuCry40), PikachuCry40 ; 38:5a64
- dbw BANK(PikachuCry41), PikachuCry41 ; 36:6746
- dbw BANK(PikachuCry42), PikachuCry42 ; 38:6976
-
-INCLUDE "engine/bank3c/overworld.asm"
-
-ResetStatusAndHalveMoneyOnBlackout:: ; f0274 (3c:4274)
-; Reset player status on blackout.
- xor a
- ld [wd435],a
- xor a ; gamefreak copypasting functions (double xor a)
- ld [wBattleResult], a
- ld [wWalkBikeSurfState], a
- ld [wIsInBattle], a
- ld [wMapPalOffset], a
- ld [wNPCMovementScriptFunctionNum], a
- ld [hJoyHeld], a
- ld [wNPCMovementScriptPointerTableNum], a
- ld [wFlags_0xcd60], a
-
- ld [$ff9f], a
- ld [$ff9f + 1], a
- ld [$ff9f + 2], a
- call HasEnoughMoney
- jr c, .lostmoney ; never happens
-
- ; Halve the player's money.
- ld a, [wPlayerMoney]
- ld [$ff9f], a
- ld a, [wPlayerMoney + 1]
- ld [$ff9f + 1], a
- ld a, [wPlayerMoney + 2]
- ld [$ff9f + 2], a
- xor a
- ld [$ffa2], a
- ld [$ffa3], a
- ld a, 2
- ld [$ffa4], a
- predef DivideBCDPredef3
- ld a, [$ffa2]
- ld [wPlayerMoney], a
- ld a, [$ffa2 + 1]
- ld [wPlayerMoney + 1], a
- ld a, [$ffa2 + 2]
- ld [wPlayerMoney + 2], a
-
-.lostmoney
- ld hl, wd732
- set 2, [hl]
- res 3, [hl]
- set 6, [hl]
- ld a, %11111111
- ld [wJoyIgnore], a
- predef_jump HealParty
-
-Func_f02da:: ; f02da (3c:42da)
- ld a,[wCurMap]
- cp VERMILION_GYM ; ??? new thing about verm gym?
- jr z,.asm_f02ee
- ld c,a
- ld hl,Pointer_f02fa
-.asm_f02e5
- ld a,[hli]
- cp c
- jr z,.asm_f02f4
- cp a,$ff
- jr nz,.asm_f02e5
- ret
-.asm_f02ee
- ld hl,wd126
- set 6,[hl]
- ret
-.asm_f02f4
- ld hl,wd126
- set 5,[hl]
- ret
-
-Pointer_f02fa:: ; f02fa (3c:42fa)
- db $cf,$d0,$d1,$d2,$d3,$d4
- db $d5,$e9,$ea,$eb,$d6,$d7
- db $d8,$a5,$a6,$87,$c7,$ca
- db $c6,$6c,$c2,$71,$f5,$f6
- db $f7,$ff
-
-BeachHouse_GFX:: ; f0314 (3c:4314)
- INCBIN "gfx/tilesets/beachhouse.2bpp"
-
-BeachHouse_Block:: ; f0914 (3c:4914)
- INCBIN "gfx/blocksets/beachhouse.bst"
-
-Func_f0a54:: ; f0a54 (3c:4a54)
- ret
-
-Func_f0a55:: ; f0a55 (3c:4a55)
- ld hl,Pointer_f0a76 ; 3c:4a76
-.loop
- ld a,[hli]
- cp a,$ff
- ret z
- ld b,a
- ld a,[wCurMap]
- cp b
- jr z,.asm_f0a68
- inc hl
- inc hl
- inc hl
- jr .loop
-
-.asm_f0a68
- ld a,[hli]
- ld c,a
- ld b,$0
- ld a,[hli]
- ld h,[hl]
- ld l,a
- ld de,wMissableObjectList
- call CopyData
- ret
-
-Pointer_f0a76:: ; f0a76 (3c:4a76)
- db $27,$07,$7b,$4a,$ff
- db $01,$ec,$02,$ed,$03,$ee,$ff
-
- dr $f0a82,$f220e
-BeachHouse_h: ; f220e (3c:620e)
-;INCLUDE "data/mapHeaders/beach_house.asm"
- dr $f220e,$f25f8
-CheckForHiddenObject:: ; f25f8 (3c:65f8)
- dr $f25f8,$f4000 \ No newline at end of file
diff --git a/engine/bank3c/overworld.asm b/engine/bank3c/overworld.asm
deleted file mode 100644
index e02fb129..00000000
--- a/engine/bank3c/overworld.asm
+++ /dev/null
@@ -1,241 +0,0 @@
-_AdvancePlayerSprite:: ; f010c (3c:410c)
- ld a,[wSpriteStateData1 + 3] ; delta Y
- ld b,a
- ld a,[wSpriteStateData1 + 5] ; delta X
- ld c,a
- ld hl,wWalkCounter ; walking animation counter
- dec [hl]
- jr nz,.afterUpdateMapCoords
-; if it's the end of the animation, update the player's map coordinates
- ld hl, wd430
- res 5, [hl]
- ld a,[wYCoord]
- add b
- ld [wYCoord],a
- ld a,[wXCoord]
- add c
- ld [wXCoord],a
-.afterUpdateMapCoords
- ld a,[wWalkCounter] ; walking animation counter
- cp a,$07
- jp nz,.scrollBackgroundAndSprites
-; if this is the first iteration of the animation
- ld a,c
- cp a,$01
- jr nz,.checkIfMovingWest
-; moving east
- ld a,[wMapViewVRAMPointer]
- ld e,a
- and $e0
- ld d,a
- ld a,e
- add $02
- and $1f
- or d
- ld [wMapViewVRAMPointer],a
- jr .adjustXCoordWithinBlock
-.checkIfMovingWest
- cp a,$ff
- jr nz,.checkIfMovingSouth
-; moving west
- ld a,[wMapViewVRAMPointer]
- ld e,a
- and a,$e0
- ld d,a
- ld a,e
- sub $02
- and $1f
- or d
- ld [wMapViewVRAMPointer],a
- jr .adjustXCoordWithinBlock
-.checkIfMovingSouth
- ld a,b
- cp a,$01
- jr nz,.checkIfMovingNorth
-; moving south
- ld a,[wMapViewVRAMPointer]
- add $40
- ld [wMapViewVRAMPointer],a
- jr nc,.adjustXCoordWithinBlock
- ld a,[wMapViewVRAMPointer + 1]
- inc a
- and $03
- or $98
- ld [wMapViewVRAMPointer + 1],a
- jr .adjustXCoordWithinBlock
-.checkIfMovingNorth
- cp a,$ff
- jr nz,.adjustXCoordWithinBlock
-; moving north
- ld a,[wMapViewVRAMPointer]
- sub $40
- ld [wMapViewVRAMPointer],a
- jr nc,.adjustXCoordWithinBlock
- ld a,[wMapViewVRAMPointer + 1]
- dec a
- and $03
- or $98
- ld [wMapViewVRAMPointer + 1],a
-.adjustXCoordWithinBlock
- ld a,c
- and a
- jr z,.pointlessJump ; mistake?
-.pointlessJump
- ld hl,wXBlockCoord
- ld a,[hl]
- add c
- ld [hl],a
- cp $02
- jr nz,.checkForMoveToWestBlock
-; moved into the tile block to the east
- xor a
- ld [hl],a
- ld hl,wXOffsetSinceLastSpecialWarp
- inc [hl]
- ld de,wCurrentTileBlockMapViewPointer
- call MoveTileBlockMapPointerEast
- jr .updateMapView
-.checkForMoveToWestBlock
- cp a,$ff
- jr nz,.adjustYCoordWithinBlock
-; moved into the tile block to the west
- ld a,$1
- ld [hl],a
- ld hl,wXOffsetSinceLastSpecialWarp
- dec [hl]
- ld de,wCurrentTileBlockMapViewPointer
- call MoveTileBlockMapPointerWest
- jr .updateMapView
-.adjustYCoordWithinBlock
- ld hl,wYBlockCoord
- ld a,[hl]
- add b
- ld [hl],a
- cp $2
- jr nz,.checkForMoveToNorthBlock
-; moved into the tile block to the south
- xor a
- ld [hl],a
- ld hl,wYOffsetSinceLastSpecialWarp
- inc [hl]
- ld de,wCurrentTileBlockMapViewPointer
- ld a,[wCurMapWidth]
- call MoveTileBlockMapPointerSouth
- jr .updateMapView
-.checkForMoveToNorthBlock
- cp a,$ff
- jr nz,.updateMapView
-; moved into the tile block to the north
- ld a,$1
- ld [hl],a
- ld hl,wYOffsetSinceLastSpecialWarp
- dec [hl]
- ld de,wCurrentTileBlockMapViewPointer
- ld a,[wCurMapWidth]
- call MoveTileBlockMapPointerNorth
-.updateMapView
- call LoadCurrentMapView
- ld a,[wSpriteStateData1 + 3] ; delta Y
- cp $1
- jr nz,.checkIfMovingNorth2
-; if moving south
- call ScheduleSouthRowRedraw
- jr .scrollBackgroundAndSprites
-.checkIfMovingNorth2
- cp $ff
- jr nz,.checkIfMovingEast2
-; if moving north
- call ScheduleNorthRowRedraw
- jr .scrollBackgroundAndSprites
-.checkIfMovingEast2
- ld a,[wSpriteStateData1 + 5] ; delta X
- cp $1
- jr nz,.checkIfMovingWest2
-; if moving east
- call ScheduleEastColumnRedraw
- jr .scrollBackgroundAndSprites
-.checkIfMovingWest2
- cp $ff
- jr nz,.scrollBackgroundAndSprites
-; if moving west
- call ScheduleWestColumnRedraw
-.scrollBackgroundAndSprites
- ld a,[wSpriteStateData1 + 3] ; delta Y
- add a
- ld b,a
- ld a,[wSpriteStateData1 + 5] ; delta X
- add a
- ld c,a
-; shift all the sprites in the direction opposite of the player's motion
-; so that the player appears to move relative to them
- ld hl,wSpriteStateData1 + $14
- ld e,15
-.spriteShiftLoop
- ld a,[hl]
- sub b
- ld [hli],a
- inc l
- ld a,[hl]
- sub c
- ld [hl],a
- ld a,$0e
- add l
- ld l,a
- dec e
- jr nz,.spriteShiftLoop
-.done
- ld a,[hSCY]
- add b
- ld [hSCY],a ; update background scroll Y
- ld a,[hSCX]
- add c
- ld [hSCX],a ; update background scroll X
- ret
-
-MoveTileBlockMapPointerEast:: ; f0248 (3c:4248)
- ld a,[de]
- add $1
- ld [de],a
- ret nc
- inc de
- ld a,[de]
- inc a
- ld [de],a
- ret
-
-MoveTileBlockMapPointerWest:: ; f0252 (3c:4252)
- ld a,[de]
- sub $1
- ld [de],a
- ret nc
- inc de
- ld a,[de]
- dec a
- ld [de],a
- ret
-
-MoveTileBlockMapPointerSouth:: ; f025c (3c:425c)
- add $6
- ld b,a
- ld a,[de]
- add b
- ld [de],a
- ret nc
- inc de
- ld a,[de]
- inc a
- ld [de],a
- ret
-
-MoveTileBlockMapPointerNorth:: ; f0268 (3c:4268)
- add $6
- ld b,a
- ld a,[de]
- sub b
- ld [de],a
- ret nc
- inc de
- ld a,[de]
- dec a
- ld [de],a
- ret \ No newline at end of file