Relabel some map-related WRAM

wMisc -> {wSurroundingTiles, wBoxPartialData, wLink_c608}
wOverworldMap -> {wOverworldMapBlocks, wHallOfFamePokemonList}
This commit is contained in:
Rangi 2018-03-19 11:36:14 -04:00
parent 12070ca500
commit 0447ee0cf9
17 changed files with 132 additions and 121 deletions

View File

@ -16,8 +16,10 @@ SCREEN_HEIGHT_PX EQU SCREEN_HEIGHT * TILE_WIDTH ; pixels
BG_MAP_WIDTH EQU 32 ; tiles BG_MAP_WIDTH EQU 32 ; tiles
BG_MAP_HEIGHT EQU 32 ; tiles BG_MAP_HEIGHT EQU 32 ; tiles
WMISC_WIDTH EQU 6 * 4
WMISC_HEIGHT EQU 5 * 4 METATILE_WIDTH EQU 4 ; tiles
SURROUNDING_WIDTH EQU 6 * METATILE_WIDTH ; tiles
SURROUNDING_HEIGHT EQU 5 * METATILE_WIDTH ; tiles
HP_BAR_LENGTH EQU 6 ; tiles HP_BAR_LENGTH EQU 6 ; tiles

View File

@ -27,39 +27,39 @@ connection: MACRO
if "\1" == "north" if "\1" == "north"
map_id \3 map_id \3
dw \2_Blocks + \3_WIDTH * (\3_HEIGHT - 3) + \5 dw \2_Blocks + \3_WIDTH * (\3_HEIGHT - 3) + \5
dw wOverworldMap + \4 + 3 dw wOverworldMapBlocks + \4 + 3
db \6 db \6
db \3_WIDTH db \3_WIDTH
db \3_HEIGHT * 2 - 1 db \3_HEIGHT * 2 - 1
db (\4 - \5) * -2 db (\4 - \5) * -2
dw wOverworldMap + \3_HEIGHT * (\3_WIDTH + 6) + 1 dw wOverworldMapBlocks + \3_HEIGHT * (\3_WIDTH + 6) + 1
elif "\1" == "south" elif "\1" == "south"
map_id \3 map_id \3
dw \2_Blocks + \5 dw \2_Blocks + \5
dw wOverworldMap + (CURRENT_MAP_HEIGHT + 3) * (CURRENT_MAP_WIDTH + 6) + \4 + 3 dw wOverworldMapBlocks + (CURRENT_MAP_HEIGHT + 3) * (CURRENT_MAP_WIDTH + 6) + \4 + 3
db \6 db \6
db \3_WIDTH db \3_WIDTH
db 0 db 0
db (\4 - \5) * -2 db (\4 - \5) * -2
dw wOverworldMap + \3_WIDTH + 7 dw wOverworldMapBlocks + \3_WIDTH + 7
elif "\1" == "west" elif "\1" == "west"
map_id \3 map_id \3
dw \2_Blocks + (\3_WIDTH * \5) + \3_WIDTH - 3 dw \2_Blocks + (\3_WIDTH * \5) + \3_WIDTH - 3
dw wOverworldMap + (CURRENT_MAP_WIDTH + 6) * (\4 + 3) dw wOverworldMapBlocks + (CURRENT_MAP_WIDTH + 6) * (\4 + 3)
db \6 db \6
db \3_WIDTH db \3_WIDTH
db (\4 - \5) * -2 db (\4 - \5) * -2
db \3_WIDTH * 2 - 1 db \3_WIDTH * 2 - 1
dw wOverworldMap + \3_WIDTH * 2 + 6 dw wOverworldMapBlocks + \3_WIDTH * 2 + 6
elif "\1" == "east" elif "\1" == "east"
map_id \3 map_id \3
dw \2_Blocks + (\3_WIDTH * \5) dw \2_Blocks + (\3_WIDTH * \5)
dw wOverworldMap + (CURRENT_MAP_WIDTH + 6) * (\4 + 3 + 1) - 3 dw wOverworldMapBlocks + (CURRENT_MAP_WIDTH + 6) * (\4 + 3 + 1) - 3
db \6 db \6
db \3_WIDTH db \3_WIDTH
db (\4 - \5) * -2 db (\4 - \5) * -2
db 0 db 0
dw wOverworldMap + \3_WIDTH + 7 dw wOverworldMapBlocks + \3_WIDTH + 7
endc endc
ENDM ENDM

View File

@ -71,7 +71,7 @@ Function818f4: ; 818f4
ld hl, PokemonPalettes ld hl, PokemonPalettes
Function818fd: ; 818fd Function818fd: ; 818fd
ld de, wOverworldMap ld de, wOverworldMapBlocks
ld c, NUM_POKEMON + 1 ld c, NUM_POKEMON + 1
.asm_81902 .asm_81902
push bc push bc
@ -87,7 +87,7 @@ Function818fd: ; 818fd
Function81911: ; 81911 Function81911: ; 81911
ld hl, TrainerPalettes ld hl, TrainerPalettes
ld de, wOverworldMap ld de, wOverworldMapBlocks
ld c, NUM_TRAINER_CLASSES ld c, NUM_TRAINER_CLASSES
.asm_81919 .asm_81919
push bc push bc
@ -424,7 +424,7 @@ Function81bf4: ; 81bf4
ld h, $0 ld h, $0
add hl, hl add hl, hl
add hl, hl add hl, hl
ld de, wOverworldMap ld de, wOverworldMapBlocks
add hl, de add hl, de
ld de, wc608 ld de, wc608
ld bc, 4 ld bc, 4
@ -876,7 +876,7 @@ Function81eca: ; 81eca
ld h, $0 ld h, $0
add hl, hl add hl, hl
add hl, hl add hl, hl
ld de, wOverworldMap ld de, wOverworldMapBlocks
add hl, de add hl, de
ld e, l ld e, l
ld d, h ld d, h

View File

@ -64,7 +64,7 @@ Function170114: ; 170114
ld a, $5 ld a, $5
call GetSRAMBank call GetSRAMBank
ld hl, $a948 ld hl, $a948
ld de, wMisc ld de, wc608
ld bc, $f6 ; 246 ld bc, $f6 ; 246
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
@ -90,11 +90,11 @@ Function170139: ; 170139
ld b, $0 ld b, $0
add hl, bc add hl, bc
call CloseSRAM call CloseSRAM
; Store that number in wMisc ; Store that number in wc608
ld a, h ld a, h
ld [wMisc], a ld [wc608], a
ld a, l ld a, l
ld [wMisc + 1], a ld [wc608 + 1], a
ld hl, wBT_OTTempMon1DVs ld hl, wBT_OTTempMon1DVs
ld a, [wPlayerID] ld a, [wPlayerID]
ld [hli], a ld [hli], a
@ -161,7 +161,7 @@ Function170139: ; 170139
ld hl, $a894 ld hl, $a894
ld bc, NAME_LENGTH_JAPANESE ld bc, NAME_LENGTH_JAPANESE
call CopyBytes call CopyBytes
ld hl, wMisc ld hl, wc608
ld de, $a948 ld de, $a948
ld bc, $f6 ld bc, $f6
call CopyBytes call CopyBytes
@ -674,7 +674,7 @@ Function1704e1: ; 1704e1
call CopyBytes call CopyBytes
ld hl, $a8b2 ld hl, $a8b2
ld de, wMisc ld de, wc608
ld bc, $0096 ld bc, $0096
call CopyBytes call CopyBytes
@ -793,7 +793,7 @@ Function1704e1: ; 1704e1
call .PlaceUpDownArrows call .PlaceUpDownArrows
ld a, $50 ld a, $50
ld [wcd4e], a ld [wcd4e], a
ld hl, wMisc ld hl, wc608
ld a, [wNrOfBeatenBattleTowerTrainers] ld a, [wNrOfBeatenBattleTowerTrainers]
ld c, a ld c, a
xor a xor a
@ -1441,7 +1441,7 @@ Function1709bb: ; 1709bb (5c:49bb) BattleTowerAction $10
ld a, $5 ld a, $5
call GetSRAMBank call GetSRAMBank
ld hl, $b023 ld hl, $b023
ld de, wMisc ld de, wc608
ld bc, $0069 ld bc, $0069
call CopyBytes call CopyBytes
ld a, [$a825] ld a, [$a825]
@ -1460,14 +1460,14 @@ Function1709bb: ; 1709bb (5c:49bb) BattleTowerAction $10
ld a, $0 ld a, $0
call GetSRAMBank call GetSRAMBank
ld hl, wRTC ld hl, wRTC
ld de, wMisc ld de, wc608
ld bc, $0004 ld bc, $0004
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
ld a, $5 ld a, $5
call GetSRAMBank call GetSRAMBank
ld hl, $b08c ld hl, $b08c
ld de, wMisc ld de, wc608
ld c, $4 ld c, $4
.compare_loop .compare_loop
ld a, [de] ld a, [de]

View File

@ -143,12 +143,12 @@ AnimateHallOfFame: ; 864c3
GetHallOfFameParty: ; 8653f GetHallOfFameParty: ; 8653f
ld hl, wOverworldMap ld hl, wHallOfFamePokemonList
ld bc, HOF_LENGTH ld bc, wHallOfFamePokemonListEnd - wHallOfFamePokemonList + 1
xor a xor a
call ByteFill call ByteFill
ld a, [wHallOfFameCount] ld a, [wHallOfFameCount]
ld de, wOverworldMap ld de, wHallOfFamePokemonList
ld [de], a ld [de], a
inc de inc de
ld hl, wPartySpecies ld hl, wPartySpecies
@ -216,7 +216,7 @@ GetHallOfFameParty: ; 8653f
pop bc pop bc
inc c inc c
pop de pop de
ld hl, HOF_MON_LENGTH ld hl, wHallOfFamePokemonListMon1End - wHallOfFamePokemonListMon1
add hl, de add hl, de
ld e, l ld e, l
ld d, h ld d, h
@ -224,7 +224,7 @@ GetHallOfFameParty: ; 8653f
jr .next jr .next
.done .done
ld a, $ff ld a, -1
ld [de], a ld [de], a
ret ret
; 865b5 ; 865b5
@ -422,7 +422,7 @@ LoadHOFTeam: ; 8671c
cp NUM_HOF_TEAMS cp NUM_HOF_TEAMS
jr nc, .invalid jr nc, .invalid
ld hl, sHallOfFame ld hl, sHallOfFame
ld bc, HOF_LENGTH ld bc, wHallOfFameTempEnd - wHallOfFameTemp + 1
call AddNTimes call AddNTimes
ld a, BANK(sHallOfFame) ld a, BANK(sHallOfFame)
call GetSRAMBank call GetSRAMBank
@ -430,7 +430,7 @@ LoadHOFTeam: ; 8671c
and a and a
jr z, .absent jr z, .absent
ld de, wHallOfFameTemp ld de, wHallOfFameTemp
ld bc, HOF_LENGTH ld bc, wHallOfFameTempEnd - wHallOfFameTemp + 1
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
and a and a

View File

@ -179,7 +179,7 @@ CheckMapForSomethingToCut: ; c7ce
farcall CheckCutCollision farcall CheckCutCollision
pop de pop de
jr nc, .fail jr nc, .fail
; Get the location of the current block in wOverworldMap. ; Get the location of the current block in wOverworldMapBlocks.
call GetBlockLocation call GetBlockLocation
ld c, [hl] ld c, [hl]
; See if that block contains something that can be cut. ; See if that block contains something that can be cut.
@ -188,7 +188,7 @@ CheckMapForSomethingToCut: ; c7ce
call CheckOverworldTileArrays call CheckOverworldTileArrays
pop hl pop hl
jr nc, .fail jr nc, .fail
; Back up the wOverworldMap address to wBuffer3 ; Back up the wOverworldMapBlocks address to wBuffer3
ld a, l ld a, l
ld [wBuffer3], a ld [wBuffer3], a
ld a, h ld a, h

View File

@ -12,7 +12,7 @@ RotateUnownFrontpic: ; e0000
ld de, wd002 ld de, wd002
call .Copy call .Copy
call .Rotate call .Rotate
ld hl, UnownPrinter_OverworldMapRectangle ld hl, UnownPrinter_GBPrinterRectangle
pop bc pop bc
add hl, bc add hl, bc
add hl, bc add hl, bc
@ -30,7 +30,7 @@ RotateUnownFrontpic: ; e0000
cp 7 * 7 cp 7 * 7
jr c, .loop jr c, .loop
ld hl, wOverworldMap ld hl, wGameboyPrinterRAM
ld de, sScratch ld de, sScratch
ld bc, 7 * 7 tiles ld bc, 7 * 7 tiles
call CopyBytes call CopyBytes
@ -95,17 +95,17 @@ RotateUnownFrontpic: ; e0000
jr nz, .loop_count jr nz, .loop_count
ret ret
overworldmaprect: MACRO gbprinterrect: MACRO
y = 0 y = 0
rept \1 rept \1
x = \1 * (\2 + -1) + y x = \1 * (\2 + -1) + y
rept \2 rept \2
dw wOverworldMap tile x dw wGameboyPrinterRAM tile x
x = x + -\2 x = x + -\2
endr endr
y = y + 1 y = y + 1
endr endr
ENDM ENDM
UnownPrinter_OverworldMapRectangle: ; e008b UnownPrinter_GBPrinterRectangle: ; e008b
overworldmaprect 7, 7 gbprinterrect 7, 7

View File

@ -84,9 +84,9 @@ Gen2ToGen1LinkComms: ; 2805d
call Serial_ExchangeBytes call Serial_ExchangeBytes
ld a, SERIAL_NO_DATA_BYTE ld a, SERIAL_NO_DATA_BYTE
ld [de], a ld [de], a
ld hl, wMisc ld hl, wLink_c608
ld de, wPlayerTrademonSpecies ld de, wTrademons
ld bc, wPlayerTrademonSpecies - wMisc ld bc, wTrademons - wLink_c608
call Serial_ExchangeBytes call Serial_ExchangeBytes
xor a xor a
ld [rIF], a ld [rIF], a
@ -229,9 +229,9 @@ Gen2ToGen2LinkComms: ; 28177
call Serial_ExchangeBytes call Serial_ExchangeBytes
ld a, SERIAL_NO_DATA_BYTE ld a, SERIAL_NO_DATA_BYTE
ld [de], a ld [de], a
ld hl, wMisc ld hl, wLink_c608
ld de, wPlayerTrademonSpecies ld de, wTrademons
ld bc, $c8 ld bc, wTrademons - wLink_c608
call Serial_ExchangeBytes call Serial_ExchangeBytes
ld a, [wLinkMode] ld a, [wLinkMode]
cp LINK_TRADECENTER cp LINK_TRADECENTER
@ -581,7 +581,7 @@ FixDataForLinkTransfer: ; 28434
ld [hli], a ld [hli], a
dec b dec b
jr nz, .loop2 jr nz, .loop2
ld hl, wMisc ld hl, wLink_c608
ld a, SERIAL_PREAMBLE_BYTE ld a, SERIAL_PREAMBLE_BYTE
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a

View File

@ -394,7 +394,7 @@ Function104b88: ; 104b88 (41:4b88)
jp nz, Function104d32 jp nz, Function104d32
call Function104d38 call Function104d38
ret nz ret nz
ld hl, wOverworldMap ld hl, wLinkData
ld a, [wca02] ld a, [wca02]
ld b, a ld b, a
call Function104d4e call Function104d4e
@ -551,7 +551,7 @@ Function104cd2: ; 104cd2 (41:4cd2)
jp nz, Function104d32 jp nz, Function104d32
call Function104d38 call Function104d38
ret nz ret nz
ld hl, wOverworldMap ld hl, wLinkData
ld a, [wca02] ld a, [wca02]
ld b, a ld b, a
call Function104d4e call Function104d4e
@ -1543,7 +1543,7 @@ Function105777: ; 105777 (41:5777)
ret ret
Function10578c: ; 10578c (41:578c) Function10578c: ; 10578c (41:578c)
ld de, wOverworldMap ld de, wLinkData
ld a, BANK(sPlayerData) ld a, BANK(sPlayerData)
call GetSRAMBank call GetSRAMBank
ld hl, sPlayerData + wPlayerName - wPlayerData ld hl, sPlayerData + wPlayerName - wPlayerData

View File

@ -1,9 +1,9 @@
_LoadMapPart:: ; 4d15b _LoadMapPart:: ; 4d15b
ld hl, wMisc ld hl, wSurroundingTiles
ld a, [wMetatileStandingY] ld a, [wMetatileStandingY]
and a and a
jr z, .top_row jr z, .top_row
ld bc, WMISC_WIDTH * 2 ld bc, SURROUNDING_WIDTH * 2
add hl, bc add hl, bc
.top_row .top_row
@ -25,7 +25,7 @@ _LoadMapPart:: ; 4d15b
dec c dec c
jr nz, .loop2 jr nz, .loop2
ld a, l ld a, l
add 4 add METATILE_WIDTH
ld l, a ld l, a
jr nc, .carry jr nc, .carry
inc h inc h

View File

@ -165,9 +165,9 @@ AddHallOfFameEntry: ; 14b5f
ld a, c ld a, c
or b or b
jr nz, .loop jr nz, .loop
ld hl, wOverworldMap ld hl, wHallOfFamePokemonList
ld de, sHallOfFame ld de, sHallOfFame
ld bc, HOF_LENGTH ld bc, wHallOfFamePokemonListEnd - wHallOfFamePokemonList + 1
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
ret ret
@ -943,8 +943,8 @@ endr
; 150f9 ; 150f9
SaveBoxAddress: ; 150f9 SaveBoxAddress: ; 150f9
; Save box via wMisc. ; Save box via wBoxPartialData.
; We do this in three steps because the size of wMisc is less than ; We do this in three steps because the size of wBoxPartialData is less than
; the size of sBox. ; the size of sBox.
push hl push hl
; Load the first part of the active box. ; Load the first part of the active box.
@ -953,8 +953,8 @@ SaveBoxAddress: ; 150f9
ld a, BANK(sBox) ld a, BANK(sBox)
call GetSRAMBank call GetSRAMBank
ld hl, sBox ld hl, sBox
ld de, wMisc ld de, wBoxPartialData
ld bc, (wMiscEnd - wMisc) ld bc, (wBoxPartialDataEnd - wBoxPartialData)
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
pop de pop de
@ -963,23 +963,23 @@ SaveBoxAddress: ; 150f9
push af push af
push de push de
call GetSRAMBank call GetSRAMBank
ld hl, wMisc ld hl, wBoxPartialData
ld bc, (wMiscEnd - wMisc) ld bc, (wBoxPartialDataEnd - wBoxPartialData)
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
; Load the second part of the active box. ; Load the second part of the active box.
ld a, BANK(sBox) ld a, BANK(sBox)
call GetSRAMBank call GetSRAMBank
ld hl, sBox + (wMiscEnd - wMisc) ld hl, sBox + (wBoxPartialDataEnd - wBoxPartialData)
ld de, wMisc ld de, wBoxPartialData
ld bc, (wMiscEnd - wMisc) ld bc, (wBoxPartialDataEnd - wBoxPartialData)
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
pop de pop de
pop af pop af
ld hl, (wMiscEnd - wMisc) ld hl, (wBoxPartialDataEnd - wBoxPartialData)
add hl, de add hl, de
ld e, l ld e, l
ld d, h ld d, h
@ -987,30 +987,30 @@ SaveBoxAddress: ; 150f9
push af push af
push de push de
call GetSRAMBank call GetSRAMBank
ld hl, wMisc ld hl, wBoxPartialData
ld bc, (wMiscEnd - wMisc) ld bc, (wBoxPartialDataEnd - wBoxPartialData)
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
; Load the third and final part of the active box. ; Load the third and final part of the active box.
ld a, BANK(sBox) ld a, BANK(sBox)
call GetSRAMBank call GetSRAMBank
ld hl, sBox + (wMiscEnd - wMisc) * 2 ld hl, sBox + (wBoxPartialDataEnd - wBoxPartialData) * 2
ld de, wMisc ld de, wBoxPartialData
ld bc, sBoxEnd - (sBox + (wMiscEnd - wMisc) * 2) ; $8e ld bc, sBoxEnd - (sBox + (wBoxPartialDataEnd - wBoxPartialData) * 2) ; $8e
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
pop de pop de
pop af pop af
ld hl, (wMiscEnd - wMisc) ld hl, (wBoxPartialDataEnd - wBoxPartialData)
add hl, de add hl, de
ld e, l ld e, l
ld d, h ld d, h
; Save it to the final part of the target box. ; Save it to the final part of the target box.
call GetSRAMBank call GetSRAMBank
ld hl, wMisc ld hl, wBoxPartialData
ld bc, sBoxEnd - (sBox + (wMiscEnd - wMisc) * 2) ; $8e ld bc, sBoxEnd - (sBox + (wBoxPartialDataEnd - wBoxPartialData) * 2) ; $8e
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
@ -1020,8 +1020,8 @@ SaveBoxAddress: ; 150f9
LoadBoxAddress: ; 1517d (5:517d) LoadBoxAddress: ; 1517d (5:517d)
; Load box via wMisc. ; Load box via wBoxPartialData.
; We do this in three steps because the size of wMisc is less than ; We do this in three steps because the size of wBoxPartialData is less than
; the size of sBox. ; the size of sBox.
push hl push hl
ld l, e ld l, e
@ -1030,52 +1030,52 @@ LoadBoxAddress: ; 1517d (5:517d)
push af push af
push hl push hl
call GetSRAMBank call GetSRAMBank
ld de, wMisc ld de, wBoxPartialData
ld bc, (wMiscEnd - wMisc) ld bc, (wBoxPartialDataEnd - wBoxPartialData)
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
ld a, BANK(sBox) ld a, BANK(sBox)
call GetSRAMBank call GetSRAMBank
ld hl, wMisc ld hl, wBoxPartialData
ld de, sBox ld de, sBox
ld bc, (wMiscEnd - wMisc) ld bc, (wBoxPartialDataEnd - wBoxPartialData)
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
pop hl pop hl
pop af pop af
ld de, (wMiscEnd - wMisc) ld de, (wBoxPartialDataEnd - wBoxPartialData)
add hl, de add hl, de
; Load part 2 ; Load part 2
push af push af
push hl push hl
call GetSRAMBank call GetSRAMBank
ld de, wMisc ld de, wBoxPartialData
ld bc, (wMiscEnd - wMisc) ld bc, (wBoxPartialDataEnd - wBoxPartialData)
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
ld a, BANK(sBox) ld a, BANK(sBox)
call GetSRAMBank call GetSRAMBank
ld hl, wMisc ld hl, wBoxPartialData
ld de, sBox + (wMiscEnd - wMisc) ld de, sBox + (wBoxPartialDataEnd - wBoxPartialData)
ld bc, (wMiscEnd - wMisc) ld bc, (wBoxPartialDataEnd - wBoxPartialData)
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
pop hl pop hl
pop af pop af
; Load part 3 ; Load part 3
ld de, (wMiscEnd - wMisc) ld de, (wBoxPartialDataEnd - wBoxPartialData)
add hl, de add hl, de
call GetSRAMBank call GetSRAMBank
ld de, wMisc ld de, wBoxPartialData
ld bc, sBoxEnd - (sBox + (wMiscEnd - wMisc) * 2) ; $8e ld bc, sBoxEnd - (sBox + (wBoxPartialDataEnd - wBoxPartialData) * 2) ; $8e
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
ld a, BANK(sBox) ld a, BANK(sBox)
call GetSRAMBank call GetSRAMBank
ld hl, wMisc ld hl, wBoxPartialData
ld de, sBox + (wMiscEnd - wMisc) * 2 ld de, sBox + (wBoxPartialDataEnd - wBoxPartialData) * 2
ld bc, sBoxEnd - (sBox + (wMiscEnd - wMisc) * 2) ; $8e ld bc, sBoxEnd - (sBox + (wBoxPartialDataEnd - wBoxPartialData) * 2) ; $8e
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM

View File

@ -14,8 +14,8 @@ _UnownPuzzle: ; e1190
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
call DisableLCD call DisableLCD
ld hl, wMisc ; includes wPuzzlePieces ld hl, wc608 ; includes wPuzzlePieces
ld bc, wMiscEnd - wMisc ld bc, wc7e8 - wc608
xor a xor a
call ByteFill call ByteFill
ld hl, UnownPuzzleCursorGFX ld hl, UnownPuzzleCursorGFX

View File

@ -392,7 +392,7 @@ CheckMovingOffEdgeOfMap:: ; 104820 (41:4820)
GetCoordOfUpperLeftCorner:: ; 10486d GetCoordOfUpperLeftCorner:: ; 10486d
ld hl, wOverworldMap ld hl, wOverworldMapBlocks
ld a, [wXCoord] ld a, [wXCoord]
bit 0, a bit 0, a
jr nz, .increment_then_halve1 jr nz, .increment_then_halve1

View File

@ -109,7 +109,7 @@ LoadMapPart:: ; 217a
rst Bankswitch rst Bankswitch
call LoadMetatiles call LoadMetatiles
ld a, $60 ld a, "■"
hlcoord 0, 0 hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill call ByteFill
@ -129,13 +129,13 @@ LoadMetatiles:: ; 2198
ld e, a ld e, a
ld a, [wOverworldMapAnchor + 1] ld a, [wOverworldMapAnchor + 1]
ld d, a ld d, a
ld hl, wMisc ld hl, wSurroundingTiles
ld b, WMISC_HEIGHT / 4 ; 5 ld b, SURROUNDING_HEIGHT / METATILE_WIDTH ; 5
.row .row
push de push de
push hl push hl
ld c, WMISC_WIDTH / 4 ; 6 ld c, SURROUNDING_WIDTH / METATILE_WIDTH ; 6
.col .col
push de push de
@ -148,7 +148,7 @@ LoadMetatiles:: ; 2198
ld a, [wMapBorderBlock] ld a, [wMapBorderBlock]
.ok .ok
; Load the current wMisc address into de. ; Load the current wSurroundingTiles address into de.
ld e, l ld e, l
ld d, h ld d, h
; Set hl to the address of the current metatile data ([wTilesetBlocksAddress] + (a) tiles). ; Set hl to the address of the current metatile data ([wTilesetBlocksAddress] + (a) tiles).
@ -169,27 +169,27 @@ LoadMetatiles:: ; 2198
ld h, a ld h, a
; copy the 4x4 metatile ; copy the 4x4 metatile
rept 3 rept METATILE_WIDTH + -1
rept 4 rept METATILE_WIDTH
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
inc de inc de
endr endr
ld a, e ld a, e
add WMISC_WIDTH - 4 add SURROUNDING_WIDTH - METATILE_WIDTH
ld e, a ld e, a
jr nc, .next\@ jr nc, .next\@
inc d inc d
.next\@ .next\@
endr endr
rept 4 rept METATILE_WIDTH
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
inc de inc de
endr endr
; Next metatile ; Next metatile
pop hl pop hl
ld de, 4 ld de, METATILE_WIDTH
add hl, de add hl, de
pop de pop de
inc de inc de
@ -197,7 +197,7 @@ endr
jp nz, .col jp nz, .col
; Next metarow ; Next metarow
pop hl pop hl
ld de, WMISC_WIDTH * 4 ld de, SURROUNDING_WIDTH * METATILE_WIDTH
add hl, de add hl, de
pop de pop de
ld a, [wMapWidth] ld a, [wMapWidth]
@ -260,10 +260,10 @@ GetDestinationWarpNumber:: ; 2252
.GetDestinationWarpNumber: ; 2266 .GetDestinationWarpNumber: ; 2266
ld a, [wPlayerStandingMapY] ld a, [wPlayerStandingMapY]
sub $4 sub 4
ld e, a ld e, a
ld a, [wPlayerStandingMapX] ld a, [wPlayerStandingMapX]
sub $4 sub 4
ld d, a ld d, a
ld a, [wCurrMapWarpCount] ld a, [wCurrMapWarpCount]
and a and a
@ -732,8 +732,8 @@ RestoreFacingAfterWarp:: ; 248a
; 24cd ; 24cd
LoadBlockData:: ; 24cd LoadBlockData:: ; 24cd
ld hl, wOverworldMap ld hl, wOverworldMapBlocks
ld bc, wOverworldMapEnd - wOverworldMap ld bc, wOverworldMapBlocksEnd - wOverworldMapBlocks
ld a, 0 ld a, 0
call ByteFill call ByteFill
call ChangeMap call ChangeMap
@ -747,7 +747,7 @@ ChangeMap:: ; 24e4
ld a, [hROMBank] ld a, [hROMBank]
push af push af
ld hl, wOverworldMap ld hl, wOverworldMapBlocks
ld a, [wMapWidth] ld a, [wMapWidth]
ld [hConnectedMapWidth], a ld [hConnectedMapWidth], a
add $6 add $6
@ -1816,7 +1816,7 @@ GetBlockLocation:: ; 2a66
add 6 add 6
ld c, a ld c, a
ld b, 0 ld b, 0
ld hl, wOverworldMap + 1 ld hl, wOverworldMapBlocks + 1
add hl, bc add hl, bc
ld a, e ld a, e
srl a srl a

View File

@ -233,7 +233,7 @@ hall_of_fame: MACRO
\1Mon4:: hof_mon \1Mon4 \1Mon4:: hof_mon \1Mon4
\1Mon5:: hof_mon \1Mon5 \1Mon5:: hof_mon \1Mon5
\1Mon6:: hof_mon \1Mon6 \1Mon6:: hof_mon \1Mon6
\1End:: ds 1 \1End:: db
ENDM ENDM
link_battle_record: MACRO link_battle_record: MACRO

View File

@ -75,8 +75,8 @@ SetRAMStateForMobile: ; 100063
EnableMobile: ; 100082 EnableMobile: ; 100082
xor a xor a
ld hl, wOverworldMap ld hl, wOverworldMapBlocks
ld bc, wOverworldMapEnd - wOverworldMap ld bc, wOverworldMapBlocksEnd - wOverworldMapBlocks
call ByteFill call ByteFill
di di

View File

@ -361,9 +361,13 @@ UNION ; c608
wc608:: ds 480 wc608:: ds 480
NEXTU ; c608 NEXTU ; c608
; miscellaneous ; surrounding tiles
wMisc:: ds WMISC_WIDTH * WMISC_HEIGHT wSurroundingTiles:: ds SURROUNDING_WIDTH * SURROUNDING_HEIGHT
wMiscEnd::
NEXTU ; c608
; box save buffer
wBoxPartialData:: ds 480
wBoxPartialDataEnd::
NEXTU ; c608 NEXTU ; c608
; odd egg ; odd egg
@ -389,7 +393,7 @@ wInitMinuteBuffer:: db ; c626
NEXTU ; c608 NEXTU ; c608
; link engine data ; link engine data
ds 10 wLink_c608:: ds 10
wc612:: ds 10 wc612:: ds 10
NEXTU ; c608 NEXTU ; c608
@ -884,8 +888,9 @@ wc7e8_End::
SECTION "Overworld Map", WRAM0 SECTION "Overworld Map", WRAM0
UNION ; c800 UNION ; c800
wOverworldMap:: ds 1300 ; c800 ; overworld map blocks
wOverworldMapEnd:: wOverworldMapBlocks:: ds 1300 ; c800
wOverworldMapBlocksEnd::
NEXTU ; c800 NEXTU ; c800
; GB Printer screen RAM ; GB Printer screen RAM
@ -928,10 +933,14 @@ wGameboyPrinterRAMEnd::
NEXTU ; c800 NEXTU ; c800
; bill's pc data ; bill's pc data
wBillsPCPokemonList:: ; c800 wBillsPCPokemonList::
; Pokemon, box number, list index ; (species, box number, list index) x30
ds 3 * 30 ds 3 * 30
NEXTU ; c800
; Hall of Fame data
wHallOfFamePokemonList:: hall_of_fame wHallOfFamePokemonList
NEXTU ; c800 NEXTU ; c800
; raw link data ; raw link data
wLinkData:: ds $514 wLinkData:: ds $514