Skip to content

Commit

Permalink
Identify some unused WRAM variables (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 authored Jun 15, 2024
1 parent d38cf52 commit fc23e72
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 53 deletions.
4 changes: 2 additions & 2 deletions audio/engine_1.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ Audio1_PlaySound::

.playMusic
xor a
ld [wUnusedC000], a
ld [wUnusedMusicByte], a
ld [wDisableChannelOutputWhenSfxEnds], a
ld [wMusicTempo + 1], a
ld [wMusicWaveInstrument], a
Expand Down Expand Up @@ -1583,7 +1583,7 @@ Audio1_PlaySound::
ld a, $77
ldh [rNR50], a ; full volume
xor a
ld [wUnusedC000], a
ld [wUnusedMusicByte], a
ld [wDisableChannelOutputWhenSfxEnds], a
ld [wMuteAudioAndPauseMusic], a
ld [wMusicTempo + 1], a
Expand Down
4 changes: 2 additions & 2 deletions audio/engine_2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ Audio2_PlaySound::

.playMusic
xor a
ld [wUnusedC000], a
ld [wUnusedMusicByte], a
ld [wDisableChannelOutputWhenSfxEnds], a
ld [wMusicTempo + 1], a
ld [wMusicWaveInstrument], a
Expand Down Expand Up @@ -1646,7 +1646,7 @@ Audio2_PlaySound::
ld a, $77
ldh [rNR50], a ; full volume
xor a
ld [wUnusedC000], a
ld [wUnusedMusicByte], a
ld [wDisableChannelOutputWhenSfxEnds], a
ld [wMuteAudioAndPauseMusic], a
ld [wMusicTempo + 1], a
Expand Down
4 changes: 2 additions & 2 deletions audio/engine_3.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ Audio3_PlaySound::

.playMusic
xor a
ld [wUnusedC000], a
ld [wUnusedMusicByte], a
ld [wDisableChannelOutputWhenSfxEnds], a
ld [wMusicTempo + 1], a
ld [wMusicWaveInstrument], a
Expand Down Expand Up @@ -1583,7 +1583,7 @@ Audio3_PlaySound::
ld a, $77
ldh [rNR50], a ; full volume
xor a
ld [wUnusedC000], a
ld [wUnusedMusicByte], a
ld [wDisableChannelOutputWhenSfxEnds], a
ld [wMuteAudioAndPauseMusic], a
ld [wMusicTempo + 1], a
Expand Down
6 changes: 3 additions & 3 deletions engine/battle/animations.asm
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ MoveAnimation:
call WaitForSoundToFinish
xor a
ld [wSubAnimSubEntryAddr], a
ld [wUnusedD09B], a
ld [wUnusedMoveAnimByte], a
ld [wSubAnimTransform], a
dec a ; NO_MOVE - 1
ld [wAnimSoundID], a
Expand Down Expand Up @@ -1125,12 +1125,12 @@ AnimationWaterDropletsEverywhere:
ld a, 16
ld [wBaseCoordY], a
ld a, 0
ld [wUnusedD08A], a
ld [wUnusedWaterDropletsByte], a
call _AnimationWaterDroplets
ld a, 24
ld [wBaseCoordY], a
ld a, 32
ld [wUnusedD08A], a
ld [wUnusedWaterDropletsByte], a
call _AnimationWaterDroplets
dec d
jr nz, .loop
Expand Down
4 changes: 2 additions & 2 deletions engine/battle/misc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ InitList:
ld a, h
ld [wListPointer + 1], a
ld a, e
ld [wUnusedCF8D], a
ld [wUnusedNamePointer], a
ld a, d
ld [wUnusedCF8D + 1], a
ld [wUnusedNamePointer + 1], a
ld bc, ItemPrices
ld a, c
ld [wItemPrices], a
Expand Down
6 changes: 3 additions & 3 deletions engine/items/item_effects.asm
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ ItemUseSurfboard:
ld a, b
ld [wSimulatedJoypadStatesEnd], a
xor a
ld [wUnusedCD39], a
ld [wUnusedSimulatedJoypadStatesMask], a
inc a
ld [wSimulatedJoypadStatesIndex], a
ret
Expand Down Expand Up @@ -1553,7 +1553,7 @@ ItemUseXAccuracy:
; The Card Key is handled in a different way.
ItemUseCardKey:
xor a
ld [wUnusedD71F], a
ld [wUnusedCardKeyGateID], a
call GetTileAndCoordsInFrontOfPlayer
ld a, [GetTileAndCoordsInFrontOfPlayer]
cp $18
Expand Down Expand Up @@ -1585,7 +1585,7 @@ ItemUseCardKey:
cp e
jr nz, .nextEntry3
ld a, [hl]
ld [wUnusedD71F], a
ld [wUnusedCardKeyGateID], a
jr .done
.nextEntry1
inc hl
Expand Down
4 changes: 2 additions & 2 deletions engine/link/cable_club.asm
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ CableClub_DoBattleOrTradeAgain:
dec c
jr nz, .unpatchEnemyMonsLoop
ld a, LOW(wEnemyMonOT)
ld [wUnusedCF8D], a
ld [wUnusedNamePointer], a
ld a, HIGH(wEnemyMonOT)
ld [wUnusedCF8D + 1], a
ld [wUnusedNamePointer + 1], a
xor a
ld [wTradeCenterPointerTableIndex], a
ld a, SFX_STOP_ALL_MUSIC
Expand Down
2 changes: 1 addition & 1 deletion engine/menus/main_menu.asm
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ LinkMenu:
ld de, CableClubOptionsText
call PlaceString
xor a
ld [wUnusedCD37], a
ld [wUnusedLinkMenuByte], a
ld [wd72d], a
ld hl, wTopMenuItemY
ld a, $7
Expand Down
2 changes: 1 addition & 1 deletion engine/menus/pokedex.asm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ShowPokedexMenu:
ld [wCurrentMenuItem], a
ld [wLastMenuItem], a
ldh [hJoy7], a
ld [wUnusedCD3A], a
ld [wUnusedOverrideSimulatedJoypadStatesIndex], a
ld [wOverrideSimulatedJoypadStatesMask], a
pop af
ld [wListScrollOffset], a
Expand Down
2 changes: 1 addition & 1 deletion engine/movie/credits.asm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ HallOfFamePC:
ld c, 128
call DelayFrames
xor a
ld [wUnusedCD3D], a ; not read
ld [wUnusedCreditsByte], a ; not read
ld [wNumCreditsMonsDisplayed], a
jp Credits

Expand Down
2 changes: 1 addition & 1 deletion engine/movie/oak_speech/init_player_data.asm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ InitPlayerData2:
ld [wPlayerID + 1], a

ld a, $ff
ld [wUnusedD71B], a
ld [wUnusedPlayerDataByte], a

ld hl, wPartyCount
call InitializeEmptyList
Expand Down
4 changes: 2 additions & 2 deletions engine/overworld/auto_movement.asm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PlayerStepOutFromDoor::
ret
.notStandingOnDoor
xor a
ld [wUnusedCD3A], a
ld [wUnusedOverrideSimulatedJoypadStatesIndex], a
ld [wSimulatedJoypadStatesIndex], a
ld [wSimulatedJoypadStatesEnd], a
ld hl, wd736
Expand All @@ -39,7 +39,7 @@ _EndNPCMovementScript::
ld [wNPCMovementScriptSpriteOffset], a
ld [wNPCMovementScriptPointerTableNum], a
ld [wNPCMovementScriptFunctionNum], a
ld [wUnusedCD3A], a
ld [wUnusedOverrideSimulatedJoypadStatesIndex], a
ld [wSimulatedJoypadStatesIndex], a
ld [wSimulatedJoypadStatesEnd], a
ret
Expand Down
2 changes: 1 addition & 1 deletion engine/overworld/clear_variables.asm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ClearVariablesOnEnterMap::
ldh [hJoyReleased], a
ldh [hJoyHeld], a
ld [wActionResultOrTookBattleTurn], a
ld [wUnusedD5A3], a
ld [wUnusedMapVariable], a
ld hl, wCardKeyDoorY
ld [hli], a
ld [hl], a
Expand Down
2 changes: 1 addition & 1 deletion engine/overworld/movement.asm
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ UpdateNPCSprite:
res 0, [hl]
xor a
ld [wSimulatedJoypadStatesIndex], a
ld [wUnusedCD3A], a
ld [wUnusedOverrideSimulatedJoypadStatesIndex], a
ret
.next
cp WALK
Expand Down
2 changes: 1 addition & 1 deletion engine/pokemon/add_mon.asm
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ _AddPartyMon::
ld hl, wPokedexOwned
call FlagAction
ld a, c ; whether the mon was already flagged as owned
ld [wUnusedD153], a ; not read
ld [wUnusedAlreadyOwnedFlag], a
ld a, [wd11e]
dec a
ld c, a
Expand Down
4 changes: 2 additions & 2 deletions home/names2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ GetName::
call CopyData
.gotPtr
ld a, e
ld [wUnusedCF8D], a
ld [wUnusedNamePointer], a
ld a, d
ld [wUnusedCF8D + 1], a
ld [wUnusedNamePointer + 1], a
pop de
pop bc
pop hl
Expand Down
8 changes: 4 additions & 4 deletions home/overworld.asm
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ WarpFound2::
ld a, [wCurMap]
ld [wLastMap], a
ld a, [wCurMapWidth]
ld [wUnusedD366], a ; not read
ld [wUnusedLastMapWidth], a
ldh a, [hWarpDestinationMap]
ld [wCurMap], a
cp ROCK_TUNNEL_1F
Expand Down Expand Up @@ -1869,7 +1869,7 @@ JoypadOverworld::
; if done simulating button presses
.doneSimulating
xor a
ld [wUnusedCD3A], a
ld [wUnusedOverrideSimulatedJoypadStatesIndex], a
ld [wSimulatedJoypadStatesIndex], a
ld [wSimulatedJoypadStatesEnd], a
ld [wJoyIgnore], a
Expand Down Expand Up @@ -2011,7 +2011,7 @@ LoadPlayerSpriteGraphicsCommon::
LoadMapHeader::
farcall MarkTownVisitedAndLoadMissableObjects
ld a, [wCurMapTileset]
ld [wUnusedD119], a
ld [wUnusedCurMapTilesetCopy], a
ld a, [wCurMap]
call SwitchToMapRomBank
ld a, [wCurMapTileset]
Expand Down Expand Up @@ -2308,7 +2308,7 @@ LoadMapData::
ldh [hSCY], a
ldh [hSCX], a
ld [wWalkCounter], a
ld [wUnusedD119], a
ld [wUnusedCurMapTilesetCopy], a
ld [wWalkBikeSurfStateCopy], a
ld [wSpriteSetID], a
call LoadTextBoxTilePatterns
Expand Down
2 changes: 1 addition & 1 deletion home/pathfinding.asm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ MoveSprite_::
ld [wSimulatedJoypadStatesEnd], a
dec a
ld [wJoyIgnore], a
ld [wUnusedCD3A], a
ld [wUnusedOverrideSimulatedJoypadStatesIndex], a
ret

; divides [hDividend2] by [hDivisor2] and stores the quotient in [hQuotient2]
Expand Down
Loading

0 comments on commit fc23e72

Please sign in to comment.