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

View File

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

View File

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

View File

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

View File

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

View File

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

806
wram.asm

File diff suppressed because it is too large Load Diff