Use features of RGBDS 1.0.0 (#69)

This commit is contained in:
Rangi 2025-11-14 00:17:30 -05:00 committed by GitHub
parent 0efdfcf9df
commit 4da89de0c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 164 additions and 136 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "pokemon-reverse-engineering-tools"]
path = pokemon-reverse-engineering-tools
url = https://github.com/kanzure/pokemon-reverse-engineering-tools.git

View File

@ -14,6 +14,17 @@ else
SHA1 := sha1sum SHA1 := sha1sum
endif endif
RGBDS ?=
RGBASM ?= $(RGBDS)rgbasm
RGBLINK ?= $(RGBDS)rgblink
RGBFIX ?= $(RGBDS)rgbfix
RGBGFX ?= $(RGBDS)rgbgfx
RGBASMFLAGS ?= -Weverything -Wtruncation=1
RGBLINKFLAGS ?= -Weverything -Wtruncation=1
RGBFIXFLAGS ?= -Weverything
RGBGFXFLAGS ?= -Weverything
all: $(ROM) compare all: $(ROM) compare
ifeq (,$(filter tools clean tidy,$(MAKECMDGOALS))) ifeq (,$(filter tools clean tidy,$(MAKECMDGOALS)))
@ -22,11 +33,13 @@ endif
%.o: dep = $(shell tools/scan_includes $(@D)/$*.asm) %.o: dep = $(shell tools/scan_includes $(@D)/$*.asm)
%.o: %.asm $$(dep) %.o: %.asm $$(dep)
rgbasm -Wunmapped-char=0 -o $@ $< $(RGBASM) $(RGBASMFLAGS) -o $@ $<
$(ROM): RGBLINKFLAGS += -l contents/contents.link -n $(ROM:.gbc=.sym) -m $(ROM:.gbc=.map)
$(ROM): RGBFIXFLAGS += -jsvc -k 01 -l 0x33 -m 0x1e -p 0 -r 02 -t "POKEPINBALL" -i VPHE
$(ROM): $(OBJS) contents/contents.link $(ROM): $(OBJS) contents/contents.link
rgblink -n $(ROM:.gbc=.sym) -m $(ROM:.gbc=.map) -l contents/contents.link -o $@ $(OBJS) $(RGBLINK) $(RGBLINKFLAGS) -o $@ $(OBJS)
rgbfix -jsvc -k 01 -l 0x33 -m 0x1e -p 0 -r 02 -t "POKEPINBALL" -i VPHE $@ $(RGBFIX) $(RGBFIXFLAGS) $@
# For contributors to make sure a change didn't affect the contents of the rom. # For contributors to make sure a change didn't affect the contents of the rom.
compare: $(ROM) compare: $(ROM)
@ -43,14 +56,14 @@ clean: tidy
find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pcm' \) -exec rm {} + find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pcm' \) -exec rm {} +
%.interleave.2bpp: %.interleave.png %.interleave.2bpp: %.interleave.png
rgbgfx -o $@ $< $(RGBGFX) -c dmg $(RGBGFXFLAGS) -o $@ $<
tools/gfx --interleave --png $< -o $@ $@ tools/gfx --interleave --png $< -o $@ $@
%.2bpp: %.png %.2bpp: %.png
rgbgfx -o $@ $< $(RGBGFX) -c dmg $(RGBGFXFLAGS) -o $@ $<
%.1bpp: %.png %.1bpp: %.png
rgbgfx -d1 -o $@ $< $(RGBGFX) -c dmg $(RGBGFXFLAGS) -d1 -o $@ $<
%.pcm: %.wav %.pcm: %.wav
tools/pcm -o $@ $< tools/pcm -o $@ $<

View File

@ -1,4 +1,27 @@
charmap "@", $00 charmap "@", $00
charmap " ", $20
charmap "!", $21
charmap "♂", $24 charmap "♂", $24
charmap "*", $2A
charmap ",", $2C
charmap "-", $2D
charmap ".", $2E
charmap ":", $3A
charmap "é", $40 charmap "é", $40
charmap "♀", $5C charmap "♀", $5C
charmap "`", $60
DEF chars EQUS "0123456789"
FOR x, STRLEN(#chars)
charmap STRSLICE(#chars, x, x + 1), $30 + x
ENDR
REDEF chars EQUS "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
FOR x, STRLEN(#chars)
charmap STRSLICE(#chars, x, x + 1), $41 + x
ENDR
REDEF chars EQUS "abcdefghijklmnopqrstuvwxyz"
FOR x, STRLEN(#chars)
charmap STRSLICE(#chars, x, x + 1), $61 + x
ENDR

View File

@ -987,15 +987,15 @@ ShowCapturedPokemonText: ; 0x106b6
ld bc, Data_2a91 ld bc, Data_2a91
ld a, [hl] ld a, [hl]
; check if mon's name starts with a vowel, so it can print "an", instead of "a" ; check if mon's name starts with a vowel, so it can print "an", instead of "a"
cp "A" cp 'A'
jr z, .asm_106f1 jr z, .asm_106f1
cp "I" cp 'I'
jr z, .asm_106f1 jr z, .asm_106f1
cp "U" cp 'U'
jr z, .asm_106f1 jr z, .asm_106f1
cp "E" cp 'E'
jr z, .asm_106f1 jr z, .asm_106f1
cp "O" cp 'O'
jr z, .asm_106f1 jr z, .asm_106f1
ld de, YouGotAText ; "You got a" ld de, YouGotAText ; "You got a"
ld bc, Data_2a79 ld bc, Data_2a79

View File

@ -316,23 +316,23 @@ PlaceTextAlphanumericOnly: ; 0xf7b1 seems to filter out punctuation and other mi
ld a, [hli] ld a, [hli]
and a and a
ret z ;if end of text, ret ret z ;if end of text, ret
cp "0" cp '0'
jr c, .NotADigit ;if a digit, add $56 and skip letter check jr c, .NotADigit ;if a digit, add $56 and skip letter check
cp "9" + 1 cp '9' + 1
jr nc, .NotADigit jr nc, .NotADigit
add $56 add $56
jr .IsValidChar jr .IsValidChar
.NotADigit .NotADigit
cp "A" cp 'A'
jr c, .NotALetter ;if a letter, add $56 and skip letter check jr c, .NotALetter ;if a letter, add $56 and skip letter check
cp "Z" + 1 cp 'Z' + 1
jr nc, .NotALetter jr nc, .NotALetter
add $bf add $bf
jr .IsValidChar jr .IsValidChar
.NotALetter .NotALetter
cp "e" ;check if acute e cp 'e' ;check if acute e
jr nz, .NotAcuteE jr nz, .NotAcuteE
ld a, $83 ld a, $83
jr .IsValidChar jr .IsValidChar
@ -348,9 +348,9 @@ PlaceTextAlphanumericOnly: ; 0xf7b1 seems to filter out punctuation and other mi
ld a, [hli] ld a, [hli]
and a and a
ret z ret z
cp "0" cp '0'
jr c, .asm_f7ef jr c, .asm_f7ef
cp "9" + 1 cp '9' + 1
jr nc, .asm_f7ef jr nc, .asm_f7ef
add $56 add $56
jr .asm_f809 jr .asm_f809

View File

@ -534,15 +534,15 @@ ShowMonEvolvedText: ; 0x10e0a
ld bc, Data_2b34 ld bc, Data_2b34
ld a, [hl] ld a, [hl]
; check if mon's name starts with a vowel, so it can print "an", instead of "a" ; check if mon's name starts with a vowel, so it can print "an", instead of "a"
cp "A" cp 'A'
jr z, .nameStartsWithVowel jr z, .nameStartsWithVowel
cp "I" cp 'I'
jr z, .nameStartsWithVowel jr z, .nameStartsWithVowel
cp "U" cp 'U'
jr z, .nameStartsWithVowel jr z, .nameStartsWithVowel
cp "E" cp 'E'
jr z, .nameStartsWithVowel jr z, .nameStartsWithVowel
cp "O" cp 'O'
jr z, .nameStartsWithVowel jr z, .nameStartsWithVowel
ld de, ItEvolvedIntoAText ; "It evolved into a" ld de, ItEvolvedIntoAText ; "It evolved into a"
ld bc, Data_2b1c ld bc, Data_2b1c

View File

@ -2266,32 +2266,32 @@ PokedexDescriptionVWFCharacterMapping: ; 0x2957c
ret ret
.checkNumericCharacter .checkNumericCharacter
cp "0" cp '0'
jr c, .checkUpperCaseCharacter jr c, .checkUpperCaseCharacter
cp "9" + 1 cp '9' + 1
jr c, .asm_295be jr c, .asm_295be
.checkUpperCaseCharacter .checkUpperCaseCharacter
cp "A" cp 'A'
jr c, .checkLowerCaseCharacter jr c, .checkLowerCaseCharacter
cp "Z" + 1 cp 'Z' + 1
jr c, .asm_295c2 jr c, .asm_295c2
.checkLowerCaseCharacter .checkLowerCaseCharacter
cp "a" cp 'a'
jr c, .checkSpecialCharacter jr c, .checkSpecialCharacter
cp "z" + 1 cp 'z' + 1
jr c, .asm_295c6 jr c, .asm_295c6
.checkSpecialCharacter .checkSpecialCharacter
cp " " cp ' '
jr z, .asm_295ca jr z, .asm_295ca
cp "," cp ','
jr z, .asm_295cd jr z, .asm_295cd
cp "." cp '.'
jr z, .asm_295d1 jr z, .asm_295d1
cp "`" cp '`'
jr z, .asm_295d5 jr z, .asm_295d5
cp "-" cp '-'
jr z, .asm_295d9 jr z, .asm_295d9
cp "é" cp 'é'
jr z, .asm_295dd jr z, .asm_295dd
and a and a
ret ret

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 B

After

Width:  |  Height:  |  Size: 106 B

View File

@ -65,36 +65,36 @@ PlaceText: ; 0x312b loads e chars of text text into de
and a and a
ret z ;if a = 0, jump ret z ;if a = 0, jump
ld c, $81 ld c, $81
cp " " cp ' '
jr z, .space jr z, .space
cp "," cp ','
jr z, .comma jr z, .comma
cp "♂" cp '♂'
jr z, .male jr z, .male
cp "♀" cp '♀'
jr z, .female jr z, .female
cp "`" cp '`'
jr z, .apostrophe jr z, .apostrophe
cp "!" cp '!'
jr z, .exclamation jr z, .exclamation
cp "x" cp 'x'
jr z, .little_x jr z, .little_x
cp "e" cp 'e'
jr z, .e_acute jr z, .e_acute
cp "*" cp '*'
jr z, .asterisk jr z, .asterisk
cp "." cp '.'
jr z, .period jr z, .period
cp ":" cp ':'
jr z, .colon jr z, .colon
cp "0" cp '0'
jr c, .check_AtoZ jr c, .check_AtoZ
cp "9" + 1 cp '9' + 1
jr c, .digit jr c, .digit
.check_AtoZ .check_AtoZ
cp "A" cp 'A'
jr c, .invalid jr c, .invalid
cp "Z" + 1 cp 'Z' + 1
jr c, .alphabet jr c, .alphabet
.invalid .invalid
jr .next_char jr .next_char
@ -276,13 +276,13 @@ UnusedPlaceString: ; 0x3268 seems to place text based on different, confusing lo
and a and a
ret z ret z
ld c, $81 ;special space? ld c, $81 ;special space?
cp " " cp ' '
jr z, .Space ;space jr z, .Space ;space
cp "," cp ','
jr z, .Comma ;comma jr z, .Comma ;comma
cp "0" cp '0'
jr c, .Punctuation ;less than 0 is punctuation jr c, .Punctuation ;less than 0 is punctuation
cp "9" + 1 cp '9' + 1
jr c, .Digits ;less than colon is numbers, more than is a mix of punctuation and AtoZ jr c, .Digits ;less than colon is numbers, more than is a mix of punctuation and AtoZ
.Punctuation .Punctuation
cp $a0 cp $a0
@ -411,10 +411,10 @@ Func_32cc: ; 0x32cc
call Func_3309 call Func_3309
dec b dec b
jr nz, .asm_32ec jr nz, .asm_32ec
ld a, "0" ld a, '0'
ld [de], a ld [de], a
inc de inc de
ld a, " " ld a, ' '
ld [de], a ld [de], a
inc de inc de
xor a xor a
@ -551,10 +551,10 @@ LoadScoreTextFromStack: ; 0x3372 load stationary text header DE into HL, then lo
call LoadBCDDigitAsText call LoadBCDDigitAsText
dec b dec b
jr nz, .Loop ;loop 4 times jr nz, .Loop ;loop 4 times
ld a, "0" ld a, '0'
ld [de], a ld [de], a
inc de inc de
ld a, " " ;end with a 0 and a space ld a, ' ' ;end with a 0 and a space
ld [de], a ld [de], a
inc de inc de
xor a xor a
@ -570,7 +570,7 @@ LoadBCDDigitAsText: ; 0x33a7 Enter BCD digit a into text DE. b is a loop counter
and a and a
ret nz ret nz
.EnterDigit .EnterDigit
add "0" ;load digit into de add '0' ;load digit into de
ld [de], a ld [de], a
inc de inc de
ld c, $0 ;mark that a digit has been entered ld c, $0 ;mark that a digit has been entered
@ -580,7 +580,7 @@ LoadBCDDigitAsText: ; 0x33a7 Enter BCD digit a into text DE. b is a loop counter
cp $3 cp $3
ret nz ;if b is 3 or 6, load a seperator comma into the text ret nz ;if b is 3 or 6, load a seperator comma into the text
.EnterComma .EnterComma
ld a, "," ld a, ','
ld [de], a ld [de], a
inc de inc de
ret ret

View File

@ -1,5 +1,5 @@
; Constant enumeration is useful for mons, maps, etc. ; Constant enumeration is useful for mons, maps, etc.
MACRO const_def MACRO? const_def
if _NARG >= 1 if _NARG >= 1
DEF const_value = \1 DEF const_value = \1
else else
@ -12,7 +12,7 @@ MACRO const_def
endc endc
ENDM ENDM
MACRO const MACRO? const
DEF \1 EQU const_value DEF \1 EQU const_value
DEF const_value = const_value + const_inc DEF const_value = const_value + const_inc
ENDM ENDM
@ -29,50 +29,49 @@ DEF dex_text EQUS "db " ; Start beginning of pokedex description
DEF dex_line EQUS "db $0d," ; Start new line in pokedex description DEF dex_line EQUS "db $0d," ; Start new line in pokedex description
DEF dex_end EQUS "db $00" ; Terminate the pokedex description DEF dex_end EQUS "db $00" ; Terminate the pokedex description
MACRO dbw MACRO? dbw
db \1 db \1
dw \2 dw \2
ENDM ENDM
MACRO dwb MACRO? dwb
dw \1 dw \1
db \2 db \2
ENDM ENDM
MACRO dba MACRO? dba
dbw BANK(\1), \1 dbw BANK(\1), \1
ENDM ENDM
MACRO dab MACRO? dab
dwb \1, BANK(\1) dwb \1, BANK(\1)
ENDM ENDM
MACRO lb MACRO? lb
ld \1, (\2 << 8) | \3 ld \1, ((\2) << 8) | (\3)
ENDM ENDM
MACRO padded_dab MACRO? padded_dab
dab \1 dab \1
db $00 db $00
ENDM ENDM
MACRO dn MACRO? dn
rept _NARG / 2 rept? _NARG / 2
db (\1) << 4 + (\2) db (\1) << 4 + (\2)
shift shift 2
shift
endr endr
ENDM ENDM
MACRO dx MACRO? dx
DEF x = 8 * ((\1) - 1) DEF x = 8 * ((\1) - 1)
rept \1 rept? \1
db ((\2) >> x) & $ff db ((\2) >> x) & $ff
DEF x = x + -8 DEF x -= 8
endr endr
ENDM ENDM
MACRO bigdw ; big-endian word MACRO? bigdw ; big-endian word
dx 2, \1 dx 2, \1
ENDM ENDM
@ -89,22 +88,21 @@ MACRO callba
ENDC ENDC
ENDM ENDM
MACRO bigBCD6 MACRO? bigBCD6
; There is probably a better name for this macro. ; There is probably a better name for this macro.
; It write a BCD in big-endian form. ; It write a BCD in big-endian form.
dn ((\1) / 10) % 10, (\1) % 10 FOR x, 6
dn ((\1) / 1000) % 10, ((\1) / 100) % 10 ; 10**10 and 10**11 would overflow a 32-bit integer,
dn ((\1) / 100000) % 10, ((\1) / 10000) % 10 ; so split the division into two steps
dn ((\1) / 10000000) % 10, ((\1) / 1000000) % 10 dn ((\1) / 10**(x + 1) / 10**x) % 10, ((\1) / 10**x / 10**x) % 10
dn ((\1) / 1000000000) % 10, ((\1) / 100000000) % 10 ENDR
dn ((\1) / 100000000000) % 10, ((\1) / 10000000000) % 10
ENDM ENDM
;\1 = X ;\1 = X
;\2 = Y ;\2 = Y
;\3 = Reference Background Map (e.g. vBGMap or vBGWin) ;\3 = Reference Background Map (e.g. vBGMap or vBGWin)
MACRO coord MACRO? coord
ld \1, \4 + $20 * \3 + \2 ld \1, (\4) + $20 * (\3) + (\2)
ENDM ENDM
DEF hlCoord EQUS "coord hl," DEF hlCoord EQUS "coord hl,"
@ -116,67 +114,67 @@ DEF tile EQUS "+ $10 *"
;\1 = 5-bit Blue value ;\1 = 5-bit Blue value
;\2 = 5-bit Green value ;\2 = 5-bit Green value
;\3 = 5-bit Red value ;\3 = 5-bit Red value
MACRO RGB MACRO? RGB
dw (\3 << 10 | \2 << 5 | \1) dw (\3) << 10 | (\2) << 5 | (\1)
ENDM ENDM
;\1 = pointer to 2bpp tile data ;\1 = pointer to 2bpp tile data
;\2 = destination for tile data in VRAM ;\2 = destination for tile data in VRAM
;\3 = size of 2bpp tile data to copy ;\3 = size of 2bpp tile data to copy
MACRO VIDEO_DATA_TILES MACRO? VIDEO_DATA_TILES
dw \1 dw \1
db Bank(\1) db BANK(\1)
dw \2 dw \2
dw (\3 << 2) dw (\3) << 2
ENDM ENDM
;\1 = pointer to 2bpp tile data ;\1 = pointer to 2bpp tile data
;\2 = bank of data ;\2 = bank of data
;\3 = destination for tile data in VRAM ;\3 = destination for tile data in VRAM
;\4 = size of 2bpp tile data to copy ;\4 = size of 2bpp tile data to copy
MACRO VIDEO_DATA_TILES_BANK MACRO? VIDEO_DATA_TILES_BANK
dw \1 dw \1
db \2 db \2
dw \3 dw \3
dw (\4 << 2) dw (\4) << 2
ENDM ENDM
;\1 = pointer to 2bpp tile data ;\1 = pointer to 2bpp tile data
;\2 = destination for tile data in VRAM ;\2 = destination for tile data in VRAM
;\3 = size of 2bpp tile data to copy ;\3 = size of 2bpp tile data to copy
MACRO VIDEO_DATA_TILES_BANK2 MACRO? VIDEO_DATA_TILES_BANK2
dw \1 dw \1
db Bank(\1) db BANK(\1)
dw \2 dw \2
dw (\3 << 2) | $2 dw ((\3) << 2) | $2
ENDM ENDM
;\1 = pointer to tilemap data ;\1 = pointer to tilemap data
;\2 = destination for tilemap data in VRAM ;\2 = destination for tilemap data in VRAM
;\3 = size of tilemap to copy ;\3 = size of tilemap to copy
MACRO VIDEO_DATA_TILEMAP MACRO? VIDEO_DATA_TILEMAP
VIDEO_DATA_TILES \1, \2, \3 VIDEO_DATA_TILES \1, \2, \3
ENDM ENDM
;\1 = pointer to tilemap data ;\1 = pointer to tilemap data
;\2 = destination for tilemap data in VRAM ;\2 = destination for tilemap data in VRAM
;\3 = size of tilemap to copy ;\3 = size of tilemap to copy
MACRO VIDEO_DATA_TILEMAP_BANK2 MACRO? VIDEO_DATA_TILEMAP_BANK2
VIDEO_DATA_TILES_BANK2 \1, \2, \3 VIDEO_DATA_TILES_BANK2 \1, \2, \3
ENDM ENDM
;\1 = pointer to background attribute data ;\1 = pointer to background attribute data
;\2 = destination for background attribute data in VRAM ;\2 = destination for background attribute data in VRAM
;\3 = size of background attribute data to copy ;\3 = size of background attribute data to copy
MACRO VIDEO_DATA_BGATTR MACRO? VIDEO_DATA_BGATTR
VIDEO_DATA_TILES_BANK2 \1, \2, \3 VIDEO_DATA_TILES_BANK2 \1, \2, \3
ENDM ENDM
;\1 = pointer to palette data ;\1 = pointer to palette data
;\2 = size of palette data ;\2 = size of palette data
MACRO VIDEO_DATA_PALETTES MACRO? VIDEO_DATA_PALETTES
dw \1 dw \1
db Bank(\1) db BANK(\1)
dw $0000 dw $0000
dw (\2 << 1) | $1 dw ((\2) << 1) | $1
ENDM ENDM

View File

@ -1,71 +1,71 @@
MACRO dex_number MACRO dex_number
db ((\1 / 100) % 10) + "0" db (((\1) / 100) % 10) + '0'
db ((\1 / 10) % 10) + "0" db (((\1) / 10) % 10) + '0'
db ((\1 / 1) % 10) + "0" db ((\1) % 10) + '0'
db "@" db "@"
ENDM ENDM
; \1 = feet ; \1 = feet
; \2 = inches ; \2 = inches
MACRO dex_height MACRO dex_height
DEF feet_tens_digit = (\1 / 10) % 10 DEF feet_tens_digit = ((\1) / 10) % 10
IF feet_tens_digit == 0 IF feet_tens_digit == 0
db " " db " "
ELSE ELSE
db feet_tens_digit + "0" db feet_tens_digit + '0'
ENDC ENDC
DEF feet_ones_digit = \1 % 10 DEF feet_ones_digit = (\1) % 10
db feet_ones_digit + "0" db feet_ones_digit + '0'
DEF inches_tens_digit = (\2 / 10) % 10 DEF inches_tens_digit = ((\2) / 10) % 10
IF inches_tens_digit > 0 IF inches_tens_digit > 0
db $70 db $70
ELSE ELSE
db $72 db $72
ENDC ENDC
DEF inches_ones_digit = \2 % 10 DEF inches_ones_digit = (\2) % 10
db inches_ones_digit + "0" db inches_ones_digit + '0'
db "@" db "@"
ENDM ENDM
MACRO dex_weight MACRO dex_weight
IF \1 >= 1000 IF \1 >= 1000
db ((\1 / 1000) % 10) + "0" db ((\1 / 1000) % 10) + '0'
ELSE ELSE
db " " db " "
ENDC ENDC
IF \1 >= 100 IF \1 >= 100
db ((\1 / 100) % 10) + "0" db ((\1 / 100) % 10) + '0'
ELSE ELSE
db " " db " "
ENDC ENDC
IF \1 >= 10 IF \1 >= 10
db ((\1 / 10) % 10) + "0" db ((\1 / 10) % 10) + '0'
ELSE ELSE
db " " db " "
ENDC ENDC
db (\1 % 10) + "0" db ((\1) % 10) + '0'
db $00, $83 db $00, $83
ENDM ENDM
MACRO dex_weight_decimal MACRO dex_weight_decimal
DEF x = \1 * 10 DEF x = (\1) * 10
IF x >= 100 IF x >= 100
db ((x / 100) % 10) + "0" db ((x / 100) % 10) + '0'
ELSE ELSE
db " " db " "
ENDC ENDC
IF x >= 10 IF x >= 10
db ((x / 100) % 10) + "0" db ((x / 100) % 10) + '0'
ELSE ELSE
db " " db " "
ENDC ENDC
db (x % 10) + "0" db (x % 10) + '0'
db (\2 % 10) + "0" db ((\2) % 10) + '0'
db $00, $FC db $00, $FC
ENDM ENDM
@ -73,21 +73,19 @@ ENDM
MACRO dex_species MACRO dex_species
; Add right padding to format to 11 characters, define 2 bytes ; Add right padding to format to 11 characters, define 2 bytes
; for each character (using dex_species_char below) ; for each character (using dex_species_char below)
DEF I = 0 FOR I, STRLEN(\1)
REPT STRLEN(\1) dex_species_char CHARVAL(STRSLICE(\1, I, I + 1))
DEF I = I + 1 ENDR
dex_species_char STRSUB(\1\, I\, 1) REPT 11 - STRLEN(\1)
ENDR dex_species_char ' '
REPT 11 - STRLEN(\1) ENDR
dex_species_char " " db "@"
ENDR
db "@"
ENDM ENDM
MACRO dex_species_char MACRO dex_species_char
IF \1 == " " IF (\1) == ' '
db $81, $40 db $81, $40
ELSE ELSE
db $82, \1 + $1F db $82, (\1) + $1F
ENDC ENDC
ENDM ENDM

@ -1 +0,0 @@
Subproject commit 979c98a7c0f67ad6b9685b2d532c66a1f76ffb22