This commit is contained in:
dannye
2024-02-04 06:54:37 -06:00
40 changed files with 10829 additions and 565 deletions
+2
View File
@@ -6,6 +6,7 @@ INCLUDE "constants/credits_constants.asm"
INCLUDE "constants/deck_ai_constants.asm"
INCLUDE "constants/deck_constants.asm"
INCLUDE "constants/duel_constants.asm"
INCLUDE "constants/duel_interface_constants.asm"
INCLUDE "constants/gfx_constants.asm"
INCLUDE "constants/hardware_constants.asm"
INCLUDE "constants/intro_constants.asm"
@@ -18,6 +19,7 @@ INCLUDE "constants/ow_anim_constants.asm"
INCLUDE "constants/ow_object_constants.asm"
INCLUDE "constants/palette_constants.asm"
INCLUDE "constants/portrait_constants.asm"
INCLUDE "constants/printer_constants.asm"
INCLUDE "constants/scene_constants.asm"
INCLUDE "constants/script_constants.asm"
INCLUDE "constants/sfx_constants.asm"
+17 -28
View File
@@ -10,7 +10,7 @@ DEF CARD_COUNT_MASK EQU $7f
; sDeck* and generic deck constants
DEF NUM_DECKS EQU 4
DEF DECK_NAME_SIZE EQU 24
DEF DECK_NAME_SIZE_WO_SUFFIX EQU 21 ; name part before "deck"
DEF DECK_NAME_SIZE_WO_SUFFIX EQU 20 ; name part before "deck"
DEF DECK_SIZE EQU 60
DEF DECK_SIZE_BYTES EQU DECK_SIZE * 2
DEF DECK_STRUCT_SIZE EQU DECK_NAME_SIZE + DECK_SIZE_BYTES
@@ -75,9 +75,9 @@ DEF CARD_DATA_POKEDEX_NUMBER EQU $37
DEF CARD_DATA_UNKNOWN1 EQU $38
DEF CARD_DATA_LEVEL EQU $39
DEF CARD_DATA_LENGTH EQU $3a
DEF CARD_DATA_WEIGHT EQU $3c
DEF CARD_DATA_PKMN_DESCRIPTION EQU $3e
DEF CARD_DATA_UNKNOWN2 EQU $40
DEF CARD_DATA_WEIGHT EQU $3b
DEF CARD_DATA_PKMN_DESCRIPTION EQU $3d
DEF CARD_DATA_UNKNOWN2 EQU $3f
DEF PKMN_CARD_DATA_LENGTH EQU $42
@@ -91,7 +91,7 @@ DEF PKMN_CARD_DATA_LENGTH EQU $42
const PSYCHIC ; $05
DEF NUM_COLORED_TYPES EQU const_value
const COLORLESS ; $06
const UNUSED_TYPE ; $07
const RAINBOW ; $07
DEF NUM_TYPES EQU const_value
; generic type (color) flag constants
@@ -111,8 +111,8 @@ DEF TYPE_PKMN_WATER EQU WATER
DEF TYPE_PKMN_FIGHTING EQU FIGHTING
DEF TYPE_PKMN_PSYCHIC EQU PSYCHIC
DEF TYPE_PKMN_COLORLESS EQU COLORLESS
DEF TYPE_PKMN_UNUSED EQU UNUSED_TYPE
const_def TYPE_PKMN_UNUSED + 1 - TYPE_PKMN_FIRE
DEF TYPE_PKMN_RAINBOW EQU RAINBOW
const_def TYPE_PKMN_RAINBOW + 1 - TYPE_PKMN_FIRE
DEF TYPE_ENERGY EQU const_value
const TYPE_ENERGY_FIRE ; $08
const TYPE_ENERGY_GRASS ; $09
@@ -134,31 +134,20 @@ DEF TYPE_TRAINER_F EQU 4
DEF CIRCLE EQU $0
DEF DIAMOND EQU $1
DEF STAR EQU $2
DEF RARITY_3 EQU $3
DEF PROMOSTAR EQU $ff
; card set constants (set 1)
const_def
const CARD_SET_COLOSSEUM ; $0
const CARD_SET_EVOLUTION ; $1
const CARD_SET_MYSTERY ; $2
const CARD_SET_LABORATORY ; $3
const CARD_SET_PROMOTIONAL ; $4
const CARD_SET_ENERGY ; $5
DEF NUM_CARD_SETS EQU const_value - 1
; CARD_DATA_SET constants (set 1)
DEF COLOSSEUM EQU CARD_SET_COLOSSEUM << 4
DEF EVOLUTION EQU CARD_SET_EVOLUTION << 4
DEF MYSTERY EQU CARD_SET_MYSTERY << 4
DEF LABORATORY EQU CARD_SET_LABORATORY << 4
DEF PROMOTIONAL EQU CARD_SET_PROMOTIONAL << 4
DEF ENERGY EQU CARD_SET_ENERGY << 4
; CARD_DATA_SET constants (set 2)
DEF JUNGLE EQU $1
DEF FOSSIL EQU $2
DEF GB EQU $7
DEF PRO EQU $8
const BEGINNING_POKEMON ; $0
const LEGENDARY_POWER ; $1
const ISLAND_OF_FOSSIL ; $2
const PSYCHIC_BATTLE ; $3
const SKY_FLYING_POKEMON ; $4
const WE_ARE_TEAM_ROCKET ; $5
const TEAM_ROCKETS_AMBITION ; $6
const PROMOTIONAL ; $7
DEF NUM_CARD_SETS EQU const_value
; CARD_DATA_STAGE constants
DEF BASIC EQU $00
+27 -6
View File
@@ -63,6 +63,13 @@ DEF DUELVARS_BENCH2_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench2CardAttache
DEF DUELVARS_BENCH3_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench3CardAttachedPluspower)" ; e3
DEF DUELVARS_BENCH4_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench4CardAttachedPluspower)" ; e4
DEF DUELVARS_BENCH5_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench5CardAttachedPluspower)" ; e5
DEF DUELVARS_ARENA_CARD_FOOD_COUNTERS EQU $e6 ; EQUS "LOW(wPlayerArenaCardFoodCounters)" ; e6
DEF DUELVARS_BENCH1_CARD_FOOD_COUNTERS EQU $e7 ; EQUS "LOW(wPlayerBench1FoodCounters)" ; e7
DEF DUELVARS_BENCH2_CARD_FOOD_COUNTERS EQU $e8 ; EQUS "LOW(wPlayerBench2FoodCounters)" ; e8
DEF DUELVARS_BENCH3_CARD_FOOD_COUNTERS EQU $e9 ; EQUS "LOW(wPlayerBench3FoodCounters)" ; e9
DEF DUELVARS_BENCH4_CARD_FOOD_COUNTERS EQU $ea ; EQUS "LOW(wPlayerBench4FoodCounters)" ; ea
DEF DUELVARS_BENCH5_CARD_FOOD_COUNTERS EQU $eb ; EQUS "LOW(wPlayerBench5FoodCounters)" ; eb
DEF DUELVARS_ARENA_CARD_STATUS EQU $ec ; EQUS "LOW(wPlayerArenaCardStatus)" ; f0
DEF DUELVARS_ARENA_CARD_SUBSTATUS1 EQU $ed ; EQUS "LOW(wPlayerArenaCardSubstatus1)" ; e7
DEF DUELVARS_ARENA_CARD_SUBSTATUS2 EQU $ee ; EQUS "LOW(wPlayerArenaCardSubstatus2)" ; e8
DEF DUELVARS_ARENA_CARD_CHANGED_WEAKNESS EQU $ef ; EQUS "LOW(wPlayerArenaCardChangedWeakness)" ; e9
@@ -72,7 +79,6 @@ DEF DUELVARS_PRIZES EQU $f2 ; EQUS "LOW(wPlayerPrizes)
DEF DUELVARS_NUMBER_OF_CARDS_IN_DISCARD_PILE EQU $f3 ; EQUS "LOW(wPlayerNumberOfCardsInDiscardPile)" ; ed
DEF DUELVARS_NUMBER_OF_CARDS_IN_HAND EQU $f4 ; EQUS "LOW(wPlayerNumberOfCardsInHand)" ; ee
DEF DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA EQU $f5 ; EQUS "LOW(wPlayerNumberOfPokemonInPlayArea)" ; ef
DEF DUELVARS_ARENA_CARD_STATUS EQU $ec ; EQUS "LOW(wPlayerArenaCardStatus)" ; f0
DEF DUELVARS_DUELIST_TYPE EQU $f6 ; EQUS "LOW(wPlayerDuelistType)" ; f1
DEF DUELVARS_ARENA_CARD_DISABLED_ATTACK_INDEX EQU $f7 ; EQUS "LOW(wPlayerArenaCardDisabledAttackIndex)" ; f2
DEF DUELVARS_ARENA_CARD_LAST_TURN_DAMAGE EQUS "LOW(wPlayerArenaCardLastTurnDamage)" ; f3
@@ -266,8 +272,23 @@ DEF PRIZES_5 EQU $05
DEF PRIZES_6 EQU $06
; constants to use as input to LookForCardInDeck
DEF SEARCHEFFECT_CARD_ID EQU $0
DEF SEARCHEFFECT_NIDORAN EQU $1
DEF SEARCHEFFECT_BASIC_FIGHTING EQU $2
DEF SEARCHEFFECT_BASIC_ENERGY EQU $3
DEF SEARCHEFFECT_POKEMON EQU $4
const_def
const SEARCHEFFECT_CARD_ID ; $0
const SEARCHEFFECT_NIDORAN ; $1
const SEARCHEFFECT_BASIC_FIGHTING ; $2
const SEARCHEFFECT_BASIC_ENERGY ; $3
const SEARCHEFFECT_POKEMON ; $4
; special rule constants, stored in wSpecialRule
const_def
const NO_RULES ; $0
const CHLOROPHYLL ; $1
const THUNDER_CHARGE ; $2
const FLAME_ARMOR ; $3
const SMALL_BENCH ; $4
const RUNNING_WATER ; $5
const EARTH_POWER ; $6
const LOW_RESISTANCE ; $7
const ENERGY_RETURN ; $8
const TOUGH_ESCAPE ; $9
const BLACK_HOLE ; $a
@@ -0,0 +1,20 @@
; wCardPageNumber constants
DEF CARDPAGE_POKEMON_OVERVIEW EQU $01
DEF CARDPAGE_POKEMON_ATTACK1_1 EQU $02
DEF CARDPAGE_POKEMON_ATTACK1_2 EQU $03
DEF CARDPAGE_POKEMON_ATTACK2_1 EQU $04
DEF CARDPAGE_POKEMON_ATTACK2_2 EQU $05
DEF CARDPAGE_POKEMON_DESCRIPTION EQU $06
DEF CARDPAGE_ENERGY_1 EQU $09
DEF CARDPAGE_ENERGY_2 EQU $0a
DEF CARDPAGE_TRAINER_1 EQU $0d
DEF CARDPAGE_TRAINER_2 EQU $0e
; wCardPageType constants
DEF CARDPAGETYPE_NOT_PLAY_AREA EQU $00
DEF CARDPAGETYPE_PLAY_AREA EQU $01
; card type header constants ($10-tile headers in DuelCardHeaderGraphics)
DEF HEADER_TRAINER EQU $00
DEF HEADER_ENERGY EQU $01
DEF HEADER_POKEMON EQU $02
+15
View File
@@ -21,3 +21,18 @@ DEF tiles EQUS "* TILE_SIZE"
DEF TILE_SIZE_1BPP EQU 8 ; bytes
DEF tiles_1bpp EQUS "* TILE_SIZE_1BPP"
; icon tile offsets
DEF ICON_TILE_BASIC_POKEMON EQU $d0
DEF ICON_TILE_STAGE_1_POKEMON EQU $d4
DEF ICON_TILE_STAGE_2_POKEMON EQU $d8
DEF ICON_TILE_TRAINER EQU $dc
DEF ICON_TILE_FIRE EQU $e0
DEF ICON_TILE_GRASS EQU $e4
DEF ICON_TILE_LIGHTNING EQU $e8
DEF ICON_TILE_WATER EQU $ec
DEF ICON_TILE_FIGHTING EQU $f0
DEF ICON_TILE_PSYCHIC EQU $f4
DEF ICON_TILE_COLORLESS EQU $f8
DEF ICON_TILE_ENERGY EQU $fc
+62
View File
@@ -31,4 +31,66 @@
const STARTMENU_NEW_GAME ; 2
const STARTMENU_CONTINUE_DUEL ; 3
; constants for wGlossaryMenu
const_def
const GLOSSARY_GAME_BASICS ; $0
const GLOSSARY_CARD_TYPE_EXPLANATIONS ; $1
const GLOSSARY_STATUS_WINNING_LOSING ; $2
const GLOSSARY_SPECIAL_DUEL_RULES ; $3
const GLOSSARY_EXIT ; $4
; filter types for CardTypeFilters
; used to categorise the different cards
; i.e. in the deck building screen
DEF FILTER_FIRE EQUS "TYPE_PKMN_FIRE"
DEF FILTER_GRASS EQUS "TYPE_PKMN_GRASS"
DEF FILTER_LIGHTNING EQUS "TYPE_PKMN_LIGHTNING"
DEF FILTER_WATER EQUS "TYPE_PKMN_WATER"
DEF FILTER_FIGHTING EQUS "TYPE_PKMN_FIGHTING"
DEF FILTER_PSYCHIC EQUS "TYPE_PKMN_PSYCHIC"
DEF FILTER_COLORLESS EQUS "TYPE_PKMN_COLORLESS"
DEF FILTER_TRAINER EQUS "TYPE_TRAINER"
DEF FILTER_ENERGY EQU $20
DEF NUM_FILTERS EQU 9
DEF NUM_DECK_CONFIRMATION_VISIBLE_CARDS EQU 7
DEF NUM_DECK_SAVE_MACHINE_SLOTS EQU 50
DEF NUM_DECK_MACHINE_VISIBLE_DECKS EQU 5
; deck flags
const_def
const DECK_1_F ; $0
const DECK_2_F ; $1
const DECK_3_F ; $2
const DECK_4_F ; $3
DEF DECK_1 EQU 1 << DECK_1_F ; $1
DEF DECK_2 EQU 1 << DECK_2_F ; $2
DEF DECK_3 EQU 1 << DECK_3_F ; $4
DEF DECK_4 EQU 1 << DECK_4_F ; $8
DEF ALL_DECKS EQU $ff
; flags in wOwnedPhantomCards
const_def
const PROMO_VENUSAUR_LV64_F ; $0
const PROMO_MEW_LV15_F ; $1
const PROMO_LUGIA_F ; $2
const PROMO_HERE_COMES_TEAM_ROCKET_F ; $3
DEF PROMO_VENUSAUR_LV64 EQU (1 << PROMO_VENUSAUR_LV64_F)
DEF PROMO_MEW_LV15 EQU (1 << PROMO_MEW_LV15_F)
DEF PROMO_LUGIA EQU (1 << PROMO_LUGIA_F)
DEF PROMO_HERE_COMES_TEAM_ROCKET EQU (1 << PROMO_HERE_COMES_TEAM_ROCKET_F)
; TODO find a way to not have these hardcoded?
DEF NUM_CARDS_BEGINNING_POKEMON EQU 66
DEF NUM_CARDS_LEGENDARY_POWER EQU 61
DEF NUM_CARDS_ISLAND_OF_FOSSIL EQU 59
DEF NUM_CARDS_PSYCHIC_BATTLE EQU 54
DEF NUM_CARDS_SKY_FLYING_POKEMON EQU 56
DEF NUM_CARDS_WE_ARE_TEAM_ROCKET EQU 50
DEF NUM_CARDS_TEAM_ROCKETS_AMBITION EQU 50
DEF NUM_CARDS_PROMOTIONAL EQU 45 ; doesn't include Phantom cards
+17
View File
@@ -0,0 +1,17 @@
; wPrinterStatus
const_def
const PRINTER_ERROR_CHECKSUM ; $0
const PRINTER_STATUS_BUSY ; $1
const PRINTER_STATUS_IMAGE_FULL ; $2
const PRINTER_STATUS_PRINTING ; $3
const PRINTER_ERROR_INVALID_PACKET ; $4
const PRINTER_ERROR_PAPER_JAMMED ; $5
const PRINTER_ERROR_CABLE_PRINTER_SWITCH ; $6
const PRINTER_ERROR_BATTERIES_LOST_CHARGE ; $7
; printer packet types
DEF PRINTERPKT_INIT EQU $01
DEF PRINTERPKT_PRINT_INSTRUCTION EQU $02
DEF PRINTERPKT_DATA EQU $04
DEF PRINTERPKT_BREAK EQU $08
DEF PRINTERPKT_NUL EQU $0f
+37 -37
View File
@@ -1,38 +1,38 @@
const_def
const SCENE_SPECIAL_RULES ; $00
const SCENE_SLOT_MACHINE ; $01
const SCENE_BEGINNING_PACK ; $02
const SCENE_LEGENDARY_PACK ; $03
const SCENE_FOSSIL_PACK ; $04
const SCENE_PSYCHIC_PACK ; $05
const SCENE_FLYING_PACK ; $06
const SCENE_ROCKET_PACK ; $07
const SCENE_AMBITION_PACK ; $08
const SCENE_PRESENT_PACK ; $09
const SCENE_INTRO_BASE_SET ; $0a
const SCENE_INTRO_JUNGLE ; $0b
const SCENE_INTRO_FOSSIL ; $0c
const SCENE_INTRO_TEAM_ROCKET ; $0d
const SCENE_TOURNAMENT_TABLE ; $0e
const SCENE_CARD_POP_MENU ; $0f
const SCENE_CARD_POP ; $10
const SCENE_CARD_POP_ERROR ; $11
const SCENE_LINK ; $12
const SCENE_RARE_CARD_POP ; $13
const SCENE_RARE_CARD_POP_ERROR ; $14
const SCENE_BLACK_BOX ; $15
const SCENE_TITLE_SCREEN_1 ; $16
const SCENE_TITLE_SCREEN_2 ; $17
const SCENE_TITLE_SCREEN_3 ; $18
const SCENE_TITLE_SCREEN_4 ; $19
const SCENE_PRINTER_1 ; $1a
const SCENE_PRINTER_2 ; $1b
const SCENE_FULL_MAILBOX ; $1c
const SCENE_GOT_MAIL ; $1d
const SCENE_MAILBOX ; $1e
const SCENE_DECK_DIAGNOSIS ; $1f
const SCENE_LINK_INTRO_1 ; $20
const SCENE_LINK_INTRO_2 ; $21
const SCENE_COIN_TOSS_RESULT_1 ; $22
const SCENE_COIN_TOSS_RESULT_2 ; $23
const SCENE_GBC_ONLY_DISCLAIMER ; $24
const SCENE_SPECIAL_RULES ; $00
const SCENE_SLOT_MACHINE ; $01
const SCENE_BEGINNING_PACK ; $02
const SCENE_LEGENDARY_PACK ; $03
const SCENE_FOSSIL_PACK ; $04
const SCENE_PSYCHIC_PACK ; $05
const SCENE_FLYING_PACK ; $06
const SCENE_ROCKET_PACK ; $07
const SCENE_AMBITION_PACK ; $08
const SCENE_PRESENT_PACK ; $09
const SCENE_INTRO_BASE_SET ; $0a
const SCENE_INTRO_JUNGLE ; $0b
const SCENE_INTRO_FOSSIL ; $0c
const SCENE_INTRO_TEAM_ROCKET ; $0d
const SCENE_TOURNAMENT_TABLE ; $0e
const SCENE_CARD_POP_MENU ; $0f
const SCENE_CARD_POP ; $10
const SCENE_CARD_POP_ERROR ; $11
const SCENE_LINK ; $12
const SCENE_RARE_CARD_POP ; $13
const SCENE_RARE_CARD_POP_ERROR ; $14
const SCENE_BLACK_BOX ; $15
const SCENE_TITLE_SCREEN_1 ; $16
const SCENE_TITLE_SCREEN_2 ; $17
const SCENE_TITLE_SCREEN_3 ; $18
const SCENE_TITLE_SCREEN_4 ; $19
const SCENE_GAMEBOY_PRINTER_TRANSMITTING ; $1a
const SCENE_GAMEBOY_PRINTER_NOT_CONNECTED ; $1b
const SCENE_FULL_MAILBOX ; $1c
const SCENE_GOT_MAIL ; $1d
const SCENE_MAILBOX ; $1e
const SCENE_DECK_DIAGNOSIS ; $1f
const SCENE_LINK_INTRO_1 ; $20
const SCENE_LINK_INTRO_2 ; $21
const SCENE_COIN_TOSS_RESULT_1 ; $22
const SCENE_COIN_TOSS_RESULT_2 ; $23
const SCENE_GBC_ONLY_DISCLAIMER ; $24
+2106 -7
View File
File diff suppressed because it is too large Load Diff
+4319 -9
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -972,7 +972,7 @@ Func_d411:
call PauseSong
ld a, MUSIC_PCMAINMENU
call PlaySong
farcall $4, $50c6
farcall Func_110c6
call ResumeSong
ret
+498 -33
View File
@@ -114,7 +114,7 @@ Func_102ef:
.Func_10327:
ld a, [wWRAMBank]
push af
ld a, $03
ld a, BANK("WRAM3")
call SwitchWRAMBank
xor a
ld [w3d400], a
@@ -126,9 +126,164 @@ Func_102ef:
pop af
call SwitchWRAMBank
ret
; 0x10342
SECTION "Bank 4@4413", ROMX[$4413], BANK[$4]
Func_10342:
push af
push bc
push de
push hl
ld a, [wWRAMBank]
push af
ld a, BANK("WRAM3")
call SwitchWRAMBank
push bc
ld a, [w3d400]
ld c, a
ld b, $00
ld hl, w3d401
add hl, bc
add hl, bc
pop bc
push hl
ld a, [hli]
ld h, [hl]
ld l, a
ld [hl], d ; x
inc hl
ld [hl], e ; y
inc hl
ld [hl], b ; width
inc hl
ld [hl], c ; height
inc hl
push hl
push bc
ld b, d ; x
ld c, e ; y
call BCCoordToBGMap0Address
pop bc
pop de
.loop
xor a ; VRAM0
call BankswitchVRAM
push bc
push hl
.loop_copy_vram0
di
call WaitForLCDOff
ld a, [hli]
ld [de], a
ei
inc de
dec b
jr nz, .loop_copy_vram0
pop hl
pop bc
ld a, BANK("VRAM1")
call BankswitchVRAM
push bc
push hl
.loop_copy_vram1
di
call WaitForLCDOff
ld a, [hli]
ld [de], a
ei
inc de
dec b
jr nz, .loop_copy_vram1
pop hl
ld bc, BG_MAP_WIDTH
add hl, bc
pop bc
dec c
jr nz, .loop
ld hl, w3d400
inc [hl]
pop hl
inc hl
inc hl
ld [hl], e
inc hl
ld [hl], d
xor a
call BankswitchVRAM
pop af
call SwitchWRAMBank
pop hl
pop de
pop bc
pop af
ret
Func_103b6:
push af
push hl
ld a, [wWRAMBank]
push af
ld a, $03
call SwitchWRAMBank
ld hl, w3d400
dec [hl]
ld a, [hl]
ld c, a
ld b, $00
ld hl, w3d401
add hl, bc
add hl, bc
ld a, [hli]
ld h, [hl]
ld l, a
ld a, [hli]
ld d, a
ld a, [hli]
ld e, a
ld a, [hli]
ld b, a
ld a, [hli]
ld c, a
push bc
push de
push hl
push bc
ld b, d
ld c, e
call BCCoordToBGMap0Address
pop bc
pop hl
.loop_rows
push bc
xor a
call BankswitchVRAM
push de
call SafeCopyDataHLtoDE
pop de
ld a, BANK("VRAM1")
call BankswitchVRAM
push de
call SafeCopyDataHLtoDE
pop de
push hl
ld h, d
ld l, e
ld bc, BG_MAP_WIDTH
add hl, bc
ld d, h
ld e, l
pop hl
pop bc
dec c
jr nz, .loop_rows
xor a
call BankswitchVRAM
pop de
pop bc
pop af
call SwitchWRAMBank
pop hl
pop af
ret
Func_10413:
ld [wd895], a
@@ -337,7 +492,7 @@ Func_1059f:
ld b, [hl]
ld a, [wWRAMBank]
push af
ld a, $03
ld a, BANK("WRAM3")
call SwitchWRAMBank
ld a, b
ld [de], a
@@ -349,10 +504,10 @@ Func_1059f:
jr nz, .loop_copy
ld a, [wWRAMBank]
push af
ld a, $03
ld a, BANK("WRAM3")
call SwitchWRAMBank
ld bc, $415
ld de, $d4c6
ld de, w3d4c6
ld hl, w3d000
call CopyBCBytesFromHLToDE
pop af
@@ -374,7 +529,7 @@ Func_105de:
.loop_copy
ld a, [wWRAMBank]
push af
ld a, $03
ld a, BANK("WRAM3")
call SwitchWRAMBank
ld a, [de]
ld b, a
@@ -387,11 +542,11 @@ Func_105de:
jr nz, .loop_copy
ld a, [wWRAMBank]
push af
ld a, $03
ld a, BANK("WRAM3")
call SwitchWRAMBank
ld bc, $415
ld de, w3d000
ld hl, $d4c6
ld hl, w3d4c6
call CopyBCBytesFromHLToDE
pop af
call SwitchWRAMBank
@@ -411,7 +566,7 @@ SetInitialGraphicsConfiguration:
push hl
xor a
ld [wTileMapFill], a
bank1call SetZeroLineSeparation
bank1call SetOneLineSeparation
call LoadSymbolsFont
call Func_35a0
call SetZeroScroll
@@ -492,7 +647,7 @@ SafeClearBGMap:
xor a
ld [hl], a
ei
ld a, $01
ld a, BANK("VRAM1")
call BankswitchVRAM
ei
.wait_lcd_2
@@ -548,7 +703,7 @@ FillBoxInBGMap:
ld a, [wd89d]
ld [hl], a
ei
ld a, $01
ld a, BANK("VRAM1")
call BankswitchVRAM
di
call WaitForLCDOff
@@ -598,7 +753,7 @@ Func_10742:
ld c, e
call BCCoordToBGMap0Address
pop bc
ld a, $01
ld a, BANK("VRAM1")
call BankswitchVRAM
.loop
push bc
@@ -1054,15 +1209,150 @@ Func_10aa8:
SECTION "Bank 4@4ab9", ROMX[$4ab9], BANK[$4]
Func_10ab9:
res 6, [hl] ; SPRITEANIMSTRUCT_FLAGS
res SPRITEANIMSTRUCT_FLAG6_F, [hl] ; SPRITEANIMSTRUCT_FLAGS
ret
Func_10abc:
set 6, [hl] ; SPRITEANIMSTRUCT_FLAGS
set SPRITEANIMSTRUCT_FLAG6_F, [hl] ; SPRITEANIMSTRUCT_FLAGS
ret
; 0x10abf
SECTION "Bank 4@4b71", ROMX[$4b71], BANK[$4]
Func_10abf:
push af
push bc
push de
push hl
inc d
inc e
inc e
ld a, d
add b
ld b, a ; (d + 1 + b)
ld a, e
add c
ld c, a ; (e + 2 + c)
ld hl, wSpriteAnimationStructs
ld a, NUM_SPRITE_ANIM_STRUCTS
.loop_anims
push af
push hl
ld a, [hl] ; SPRITEANIMSTRUCT_FLAGS
and SPRITEANIMSTRUCT_ACTIVE
jr z, .next_anim
inc hl
inc hl
inc hl
ld a, [hli] ; SPRITEANIMSTRUCT_X_POS
srl a
srl a
srl a ; /8
cp d
jr c, .next_anim
ld a, [hld] ; SPRITEANIMSTRUCT_Y_POS
srl a
srl a
srl a ; /8
cp e
jr c, .next_anim
ld a, [hli] ; SPRITEANIMSTRUCT_X_POS
srl a
srl a
srl a ; /8
cp b
jr nc, .next_anim
ld a, [hld] ; SPRITEANIMSTRUCT_Y_POS
srl a
srl a
srl a ; /8
cp c
jr nc, .next_anim
dec hl
dec hl
dec hl
res SPRITEANIMSTRUCT_FLAG6_F, [hl] ; SPRITEANIMSTRUCT_FLAGS
.next_anim
pop hl
push bc
ld bc, SPRITEANIMSTRUCT_LENGTH
add hl, bc
pop bc
pop af
dec a
jr nz, .loop_anims
pop hl
pop de
pop bc
pop af
ret
Func_10b18:
push af
push bc
push de
push hl
inc d
inc e
inc e
ld a, d
add b
ld b, a ; (d + 1 + b)
ld a, e
add c
ld c, a ; (e + 2 + c)
ld hl, wSpriteAnimationStructs
ld a, NUM_SPRITE_ANIM_STRUCTS
.loop_sprite_anims
push af
push hl
ld a, [hl] ; SPRITEANIMSTRUCT_FLAGS
and SPRITEANIMSTRUCT_ACTIVE
jr z, .next_sprite_anim
inc hl
inc hl
inc hl
ld a, [hli] ; SPRITEANIMSTRUCT_X_POS
srl a
srl a
srl a ; /8
cp d
jr c, .next_sprite_anim
ld a, [hld] ; SPRITEANIMSTRUCT_Y_POS
srl a
srl a
srl a ; /8
cp e
jr c, .next_sprite_anim
ld a, [hli] ; SPRITEANIMSTRUCT_X_POS
srl a
srl a
srl a ; /8
cp b
jr nc, .next_sprite_anim
ld a, [hld] ; SPRITEANIMSTRUCT_Y_POS
srl a
srl a
srl a ; /8
cp c
jr nc, .next_sprite_anim
dec hl
dec hl
dec hl
set SPRITEANIMSTRUCT_FLAG6_F, [hl] ; SPRITEANIMSTRUCT_FLAGS
.next_sprite_anim
pop hl
push bc
ld bc, SPRITEANIMSTRUCT_LENGTH
add hl, bc
pop bc
pop af
dec a
jr nz, .loop_sprite_anims
pop hl
pop de
pop bc
pop af
ret
Func_10b71:
push af
@@ -1160,7 +1450,7 @@ Func_10be7:
ld b, [hl]
ld a, [wWRAMBank]
push af
ld a, $03
ld a, BANK("WRAM3")
call SwitchWRAMBank
ld a, b
ld [de], a
@@ -1185,12 +1475,12 @@ Func_10c10:
push de
push hl
ld de, wSpriteAnim4TileOffset
ld hl, wSpriteAnim1
ld hl, wSpriteAnimationStructs
ld c, $ca
.asm_10c1e
ld a, [wWRAMBank]
push af
ld a, $03
ld a, BANK("WRAM3")
call SwitchWRAMBank
ld a, [de]
ld b, a
@@ -1626,7 +1916,7 @@ Func_10ea7:
ld b, [hl]
ld a, [wWRAMBank]
push af
ld a, $03
ld a, BANK("WRAM3")
call SwitchWRAMBank
ld a, b
ld [de], a
@@ -1657,7 +1947,7 @@ Func_10ed3:
.asm_10ee1
ld a, [wWRAMBank]
push af
ld a, $03
ld a, BANK("WRAM3")
call SwitchWRAMBank
ld a, [de]
ld b, a
@@ -1887,9 +2177,36 @@ IsStillOWObject:
db OW_PURPLE_CASTLE_COIN
db OW_STRONGHOLD_PLATFORM
db $ff ; end
; 0x11002
SECTION "Bank 4@502c", ROMX[$502c], BANK[$4]
Func_11002:
push af
push bc
push de
push hl
lb de, 0, 12
lb bc, 20, 6
call Func_10673
call Func_10abf
call DoFrame
call Func_10342
pop hl
pop de
pop bc
pop af
ret
Func_1101d:
push af
push bc
push de
push hl
call Func_103b6
call Func_10b18
pop hl
pop de
pop bc
pop af
ret
PrintScrollableText_NoTextBoxLabelVRAM0::
push af
@@ -1995,11 +2312,159 @@ Func_110c2::
call PopFrameFunction
ret
Func_110c6:
push af
push bc
push de
push hl
call Func_11002
ldtx hl, Text05bb
call PrintScrollableText_NoTextBoxLabelVRAM0
ld e, $01
.asm_110d5
call .ShowMenu
call .HandleInput
jr c, .asm_110f2
push de
call .ExecuteSelectedOption
pop de
jr c, .asm_110f2
call .Func_11181
ld a, e
and a
jr z, .asm_110f0
call Func_1101d
ld e, $00
.asm_110f0
jr .asm_110d5
.asm_110f2
call .Func_11181
ld a, e
and a
jr nz, .asm_110fc
call Func_11002
.asm_110fc
ldtx hl, Text05bc
call PrintScrollableText_NoTextBoxLabelVRAM0
call Func_1101d
pop hl
pop de
pop bc
pop af
ret
.ShowMenu:
push af
push bc
push de
push hl
lb de, 10, 0
ld b, BANK(.menu_params)
ld hl, .menu_params
call LoadMenuBoxParams
farcall Func_1cacf
ld a, [wPCMenuCursorPosition]
farcall DrawMenuBox
pop hl
pop de
pop bc
pop af
ret
.menu_params
db TRUE ; skip clear
db 10, 12 ; width, height
db SYM_CURSOR_R ; blink cursor symbol
db SYM_SPACE ; space symbol
db SYM_CURSOR_R ; default cursor symbol
db SYM_CURSOR_R ; selection cursor symbol
db A_BUTTON ; press keys
db B_BUTTON ; held keys
db FALSE ; has horizontal scroll
db 1 ; vertical step
dw NULL ; update function
dw NULL ; label text ID
textitem 2, 2, Text05b7
textitem 2, 4, Text05cc
textitem 2, 6, Text05b9
textitem 2, 8, Text05ba
textitem 2, 10, Text05bd
db $ff
.HandleInput:
ld a, [wPCMenuCursorPosition]
farcall HandleMenuBox
ld [wPCMenuCursorPosition], a
jr c, .asm_11161
push af
ld a, SFX_02
call CallPlaySFX
pop af
ret
.asm_11161
push af
ld a, SFX_03
call CallPlaySFX
pop af
ret
; a = option that was selected
.ExecuteSelectedOption:
ld hl, .function_map
call CallMappedFunction
ret
.function_map
key_func $0, .CardAlbum
db $1, BANK(@)
dw $51d7
key_func $2, .Glossary
key_func $3, .Func_111be
db $ff ; end
.Func_11181:
farcall Func_1caf1
ret
.CardAlbum:
call Func_1022a
call SetFadePalsFrameFunc
farcall CardAlbum
farcall StartFadeToWhite
farcall WaitPalFading_Bank07
call UnsetFadePalsFrameFunc
call Func_10252
ret
.Glossary:
call Func_1022a
call SetFadePalsFrameFunc
call ClearSpriteAnimsAndSetInitialGraphicsConfiguration
call FlushAllPalettes
farcall Glossary
farcall StartFadeToWhite
farcall WaitPalFading_Bank07
call UnsetFadePalsFrameFunc
call Func_10252
ret
.Func_111be:
call Func_1022a
call SetFadePalsFrameFunc
farcall PrinterMenu
farcall StartFadeToWhite
farcall WaitPalFading_Bank07
call UnsetFadePalsFrameFunc
call Func_10252
ret
; 0x111d7
SECTION "Bank 4@51f0", ROMX[$51f0], BANK[$4]
Func_111f0:
ld a, $04
ld [wd9dc], a
ld [wPCMenuCursorPosition], a
ret
; 0x111f6
@@ -2302,7 +2767,7 @@ Func_11384::
.loop
push bc
push hl
bit 6, [hl]
bit 6, [hl] ; OWOBJSTRUCT_FLAGS
jr z, .next
push hl
call GetOWObjectSpriteAnim
@@ -2400,7 +2865,7 @@ Func_113f8:
ld b, [hl]
ld a, [wWRAMBank]
push af
ld a, $03
ld a, BANK("WRAM3")
call SwitchWRAMBank
ld a, b
ld [de], a
@@ -2431,7 +2896,7 @@ Func_11424:
.asm_11432
ld a, [wWRAMBank]
push af
ld a, $03
ld a, BANK("WRAM3")
call SwitchWRAMBank
ld a, [de]
ld b, a
@@ -2771,7 +3236,7 @@ DoIntro:
call ResetIntroOrbStates
push af
ld a, SFX_9A
call Func_3cfe
call CallPlaySFX
pop af
.loop_intro_update
@@ -2981,7 +3446,7 @@ AnimateTitle:
jr c, .finish
push af
ld a, SFX_9B
call Func_3cfe
call CallPlaySFX
pop af
call .Expand
jr c, .finish
@@ -3099,7 +3564,7 @@ AnimateSubtitleEnter:
call LoadTitleScreenGraphics
push af
ld a, SFX_9C
call Func_3cfe
call CallPlaySFX
pop af
call .Distort
farcall SetAllBGPaletteFadeConfigsToEnabled
@@ -3630,7 +4095,7 @@ ClearBoxInBGMap:
call WaitForLCDOff
xor a
ld [hl], a
ld a, $01
ld a, BANK("VRAM1")
call BankswitchVRAM
call WaitForLCDOff
xor a
@@ -3993,7 +4458,7 @@ DrawLoadedCard:
xor a
call BankswitchVRAM
call .ApplyTilemap
ld a, $01
ld a, BANK("VRAM1")
call BankswitchVRAM
call .ApplyAttrmap
pop hl
+1269 -19
View File
File diff suppressed because it is too large Load Diff
+52 -16
View File
@@ -1195,7 +1195,38 @@ SetAllOBPaletteFadeConfigsToEnabled:
ret
; 0x1cac3
SECTION "Bank 7@4b00", ROMX[$4b00], BANK[$7]
SECTION "Bank 7@4acf", ROMX[$4acf], BANK[$7]
Func_1cacf:
push af
push bc
push de
ld a, [wMenuBoxX]
ld d, a
ld a, [wMenuBoxY]
ld e, a
ld a, [wMenuBoxWidth]
ld b, a
ld a, [wMenuBoxHeight]
ld c, a
farcall Func_10abf
call DoFrame
farcall Func_10342
pop de
pop bc
pop af
ret
Func_1caf1:
push af
push bc
push de
farcall Func_103b6
farcall Func_10b18
pop de
pop bc
pop af
ret
; a = default cursor position
DrawMenuBox:
@@ -1283,6 +1314,11 @@ DrawMenuBox:
pop af
ret
; handles player input inside a menu box
; that was initialized with LoadMenuBoxParams
; returns carry if a selection was made
; input:
; a = default cursor position
HandleMenuBox:
push bc
push de
@@ -1350,12 +1386,12 @@ HandleMenuBox:
ld b, a
ld a, c
sub b
jr nc, .asm_1cbf6
jr nc, .no_overflow_1
add h ; warp around
.asm_1cbf6
.no_overflow_1
push af
ld a, SFX_01
call Func_3cfe
call CallPlaySFX
pop af
call .UnfocusItem
ld c, a
@@ -1374,12 +1410,12 @@ HandleMenuBox:
ld a, c
add b
cp h
jr c, .asm_1cc17
jr c, .no_overflow_2
sub h ; warp around
.asm_1cc17
.no_overflow_2
push af
ld a, SFX_01
call Func_3cfe
call CallPlaySFX
pop af
call .UnfocusItem
ld c, a
@@ -1395,12 +1431,12 @@ HandleMenuBox:
ld b, a
ld a, c
sub b
jr nc, .asm_1cc33
jr nc, .no_overflow_3
add h
.asm_1cc33
.no_overflow_3
push af
ld a, SFX_01
call Func_3cfe
call CallPlaySFX
pop af
call .UnfocusItem
ld c, a
@@ -1417,12 +1453,12 @@ HandleMenuBox:
ld a, c
add b
cp h
jr c, .asm_1cc50
jr c, .no_overflow_4
sub h
.asm_1cc50
.no_overflow_4
push af
ld a, SFX_01
call Func_3cfe
call CallPlaySFX
pop af
call .UnfocusItem
ld c, a
@@ -1901,13 +1937,13 @@ HandleStartMenuBox:
jr c, .selected
push af
ld a, SFX_02
call Func_3cfe
call CallPlaySFX
pop af
ret
.selected
push af
ld a, SFX_03
call Func_3cfe
call CallPlaySFX
pop af
ret
@@ -2242,7 +2278,7 @@ Func_1dcb7:
SECTION "Bank 7@5fb9", ROMX[$5fb9], BANK[$7]
Func_1dfb9:
Func_1dfb9::
push af
push bc
push de
+149 -120
View File
@@ -62,6 +62,35 @@ ClearSavedDuel:
ret
; 0x240e6
SECTION "Bank 9@425e", ROMX[$425e], BANK[$9]
DrawDuelHorizontalSeparator:
ld hl, .LineSeparatorTileData
call WriteDataBlocksToBGMap0
ld a, [wConsole]
cp CONSOLE_CGB
ret nz
call BankswitchVRAM1
ld hl, .LineSeparatorAttributeData
call WriteDataBlocksToBGMap0
call BankswitchVRAM0
ret
.LineSeparatorTileData:
db 0, 4, $34, $34, $34, $34, $34, $34, $34, $34, $34, $31, $32, 0
db 9, 5, $33, $33, 0
db 9, 6, $33, $33, 0
db 9, 7, $32, $31, $34, $34, $34, $34, $34, $34, $34, $34, $34, 0
db $ff ; end
.LineSeparatorAttributeData:
db 0, 4, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0
db 9, 5, $01, $21, 0
db 9, 6, $01, $21, 0
db 9, 7, $61, $61, $01, $01, $01, $01, $01, $01, $01, $01, $01, 0
db $ff ; end
; 0x242c5
SECTION "Bank 9@5934", ROMX[$5934], BANK[$9]
; a = deck ID
@@ -97,7 +126,7 @@ LoadDeckIDData:
ld a, [hli]
ld [wcc15], a
ld a, [hli]
ld [wcc10], a
ld [wSpecialRule], a
ld a, [hli]
ld [wcd0e], a
ld a, [hli]
@@ -115,7 +144,7 @@ DeckIDData:
tx Text04d5 ; opponent name
db $05 ; ?
db $02 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $12 ; ?
@@ -126,7 +155,7 @@ DeckIDData:
tx Text04f6 ; opponent name
db $00 ; ?
db $00 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $00 ; ?
db $00 ; ?
@@ -137,7 +166,7 @@ DeckIDData:
tx Text04f6 ; opponent name
db $00 ; ?
db $00 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $00 ; ?
db $00 ; ?
@@ -148,7 +177,7 @@ DeckIDData:
tx Text04f6 ; opponent name
db $00 ; ?
db $00 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $00 ; ?
db $00 ; ?
@@ -159,7 +188,7 @@ DeckIDData:
tx Text04f6 ; opponent name
db $00 ; ?
db $00 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $00 ; ?
db $00 ; ?
@@ -170,7 +199,7 @@ DeckIDData:
tx Text04f6 ; opponent name
db $00 ; ?
db $00 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $00 ; ?
db $00 ; ?
@@ -181,7 +210,7 @@ DeckIDData:
tx Text04f6 ; opponent name
db $00 ; ?
db $00 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $00 ; ?
db $00 ; ?
@@ -192,7 +221,7 @@ DeckIDData:
tx Text04d5 ; opponent name
db $05 ; ?
db $02 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $12 ; ?
@@ -203,7 +232,7 @@ DeckIDData:
tx Text04f6 ; opponent name
db $00 ; ?
db $00 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $00 ; ?
db $00 ; ?
@@ -214,7 +243,7 @@ DeckIDData:
tx Text0432 ; opponent name
db $06 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $12 ; ?
@@ -225,7 +254,7 @@ DeckIDData:
tx Text04f6 ; opponent name
db $00 ; ?
db $00 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $00 ; ?
db $00 ; ?
@@ -236,7 +265,7 @@ DeckIDData:
tx Text0432 ; opponent name
db $06 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $12 ; ?
@@ -247,7 +276,7 @@ DeckIDData:
tx Text04f6 ; opponent name
db $00 ; ?
db $00 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $00 ; ?
db $00 ; ?
@@ -258,7 +287,7 @@ DeckIDData:
tx Text0432 ; opponent name
db $06 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $12 ; ?
@@ -269,7 +298,7 @@ DeckIDData:
tx Text0432 ; opponent name
db $06 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $12 ; ?
@@ -280,7 +309,7 @@ DeckIDData:
tx Text0432 ; opponent name
db $06 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $12 ; ?
@@ -291,7 +320,7 @@ DeckIDData:
tx Text04a3 ; opponent name
db $0a ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $03 ; ?
db $09 ; ?
@@ -302,7 +331,7 @@ DeckIDData:
tx Text04a3 ; opponent name
db $0a ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $03 ; ?
db $09 ; ?
@@ -313,7 +342,7 @@ DeckIDData:
tx Text04a0 ; opponent name
db $0c ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $01 ; ?
@@ -324,7 +353,7 @@ DeckIDData:
tx Text04a0 ; opponent name
db $0c ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $01 ; ?
@@ -335,7 +364,7 @@ DeckIDData:
tx Text04e4 ; opponent name
db $0b ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $01 ; ?
@@ -346,7 +375,7 @@ DeckIDData:
tx Text04aa ; opponent name
db $0d ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $01 ; ?
@@ -357,7 +386,7 @@ DeckIDData:
tx Text04d4 ; opponent name
db $0e ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $03 ; ?
db $0a ; ?
@@ -368,7 +397,7 @@ DeckIDData:
tx Text04d4 ; opponent name
db $0e ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $03 ; ?
db $0a ; ?
@@ -379,7 +408,7 @@ DeckIDData:
tx Text04ec ; opponent name
db $0f ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $02 ; ?
@@ -390,7 +419,7 @@ DeckIDData:
tx Text04bd ; opponent name
db $11 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $02 ; ?
@@ -401,7 +430,7 @@ DeckIDData:
tx Text0491 ; opponent name
db $10 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $02 ; ?
@@ -412,7 +441,7 @@ DeckIDData:
tx Text0493 ; opponent name
db $12 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $03 ; ?
db $0b ; ?
@@ -423,7 +452,7 @@ DeckIDData:
tx Text04de ; opponent name
db $13 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $03 ; ?
@@ -434,7 +463,7 @@ DeckIDData:
tx Text04b8 ; opponent name
db $14 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $03 ; ?
@@ -445,7 +474,7 @@ DeckIDData:
tx Text049c ; opponent name
db $15 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $03 ; ?
@@ -456,7 +485,7 @@ DeckIDData:
tx Text04e0 ; opponent name
db $16 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $03 ; ?
db $0c ; ?
@@ -467,7 +496,7 @@ DeckIDData:
tx Text04ce ; opponent name
db $17 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $04 ; ?
@@ -478,7 +507,7 @@ DeckIDData:
tx Text04ce ; opponent name
db $17 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $04 ; ?
@@ -489,7 +518,7 @@ DeckIDData:
tx Text04a5 ; opponent name
db $18 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $04 ; ?
@@ -500,7 +529,7 @@ DeckIDData:
tx Text04b5 ; opponent name
db $19 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $04 ; ?
@@ -511,7 +540,7 @@ DeckIDData:
tx Text0489 ; opponent name
db $1a ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $03 ; ?
db $0d ; ?
@@ -522,7 +551,7 @@ DeckIDData:
tx Text0475 ; opponent name
db $1b ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $05 ; ?
@@ -533,7 +562,7 @@ DeckIDData:
tx Text0475 ; opponent name
db $1b ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $05 ; ?
@@ -544,7 +573,7 @@ DeckIDData:
tx Text04b9 ; opponent name
db $1c ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $05 ; ?
@@ -555,7 +584,7 @@ DeckIDData:
tx Text04d7 ; opponent name
db $1d ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $05 ; ?
@@ -566,7 +595,7 @@ DeckIDData:
tx Text048a ; opponent name
db $1e ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $03 ; ?
db $0e ; ?
@@ -577,7 +606,7 @@ DeckIDData:
tx Text04df ; opponent name
db $20 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $06 ; ?
@@ -588,7 +617,7 @@ DeckIDData:
tx Text04a1 ; opponent name
db $1f ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $06 ; ?
@@ -599,7 +628,7 @@ DeckIDData:
tx Text04cc ; opponent name
db $21 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $06 ; ?
@@ -610,7 +639,7 @@ DeckIDData:
tx Text047d ; opponent name
db $22 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $03 ; ?
db $0f ; ?
@@ -621,7 +650,7 @@ DeckIDData:
tx Text049a ; opponent name
db $23 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $07 ; ?
@@ -632,7 +661,7 @@ DeckIDData:
tx Text049a ; opponent name
db $23 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $07 ; ?
@@ -643,7 +672,7 @@ DeckIDData:
tx Text04d3 ; opponent name
db $24 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $07 ; ?
@@ -654,7 +683,7 @@ DeckIDData:
tx Text04dc ; opponent name
db $25 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $07 ; ?
@@ -665,7 +694,7 @@ DeckIDData:
tx Text0474 ; opponent name
db $26 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $03 ; ?
db $10 ; ?
@@ -676,7 +705,7 @@ DeckIDData:
tx Text04a2 ; opponent name
db $27 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $08 ; ?
@@ -687,7 +716,7 @@ DeckIDData:
tx Text04cd ; opponent name
db $29 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $08 ; ?
@@ -698,7 +727,7 @@ DeckIDData:
tx Text04f5 ; opponent name
db $28 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $08 ; ?
@@ -709,7 +738,7 @@ DeckIDData:
tx Text042a ; opponent name
db $3e ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $1f ; ?
db $16 ; ?
@@ -720,7 +749,7 @@ DeckIDData:
tx Text0427 ; opponent name
db $3b ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $1f ; ?
db $16 ; ?
@@ -731,7 +760,7 @@ DeckIDData:
tx Text0428 ; opponent name
db $3c ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $1f ; ?
db $16 ; ?
@@ -742,7 +771,7 @@ DeckIDData:
tx Text0429 ; opponent name
db $3d ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $1f ; ?
db $16 ; ?
@@ -753,7 +782,7 @@ DeckIDData:
tx Text04be ; opponent name
db $2a ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $04 ; ?
db $11 ; ?
@@ -764,7 +793,7 @@ DeckIDData:
tx Text049e ; opponent name
db $2b ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $04 ; ?
db $11 ; ?
@@ -775,7 +804,7 @@ DeckIDData:
tx Text0482 ; opponent name
db $2c ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $04 ; ?
db $11 ; ?
@@ -786,7 +815,7 @@ DeckIDData:
tx Text04ed ; opponent name
db $2d ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $04 ; ?
db $11 ; ?
@@ -797,7 +826,7 @@ DeckIDData:
tx Text04d8 ; opponent name
db $3f ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $1f ; ?
db $17 ; ?
@@ -808,7 +837,7 @@ DeckIDData:
tx Text04e3 ; opponent name
db $40 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $1f ; ?
db $17 ; ?
@@ -819,7 +848,7 @@ DeckIDData:
tx Text04da ; opponent name
db $41 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $01 ; ?
db $1f ; ?
db $17 ; ?
@@ -830,7 +859,7 @@ DeckIDData:
tx Text04dd ; opponent name
db $42 ; ?
db $06 ; ?
db $01 ; ?
db $01 ; special duel rules
db $00 ; ?
db $20 ; ?
db $1d ; ?
@@ -841,7 +870,7 @@ DeckIDData:
tx Text04a4 ; opponent name
db $46 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $26 ; ?
@@ -852,7 +881,7 @@ DeckIDData:
tx Text04f2 ; opponent name
db $43 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $07 ; ?
db $1f ; ?
db $18 ; ?
@@ -863,7 +892,7 @@ DeckIDData:
tx Text0479 ; opponent name
db $44 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $02 ; ?
db $1f ; ?
db $18 ; ?
@@ -874,7 +903,7 @@ DeckIDData:
tx Text0487 ; opponent name
db $45 ; ?
db $06 ; ?
db $02 ; ?
db $02 ; special duel rules
db $00 ; ?
db $20 ; ?
db $1e ; ?
@@ -885,7 +914,7 @@ DeckIDData:
tx Text049b ; opponent name
db $47 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $1f ; ?
db $19 ; ?
@@ -896,7 +925,7 @@ DeckIDData:
tx Text04e2 ; opponent name
db $48 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $03 ; ?
db $1f ; ?
db $19 ; ?
@@ -907,7 +936,7 @@ DeckIDData:
tx Text0499 ; opponent name
db $49 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $08 ; ?
db $1f ; ?
db $19 ; ?
@@ -918,7 +947,7 @@ DeckIDData:
tx Text04bc ; opponent name
db $4a ; ?
db $06 ; ?
db $03 ; ?
db $03 ; special duel rules
db $00 ; ?
db $20 ; ?
db $1f ; ?
@@ -929,7 +958,7 @@ DeckIDData:
tx Text04d9 ; opponent name
db $4b ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $04 ; ?
db $1f ; ?
db $1a ; ?
@@ -940,7 +969,7 @@ DeckIDData:
tx Text049f ; opponent name
db $4c ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $09 ; ?
db $1f ; ?
db $1a ; ?
@@ -951,7 +980,7 @@ DeckIDData:
tx Text0473 ; opponent name
db $4d ; ?
db $04 ; ?
db $04 ; ?
db $04 ; special duel rules
db $00 ; ?
db $1f ; ?
db $1a ; ?
@@ -962,7 +991,7 @@ DeckIDData:
tx Text0483 ; opponent name
db $4e ; ?
db $06 ; ?
db $05 ; ?
db $05 ; special duel rules
db $00 ; ?
db $20 ; ?
db $20 ; ?
@@ -973,7 +1002,7 @@ DeckIDData:
tx Text0494 ; opponent name
db $4f ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $0c ; ?
db $1f ; ?
db $1b ; ?
@@ -984,7 +1013,7 @@ DeckIDData:
tx Text048c ; opponent name
db $50 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $05 ; ?
db $1f ; ?
db $1b ; ?
@@ -995,7 +1024,7 @@ DeckIDData:
tx Text0485 ; opponent name
db $51 ; ?
db $06 ; ?
db $06 ; ?
db $06 ; special duel rules
db $00 ; ?
db $20 ; ?
db $21 ; ?
@@ -1006,7 +1035,7 @@ DeckIDData:
tx Text04db ; opponent name
db $52 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $06 ; ?
db $1f ; ?
db $1c ; ?
@@ -1017,7 +1046,7 @@ DeckIDData:
tx Text0492 ; opponent name
db $53 ; ?
db $04 ; ?
db $07 ; ?
db $07 ; special duel rules
db $00 ; ?
db $1f ; ?
db $1c ; ?
@@ -1028,7 +1057,7 @@ DeckIDData:
tx Text04e5 ; opponent name
db $54 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $0a ; ?
db $1f ; ?
db $1c ; ?
@@ -1039,7 +1068,7 @@ DeckIDData:
tx Text04ee ; opponent name
db $55 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $0d ; ?
db $1f ; ?
db $1c ; ?
@@ -1050,7 +1079,7 @@ DeckIDData:
tx Text04d2 ; opponent name
db $56 ; ?
db $06 ; ?
db $08 ; ?
db $08 ; special duel rules
db $00 ; ?
db $20 ; ?
db $22 ; ?
@@ -1061,7 +1090,7 @@ DeckIDData:
tx Text04b6 ; opponent name
db $57 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $0e ; ?
db $20 ; ?
db $23 ; ?
@@ -1072,7 +1101,7 @@ DeckIDData:
tx Text0478 ; opponent name
db $58 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $0f ; ?
db $20 ; ?
db $23 ; ?
@@ -1083,7 +1112,7 @@ DeckIDData:
tx Text0497 ; opponent name
db $59 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $10 ; ?
db $20 ; ?
db $23 ; ?
@@ -1094,7 +1123,7 @@ DeckIDData:
tx Text042d ; opponent name
db $07 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $23 ; ?
db $14 ; ?
@@ -1105,7 +1134,7 @@ DeckIDData:
tx Text0486 ; opponent name
db $5a ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $0b ; ?
db $20 ; ?
db $24 ; ?
@@ -1116,7 +1145,7 @@ DeckIDData:
tx Text04f0 ; opponent name
db $5b ; ?
db $06 ; ?
db $09 ; ?
db $09 ; special duel rules
db $00 ; ?
db $20 ; ?
db $24 ; ?
@@ -1127,7 +1156,7 @@ DeckIDData:
tx Text04f0 ; opponent name
db $5b ; ?
db $06 ; ?
db $0a ; ?
db $0a ; special duel rules
db $00 ; ?
db $20 ; ?
db $24 ; ?
@@ -1138,7 +1167,7 @@ DeckIDData:
tx Text04f0 ; opponent name
db $5b ; ?
db $06 ; ?
db $07 ; ?
db $07 ; special duel rules
db $00 ; ?
db $20 ; ?
db $24 ; ?
@@ -1149,7 +1178,7 @@ DeckIDData:
tx Text04c2 ; opponent name
db $5c ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $21 ; ?
db $25 ; ?
@@ -1160,7 +1189,7 @@ DeckIDData:
tx Text04c2 ; opponent name
db $5c ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $21 ; ?
db $25 ; ?
@@ -1171,7 +1200,7 @@ DeckIDData:
tx Text04c2 ; opponent name
db $5c ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $21 ; ?
db $25 ; ?
@@ -1182,7 +1211,7 @@ DeckIDData:
tx Text04c2 ; opponent name
db $5c ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $21 ; ?
db $25 ; ?
@@ -1193,7 +1222,7 @@ DeckIDData:
tx Text04c8 ; opponent name
db $36 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $02 ; ?
db $27 ; ?
@@ -1204,7 +1233,7 @@ DeckIDData:
tx Text04b4 ; opponent name
db $37 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $03 ; ?
db $27 ; ?
@@ -1215,7 +1244,7 @@ DeckIDData:
tx Text04bf ; opponent name
db $38 ; ?
db $04 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $1f ; ?
db $27 ; ?
@@ -1226,7 +1255,7 @@ DeckIDData:
tx Text04ef ; opponent name
db $39 ; ?
db $05 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $1f ; ?
db $27 ; ?
@@ -1237,7 +1266,7 @@ DeckIDData:
tx Text0488 ; opponent name
db $3a ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $20 ; ?
db $27 ; ?
@@ -1248,7 +1277,7 @@ DeckIDData:
tx Text047a ; opponent name
db $08 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $10 ; ?
db $13 ; ?
@@ -1259,7 +1288,7 @@ DeckIDData:
tx Text047a ; opponent name
db $09 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $24 ; ?
db $13 ; ?
@@ -1270,7 +1299,7 @@ DeckIDData:
tx Text04e6 ; opponent name
db $04 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $0f ; ?
db $15 ; ?
@@ -1281,7 +1310,7 @@ DeckIDData:
tx Text042b ; opponent name
db $5d ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $0f ; ?
db $16 ; ?
@@ -1292,7 +1321,7 @@ DeckIDData:
tx Text04e6 ; opponent name
db $04 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $0f ; ?
db $15 ; ?
@@ -1303,7 +1332,7 @@ DeckIDData:
tx Text04e6 ; opponent name
db $04 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $0f ; ?
db $15 ; ?
@@ -1314,7 +1343,7 @@ DeckIDData:
tx Text04e6 ; opponent name
db $04 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $0f ; ?
db $15 ; ?
@@ -1325,7 +1354,7 @@ DeckIDData:
tx Text047f ; opponent name
db $2e ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $20 ; ?
db $28 ; ?
@@ -1336,7 +1365,7 @@ DeckIDData:
tx Text04cf ; opponent name
db $2f ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $20 ; ?
db $28 ; ?
@@ -1347,7 +1376,7 @@ DeckIDData:
tx Text04e1 ; opponent name
db $30 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $20 ; ?
db $28 ; ?
@@ -1358,7 +1387,7 @@ DeckIDData:
tx Text04ab ; opponent name
db $31 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $20 ; ?
db $28 ; ?
@@ -1369,7 +1398,7 @@ DeckIDData:
tx Text04c3 ; opponent name
db $32 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $20 ; ?
db $28 ; ?
@@ -1380,7 +1409,7 @@ DeckIDData:
tx Text0476 ; opponent name
db $33 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $20 ; ?
db $28 ; ?
@@ -1391,7 +1420,7 @@ DeckIDData:
tx Text04a9 ; opponent name
db $34 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $20 ; ?
db $28 ; ?
@@ -1402,7 +1431,7 @@ DeckIDData:
tx Text04d0 ; opponent name
db $35 ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $20 ; ?
db $28 ; ?
@@ -1413,7 +1442,7 @@ DeckIDData:
tx Text04ac ; opponent name
db $5e ; ?
db $06 ; ?
db $00 ; ?
db NO_RULES ; special duel rules
db $00 ; ?
db $20 ; ?
db $28 ; ?
File diff suppressed because it is too large Load Diff
+368
View File
@@ -0,0 +1,368 @@
Glossary:
xor a
ld [wd0d2], a
bank1call SetDefaultPalettes
lb de, $38, $9f
call SetupText
jr .asm_186ba
ld a, $01
ld [wd0d2], a
.asm_186ba
xor a
.main_menu
ld hl, .MainMenuParameters
call InitializeMenuParameters
xor a
ld [wTileMapFill], a
call ZeroObjectPositions
ld a, $01
ld [wVBlankOAMCopyToggle], a
call DoFrame
call EmptyScreen
farcall LoadMenuCursorTile
ld hl, .MainMenuItems
call PlaceTextItems
ldtx hl, Text03d0
call DrawWideTextBox_PrintText
.loop_input
call DoFrame
call HandleMenuInput
jr nc, .loop_input
cp -1
ret z ; return
; selection was made
call EraseCursor
ldh a, [hCurScrollMenuItem]
ld [wGlossaryMenu], a
cp GLOSSARY_EXIT
ret z ; exit Glossary
call .ShowMenuContent
ld a, [wGlossaryMenu]
cp GLOSSARY_STATUS_WINNING_LOSING
jr nz, .has_10_topics
; GLOSSARY_STATUS_WINNING_LOSING
xor a
ld de, GlossaryTransitionTable_8Topics
jr .got_transition_table
.has_10_topics
cp GLOSSARY_SPECIAL_DUEL_RULES
jr nz, .not_special_duel_rules
; GLOSSARY_SPECIAL_DUEL_RULES
ld a, [wSpecialRule]
or a
jr z, .asm_18714
dec a
.asm_18714
ld de, GlossaryTransitionTable_10Topics
jr .got_transition_table
.not_special_duel_rules
xor a
ld de, GlossaryTransitionTable_10Topics
.got_transition_table
ld [wd0c1], a
ld hl, wTransitionTablePtr
ld [hl], e
inc hl
ld [hl], d
ld a, $ff
ld [wd0c4], a
xor a
ld [wScrollMenuCursorBlinkCounter], a
.topic_menu
ld a, $01
ld [wVBlankOAMCopyToggle], a
call DoFrame
ld a, [wd0d2]
or a
call nz, .Func_18763
farcall HandleMultiDirectionalMenu
jr nc, .topic_menu
cp $ff
jr nz, .selected_topic
farcall ZeroObjectPositionsWithCopyToggleOn
ldh a, [hCurScrollMenuItem]
jp .main_menu
.selected_topic
push af
farcall ZeroObjectPositionsWithCopyToggleOn
pop af
call .ShowExplanation
call .ShowMenuContent
xor a
ld [wScrollMenuCursorBlinkCounter], a
jr .topic_menu
.Func_18763:
ld a, [wGlossaryMenu]
cp GLOSSARY_SPECIAL_DUEL_RULES
ret nz ; not in special duel rules menu
ld a, [wSpecialRule]
or a
ret z ; no special rules
dec a
sla a
ld c, a
ld hl, wScrollMenuCursorBlinkCounter
ld a, [hl]
and $0f
ret nz
lb de, 4, "FW4_★"
bit 4, [hl]
jr z, .got_tile
lb de, 0, "FW0_ "
.got_tile
ld b, $00
ld hl, .rule_coords
add hl, bc
push de
ld e, [hl]
inc hl
ld d, [hl]
call InitTextPrinting
pop de
call Func_22ca
ret
.rule_coords
; x, y
db 3, 8 ; CHLOROPHYLL
db 5, 8 ; THUNDER_CHARGE
db 7, 8 ; FLAME_ARMOR
db 9, 7 ; SMALL_BENCH
db 11, 7 ; RUNNING_WATER
db 3, 18 ; EARTH_POWER
db 5, 17 ; LOW_RESISTANCE
db 7, 17 ; ENERGY_RETURN
db 9, 17 ; TOUGH_ESCAPE
db 11, 18 ; BLACK_HOLE
.MainMenuParameters:
db 1, 3 ; cursor x, cursor y
db 2 ; y displacement between items
db 5 ; number of items
db SYM_CURSOR_R ; cursor tile number
db SYM_SPACE ; tile behind cursor
dw NULL ; function pointer if non-0
.MainMenuItems:
textitem 2, 1, Text03c6
textitem 3, 3, Text03c7
textitem 3, 5, Text03c8
textitem 3, 7, Text03c9
textitem 3, 9, Text03ca
textitem 3, 11, Text03cb
db $ff
; shows which topics are inside this Glossary menu
; each menu has a text ID for title and for the items
.ShowMenuContent:
xor a
ld [wTileMapFill], a
call EmptyScreen
ld a, [wGlossaryMenu]
or a
jr nz, .asm_187df
; GLOSSARY_GAME_BASICS
ldtx hl, Text03c7
ldtx de, Text03cc
jr .got_title_and_topics
.asm_187df
cp GLOSSARY_CARD_TYPE_EXPLANATIONS
jr nz, .asm_187eb
; GLOSSARY_CARD_TYPE_EXPLANATIONS
ldtx hl, Text03c8
ldtx de, Text03cd
jr .got_title_and_topics
.asm_187eb
cp GLOSSARY_STATUS_WINNING_LOSING
jr nz, .asm_187f7
; GLOSSARY_STATUS_WINNING_LOSING
ldtx hl, Text03c9
ldtx de, Text03ce
jr .got_title_and_topics
.asm_187f7
; GLOSSARY_SPECIAL_DUEL_RULES
lb de, 6, 1
call InitTextPrinting
ldtx hl, Text03ca
ldtx de, Text03cf
push de
jr .skip_init_text
; hl = title
; de = topics
.got_title_and_topics
push de
push hl
lb de, 3, 1
call InitTextPrinting
pop hl
.skip_init_text
call ProcessTextFromID
lb de, 1, 3
call InitTextPrinting
pop hl
call ProcessTextFromID
ldtx hl, Text03d0
call DrawWideTextBox_PrintText
ret
; shows a big box with the explanation of the
; selected topic, each topic has data
; related to the x position of the topic title text
; and the text IDs of the information shown
; waits for the player to press the B button
.ShowExplanation:
push af
xor a
ld [wTileMapFill], a
call EmptyScreen
lb de, 0, 4
lb bc, 20, 14
call DrawRegularTextBox
ld a, [wGlossaryMenu]
or a
jr nz, .asm_18847
; GLOSSARY_GAME_BASICS
ld hl, .ExplanationTextData_GameBasics
push hl
ldtx hl, Text03d1
push hl
lb de, 2, 0
jr .got_explanation_data
.asm_18847
cp GLOSSARY_CARD_TYPE_EXPLANATIONS
jr nz, .asm_18858
; GLOSSARY_CARD_TYPE_EXPLANATIONS
ld hl, .ExplanationTextData_CardTypes
push hl
ldtx hl, Text03d2
push hl
lb de, 2, 0
jr .got_explanation_data
.asm_18858
cp GLOSSARY_STATUS_WINNING_LOSING
jr nz, .asm_18869
; GLOSSARY_STATUS_WINNING_LOSING
ld hl, .ExplanationTextData_StatusWinningLosing
push hl
ldtx hl, Text03d3
push hl
lb de, 2, 0
jr .got_explanation_data
.asm_18869
; GLOSSARY_SPECIAL_DUEL_RULES
ld hl, .ExplanationTextData_SpecialDuelRules
push hl
ldtx hl, Text03d4
push hl
lb de, 5, 0
.got_explanation_data
call InitTextPrinting
pop hl
call ProcessTextFromID
pop hl
pop af
ld c, a
ld b, $00
add hl, bc
sla a
sla a ; *4
ld c, a
add hl, bc
; topic title
ld a, [hli]
push hl
ld d, a ; x
ld e, 2
call InitTextPrinting
ld a, [hli]
ld h, [hl]
ld l, a
call ProcessTextFromID
pop hl
; topic explanation
lb de, 1, 5
call InitTextPrinting
inc hl
inc hl
ld a, [hli]
ld h, [hl]
ld l, a
ld a, $1
ld [wLineSeparation], a
call ProcessTextFromID
xor a
ld [wLineSeparation], a
call EnableLCD
.loop_wait_b_btn
call DoFrame
ldh a, [hKeysPressed]
and B_BUTTON
jr z, .loop_wait_b_btn
ld a, $ff
farcall PlayAcceptOrDeclineSFX
ret
MACRO explanation
db \1 ; title x position
tx \2 ; title text ID
tx \3 ; explanation text ID
ENDM
.ExplanationTextData_GameBasics:
explanation 5, Text03d5, Text03fb
explanation 6, Text03d6, Text03fc
explanation 4, Text03d7, Text03fd
explanation 6, Text03d8, Text03fe
explanation 5, Text03d9, Text03ff
explanation 5, Text03da, Text0400
explanation 4, Text03db, Text0401
explanation 3, Text03dc, Text0402
explanation 4, Text03dd, Text0403
explanation 2, Text03de, Text0404
.ExplanationTextData_CardTypes:
explanation 3, Text03df, Text0405
explanation 3, Text03e0, Text0406
explanation 4, Text03e1, Text0407
explanation 4, Text03e2, Text0408
explanation 3, Text03e3, Text0409
explanation 6, Text03e4, Text040a
explanation 5, Text03e5, Text040b
explanation 6, Text03e6, Text040c
explanation 5, Text03e7, Text040d
explanation 5, Text03e8, Text040e
.ExplanationTextData_StatusWinningLosing:
explanation 5, Text03e9, Text040f
explanation 5, Text03ea, Text0410
explanation 4, Text03eb, Text0411
explanation 4, Text03ec, Text0412
explanation 3, Text03ed, Text0413
explanation 3, Text03ee, Text0414
explanation 3, Text03ef, Text0415
explanation 4, Text03f0, Text0416
.ExplanationTextData_SpecialDuelRules:
explanation 3, Text03f1, Text0417
explanation 3, Text03f2, Text0418
explanation 3, Text03f3, Text0419
explanation 4, Text03f4, Text041a
explanation 4, Text03f5, Text041b
explanation 3, Text03f6, Text041c
explanation 4, Text03f7, Text041d
explanation 4, Text03f8, Text041e
explanation 4, Text03f9, Text041f
explanation 3, Text03fa, Text0420
+39 -39
View File
@@ -57,43 +57,43 @@ _LoadScene::
ret
SceneDataPointers:
dw .SceneSpecialRules ; SCENE_SPECIAL_RULES
dw .SceneSlotMachine ; SCENE_SLOT_MACHINE
dw .SceneBeginningPack ; SCENE_BEGINNING_PACK
dw .SceneLegendaryPack ; SCENE_LEGENDARY_PACK
dw .SceneFossilPack ; SCENE_FOSSIL_PACK
dw .ScenePsychicPack ; SCENE_PSYCHIC_PACK
dw .SceneFlyingPack ; SCENE_FLYING_PACK
dw .SceneRocketPack ; SCENE_ROCKET_PACK
dw .SceneAmbitionPack ; SCENE_AMBITION_PACK
dw .ScenePresentPack ; SCENE_PRESENT_PACK
dw .SceneIntroBaseSet ; SCENE_INTRO_BASE_SET
dw .SceneIntroJungle ; SCENE_INTRO_JUNGLE
dw .SceneIntroFossil ; SCENE_INTRO_FOSSIL
dw .SceneIntroTeamRocket ; SCENE_INTRO_TEAM_ROCKET
dw .SceneTournamentTable ; SCENE_TOURNAMENT_TABLE
dw .SceneCardPopMenu ; SCENE_CARD_POP_MENU
dw .SceneCardPop ; SCENE_CARD_POP
dw .SceneCardPopError ; SCENE_CARD_POP_ERROR
dw .SceneLink ; SCENE_LINK
dw .SceneRareCardPop ; SCENE_RARE_CARD_POP
dw .SceneRareCardPopError ; SCENE_RARE_CARD_POP_ERRORR
dw .SceneBlackBox ; SCENE_BLACK_BOX
dw .SceneTitleScreen1 ; SCENE_TITLE_SCREEN_1
dw .SceneTitleScreen2 ; SCENE_TITLE_SCREEN_2
dw .SceneTitleScreen3 ; SCENE_TITLE_SCREEN_3
dw .SceneTitleScreen4 ; SCENE_TITLE_SCREEN_4
dw .ScenePrinter1 ; SCENE_PRINTER_1
dw .ScenePrinter2 ; SCENE_PRINTER_2
dw .SceneFullMailbox ; SCENE_FULL_MAILBOX
dw .SceneGotMail ; SCENE_GOT_MAIL
dw .SceneMailbox ; SCENE_MAILBOX
dw .SceneDeckDiagnosis ; SCENE_DECK_DIAGNOSIS
dw .SceneLinkIntro1 ; SCENE_LINK_INTRO_1
dw .SceneLinkIntro2 ; SCENE_LINK_INTRO_2
dw .SceneCoinTossResult1 ; SCENE_COIN_TOSS_RESULT_1
dw .SceneCoinTossResult2 ; SCENE_COIN_TOSS_RESULT_2
dw .SceneGBCOnlyDisclaimer ; SCENE_GBC_ONLY_DISCLAIMER
dw .SceneSpecialRules ; SCENE_SPECIAL_RULES
dw .SceneSlotMachine ; SCENE_SLOT_MACHINE
dw .SceneBeginningPack ; SCENE_BEGINNING_PACK
dw .SceneLegendaryPack ; SCENE_LEGENDARY_PACK
dw .SceneFossilPack ; SCENE_FOSSIL_PACK
dw .ScenePsychicPack ; SCENE_PSYCHIC_PACK
dw .SceneFlyingPack ; SCENE_FLYING_PACK
dw .SceneRocketPack ; SCENE_ROCKET_PACK
dw .SceneAmbitionPack ; SCENE_AMBITION_PACK
dw .ScenePresentPack ; SCENE_PRESENT_PACK
dw .SceneIntroBaseSet ; SCENE_INTRO_BASE_SET
dw .SceneIntroJungle ; SCENE_INTRO_JUNGLE
dw .SceneIntroFossil ; SCENE_INTRO_FOSSIL
dw .SceneIntroTeamRocket ; SCENE_INTRO_TEAM_ROCKET
dw .SceneTournamentTable ; SCENE_TOURNAMENT_TABLE
dw .SceneCardPopMenu ; SCENE_CARD_POP_MENU
dw .SceneCardPop ; SCENE_CARD_POP
dw .SceneCardPopError ; SCENE_CARD_POP_ERROR
dw .SceneLink ; SCENE_LINK
dw .SceneRareCardPop ; SCENE_RARE_CARD_POP
dw .SceneRareCardPopError ; SCENE_RARE_CARD_POP_ERRORR
dw .SceneBlackBox ; SCENE_BLACK_BOX
dw .SceneTitleScreen1 ; SCENE_TITLE_SCREEN_1
dw .SceneTitleScreen2 ; SCENE_TITLE_SCREEN_2
dw .SceneTitleScreen3 ; SCENE_TITLE_SCREEN_3
dw .SceneTitleScreen4 ; SCENE_TITLE_SCREEN_4
dw .ScenePrinterTransmitting ; SCENE_GAMEBOY_PRINTER_TRANSMITTING
dw .ScenePrinterNotConnected ; SCENE_GAMEBOY_PRINTER_NOT_CONNECTED
dw .SceneFullMailbox ; SCENE_FULL_MAILBOX
dw .SceneGotMail ; SCENE_GOT_MAIL
dw .SceneMailbox ; SCENE_MAILBOX
dw .SceneDeckDiagnosis ; SCENE_DECK_DIAGNOSIS
dw .SceneLinkIntro1 ; SCENE_LINK_INTRO_1
dw .SceneLinkIntro2 ; SCENE_LINK_INTRO_2
dw .SceneCoinTossResult1 ; SCENE_COIN_TOSS_RESULT_1
dw .SceneCoinTossResult2 ; SCENE_COIN_TOSS_RESULT_2
dw .SceneGBCOnlyDisclaimer ; SCENE_GBC_ONLY_DISCLAIMER
.SceneSpecialRules
dw TILESET_SPECIAL_RULES
@@ -299,7 +299,7 @@ SceneDataPointers:
dw PALETTE_173
db $ff, $ff ; end
.ScenePrinter1
.ScenePrinterTransmitting
dw TILESET_PRINTER_SCENE
dw PALETTE_179
dw TILEMAP_22F
@@ -311,7 +311,7 @@ SceneDataPointers:
dw PALETTE_17A
db $ff, $ff ; end
.ScenePrinter2
.ScenePrinterNotConnected
dw TILESET_PRINTER_SCENE
dw PALETTE_179
dw TILEMAP_22F
Binary file not shown.

After

Width:  |  Height:  |  Size: 89 B

+1 -1
View File
@@ -134,7 +134,7 @@ AddCardToCollection:
push hl
push bc
push de
bank1call $6a0c ; CreateTempCardCollection
bank1call CreateTempCardCollection
pop de
call EnableSRAM
ld hl, wTempCardCollection
+18 -23
View File
@@ -87,7 +87,7 @@ LoadCardDataToHL_FromCardID:
ret
; return in a the type (TYPE_* constant) of the card with id at de
GetCardType:
GetCardType::
push hl
call GetCardPointer
jr c, .done
@@ -120,7 +120,7 @@ Func_2d3f:
ret
; return in de the 2-byte text id of the name of the card with id at de
GetCardName:
GetCardName::
push hl
call GetCardPointer
jr c, .done
@@ -138,7 +138,7 @@ GetCardName:
ret
; from the card id in de, returns type into a, rarity into b, and set into c
GetCardTypeRarityAndSet:
GetCardTypeRarityAndSet::
push hl
push de
call GetCardPointer
@@ -168,12 +168,7 @@ GetCardPointer:
ld a, d
or e
jr z, .invalid
ld a, d
cp HIGH(NUM_CARDS + 1)
jr nz, .check
ld a, e
cp LOW(NUM_CARDS + 1)
.check
cp16 NUM_CARDS + 1
jr c, .valid
.invalid
scf
@@ -211,17 +206,17 @@ LoadCardGfx::
call BankswitchROM
ret
Func_2dc4:
Func_2dc4::
ldh a, [hBankROM]
push af
call LoadCardPalettes
ld a, l
ld [wcde5], a
ld [wcde5 + 0], a
ld a, h
ld [wcde5 + 1], a
ld hl, $cd92
ld bc, $3000
.asm_2dd8
ld hl, wCardAttrMap
lb bc, $30, 0
.loop_copy
ld a, [hl]
and $3f
ld [hli], a
@@ -233,20 +228,20 @@ Func_2dc4:
add hl, hl
add hl, hl
add hl, hl
add hl, hl
ld a, [wcde5]
add hl, hl ; *TILE_SIZE
ld a, [wcde5 + 0]
add l
ld l, a
ld a, [wcde5 + 1]
adc h
ld h, a
ld b, $10
ld b, TILE_SIZE
call SafeCopyDataHLtoDE
pop bc
pop hl
inc c
dec b
jr nz, .asm_2dd8
jr nz, .loop_copy
pop af
call BankswitchROM
ret
@@ -258,23 +253,23 @@ LoadCardPalettes:
ld a, h
srl a
srl a
srl a
srl a ; /8
add BANK(CardGraphics)
call BankswitchROM
pop hl
add hl, hl
add hl, hl
add hl, hl
add hl, hl ; *8
res 7, h
set 6, h ; $4000 ≤ hl ≤ $7fff
ld b, $48
ld b, 3 palettes + $30 ; palettes + attributes
ld de, wCardPalettes
.asm_2e1c
.loop_copy
ld a, [hli]
ld [de], a
inc de
dec b
jr nz, .asm_2e1c
jr nz, .loop_copy
pop de
pop bc
ret
+2 -2
View File
@@ -1,12 +1,12 @@
; switch to CGB Normal Speed Mode if playing on CGB and current mode is Double Speed Mode
SwitchToCGBNormalSpeed:
SwitchToCGBNormalSpeed::
ld hl, rKEY1
bit 7, [hl]
ret z
jr CGBSpeedSwitch
; switch to CGB Double Speed Mode if playing on CGB and current mode is Normal Speed Mode
SwitchToCGBDoubleSpeed:
SwitchToCGBDoubleSpeed::
ld hl, rKEY1
bit 7, [hl]
ret nz
+13 -18
View File
@@ -54,7 +54,7 @@ CopyDeckData:
ret
; return, in register a, the amount of prizes that the turn holder has not yet drawn
CountPrizes:
CountPrizes::
push hl
ld a, DUELVARS_PRIZES
get_turn_duelist_var
@@ -223,19 +223,14 @@ Func_0ffa:
push de
ld c, a
call GetCardIDFromDeckIndex
ld a, d
cp HIGH(RECYCLE_ENERGY)
jr nz, .asm_1008
ld a, e
cp LOW(RECYCLE_ENERGY)
.asm_1008
cp16 RECYCLE_ENERGY
ld a, c
pop de
pop bc
jr nz, PutCardInDiscardPile
push bc
ld c, a
ld a, [wcc10]
ld a, [wSpecialRule]
cp $0a
ld a, c
pop bc
@@ -490,7 +485,7 @@ ShuffleCards:
; returns, in register de, the id of the card with the deck index (0-59) specified by register a
; preserves af and hl
GetCardIDFromDeckIndex:
GetCardIDFromDeckIndex::
push af
push hl
call _GetCardIDFromDeckIndex
@@ -584,7 +579,7 @@ _GetCardIDFromDeckIndex:
ret
; load data of card with deck index a (0-59) to wLoadedCard1
LoadCardDataToBuffer1_FromDeckIndex:
LoadCardDataToBuffer1_FromDeckIndex::
push hl
push de
push bc
@@ -600,7 +595,7 @@ LoadCardDataToBuffer1_FromDeckIndex:
ret
; load data of card with deck index a (0-59) to wLoadedCard2
LoadCardDataToBuffer2_FromDeckIndex:
LoadCardDataToBuffer2_FromDeckIndex::
push hl
push de
push bc
@@ -888,7 +883,7 @@ PutHandCardInPlayArea:
ret
Func_12fc:
ld a, [wcc10]
ld a, [wSpecialRule]
cp $08
jr nz, MovePlayAreaCardToDiscardPile
call EmptyPlayAreaSlot
@@ -1086,7 +1081,7 @@ SwapPlayAreaPokemon:
; or a Pokemon card in the bench, depending on the value of register e.
; input: e = location to check, i.e. PLAY_AREA_*
; Feedback is returned in wAttachedEnergies and wTotalAttachedEnergies.
GetPlayAreaCardAttachedEnergies:
GetPlayAreaCardAttachedEnergies::
push hl
push de
push bc
@@ -1206,7 +1201,7 @@ GetTurnDuelistVariable:
; returns [([hWhoseTurn] ^ $1) << 8 + a] in a and in [hl]
; i.e. duelvar a of the player whose turn it is not
GetNonTurnDuelistVariable:
GetNonTurnDuelistVariable::
ld l, a
ldh a, [hWhoseTurn]
ld h, OPPONENT_TURN
@@ -1720,7 +1715,7 @@ ApplyDamageModifiers_DamageToTarget:
and b
jr z, .check_pluspower_and_defender ; jump if not resistant
ld hl, -30
ld a, [wcc10]
ld a, [wSpecialRule]
cp $07
jr nz, .asm_1801
ld hl, -10
@@ -2044,7 +2039,7 @@ DealDamageToPlayAreaPokemon:
ret
Func_1bb4:
call $3c55 ; Func_3c55
call FinishQueuedAnimations
bank1call $4cd7 ; DrawDuelMainScene
bank1call $4d82 ; DrawDuelHUDs
xor a
@@ -2174,7 +2169,7 @@ CheckLoadedAttackFlag:
; As a side effect, this also returns a duelist variable in a similar manner to
; GetNonTurnDuelistVariable, but this function appears to be
; only called to swap the turn value.
SwapTurn:
SwapTurn::
push af
push hl
call GetNonTurnDuelistVariable
@@ -2185,7 +2180,7 @@ SwapTurn:
ret
; copy the TX_END-terminated player's name from sPlayerName to de
CopyPlayerName:
CopyPlayerName::
call EnableSRAM
ld hl, sPlayerName
.loop
+35 -35
View File
@@ -10,7 +10,7 @@ InitializeCardListParameters::
ld a, e
ld [wCurMenuItem], a
add d
ldh [hCurMenuItem], a
ldh [hCurScrollMenuItem], a
ld a, [hli]
ld [wCursorXPosition], a
ld a, [hli]
@@ -20,7 +20,7 @@ InitializeCardListParameters::
ld a, [hli]
ld [wListItemNameMaxLength], a
ld a, [hli]
ld [wNumMenuItems], a
ld [wNumScrollMenuItems], a
ld a, [hli]
ld [wCursorTile], a
ld a, [hli]
@@ -46,18 +46,18 @@ HandleCardListInput::
ld d, a
ld a, [wCurMenuItem]
ld e, a
ldh a, [hCurMenuItem]
ldh a, [hCurScrollMenuItem]
scf
ret
; initializes parameters for a menu, given the 8 bytes starting at hl,
; which are loaded to the following addresses:
; wCursorXPosition, wCursorYPosition, wYDisplacementBetweenMenuItems, wNumMenuItems,
; wCursorXPosition, wCursorYPosition, wYDisplacementBetweenMenuItems, wNumScrollMenuItems,
; wCursorTile, wTileBehindCursor, wMenuFunctionPointer.
; also sets the current menu item (wCurMenuItem) to the one specified in register a.
InitializeMenuParameters::
ld [wCurMenuItem], a
ldh [hCurMenuItem], a
ldh [hCurScrollMenuItem], a
ld de, wCursorXPosition
ld b, wMenuFunctionPointer + $2 - wCursorXPosition
.loop
@@ -80,7 +80,7 @@ HandleMenuInput::
or a
jr z, .up_down_done
ld b, a
ld a, [wNumMenuItems]
ld a, [wNumScrollMenuItems]
ld c, a
ld a, [wCurMenuItem]
bit D_UP_F, b
@@ -88,7 +88,7 @@ HandleMenuInput::
dec a
bit 7, a
jr z, .handle_up_or_down
ld a, [wNumMenuItems]
ld a, [wNumScrollMenuItems]
dec a ; wrapping around, so load the bottommost item
jr .handle_up_or_down
.not_up
@@ -109,7 +109,7 @@ HandleMenuInput::
ld [wCursorBlinkCounter], a
.up_down_done
ld a, [wCurMenuItem]
ldh [hCurMenuItem], a
ldh [hCurScrollMenuItem], a
ld hl, wMenuFunctionPointer ; call the function if non-0 (periodically)
ld a, [hli]
or [hl]
@@ -117,7 +117,7 @@ HandleMenuInput::
ld a, [hld]
ld l, [hl]
ld h, a
ldh a, [hCurMenuItem]
ldh a, [hCurScrollMenuItem]
call CallHL
jr nc, RefreshMenuCursor_CheckPlaySFX
.A_pressed_draw_cursor
@@ -126,7 +126,7 @@ HandleMenuInput::
call PlayOpenOrExitScreenSFX
ld a, [wCurMenuItem]
ld e, a
ldh a, [hCurMenuItem]
ldh a, [hCurScrollMenuItem]
scf
ret
.check_A_or_B
@@ -139,16 +139,16 @@ HandleMenuInput::
ld a, [wCurMenuItem]
ld e, a
ld a, $ff
ldh [hCurMenuItem], a
ldh [hCurScrollMenuItem], a
call PlayOpenOrExitScreenSFX
scf
ret
; plays an "open screen" sound (SFX_02) if [hCurMenuItem] != 0xff
; plays an "exit screen" sound (SFX_03) if [hCurMenuItem] == 0xff
; plays an "open screen" sound (SFX_02) if [hCurScrollMenuItem] != 0xff
; plays an "exit screen" sound (SFX_03) if [hCurScrollMenuItem] == 0xff
PlayOpenOrExitScreenSFX::
push af
ldh a, [hCurMenuItem]
ldh a, [hCurScrollMenuItem]
inc a
jr z, .play_exit_sfx
ld a, SFX_02
@@ -214,10 +214,10 @@ DrawCursor2::
ld a, [wCursorTile]
jr DrawCursor
; set wCurMenuItem, and hCurMenuItem to a, and zero wCursorBlinkCounter
; set wCurMenuItem, and hCurScrollMenuItem to a, and zero wCursorBlinkCounter
SetMenuItem::
ld [wCurMenuItem], a
ldh [hCurMenuItem], a
ldh [hCurScrollMenuItem], a
xor a
ld [wCursorBlinkCounter], a
ret
@@ -263,7 +263,7 @@ HandleDuelMenuInput::
call .erase_cursor
pop af
ld [wCurMenuItem], a
ldh [hCurMenuItem], a
ldh [hCurScrollMenuItem], a
xor a
ld [wCursorBlinkCounter], a
jr .blink_cursor
@@ -345,14 +345,14 @@ ReloadCardListItems::
call WriteByteToBGMap0
ld e, SYM_SPACE
ld a, [wListScrollOffset]
ld hl, wNumMenuItems
ld hl, wNumScrollMenuItems
add [hl]
ld hl, wNumListItems
cp [hl]
jr nc, .cant_go_down
ld e, SYM_CURSOR_D
.cant_go_down
ld a, [wNumMenuItems]
ld a, [wNumScrollMenuItems]
add a
add c
dec a
@@ -364,7 +364,7 @@ ReloadCardListItems::
ld d, $00
ld hl, wDuelTempList
add hl, de
ld a, [wNumMenuItems]
ld a, [wNumScrollMenuItems]
ld b, a
ld a, [wListItemXPosition]
ld d, a
@@ -404,10 +404,10 @@ ReloadCardListItems::
; reload a list of cards, except don't print their names
Func_2827::
ld a, $01
ldh [hffb0], a
ldh [hffbb], a
call ReloadCardListItems
xor a
ldh [hffb0], a
ldh [hffbb], a
ret
; convert the number at a to TX_SYMBOL text format and write it to wDefaultText
@@ -429,7 +429,7 @@ OneByteNumberToTxSymbol_TrimLeadingZerosAndAlign::
CardListMenuFunction::
ldh a, [hDPadHeld]
ld b, a
ld a, [wNumMenuItems]
ld a, [wNumScrollMenuItems]
dec a
ld c, a
ld a, [wCurMenuItem]
@@ -484,7 +484,7 @@ CardListMenuFunction::
ld a, [wListScrollOffset]
or a
jr z, .continue
ld hl, wNumMenuItems
ld hl, wNumScrollMenuItems
sub [hl]
jr c, .top_of_page_reached
ld [wListScrollOffset], a
@@ -496,7 +496,7 @@ CardListMenuFunction::
ld hl, wCurMenuItem
add [hl]
ld c, a
ld hl, wNumMenuItems
ld hl, wNumScrollMenuItems
sub [hl]
jr nc, .asm_28c4
add [hl]
@@ -510,12 +510,12 @@ CardListMenuFunction::
.not_left
bit D_RIGHT_F, b
jr z, .continue
ld a, [wNumMenuItems]
ld a, [wNumScrollMenuItems]
ld hl, wNumListItems
cp [hl]
jr nc, .continue
ld a, [wListScrollOffset]
ld hl, wNumMenuItems
ld hl, wNumScrollMenuItems
add [hl]
ld c, a
add [hl]
@@ -534,7 +534,7 @@ CardListMenuFunction::
add [hl]
ld c, a
ld a, [wNumListItems]
ld hl, wNumMenuItems
ld hl, wNumScrollMenuItems
sub [hl]
ld [wListScrollOffset], a
ld b, a
@@ -549,13 +549,13 @@ CardListMenuFunction::
ld a, [wListScrollOffset]
ld hl, wCurMenuItem
add [hl]
ldh [hCurMenuItem], a
ldh [hCurScrollMenuItem], a
ld a, [wCardListIndicatorYPosition]
cp $ff
jr z, .skip_printing_indicator
; print <sel_item>/<num_items>
ld c, a
ldh a, [hCurMenuItem]
ldh a, [hCurScrollMenuItem]
inc a
call OneByteNumberToTxSymbol_TrimLeadingZeros
ld b, 14
@@ -577,7 +577,7 @@ CardListMenuFunction::
ld a, [hld]
ld l, [hl]
ld h, a
ldh a, [hCurMenuItem]
ldh a, [hCurScrollMenuItem]
jp hl ; execute the function at wListFunctionPointer
.no_list_function
ldh a, [hKeysPressed]
@@ -589,7 +589,7 @@ CardListMenuFunction::
ret
.pressed_b
ld a, $ff
ldh [hCurMenuItem], a
ldh [hCurScrollMenuItem], a
scf
ret
@@ -811,7 +811,7 @@ SetCursorParametersForTextBox::
inc hl
ld [hl], 0 ; wYDisplacementBetweenMenuItems
inc hl
ld [hl], 1 ; wNumMenuItems
ld [hl], 1 ; wNumScrollMenuItems
inc hl
ld [hl], b ; wCursorTile
inc hl
@@ -1031,7 +1031,7 @@ HandleYesOrNoMenu::
jr .wait_button_loop
.a_pressed
ld a, [wCurMenuItem]
ldh [hCurMenuItem], a
ldh [hCurScrollMenuItem], a
or a
jr nz, .no
;.yes
@@ -1041,7 +1041,7 @@ HandleYesOrNoMenu::
xor a
ld [wDefaultYesOrNo], a ; 0
ld a, 1
ldh [hCurMenuItem], a
ldh [hCurScrollMenuItem], a
scf
ret
+1 -1
View File
@@ -500,7 +500,7 @@ Func_2c4b::
call PrintTextNoDelay_Init
pop de
pop hl
ldh a, [hffb0]
ldh a, [hffbb]
or a
ret nz
ldh a, [hTextLineCurPos]
+105 -74
View File
@@ -1,57 +1,67 @@
; serial transfer-related
SendPrinterPacket:
; send printer packet:
; - d = PRINTERPKT_* constant
; - e = in case of PRINTERPKT_DATA, whether it's compressed
; - bc = number of bytes in data
SendPrinterPacket::
push hl
ld hl, wce64
ld hl, wPrinterPacket
; Preamble
ld a, $88
ld [hli], a ; [wce64] ← $88
ld [hli], a ; [wPrinterPacketPreamble + 0] ← $88
ld a, $33
ld [hli], a ; [wce65] ← $33
ld [hli], a ; [wPrinterPacketPreamble + 1] ← $33
; Header
ld [hl], d ; [wce66] ← d
ld [hl], d ; [wPrinterPacketInstructions + 0] ← d
inc hl
ld [hl], e ; [wce67] ← e
ld [hl], e ; [wPrinterPacketInstructions + 1] ← e
inc hl
ld [hl], c ; [wce68] ← c
ld [hl], c ; [wPrinterPacketDataSize + 0] ← c
inc hl
ld [hl], b ; [wce69] ← b
ld [hl], b ; [wPrinterPacketDataSize + 1] ← b
inc hl
; Data pointer
pop de
ld [hl], e ; [wPrinterPacketDataPtr] ← l
ld [hl], e ; [wPrinterPacketDataPtr + 0] ← l
inc hl
ld [hl], d ; [wce6b] ← h
ld [hl], d ; [wPrinterPacketDataPtr + 1] ← h
inc hl
ld de, $ff45
ld [hl], e ; [wce6c] ← $45
ld de, -$bb
ld [hl], e ; [wPrinterPacketChecksum + 0] ← $45
inc hl
ld [hl], d ; [wce6d] ← $ff
ld [hl], d ; [wPrinterPacketChecksum + 1] ← $ff
ld hl, wSerialDataPtr
ld [hl], LOW(wce64) ; [wSerialDataPtr] ← $64
ld [hl], LOW(wPrinterPacket) ; [wSerialDataPtr] ← $64
inc hl
ld [hl], HIGH(wce64) ; [wSerialDataPtr] ← $ce
ld [hl], HIGH(wPrinterPacket) ; [wSerialDataPtr] ← $ce
call Func_0e8e
ld a, $1
ld [wce63], a ; [wce63] ← 1
call Func_31fc
.asm_315d
ld [wPrinterPacketSequence], a ; [wPrinterPacketSequence] ← 1
call SendNextPrinterPacketByte
.wait_printer_packet_transmission
call DoFrame
ld a, [wce63]
ld a, [wPrinterPacketSequence]
or a
jr nz, .asm_315d
jr nz, .wait_printer_packet_transmission
call ResetSerial
ld bc, 1500
.asm_316c
.post_transmission_delay
dec bc
ld a, b
or c
jr nz, .asm_316c
jr nz, .post_transmission_delay
ld a, [wce6e]
; we expect printer to send $81
; as the device number, any other value
; means that a second device in connected
ld a, [wSerialTransferData]
cp $81
jr nz, .asm_3182
jr nz, .unexpected_device_number
ld a, [wPrinterStatus]
ld l, a
and $f1
@@ -60,46 +70,53 @@ SendPrinterPacket:
scf
ret
.asm_3182
.unexpected_device_number
ld a, $ff
ld [wPrinterStatus], a
scf
ret
Func_3189:
ld hl, PointerTable_3190
; a = which sequence to execute
ExecutePrinterPacketSequence::
ld hl, .SequencePointers
dec a
jp JumpToFunctionInTable
PointerTable_3190:
dw Func_2fe7
dw Func_2fe7
dw Func_2fe7
dw Func_2fe7
dw Func_2fe7
dw Func_31b0
dw Func_31ca
dw Func_31dd
dw Func_31e5
dw Func_31ef
dw Func_31ea
dw Func_31f2
.SequencePointers:
; each entry corresponds to value in wPrinterPacketSequence
dw .SendPreambleOrHeaderByte ; 1: send wPrinterPacketPreamble + 1
dw .SendPreambleOrHeaderByte ; 2: send wPrinterPacketInstructions + 0
dw .SendPreambleOrHeaderByte ; 3: send wPrinterPacketInstructions + 1
dw .SendPreambleOrHeaderByte ; 4: send wPrinterPacketDataSize + 0
dw .SendPreambleOrHeaderByte ; 5: send wPrinterPacketDataSize + 1
dw .StartDataSection ; 6
dw .SendRestOfDataSection ; 7
dw .SendChecksumByte1 ; 8
dw .SendChecksumByte2 ; 9
dw .SendDummyByte ; 10
dw .GetDeviceNumber ; 11
dw .GetStatusAndFinishSequence ; 12
Func_2fe7:
call Func_31fc
Func_31ab:
ld hl, wce63
; send next byte and increment sequence
.SendPreambleOrHeaderByte:
call SendNextPrinterPacketByte
.increment_sequence
ld hl, wPrinterPacketSequence
inc [hl]
ret
Func_31b0:
call Func_31ab
ld hl, wce68
; check if there is data to send
; if so, then update serial data pointer
; otherwise, skip sending data section
.StartDataSection:
call .increment_sequence
ld hl, wPrinterPacketDataSize
ld a, [hli]
or [hl]
jr nz, .set_data_ptr
call Func_31ab
jr Func_31dd
; no data to send
call .increment_sequence
jr .SendChecksumByte1
.set_data_ptr
ld hl, wPrinterPacketDataPtr
@@ -111,47 +128,60 @@ Func_31b0:
ld [de], a
; fallthrough
Func_31ca:
call Func_31fc
ld hl, wce68
; sends next byte in data section
; only increment sequence when
; there are no more bytes to send
.SendRestOfDataSection:
call SendNextPrinterPacketByte
ld hl, wPrinterPacketDataSize
ld a, [hl]
dec [hl]
or a
jr nz, .asm_31d8
jr nz, .finish_data_section
inc hl
dec [hl]
dec hl
.asm_31d8
.finish_data_section
ld a, [hli]
or [hl]
jr z, Func_31ab
jr z, .increment_sequence
ret
Func_31dd:
ld a, [wce6c]
Func_31e0:
call Func_3212
jr Func_31ab
; sends first byte of checksum
.SendChecksumByte1:
ld a, [wPrinterPacketChecksum + 0]
.send_byte_and_increment_sequence
call SendByteThroughSerialData
jr .increment_sequence
Func_31e5:
ld a, [wce6d]
jr Func_31e0
; sends second byte of checksum
.SendChecksumByte2:
ld a, [wPrinterPacketChecksum + 1]
jr .send_byte_and_increment_sequence
Func_31ea:
; gets number of device, and sends a dummy byte
.GetDeviceNumber:
ldh a, [rSB]
ld [wce6e], a
Func_31ef:
xor a
jr Func_31e0
ld [wSerialTransferData], a
; fallthrough
Func_31f2:
; sends a dummy byte
.SendDummyByte:
xor a
jr .send_byte_and_increment_sequence
; gets the printer status, then finishes sequence
.GetStatusAndFinishSequence:
ldh a, [rSB]
ld [wPrinterStatus], a
xor a
ld [wce63], a
ld [wPrinterPacketSequence], a
ret
Func_31fc:
; sends byte pointed by wSerialDataPtr to printer
; then increments this pointer to point to next byte
; for next iteration, and adds byte value to checksum
SendNextPrinterPacketByte::
ld hl, wSerialDataPtr
ld e, [hl]
inc hl
@@ -163,7 +193,7 @@ Func_31fc:
ld [hl], e
ld e, a
ld hl, wce6c
ld hl, wPrinterPacketChecksum
add [hl]
ld [hli], a
ld a, $0
@@ -172,7 +202,8 @@ Func_31fc:
ld a, e
; fallthrough
Func_3212:
; a = byte to send through serial data transfer
SendByteThroughSerialData:
ldh [rSB], a
ld a, SC_INTERNAL
ldh [rSC], a
+8 -8
View File
@@ -90,7 +90,7 @@ ProcessSpecialTextCharacter::
call TerminateHalfWidthText
pop af
ld [wFontWidth], a
ldh a, [hffb0]
ldh a, [hffbb]
or a
jr nz, .skip_placing_tile
ld a, [hl]
@@ -146,7 +146,7 @@ SetupText::
ldh [hffa8], a
call InitTextFormat
xor a
ldh [hffb0], a
ldh [hffbb], a
ldh [hffa9], a
ld a, $88
ld [wTilePatternSelector], a
@@ -206,15 +206,15 @@ InitTextPrinting::
ret
; requests a text tile to be generated and prints it in the screen
; different modes depending on hffb0:
; hffb0 == $0: generate and place text tile
; hffb0 == $2 (bit 1 set): only generate text tile?
; hffb0 == $1 (bit 0 set): not even generate it, but just update text buffers?
; different modes depending on hffbb:
; hffbb == $0: generate and place text tile
; hffbb == $2 (bit 1 set): only generate text tile?
; hffbb == $1 (bit 0 set): not even generate it, but just update text buffers?
Func_22ca::
push hl
push de
push bc
ldh a, [hffb0]
ldh a, [hffbb]
and $1
jr nz, .asm_22ed
call Func_2325
@@ -223,7 +223,7 @@ Func_22ca::
jr nz, .done
call GenerateTextTile
.tile_already_exists
ldh a, [hffb0]
ldh a, [hffbb]
and $2
jr nz, .done
ldh a, [hffa9]
+6 -6
View File
@@ -99,12 +99,12 @@ SerialHandler:
push hl
push de
push bc
ld a, [wce63] ;
or a ;
jr z, .asm_d35 ; if [wce63] nonzero:
call $2fc8 ; Func_3189 ; ?
jr .done ; return
.asm_d35
ld a, [wPrinterPacketSequence] ;
or a ;
jr z, .not_printer_sequence ; if [wPrinterPacketSequence] nonzero:
call ExecutePrinterPacketSequence
jr .done ; return
.not_printer_sequence
ld a, [wSerialOp] ;
or a ;
jr z, .asm_d55 ; skip ahead if [wSerialOp] zero
+2 -2
View File
@@ -168,7 +168,7 @@ DrawRegularTextBox::
jr z, DrawRegularTextBoxCGB
; fallthrough
DrawRegularTextBoxDMG:
DrawRegularTextBoxDMG::
call DECoordToBGMap0Address
; top line (border) of the text box
ld a, SYM_BOX_TOP
@@ -197,7 +197,7 @@ ContinueDrawingTextBoxDMGorSGB:
; e = value of byte b
; a = value of bytes [1, b-1]
; b is supposed to be BG_MAP_WIDTH or smaller, else the stack would get corrupted
CopyLine:
CopyLine::
add sp, -BG_MAP_WIDTH
push hl
push bc
+6 -4
View File
@@ -82,15 +82,17 @@ LoadDuelDrawCardsScreenTiles::
ld b, $08
jp CopyFontsOrDuelGraphicsTiles
Func_1da5::
; load the face down basic / stage1 / stage2 card images shown in the check Pokemon screens
LoadDuelFaceDownCardTiles::
ld b, $10
jr Func_1da9.asm_1dab
jr LoadDuelCheckPokemonScreenTiles.got_num_tiles
Func_1da9::
; same as LoadDuelFaceDownCardTiles, plus also load the ACT / BPx tiles
LoadDuelCheckPokemonScreenTiles::
ld b, $24
; fallthrough
.asm_1dab
.got_num_tiles
ld hl, $4000
ld de, v0Tiles1 + $50 tiles
call CopyFontsOrDuelGraphicsTiles
+19 -15
View File
@@ -436,7 +436,7 @@ Func_32d8::
Func_32f6::
ldh a, [hKeysHeld]
and D_RIGHT | D_LEFT | D_UP | D_DOWN
and D_PAD
jr z, .set_carry
ld b, NORTH
bit D_UP_F, a
@@ -852,7 +852,7 @@ CallMappedFunction::
.loop_entries
ld a, [hli]
cp $ff
jr z, .set_carry
jr z, .not_found
cp c
jr nz, .next
ldh a, [hBankROM]
@@ -880,7 +880,7 @@ CallMappedFunction::
inc hl
jr .loop_entries
.set_carry
.not_found
scf
ret
@@ -2236,26 +2236,26 @@ Func_3c3d::
Func_3c42::
push af
call Func_3c55
farcall $7, $5fb9
call FinishQueuedAnimations
farcall Func_1dfb9
farcall Func_110b9
ld a, $01
ld [$dc57], a
ld [wdc57], a
pop af
ret
Func_3c55::
FinishQueuedAnimations::
push af
ld a, [$dc57]
ld a, [wdc57]
and a
jr z, .asm_3c60
farcall Func_110c2
.asm_3c60
xor a
ld [$dc57], a
ld [$dc5e], a
ld [$dc5f], a
farcall $7, $5fb9
ld [wdc57], a
ld [wdc5e + 0], a
ld [wdc5e + 1], a
farcall Func_1dfb9
pop af
ret
@@ -2348,14 +2348,14 @@ SetNoMusic::
pop af
ret
Func_3cfe::
CallPlaySFX::
call PlaySFX
ret
Func_3d02::
push af
xor a
call Func_3cfe
call CallPlaySFX
pop af
ret
@@ -2603,7 +2603,11 @@ Func_3e54::
farcall Func_10d40
ret
Func_3e5d::
; input
; a = scene ID (SCENE_* constant)
; b = base X position in tiles
; c = base Y position in tiles
EmptyScreenAndLoadScene::
push af
farcall ClearSpriteAnimsAndSetInitialGraphicsConfiguration
call EmptyScreen
+2 -2
View File
@@ -1,5 +1,5 @@
; set current dest VRAM bank to 0
BankswitchVRAM0:
BankswitchVRAM0::
push af
xor a
ldh [hBankVRAM], a
@@ -8,7 +8,7 @@ BankswitchVRAM0:
ret
; set current dest VRAM bank to 1
BankswitchVRAM1:
BankswitchVRAM1::
push af
ld a, $1
ldh [hBankVRAM], a
+12 -3
View File
@@ -88,7 +88,7 @@ hTemp_ffa0:: ; ffa2
ds $10
; hffa8 through hffb0 belong to the text engine
; hffa8 through hffbb belong to the text engine
hffa8:: ; ffb3
ds $1
@@ -122,9 +122,18 @@ hTextLineLength:: ; ffb9
hJapaneseSyllabary:: ; ffba
ds $1
hffb0:: ; ffbb
hffbb:: ; ffbb
ds $1
; unlike wCurMenuItem, this accounts for the scroll offset (wListScrollOffset)
hCurMenuItem:: ; ffbc
hCurScrollMenuItem:: ; ffbc
ds $1
hCurMenuItem:: ; ffbd
ds $1
hffbe:: ; ffbe
ds $1
hffbf:: ; ffbf
ds $1
+14 -8
View File
@@ -48,6 +48,8 @@ ROMX $09
"Bank 9"
ROMX $0c
"Bank c"
ROMX $0e
"Bank e"
ROMX $0f
"Bank f"
ROMX $10
@@ -221,28 +223,30 @@ WRAM0
"WRAM0 Serial Transfer"
org $cbda
"WRAM0 Duels 2"
org $cc01
"WRAM0 Duels 2@cc01"
org $cc29
"WRAM0 Duels 2@cc29"
org $cd5b
"WRAM0 2"
org $cdc2
"WRAM0 2@cdc2"
WRAMX 1
"WRAM1"
org $d0bf
"WRAM1@d0bf"
org $d0e3
"WRAM1@d0e3"
org $d393
"WRAM1@d393"
org $d0e1
"WRAM1@d0e1"
org $d380
"WRAM1@d380"
org $d4c8
"WRAM1@d4c8"
org $d54c
"WRAM1@d54c"
org $dc06
"WRAM1@dc06"
org $dd02
"WRAM1@dd02"
WRAMX 2
"WRAM2"
org $d58e
"WRAM2@d58e"
WRAMX 3
"WRAM3"
WRAMX 7
@@ -257,3 +261,5 @@ SRAM $01
"SRAM1"
SRAM $02
"SRAM2"
SRAM $03
"SRAM3"
+9
View File
@@ -38,3 +38,12 @@ MACRO retbc
push bc
ret
ENDM
MACRO cp16
ld a, d
cp HIGH(\1)
jr nz, :+
ld a, e
cp LOW(\1)
:
ENDM
+11
View File
@@ -118,6 +118,17 @@ MACRO textitem
tx \3 ; text ID
ENDM
; cursor x / cursor y / attribute / idx-up / idx-down / idx-right / idx-left
; idx-[direction] means the index to get when the input is in the direction.
; its attribute is used for drawing a flipped cursor.
MACRO cursor_transition
db \1, \2, \3
REPT 4
db \4
SHIFT
ENDR
ENDM
; key-value pairs
; for function maps
MACRO key_func
+4 -3
View File
@@ -4,7 +4,7 @@ MACRO card_data_struct
\1Name:: ds 2
\1Rarity:: ds 1
\1Set:: ds 1
ds 1 ; ???
\1Unk07:: ds 1 ; ???
\1ID:: ds 2
\1EffectCommands:: ; ds 2
\1HP:: ds 1
@@ -18,11 +18,12 @@ MACRO card_data_struct
\1Resistance:: ds 1
\1Category:: ds 2
\1PokedexNumber:: ds 1
\1Unknown1:: ds 1
\1Unk3a:: ds 1
\1Level:: ds 1
\1Length:: ds 2
\1Length:: ds 1
\1Weight:: ds 2
\1Description:: ds 2
ds 1
;\1Unknown2:: ds 1
ENDM
+3
View File
@@ -34,6 +34,9 @@ INCLUDE "engine/gbc_only_disclaimer.asm"
SECTION "Bank c", ROMX
INCLUDE "engine/bank0c.asm"
SECTION "Bank e", ROMX
INCLUDE "engine/bank0e.asm"
SECTION "Bank f", ROMX
INCLUDE "engine/bank0f.asm"
+15 -1
View File
@@ -66,7 +66,17 @@ ENDR
sCurrentlySelectedDeck:: ; b7a0
ds $1
ds $6
s0b7a1:: ; b7a1
ds $1
ds $1
; each bit represents whether the player has
; obtained a card from a given set
sBoosterPacksObtained:: ; b7a3
ds $1
ds $3
sCardAndDeckSaveDataEnd::
@@ -93,6 +103,10 @@ s1a100:: ; a100
SECTION "SRAM2", SRAM
SECTION "SRAM3", SRAM
; buffers used to temporary store gfx related data
; such as tiles or BG maps
sGfxBuffer0:: ; a000
+451 -44
View File
@@ -8,7 +8,7 @@ SECTION "WRAM0", WRAM0
UNION
wTempCardCollection:: ; c000
ds $100
ds CARD_COLLECTION_SIZE
NEXTU
@@ -33,8 +33,6 @@ wDecompressionSecondaryBufferStart:: ; c0ef
ENDU
ds $100
SECTION "WRAM0 Duels 1", WRAM0
wPlayerDuelVariables:: ; c200
@@ -299,6 +297,50 @@ wSerialRecvBuf:: ; cb9f
wSerialEnd:: ; cbbf
ds $1
; When we're viewing a card's information, the page we are currently at.
; For Pokemon cards, values from $1 to $6 (two pages for attack descriptions)
; For Energy cards, it's always $9
; For Trainer cards, $d or $e (two pages for trainer card descriptions)
; see CARDPAGE_* constants
wCardPageNumber:: ; cbc0
ds $1
ds $1
; selects a PLAY_AREA_* slot in order to display information related to it. used by functions
; such as PrintPlayAreaCardLocation, PrintPlayAreaCardInformation and PrintPlayAreaCardHeader
wCurPlayAreaSlot:: ; cbc2
; X position to display the attached energies, HP bar, and Pluspower/Defender icons
; obviously different for player and opponent side. used by DrawDuelHUD.
wHUDEnergyAndHPBarsX:: ; cbc2
ds $1
; current Y coordinate where some play area information is being printed at. used by functions
; such as PrintPlayAreaCardLocation, PrintPlayAreaCardInformation and PrintPlayAreaCardHeader
wCurPlayAreaY:: ; cbc3
; current Y coordinate where some play area information is being printed at. used by functions
; such as PrintPlayAreaCardLocation, PrintPlayAreaCardInformation and PrintPlayAreaCardHeader
wHUDEnergyAndHPBarsY:: ; cbc3
ds $1
ds $6
; CARDPAGETYPE_PLAY_AREA or CARDPAGETYPE_NOT_PLAY_AREA
; some of the elements displayed in a card page change depending on which value
wCardPageType:: ; cbca
ds $1
ds $5
; when viewing a card page, which keys (among B_BUTTON, D_UP, and D_DOWN) will exit the page,
; either to go back to the previous menu or list, or to load the card page of the card above/below it
wCardPageExitKeys:: ; cbd0
ds $1
SECTION "WRAM0 Duels 2", WRAM0
wOppRNG1:: ; cbda
@@ -318,7 +360,16 @@ wDuelReturnAddress:: ; cbdd
wTempSerialBuf:: ; cbe2
ds $8
SECTION "WRAM0 Duels 2@cc01", WRAM0
ds $13
wcbfd:: ; cbfd
ds $1
ds $2
; current duel is a [wDuelInitialPrizes]-prize match
wDuelInitialPrizes:: ; cc00
ds $1
wcc01:: ; cc01
ds $1
@@ -327,11 +378,16 @@ wcc01:: ; cc01
wDuelType:: ; cc02
ds $1
ds $6
ds $3
wGoopGasAttackActive:: ; cc06
ds $1
ds $2
; this holds the current opponent's deck minus 2 (that is, a *_DECK_ID constant),
; in order to account for the two unused pointers at the beginning of DeckPointers.
wOpponentDeckID:: ; cc0e
wOpponentDeckID:: ; cc09
ds $1
ds $1
@@ -353,7 +409,8 @@ wPlayerAttackingCardID:: ; cc0d
wIsPracticeDuel:: ; cc0f
ds $1
wcc10:: ; cc10
; index of special rules for this duel
wSpecialRule:: ; cc10
ds $1
ds $1
@@ -616,8 +673,6 @@ wCardPalettes:: ; cd7a
wCardAttrMap:: ; cd92
ds $30
SECTION "WRAM0 2@cdc2", WRAM0
; information about the text being currently processed, including font width,
; the rom bank, and the memory address of the next character to be printed.
; supports up to four nested texts (used with TX_RAM).
@@ -678,39 +733,30 @@ wcde5:: ; cde5
wCoinTossScreenTextID:: ; cde7
ds $2
wce63:: ; cde9
; which routine in ExecutePrinterPacketSequence to run
wPrinterPacketSequence:: ; cde9
ds $1
wce64:: ; cdea
ds $1
wPrinterPacket:: ; cdea
wce65:: ; cdeb
ds $1
wPrinterPacketPreamble::
ds $2
wce66:: ; cdec
ds $1
wPrinterPacketInstructions:: ; cdec
ds $2
wce67:: ; cded
ds $1
wce68:: ; cdee
ds $1
wce69:: ; cdef
ds $1
wPrinterPacketDataSize:: ; cdee
ds $2
; pointer to memory of data to send
; in the data packet to the printer
wPrinterPacketDataPtr:: ; cdf0
ds $2
wce6c:: ; cdf2
ds $1
wPrinterPacketChecksum:: ; cdf2
ds $2
wce6d:: ; cdf3
ds $1
wce6e:: ; cdf4
wSerialTransferData:: ; cdf4
ds $1
wPrinterStatus:: ; cdf5
@@ -721,7 +767,77 @@ wPrinterStatus:: ; cdf5
wSerialDataPtr:: ; cdf6
ds $2
ds $55
ds $10
wTempCardID_ce08:: ; ce08
ds $2
ds $2
wce0c:: ; ce0c
ds $1
ds $1
wVBlankFunctionTrampolineBackup:: ; ce0e
ds $2
wTempPrinterSRAM:: ; ce10
ds $1
wPrinterHorizontalOffset:: ; ce11
ds $1
; the count of some card ID in the deck to be printed
wPrinterCardCount:: ; ce12
ds $1
; total card count of list to be printed
wPrinterTotalCardCount:: ; ce13
ds $2
wCurPrinterCardType:: ; ce15
ds $1
; total card count of the current card type
; in list to be printed
wPrinterCurCardTypeCount:: ; ce16
ds $2
wPrinterNumCardTypes:: ; ce18
ds $2
; related to printer functions
; only written to but never read
wce98:: ; ce1a
ds $1
wPrinterContrastLevel:: ; ce1b
ds $1
ds $1
wPrinterNumberLineFeeds:: ; ce1d
ds $1
wPrintOnlyStarRarity:: ; ce1e
ds $1
; only used in unreferenced function Func_1a14b
; otherwise unused
wce9d:: ; ce1f
ds $1
wPrinterInitAttempts:: ; ce20
ds $1
wce9f:: ; ce21
ds $1
ds $2a
wce4c:: ; ce4c
ds $1
wWRAMBank:: ; ce4d
ds $1
@@ -766,7 +882,7 @@ wCursorYPosition:: ; d00e
wYDisplacementBetweenMenuItems:: ; d00f
ds $1
wNumMenuItems:: ; d010
wNumScrollMenuItems:: ; d010
ds $1
wCursorTile:: ; d011
@@ -828,7 +944,17 @@ wCheckMenuPlayAreaWhichDuelist:: ; d0bf
wCheckMenuPlayAreaWhichLayout:: ; d0c0
ds $1
ds $7
wd0c1:: ; d0c1
ds $1
; pointer to transition table data
wTransitionTablePtr:: ; d0c2
ds $2
wd0c4:: ; d0c4
ds $1
ds $3
; number of prize cards still to be
; picked by the player
@@ -842,31 +968,251 @@ wNumberOfPrizeCardsToSelect:: ; d0c8
wInPlayAreaFromSelectButton:: ; d0cf
ds $1
SECTION "WRAM1@d0e3", WRAMX
wd0d0:: ; d0d0
ds $1
; GLOSSARY_* constant
wGlossaryMenu:: ; d0d1
ds $1
wd0d2:: ; d0d2
ds $1
SECTION "WRAM1@d0e1", WRAMX
wScrollMenuScrollOffset:: ; d0e1
ds $1
ds $1
wScrollMenuCursorBlinkCounter:: ; d0e3
wNamingScreenCursorBlinkCounter:: ; d0e3
ds $1
; used to temporarily store wCurCardTypeFilter
; to check whether a new filter is to be applied
wTempCardTypeFilter:: ; d0e4
wCurScrollMenuItem:: ; d0e4
wNamingScreenCursorY:: ; d0e4
ds $1
ds $4
wMenuParams::
wMenuCursorXOffset:: ; d0e5
ds $1
wMenuCursorYOffset:: ; d0e6
ds $1
wMenuYSeparation:: ; d0e7
ds $1
wMenuXSeparation:: ; d0e8
ds $1
wNumMenuItems:: ; d0e9
wNamingScreenNumRows:: ; d0e9
ds $1
wVisibleCursorTile:: ; d0ea
wMenuVisibleCursorTile:: ; d0ea
ds $1
wInvisibleCursorTile:: ; d0eb
wMenuInvisibleCursorTile:: ; d0eb
ds $1
SECTION "WRAM1@d393", WRAMX
; if non-NULL, the function loaded here is called once per frame by HandleMenuInput
wMenuUpdateFunc:: ; d0ec
ds $2
wNamingScreenInputSFX:: ; d393
wMenuParamsEnd::
; number of cards that are listed
; in the current filtered list
wNumEntriesInCurFilter::
wBoosterPackCardListSize:: ; d0ee
ds $1
ds $3
ds $2
; deck selected by the player in the Decks screen
wCurDeck:: ; d0f1
ds $1
ds $4
; holds symbols for representing a number in decimal
; goes up in magnitude (first byte is ones place,
; second byte is tens place, etc) up to 5 digits
wDecimalDigitsSymbols:: ; d0f6
ds $5
UNION
; each of these stores the card count
; of each filter in the deck building screen
; the order follows CardTypeFilters
wCardFilterCounts:: ; d0fb
ds NUM_FILTERS
NEXTU
; represents which Booster Packs have been
; collected by the player in the Card Album
; - $0 is obtained
; - non-$0 is not obtained yet
wBoosterPackItems:: ; d0fb
ds NUM_CARD_SETS
ENDU
; buffer used to show which card IDs
; are visible in a given list
wVisibleListCardIDs:: ; d104
ds $e
; number of visible entries
; when showing a list of cards
wNumVisibleCardListEntries:: ; d112
ds $1
wTotalCardCount:: ; d113
ds $1
; is TRUE if list cannot be scrolled down
; past the last visible entry
wUnableToScrollDown:: ; d114
ds $1
wScrollMenuScrollFunc:: ; d115
ds $2
; holds y and x coordinates (in that order)
; of start of card list (top-left corner)
wCardListCoords:: ; d117
ds $2
wd119:: ; d119
ds $1
; the current filter being used
; from the CardTypeFilters list
wCurCardTypeFilter:: ; d11a
ds $1
; temporarily stores wCurMenuItem value
wTempCurMenuItem:: ; d11b
ds $1
ds $2
wced7:: ; d11e
ds $1
ds $1
; stores how many different cards there are in a deck
wNumUniqueCards:: ; d120
ds $1
wd121:: ; d121
ds $1
; cards that belong to a Booster Pack
; for showing in the Card Album
wBoosterPackCardList:: ; d122
; temporary card list for multiple purposes
wTempCardList:: ; d122
ds 2 * 80
ds $2
; holds cards for the current deck
wCurDeckCards:: ; d1c4
ds $a2
; list of all the different cards in a deck configuration
wUniqueDeckCardList:: ; d266
; stores the count number of cards owned
; can be 0 in the case that a card is not available
; i.e. already inside a built deck
wOwnedCardsCountList::
wBoosterPackCardCounts:: ; d266
ds $51
ds $29
; name of the selected deck
wCurDeckName:: ; d2e0
wBoosterPackCardListPrefixBuffer:: ; d2e0
ds DECK_NAME_SIZE
ds $6
wTempSavedDeckCards:: ; d2fe
ds 2 * DECK_SIZE
SECTION "WRAM1@d380", WRAMX
; max number of cards that are allowed
; to include when building a deck configuration
wMaxNumCardsAllowed:: ; d380
ds $1
wd381:: ; d381
ds $1
; max number of cards with same name that are allowed
; to be included when building a deck configuration
wSameNameCardsLimit:: ; d382
ds $1
ds $5
wCurCardListPtr:: ; d388
ds $1
ds $5
; the tile to draw in place of the cursor, in case
; the cursor is not to be drawn
wCursorAlternateTile:: ; d38e
ds $1
wTempScrollMenuNumVisibleItems:: ; d38f
ds $1
; which Booster Pack was selected
; in the Card Album menu
wCardAlbumBoosterPack:: ; d390
ds $1
wBoosterPackCardListNumItems:: ; d391
ds $1
wOwnedPhantomCards:: ; d392
ds $1
; value containing a SFX to play
; due to a menu input
wMenuInputSFX:: ; d393
ds $1
wSelectedPrinterMenuItem:: ; d394
ds $1
wFirstOwnedCardIndex:: ; d395
ds $1
wNumCardListEntries:: ; d396
ds $1
wNamingScreenBuffer:: ; d397
ds NAMING_SCREEN_BUFFER_LENGTH
@@ -903,6 +1249,53 @@ wNamingScreenMode:: ; d3eb
wd3ef:: ; d3ef
ds $1
ds $26
; pointers to all decks of current deck machine
wMachineDeckPtrs:: ; d416
ds 2 * NUM_DECK_SAVE_MACHINE_SLOTS
wNumSavedDecks:: ; d47a
ds $1
wTempScrollMenuItem:: ; d47b
ds $1
wTempScrollMenuScrollOffset:: ; d47c
ds $1
; which list entry was selected in the Deck Machine screen
wSelectedDeckMachineEntry:: ; d47d
ds $1
ds $19
wDeckMachineTitleText:: ; d497
ds $2
wNumDeckMachineEntries:: ; d499
ds $1
ds $1
wd49b:: ; d49b
ds $1
; text ID to print in the text box when
; inside the Deck Machine menu
wDeckMachineText:: ; d49c
ds $2
wd49e:: ; d49e
ds $1
wd49f:: ; d49f
ds $1
SECTION "WRAM1@d4c8", WRAMX
wd4c8:: ; d4c8
ds $80
SECTION "WRAM1@d54c", WRAMX
@@ -1355,7 +1748,7 @@ wTextBoxFrameColor:: ; d9d6
ds $5
wd9dc:: ; d9dc
wPCMenuCursorPosition:: ; d9dc
ds $1
; $0 = no fading
@@ -1800,6 +2193,16 @@ wde64:: ; de64
wde69:: ; de69
ds $2
SECTION "WRAM2", WRAMX
wScratchCardCollection:: ; d000
ds CARD_COLLECTION_SIZE
SECTION "WRAM2@d58e", WRAMX
w2d58e:: ; d58e
ds $80
SECTION "WRAM3", WRAMX
w3d000:: ; d000
@@ -1810,14 +2213,18 @@ w3d000:: ; d000
w3d400:: ; d400
ds $1
; pointers to BG map
w3d401:: ; d401
ds $1
ds $13
ds 2 * 10
w3d415:: ; d415
ds $1
ds $b0
w3d4c6:: ; d4c6
ds $415
SECTION "WRAM7 Audio", WRAMX
wSVBKBackup:: ; d000