Further WRAM organization

This commit is contained in:
Remy Oukaour
2017-12-09 15:14:51 -05:00
parent 5a5df2ab87
commit e3c686f6df
13 changed files with 211 additions and 323 deletions

View File

@@ -2581,8 +2581,8 @@ BGEffects_LoadBGPal0_OBPal1: ; c8e52 (32:4e52)
ld a, h ld a, h
push bc push bc
push af push af
ld hl, BGPals ; BGPals ld hl, BGPals
ld de, UnknBGPals ; wd000 ld de, UnknBGPals
ld b, a ld b, a
ld c, $1 ld c, $1
call CopyPals call CopyPals

View File

@@ -111,8 +111,8 @@ _ResetWRAM: ; 5bae
xor a xor a
call ByteFill call ByteFill
ld hl, wd000 ld hl, wRAM1Start
ld bc, wGameData - wd000 ld bc, wGameData - wRAM1Start
xor a xor a
call ByteFill call ByteFill

View File

@@ -331,7 +331,7 @@ ReceiveKeyItem: ; d35a
ret ret
TossKeyItem: ; d374 TossKeyItem: ; d374
ld a, [wd107] ld a, [CurItemQuantity]
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, NumKeyItems ld hl, NumKeyItems

View File

@@ -2668,7 +2668,7 @@ Script_warp:
call GetScriptByte call GetScriptByte
ld [YCoord], a ld [YCoord], a
ld a, -1 ld a, -1
ld [wd001], a ld [DefaultSpawnpoint], a
ld a, MAPSETUP_WARP ld a, MAPSETUP_WARP
ld [hMapEntryMethod], a ld [hMapEntryMethod], a
ld a, 1 ld a, 1
@@ -2681,7 +2681,7 @@ Script_warp:
call GetScriptByte call GetScriptByte
call GetScriptByte call GetScriptByte
ld a, -1 ld a, -1
ld [wd001], a ld [DefaultSpawnpoint], a
ld a, MAPSETUP_BADWARP ld a, MAPSETUP_BADWARP
ld [hMapEntryMethod], a ld [hMapEntryMethod], a
ld a, 1 ld a, 1

View File

@@ -94,7 +94,7 @@ CheckRegisteredItem: ; 13345
dec a dec a
cp [hl] cp [hl]
jr nc, .NotEnoughItems jr nc, .NotEnoughItems
ld [wd107], a ld [CurItemQuantity], a
and a and a
ret ret

View File

@@ -42,10 +42,10 @@ ENDM
LoadSpawnPoint: ; 1531f LoadSpawnPoint: ; 1531f
; loads the spawn point in wd001 ; loads the spawn point in DefaultSpawnpoint
push hl push hl
push de push de
ld a, [wd001] ld a, [DefaultSpawnpoint]
cp SPAWN_N_A cp SPAWN_N_A
jr z, .spawn_n_a jr z, .spawn_n_a
ld l, a ld l, a

View File

@@ -614,7 +614,7 @@ TossItemFromPC: ; 129f4
pop af pop af
jr c, .quit jr c, .quit
pop hl pop hl
ld a, [wd107] ld a, [CurItemQuantity]
call TossItem call TossItem
call PartyMonItemName call PartyMonItemName
ld hl, .TossedThisMany ld hl, .TossedThisMany

View File

@@ -632,7 +632,7 @@ FlyFunction: ; ca3b
cp NUM_SPAWNS cp NUM_SPAWNS
jr nc, .illegal jr nc, .illegal
ld [wd001], a ld [DefaultSpawnpoint], a
call CloseWindow call CloseWindow
ld a, $1 ld a, $1
ret ret
@@ -962,7 +962,7 @@ TeleportFunction: ; cc61
callba IsSpawnPoint callba IsSpawnPoint
jr nc, .nope jr nc, .nope
ld a, c ld a, c
ld [wd001], a ld [DefaultSpawnpoint], a
ld a, $1 ld a, $1
ret ret

View File

@@ -77,6 +77,6 @@ GetWhiteoutSpawn: ; 12527
xor a ; SPAWN_HOME xor a ; SPAWN_HOME
.yes .yes
ld [wd001], a ld [DefaultSpawnpoint], a
ret ret
; 1253d ; 1253d

View File

@@ -69,8 +69,8 @@ Init:: ; 17d
ld [rLCDC], a ld [rLCDC], a
; Clear WRAM bank 0 ; Clear WRAM bank 0
ld hl, wc000 ld hl, wRAM0Start
ld bc, wd000 - wc000 ld bc, wRAM1Start - wRAM0Start
.ByteFill: .ByteFill:
ld [hl], 0 ld [hl], 0
inc hl inc hl

View File

@@ -3332,7 +3332,7 @@ InitDisplayForRedCredits: ; 4e8c2
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
xor a xor a
call ByteFill call ByteFill
ld hl, wd000 ; UnknBGPals ld hl, UnknBGPals
ld c, 4 tiles ld c, 4 tiles
.load_white_palettes .load_white_palettes
ld a, (palred 31 + palgreen 31 + palblue 31) % $100 ld a, (palred 31 + palgreen 31 + palblue 31) % $100

View File

@@ -5410,7 +5410,7 @@ Function1023c6: ; 1023c6
dec a dec a
ld [CurPartyMon], a ld [CurPartyMon], a
xor a xor a
ld [wd10b], a ld [wPokemonWithdrawDepositParameter], a
callba RemoveMonFromPartyOrBox callba RemoveMonFromPartyOrBox
ld hl, PartyCount ld hl, PartyCount
inc [hl] inc [hl]

498
wram.asm

File diff suppressed because it is too large Load Diff