More WRAM organization

This commit is contained in:
Remy Oukaour 2017-12-09 14:22:58 -05:00
parent 16c6696dd5
commit 5a5df2ab87
7 changed files with 418 additions and 448 deletions

View File

@ -70,25 +70,25 @@ DoMove: ; 3402c
; Start at the first command. ; Start at the first command.
ld hl, BattleScriptBuffer ld hl, BattleScriptBuffer
ld a, l ld a, l
ld [BattleScriptBufferLoc], a ld [BattleScriptBufferAddress], a
ld a, h ld a, h
ld [BattleScriptBufferLoc + 1], a ld [BattleScriptBufferAddress + 1], a
.ReadMoveEffectCommand: .ReadMoveEffectCommand:
; ld a, [BattleScriptBufferLoc++] ; ld a, [BattleScriptBufferAddress++]
ld a, [BattleScriptBufferLoc] ld a, [BattleScriptBufferAddress]
ld l, a ld l, a
ld a, [BattleScriptBufferLoc + 1] ld a, [BattleScriptBufferAddress + 1]
ld h, a ld h, a
ld a, [hli] ld a, [hli]
push af push af
ld a, l ld a, l
ld [BattleScriptBufferLoc], a ld [BattleScriptBufferAddress], a
ld a, h ld a, h
ld [BattleScriptBufferLoc + 1], a ld [BattleScriptBufferAddress + 1], a
pop af pop af
; endturn_command (-2) is used to terminate branches without ending the read cycle. ; endturn_command (-2) is used to terminate branches without ending the read cycle.
@ -2743,9 +2743,9 @@ BattleCommand_RageDamage: ; 3527b
EndMoveEffect: ; 352a3 EndMoveEffect: ; 352a3
ld a, [BattleScriptBufferLoc] ld a, [BattleScriptBufferAddress]
ld l, a ld l, a
ld a, [BattleScriptBufferLoc + 1] ld a, [BattleScriptBufferAddress + 1]
ld h, a ld h, a
ld a, $ff ld a, $ff
ld [hli], a ld [hli], a
@ -7097,9 +7097,9 @@ BattleCommand_EndLoop: ; 369b6
; Loop back to the command before 'critical'. ; Loop back to the command before 'critical'.
.loop_back_to_critical .loop_back_to_critical
ld a, [BattleScriptBufferLoc + 1] ld a, [BattleScriptBufferAddress + 1]
ld h, a ld h, a
ld a, [BattleScriptBufferLoc] ld a, [BattleScriptBufferAddress]
ld l, a ld l, a
.not_critical .not_critical
ld a, [hld] ld a, [hld]
@ -7107,9 +7107,9 @@ BattleCommand_EndLoop: ; 369b6
jr nz, .not_critical jr nz, .not_critical
inc hl inc hl
ld a, h ld a, h
ld [BattleScriptBufferLoc + 1], a ld [BattleScriptBufferAddress + 1], a
ld a, l ld a, l
ld [BattleScriptBufferLoc], a ld [BattleScriptBufferAddress], a
ret ret
; 36a82 ; 36a82
@ -9983,9 +9983,9 @@ BattleCommand_ClearText: ; 37e85
SkipToBattleCommand: ; 37e8c SkipToBattleCommand: ; 37e8c
; Skip over commands until reaching command b. ; Skip over commands until reaching command b.
ld a, [BattleScriptBufferLoc + 1] ld a, [BattleScriptBufferAddress + 1]
ld h, a ld h, a
ld a, [BattleScriptBufferLoc] ld a, [BattleScriptBufferAddress]
ld l, a ld l, a
.loop .loop
ld a, [hli] ld a, [hli]
@ -9993,9 +9993,9 @@ SkipToBattleCommand: ; 37e8c
jr nz, .loop jr nz, .loop
ld a, h ld a, h
ld [BattleScriptBufferLoc + 1], a ld [BattleScriptBufferAddress + 1], a
ld a, l ld a, l
ld [BattleScriptBufferLoc], a ld [BattleScriptBufferAddress], a
ret ret
; 37ea1 ; 37ea1

View File

@ -512,7 +512,7 @@ Pokedex_InitOptionScreen: ; 4039d (10:439d)
call ClearSprites call ClearSprites
call Pokedex_DrawOptionScreenBG call Pokedex_DrawOptionScreenBG
call Pokedex_InitArrowCursor call Pokedex_InitArrowCursor
ld a, [wCurrentDexMode] ld a, [wCurrentDexMode] ; Index of the topmost visible item in a scrolling menu ???
ld [wDexArrowCursorPosIndex], a ld [wDexArrowCursorPosIndex], a
call Pokedex_DisplayModeDescription call Pokedex_DisplayModeDescription
call WaitBGMap call WaitBGMap

View File

@ -100,7 +100,7 @@ TradeAnimationPlayer2: ; 28f63
tradeanim_end tradeanim_end
RunTradeAnimScript: ; 28fa1 RunTradeAnimScript: ; 28fa1
ld hl, wTradeAnimPointer ld hl, wTradeAnimAddress
ld [hl], e ld [hl], e
inc hl inc hl
ld [hl], d ld [hl], d
@ -294,7 +294,7 @@ TradeAnim_IncrementJumptableIndex: ; 2910f
; 29114 ; 29114
TradeAnim_AdvanceScriptPointer: ; 29114 TradeAnim_AdvanceScriptPointer: ; 29114
ld hl, wTradeAnimPointer ld hl, wTradeAnimAddress
ld e, [hl] ld e, [hl]
inc hl inc hl
ld d, [hl] ld d, [hl]

View File

@ -83,14 +83,14 @@ _GetFrontpic: ; 510a5
ld b, a ld b, a
push bc push bc
call GetFrontpicPointer call GetFrontpicPointer
ld a, BANK(wDecompressScratch) ld a, BANK(wDecompressEnemyFrontpic)
ld [rSVBK], a ld [rSVBK], a
ld a, b ld a, b
ld de, wDecompressScratch + $800 ld de, wDecompressEnemyFrontpic
call FarDecompress call FarDecompress
pop bc pop bc
ld hl, wDecompressScratch ld hl, wDecompressScratch
ld de, wDecompressScratch + $800 ld de, wDecompressEnemyFrontpic
call PadFrontpic call PadFrontpic
pop hl pop hl
push hl push hl
@ -149,15 +149,15 @@ GetAnimatedFrontpic: ; 51103
call GetFarWRAMByte call GetFarWRAMByte
pop hl pop hl
and $f and $f
ld de, w6_d800 + 5 * 5 tiles ld de, wDecompressEnemyFrontpic + 5 * 5 tiles
ld c, 5 * 5 ld c, 5 * 5
cp 5 cp 5
jr z, .got_dims jr z, .got_dims
ld de, w6_d800 + 6 * 6 tiles ld de, wDecompressEnemyFrontpic + 6 * 6 tiles
ld c, 6 * 6 ld c, 6 * 6
cp 6 cp 6
jr z, .got_dims jr z, .got_dims
ld de, w6_d800 + 7 * 7 tiles ld de, wDecompressEnemyFrontpic + 7 * 7 tiles
ld c, 7 * 7 ld c, 7 * 7
.got_dims .got_dims

View File

@ -1415,7 +1415,7 @@ LoadTileset:: ; 2821
ld a, $1 ld a, $1
ld [rVBK], a ld [rVBK], a
ld hl, w6_d600 ld hl, wDecompressScratch + $60 tiles
ld de, VTiles2 ld de, VTiles2
ld bc, $60 tiles ld bc, $60 tiles
call CopyBytes call CopyBytes

View File

@ -83,7 +83,7 @@ Function10804d: ; 10804d
mobiletradeanim_end mobiletradeanim_end
RunMobileTradeAnim_Frontpics: ; 10805b RunMobileTradeAnim_Frontpics: ; 10805b
ld hl, wTradeAnimPointer ld hl, wTradeAnimAddress
ld [hl], e ld [hl], e
inc hl inc hl
ld [hl], d ld [hl], d
@ -113,7 +113,7 @@ RunMobileTradeAnim_Frontpics: ; 10805b
; 108089 ; 108089
RunMobileTradeAnim_NoFrontpics: ; 108089 RunMobileTradeAnim_NoFrontpics: ; 108089
ld hl, wTradeAnimPointer ld hl, wTradeAnimAddress
ld [hl], e ld [hl], e
inc hl inc hl
ld [hl], d ld [hl], d
@ -411,7 +411,7 @@ MobileTradeAnim_Next: ; 1082b2
; 1082b7 ; 1082b7
GetMobileTradeAnimByte: ; 1082b7 GetMobileTradeAnimByte: ; 1082b7
ld hl, wTradeAnimPointer ld hl, wTradeAnimAddress
ld e, [hl] ld e, [hl]
inc hl inc hl
ld d, [hl] ld d, [hl]

806
wram.asm

File diff suppressed because it is too large Load Diff