Require rgbds 0.5.1

Use some new features: \<10> macro args, SECTION UNION, SIZEOF/STARTOF, and CHARLEN/CHARSUB
This commit is contained in:
Rangi 2021-05-09 12:26:28 -04:00
parent efd1006917
commit b1dbadbdd3
14 changed files with 224 additions and 148 deletions

View File

@ -9,7 +9,7 @@ install:
HOMEBREW_NO_AUTO_UPDATE=1 brew install bison HOMEBREW_NO_AUTO_UPDATE=1 brew install bison
export PATH="/usr/local/opt/bison/bin:$PATH" export PATH="/usr/local/opt/bison/bin:$PATH"
fi fi
git clone -b v0.5.0 --depth=1 https://github.com/gbdev/rgbds git clone -b v0.5.1 --depth=1 https://github.com/gbdev/rgbds
sudo make -C rgbds install sudo make -C rgbds install
rm -rf rgbds rm -rf rgbds
) )

6
FAQ.md
View File

@ -41,15 +41,15 @@ You need to install `gcc`. If you're using Cygwin, re-run its setup, and at "Sel
### "ERROR: `UNION` already defined" ### "ERROR: `UNION` already defined"
Download [**rgbds 0.5.0**][rgbds] or newer. Older versions will not work. Download [**rgbds 0.5.1**][rgbds] or newer. Older versions will not work.
### "ERROR: Macro not defined" ### "ERROR: Macro not defined"
Download [**rgbds 0.5.0**][rgbds] or newer. Older versions will not work. Download [**rgbds 0.5.1**][rgbds] or newer. Older versions will not work.
### "Expression must be 8-bit" ### "Expression must be 8-bit"
Download [**rgbds 0.5.0**][rgbds] or newer. Older versions will not work. Download [**rgbds 0.5.1**][rgbds] or newer. Older versions will not work.
### "Segmentation fault" from `rgbgfx` ### "Segmentation fault" from `rgbgfx`

View File

@ -42,9 +42,9 @@ Run setup and leave the default settings. At the "**Select Packages**" step, cho
Double click on the text that says "**Skip**" next to each package to select the most recent version to install. Double click on the text that says "**Skip**" next to each package to select the most recent version to install.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/windows) for Windows with Cygwin to install **rgbds 0.5.0**. Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/windows) for Windows with Cygwin to install **rgbds 0.5.1**.
**Note:** If you already have an older rgbds, you will need to update to 0.5.0. Ignore this if you have never installed rgbds before. If a version newer than 0.5.0 does not work, try downloading 0.5.0. **Note:** If you already have an older rgbds, you will need to update to 0.5.1. Ignore this if you have never installed rgbds before. If a version newer than 0.5.1 does not work, try downloading 0.5.1.
Now open the **Cygwin terminal** and enter the following commands. Now open the **Cygwin terminal** and enter the following commands.
@ -67,7 +67,7 @@ Install [**Homebrew**](https://brew.sh/). Follow the official instructions.
Open **Terminal** and prepare to enter commands. Open **Terminal** and prepare to enter commands.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/macos) for macOS to install **rgbds 0.5.0**. Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/macos) for macOS to install **rgbds 0.5.1**.
Now you're ready to [build **pokecrystal**](#build-pokecrystal). Now you're ready to [build **pokecrystal**](#build-pokecrystal).
@ -84,7 +84,7 @@ To install the software required for **pokecrystal**:
sudo apt-get install make gcc git sudo apt-get install make gcc git
``` ```
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.0** from source. Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.1** from source.
### OpenSUSE ### OpenSUSE
@ -94,7 +94,7 @@ To install the software required for **pokecrystal**:
sudo zypper install make gcc git sudo zypper install make gcc git
``` ```
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.0** from source. Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.1** from source.
### Arch Linux ### Arch Linux
@ -104,9 +104,9 @@ To install the software required for **pokecrystal**:
sudo pacman -S make gcc git rgbds sudo pacman -S make gcc git rgbds
``` ```
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/arch) for Arch Linux to install **rgbds 0.5.0**. Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/arch) for Arch Linux to install **rgbds 0.5.1**.
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.0** from source. If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.1** from source.
### Termux ### Termux
@ -122,7 +122,7 @@ To install **rgbds**:
sudo apt install rgbds sudo apt install rgbds
``` ```
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.0** from source. If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.1** from source.
### Other distros ### Other distros
@ -133,7 +133,7 @@ If your distro is not listed here, try to find the required software in its repo
- `git` - `git`
- `rgbds` - `rgbds`
If `rgbds` is not available, you'll need to follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.0** from source. If `rgbds` is not available, you'll need to follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.1** from source.
Now you're ready to [build **pokecrystal**](#build-pokecrystal). Now you're ready to [build **pokecrystal**](#build-pokecrystal).
@ -161,12 +161,12 @@ make crystal11
### Build with a local rgbds version ### Build with a local rgbds version
If you have different projects that require different versions of `rgbds`, it might not be convenient to install rgbds 0.5.0 globally. Instead, you can put its files in a directory within pokecrystal, such as `pokecrystal/rgbds-0.5.0/`. Then specify it when you run `make`: If you have different projects that require different versions of `rgbds`, it might not be convenient to install rgbds 0.5.1 globally. Instead, you can put its files in a directory within pokecrystal, such as `pokecrystal/rgbds-0.5.1/`. Then specify it when you run `make`:
```bash ```bash
make RGBDS=rgbds-0.5.0/ make RGBDS=rgbds-0.5.1/
``` ```
```bash ```bash
make RGBDS=rgbds-0.5.0/ crystal11 make RGBDS=rgbds-0.5.1/ crystal11
``` ```

View File

@ -1,9 +1,8 @@
npctrade: MACRO npctrade: MACRO
; dialog set, requested mon, offered mon, nickname, dvs, item, OT ID, OT name, gender requested ; dialog set, requested mon, offered mon, nickname, dvs, item, OT ID, OT name, gender requested
db \1, \2, \3, \4, \5, \6, \7 db \1, \2, \3, \4, \5, \6, \7
shift dw \8
dw \7 db \9, \<10>, 0
db \8, \9, 0
ENDM ENDM
NPCTrades: NPCTrades:

View File

@ -1,18 +1,17 @@
unownwall: MACRO unownwall: MACRO
rept _NARG for n, CHARLEN(\1)
if \1 == "-" x = CHARSUB(\1, n + 1)
x = $64 if x == "-"
elif \1 >= "Y" db $64
x = 2 * (\1 - "Y") + $60 elif x >= "Y"
elif \1 >= "Q" db 2 * (x - "Y") + $60
x = 2 * (\1 - "Q") + $40 elif x >= "Q"
elif \1 >= "I" db 2 * (x - "Q") + $40
x = 2 * (\1 - "I") + $20 elif x >= "I"
db 2 * (x - "I") + $20
else else
x = 2 * (\1 - "A") db 2 * (x - "A")
endc endc
db x
shift
endr endr
db -1 ; end db -1 ; end
ENDM ENDM
@ -20,16 +19,16 @@ ENDM
UnownWalls: UnownWalls:
; UNOWNWORDS_ESCAPE ; UNOWNWORDS_ESCAPE
; db $08, $44, $04, $00, $2e, $08, -1 ; db $08, $44, $04, $00, $2e, $08, -1
unownwall "E", "S", "C", "A", "P", "E" unownwall "ESCAPE"
; UNOWNWORDS_LIGHT ; UNOWNWORDS_LIGHT
; db $26, $20, $0c, $0e, $46, -1 ; db $26, $20, $0c, $0e, $46, -1
unownwall "L", "I", "G", "H", "T" unownwall "LIGHT"
; UNOWNWORDS_WATER ; UNOWNWORDS_WATER
; db $4c, $00, $46, $08, $42, -1 ; db $4c, $00, $46, $08, $42, -1
unownwall "W", "A", "T", "E", "R" unownwall "WATER"
; UNOWNWORDS_HO_OH ; UNOWNWORDS_HO_OH
; db $0e, $2c, $64, $2c, $0e, -1 ; db $0e, $2c, $64, $2c, $0e, -1
unownwall "H", "O", "-", "O", "H" unownwall "HO-OH"
MenuHeaders_UnownWalls: MenuHeaders_UnownWalls:
; UNOWNWORDS_ESCAPE ; UNOWNWORDS_ESCAPE

View File

@ -1,6 +1,6 @@
unownword: MACRO unownword: MACRO
for x, STRLEN(\1) for n, CHARLEN(\1)
db STRSUB(\1, x + 1, 1) - "A" + FIRST_UNOWN_CHAR db CHARSUB(\1, n + 1) - "A" + FIRST_UNOWN_CHAR
endr endr
db -1 db -1
ENDM ENDM

View File

@ -14,8 +14,8 @@ _UnownPuzzle:
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call DisableLCD call DisableLCD
ld hl, wUnownPuzzle ; includes wPuzzlePieces ld hl, STARTOF("Miscellaneous") ; includes wPuzzlePieces
ld bc, wUnownPuzzleEnd - wUnownPuzzle ld bc, SIZEOF("Miscellaneous")
xor a xor a
call ByteFill call ByteFill
ld hl, UnownPuzzleCursorGFX ld hl, UnownPuzzleCursorGFX

View File

@ -187,25 +187,23 @@ NextChar::
CheckDict:: CheckDict::
dict: MACRO dict: MACRO
assert CHARLEN(\1) == 1
if \1 == 0 if \1 == 0
and a and a
else else
cp \1 cp \1
endc endc
if ISCONST(\2) if ISCONST(\2)
; Replace a character with another one ; Replace a character with another one
jr nz, ._\@ jr nz, .not\@
ld a, \2 ld a, \2
._\@: .not\@:
else elif STRSUB("\2", 1, 1) == "."
if STRSUB("\2", 1, 1) == "."
; Locals can use a short jump ; Locals can use a short jump
jr z, \2 jr z, \2
else else
jp z, \2 jp z, \2
endc endc
endc
ENDM ENDM
dict "<MOBILE>", MobileScriptChar dict "<MOBILE>", MobileScriptChar

View File

@ -326,12 +326,15 @@ WRAM0
"Sprites" "Sprites"
"Tilemap" "Tilemap"
"Miscellaneous" "Miscellaneous"
"Unused Map Buffer"
align 8 align 8
"Overworld Map" "Overworld Map"
align 4 align 4
"Video" "Video"
WRAMX 1 WRAMX 1
"WRAM 1" "WRAM 1"
"Miscellaneous WRAM 1"
"More WRAM 1"
"Enemy Party" "Enemy Party"
"Party" "Party"
WRAMX 2 WRAMX 2

View File

@ -224,12 +224,7 @@ signpost: MACRO
ENDM ENDM
person_event: MACRO person_event: MACRO
_s = \1 object_event \3, \2, \1, \4, \5, \6, \7, \8, \9, \<10>, \<11>, \<12>, \<13>
_y = \2
_x = \3
_m = \4
shift 4
object_event _x, _y, _s, _m, \1, \2, \3, \4, \5, \6, \7, \8, \9
ENDM ENDM
PERSONTYPE_SCRIPT EQUS "OBJECTTYPE_SCRIPT" PERSONTYPE_SCRIPT EQUS "OBJECTTYPE_SCRIPT"

View File

@ -102,21 +102,16 @@ object_event: MACRO
; * if h1 == -1, h2 is treated as a time-of-day value: ; * if h1 == -1, h2 is treated as a time-of-day value:
; a combo of MORN, DAY, and/or NITE, or -1 to always appear ; a combo of MORN, DAY, and/or NITE, or -1 to always appear
;\9: color: a PAL_NPC_* constant, or 0 for sprite default ;\9: color: a PAL_NPC_* constant, or 0 for sprite default
;\10: function: a OBJECTTYPE_* constant ;\<10>: function: a OBJECTTYPE_* constant
;\11: sight range: applies to OBJECTTYPE_TRAINER ;\<11>: sight range: applies to OBJECTTYPE_TRAINER
;\12: script pointer ;\<12>: script pointer
;\13: event flag: an EVENT_* constant, or -1 to always appear ;\<13>: event flag: an EVENT_* constant, or -1 to always appear
db \3, \2 + 4, \1 + 4, \4 db \3, \2 + 4, \1 + 4, \4
dn \6, \5 dn \6, \5
db \7, \8 db \7, \8
shift dn \9, \<10>
dn \8, \9 db \<11>
shift dw \<12>, \<13>
db \9
shift
dw \9
shift
dw \9
; the dummy PlayerObjectTemplate object_event has no def_object_events ; the dummy PlayerObjectTemplate object_event has no def_object_events
if DEF(_NUM_OBJECT_EVENTS) if DEF(_NUM_OBJECT_EVENTS)
{_NUM_OBJECT_EVENTS} = {_NUM_OBJECT_EVENTS} + 1 {_NUM_OBJECT_EVENTS} = {_NUM_OBJECT_EVENTS} + 1

View File

@ -1,9 +1,9 @@
MAJOR EQU 0 MAJOR EQU 0
MINOR EQU 5 MINOR EQU 5
PATCH EQU 0 PATCH EQU 1
wrong_rgbds: MACRO wrong_rgbds: MACRO
fail "pokecrystal requires rgbds v0.5.0 or newer." fail "pokecrystal requires rgbds v0.5.1 or newer."
ENDM ENDM
IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__) IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__)

View File

@ -82,14 +82,14 @@ for objfile in objects:
elif magic == b'RGB9': elif magic == b'RGB9':
obj_ver = 10 + unpack_file("<I", f)[0] obj_ver = 10 + unpack_file("<I", f)[0]
if obj_ver not in [6, 10, 11, 12, 13, 15, 16, 17]: if obj_ver not in [6, 10, 11, 12, 13, 15, 16, 17, 18]:
print("Error: File '%s' is of an unknown format." % objfile, file=stderr) print("Error: File '%s' is of an unknown format." % objfile, file=stderr)
exit(1) exit(1)
num_symbols = unpack_file("<I", f)[0] num_symbols = unpack_file("<I", f)[0]
unpack_file("<I", f) # skip num sections unpack_file("<I", f) # skip num sections
if obj_ver in [16, 17]: if obj_ver in [16, 17, 18]:
node_filenames = [] node_filenames = []
num_nodes = unpack_file("<I", f)[0] num_nodes = unpack_file("<I", f)[0]
for x in range(num_nodes): for x in range(num_nodes):
@ -109,7 +109,7 @@ for objfile in objects:
sym_type = symtype(unpack_file("<B", f)[0] & 0x7f) sym_type = symtype(unpack_file("<B", f)[0] & 0x7f)
if sym_type == symtype.IMPORT: if sym_type == symtype.IMPORT:
continue continue
if obj_ver in [16, 17]: if obj_ver in [16, 17, 18]:
sym_fileno = unpack_file("<I", f)[0] sym_fileno = unpack_file("<I", f)[0]
sym_filename = node_filenames[sym_fileno] sym_filename = node_filenames[sym_fileno]
else: else:

235
wram.asm
View File

@ -323,27 +323,32 @@ wTilemap::
wTilemapEnd:: wTilemapEnd::
SECTION "Miscellaneous", WRAM0
; This union spans 480 bytes. ; This union spans 480 bytes.
UNION SECTION UNION "Miscellaneous", WRAM0
; surrounding tiles ; surrounding tiles
; This buffer determines the size for the rest of the union; ; This buffer determines the size for the rest of the union;
; it uses exactly 480 bytes. ; it uses exactly 480 bytes.
wSurroundingTiles:: ds SURROUNDING_WIDTH * SURROUNDING_HEIGHT wSurroundingTiles:: ds SURROUNDING_WIDTH * SURROUNDING_HEIGHT
NEXTU
SECTION UNION "Miscellaneous", WRAM0
; box save buffer ; box save buffer
; SaveBoxAddress uses this buffer in three steps because it ; SaveBoxAddress uses this buffer in three steps because it
; needs more space than the buffer can hold. ; needs more space than the buffer can hold.
wBoxPartialData:: ds 480 wBoxPartialData:: ds 480
wBoxPartialDataEnd:: wBoxPartialDataEnd::
NEXTU
SECTION UNION "Miscellaneous", WRAM0
; battle tower temp struct ; battle tower temp struct
wBT_OTTemp:: battle_tower_struct wBT_OTTemp wBT_OTTemp:: battle_tower_struct wBT_OTTemp
NEXTU
SECTION UNION "Miscellaneous", WRAM0
; battle data ; battle data
wBattle:: wBattle::
wEnemyMoveStruct:: move_struct wEnemyMoveStruct wEnemyMoveStruct:: move_struct wEnemyMoveStruct
@ -626,23 +631,21 @@ wPlayerJustGotFrozen:: db
wEnemyJustGotFrozen:: db wEnemyJustGotFrozen:: db
wBattleEnd:: wBattleEnd::
NEXTU
; unown puzzle
wUnownPuzzle::
ds 200
wPuzzlePieces:: ds 6 * 6
ds 244
wUnownPuzzleEnd::
NEXTU SECTION UNION "Miscellaneous", WRAM0
; link patch lists ; link patch lists
wPlayerPatchLists:: ds 200 wPlayerPatchLists:: ds 200
wOTPatchLists:: ds 200 wOTPatchLists:: ds 200
NEXTU
SECTION UNION "Miscellaneous", WRAM0
; mobile
wMobileTransferData:: ds 480 wMobileTransferData:: ds 480
NEXTU
SECTION UNION "Miscellaneous", WRAM0
; This union spans 200 bytes. ; This union spans 200 bytes.
UNION UNION
@ -813,6 +816,10 @@ wMemoryGameLastMatches:: ds 5
wMemoryGameCounter:: db wMemoryGameCounter:: db
wMemoryGameNumCardsMatched:: db wMemoryGameNumCardsMatched:: db
NEXTU
; unown puzzle
wPuzzlePieces:: ds 6 * 6
NEXTU NEXTU
; mobile data ; mobile data
wc6d0:: ds 56 wc6d0:: ds 56
@ -839,7 +846,8 @@ wc7d2:: ds 1
wc7d3:: ds 2 wc7d3:: ds 2
ENDU ENDU
ENDU
SECTION "Unused Map Buffer", WRAM0
; This was a buffer for map-related pointers in the 1997 G/S prototype. ; This was a buffer for map-related pointers in the 1997 G/S prototype.
; See wMapBuffer in pokegold-spaceworld's wram.asm. ; See wMapBuffer in pokegold-spaceworld's wram.asm.
@ -847,14 +855,15 @@ wUnusedMapBuffer:: ds 24
wUnusedMapBufferEnd:: wUnusedMapBufferEnd::
SECTION "Overworld Map", WRAM0 SECTION UNION "Overworld Map", WRAM0
UNION
; overworld map blocks ; overworld map blocks
wOverworldMapBlocks:: ds 1300 wOverworldMapBlocks:: ds 1300
wOverworldMapBlocksEnd:: wOverworldMapBlocksEnd::
NEXTU
SECTION UNION "Overworld Map", WRAM0
; GB Printer data ; GB Printer data
wGameboyPrinterRAM:: wGameboyPrinterRAM::
wGameboyPrinter2bppSource:: ds 40 tiles wGameboyPrinter2bppSource:: ds 40 tiles
@ -888,7 +897,9 @@ wPrinterExposureTime:: db
ds 16 ds 16
wGameboyPrinterRAMEnd:: wGameboyPrinterRAMEnd::
NEXTU
SECTION UNION "Overworld Map", WRAM0
; bill's pc data ; bill's pc data
wBillsPCData:: wBillsPCData::
wBillsPCPokemonList:: wBillsPCPokemonList::
@ -908,20 +919,27 @@ wBillsPC_MonHasMail:: db
wBillsPCDataEnd:: wBillsPCDataEnd::
NEXTU SECTION UNION "Overworld Map", WRAM0
; Hall of Fame data ; Hall of Fame data
wHallOfFamePokemonList:: hall_of_fame wHallOfFamePokemonList wHallOfFamePokemonList:: hall_of_fame wHallOfFamePokemonList
NEXTU
SECTION UNION "Overworld Map", WRAM0
; debug color picker ; debug color picker
wDebugOriginalColors:: ds 256 * 4 wDebugOriginalColors:: ds 256 * 4
NEXTU
SECTION UNION "Overworld Map", WRAM0
; raw link data ; raw link data
wLinkData:: ds 1300 wLinkData:: ds 1300
wLinkDataEnd:: wLinkDataEnd::
NEXTU
SECTION UNION "Overworld Map", WRAM0
; link data members ; link data members
wLinkPlayerName:: ds NAME_LENGTH wLinkPlayerName:: ds NAME_LENGTH
wLinkPartyCount:: db wLinkPartyCount:: db
@ -974,7 +992,9 @@ wLinkPatchList1:: ds SERIAL_PATCH_LIST_LENGTH
wLinkPatchList2:: ds SERIAL_PATCH_LIST_LENGTH wLinkPatchList2:: ds SERIAL_PATCH_LIST_LENGTH
ENDU ENDU
NEXTU
SECTION UNION "Overworld Map", WRAM0
; link data prep ; link data prep
ds 1000 ds 1000
wCurLinkOTPartyMonTypePointer:: dw wCurLinkOTPartyMonTypePointer:: dw
@ -985,7 +1005,9 @@ for n, 1, PARTY_LENGTH + 1
wLinkOTPartyMon{d:n}Type:: dw wLinkOTPartyMon{d:n}Type:: dw
endr endr
NEXTU
SECTION UNION "Overworld Map", WRAM0
; link mail data ; link mail data
ds 500 ds 500
wLinkPlayerMail:: wLinkPlayerMail::
@ -1002,13 +1024,17 @@ wOTPlayerMailPatchSet:: ds 103 + SERIAL_MAIL_PREAMBLE_LENGTH
wLinkOTMailEnd:: wLinkOTMailEnd::
ds 10 ds 10
NEXTU
SECTION UNION "Overworld Map", WRAM0
; received link mail data ; received link mail data
ds 500 ds 500
wLinkReceivedMail:: ds MAIL_STRUCT_LENGTH * PARTY_LENGTH wLinkReceivedMail:: ds MAIL_STRUCT_LENGTH * PARTY_LENGTH
wLinkReceivedMailEnd:: db wLinkReceivedMailEnd:: db
NEXTU
SECTION UNION "Overworld Map", WRAM0
; mystery gift data ; mystery gift data
wMysteryGiftStaging:: ds 80 wMysteryGiftStaging:: ds 80
@ -1052,22 +1078,28 @@ wMysteryGiftPlayerBackupItem:: db
ds 1 ds 1
wMysteryGiftPlayerDataEnd:: wMysteryGiftPlayerDataEnd::
NEXTU
SECTION UNION "Overworld Map", WRAM0
ds $200 ds $200
UNION
; blank credits tile buffer
wCreditsBlankFrame2bpp:: ds 4 * 4 tiles
wCreditsBlankFrame2bppEnd::
NEXTU
; mystery gift data ; mystery gift data
wUnusedMysteryGiftStagedDataLength:: db wUnusedMysteryGiftStagedDataLength:: db
wMysteryGiftMessageCount:: db wMysteryGiftMessageCount:: db
wMysteryGiftStagedDataLength:: db wMysteryGiftStagedDataLength:: db
ENDU
NEXTU
SECTION UNION "Overworld Map", WRAM0
ds $200
; blank credits tile buffer
wCreditsBlankFrame2bpp:: ds 4 * 4 tiles
wCreditsBlankFrame2bppEnd::
SECTION UNION "Overworld Map", WRAM0
; mobile ; mobile
ds 7 ds 7
wc807:: ds 1 wc807:: ds 1
@ -1096,9 +1128,9 @@ wccb8:: ds 1
wccb9:: ds 1 wccb9:: ds 1
wccba:: ds 90 wccba:: ds 90
if DEF(_DEBUG) if DEF(_DEBUG)
NEXTU SECTION UNION "Overworld Map", WRAM0
; debug room
; debug room RTC values ; debug room RTC values
wDebugRoomRTCSec:: db wDebugRoomRTCSec:: db
@ -1138,8 +1170,6 @@ ENDU
endc endc
ENDU
SECTION "Video", WRAM0 SECTION "Video", WRAM0
@ -1671,7 +1701,9 @@ wBetaTitleSequenceOpeningType::
wDefaultSpawnpoint:: db wDefaultSpawnpoint:: db
UNION
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; mon buffer ; mon buffer
wBufferMonNickname:: ds MON_NAME_LENGTH wBufferMonNickname:: ds MON_NAME_LENGTH
wBufferMonOT:: ds NAME_LENGTH wBufferMonOT:: ds NAME_LENGTH
@ -1680,7 +1712,9 @@ wBufferMon:: party_struct wBufferMon
wMonOrItemNameBuffer:: ds NAME_LENGTH wMonOrItemNameBuffer:: ds NAME_LENGTH
ds NAME_LENGTH ds NAME_LENGTH
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; poke seer ; poke seer
wSeerAction:: db wSeerAction:: db
wSeerNickname:: ds MON_NAME_LENGTH wSeerNickname:: ds MON_NAME_LENGTH
@ -1693,11 +1727,15 @@ wSeerCaughtLevel:: db
wSeerCaughtData:: db wSeerCaughtData:: db
wSeerCaughtGender:: db wSeerCaughtGender:: db
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; mail temp storage ; mail temp storage
wTempMail:: mailmsg wTempMail wTempMail:: mailmsg wTempMail
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; bug-catching contest ; bug-catching contest
wBugContestResults:: wBugContestResults::
bugcontestwinner wBugContestFirstPlace bugcontestwinner wBugContestFirstPlace
@ -1708,7 +1746,9 @@ wBugContestWinnersEnd::
ds 4 ds 4
wBugContestWinnerName:: ds NAME_LENGTH wBugContestWinnerName:: ds NAME_LENGTH
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; mart items ; mart items
wMartItem1BCD:: ds 3 wMartItem1BCD:: ds 3
wMartItem2BCD:: ds 3 wMartItem2BCD:: ds 3
@ -1721,7 +1761,9 @@ wMartItem8BCD:: ds 3
wMartItem9BCD:: ds 3 wMartItem9BCD:: ds 3
wMartItem10BCD:: ds 3 wMartItem10BCD:: ds 3
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; town map data ; town map data
wTownMapPlayerIconLandmark:: db wTownMapPlayerIconLandmark:: db
UNION UNION
@ -1733,12 +1775,16 @@ wStartFlypoint:: db
wEndFlypoint:: db wEndFlypoint:: db
ENDU ENDU
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; phone call data ; phone call data
wPhoneScriptBank:: db wPhoneScriptBank:: db
wPhoneCaller:: dw wPhoneCaller:: dw
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; radio data ; radio data
wCurRadioLine:: db wCurRadioLine:: db
wNextRadioLine:: db wNextRadioLine:: db
@ -1748,11 +1794,15 @@ wOaksPKMNTalkSegmentCounter:: db
ds 5 ds 5
wRadioText:: ds 2 * SCREEN_WIDTH wRadioText:: ds 2 * SCREEN_WIDTH
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; lucky number show ; lucky number show
wLuckyNumberDigitsBuffer:: ds 5 wLuckyNumberDigitsBuffer:: ds 5
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; movement buffer data ; movement buffer data
wMovementBufferCount:: db wMovementBufferCount:: db
wMovementBufferObject:: db wMovementBufferObject:: db
@ -1760,7 +1810,9 @@ wUnusedMovementBufferBank:: db
wUnusedMovementBufferPointer:: dw wUnusedMovementBufferPointer:: dw
wMovementBuffer:: ds 55 wMovementBuffer:: ds 55
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; box printing ; box printing
wWhichBoxMonToPrint:: db wWhichBoxMonToPrint:: db
wFinishedPrintingBox:: db wFinishedPrintingBox:: db
@ -1768,46 +1820,64 @@ wAddrOfBoxToPrint:: dw
wBankOfBoxToPrint:: db wBankOfBoxToPrint:: db
wWhichBoxToPrint:: db wWhichBoxToPrint:: db
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; Unown printing ; Unown printing
wPrintedUnownTileSource:: ds 1 tiles wPrintedUnownTileSource:: ds 1 tiles
wPrintedUnownTileDest:: ds 1 tiles wPrintedUnownTileDest:: ds 1 tiles
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; trainer HUD data ; trainer HUD data
ds 1 ds 1
wPlaceBallsDirection:: db wPlaceBallsDirection:: db
wTrainerHUDTiles:: ds 4 wTrainerHUDTiles:: ds 4
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; mobile participant nicknames ; mobile participant nicknames
ds 4 ds 4
wMobileParticipant1Nickname:: ds NAME_LENGTH_JAPANESE wMobileParticipant1Nickname:: ds NAME_LENGTH_JAPANESE
wMobileParticipant2Nickname:: ds NAME_LENGTH_JAPANESE wMobileParticipant2Nickname:: ds NAME_LENGTH_JAPANESE
wMobileParticipant3Nickname:: ds NAME_LENGTH_JAPANESE wMobileParticipant3Nickname:: ds NAME_LENGTH_JAPANESE
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; battle exp gain ; battle exp gain
wExperienceGained:: ds 3 wExperienceGained:: ds 3
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; earthquake data buffer ; earthquake data buffer
wEarthquakeMovementDataBuffer:: ds 5 wEarthquakeMovementDataBuffer:: ds 5
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; switching items in pack ; switching items in pack
wSwitchItemBuffer:: ds 2 ; may store 1 or 2 bytes wSwitchItemBuffer:: ds 2 ; may store 1 or 2 bytes
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; switching pokemon in party ; switching pokemon in party
; may store NAME_LENGTH, PARTYMON_STRUCT_LENGTH, or MAIL_STRUCT_LENGTH bytes ; may store NAME_LENGTH, PARTYMON_STRUCT_LENGTH, or MAIL_STRUCT_LENGTH bytes
wSwitchMonBuffer:: ds 48 wSwitchMonBuffer:: ds 48
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; giving pokemon mail ; giving pokemon mail
wMonMailMessageBuffer:: ds MAIL_MSG_LENGTH + 1 wMonMailMessageBuffer:: ds MAIL_MSG_LENGTH + 1
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; bill's pc ; bill's pc
UNION UNION
wBoxNameBuffer:: ds BOX_NAME_LENGTH wBoxNameBuffer:: ds BOX_NAME_LENGTH
@ -1817,12 +1887,16 @@ wBillsPCTempListIndex:: db
wBillsPCTempBoxCount:: db wBillsPCTempBoxCount:: db
ENDU ENDU
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; prof. oak's pc ; prof. oak's pc
wTempPokedexSeenCount:: db wTempPokedexSeenCount:: db
wTempPokedexCaughtCount:: db wTempPokedexCaughtCount:: db
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; player's room pc ; player's room pc
UNION UNION
wDecoNameBuffer:: ds ITEM_NAME_LENGTH wDecoNameBuffer:: ds ITEM_NAME_LENGTH
@ -1831,13 +1905,17 @@ wNumOwnedDecoCategories:: db
wOwnedDecoCategories:: ds 16 wOwnedDecoCategories:: ds 16
ENDU ENDU
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; trade ; trade
wCurTradePartyMon:: db wCurTradePartyMon:: db
wCurOTTradePartyMon:: db wCurOTTradePartyMon:: db
wBufferTrademonNickname:: ds MON_NAME_LENGTH wBufferTrademonNickname:: ds MON_NAME_LENGTH
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; link battle record data ; link battle record data
wLinkBattleRecordBuffer:: wLinkBattleRecordBuffer::
wLinkBattleRecordName:: ds NAME_LENGTH wLinkBattleRecordName:: ds NAME_LENGTH
@ -1845,7 +1923,9 @@ wLinkBattleRecordWins:: dw
wLinkBattleRecordLosses:: dw wLinkBattleRecordLosses:: dw
wLinkBattleRecordDraws:: dw wLinkBattleRecordDraws:: dw
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; miscellaneous ; miscellaneous
wTempDayOfWeek:: wTempDayOfWeek::
wPrevPartyLevel:: wPrevPartyLevel::
@ -1858,13 +1938,17 @@ wApricorns::
wSuicuneFrame:: wSuicuneFrame::
db db
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; debug color picker ; debug color picker
wDebugColorIsTrainer:: db wDebugColorIsTrainer:: db
wDebugColorIsShiny:: db wDebugColorIsShiny:: db
wDebugColorCurTMHM:: db wDebugColorCurTMHM:: db
NEXTU
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; mobile? ; mobile?
wd002:: ds 1 wd002:: ds 1
wd003:: ds 1 wd003:: ds 1
@ -1892,9 +1976,11 @@ wd033:: ds 1
wd034:: ds 2 wd034:: ds 2
wd036:: ds 2 wd036:: ds 2
NEXTU
; Every previous NEXTU takes up 60 or fewer bytes, SECTION UNION "Miscellaneous WRAM 1", WRAMX
; except the initial "mon buffer" UNION.
; Every previous SECTION UNION takes up 60 or fewer bytes,
; except the initial "mon buffer" one.
ds 60 ds 60
UNION UNION
@ -2018,7 +2104,9 @@ wPoisonStepDataEnd::
ENDU ENDU
ds 23 ds 23
ENDU
SECTION "More WRAM 1", WRAMX
wTMHMMoveNameBackup:: ds MOVE_NAME_LENGTH wTMHMMoveNameBackup:: ds MOVE_NAME_LENGTH
@ -2928,7 +3016,6 @@ wCurBox:: db
ds 2 ds 2
; 8 chars + $50
wBoxNames:: ds BOX_NAME_LENGTH * NUM_BOXES wBoxNames:: ds BOX_NAME_LENGTH * NUM_BOXES
wCelebiEvent:: wCelebiEvent::