rgbds 0.6 (#12)

This commit is contained in:
FexCollects 2025-02-08 22:49:11 -07:00 committed by GitHub
parent 1cd781b903
commit 705e8068fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 199 additions and 198 deletions

View File

@ -37,9 +37,9 @@ verify: series_1_z80 berries_z80 berries_2_z80 promo_en_z80 p_promo_z80 n_promo_
trainers/%-EN.tx: trainers/%.asm
python3 ../scripts/regionalize.py $< $@ EN EN
trainers/%.o: trainers/%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
trainers/%.gbc: trainers/%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
trainers/%.bin: trainers/%.gbc
python3 ../scripts/stripgbc.py $< $@
trainers/%.z80: trainers/%.gbc
@ -51,9 +51,9 @@ trainers/%.mev: trainers/%.bin
berries/%-EN.tx: berries/%.asm
python3 ../scripts/regionalize.py $< $@ EN EN
berries/%.o: berries/%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
berries/%.gbc: berries/%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
berries/%.bin: berries/%.gbc
python3 ../scripts/stripgbc.py $< $@
berries/%.z80: berries/%.gbc
@ -65,9 +65,9 @@ berries/%.mev: berries/%.bin
prologue-%.tx: prologue.asm
python3 ../scripts/regionalize.py $< $@ $* $*
prologue-%.o: prologue-%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
prologue-%.gbc: prologue-%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
prologue-%.bin: prologue-%.gbc
python3 ../scripts/stripgbc.py $< $@
@ -77,9 +77,9 @@ battletrainer-%.tx: battletrainer.asm prologue-%.bin
08-A%-EN.tx: 08-A%.asm battletrainer-EN.tx
python3 ../scripts/ereadertext.py $< $@ EN
08-A%.o: 08-A%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
08-A%.gbc: 08-A%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
08-A%.z80: 08-A%.gbc
python3 ../scripts/stripgbc.py $< $@
08-A%.vpk: 08-A%.z80
@ -90,9 +90,9 @@ battletrainer-%.tx: battletrainer.asm prologue-%.bin
08-B%-EN.tx: 08-B%.asm battletrainer-EN.tx
python3 ../scripts/ereadertext.py $< $@ EN
08-B%.o: 08-B%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
08-B%.gbc: 08-B%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
08-B%.z80: 08-B%.gbc
python3 ../scripts/stripgbc.py $< $@
08-B%.vpk: 08-B%.z80
@ -103,9 +103,9 @@ battletrainer-%.tx: battletrainer.asm prologue-%.bin
129-B%-EN.tx: 129-B%.asm battletrainer-EN.tx
python3 ../scripts/ereadertext.py $< $@ EN
129-B%.o: 129-B%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
129-B%.gbc: 129-B%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
129-B%.z80: 129-B%.gbc
python3 ../scripts/stripgbc.py $< $@
129-B%.vpk: 129-B%.z80
@ -118,9 +118,9 @@ enigmaberry-%.tx: enigmaberry.asm prologue-%.bin
08-K%-EN.tx: 08-K%.asm enigmaberry-EN.tx
python3 ../scripts/ereadertext.py $< $@ EN
08-K%.o: 08-K%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
08-K%.gbc: 08-K%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
08-K%.z80: 08-K%.gbc
python3 ../scripts/stripgbc.py $< $@
08-K%.vpk: 08-K%.z80
@ -131,9 +131,9 @@ enigmaberry-%.tx: enigmaberry.asm prologue-%.bin
08-N%-EN.tx: 08-N%.asm battletrainer-EN.tx
python3 ../scripts/ereadertext.py $< $@ EN
08-N%.o: 08-N%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
08-N%.gbc: 08-N%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
08-N%.z80: 08-N%.gbc
python3 ../scripts/stripgbc.py $< $@
08-N%.vpk: 08-N%.z80
@ -144,9 +144,9 @@ enigmaberry-%.tx: enigmaberry.asm prologue-%.bin
08-P%-EN.tx: 08-P%.asm battletrainer-EN.tx
python3 ../scripts/ereadertext.py $< $@ EN
08-P%.o: 08-P%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
08-P%.gbc: 08-P%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
08-P%.z80: 08-P%.gbc
python3 ../scripts/stripgbc.py $< $@
08-P%.vpk: 08-P%.z80

View File

@ -9,7 +9,7 @@ INCLUDE "../constants/trainerclasses.asm"
MOSSDEEP EQU 0
Battle_Trainer: MACRO
MACRO Battle_Trainer
Section "battle",ROM0[$100]
db $01
dd $02000000
@ -22,32 +22,32 @@ Battle_Trainer: MACRO
BT_Level EQUS "db"
Class EQUS "db"
BT_Floor EQUS "dw" ; the byte after it is 00, but apparently means something…
Intro_EN: MACRO
MACRO Intro_EN
IF REGION == REGION_EN
dw \1, \2, \3, \4, \5, \6
ENDC
ENDM
Win_EN: MACRO
MACRO Win_EN
IF REGION == REGION_EN
dw \1, \2, \3, \4, \5, \6
ENDC
ENDM
Loss_EN: MACRO
MACRO Loss_EN
IF REGION == REGION_EN
dw \1, \2, \3, \4, \5, \6
ENDC
ENDM
Intro_JP: MACRO
MACRO Intro_JP
IF REGION == REGION_JP
dw \1, \2, \3, \4, \5, \6
ENDC
ENDM
Win_JP: MACRO
MACRO Win_JP
IF REGION == REGION_JP
dw \1, \2, \3, \4, \5, \6
ENDC
ENDM
Loss_JP: MACRO
MACRO Loss_JP
IF REGION == REGION_JP
dw \1, \2, \3, \4, \5, \6
ENDC
@ -56,21 +56,21 @@ Pokemon EQUS "dw"
Holds EQUS "dw"
Moves EQUS "dw"
Level EQUS "db"
PP_Ups: MACRO
MACRO PP_Ups
db (\1) + (\2 << 2) + (\3 << 4) + (\4 << 6)
ENDM
EVs EQUS "db"
OT_ID EQUS "dw"
IVs: MACRO
MACRO IVs
dw \1 + (\2 << 5) + (\3 << 10) + ((\4 & 1) << 15)
dw (\4 >> 1) + (\5 << 4) + (\6 << 9) + (\7 << 15)
ENDM
PV: MACRO
MACRO PV
dw (\1 & $FFFF), (\1 >> 16)
ENDM
Friendship EQUS "db"
End_Trainer: MACRO
MACRO End_Trainer
db 0,0,0,0
EOF
ENDM
ENDM

BIN
bin/rgbds/v0.6.0/rgbasm Executable file

Binary file not shown.

BIN
bin/rgbds/v0.6.0/rgblink Executable file

Binary file not shown.

View File

@ -1,184 +1,184 @@
LASTRESULT EQU $800D
end: MACRO
MACRO end
db $02
ENDM
return: MACRO
MACRO return
db $03
ENDM
goto: MACRO
MACRO goto
db $05
dd \1
ENDM
goto_if: MACRO
MACRO goto_if
db $06
db \1
dd \2
ENDM
call_if: MACRO
MACRO call_if
db $07
db \1
dd \2
ENDM
gotostd: MACRO
MACRO gotostd
db $08
db \1
ENDM
callstd: MACRO
MACRO callstd
db $09, \1
ENDM
gotostd_if: MACRO
MACRO gotostd_if
db $0A
db \1
db \2
ENDM
callstd_if: MACRO
MACRO callstd_if
db $0B
db \3
db \2
ENDM
returnram: MACRO
MACRO returnram
db $0C
ENDM
killscript: MACRO
MACRO killscript
db $0D
ENDM
setbyte: MACRO
MACRO setbyte
db $0E, \1
ENDM
loadword: MACRO
MACRO loadword
db $0F
db \1
dd \2
ENDM
loadbyte: MACRO
MACRO loadbyte
db $10
db \1
db \2
ENDM
writebytetoaddr: MACRO
MACRO writebytetoaddr
db $11
db \1
dd \2
ENDM
loadbytefromaddr: MACRO
MACRO loadbytefromaddr
db $12
db \1
dd \2
ENDM
setptrbyte: MACRO
MACRO setptrbyte
db $13
db \1
dd \2
ENDM
copylocal: MACRO
MACRO copylocal
db $14
db \1
db \2
ENDM
copybyte: MACRO
MACRO copybyte
db $15
dd \1
dd \2
ENDM
setvar: MACRO
MACRO setvar
db $16
dw \1
dw \2
ENDM
addvar: MACRO
MACRO addvar
db $17
dw \1
dw \2
ENDM
subvar: MACRO
MACRO subvar
db $18
dw \1
dw \2
ENDM
copyvar: MACRO
MACRO copyvar
db $19
dw \1
dw \2
ENDM
copyvarifnotzero: MACRO
MACRO copyvarifnotzero
db $1A
dw \1, \2
ENDM
compare: MACRO
MACRO compare
db $21
dw \1, \2
ENDM
setflag: MACRO
MACRO setflag
db $29
dw \1
ENDM
checkflag: MACRO
MACRO checkflag
db $2B
dw \1
ENDM
playfanfare: MACRO
MACRO playfanfare
db $31
dw \1
ENDM
waitfanfare: MACRO
MACRO waitfanfare
db $32
ENDM
getpartysize: MACRO
MACRO getpartysize
db $43
ENDM
additem: MACRO
MACRO additem
db $44
dw \1, \2
ENDM
checkitemroom: MACRO
MACRO checkitemroom
db $46
dw \1, \2
ENDM
checkitem: MACRO
MACRO checkitem
db $47
dw \1, \2
ENDM
checkpcitem: MACRO
MACRO checkpcitem
db $4A
dw \1, \2
ENDM
adddecoration: MACRO
MACRO adddecoration
db $4b
dw \1
ENDM
faceplayer: MACRO
MACRO faceplayer
db $5A
ENDM
waitmsg: MACRO
MACRO waitmsg
db $66
ENDM
lock: MACRO
MACRO lock
db $6A
ENDM
release: MACRO
MACRO release
db $6C
ENDM
waitkeypress: MACRO
MACRO waitkeypress
db $6D
ENDM
showmonpic: MACRO
MACRO showmonpic
db $75
dw \1
db \2
db \3
ENDM
hidemonpic: MACRO
MACRO hidemonpic
db $76
ENDM
showcontestpainting: MACRO
MACRO showcontestpainting
db $77
db \1
ENDM
braillemessage: MACRO
MACRO braillemessage
db $78
dd \1
ENDM
brailleformat: MACRO
MACRO brailleformat
db \1
db \2
db \3
@ -186,7 +186,7 @@ brailleformat: MACRO
db \5
db \6
ENDM
givemon: MACRO
MACRO givemon
db $79
dw \1
db \2
@ -195,104 +195,104 @@ givemon: MACRO
dd \5
db \6
ENDM
giveegg: MACRO
MACRO giveegg
db $7A
dw \1
ENDM
setmonmove: MACRO
MACRO setmonmove
db $7b
db \1
db \2
dw \3
ENDM
checkpartymove: MACRO
MACRO checkpartymove
db $7c
dw \1
ENDM
bufferspeciesname: MACRO
MACRO bufferspeciesname
db $7d
db \1
dw \2
ENDM
bufferleadmonspeciesname: MACRO
MACRO bufferleadmonspeciesname
db $7E
db \1
ENDM
bufferpartymonnick: MACRO
MACRO bufferpartymonnick
db $7f
db \1
dw \2
ENDM
bufferitemname: MACRO
MACRO bufferitemname
db $80
db \1
dw \2
ENDM
bufferdecorationname: MACRO
MACRO bufferdecorationname
db $81
db \1
dw \2
ENDM
buffermovename: MACRO
MACRO buffermovename
db $82
db \1
dw \2
ENDM
random: MACRO
MACRO random
db $8F
dw \1
ENDM
setrespawn: MACRO
MACRO setrespawn
db $9F
dw \1
ENDM
checkplayergender: MACRO
MACRO checkplayergender
db $A0
ENDM
playmoncry: MACRO
MACRO playmoncry
db $A1
dw \1
dw \2
ENDM
setwildbattle: MACRO
MACRO setwildbattle
db $B6
dw \1
db \2
dw \3
ENDM
dowildbattle: MACRO
MACRO dowildbattle
db $B7
ENDM
setvirtualaddress: MACRO
MACRO setvirtualaddress
db $B8
GBAPTR \1
ENDM
virtualgotoif: MACRO
MACRO virtualgotoif
db $BB
db \1
GBAPTR \2
ENDM
virtualmsgbox: MACRO
MACRO virtualmsgbox
db $BD
GBAPTR \1
ENDM
virtualloadpointer: MACRO
MACRO virtualloadpointer
db $BE
GBAPTR \1
ENDM
waitmoncry: MACRO
MACRO waitmoncry
db $C5
ENDM
setmoneventlegal: MACRO
MACRO setmoneventlegal
db $CD
dw \1
ENDM
checkmoneventlegal: MACRO
MACRO checkmoneventlegal
db $CE
dw \1
ENDM
setmonmetlocation: MACRO
MACRO setmonmetlocation
db $D2
dw \1
db \2
ENDM
ENDM

View File

@ -4,9 +4,9 @@ all: 08-O001-EN.raw
decoration-%.tx: decoration.asm
python3 ../scripts/regionalize.py $< $@ $* $*
decoration-%.o: decoration-%.tx
../bin/rgbds/v0.2.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
decoration-%.gbc: decoration-%.o
../bin/rgbds/v0.2.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
decoration-%.bin: decoration-%.gbc
python3 ../scripts/stripgbc.py $< $@
decoration-%.mev: decoration-%.bin
@ -15,18 +15,18 @@ decoration-%.mev: decoration-%.bin
prologue-%.tx: prologue.asm
python3 ../scripts/regionalize.py $< $@ $* $*
prologue-%.o: prologue-%.tx
../bin/rgbds/v0.2.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
prologue-%.gbc: prologue-%.o
../bin/rgbds/v0.2.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
prologue-%.bin: prologue-%.gbc
python3 ../scripts/stripgbc.py $< $@
08-O001-%.tx: 08-O001.asm decoration-%.mev prologue-%.bin
python3 ../scripts/ereadertext.py $< $@ $*
08-O001-%.o: 08-O001-%.tx
../bin/rgbds/v0.2.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
08-O001-%.gbc: 08-O001-%.o
../bin/rgbds/v0.2.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
08-O001-%.z80: 08-O001-%.gbc
python3 ../scripts/stripgbc.py $< $@
08-O001-%.vpk: 08-O001-%.z80
@ -38,9 +38,9 @@ prologue-%.bin: prologue-%.gbc
decoration-tickets-%.tx: decoration-tickets.asm
python3 ../scripts/regionalize.py $< $@ $* $*
decoration-tickets-%.o: decoration-tickets-%.tx
../bin/rgbds/v0.2.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
decoration-tickets-%.gbc: decoration-tickets-%.o
../bin/rgbds/v0.2.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
decoration-tickets-%.bin: decoration-tickets-%.gbc
python3 ../scripts/stripgbc.py $< $@
decoration-tickets-%.mev: decoration-tickets-%.bin
@ -49,9 +49,9 @@ decoration-tickets-%.mev: decoration-tickets-%.bin
08-O002-%.tx: 08-O002.asm decoration-tickets-%.mev prologue-%.bin
python3 ../scripts/ereadertext.py $< $@ $*
08-O002-%.o: 08-O002-%.tx
../bin/rgbds/v0.2.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
08-O002-%.gbc: 08-O002-%.o
../bin/rgbds/v0.2.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
08-O002-%.z80: 08-O002-%.gbc
python3 ../scripts/stripgbc.py $< $@
08-O002-%.vpk: 08-O002-%.z80

View File

@ -1,6 +1,7 @@
INCLUDE "../macros.asm"
INCLUDE "../constants/items.asm"
INCLUDE "../constants/scriptcommands.asm"
SECTION "CODE", ROM0
DataStartRegirock:
Mystery_Event
@ -120,4 +121,4 @@ RegisteelEnd:
EndofRegiChunks:
DataEnd:
EOF
EOF

View File

@ -6,9 +6,9 @@ verify:
eonticket-%.tx: eonticket.asm
python3 ../scripts/regionalize.py $< $@ $* $*
eonticket-%.o: eonticket-%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
eonticket-%.gbc: eonticket-%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
eonticket-%.bin: eonticket-%.gbc
python3 ../scripts/stripgbc.py $< $@
eonticket-%.mev: eonticket-%.bin
@ -17,18 +17,18 @@ eonticket-%.mev: eonticket-%.bin
prologue-%.tx: prologue.asm
python3 ../scripts/regionalize.py $< $@ $* $*
prologue-%.o: prologue-%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
prologue-%.gbc: prologue-%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
prologue-%.bin: prologue-%.gbc
python3 ../scripts/stripgbc.py $< $@
00-C000-%.tx: 00-C000.asm eonticket-%.mev prologue-%.bin
python3 ../scripts/ereadertext.py $< $@ $*
00-C000-%.o: 00-C000-%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
00-C000-%.gbc: 00-C000-%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
00-C000-%.z80: 00-C000-%.gbc
python3 ../scripts/stripgbc.py $< $@
00-C000-%.vpk: 00-C000-%.z80

View File

@ -159,4 +159,4 @@ BagsKeyItemsPocketFull:
Text_DE "Deine BASIS-TASCHE ist voll.@"
DataEnd:
EOF
EOF

View File

@ -4,9 +4,9 @@ all: 00-G000-EN.raw
giftpokemon-%.tx: giftpokemon.asm
python3 ../scripts/regionalize.py $< $@ $* $*
giftpokemon-%.o: giftpokemon-%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
giftpokemon-%.gbc: giftpokemon-%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
giftpokemon1-%.bin: giftpokemon-%.gbc
python3 ../scripts/stripgbc.py $< $@
giftpokemon-%.bin: giftpokemon1-%.bin
@ -17,18 +17,18 @@ giftpokemon-%.mev: giftpokemon-%.bin
prologue-%.tx: prologue.asm
python3 ../scripts/regionalize.py $< $@ $* $*
prologue-%.o: prologue-%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
prologue-%.gbc: prologue-%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
prologue-%.bin: prologue-%.gbc
python3 ../scripts/stripgbc.py $< $@
00-G000-%.tx: 00-G000.asm giftpokemon-%.mev prologue-%.bin
python3 ../scripts/ereadertext.py $< $@ $*
00-G000-%.o: 00-G000-%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
00-G000-%.gbc: 00-G000-%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
00-G000-%.z80: 00-G000-%.gbc
python3 ../scripts/stripgbc.py $< $@
00-G000-%.vpk: 00-G000-%.z80

View File

@ -9,7 +9,7 @@ INCLUDE "../constants/trainerclasses.asm"
MOSSDEEP EQU 0
Battle_Trainer: MACRO
MACRO Battle_Trainer
Section "battle",ROM0[$100]
db $01
dd $02000000
@ -22,32 +22,32 @@ Battle_Trainer: MACRO
BT_Level EQUS "db"
Class EQUS "db"
BT_Floor EQUS "dw" ; the byte after it is 00, but apparently means something…
Intro_EN: MACRO
MACRO Intro_EN
IF REGION == REGION_EN
dw \1, \2, \3, \4, \5, \6
ENDC
ENDM
Win_EN: MACRO
MACRO Win_EN
IF REGION == REGION_EN
dw \1, \2, \3, \4, \5, \6
ENDC
ENDM
Loss_EN: MACRO
MACRO Loss_EN
IF REGION == REGION_EN
dw \1, \2, \3, \4, \5, \6
ENDC
ENDM
Intro_JP: MACRO
MACRO Intro_JP
IF REGION == REGION_JP
dw \1, \2, \3, \4, \5, \6
ENDC
ENDM
Win_JP: MACRO
MACRO Win_JP
IF REGION == REGION_JP
dw \1, \2, \3, \4, \5, \6
ENDC
ENDM
Loss_JP: MACRO
MACRO Loss_JP
IF REGION == REGION_JP
dw \1, \2, \3, \4, \5, \6
ENDC
@ -56,16 +56,16 @@ Pokemon EQUS "dw"
Holds EQUS "dw"
Moves EQUS "dw"
Level EQUS "db"
PP_Ups: MACRO
MACRO PP_Ups
db (\1) + (\2 << 2) + (\3 << 4) + (\4 << 6)
ENDM
EVs EQUS "db"
OT_ID EQUS "dw"
IVs: MACRO
MACRO IVs
dw \1 + (\2 << 5) + (\3 << 10) + ((\4 & 1) << 15)
dw (\4 >> 1) + (\5 << 4) + (\6 << 9) + (\7 << 15)
ENDM
PV: MACRO
MACRO PV
dw (\1 & $FFFF), (\1 >> 16)
ENDM
Friendship EQUS "db"
@ -76,17 +76,17 @@ PP EQUS "db"
Condition EQUS "db"
PokerusStatus EQUS "db"
MetLocation EQUS "db"
Origins: MACRO
MACRO Origins
dw \1 + (\2 << 7) + (\3 << 11) + (\4 << 15)
ENDM
Ribbons EQUS "dd"
Ability: MACRO
MACRO Ability
dd (\1 << 28)
ENDM
End_GiftPokemon: MACRO
MACRO End_GiftPokemon
db $01,$00,$02,$00,$03,$00,$04,$00,$05,$00,$06,$00,$07,$00,$08,$00,$09,$00,$BF,$C8,$C1,$C6,$C3,$CD,$C2,$FF,$0F,$27,$00,$00,$4A,$75,$82,$00,$00,$03
ENDM
End_GiftEgg: MACRO
MACRO End_GiftEgg
db $00,$31,$00,$03,$49,$6A,$00,$03,$30,$06,$00,$00,$00,$31,$00,$03,$DF,$8F,$00,$08,$F0,$17,$00,$03,$A3,$07,$00,$08,$17,$00,$00,$00,$8C,$1D,$00,$03
ENDM
ENDM

View File

@ -2,111 +2,111 @@
; but are used in e-Reader programs
; ld [\1], hl
LD_IND_HL: MACRO
MACRO LD_IND_HL
db $22, (\1 & $FF), (\1 >> 8)
ENDM
; ld [\1], a
LD_IND_A: MACRO
MACRO LD_IND_A
db $32, (\1 & $FF), (\1 >> 8)
ENDM
; ld hl, [\1]
LD_HL_IND: MACRO
MACRO LD_HL_IND
db $2A, (\1 & $FF), (\1 >> 8)
ENDM
; ld a, [\1]
LD_A_IND: MACRO
MACRO LD_A_IND
db $3A
dw \1
ENDM
waita: MACRO
MACRO waita
ld a, \1
db $76
ENDM
; ld [hl], a
LD_IND_HL_A: MACRO
MACRO LD_IND_HL_A
db $77
ENDM
; ld a, [hl]
LD_IND_A_HL: MACRO
MACRO LD_IND_A_HL
db $7E
ENDM
; ld c, [hl]
LD_IND_C_HL: MACRO
MACRO LD_IND_C_HL
db $4E
ENDM
; ld b, [hl]
LD_IND_B_HL: MACRO
MACRO LD_IND_B_HL
db $46
ENDM
; ld l, [hl]
LD_IND_L_HL: MACRO
MACRO LD_IND_L_HL
db $6E
ENDM
; ld e, [hl]
LD_IND_E_HL: MACRO
MACRO LD_IND_E_HL
db $5E
ENDM
; ld d, [hl]
LD_IND_D_HL: MACRO
MACRO LD_IND_D_HL
db $56
ENDM
; ld [hl], c
LD_IND_HL_C: MACRO
MACRO LD_IND_HL_C
db $71
ENDM
; ld [hl], b
LD_IND_HL_B: MACRO
MACRO LD_IND_HL_B
db $70
ENDM
; ld a, [de]
LD_IND_A_DE: MACRO
MACRO LD_IND_A_DE
db $1A
ENDM
; add a, [hl]
ADD_A_HL_IND: MACRO
MACRO ADD_A_HL_IND
db $86
ENDM
EX_DE_HL: MACRO
MACRO EX_DE_HL
db $EB
ENDM
wait: MACRO
MACRO wait
db $D3, \1
ENDM
API: MACRO
MACRO API
db ($C7 + (\1 & $100) >> 5), (\1 & $FF) ; $C7 for API $0xx, $CF for API $1xx
ENDM
dd: MACRO
MACRO dd
dw (\1) & $FFFF
dw (\1) >> 16
ENDM
RGB: MACRO
MACRO RGB
dw (\1) | ((\2) << 5) | ((\3) << 10)
ENDM
GBAPTR: MACRO
MACRO GBAPTR
dd $02000000 + \1 - ScriptBaseAddress
ENDM
Insert_Prologue: MACRO
MACRO Insert_Prologue
db "GameFreak inc."
db 0,0,0,0,0,0
dd \1
@ -122,7 +122,7 @@ Insert_Prologue: MACRO
db 0,0
ENDM
Mystery_Event: MACRO
MACRO Mystery_Event
ScriptBaseAddress EQU $100
SECTION "mysteryevent", ROM0[$100]
db $01
@ -157,30 +157,30 @@ DOME_TRAINER EQU $11 ; Battle Dome trainer
; an FF byte followed by 00s will flag the end of the program so that it can
; be extracted automatically from the Game Boy ROM that rgbds tries to build
EOF: MACRO
MACRO EOF
db $FF
ENDM
; names for some API functions based on Martin Korths GBATEK
; http://problemkaputt.de/gbatek.htm
FadeIn: MACRO
MACRO FadeIn
ld a, \1
API $000
ENDM
SetBackgroundAutoScroll: MACRO
MACRO SetBackgroundAutoScroll
ld bc, \1
ld de, \2
xor a
API $012
ENDM
SetBackgroundMode: MACRO
MACRO SetBackgroundMode
ld e, \1
push de
xor a
API $019
ENDM
API_02C: MACRO
MACRO API_02C
ld hl, $0000
push hl
ld bc, \1
@ -192,7 +192,7 @@ API_02C: MACRO
ENDC
API $02C
ENDM
LoadCustomBackground: MACRO
MACRO LoadCustomBackground
ld de, \1
IF \2 == 0
xor a ; save a byte
@ -201,44 +201,44 @@ LoadCustomBackground: MACRO
ENDC
API $02D
ENDM
SetSpritePos: MACRO
MACRO SetSpritePos
ld bc, \3
ld de, \2
LD_HL_IND \1
API $032
ENDM
SpriteShow: MACRO
MACRO SpriteShow
LD_HL_IND \1
API $046
ENDM
SpriteHide: MACRO
MACRO SpriteHide
LD_HL_IND \1
API $047
ENDM
SpriteMirrorToggle: MACRO
MACRO SpriteMirrorToggle
ld e, \1
LD_HL_IND \2
API $048
ENDM
CreateCustomSprite: MACRO
MACRO CreateCustomSprite
ld e, \2
ld hl, \3
API $04D
LD_IND_HL \1
ENDM
SpriteAutoScaleUntilSize: MACRO
MACRO SpriteAutoScaleUntilSize
ld c, \2
ld de, \3
LD_HL_IND \1
API $05B
ENDM
SetBackgroundPalette: MACRO
MACRO SetBackgroundPalette
ld c, \1
ld de, \2
ld hl, \3
API $07E
ENDM
API_084: MACRO
MACRO API_084
ld l, \4
push hl
ld bc, \3
@ -246,63 +246,63 @@ API_084: MACRO
LD_HL_IND \1
API $084
ENDM
CreateRegion: MACRO
MACRO CreateRegion
ld bc, (\2 << 8 + \3)
ld de, (\4 << 8 + \5)
ld hl, (\6 << 8 + \7)
API $090
LD_IND_A \1
ENDM
SetRegionColor: MACRO
MACRO SetRegionColor
ld e, \2
LD_A_IND \1
API $091
ENDM
CLEAR_REGION: MACRO
MACRO CLEAR_REGION
LD_A_IND \1
API $092
ENDM
SetTextColor: MACRO
MACRO SetTextColor
ld de, (\2 << 8 + \3)
LD_A_IND \1
API $098
ENDM
DrawText: MACRO
MACRO DrawText
CLEAR_REGION \1
ld bc, \2
ld de, (\3 << 8 + \4)
LD_A_IND \1
API $099
ENDM
SetTextSize: MACRO
MACRO SetTextSize
API $09A
ENDM
API_09B: MACRO
MACRO API_09B
ld de, \2
LD_A_IND \1
API $09B
ENDM
GetTextWidth: MACRO
MACRO GetTextWidth
ld de, \2
LD_A_IND \1
API $0C0
ENDM
API_0C7: MACRO
MACRO API_0C7
ld hl, \1
API $0C7
ENDM
EXIT: MACRO
MACRO EXIT
API $100
ENDM
API_106: MACRO
MACRO API_106
ld de, \1
ld hl, \2
API $106
ENDM
SOUND_PAUSE: MACRO
MACRO SOUND_PAUSE
API $116
ENDM
IS_SOUND_PLAYING: MACRO
MACRO IS_SOUND_PLAYING
API $08D
ld b, $00
ld e, $01
@ -311,8 +311,8 @@ IS_SOUND_PLAYING: MACRO
ld a, \1
EXIT
ENDM
API_121: MACRO
MACRO API_121
ld de, $0000
ld hl, $0000
API $121
ENDM
ENDM

View File

@ -4,9 +4,9 @@ all: 00-R000-EN.raw
ribbon-%.tx: ribbon.asm
python3 ../scripts/regionalize.py $< $@ $* $*
ribbon-%.o: ribbon-%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
ribbon-%.gbc: ribbon-%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
ribbon-%.bin: ribbon-%.gbc
python3 ../scripts/stripgbc.py $< $@
ribbon-%.mev: ribbon-%.bin
@ -15,18 +15,18 @@ ribbon-%.mev: ribbon-%.bin
prologue-%.tx: prologue.asm
python3 ../scripts/regionalize.py $< $@ $* $*
prologue-%.o: prologue-%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
prologue-%.gbc: prologue-%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
prologue-%.bin: prologue-%.gbc
python3 ../scripts/stripgbc.py $< $@
00-R000-%.tx: 00-R000.asm ribbon-%.mev prologue-%.bin
python3 ../scripts/ereadertext.py $< $@ $*
00-R000-%.o: 00-R000-%.tx
../bin/rgbds/v0.5.0/rgbasm -o $@ $<
../bin/rgbds/v0.6.0/rgbasm -o $@ $<
00-R000-%.gbc: 00-R000-%.o
../bin/rgbds/v0.5.0/rgblink -o $@ $<
../bin/rgbds/v0.6.0/rgblink -o $@ $<
00-R000-%.z80: 00-R000-%.gbc
python3 ../scripts/stripgbc.py $< $@
00-R000-%.vpk: 00-R000-%.z80