mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-11-12 08:15:00 +13:00
more syncing with pokeyellow
This commit is contained in:
parent
fd2235e678
commit
61ee396786
|
|
@ -73,29 +73,29 @@ PrintBenchGuyText:
|
||||||
; format: db map id, player sprite facing direction, text id of PredefTextIDPointerTable
|
; format: db map id, player sprite facing direction, text id of PredefTextIDPointerTable
|
||||||
BenchGuyTextPointers:
|
BenchGuyTextPointers:
|
||||||
db VIRIDIAN_POKECENTER, SPRITE_FACING_LEFT
|
db VIRIDIAN_POKECENTER, SPRITE_FACING_LEFT
|
||||||
db (ViridianCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1
|
db_tx_pre ViridianCityPokecenterBenchGuyText
|
||||||
db PEWTER_POKECENTER, SPRITE_FACING_LEFT
|
db PEWTER_POKECENTER, SPRITE_FACING_LEFT
|
||||||
db (PewterCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1
|
db_tx_pre PewterCityPokecenterBenchGuyText
|
||||||
db CERULEAN_POKECENTER, SPRITE_FACING_LEFT
|
db CERULEAN_POKECENTER, SPRITE_FACING_LEFT
|
||||||
db (CeruleanCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1
|
db_tx_pre CeruleanCityPokecenterBenchGuyText
|
||||||
db LAVENDER_POKECENTER, SPRITE_FACING_LEFT
|
db LAVENDER_POKECENTER, SPRITE_FACING_LEFT
|
||||||
db (LavenderCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1
|
db_tx_pre LavenderCityPokecenterBenchGuyText
|
||||||
db VERMILION_POKECENTER, SPRITE_FACING_LEFT
|
db VERMILION_POKECENTER, SPRITE_FACING_LEFT
|
||||||
db (VermilionCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1
|
db_tx_pre VermilionCityPokecenterBenchGuyText
|
||||||
db CELADON_POKECENTER, SPRITE_FACING_LEFT
|
db CELADON_POKECENTER, SPRITE_FACING_LEFT
|
||||||
db (CeladonCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1
|
db_tx_pre CeladonCityPokecenterBenchGuyText
|
||||||
db CELADON_HOTEL, SPRITE_FACING_LEFT
|
db CELADON_HOTEL, SPRITE_FACING_LEFT
|
||||||
db (CeladonCityHotelText_id - TextPredefs) / 2 + 1
|
db_tx_pre CeladonCityHotelText
|
||||||
db FUCHSIA_POKECENTER, SPRITE_FACING_LEFT
|
db FUCHSIA_POKECENTER, SPRITE_FACING_LEFT
|
||||||
db (FuchsiaCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1
|
db_tx_pre FuchsiaCityPokecenterBenchGuyText
|
||||||
db CINNABAR_POKECENTER, SPRITE_FACING_LEFT
|
db CINNABAR_POKECENTER, SPRITE_FACING_LEFT
|
||||||
db (CinnabarIslandPokecenterBenchGuyText_id - TextPredefs) / 2 + 1
|
db_tx_pre CinnabarIslandPokecenterBenchGuyText
|
||||||
db SAFFRON_POKECENTER, SPRITE_FACING_LEFT
|
db SAFFRON_POKECENTER, SPRITE_FACING_LEFT
|
||||||
db (SaffronCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1
|
db_tx_pre SaffronCityPokecenterBenchGuyText
|
||||||
db MT_MOON_POKECENTER, SPRITE_FACING_LEFT
|
db MT_MOON_POKECENTER, SPRITE_FACING_LEFT
|
||||||
db (MtMoonPokecenterBenchGuyText_id - TextPredefs) / 2 + 1
|
db_tx_pre MtMoonPokecenterBenchGuyText
|
||||||
db ROCK_TUNNEL_POKECENTER,SPRITE_FACING_LEFT
|
db ROCK_TUNNEL_POKECENTER,SPRITE_FACING_LEFT
|
||||||
db (RockTunnelPokecenterBenchGuyText_id - TextPredefs) / 2 + 1
|
db_tx_pre RockTunnelPokecenterBenchGuyText
|
||||||
db $FF
|
db $FF
|
||||||
|
|
||||||
ViridianCityPokecenterBenchGuyText:
|
ViridianCityPokecenterBenchGuyText:
|
||||||
|
|
|
||||||
|
|
@ -39,39 +39,39 @@ PrintBookshelfText:
|
||||||
; format: db tileset id, bookshelf tile id, text id
|
; format: db tileset id, bookshelf tile id, text id
|
||||||
BookshelfTileIDs:
|
BookshelfTileIDs:
|
||||||
db PLATEAU, $30
|
db PLATEAU, $30
|
||||||
db (IndigoPlateauStatues_id - TextPredefs) / 2 + 1
|
db_tx_pre IndigoPlateauStatues
|
||||||
db HOUSE, $3D
|
db HOUSE, $3D
|
||||||
db (TownMapText_id - TextPredefs) / 2 + 1
|
db_tx_pre TownMapText
|
||||||
db HOUSE, $1E
|
db HOUSE, $1E
|
||||||
db (BookOrSculptureText_id - TextPredefs) / 2 + 1
|
db_tx_pre BookOrSculptureText
|
||||||
db MANSION, $32
|
db MANSION, $32
|
||||||
db (BookOrSculptureText_id - TextPredefs) / 2 + 1
|
db_tx_pre BookOrSculptureText
|
||||||
db REDS_HOUSE_1, $32
|
db REDS_HOUSE_1, $32
|
||||||
db (BookOrSculptureText_id - TextPredefs) / 2 + 1
|
db_tx_pre BookOrSculptureText
|
||||||
db LAB, $28
|
db LAB, $28
|
||||||
db (BookOrSculptureText_id - TextPredefs) / 2 + 1
|
db_tx_pre BookOrSculptureText
|
||||||
db LOBBY, $16
|
db LOBBY, $16
|
||||||
db (ElevatorText_id - TextPredefs) / 2 + 1
|
db_tx_pre ElevatorText
|
||||||
db GYM, $1D
|
db GYM, $1D
|
||||||
db (BookOrSculptureText_id - TextPredefs) / 2 + 1
|
db_tx_pre BookOrSculptureText
|
||||||
db DOJO, $1D
|
db DOJO, $1D
|
||||||
db (BookOrSculptureText_id - TextPredefs) / 2 + 1
|
db_tx_pre BookOrSculptureText
|
||||||
db GATE, $22
|
db GATE, $22
|
||||||
db (BookOrSculptureText_id - TextPredefs) / 2 + 1
|
db_tx_pre BookOrSculptureText
|
||||||
db MART, $54
|
db MART, $54
|
||||||
db (PokemonStuffText_id - TextPredefs) / 2 + 1
|
db_tx_pre PokemonStuffText
|
||||||
db MART, $55
|
db MART, $55
|
||||||
db (PokemonStuffText_id - TextPredefs) / 2 + 1
|
db_tx_pre PokemonStuffText
|
||||||
db POKECENTER, $54
|
db POKECENTER, $54
|
||||||
db (PokemonStuffText_id - TextPredefs) / 2 + 1
|
db_tx_pre PokemonStuffText
|
||||||
db POKECENTER, $55
|
db POKECENTER, $55
|
||||||
db (PokemonStuffText_id - TextPredefs) / 2 + 1
|
db_tx_pre PokemonStuffText
|
||||||
db LOBBY, $50
|
db LOBBY, $50
|
||||||
db (PokemonStuffText_id - TextPredefs) / 2 + 1
|
db_tx_pre PokemonStuffText
|
||||||
db LOBBY, $52
|
db LOBBY, $52
|
||||||
db (PokemonStuffText_id - TextPredefs) / 2 + 1
|
db_tx_pre PokemonStuffText
|
||||||
db SHIP, $36
|
db SHIP, $36
|
||||||
db (BookOrSculptureText_id - TextPredefs) / 2 + 1
|
db_tx_pre BookOrSculptureText
|
||||||
db $FF
|
db $FF
|
||||||
|
|
||||||
IndigoPlateauStatues:
|
IndigoPlateauStatues:
|
||||||
|
|
|
||||||
161
home/text.asm
161
home/text.asm
|
|
@ -52,28 +52,28 @@ PlaceNextChar::
|
||||||
ld a,[de]
|
ld a,[de]
|
||||||
|
|
||||||
cp "@"
|
cp "@"
|
||||||
jr nz,.PlaceText
|
jr nz, Char4ETest
|
||||||
ld b,h
|
ld b,h
|
||||||
ld c,l
|
ld c,l
|
||||||
pop hl
|
pop hl
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.PlaceText
|
Char4ETest::
|
||||||
cp $4E
|
cp $4E ; next
|
||||||
jr nz,.next
|
jr nz, .char4FTest
|
||||||
ld bc,SCREEN_WIDTH * 2
|
ld bc, 2 * SCREEN_WIDTH
|
||||||
ld a,[hFlags_0xFFF6]
|
ld a,[hFlags_0xFFF6]
|
||||||
bit 2,a
|
bit 2,a
|
||||||
jr z,.next2
|
jr z,.ok
|
||||||
ld bc,SCREEN_WIDTH
|
ld bc,SCREEN_WIDTH
|
||||||
.next2
|
.ok
|
||||||
pop hl
|
pop hl
|
||||||
add hl,bc
|
add hl,bc
|
||||||
push hl
|
push hl
|
||||||
jp PlaceNextChar_inc
|
jp PlaceNextChar_inc
|
||||||
|
|
||||||
.next
|
.char4FTest
|
||||||
cp $4F
|
cp $4F ; line
|
||||||
jr nz,.next3
|
jr nz,.next3
|
||||||
pop hl
|
pop hl
|
||||||
coord hl, 1, 16
|
coord hl, 1, 16
|
||||||
|
|
@ -81,46 +81,36 @@ PlaceNextChar::
|
||||||
jp PlaceNextChar_inc
|
jp PlaceNextChar_inc
|
||||||
|
|
||||||
.next3 ; Check against a dictionary
|
.next3 ; Check against a dictionary
|
||||||
|
dict: macro
|
||||||
|
if \1 == 0
|
||||||
and a
|
and a
|
||||||
jp z,Char00
|
else
|
||||||
cp $4C
|
cp \1
|
||||||
jp z,Char4C
|
endc
|
||||||
cp $4B
|
jp z, \2
|
||||||
jp z,Char4B
|
endm
|
||||||
cp $51
|
|
||||||
jp z,Char51
|
dict $00, Char00 ; error
|
||||||
cp $49
|
dict $4C, Char4C ; autocont
|
||||||
jp z,Char49
|
dict $4B, Char4B ; cont_
|
||||||
cp $52
|
dict $51, Char51 ; para
|
||||||
jp z,Char52
|
dict $49, Char49 ; page
|
||||||
cp $53
|
dict $52, Char52 ; player
|
||||||
jp z,Char53
|
dict $53, Char53 ; rival
|
||||||
cp $54
|
dict $54, Char54 ; POKé
|
||||||
jp z,Char54
|
dict $5B, Char5B ; PC
|
||||||
cp $5B
|
dict $5E, Char5E ; ROCKET
|
||||||
jp z,Char5B
|
dict $5C, Char5C ; TM
|
||||||
cp $5E
|
dict $5D, Char5D ; TRAINER
|
||||||
jp z,Char5E
|
dict $55, Char55 ; cont
|
||||||
cp $5C
|
dict $56, Char56 ; 6 dots
|
||||||
jp z,Char5C
|
dict $57, Char57 ; done
|
||||||
cp $5D
|
dict $58, Char58 ; prompt
|
||||||
jp z,Char5D
|
dict $4A, Char4A ; PKMN
|
||||||
cp $55
|
dict $5F, Char5F ; dex
|
||||||
jp z,Char55
|
dict $59, Char59 ; TARGET
|
||||||
cp $56
|
dict $5A, Char5A ; USER
|
||||||
jp z,Char56
|
|
||||||
cp $57
|
|
||||||
jp z,Char57
|
|
||||||
cp $58
|
|
||||||
jp z,Char58
|
|
||||||
cp $4A
|
|
||||||
jp z,Char4A
|
|
||||||
cp $5F
|
|
||||||
jp z,Char5F
|
|
||||||
cp $59
|
|
||||||
jp z,Char59
|
|
||||||
cp $5A
|
|
||||||
jp z,Char5A
|
|
||||||
ld [hli],a
|
ld [hli],a
|
||||||
call PrintLetterDelay
|
call PrintLetterDelay
|
||||||
PlaceNextChar_inc::
|
PlaceNextChar_inc::
|
||||||
|
|
@ -211,7 +201,6 @@ MonsterNameCharsCommon::
|
||||||
; print “Enemy ”
|
; print “Enemy ”
|
||||||
ld de,Char5AText
|
ld de,Char5AText
|
||||||
call PlaceString
|
call PlaceString
|
||||||
|
|
||||||
ld h,b
|
ld h,b
|
||||||
ld l,c
|
ld l,c
|
||||||
ld de,wEnemyMonNick ; enemy active monster name
|
ld de,wEnemyMonNick ; enemy active monster name
|
||||||
|
|
@ -264,36 +253,36 @@ Char5F::
|
||||||
pop hl
|
pop hl
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Char58::
|
Char58:: ; prompt
|
||||||
ld a,[wLinkState]
|
ld a,[wLinkState]
|
||||||
cp LINK_STATE_BATTLING
|
cp LINK_STATE_BATTLING
|
||||||
jp z,Next1AA2
|
jp z, .ok
|
||||||
ld a,$EE
|
ld a, $EE
|
||||||
Coorda 18, 16
|
Coorda 18, 16
|
||||||
Next1AA2::
|
.ok
|
||||||
call ProtectedDelay3
|
call ProtectedDelay3
|
||||||
call ManualTextScroll
|
call ManualTextScroll
|
||||||
ld a, " "
|
ld a, " "
|
||||||
Coorda 18, 16
|
Coorda 18, 16
|
||||||
Char57::
|
Char57:: ; done
|
||||||
pop hl
|
pop hl
|
||||||
ld de,Char58Text
|
ld de, Char58Text
|
||||||
dec de
|
dec de
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Char58Text::
|
Char58Text::
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
Char51::
|
Char51:: ; para
|
||||||
push de
|
push de
|
||||||
ld a,$EE
|
ld a, $EE
|
||||||
Coorda 18, 16
|
Coorda 18, 16
|
||||||
call ProtectedDelay3
|
call ProtectedDelay3
|
||||||
call ManualTextScroll
|
call ManualTextScroll
|
||||||
coord hl, 1, 13
|
coord hl, 1, 13
|
||||||
lb bc, 4, 18
|
lb bc, 4, 18
|
||||||
call ClearScreenArea
|
call ClearScreenArea
|
||||||
ld c,20
|
ld c, 20
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
pop de
|
pop de
|
||||||
coord hl, 1, 14
|
coord hl, 1, 14
|
||||||
|
|
@ -328,13 +317,13 @@ Char4B::
|
||||||
;fall through
|
;fall through
|
||||||
Char4C::
|
Char4C::
|
||||||
push de
|
push de
|
||||||
call Next1B18
|
call ScrollTextUpOneLine
|
||||||
call Next1B18
|
call ScrollTextUpOneLine
|
||||||
coord hl, 1, 16
|
coord hl, 1, 16
|
||||||
pop de
|
pop de
|
||||||
jp PlaceNextChar_inc
|
jp PlaceNextChar_inc
|
||||||
|
|
||||||
Next1B18::
|
ScrollTextUpOneLine::
|
||||||
coord hl, 0, 14
|
coord hl, 0, 14
|
||||||
coord de, 0, 13
|
coord de, 0, 13
|
||||||
ld b,60
|
ld b,60
|
||||||
|
|
@ -372,7 +361,7 @@ TextCommandProcessor::
|
||||||
push af
|
push af
|
||||||
set 1,a
|
set 1,a
|
||||||
ld e,a
|
ld e,a
|
||||||
ld a,[$fff4]
|
ld a, [$fff4]
|
||||||
xor e
|
xor e
|
||||||
ld [wLetterPrintingDelayFlags],a
|
ld [wLetterPrintingDelayFlags],a
|
||||||
ld a,c
|
ld a,c
|
||||||
|
|
@ -389,22 +378,22 @@ NextTextCommand::
|
||||||
ret
|
ret
|
||||||
.doTextCommand
|
.doTextCommand
|
||||||
push hl
|
push hl
|
||||||
cp a,$17
|
cp a, $17
|
||||||
jp z,TextCommand17
|
jp z, TextCommand17
|
||||||
cp a,$0e
|
cp a, $0e
|
||||||
jp nc,TextCommand0B ; if a != 0x17 and a >= 0xE, go to command 0xB
|
jp nc,TextCommand0B ; if a != 0x17 and a >= 0xE, go to command 0xB
|
||||||
; if a < 0xE, use a jump table
|
; if a < 0xE, use a jump table
|
||||||
ld hl,TextCommandJumpTable
|
ld hl,TextCommandJumpTable
|
||||||
push bc
|
push bc
|
||||||
add a
|
add a
|
||||||
ld b,$00
|
ld b, 0
|
||||||
ld c,a
|
ld c, a
|
||||||
add hl,bc
|
add hl, bc
|
||||||
pop bc
|
pop bc
|
||||||
ld a,[hli]
|
ld a, [hli]
|
||||||
ld h,[hl]
|
ld h, [hl]
|
||||||
ld l,a
|
ld l, a
|
||||||
jp [hl]
|
jp hl
|
||||||
|
|
||||||
; draw box
|
; draw box
|
||||||
; 04AAAABBCC
|
; 04AAAABBCC
|
||||||
|
|
@ -523,10 +512,10 @@ TextCommand06::
|
||||||
; 07
|
; 07
|
||||||
; (no arguments)
|
; (no arguments)
|
||||||
TextCommand07::
|
TextCommand07::
|
||||||
ld a," "
|
ld a, " "
|
||||||
Coorda 18, 16 ; place blank space in lower right corner of dialogue text box
|
Coorda 18, 16 ; place blank space in lower right corner of dialogue text box
|
||||||
call Next1B18 ; scroll up text
|
call ScrollTextUpOneLine
|
||||||
call Next1B18
|
call ScrollTextUpOneLine
|
||||||
pop hl
|
pop hl
|
||||||
coord bc, 1, 16 ; address of second line of dialogue text box
|
coord bc, 1, 16 ; address of second line of dialogue text box
|
||||||
jp NextTextCommand
|
jp NextTextCommand
|
||||||
|
|
@ -537,7 +526,7 @@ TextCommand08::
|
||||||
pop hl
|
pop hl
|
||||||
ld de,NextTextCommand
|
ld de,NextTextCommand
|
||||||
push de ; return address
|
push de ; return address
|
||||||
jp [hl]
|
jp hl
|
||||||
|
|
||||||
; print decimal number (converted from binary number)
|
; print decimal number (converted from binary number)
|
||||||
; 09AAAABB
|
; 09AAAABB
|
||||||
|
|
@ -626,16 +615,16 @@ TextCommand0B::
|
||||||
|
|
||||||
; format: text command ID, sound ID or cry ID
|
; format: text command ID, sound ID or cry ID
|
||||||
TextCommandSounds::
|
TextCommandSounds::
|
||||||
db $0B,SFX_GET_ITEM_1
|
db $0B, SFX_GET_ITEM_1
|
||||||
db $12,SFX_CAUGHT_MON
|
db $12, SFX_CAUGHT_MON
|
||||||
db $0E,SFX_POKEDEX_RATING
|
db $0E, SFX_POKEDEX_RATING
|
||||||
db $0F,SFX_GET_ITEM_1
|
db $0F, SFX_GET_ITEM_1
|
||||||
db $10,SFX_GET_ITEM_2
|
db $10, SFX_GET_ITEM_2
|
||||||
db $11,SFX_GET_KEY_ITEM
|
db $11, SFX_GET_KEY_ITEM
|
||||||
db $13,SFX_DEX_PAGE_ADDED
|
db $13, SFX_DEX_PAGE_ADDED
|
||||||
db $14,NIDORINA ; used in OakSpeech
|
db $14, NIDORINA ; used in OakSpeech
|
||||||
db $15,PIDGEOT ; used in SaffronCityText12
|
db $15, PIDGEOT ; used in SaffronCityText12
|
||||||
db $16,DEWGONG ; unused?
|
db $16, DEWGONG ; unused?
|
||||||
|
|
||||||
; draw ellipses
|
; draw ellipses
|
||||||
; 0CAA
|
; 0CAA
|
||||||
|
|
|
||||||
148
macros.asm
148
macros.asm
|
|
@ -81,29 +81,62 @@ bcd3: MACRO
|
||||||
coins equs "bcd2"
|
coins equs "bcd2"
|
||||||
money equs "bcd3"
|
money equs "bcd3"
|
||||||
|
|
||||||
|
validateCoords: MACRO
|
||||||
|
if \1 >= SCREEN_WIDTH
|
||||||
|
fail "x coord out of range"
|
||||||
|
endc
|
||||||
|
if \2 >= SCREEN_HEIGHT
|
||||||
|
fail "y coord out of range"
|
||||||
|
endc
|
||||||
|
endm
|
||||||
|
|
||||||
;\1 = r
|
;\1 = r
|
||||||
;\2 = X
|
;\2 = X
|
||||||
;\3 = Y
|
;\3 = Y
|
||||||
|
;\4 = which tilemap (optional)
|
||||||
coord: MACRO
|
coord: MACRO
|
||||||
ld \1, wTileMap + 20 * \3 + \2
|
validateCoords \2, \3
|
||||||
|
if _NARG >= 4
|
||||||
|
ld \1, \4 + SCREEN_WIDTH * \3 + \2
|
||||||
|
else
|
||||||
|
ld \1, wTileMap + SCREEN_WIDTH * \3 + \2
|
||||||
|
endc
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
;\1 = X
|
;\1 = X
|
||||||
;\2 = Y
|
;\2 = Y
|
||||||
|
;\3 = which tilemap (optional)
|
||||||
aCoord: MACRO
|
aCoord: MACRO
|
||||||
ld a, [wTileMap + 20 * \2 + \1]
|
validateCoords \1, \2
|
||||||
|
if _NARG >= 3
|
||||||
|
ld a, [\3 + SCREEN_WIDTH * \2 + \1]
|
||||||
|
else
|
||||||
|
ld a, [wTileMap + SCREEN_WIDTH * \2 + \1]
|
||||||
|
endc
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
;\1 = X
|
;\1 = X
|
||||||
;\2 = Y
|
;\2 = Y
|
||||||
|
;\3 = which tilemap (optional)
|
||||||
Coorda: MACRO
|
Coorda: MACRO
|
||||||
ld [wTileMap + 20 * \2 + \1], a
|
validateCoords \1, \2
|
||||||
|
if _NARG >= 3
|
||||||
|
ld [\3 + SCREEN_WIDTH * \2 + \1], a
|
||||||
|
else
|
||||||
|
ld [wTileMap + SCREEN_WIDTH * \2 + \1], a
|
||||||
|
endc
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
;\1 = X
|
;\1 = X
|
||||||
;\2 = Y
|
;\2 = Y
|
||||||
|
;\3 = which tilemap (optional)
|
||||||
dwCoord: MACRO
|
dwCoord: MACRO
|
||||||
dw wTileMap + 20 * \2 + \1
|
validateCoords \1, \2
|
||||||
|
if _NARG >= 3
|
||||||
|
dw \3 + SCREEN_WIDTH * \2 + \1
|
||||||
|
else
|
||||||
|
dw wTileMap + SCREEN_WIDTH * \2 + \1
|
||||||
|
endc
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
;\1 = r
|
;\1 = r
|
||||||
|
|
@ -134,7 +167,7 @@ EMAP: MACRO ; emap x-coordinate,y-coordinate,textpointer
|
||||||
; nybble: y-coordinate
|
; nybble: y-coordinate
|
||||||
; nybble: x-coordinate
|
; nybble: x-coordinate
|
||||||
; word : pointer to map name
|
; word : pointer to map name
|
||||||
db (\1 + (\2 << 4))
|
dn \2, \1
|
||||||
dw \3
|
dw \3
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
@ -146,7 +179,7 @@ IMAP: MACRO ; imap mapid_less_than,x-coordinate,y-coordinate,textpointer
|
||||||
; nybble: x-coordinate
|
; nybble: x-coordinate
|
||||||
; word : pointer to map name
|
; word : pointer to map name
|
||||||
db \1 + 1
|
db \1 + 1
|
||||||
db \2 + \3 << 4
|
dn \3, \2
|
||||||
dw \4
|
dw \4
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
@ -174,28 +207,30 @@ dbw: MACRO
|
||||||
dw \2
|
dw \2
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
dba: MACRO
|
||||||
|
dbw BANK(\1), \1
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
dwb: MACRO
|
||||||
|
dw \1
|
||||||
|
db \2
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
dab: MACRO
|
||||||
|
dwb \1, BANK(\1)
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
dbbw: MACRO
|
||||||
|
db \1, \2
|
||||||
|
dw \3
|
||||||
|
ENDM
|
||||||
|
|
||||||
; data format macros
|
; data format macros
|
||||||
RGB: MACRO
|
RGB: MACRO
|
||||||
dw (\3 << 10 | \2 << 5 | \1)
|
dw (\3 << 10 | \2 << 5 | \1)
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
; text macros
|
; text macros
|
||||||
TX_NUM: MACRO
|
|
||||||
; print a big-endian decimal number.
|
|
||||||
; \1: address to read from
|
|
||||||
; \2: number of bytes to read
|
|
||||||
; \3: number of digits to display
|
|
||||||
db $09
|
|
||||||
dw \1
|
|
||||||
db \2 << 4 | \3
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
TX_FAR: MACRO
|
|
||||||
db $17
|
|
||||||
dw \1
|
|
||||||
db BANK(\1)
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
; text engine command $1
|
; text engine command $1
|
||||||
TX_RAM: MACRO
|
TX_RAM: MACRO
|
||||||
; prints text to screen
|
; prints text to screen
|
||||||
|
|
@ -212,6 +247,46 @@ TX_BCD: MACRO
|
||||||
db \2
|
db \2
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
TX_CURSOR: MACRO
|
||||||
|
; Move cursor to (\1, \2)
|
||||||
|
; \1: X coord (0 - 19)
|
||||||
|
; \2: Y coord (0 - 17)
|
||||||
|
db $3
|
||||||
|
dwCoord \1, \2
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
TX_LINE EQUS "db $05"
|
||||||
|
TX_BUTTON_SOUND EQUS "db $06"
|
||||||
|
TX_ASM EQUS "db $08"
|
||||||
|
|
||||||
|
TX_NUM: MACRO
|
||||||
|
; print a big-endian decimal number.
|
||||||
|
; \1: address to read from
|
||||||
|
; \2: number of bytes to read
|
||||||
|
; \3: number of digits to display
|
||||||
|
db $09
|
||||||
|
dw \1
|
||||||
|
db \2 << 4 | \3
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
TX_SFX_ITEM EQUS "db $0b"
|
||||||
|
TX_WAIT_BUTTON EQUS "db $0d"
|
||||||
|
TX_SFX_CONGRATS EQUS "db $10"
|
||||||
|
TX_SFX_KEY_ITEM EQUS "db $11"
|
||||||
|
|
||||||
|
TX_FAR: MACRO
|
||||||
|
; 17AAAABB (call text at BB:AAAA)
|
||||||
|
db $17
|
||||||
|
dab \1
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
TX_VENDING_MACHINE EQUS "db $f5"
|
||||||
|
TX_CABLE_CLUB_RECEPTIONIST EQUS "db $f6"
|
||||||
|
TX_PRIZE_VENDOR EQUS "db $f7"
|
||||||
|
TX_POKECENTER_PC EQUS "db $f9"
|
||||||
|
TX_PLAYERS_PC EQUS "db $fc"
|
||||||
|
TX_BILLS_PC EQUS "db $fd"
|
||||||
|
|
||||||
TX_MART: MACRO
|
TX_MART: MACRO
|
||||||
db $FE, _NARG
|
db $FE, _NARG
|
||||||
rept _NARG
|
rept _NARG
|
||||||
|
|
@ -221,23 +296,13 @@ TX_MART: MACRO
|
||||||
db $FF
|
db $FF
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
TX_LINE EQUS "db $05"
|
|
||||||
TX_BUTTON_SOUND EQUS "db $06"
|
|
||||||
TX_ASM EQUS "db $08"
|
|
||||||
TX_SFX_ITEM EQUS "db $0b"
|
|
||||||
TX_WAIT_BUTTON EQUS "db $0d"
|
|
||||||
TX_SFX_CONGRATS EQUS "db $10"
|
|
||||||
TX_SFX_KEY_ITEM EQUS "db $11"
|
|
||||||
|
|
||||||
TX_VENDING_MACHINE EQUS "db $f5"
|
|
||||||
TX_CABLE_CLUB_RECEPTIONIST EQUS "db $f6"
|
|
||||||
TX_PRIZE_VENDOR EQUS "db $f7"
|
|
||||||
TX_POKECENTER_PC EQUS "db $f9"
|
|
||||||
TX_PLAYERS_PC EQUS "db $fc"
|
|
||||||
TX_BILLS_PC EQUS "db $fd"
|
|
||||||
TX_POKECENTER_NURSE EQUS "db $ff"
|
TX_POKECENTER_NURSE EQUS "db $ff"
|
||||||
|
|
||||||
; Predef macro.
|
; Predef macro.
|
||||||
|
predef_const: MACRO
|
||||||
|
const \1PredefID
|
||||||
|
ENDM
|
||||||
|
|
||||||
add_predef: MACRO
|
add_predef: MACRO
|
||||||
\1Predef::
|
\1Predef::
|
||||||
db BANK(\1)
|
db BANK(\1)
|
||||||
|
|
@ -258,11 +323,18 @@ predef_jump: MACRO
|
||||||
jp Predef
|
jp Predef
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
tx_pre_const: MACRO
|
||||||
|
const \1_id
|
||||||
|
ENDM
|
||||||
|
|
||||||
add_tx_pre: MACRO
|
add_tx_pre: MACRO
|
||||||
\1_id:: dw \1
|
\1_id:: dw \1
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
db_tx_pre: MACRO
|
||||||
|
db (\1_id - TextPredefs) / 2 + 1
|
||||||
|
ENDM
|
||||||
|
|
||||||
tx_pre_id: MACRO
|
tx_pre_id: MACRO
|
||||||
ld a, (\1_id - TextPredefs) / 2 + 1
|
ld a, (\1_id - TextPredefs) / 2 + 1
|
||||||
ENDM
|
ENDM
|
||||||
|
|
@ -674,9 +746,9 @@ ENDM
|
||||||
tmlearn: MACRO
|
tmlearn: MACRO
|
||||||
x = 0
|
x = 0
|
||||||
rept _NARG
|
rept _NARG
|
||||||
if \1 != 0
|
IF \1 != 0
|
||||||
x = x | (1 << ((\1 - 1) % 8))
|
x = x | (1 << ((\1 - 1) % 8))
|
||||||
endc
|
ENDC
|
||||||
shift
|
shift
|
||||||
endr
|
endr
|
||||||
db x
|
db x
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue