Merge branch 'master' of https://github.com/pret/pokered
Some checks failed
CI / build (push) Has been cancelled

This commit is contained in:
dannye 2025-11-12 17:56:10 -06:00
commit 324ae167d1
72 changed files with 499 additions and 446 deletions

View File

@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@master
with:
path: rgbds
ref: v0.9.3
ref: v1.0.0
repository: gbdev/rgbds
- name: Install rgbds

View File

@ -1 +1 @@
0.9.3
1.0.0

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.
Then follow the [**rgbds** install instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 0.9.3**.
Then follow the [**rgbds** install instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 1.0.0**.
**Note:** If you already have an installed rgbds older than 0.9.3, you will need to update to 0.9.3. Ignore this if you have never installed rgbds before. If a version newer than 0.9.3 does not work, try downloading 0.9.3.
**Note:** If you already have an installed rgbds older than 1.0.0, you will need to update to 1.0.0. Ignore this if you have never installed rgbds before. If a version newer than 1.0.0 does not work, try downloading 1.0.0.
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.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 0.9.3**.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 1.0.0**.
Now you're ready to [build **pokeyellow**](#build-pokeyellow).
@ -84,7 +84,7 @@ To install the software required for **pokeyellow**:
sudo apt-get install make gcc git
```
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.3** from source.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 1.0.0** from source.
### OpenSUSE
@ -94,7 +94,7 @@ To install the software required for **pokeyellow**:
sudo zypper install make gcc git
```
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.3** from source.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 1.0.0** from source.
### Arch Linux
@ -104,7 +104,7 @@ To install the software required for **pokeyellow**:
sudo pacman -S make gcc git rgbds
```
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.3** from source.
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 1.0.0** from source.
### Termux
@ -120,7 +120,7 @@ To install **rgbds**:
pkg install rgbds
```
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.3** from source.
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 1.0.0** from source.
### Other distros
@ -131,7 +131,7 @@ If your distro is not listed here, try to find the required software in its repo
- `git`
- `rgbds`
If `rgbds` is not available, you'll need to follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.3** from source.
If `rgbds` is not available, you'll need to follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 1.0.0** from source.
Now you're ready to [build **pokeyellow**](#build-pokeyellow).
@ -153,8 +153,8 @@ make
### 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.9.3 globally. Instead, you can put its files in a directory within pokeyellow, such as `pokeyellow/rgbds-0.9.3/`. 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 1.0.0 globally. Instead, you can put its files in a directory within pokeyellow, such as `pokeyellow/rgbds-1.0.0/`. Then specify it when you run `make`:
```bash
make RGBDS=rgbds-0.9.3/
make RGBDS=rgbds-1.0.0/
```

View File

@ -36,6 +36,11 @@ RGBFIX ?= $(RGBDS)rgbfix
RGBGFX ?= $(RGBDS)rgbgfx
RGBLINK ?= $(RGBDS)rgblink
RGBASMFLAGS ?= -Weverything -Wtruncation=1
RGBLINKFLAGS ?= -Weverything -Wtruncation=1
RGBFIXFLAGS ?= -Weverything
RGBGFXFLAGS ?= -Weverything
### Build targets
@ -82,7 +87,7 @@ tools:
$(MAKE) -C tools/
RGBASMFLAGS = -Q8 -P includes.asm -Weverything -Wtruncation=1
RGBASMFLAGS += -Q8 -P includes.asm
# Create a sym/map for debug purposes if `make` run with `DEBUG=1`
ifeq ($(DEBUG),1)
RGBASMFLAGS += -E
@ -120,15 +125,19 @@ $(foreach obj, $(pokeyellow_vc_obj), $(eval $(call DEP,$(obj),$(obj:_vc.o=.asm))
endif
pokeyellow_pad = 0x00
pokeyellow_debug_pad = 0xff
pokeyellow_vc_pad = 0x00
RGBLINKFLAGS += -d
pokeyellow.gbc: RGBLINKFLAGS += -p 0x00
pokeyellow_debug.gbc: RGBLINKFLAGS += -p 0xff
pokeyellow_vc.gbc: RGBLINKFLAGS += -p 0x00
opts = -cjsv -k 01 -l 0x33 -m MBC5+RAM+BATTERY -p 0 -r 03 -t "POKEMON YELLOW"
RGBFIXFLAGS += -cjsv -k 01 -l 0x33 -m MBC5+RAM+BATTERY -p 0 -r 03 -t "POKEMON YELLOW"
pokeyellow.gbc: RGBFIXFLAGS += -p 0x00
pokeyellow_debug.gbc: RGBFIXFLAGS += -p 0xff
pokeyellow_vc.gbc: RGBFIXFLAGS += -p 0x00
%.gbc: $$(%_obj) layout.link
$(RGBLINK) -p $($*_pad) -w -m $*.map -n $*.sym -l layout.link -o $@ $(filter %.o,$^)
$(RGBFIX) -p $($*_pad) $(opts) $@
$(RGBLINK) $(RGBLINKFLAGS) -l layout.link -m $*.map -n $*.sym -o $@ $(filter %.o,$^)
$(RGBFIX) $(RGBFIXFLAGS) $@
### Misc file-specific graphics rules
@ -157,12 +166,12 @@ gfx/surfing_pikachu/surfing_pikachu_1c.2bpp: tools/gfx += --trim-whitespace
### Catch-all graphics rules
%.2bpp: %.png
$(RGBGFX) --colors dmg=e4 $(rgbgfx) -o $@ $<
$(RGBGFX) --colors dmg $(RGBGFXFLAGS) -o $@ $<
$(if $(tools/gfx),\
tools/gfx $(tools/gfx) -o $@ $@ || $$($(RM) $@ && false))
%.1bpp: %.png
$(RGBGFX) --colors dmg=e4 $(rgbgfx) --depth 1 -o $@ $<
$(RGBGFX) --colors dmg $(RGBGFXFLAGS) --depth 1 -o $@ $<
$(if $(tools/gfx),\
tools/gfx $(tools/gfx) --depth 1 -o $@ $@ || $$($(RM) $@ && false))

View File

@ -64,7 +64,6 @@ DEF HOF_MON EQU $10
DEF HOF_TEAM EQU PARTY_LENGTH * HOF_MON
DEF HOF_TEAM_CAPACITY EQU 50
; mon data locations
; Note that some values are not supported by all functions that use these values.
const_def
@ -74,15 +73,14 @@ DEF HOF_TEAM_CAPACITY EQU 50
const DAYCARE_DATA ; 3
const BATTLE_MON_DATA ; 4
; See data/pokemon/evos_moves.asm
; Evolution types
const_def 1
const EVOLVE_LEVEL ; 1
const EVOLVE_ITEM ; 2
const EVOLVE_TRADE ; 3
; evolution data (see data/pokemon/evos_moves.asm)
DEF NUM_EVOS_IN_BUFFER EQU 3
; wMonHGrowthRate values
; GrowthRateTable indexes (see data/growth_rates.asm)

View File

@ -1,5 +1,5 @@
DEF NAME_LENGTH EQU 11
DEF ITEM_NAME_LENGTH EQU 13
DEF NAME_LENGTH EQU 11
DEF ITEM_NAME_LENGTH EQU 13
DEF NAME_BUFFER_LENGTH EQU 20
DEF NAME_LENGTH_JP EQU 6
@ -9,9 +9,9 @@ DEF NAME_LENGTH_JP EQU 6
const BIT_LEFT_ALIGN ; 6
const BIT_LEADING_ZEROES ; 7
DEF MONEY_SIGN EQU (1 << BIT_MONEY_SIGN)
DEF LEFT_ALIGN EQU (1 << BIT_LEFT_ALIGN)
DEF LEADING_ZEROES EQU (1 << BIT_LEADING_ZEROES)
DEF MONEY_SIGN EQU 1 << BIT_MONEY_SIGN
DEF LEFT_ALIGN EQU 1 << BIT_LEFT_ALIGN
DEF LEADING_ZEROES EQU 1 << BIT_LEADING_ZEROES
; special text IDs (see home/text_script.asm)
const_def $d0

View File

@ -13,7 +13,8 @@ TradeMons:
; Red/Green. Japanese Blue changed _AfterTrade2Text to say your Pokémon
; "went and evolved" and also changed the trades to match. English
; Red/Blue uses the original JP Red/Green trades but with the JP Blue
; post-trade text.
; post-trade text. English Yellow changed _AfterTrade2Text to
; not mention evolution.
npctrade LICKITUNG, DUGTRIO, TRADE_DIALOGSET_CASUAL, "GURIO"
npctrade CLEFAIRY, MR_MIME, TRADE_DIALOGSET_CASUAL, "MILES"
npctrade BUTTERFREE, BEEDRILL, TRADE_DIALOGSET_HAPPY, "STINGER" ; unused

View File

@ -1689,7 +1689,7 @@ _AnimationSquishMonPic:
call AnimCopyRowRight
inc hl
.next
ld [hl], " "
ld [hl], ' '
pop hl
ld de, SCREEN_WIDTH
add hl, de
@ -1922,7 +1922,7 @@ _AnimationSlideMonOff:
; bugfix: compares against the max tile + 1 as opposed to the max tile
cp $62
ret c
ld a, " "
ld a, ' '
ret
.EnemyNextTile
@ -1932,7 +1932,7 @@ _AnimationSlideMonOff:
; the lower right tile is in the first column to slide off the screen.
cp $30
ret c
ld a, " "
ld a, ' '
ret
AnimationSlideMonHalfOff:

View File

@ -20,7 +20,7 @@ SlidePlayerAndEnemySilhouettesOnScreen:
ld hl, vBGMap0
ld bc, TILEMAP_AREA
.clearBackgroundLoop
ld a, " "
ld a, ' '
ld [hli], a
dec bc
ld a, b
@ -2059,11 +2059,11 @@ CenterMonName:
.loop
inc de
ld a, [de]
cp "@"
cp '@'
jr z, .done
inc de
ld a, [de]
cp "@"
cp '@'
jr z, .done
dec hl
dec b
@ -2120,15 +2120,15 @@ DisplayBattleMenu::
call CopyData
; the following simulates the keystrokes by drawing menus on screen
hlcoord 9, 14
ld [hl], "▶"
ld [hl], '▶'
ld c, 20
call DelayFrames
ld [hl], " "
ld [hl], ' '
hlcoord 9, 16
ld [hl], "▶"
ld [hl], '▶'
ld c, 20
call DelayFrames
ld [hl], "▷"
ld [hl], '▷'
ld a, $2 ; select the "ITEM" menu
jp .upperLeftMenuItemWasNotSelected
.oldManName
@ -2148,7 +2148,7 @@ DisplayBattleMenu::
.leftColumn ; put cursor in left column of menu
ld a, [wBattleType]
cp BATTLE_TYPE_SAFARI
ld a, " "
ld a, ' '
jr z, .safariLeftColumn
; put cursor in left column for normal battle menu (i.e. when it's not a Safari battle)
ldcoord_a 15, 14 ; clear upper cursor position in right column
@ -2181,7 +2181,7 @@ DisplayBattleMenu::
.rightColumn ; put cursor in right column of menu
ld a, [wBattleType]
cp BATTLE_TYPE_SAFARI
ld a, " "
ld a, ' '
jr z, .safariRightColumn
; put cursor in right column for normal battle menu (i.e. when it's not a Safari battle)
ldcoord_a 9, 14 ; clear upper cursor position in left column
@ -2432,7 +2432,7 @@ PartyMenuOrRockOrRun:
.partyMonDeselected
hlcoord 11, 11
ld bc, 6 * SCREEN_WIDTH + 9
ld a, " "
ld a, ' '
call FillMemory
xor a ; NORMAL_PARTY_MENU
ld [wPartyMenuTypeOrMessageID], a
@ -2600,9 +2600,9 @@ MoveSelectionMenu:
; so it is necessary to put the di ei block to not cause tearing
call TextBoxBorder
hlcoord 4, 12
ld [hl], "─"
ld [hl], '─'
hlcoord 10, 12
ld [hl], "┘"
ld [hl], '┘'
ei
hlcoord 6, 13
call .writemoves
@ -2704,7 +2704,7 @@ SelectMenuItem:
dec a
ld bc, SCREEN_WIDTH
call AddNTimes
ld [hl], "▷"
ld [hl], '▷'
.select
ld hl, hUILayoutFlags
set BIT_DOUBLE_SPACED_MENU, [hl]
@ -3057,9 +3057,9 @@ PrintMenuItem:
ld de, TypeText
call PlaceString
hlcoord 7, 11
ld [hl], "/"
ld [hl], '/'
hlcoord 5, 9
ld [hl], "/"
ld [hl], '/'
hlcoord 5, 11
ld de, wBattleMenuCurrentPP
lb bc, 1, 2

View File

@ -779,7 +779,7 @@ FellText:
PrintStatText:
ld hl, StatModTextStrings
ld c, "@"
ld c, '@'
.findStatName_outer
dec b
jr z, .foundStatName

View File

@ -76,17 +76,17 @@ InitWildBattle:
ld [hli], a ; write front sprite pointer
ld [hl], b
ld hl, wEnemyMonNick ; set name to "GHOST"
ld a, "G"
ld a, 'G'
ld [hli], a
ld a, "H"
ld a, 'H'
ld [hli], a
ld a, "O"
ld a, 'O'
ld [hli], a
ld a, "S"
ld a, 'S'
ld [hli], a
ld a, "T"
ld a, 'T'
ld [hli], a
ld [hl], "@"
ld [hl], '@'
ld a, [wCurPartySpecies]
push af
ld a, MON_GHOST

View File

@ -12,9 +12,9 @@ DisplayLinkBattleVersusTextBox:
call PlaceString
; place bold "VS" tiles between the names
hlcoord 9, 8
ld a, "<BOLD_V>"
ld a, '<BOLD_V>'
ld [hli], a
ld [hl], "<BOLD_S>"
ld [hl], '<BOLD_S>'
xor a
ld [wUpdateSpritesEnabled], a
callfar SetupPlayerAndEnemyPokeballs

View File

@ -17,7 +17,7 @@ FormatMovesString:
ld hl, wNameBuffer
.copyNameLoop
ld a, [hli]
cp "@"
cp '@'
jr z, .doneCopyingName
ld [de], a
inc de
@ -26,7 +26,7 @@ FormatMovesString:
ld a, b
ld [wNumMovesMinusOne], a
inc b
ld a, "<NEXT>"
ld a, '<NEXT>'
ld [de], a
inc de
pop hl
@ -35,19 +35,19 @@ FormatMovesString:
jr z, .done
jr .printMoveNameLoop
.printDashLoop
ld a, "-"
ld a, '-'
ld [de], a
inc de
inc b
ld a, b
cp NUM_MOVES
jr z, .done
ld a, "<NEXT>"
ld a, '<NEXT>'
ld [de], a
inc de
jr .printDashLoop
.done
ld a, "@"
ld a, '@'
ld [de], a
ret

View File

@ -25,7 +25,7 @@ PrintType:
; erase "TYPE2/" if the mon only has 1 type
EraseType2Text:
ld a, " "
ld a, ' '
ld bc, $13
add hl, bc
ld bc, $6

View File

@ -14,7 +14,7 @@ SaveTrainerName::
ld a, [hli]
ld [de], a
inc de
cp "@"
cp '@'
jr nz, .CopyCharacter
ret

View File

@ -131,11 +131,11 @@ Func_fe7ca:
push hl
push bc
dec hl
ld a, "▶"
ld a, '▶'
ld [hl], a
ld bc, 11
add hl, bc
ld a, " "
ld a, ' '
ld [hl], a
push de
pop de
@ -232,13 +232,13 @@ Func_fe85d:
ld [wWhichPokemon], a
dec de
dec hl
ld a, " "
ld a, ' '
ld [hl], a
push bc
ld bc, hMovingBGTilesCounter1
add hl, bc
pop bc
ld a, "▶"
ld a, '▶'
ld [hl], a
inc hl
push hl
@ -254,11 +254,11 @@ Func_fe880:
ld [wWhichPokemon], a
inc de
dec hl
ld a, " "
ld a, ' '
ld [hl], a
ld bc, SCREEN_WIDTH * 2
add hl, bc
ld a, "▶"
ld a, '▶'
ld [hl], a
inc hl
push hl
@ -270,11 +270,11 @@ Func_fe8a1:
push hl
push bc
dec hl
ld a, " "
ld a, ' '
ld [hl], a
ld bc, 11
add hl, bc
ld a, "▶"
ld a, '▶'
ld [hl], a
pop bc
pop hl
@ -352,7 +352,7 @@ Func_fe912:
push hl
ld bc, 10
add hl, bc
ld a, " "
ld a, ' '
ld [hl], a
pop hl
ld bc, hMovingBGTilesCounter1
@ -360,7 +360,7 @@ Func_fe912:
push hl
ld bc, 10
add hl, bc
ld a, "▶"
ld a, '▶'
ld [hl], a
call Func_fe964
pop hl
@ -376,7 +376,7 @@ Func_fe93b:
push hl
ld bc, 10
add hl, bc
ld a, " "
ld a, ' '
ld [hl], a
pop hl
ld bc, SCREEN_WIDTH * 2
@ -384,7 +384,7 @@ Func_fe93b:
push hl
ld bc, 10
add hl, bc
ld a, "▶"
ld a, '▶'
ld [hl], a
call Func_fe964
pop hl
@ -532,10 +532,10 @@ Func_fe97f:
pop bc
; fallthrough
Func_fea78:
ld a, " "
ld a, ' '
ldcoord_a 0, 8
ldcoord_a 15, 8
ld a, "▶"
ld a, '▶'
ldcoord_a 0, 4
; fallthrough
Func_fea85:
@ -566,7 +566,7 @@ Func_fea9d:
jr nz, .asm_feace
ld a, 2
ld [wIsInBattle], a
ld a, " "
ld a, ' '
ldcoord_a 4, 3
hlcoord 1, 4
ld de, Text_fedb2
@ -575,7 +575,7 @@ Func_fea9d:
.asm_feace
ld a, 1
ld [wIsInBattle], a
ld a, " "
ld a, ' '
ldcoord_a 1, 3
hlcoord 1, 4
ld de, Text_feda8
@ -583,9 +583,9 @@ Func_fea9d:
jp Func_fea85
Func_feae4:
ld a, "▶"
ld a, '▶'
ldcoord_a 0, 8
ld a, " "
ld a, ' '
ldcoord_a 15, 8
ldcoord_a 0, 4
; fallthrough
@ -694,9 +694,9 @@ Func_feb82:
jp Func_feb64
Func_febba:
ld a, " "
ld a, ' '
ldcoord_a 0, 8
ld a, "▶"
ld a, '▶'
ldcoord_a 15, 8
; fallthrough
Func_febc4:
@ -940,9 +940,9 @@ Func_fedfe:
; fallthrough
Func_fee23:
hlcoord 0, 3
ld [hl], " "
ld [hl], ' '
hlcoord 0, 1
ld [hl], "▶"
ld [hl], '▶'
call Func_fee60
.asm_fee30
call DelayFrame
@ -995,11 +995,11 @@ Func_fee60:
Func_fee96:
hlcoord 0, 1
ld [hl], " "
ld [hl], ' '
hlcoord 0, 3
ld [hl], "▶"
ld [hl], '▶'
hlcoord 0, 5
ld [hl], " "
ld [hl], ' '
call Func_feee2
call Func_feeef
.asm_feeab
@ -1173,13 +1173,13 @@ Func_fefc5:
pop de
pop hl
push hl
ld [hl], "▶"
ld [hl], '▶'
ld bc, hMovingBGTilesCounter1
add hl, bc
ld [hl], " "
ld [hl], ' '
ld bc, SCREEN_WIDTH * 4
add hl, bc
ld [hl], " "
ld [hl], ' '
pop hl
inc hl
ld a, [de]
@ -1218,7 +1218,7 @@ Func_ff006:
callfar Func_3b079
pop hl
jr c, .asm_ff036
ld [hl], "×"
ld [hl], '×'
.asm_ff036
pop af
ld [wCurPartySpecies], a
@ -1296,13 +1296,13 @@ Func_ff09e:
push de
push bc
push hl
ld [hl], "▶"
ld [hl], '▶'
ld bc, hMovingBGTilesCounter1
add hl, bc
ld [hl], " "
ld [hl], ' '
ld bc, SCREEN_WIDTH * 4
add hl, bc
ld [hl], " "
ld [hl], ' '
pop hl
inc hl
ld a, [de]
@ -1454,13 +1454,13 @@ Func_ff1b9:
; fallthrough
Func_ff1e7:
hlcoord 2, 13
ld [hl], "゙"
ld [hl], '゙'
hlcoord 1, 14
ld [hl], "レ"
ld [hl], 'レ'
inc hl
ld [hl], "へ"
ld [hl], 'へ'
inc hl
ld [hl], "ル"
ld [hl], 'ル'
inc hl
inc hl
ld de, wCurEnemyLevel

View File

@ -24,15 +24,15 @@ _GivePokemon::
cp 9
jr c, .singleDigitBoxNum
sub 9
ld [hl], "1"
ld [hl], '1'
inc hl
add "0"
add '0'
jr .next
.singleDigitBoxNum
add "1"
add '1'
.next
ld [hli], a
ld [hl], "@"
ld [hl], '@'
ld hl, SentToBoxText
call PrintText
scf

View File

@ -42,7 +42,7 @@ DisplayDexRating:
inc de
.copyRatingTextLoop
ld a, [hli]
cp "@"
cp '@'
jr z, .doneCopying
ld [de], a
inc de

View File

@ -221,7 +221,7 @@ UpdateHPBar_PrintHPNumber:
.hpBelowBar
add hl, de
push hl
ld a, " "
ld a, ' '
ld [hli], a
ld [hli], a
ld [hli], a

View File

@ -2441,7 +2441,7 @@ ItemUseTMHM:
.chooseMon
ld hl, wStringBuffer
ld de, wTempMoveNameBuffer
ld bc, 14
ld bc, ITEM_NAME_LENGTH + 1
call CopyData ; save the move name because DisplayPartyMenu will overwrite it
ld a, $ff
ld [wUpdateSpritesEnabled], a
@ -2451,7 +2451,7 @@ ItemUseTMHM:
push af
ld hl, wTempMoveNameBuffer
ld de, wStringBuffer
ld bc, 14
ld bc, ITEM_NAME_LENGTH + 1
call CopyData
pop af
jr nc, .checkIfAbleToLearnMove

View File

@ -57,7 +57,7 @@ DisplayTownMap:
ld a, [hli]
ld [de], a
inc de
cp "@"
cp '@'
jr nz, .copyMapName
hlcoord 1, 0
ld de, wNameBuffer
@ -176,7 +176,7 @@ LoadTownMap_Fly::
ld hl, wFlyLocationsList
decoord 18, 0
.townMapFlyLoop
ld a, " "
ld a, ' '
ld [de], a
push hl
push hl
@ -193,9 +193,9 @@ LoadTownMap_Fly::
ld c, 15
call DelayFrames
hlcoord 18, 0
ld [hl], "▲"
ld [hl], '▲'
hlcoord 19, 0
ld [hl], "▼"
ld [hl], '▼'
pop hl
.inputLoop
push hl
@ -373,7 +373,7 @@ DrawPlayerOrBirdSprite:
ld a, [hli]
ld [de], a
inc de
cp "@"
cp '@'
jr nz, .loop
ld hl, wShadowOAM
ld de, wShadowOAMBackup

View File

@ -488,7 +488,7 @@ TradeCenter_SelectMon:
ld a, 16
ld [wTopMenuItemY], a
.selectStatsMenuItem
ld a, " "
ld a, ' '
ldcoord_a 11, 16
ld a, PAD_RIGHT | PAD_B | PAD_A
ld [wMenuWatchedKeys], a
@ -505,7 +505,7 @@ TradeCenter_SelectMon:
call LoadScreenTilesFromBuffer1
jp .playerMonMenu
.selectTradeMenuItem
ld a, " "
ld a, ' '
ldcoord_a 1, 16
ld a, PAD_LEFT | PAD_B | PAD_A
ld [wMenuWatchedKeys], a
@ -553,10 +553,10 @@ TradeCenter_SelectMon:
ld l, a
ld a, [wMenuCursorLocation + 1]
ld h, a
ld a, " "
ld a, ' '
ld [hl], a
.cancelMenuItem_Loop
ld a, "▶" ; filled arrow cursor
ld a, '▶' ; filled arrow cursor
ldcoord_a 1, 16
.cancelMenuItem_JoypadLoop
call JoypadLowSensitivity
@ -568,14 +568,14 @@ TradeCenter_SelectMon:
bit B_PAD_UP, a
jr z, .cancelMenuItem_JoypadLoop
; if Up pressed
ld a, " "
ld a, ' '
ldcoord_a 1, 16
ld a, [wPartyCount]
dec a
ld [wCurrentMenuItem], a
jp .playerMonMenu
.cancelMenuItem_APressed
ld a, "▷" ; unfilled arrow cursor
ld a, '▷' ; unfilled arrow cursor
ldcoord_a 1, 16
ld a, $f
ld [wSerialExchangeNybbleSendData], a
@ -624,7 +624,7 @@ TradeCenter_PlaceSelectedEnemyMonMenuCursor:
hlcoord 1, 9
ld bc, SCREEN_WIDTH
call AddNTimes
ld [hl], "▷" ; cursor
ld [hl], '▷' ; cursor
ret
TradeCenter_DisplayStats:
@ -956,7 +956,7 @@ CableClub_TextBoxBorder:
push hl
ld a, $7b ; border left vertical line tile
ld [hli], a
ld a, " "
ld a, ' '
call CableClub_DrawHorizontalLine
ld [hl], $77 ; border right vertical line tile
pop hl

View File

@ -109,10 +109,10 @@ Func_f531b::
call Serial_SendZeroByte
dec b
jr nz, .loop
ld b, " "
ld c, " "
ld d, " "
ld e, "▷"
ld b, ' '
ld c, ' '
ld d, ' '
ld e, '▷'
ld a, [wLinkMenuSelectionSendBuffer]
bit 3, a
jr nz, .asm_f541a
@ -358,7 +358,7 @@ PetitCup::
ld hl, wNameBuffer
.loop2
ld a, [hli]
cp "@"
cp '@'
jr nz, .loop2
ld a, [hli]
cp $7
@ -736,10 +736,10 @@ LinkMenu:
ld a, SC_START | SC_INTERNAL
ldh [rSC], a
.skipStartingTransfer
ld b, " "
ld c, " "
ld d, " "
ld e, "▷"
ld b, ' '
ld c, ' '
ld d, ' '
ld e, '▷'
ld a, [wLinkMenuSelectionSendBuffer]
and PAD_B << 2 ; was B button pressed?
jr nz, .updateCursorPosition
@ -811,10 +811,10 @@ LinkMenu:
ld a, [wNamedObjectIndex]
and a
jr nz, .asm_f5974
ld b, " "
ld c, " "
ld d, "▷"
ld e, " "
ld b, ' '
ld c, ' '
ld d, '▷'
ld e, ' '
call Func_f59ec
.asm_f5974
xor a
@ -856,10 +856,10 @@ LinkMenu:
ld a, [wNamedObjectIndex]
and a
jr z, .asm_f59cd
ld b, " "
ld c, " "
ld d, " "
ld e, "▷"
ld b, ' '
ld c, ' '
ld d, ' '
ld e, '▷'
call Func_f59ec
jp .choseCancel
@ -869,10 +869,10 @@ LinkMenu:
jp .choseCancel
.asm_f59d6
ld b, " "
ld c, " "
ld d, "▷"
ld e, " "
ld b, ' '
ld c, ' '
ld d, '▷'
ld e, ' '
call Func_f59ec
call Func_f531b
jp c, .choseCancel

View File

@ -284,7 +284,7 @@ CheckForPlayerNameInSRAM:
ld hl, sPlayerName
.loop
ld a, [hli]
cp "@"
cp '@'
jr z, .found
dec b
jr nz, .loop

View File

@ -39,7 +39,7 @@ AskName:
pop af
ld [wUpdateSpritesEnabled], a
ld a, [wStringBuffer]
cp "@"
cp '@'
ret nz
.declinedNickname
ld d, h
@ -63,7 +63,7 @@ DisplayNameRaterScreen::
call RestoreScreenTilesAndReloadTilePatterns
call LoadGBPal
ld a, [wStringBuffer]
cp "@"
cp '@'
jr z, .playerCancelled
ld hl, wPartyMonNicks
ld bc, NAME_LENGTH
@ -106,7 +106,7 @@ DisplayNamingScreen:
ld [wMenuWatchedKeys], a
ld a, 7
ld [wMaxMenuItem], a
ld a, "@"
ld a, '@'
ld [wStringBuffer], a
xor a
ld hl, wNamingScreenSubmitName
@ -229,10 +229,10 @@ DisplayNamingScreen:
ld [wNamingScreenLetter], a
call CalcStringLength
ld a, [wNamingScreenLetter]
cp "゙"
cp '゙'
ld de, Dakutens
jr z, .dakutensAndHandakutens
cp "゚"
cp '゚'
ld de, Handakutens
jr z, .dakutensAndHandakutens
ld a, [wNamingScreenType]
@ -257,7 +257,7 @@ DisplayNamingScreen:
.addLetter
ld a, [wNamingScreenLetter]
ld [hli], a
ld [hl], "@"
ld [hl], '@'
ld a, SFX_PRESS_AB
call PlaySound
ret
@ -267,7 +267,7 @@ DisplayNamingScreen:
ret z
call CalcStringLength
dec hl
ld [hl], "@"
ld [hl], '@'
ret
.pressedRight
ld a, [wCurrentMenuItem]
@ -457,7 +457,7 @@ CalcStringLength:
ld c, $0
.loop
ld a, [hl]
cp "@"
cp '@'
ret z
inc hl
inc c
@ -483,7 +483,7 @@ PrintNamingText:
call PlaceString
ld hl, $1
add hl, bc
ld [hl], "の" ; leftover from Japanese version; blank tile $c9 in English
ld [hl], 'の' ; leftover from Japanese version; blank tile $c9 in English
hlcoord 1, 3
ld de, NicknameTextString
jr .placeString

View File

@ -433,7 +433,7 @@ OptionsMenu_UpdateCursorPosition:
ld de, SCREEN_WIDTH
ld c, 16
.loop
ld [hl], " "
ld [hl], ' '
add hl, de
dec c
jr nz, .loop
@ -441,7 +441,7 @@ OptionsMenu_UpdateCursorPosition:
ld bc, SCREEN_WIDTH * 2
ld a, [wOptionsCursorLocation]
call AddNTimes
ld [hl], "▶"
ld [hl], '▶'
ret
InitOptionsMenu:

View File

@ -59,7 +59,7 @@ RedrawPartyMenu_::
dec hl
dec hl
dec hl
ld a, "▷" ; unfilled right arrow menu cursor
ld a, '▷' ; unfilled right arrow menu cursor
ld [hli], a ; place the cursor
inc hl
inc hl
@ -139,7 +139,7 @@ RedrawPartyMenu_::
ld l, a
ld de, wEvoDataBuffer
ld a, BANK(EvosMovesPointerTable)
ld bc, 4 * 3 + 1 ; enough for Eevee's three 4-byte evolutions and 0 terminator
ld bc, wEvoDataBufferEnd - wEvoDataBuffer
call FarCopyData
ld hl, wEvoDataBuffer
ld de, .notAbleToEvolveText

View File

@ -136,7 +136,7 @@ ENDC
push bc
hlcoord 0, 3
ld de, 20
lb bc, " ", 13
lb bc, ' ', 13
call DrawTileLine ; cover up the menu cursor in the pokemon list
pop bc
ret
@ -145,7 +145,7 @@ ENDC
push bc
hlcoord 15, 8
ld de, 20
lb bc, " ", 9
lb bc, ' ', 9
call DrawTileLine ; cover up the menu cursor in the side menu
pop bc
jr .exitSideMenu
@ -266,7 +266,7 @@ Pokedex_DrawInterface:
ldh [hAutoBGTransferEnabled], a
; draw the horizontal line separating the seen and owned amounts from the menu
hlcoord 15, 6
ld a, "─"
ld a, '─'
ld [hli], a
ld [hli], a
ld [hli], a
@ -388,7 +388,7 @@ Pokedex_PlacePokemonList:
ld hl, wPokedexOwned
call IsPokemonBitSet
pop hl
ld a, " "
ld a, ' '
jr z, .writeTile
ld a, $72 ; pokeball tile
.writeTile
@ -558,9 +558,9 @@ DrawDexEntryOnScreen:
call IndexToPokedex
hlcoord 2, 8
ld a, "№"
ld a, '№'
ld [hli], a
ld a, "<DOT>"
ld a, '<DOT>'
ld [hli], a
ld de, wPokedexNum
lb bc, LEADING_ZEROES | 1, 3
@ -601,14 +601,14 @@ DrawDexEntryOnScreen:
hlcoord 12, 6
lb bc, 1, 2
call PrintNumber ; print feet (height)
ld a, ""
ld a, ''
ld [hl], a
inc de
inc de ; de = address of inches (height)
hlcoord 15, 6
lb bc, LEADING_ZEROES | 1, 2
call PrintNumber ; print inches (height)
ld a, "″"
ld a, '″'
ld [hl], a
; now print the weight (note that weight is stored in tenths of pounds internally)
inc de
@ -636,12 +636,12 @@ DrawDexEntryOnScreen:
ldh a, [hDexWeight]
sbc 0
jr nc, .next
ld [hl], "0" ; if the weight is less than 10, put a 0 before the decimal point
ld [hl], '0' ; if the weight is less than 10, put a 0 before the decimal point
.next
inc hl
ld a, [hli]
ld [hld], a ; make space for the decimal point by moving the last digit forward one tile
ld [hl], "<DOT>" ; decimal point tile
ld [hl], '<DOT>' ; decimal point tile
pop af
ldh [hDexWeight + 1], a ; restore original value of [hDexWeight + 1]
pop af

View File

@ -451,11 +451,11 @@ DisplayChangeBoxMenu:
jr c, .singleDigitBoxNum
sub 9
hlcoord 8, 2
ld [hl], "1"
add "0"
ld [hl], '1'
add '0'
jr .next
.singleDigitBoxNum
add "1"
add '1'
.next
ldcoord_a 9, 2
hlcoord 1, 2

View File

@ -306,7 +306,7 @@ ErasePartyMenuCursors::
ld bc, 2 * SCREEN_WIDTH ; menu cursor positions are 2 rows apart
ld a, 6 ; 6 menu cursor positions
.loop
ld [hl], " "
ld [hl], ' '
add hl, bc
dec a
jr nz, .loop
@ -346,7 +346,7 @@ StartMenu_Item::
jp RedisplayStartMenu
.choseItem
; erase menu cursor (blank each tile in front of an item name)
ld a, " "
ld a, ' '
ldcoord_a 5, 4
ldcoord_a 5, 6
ldcoord_a 5, 8
@ -499,7 +499,7 @@ DrawTrainerInfo:
predef DisplayPicCenteredOrUpperRight
call DisableLCD
hlcoord 0, 2
ld a, " "
ld a, ' '
call TrainerInfo_DrawVerticalLine
hlcoord 1, 2
call TrainerInfo_DrawVerticalLine
@ -689,7 +689,7 @@ SwitchPartyMon_ClearGfx:
ld bc, SCREEN_WIDTH * 2
call AddNTimes
ld c, SCREEN_WIDTH * 2
ld a, " "
ld a, ' '
.clearMonBGLoop ; clear the mon's row in the party menu
ld [hli], a
dec c

View File

@ -442,7 +442,7 @@ DisplayFieldMoveMonMenu:
jr z, .reachedName
.skipNameLoop ; skip past current name
ld a, [hli]
cp "@"
cp '@'
jr nz, .skipNameLoop
jr .skipNamesLoop
.reachedName

View File

@ -98,7 +98,7 @@ PlaceMenuCursorDuplicate:
jr nz, .loop2
.asm_f5ad5
ld a, [hl]
cp "▶"
cp '▶'
jr nz, .asm_f5ade
ld a, [wTileBehindCursor]
ld [hl], a
@ -114,11 +114,11 @@ PlaceMenuCursorDuplicate:
jr nz, .loop3
.asm_f5aec
ld a, [hl]
cp "▶"
cp '▶'
jr z, .asm_f5af4
ld [wTileBehindCursor], a
.asm_f5af4
ld a, "▶"
ld a, '▶'
ld [hl], a
ld a, l
ld [wMenuCursorLocation], a

View File

@ -171,7 +171,7 @@ FillFourRowsWithBlack:
FillMiddleOfScreenWithWhite:
hlcoord 0, 4
ld bc, SCREEN_WIDTH * 10
ld a, " "
ld a, ' '
jp FillMemory
FillLeftHalfOfScreenWithWhite:
@ -191,7 +191,7 @@ FillRightHalfOfScreenWithWhite:
FillHalfOfScreenWithWhite:
ld b, 10
ld c, 10
ld a, " "
ld a, ' '
.loop
push bc
push hl

View File

@ -8,7 +8,7 @@ AnimateHallOfFame:
call DisableLCD
ld hl, vBGMap0
ld bc, 2 * TILEMAP_AREA
ld a, " "
ld a, ' '
call FillMemory
call EnableLCD
ld hl, rLCDC

View File

@ -16,7 +16,7 @@ ChoosePlayerName:
ld [wNamingScreenType], a
call DisplayNamingScreen
ld a, [wStringBuffer]
cp "@"
cp '@'
jr z, .customName
call ClearScreen
call Delay3
@ -49,7 +49,7 @@ ChooseRivalName:
ld [wNamingScreenType], a
call DisplayNamingScreen
ld a, [wStringBuffer]
cp "@"
cp '@'
jr z, .customName
call ClearScreen
call Delay3
@ -199,7 +199,7 @@ GetDefaultName:
ld e, l
.innerLoop
ld a, [hli]
cp "@"
cp '@'
jr nz, .innerLoop
ld a, b
cp c

View File

@ -53,7 +53,7 @@ DisplayTitleScreen:
callfar LoadYellowTitleScreenGFX
ld hl, vBGMap0
ld bc, (vBGMap1 tile $40) - vBGMap0
ld a, " "
ld a, ' '
call FillMemory
callfar TitleScreen_PlacePokemonLogo
call FillSpriteBuffer0WithAA

View File

@ -151,7 +151,7 @@ Trade_Delay80:
Trade_ClearTileMap:
hlcoord 0, 0
ld bc, SCREEN_AREA
ld a, " "
ld a, ' '
jp FillMemory
LoadTradingGFXAndMonNames:
@ -169,7 +169,7 @@ LoadTradingGFXAndMonNames:
call FarCopyData
ld hl, vBGMap0
ld bc, 2 * TILEMAP_AREA
ld a, " "
ld a, ' '
call FillMemory
call ClearSprites
ld a, $ff

View File

@ -241,7 +241,7 @@ PrintSafariZoneSteps::
cp 10
jr nc, .tenOrMore
hlcoord 5, 3
ld a, " "
ld a, ' '
ld [hl], a
.tenOrMore
hlcoord 6, 3

View File

@ -16,10 +16,10 @@ LoadWildData::
jr z, .NoGrassData ; if no grass data, skip to surfing data
push hl
ld de, wGrassMons ; otherwise, load grass data
ld bc, $14
ld bc, WILDDATA_LENGTH - 1
call CopyData
pop hl
ld bc, $14
ld bc, WILDDATA_LENGTH - 1
add hl, bc
.NoGrassData
ld a, [hli]
@ -27,7 +27,7 @@ LoadWildData::
and a
ret z ; if no water data, we're done
ld de, wWaterMons ; otherwise, load surfing data
ld bc, $14
ld bc, WILDDATA_LENGTH - 1
jp CopyData
INCLUDE "data/wild/grass_water.asm"

View File

@ -154,11 +154,11 @@ BillsPCMenu:
; two digit box num
sub 9
hlcoord 17, 16
ld [hl], "1"
add "0"
ld [hl], '1'
add '0'
jr .next
.singleDigitBoxNum
add "1"
add '1'
.next
ldcoord_a 18, 16
hlcoord 10, 16
@ -258,15 +258,15 @@ BillsPCDeposit:
cp 9
jr c, .singleDigitBoxNum
sub 9
ld [hl], "1"
ld [hl], '1'
inc hl
add "0"
add '0'
jr .next
.singleDigitBoxNum
add "1"
add '1'
.next
ld [hli], a
ld [hl], "@"
ld [hl], '@'
ld hl, MonWasStoredText
call PrintText
jp BillsPCMenu

View File

@ -280,7 +280,7 @@ RenameEvolvedMon:
cp [hl]
inc hl
ret nz
cp "@"
cp '@'
jr nz, .compareNamesLoop
ld a, [wWhichPokemon]
ld bc, NAME_LENGTH

View File

@ -10,37 +10,37 @@ PrintStatusAilment::
jr nz, .par
and SLP_MASK
ret z
ld a, "S"
ld a, 'S'
ld [hli], a
ld a, "L"
ld a, 'L'
ld [hli], a
ld [hl], "P"
ld [hl], 'P'
ret
.psn
ld a, "P"
ld a, 'P'
ld [hli], a
ld a, "S"
ld a, 'S'
ld [hli], a
ld [hl], "N"
ld [hl], 'N'
ret
.brn
ld a, "B"
ld a, 'B'
ld [hli], a
ld a, "R"
ld a, 'R'
ld [hli], a
ld [hl], "N"
ld [hl], 'N'
ret
.frz
ld a, "F"
ld a, 'F'
ld [hli], a
ld a, "R"
ld a, 'R'
ld [hli], a
ld [hl], "Z"
ld [hl], 'Z'
ret
.par
ld a, "P"
ld a, 'P'
ld [hli], a
ld a, "A"
ld a, 'A'
ld [hli], a
ld [hl], "R"
ld [hl], 'R'
ret

View File

@ -52,7 +52,7 @@ DrawHP_:
ld de, wLoadedMonHP
lb bc, 2, 3
call PrintNumber
ld a, "/"
ld a, '/'
ld [hli], a
ld de, wLoadedMonMaxHP
lb bc, 2, 3
@ -110,9 +110,9 @@ StatusScreen:
call DrawLineBox ; Draws the box around name, HP and status
ld de, -6
add hl, de
ld [hl], "<DOT>"
ld [hl], '<DOT>'
dec hl
ld [hl], "№"
ld [hl], '№'
hlcoord 19, 9
lb bc, 8, 6
call DrawLineBox ; Draws the box around types, ID No. and OT
@ -343,13 +343,13 @@ StatusScreen2:
ld b, a ; Number of moves ?
hlcoord 11, 10
ld de, SCREEN_WIDTH * 2
ld a, "<BOLD_P>"
ld a, '<BOLD_P>'
call StatusScreen_PrintPP ; Print "PP"
ld a, b
and a
jr z, .InitPP
ld c, a
ld a, "-"
ld a, '-'
call StatusScreen_PrintPP ; Fill the rest with --
.InitPP
ld hl, wLoadedMonMoves
@ -386,7 +386,7 @@ StatusScreen2:
ld de, wStatusScreenCurrentPP
lb bc, 1, 2
call PrintNumber
ld a, "/"
ld a, '/'
ld [hli], a
ld de, wMaxPP
lb bc, 1, 2
@ -414,7 +414,7 @@ StatusScreen2:
ld [wLoadedMonLevel], a ; Increase temporarily if not 100
.Level100
hlcoord 14, 6
ld [hl], "<to>"
ld [hl], '<to>'
inc hl
inc hl
call PrintLevel
@ -483,7 +483,7 @@ StatusScreenExpText:
StatusScreen_ClearName:
ld bc, 10
ld a, " "
ld a, ' '
jp FillMemory
StatusScreen_PrintPP:

View File

@ -675,7 +675,7 @@ Printer_PrepareSurfingMinigameHighScoreTileMap::
.find_end_of_name
ld a, [hli]
inc c
cp "@"
cp '@'
jr nz, .find_end_of_name
ld a, 8
sub c
@ -778,7 +778,7 @@ PrintPCBox_DrawPage1:
call PrintPCBox_PlaceHorizontalLines
hlcoord 0, 0
ld bc, 11 * SCREEN_WIDTH
ld a, " "
ld a, ' '
call FillMemory
call PrintPCBox_DrawLeftAndRightBorders
call PrintPCBox_DrawTopBorder
@ -794,13 +794,13 @@ PrintPCBox_DrawPage1:
cp 9
jr c, .less_than_9
sub 9
ld [hl], "1"
ld [hl], '1'
inc hl
add "0"
add '0'
jr .placed_box_number
.less_than_9
add "1"
add '1'
.placed_box_number
ld [hl], a
hlcoord 4, 9
@ -846,7 +846,7 @@ PrintPCBox_DrawPage4:
call PrintPCBox_DrawBottomBorderAtHL
hlcoord 0, 16
ld bc, 2 * SCREEN_WIDTH
ld a, " "
ld a, ' '
call FillMemory
ld a, [wBoxDataStart]
cp 16
@ -872,14 +872,14 @@ PrintPCBox_PlaceBoxMonInfo:
push de
push hl
ld bc, 12
ld a, " "
ld a, ' '
call FillMemory
pop hl
push hl
ld de, SCREEN_WIDTH
add hl, de
ld bc, 12
ld a, " "
ld a, ' '
call FillMemory
pop hl
push hl
@ -896,7 +896,7 @@ PrintPCBox_PlaceBoxMonInfo:
pop hl
ld bc, SCREEN_WIDTH + 1
add hl, bc
ld [hl], " " ; blank tile instead of "/" separator in Yellow
ld [hl], ' ' ; blank tile instead of "/" separator in Yellow
inc hl
call PlaceString
ld hl, wBoxNumString

View File

@ -32,10 +32,10 @@ Printer_GetMonStats:
hlcoord 2, 10
ld a, $6e
ld [hli], a
ld [hl], " "
ld [hl], ' '
hlcoord 2, 11
ld [hl], ""
ld [hl], ''
hlcoord 4, 11
ld de, wLoadedMonMaxHP
@ -56,7 +56,7 @@ Printer_GetMonStats:
predef IndexToPokedex
hlcoord 2, 8
ld [hl], "№"
ld [hl], '№'
inc hl
ld [hl], $f2
inc hl

View File

@ -632,7 +632,7 @@ SlotMachine_PrintWinningSymbol:
inc a
ld [hl], a
hlcoord 18, 16
ld [hl], "▼"
ld [hl], '▼'
ret
SlotMachine_SubtractBetFromPlayerCoins:

View File

@ -172,39 +172,39 @@ GetFarByte::
ClearScreenArea::
; Clear tilemap area cxb at hl.
ld a, " " ; blank tile
ld de, 20 ; screen width
.y
ld a, ' '
ld de, SCREEN_WIDTH
.loopRows
push hl
push bc
.x
.loopTiles
ld [hli], a
dec c
jr nz, .x
jr nz, .loopTiles
pop bc
pop hl
add hl, de
dec b
jr nz, .y
jr nz, .loopRows
ret
CopyScreenTileBufferToVRAM::
; Copy wTileMap to the BG Map starting at b * $100.
; This is done in thirds of 6 rows, so it takes 3 frames.
ld c, 6
ld c, SCREEN_HEIGHT / 3
ld hl, $600 * 0
lb hl, 0, 0
decoord 0, 6 * 0
call .setup
call DelayFrame
ld hl, $600 * 1
lb hl, SCREEN_HEIGHT / 3, 0
decoord 0, 6 * 1
call .setup
call DelayFrame
ld hl, $600 * 2
lb hl, 2 * SCREEN_HEIGHT / 3, 0
decoord 0, 6 * 2
call .setup
jp DelayFrame
@ -226,10 +226,10 @@ CopyScreenTileBufferToVRAM::
ClearScreen::
; Clear wTileMap, then wait
; for the bg map to update.
ld bc, 20 * 18
ld bc, SCREEN_AREA
inc b
hlcoord 0, 0
ld a, " "
ld a, ' '
.loop
ld [hli], a
dec c

View File

@ -8,6 +8,6 @@ CopyString::
ld a, [de]
inc de
ld [hli], a
cp "@"
cp '@'
jr nz, CopyString
ret

View File

@ -66,7 +66,7 @@ DisplayListMenuIDLoop::
and a ; is it the Old Man battle?
jr z, .notOldManBattle
.oldManBattle
ld a, "▶"
ld a, '▶'
ldcoord_a 5, 4 ; place menu cursor in front of first menu entry
ld c, 20
call DelayFrames
@ -475,7 +475,7 @@ PrintListMenuEntries::
push hl
ld bc, SCREEN_WIDTH + 8 ; 1 row down and 8 columns right
add hl, bc
ld a, "×"
ld a, '×'
ld [hli], a
ld a, [wNamedObjectIndex]
push af
@ -503,7 +503,7 @@ PrintListMenuEntries::
cp c ; is it this item?
jr nz, .nextListEntry
dec hl
ld a, "▷"
ld a, '▷'
ld [hli], a
.nextListEntry
ld bc, 2 * SCREEN_WIDTH ; 2 rows
@ -514,7 +514,7 @@ PrintListMenuEntries::
jp nz, .loop
ld bc, -8
add hl, bc
ld a, "▼"
ld a, '▼'
ld [hl], a
ret
.printCancelMenuItem

View File

@ -16,7 +16,7 @@ GetMonName::
ld bc, NAME_LENGTH - 1
call CopyData
ld hl, wNameBuffer + NAME_LENGTH - 1
ld [hl], "@"
ld [hl], '@'
pop de
pop af
ldh [hLoadedROMBank], a
@ -74,7 +74,7 @@ GetMachineName::
; now get the machine number and convert it to text
ld a, [wNamedObjectIndex]
sub TM01 - 1
ld b, "0"
ld b, '0'
.FirstDigit
sub 10
jr c, .SecondDigit
@ -87,11 +87,11 @@ GetMachineName::
ld [de], a
inc de
pop af
ld b, "0"
ld b, '0'
add b
ld [de], a
inc de
ld a, "@"
ld a, '@'
ld [de], a
pop af
ld [wNamedObjectIndex], a

View File

@ -74,7 +74,7 @@ GetName::
ld e, l
.nextChar
ld a, [hli]
cp "@"
cp '@'
jr nz, .nextChar
inc c
ld a, b

View File

@ -349,11 +349,11 @@ PrintStatusCondition::
pop de
jr nz, PrintStatusConditionNotFainted
; if the pokemon's HP is 0, print "FNT"
ld a, "F"
ld a, 'F'
ld [hli], a
ld a, "N"
ld a, 'N'
ld [hli], a
ld [hl], "T"
ld [hl], 'T'
and a
ret
@ -365,7 +365,7 @@ PrintStatusConditionNotFainted::
; hl = destination address
; [wLoadedMonLevel] = level
PrintLevel::
ld a, "<LV>" ; ":L" tile ID
ld a, '<LV>' ; ":L" tile ID
ld [hli], a
ld c, 2 ; number of digits
ld a, [wLoadedMonLevel] ; level
@ -381,7 +381,7 @@ PrintLevel::
; hl = destination address
; [wLoadedMonLevel] = level
PrintLevelFull::
ld a, "<LV>" ; ":L" tile ID
ld a, '<LV>' ; ":L" tile ID
ld [hli], a
ld c, 3 ; number of digits
ld a, [wLoadedMonLevel] ; level

View File

@ -20,7 +20,7 @@ PrintBCDNumber::
jr z, .loop
bit BIT_LEADING_ZEROES, b
jr nz, .loop
ld [hl], "¥"
ld [hl], '¥'
inc hl
.loop
ld a, [de]
@ -40,10 +40,10 @@ PrintBCDNumber::
.skipRightAlignmentAdjustment
bit BIT_MONEY_SIGN, b
jr z, .skipCurrencySymbol
ld [hl], "¥"
ld [hl], '¥'
inc hl
.skipCurrencySymbol
ld [hl], "0"
ld [hl], '0'
call PrintLetterDelay
inc hl
.done
@ -59,13 +59,13 @@ PrintBCDDigit::
; if bit 7 is set, then no numbers have been printed yet
bit BIT_MONEY_SIGN, b
jr z, .skipCurrencySymbol
ld [hl], "¥"
ld [hl], '¥'
inc hl
res BIT_MONEY_SIGN, b
.skipCurrencySymbol
res BIT_LEADING_ZEROES, b
.outputDigit
add "0"
add '0'
ld [hli], a
jp PrintLetterDelay
.zeroDigit

View File

@ -118,14 +118,14 @@ ENDM
call .PrintLeadingZero
jr .next
.past
ld a, "0"
ld a, '0'
add c
ld [hl], a
.next
call .NextDigit
.ones
ld a, "0"
ld a, '0'
add b
ld [hli], a
pop de
@ -202,7 +202,7 @@ ENDM
or c
jr z, .PrintLeadingZero
ld a, "0"
ld a, '0'
add c
ld [hl], a
ldh [hPastLeadingZeros], a
@ -211,7 +211,7 @@ ENDM
.PrintLeadingZero:
bit BIT_LEADING_ZEROES, d
ret z
ld [hl], "0"
ld [hl], '0'
ret
.NextDigit:

View File

@ -3,7 +3,7 @@ TextBoxBorder::
; top row
push hl
ld a, "┌"
ld a, '┌'
ld [hli], a
inc a ; "─"
call .PlaceChars
@ -17,11 +17,11 @@ TextBoxBorder::
; middle rows
.next
push hl
ld a, "│"
ld a, '│'
ld [hli], a
ld a, " "
ld a, ' '
call .PlaceChars
ld [hl], "│"
ld [hl], '│'
pop hl
ld de, SCREEN_WIDTH
@ -30,11 +30,11 @@ TextBoxBorder::
jr nz, .next
; bottom row
ld a, "└"
ld a, '└'
ld [hli], a
ld a, "─"
ld a, '─'
call .PlaceChars
ld [hl], "┘"
ld [hl], '┘'
ret
.PlaceChars::
@ -51,7 +51,7 @@ PlaceString::
PlaceNextChar::
ld a, [de]
cp "@"
cp '@'
jr nz, .NotTerminator
ld b, h
ld c, l
@ -59,7 +59,7 @@ PlaceNextChar::
ret
.NotTerminator
cp "<NEXT>"
cp '<NEXT>'
jr nz, .NotNext
ld bc, 2 * SCREEN_WIDTH
ldh a, [hUILayoutFlags]
@ -73,7 +73,7 @@ PlaceNextChar::
jp NextChar
.NotNext
cp "<LINE>"
cp '<LINE>'
jr nz, .NotLine
pop hl
hlcoord 1, 16
@ -83,26 +83,26 @@ PlaceNextChar::
.NotLine
; Check against a dictionary
dict "<NULL>", NullChar
dict "<SCROLL>", _ContTextNoPause
dict "<_CONT>", _ContText
dict "<PARA>", Paragraph
dict "<PAGE>", PageChar
dict "<PLAYER>", PrintPlayerName
dict "<RIVAL>", PrintRivalName
dict "#", PlacePOKe
dict "<PC>", PCChar
dict "<ROCKET>", RocketChar
dict "<TM>", TMChar
dict "<TRAINER>", TrainerChar
dict "<CONT>", ContText
dict "<……>", SixDotsChar
dict "<DONE>", DoneText
dict "<PROMPT>", PromptText
dict "<PKMN>", PlacePKMN
dict "<DEXEND>", PlaceDexEnd
dict "<TARGET>", PlaceMoveTargetsName
dict "<USER>", PlaceMoveUsersName
dict '<NULL>', NullChar
dict '<SCROLL>', _ContTextNoPause
dict '<_CONT>', _ContText
dict '<PARA>', Paragraph
dict '<PAGE>', PageChar
dict '<PLAYER>', PrintPlayerName
dict '<RIVAL>', PrintRivalName
dict '#', PlacePOKe
dict '<PC>', PCChar
dict '<ROCKET>', RocketChar
dict '<TM>', TMChar
dict '<TRAINER>', TrainerChar
dict '<CONT>', ContText
dict '<……>', SixDotsChar
dict '<DONE>', DoneText
dict '<PROMPT>', PromptText
dict '<PKMN>', PlacePKMN
dict '<DEXEND>', PlaceDexEnd
dict '<TARGET>', PlaceMoveTargetsName
dict '<USER>', PlaceMoveUsersName
ld [hli], a
call PrintLetterDelay
@ -202,7 +202,7 @@ ContCharText::
text_end
PlaceDexEnd::
ld [hl], "."
ld [hl], '.'
pop hl
ret
@ -210,12 +210,12 @@ PromptText::
ld a, [wLinkState]
cp LINK_STATE_BATTLING
jp z, .ok
ld a, "▼"
ld a, '▼'
ldcoord_a 18, 16
.ok
call ProtectedDelay3
call ManualTextScroll
ld a, " "
ld a, ' '
ldcoord_a 18, 16
DoneText::
@ -229,7 +229,7 @@ DoneText::
Paragraph::
push de
ld a, "▼"
ld a, '▼'
ldcoord_a 18, 16
call ProtectedDelay3
call ManualTextScroll
@ -246,12 +246,12 @@ PageChar::
ldh a, [hUILayoutFlags]
bit BIT_PAGE_CHAR_IS_NEXT, a
jr z, .pageChar
ld a, "<NEXT>"
ld a, '<NEXT>'
jp PlaceNextChar.NotTerminator
.pageChar
push de
ld a, "▼"
ld a, '▼'
ldcoord_a 18, 16
call ProtectedDelay3
call ManualTextScroll
@ -267,13 +267,13 @@ PageChar::
jp NextChar
_ContText::
ld a, "▼"
ld a, '▼'
ldcoord_a 18, 16
call ProtectedDelay3
push de
call ManualTextScroll
pop de
ld a, " "
ld a, ' '
ldcoord_a 18, 16
_ContTextNoPause::
push de
@ -298,7 +298,7 @@ ScrollTextUpOneLine::
dec b
jr nz, .copyText
hlcoord 1, 16
ld a, " "
ld a, ' '
ld b, SCREEN_WIDTH - 2
.clearText
ld [hli], a
@ -443,12 +443,12 @@ TextCommand_PROMPT_BUTTON::
ld a, [wLinkState]
cp LINK_STATE_BATTLING
jp z, TextCommand_WAIT_BUTTON
ld a, "▼"
ld a, '▼'
ldcoord_a 18, 16 ; place down arrow in lower right corner of dialogue text box
push bc
call ManualTextScroll ; blink arrow and wait for A or B to be pressed
pop bc
ld a, " "
ld a, ' '
ldcoord_a 18, 16 ; overwrite down arrow with blank space
pop hl
jp NextTextCommand
@ -456,7 +456,7 @@ TextCommand_PROMPT_BUTTON::
TextCommand_SCROLL::
; pushes text up two lines and sets the BC cursor to the border tile
; below the first character column of the text box.
ld a, " "
ld a, ' '
ldcoord_a 18, 16 ; place blank space in lower right corner of dialogue text box
call ScrollTextUpOneLine
call ScrollTextUpOneLine
@ -571,7 +571,7 @@ TextCommand_DOTS::
ld l, c
.loop
ld a, "…"
ld a, '…'
ld [hli], a
push de
call Joypad

View File

@ -19,7 +19,7 @@ GetRowColAddressBgMap::
; clears a VRAM background map with blank space tiles
; INPUT: h - high byte of background tile map address in VRAM
ClearBgMap::
ld a, " "
ld a, ' '
jr .next
ld a, l
.next

View File

@ -151,7 +151,7 @@ PlaceMenuCursor::
jr nz, .oldMenuItemLoop
.checkForArrow1
ld a, [hl]
cp "▶" ; was an arrow next to the previously selected menu item?
cp '▶' ; was an arrow next to the previously selected menu item?
jr nz, .skipClearingArrow
.clearArrow
ld a, [wTileBehindCursor]
@ -175,11 +175,11 @@ PlaceMenuCursor::
jr nz, .currentMenuItemLoop
.checkForArrow2
ld a, [hl]
cp "▶" ; has the right arrow already been placed?
cp '▶' ; has the right arrow already been placed?
jr z, .skipSavingTile ; if so, don't lose the saved tile
ld [wTileBehindCursor], a ; save tile before overwriting with right arrow
.skipSavingTile
ld a, "▶" ; place right arrow
ld a, '▶' ; place right arrow
ld [hl], a
ld a, l
ld [wMenuCursorLocation], a
@ -199,7 +199,7 @@ PlaceUnfilledArrowMenuCursor::
ld l, a
ld a, [wMenuCursorLocation + 1]
ld h, a
ld [hl], "▷"
ld [hl], '▷'
ld a, b
ret
@ -209,7 +209,7 @@ EraseMenuCursor::
ld l, a
ld a, [wMenuCursorLocation + 1]
ld h, a
ld [hl], " "
ld [hl], ' '
ret
; This toggles a blinking down arrow at hl on and off after a delay has passed.
@ -223,7 +223,7 @@ EraseMenuCursor::
HandleDownArrowBlinkTiming::
ld a, [hl]
ld b, a
ld a, "▼"
ld a, '▼'
cp b
jr nz, .downArrowOff
.downArrowOn
@ -235,7 +235,7 @@ HandleDownArrowBlinkTiming::
dec a
ldh [hDownArrowBlinkCount2], a
ret nz
ld a, " "
ld a, ' '
ld [hl], a
ld a, $ff
ldh [hDownArrowBlinkCount1], a
@ -257,7 +257,7 @@ HandleDownArrowBlinkTiming::
ret nz
ld a, $06
ldh [hDownArrowBlinkCount2], a
ld a, "▼"
ld a, '▼'
ld [hl], a
ret

View File

@ -1,18 +1,14 @@
; Macros to verify assumptions about the data or code
MACRO _redef_current_label
MACRO? _redef_current_label
IF DEF(\1)
PURGE \1
ENDC
IF _NARG == 3 + (\3)
DEF \1 EQUS "\<_NARG>"
ELIF DEF(..)
IF .. - @ == 0
DEF \1 EQUS "{..}"
ENDC
ELIF DEF(.)
if . - @ == 0
DEF \1 EQUS "{.}"
ELIF STRLEN(#__SCOPE__)
IF {{__SCOPE__}} - @ == 0
DEF \1 EQUS #{__SCOPE__}
ENDC
ENDC
if !DEF(\1)
@ -21,12 +17,12 @@ MACRO _redef_current_label
ENDC
ENDM
MACRO table_width
MACRO? table_width
DEF CURRENT_TABLE_WIDTH = \1
_redef_current_label CURRENT_TABLE_START, "._table_width\@", 2, \#
ENDM
MACRO assert_table_length
MACRO? assert_table_length
DEF w = \1
DEF x = w * CURRENT_TABLE_WIDTH
DEF y = @ - {CURRENT_TABLE_START}
@ -34,7 +30,7 @@ MACRO assert_table_length
"bytes, for {d:x} total; but got {d:y} bytes"
ENDM
MACRO assert_max_table_length
MACRO? assert_max_table_length
DEF w = \1
DEF x = w * CURRENT_TABLE_WIDTH
DEF y = @ - {CURRENT_TABLE_START}
@ -42,24 +38,24 @@ MACRO assert_max_table_length
"{d:CURRENT_TABLE_WIDTH} bytes, for maximum {d:x} total; but got {d:y} bytes"
ENDM
MACRO list_start
MACRO? list_start
DEF list_index = 0
_redef_current_label CURRENT_LIST_START, "._list_start\@", 1, \#
ENDM
MACRO li
MACRO? li
ASSERT STRFIND(\1, "@") == -1, "String terminator \"@\" in list entry: \1"
db \1, "@"
DEF list_index += 1
ENDM
MACRO assert_list_length
MACRO? assert_list_length
DEF x = \1
ASSERT x == list_index, \
"{CURRENT_LIST_START}: expected {d:x} entries, got {d:list_index}"
ENDM
MACRO nybble_array
MACRO? nybble_array
DEF CURRENT_NYBBLE_ARRAY_VALUE = 0
DEF CURRENT_NYBBLE_ARRAY_LENGTH = 0
IF _NARG == 1
@ -70,7 +66,7 @@ MACRO nybble_array
ENDC
ENDM
MACRO nybble
MACRO? nybble
ASSERT 0 <= (\1) && (\1) < $10, "nybbles must be 0-15"
DEF CURRENT_NYBBLE_ARRAY_VALUE = (\1) | (CURRENT_NYBBLE_ARRAY_VALUE << 4)
DEF CURRENT_NYBBLE_ARRAY_LENGTH += 1
@ -80,7 +76,7 @@ MACRO nybble
ENDC
ENDM
MACRO end_nybble_array
MACRO? end_nybble_array
IF CURRENT_NYBBLE_ARRAY_LENGTH % 2
db CURRENT_NYBBLE_ARRAY_VALUE << 4
ENDC
@ -94,7 +90,7 @@ MACRO end_nybble_array
ENDC
ENDM
MACRO bit_array
MACRO? bit_array
DEF CURRENT_BIT_ARRAY_VALUE = 0
DEF CURRENT_BIT_ARRAY_LENGTH = 0
IF _NARG == 1
@ -105,7 +101,7 @@ MACRO bit_array
ENDC
ENDM
MACRO dbit
MACRO? dbit
ASSERT (\1) == 0 || (\1) == 1, "bits must be 0 or 1"
DEF CURRENT_BIT_ARRAY_VALUE |= (\1) << (CURRENT_BIT_ARRAY_LENGTH % 8)
DEF CURRENT_BIT_ARRAY_LENGTH += 1
@ -115,7 +111,7 @@ MACRO dbit
ENDC
ENDM
MACRO end_bit_array
MACRO? end_bit_array
IF CURRENT_BIT_ARRAY_LENGTH % 8
db CURRENT_BIT_ARRAY_VALUE
ENDC
@ -129,7 +125,7 @@ MACRO end_bit_array
ENDC
ENDM
MACRO def_grass_wildmons
MACRO? def_grass_wildmons
;\1: encounter rate
DEF CURRENT_GRASS_WILDMONS_RATE = \1
REDEF CURRENT_GRASS_WILDMONS_LABEL EQUS "._def_grass_wildmons_\1"
@ -137,7 +133,7 @@ MACRO def_grass_wildmons
db \1
ENDM
MACRO end_grass_wildmons
MACRO? end_grass_wildmons
DEF x = @ - {CURRENT_GRASS_WILDMONS_LABEL}
IF CURRENT_GRASS_WILDMONS_RATE == 0
ASSERT 1 == x, \
@ -148,7 +144,7 @@ MACRO end_grass_wildmons
ENDC
ENDM
MACRO def_water_wildmons
MACRO? def_water_wildmons
;\1: encounter rate
DEF CURRENT_WATER_WILDMONS_RATE = \1
REDEF CURRENT_WATER_WILDMONS_LABEL EQUS "._def_water_wildmons_\1"
@ -156,7 +152,7 @@ MACRO def_water_wildmons
db \1
ENDM
MACRO end_water_wildmons
MACRO? end_water_wildmons
DEF x = @ - {CURRENT_WATER_WILDMONS_LABEL}
IF CURRENT_WATER_WILDMONS_RATE == 0
ASSERT 1 == x, \

View File

@ -1,10 +1,10 @@
; Syntactic sugar macros
MACRO lb ; r, hi, lo
MACRO? lb ; r, hi, lo
ld \1, ((\2) & $ff) << 8 + ((\3) & $ff)
ENDM
MACRO ldpal
MACRO? ldpal
ld \1, \2 << 6 | \3 << 4 | \4 << 2 | \5
ENDM

View File

@ -1,6 +1,6 @@
; Enumerate constants
MACRO const_def
MACRO? const_def
IF _NARG >= 1
DEF const_value = \1
ELSE
@ -13,22 +13,22 @@ MACRO const_def
ENDC
ENDM
MACRO const
MACRO? const
DEF \1 EQU const_value
DEF const_value += const_inc
ENDM
MACRO const_export
MACRO? const_export
const \1
EXPORT \1
ENDM
MACRO shift_const
MACRO? shift_const
DEF \1 EQU 1 << const_value
DEF const_value += const_inc
ENDM
MACRO const_skip
MACRO? const_skip
if _NARG >= 1
DEF const_value += const_inc * (\1)
else
@ -36,7 +36,7 @@ MACRO const_skip
endc
ENDM
MACRO const_next
MACRO? const_next
if (const_value > 0 && \1 < const_value) || (const_value < 0 && \1 > const_value)
fail "const_next cannot go backwards from {const_value} to \1"
else
@ -44,12 +44,12 @@ MACRO const_next
endc
ENDM
MACRO dw_const
MACRO? dw_const
dw \1
const \2
ENDM
MACRO rb_skip
MACRO? rb_skip
IF _NARG == 1
rsset _RS + \1
ELSE

View File

@ -1,4 +1,4 @@
MACRO validate_coords
MACRO? validate_coords
IF _NARG >= 4
IF \1 >= \3
fail "x coord out of range"
@ -11,19 +11,19 @@ MACRO validate_coords
ENDC
ENDM
MACRO hlcoord
MACRO? hlcoord
coord hl, \#
ENDM
MACRO bccoord
MACRO? bccoord
coord bc, \#
ENDM
MACRO decoord
MACRO? decoord
coord de, \#
ENDM
MACRO coord
MACRO? coord
; register, x, y[, origin]
validate_coords \2, \3
IF _NARG >= 4
@ -33,19 +33,19 @@ MACRO coord
ENDC
ENDM
MACRO hlbgcoord
MACRO? hlbgcoord
bgcoord hl, \#
ENDM
MACRO bcbgcoord
MACRO? bcbgcoord
bgcoord bc, \#
ENDM
MACRO debgcoord
MACRO? debgcoord
bgcoord de, \#
ENDM
MACRO bgcoord
MACRO? bgcoord
; register, x, y[, origin]
validate_coords \2, \3, TILEMAP_WIDTH, TILEMAP_HEIGHT
IF _NARG >= 4
@ -55,30 +55,30 @@ MACRO bgcoord
ENDC
ENDM
MACRO hlowcoord
MACRO? hlowcoord
owcoord hl, \#
ENDM
MACRO bcowcoord
MACRO? bcowcoord
owcoord bc, \#
ENDM
MACRO deowcoord
MACRO? deowcoord
owcoord de, \#
ENDM
MACRO owcoord
MACRO? owcoord
; register, x, y, map width
ld \1, wOverworldMap + ((\2) + 3) + (((\3) + 3) * ((\4) + (3 * 2)))
ENDM
MACRO event_displacement
MACRO? event_displacement
; map width, x blocks, y blocks
dw (wOverworldMap + 7 + (\1) + ((\1) + 6) * ((\3) >> 1) + ((\2) >> 1))
db \3, \2
ENDM
MACRO dwcoord
MACRO? dwcoord
; x, y
validate_coords \1, \2
IF _NARG >= 3
@ -88,7 +88,7 @@ MACRO dwcoord
ENDC
ENDM
MACRO ldcoord_a
MACRO? ldcoord_a
; x, y[, origin]
validate_coords \1, \2
IF _NARG >= 3
@ -98,7 +98,7 @@ MACRO ldcoord_a
ENDC
ENDM
MACRO lda_coord
MACRO? lda_coord
; x, y[, origin]
validate_coords \1, \2
IF _NARG >= 3
@ -108,7 +108,7 @@ MACRO lda_coord
ENDC
ENDM
MACRO dbmapcoord
MACRO? dbmapcoord
; x, y
db \2, \1
ENDM

View File

@ -2,19 +2,19 @@
DEF percent EQUS "* $ff / 100"
MACRO bcd2
MACRO? bcd2
dn ((\1) / 1000) % 10, ((\1) / 100) % 10
dn ((\1) / 10) % 10, (\1) % 10
ENDM
MACRO bcd3
MACRO? bcd3
dn ((\1) / 100000) % 10, ((\1) / 10000) % 10
dn ((\1) / 1000) % 10, ((\1) / 100) % 10
dn ((\1) / 10) % 10, (\1) % 10
ENDM
; used in data/pokemon/base_stats/*.asm
MACRO tmhm
MACRO? tmhm
; initialize bytes to 0
FOR n, (NUM_TM_HM + 7) / 8
DEF _tm{d:n} = 0
@ -40,49 +40,49 @@ ENDM
; Constant data (db, dw, dl) macros
MACRO dbw
MACRO? dbw
db \1
dw \2
ENDM
MACRO dwb
MACRO? dwb
dw \1
db \2
ENDM
MACRO dn ; nybbles
MACRO? dn ; nybbles
REPT _NARG / 2
db ((\1) << 4) | (\2)
SHIFT 2
ENDR
ENDM
MACRO dc ; "crumbs"
MACRO? dc ; "crumbs"
REPT _NARG / 4
db ((\1) << 6) | ((\2) << 4) | ((\3) << 2) | (\4)
SHIFT 4
ENDR
ENDM
MACRO bigdw ; big-endian word
MACRO? bigdw ; big-endian word
db HIGH(\1), LOW(\1)
ENDM
MACRO dba ; dbw bank, address
MACRO? dba ; dbw bank, address
REPT _NARG
dbw BANK(\1), \1
SHIFT
ENDR
ENDM
MACRO dab ; dwb address, bank
MACRO? dab ; dwb address, bank
REPT _NARG
dwb \1, BANK(\1)
SHIFT
ENDR
ENDM
MACRO dname
MACRO? dname
IF _NARG == 2
DEF n = \2
ELSE
@ -91,7 +91,7 @@ MACRO dname
ASSERT STRFIND(\1, "@") == -1, "String terminator \"@\" in name: \1"
ASSERT CHARLEN(\1) <= n, "Name longer than {d:n} characters: \1"
db \1
ds n - CHARLEN(\1), "@"
ds n - CHARLEN(\1), '@'
ENDM
MACRO sine_table

View File

@ -1,4 +1,4 @@
MACRO RGB
MACRO? RGB
REPT _NARG / 3
dw palred (\1) + palgreen (\2) + palblue (\3)
SHIFT 3
@ -16,7 +16,7 @@ DEF color EQUS "+ COLOR_SIZE *"
DEF tiles EQUS "* TILE_SIZE"
DEF tile EQUS "+ TILE_SIZE *"
MACRO dbsprite
MACRO? dbsprite
; x tile, y tile, x pixel, y pixel, vtile offset, attributes
db (\2 * TILE_WIDTH) % $100 + \4, (\1 * TILE_WIDTH) % $100 + \3, \5, \6
ENDM

View File

@ -1,32 +1,32 @@
MACRO predef_id
MACRO? predef_id
ld a, (\1Predef - PredefPointers) / 3
ENDM
MACRO predef
MACRO? predef
predef_id \1
call Predef
ENDM
MACRO predef_jump
MACRO? predef_jump
predef_id \1
jp Predef
ENDM
MACRO tx_pre_id
MACRO? tx_pre_id
ld a, (\1_id - TextPredefs) / 2 + 1
ENDM
MACRO tx_pre
MACRO? tx_pre
tx_pre_id \1
call PrintPredefTextID
ENDM
MACRO tx_pre_jump
MACRO? tx_pre_jump
tx_pre_id \1
jp PrintPredefTextID
ENDM
MACRO db_tx_pre
MACRO? db_tx_pre
db (\1_id - TextPredefs) / 2 + 1
ENDM

View File

@ -1,6 +1,6 @@
; Used in wram.asm
MACRO flag_array
MACRO? flag_array
ds ((\1) + 7) / 8
ENDM

View File

@ -174,7 +174,7 @@ MACRO connection
DEF _tgt = 0
ENDC
IF !STRCMP("\1", "north")
IF "\1" === "north"
DEF _blk = \3_WIDTH * (\3_HEIGHT - 3) + _src
DEF _map = _tgt
DEF _win = (\3_WIDTH + 6) * \3_HEIGHT + 1
@ -185,7 +185,7 @@ MACRO connection
DEF _len = \3_WIDTH
ENDC
ELIF !STRCMP("\1", "south")
ELIF "\1" === "south"
DEF _blk = _src
DEF _map = (CURRENT_MAP_WIDTH + 6) * (CURRENT_MAP_HEIGHT + 3) + _tgt
DEF _win = \3_WIDTH + 7
@ -196,7 +196,7 @@ MACRO connection
DEF _len = \3_WIDTH
ENDC
ELIF !STRCMP("\1", "west")
ELIF "\1" === "west"
DEF _blk = (\3_WIDTH * _src) + \3_WIDTH - 3
DEF _map = (CURRENT_MAP_WIDTH + 6) * _tgt
DEF _win = (\3_WIDTH + 6) * 2 - 6
@ -207,7 +207,7 @@ MACRO connection
DEF _len = \3_HEIGHT
ENDC
ELIF !STRCMP("\1", "east")
ELIF "\1" === "east"
DEF _blk = (\3_WIDTH * _src)
DEF _map = (CURRENT_MAP_WIDTH + 6) * _tgt + CURRENT_MAP_WIDTH + 3
DEF _win = \3_WIDTH + 7

View File

@ -1,10 +1,10 @@
MACRO vc_hook
MACRO? vc_hook
IF DEF(_YELLOW_VC)
.VC_\1::
ENDC
ENDM
MACRO vc_patch
MACRO? vc_patch
IF DEF(_YELLOW_VC)
ASSERT !DEF(CURRENT_VC_PATCH), "Already started a vc_patch"
DEF CURRENT_VC_PATCH EQUS "\1"
@ -12,7 +12,7 @@ MACRO vc_patch
ENDC
ENDM
MACRO vc_patch_end
MACRO? vc_patch_end
IF DEF(_YELLOW_VC)
ASSERT DEF(CURRENT_VC_PATCH), "No vc_patch started"
.VC_{CURRENT_VC_PATCH}_End::
@ -20,7 +20,7 @@ MACRO vc_patch_end
ENDC
ENDM
MACRO vc_assert
MACRO? vc_assert
IF DEF(_YELLOW_VC)
ASSERT \#
ENDC

View File

@ -1064,6 +1064,7 @@ wDownscaledMonSize::
; FormatMovesString stores the number of moves minus one here
wNumMovesMinusOne:: db
; This union spans 20 bytes.
UNION
; storage buffer for various name strings
wNameBuffer:: ds NAME_BUFFER_LENGTH
@ -1079,7 +1080,8 @@ wPayDayMoney:: ds 3
NEXTU
; evolution data for one mon
wEvoDataBuffer:: ds 4 * 3 + 1 ; enough for Eevee's three 4-byte evolutions and 0 terminator
wEvoDataBuffer:: ds NUM_EVOS_IN_BUFFER * 4 + 1 ; enough for Eevee's three 4-byte evolutions and 0 terminator
wEvoDataBufferEnd::
NEXTU
wBattleMenuCurrentPP:: db
@ -1239,7 +1241,7 @@ wPartyMenuBlkPacket:: ds $30
NEXTU
ds 29
; storage buffer for various strings
wStringBuffer:: ds 20
wStringBuffer:: ds NAME_BUFFER_LENGTH
NEXTU
ds 29
@ -1381,7 +1383,7 @@ wTrainerPicPointer:: dw
ds 1
UNION
wTempMoveNameBuffer:: ds 14
wTempMoveNameBuffer:: ds ITEM_NAME_LENGTH + 1
NEXTU
; The name of the mon that is learning a move.
@ -2393,12 +2395,12 @@ wEventFlags:: flag_array NUM_EVENTS
UNION
wGrassRate:: db
wGrassMons:: ds 10 * 2
wGrassMons:: ds WILDDATA_LENGTH - 1
ds 8
wWaterRate:: db
wWaterMons:: ds 10 * 2
wWaterMons:: ds WILDDATA_LENGTH - 1
NEXTU
; linked game's trainer name

View File

@ -1,6 +1,6 @@
IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__)
fail "pokeyellow requires rgbds v0.9.3 or newer."
IF !DEF(__RGBDS_MAJOR__)
fail "pokeyellow requires rgbds v1.0.0 or newer."
ENDC
IF __RGBDS_MAJOR__ == 0 && (__RGBDS_MINOR__ < 9 || (__RGBDS_MINOR__ == 9 && __RGBDS_PATCH__ < 3))
fail "pokeyellow requires rgbds v0.9.3 or newer."
IF __RGBDS_MAJOR__ < 1
fail "pokeyellow requires rgbds v1.0.0 or newer."
ENDC

View File

@ -86,7 +86,7 @@ Route23CopyBadgeTextScript:
ld a, [hli]
ld [de], a
inc de
cp "@"
cp '@'
jr nz, .copyTextLoop
ret

View File

@ -1,5 +1,5 @@
#define PROGRAM_NAME "make_patch"
#define USAGE_OPTS "values.sym patched.gbc original.gbc vc.patch.template vc.patch"
#define USAGE_OPTS "[--ignore addr:size] values.sym patched.gbc original.gbc vc.patch.template vc.patch"
#include "common.h"
@ -127,7 +127,7 @@ struct Symbol *parse_symbols(const char *filename) {
if (c == EOF || c == '\n' || c == '\r' || c == ';' || (state == SYM_NAME && (c == ' ' || c == '\t'))) {
if (state == SYM_NAME) {
// The symbol name has ended; append the buffered symbol
buffer_append(buffer, &(char []){'\0'});
buffer_append(buffer, &(char){'\0'});
symbol_append(&symbols, buffer->data, bank, address);
}
// Skip to the next line, ignoring anything after the symbol value and name
@ -143,7 +143,7 @@ struct Symbol *parse_symbols(const char *filename) {
// The symbol value or name has started; buffer its contents
if (++state == SYM_NAME) {
// The symbol name has started; parse the buffered value
buffer_append(buffer, &(char []){'\0'});
buffer_append(buffer, &(char){'\0'});
parse_symbol_value(buffer->data, &bank, &address);
}
buffer->size = 0;
@ -349,7 +349,15 @@ void skip_to_next_line(FILE *restrict input, FILE *restrict output) {
}
}
struct Buffer *process_template(const char *template_filename, const char *patch_filename, FILE *restrict new_rom, FILE *restrict orig_rom, const struct Symbol *symbols) {
struct Buffer *process_template(
const char *template_filename,
const char *patch_filename,
FILE *restrict new_rom,
FILE *restrict orig_rom,
const struct Symbol *symbols,
unsigned int ignore_addr,
unsigned int ignore_size
) {
FILE *input = xfopen(template_filename, 'r');
FILE *output = xfopen(patch_filename, 'w');
@ -358,6 +366,11 @@ struct Buffer *process_template(const char *template_filename, const char *patch
// The ROM checksum will always differ
buffer_append(patches, &(struct Patch){0x14e, 2});
// The ignored data will always differ
unsigned int rom_size = (unsigned int)xfsize("", orig_rom);
if (ignore_size > 0 && ignore_size <= rom_size && ignore_addr <= rom_size - ignore_size) {
buffer_append(patches, &(struct Patch){ignore_addr, ignore_size});
}
// Fill in the template
const struct Symbol *current_hook = NULL;
@ -375,7 +388,7 @@ struct Buffer *process_template(const char *template_filename, const char *patch
for (c = getc(input); c != EOF && c != '}'; c = getc(input)) {
buffer_append(buffer, &c);
}
buffer_append(buffer, &(char []){'\0'});
buffer_append(buffer, &(char){'\0'});
// Interpret the command in the context of the current patch
interpret_command(buffer->data, current_hook, symbols, patches, new_rom, orig_rom, output);
break;
@ -404,7 +417,7 @@ struct Buffer *process_template(const char *template_filename, const char *patch
buffer_append(buffer, &c);
}
}
buffer_append(buffer, &(char []){'\0'});
buffer_append(buffer, &(char){'\0'});
// The current patch should have a corresponding ".VC_" label
current_hook = symbol_find_cat(symbols, ".VC_", buffer->data);
skip_to_next_line(input, output);
@ -458,19 +471,53 @@ bool verify_completeness(FILE *restrict orig_rom, FILE *restrict new_rom, struct
}
}
void parse_args(int argc, char *argv[], unsigned int *ignore_addr, unsigned int *ignore_size) {
struct option long_options[] = {
{"ignore", required_argument, 0, 'i'},
{"help", no_argument, 0, 'h'},
{0}
};
for (int opt; (opt = getopt_long(argc, argv, "h", long_options)) != -1;) {
switch (opt) {
case 'i': {
char *colon = strchr(optarg, ':');
if (colon) {
*colon++ = '\0';
*ignore_addr = strtoul(optarg, NULL, 0);
*ignore_size = strtoul(colon, NULL, 0);
} else {
error_exit("Error: Invalid argument for '--ignore': \"%s\"\n", optarg);
}
break;
}
case 'h':
usage_exit(0);
break;
default:
usage_exit(1);
}
}
}
int main(int argc, char *argv[]) {
if (argc != 6) {
unsigned int ignore_addr = 0, ignore_size = 0;
parse_args(argc, argv, &ignore_addr, &ignore_size);
argc -= optind;
argv += optind;
if (argc != 5) {
usage_exit(1);
}
struct Symbol *symbols = parse_symbols(argv[1]);
struct Symbol *symbols = parse_symbols(argv[0]);
FILE *new_rom = xfopen(argv[2], 'r');
FILE *orig_rom = xfopen(argv[3], 'r');
struct Buffer *patches = process_template(argv[4], argv[5], new_rom, orig_rom, symbols);
FILE *new_rom = xfopen(argv[1], 'r');
FILE *orig_rom = xfopen(argv[2], 'r');
struct Buffer *patches = process_template(argv[3], argv[4], new_rom, orig_rom, symbols, ignore_addr, ignore_size);
if (!verify_completeness(orig_rom, new_rom, patches)) {
fprintf(stderr, PROGRAM_NAME ": Warning: Not all ROM differences are defined by \"%s\"\n", argv[5]);
fprintf(stderr, PROGRAM_NAME ": Warning: Not all ROM differences are defined by \"%s\"\n", argv[4]);
}
symbol_free(symbols);

View File

@ -1,49 +1,49 @@
; These are all the asm constants needed to make the yellow_vc patch.
; [FPA 001 Begin]
EXPORT DEF M_CHAR EQU "M"
EXPORT DEF E_CHAR EQU "E"
EXPORT DEF G_CHAR EQU "G"
EXPORT DEF A_CHAR EQU "A"
EXPORT DEF P_CHAR EQU "P"
EXPORT DEF X_CHAR EQU "X"
EXPORT DEF L_CHAR EQU "L"
EXPORT DEF S_CHAR EQU "S"
EXPORT DEF F_CHAR EQU "F"
EXPORT DEF M_CHAR EQU 'M'
EXPORT DEF E_CHAR EQU 'E'
EXPORT DEF G_CHAR EQU 'G'
EXPORT DEF A_CHAR EQU 'A'
EXPORT DEF P_CHAR EQU 'P'
EXPORT DEF X_CHAR EQU 'X'
EXPORT DEF L_CHAR EQU 'L'
EXPORT DEF S_CHAR EQU 'S'
EXPORT DEF F_CHAR EQU 'F'
EXPORT MEGA_PUNCH
; [FPA 002 Begin]
EXPORT DEF U_CHAR EQU "U"
EXPORT DEF I_CHAR EQU "I"
EXPORT DEF U_CHAR EQU 'U'
EXPORT DEF I_CHAR EQU 'I'
EXPORT GUILLOTINE
; [FPA 003 Begin]
EXPORT DEF K_CHAR EQU "K"
EXPORT DEF K_CHAR EQU 'K'
EXPORT MEGA_KICK
; [FPA 004 Begin]
EXPORT DEF B_CHAR EQU "B"
EXPORT DEF Z_CHAR EQU "Z"
EXPORT DEF B_CHAR EQU 'B'
EXPORT DEF Z_CHAR EQU 'Z'
EXPORT BLIZZARD
; [FPA 005 Begin]
EXPORT BUBBLEBEAM
; [FPA 006 Begin]
EXPORT DEF H_CHAR EQU "H"
EXPORT DEF Y_CHAR EQU "Y"
EXPORT DEF H_CHAR EQU 'H'
EXPORT DEF Y_CHAR EQU 'Y'
EXPORT HYPER_BEAM
; [FPA 007 Begin]
EXPORT DEF T_CHAR EQU "T"
EXPORT DEF N_CHAR EQU "N"
EXPORT DEF T_CHAR EQU 'T'
EXPORT DEF N_CHAR EQU 'N'
EXPORT THUNDERBOLT
; [FPA 008 Begin]
EXPORT HAZE
; [FPA 009 Begin]
EXPORT DEF R_CHAR EQU "R"
EXPORT DEF R_CHAR EQU 'R'
EXPORT REFLECT
; [FPA 010 Begin]