pokecrystal-board/engine/menus/trainer_card.asm

614 lines
10 KiB
NASM
Raw Normal View History

; TrainerCard.Jumptable indexes
const_def
const TRAINERCARDSTATE_PAGE1_LOADGFX ; 0
const TRAINERCARDSTATE_PAGE1_JOYPAD ; 1
const TRAINERCARDSTATE_PAGE2_LOADGFX ; 2
const TRAINERCARDSTATE_PAGE2_JOYPAD ; 3
const TRAINERCARDSTATE_PAGE3_LOADGFX ; 4
const TRAINERCARDSTATE_PAGE3_JOYPAD ; 5
const TRAINERCARDSTATE_QUIT ; 6
2018-06-24 07:09:41 -07:00
TrainerCard:
2018-01-23 14:39:09 -08:00
ld a, [wVramState]
2015-11-17 12:54:03 -08:00
push af
xor a
2018-01-23 14:39:09 -08:00
ld [wVramState], a
ld hl, wOptions
2015-11-17 12:54:03 -08:00
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
2015-12-28 07:57:04 -08:00
call .InitRAM
.loop
2015-11-17 12:54:03 -08:00
call UpdateTime
call JoyTextDelay
ld a, [wJumptableIndex]
bit 7, a
2015-12-28 07:57:04 -08:00
jr nz, .quit
ldh a, [hJoyLast]
2015-11-17 12:54:03 -08:00
and B_BUTTON
2015-12-28 07:57:04 -08:00
jr nz, .quit
call .RunJumptable
2015-11-17 12:54:03 -08:00
call DelayFrame
2015-12-28 07:57:04 -08:00
jr .loop
.quit
2015-11-17 12:54:03 -08:00
pop af
2018-01-23 14:39:09 -08:00
ld [wOptions], a
2015-11-17 12:54:03 -08:00
pop af
2018-01-23 14:39:09 -08:00
ld [wVramState], a
2015-11-17 12:54:03 -08:00
ret
2018-06-24 07:09:41 -07:00
.InitRAM:
2015-11-17 12:54:03 -08:00
call ClearBGPalettes
call ClearSprites
call ClearTileMap
call DisableLCD
2017-12-24 09:47:30 -08:00
farcall GetCardPic
2015-11-17 12:54:03 -08:00
ld hl, CardRightCornerGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $1c
2015-11-17 12:54:03 -08:00
ld bc, 1 tiles
ld a, BANK(CardRightCornerGFX)
call FarCopyBytes
ld hl, CardStatusGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $29
2015-12-28 07:57:04 -08:00
ld bc, 86 tiles
2015-11-17 12:54:03 -08:00
ld a, BANK(CardStatusGFX)
call FarCopyBytes
2015-12-28 07:57:04 -08:00
call TrainerCard_PrintTopHalfOfCard
2015-11-17 12:54:03 -08:00
hlcoord 0, 8
2015-12-28 07:57:04 -08:00
ld d, 6
call TrainerCard_InitBorder
2015-11-17 12:54:03 -08:00
call EnableLCD
call WaitBGMap
2015-12-28 07:57:04 -08:00
ld b, SCGB_TRAINER_CARD
2015-11-17 12:54:03 -08:00
call GetSGBLayout
call SetPalettes
call WaitBGMap
ld hl, wJumptableIndex
xor a ; TRAINERCARDSTATE_PAGE1_LOADGFX
ld [hli], a ; wJumptableIndex
ld [hli], a ; wTrainerCardBadgeFrameCounter
ld [hli], a ; wTrainerCardBadgeTileID
ld [hl], a ; wTrainerCardBadgeAttributes
2015-11-17 12:54:03 -08:00
ret
2018-06-24 07:09:41 -07:00
.RunJumptable:
2015-12-28 07:57:04 -08:00
jumptable .Jumptable, wJumptableIndex
2015-11-17 12:54:03 -08:00
2018-06-24 07:09:41 -07:00
.Jumptable:
; entries correspond to TRAINERCARDSTATE_* constants
2015-12-28 07:57:04 -08:00
dw TrainerCard_Page1_LoadGFX
dw TrainerCard_Page1_Joypad
dw TrainerCard_Page2_LoadGFX
dw TrainerCard_Page2_Joypad
dw TrainerCard_Page3_LoadGFX
dw TrainerCard_Page3_Joypad
dw TrainerCard_Quit
2015-11-17 12:54:03 -08:00
2018-06-24 07:09:41 -07:00
TrainerCard_IncrementJumptable:
2015-11-17 12:54:03 -08:00
ld hl, wJumptableIndex
inc [hl]
ret
2018-06-24 07:09:41 -07:00
TrainerCard_Quit:
2015-11-17 12:54:03 -08:00
ld hl, wJumptableIndex
set 7, [hl]
ret
2018-06-24 07:09:41 -07:00
TrainerCard_Page1_LoadGFX:
2015-11-17 12:54:03 -08:00
call ClearSprites
hlcoord 0, 8
2015-12-28 07:57:04 -08:00
ld d, 6
call TrainerCard_InitBorder
2015-11-17 12:54:03 -08:00
call WaitBGMap
ld de, CardStatusGFX
2017-12-28 04:32:33 -08:00
ld hl, vTiles2 tile $29
2015-12-28 07:57:04 -08:00
lb bc, BANK(CardStatusGFX), 86
2015-11-17 12:54:03 -08:00
call Request2bpp
2015-12-28 07:57:04 -08:00
call TrainerCard_Page1_PrintDexCaught_GameTime
call TrainerCard_IncrementJumptable
2015-11-17 12:54:03 -08:00
ret
2018-06-24 07:09:41 -07:00
TrainerCard_Page1_Joypad:
2015-12-28 07:57:04 -08:00
call TrainerCard_Page1_PrintGameTime
2015-11-17 12:54:03 -08:00
ld hl, hJoyLast
ld a, [hl]
and D_RIGHT | A_BUTTON
jr nz, .pressed_right_a
ret
.pressed_right_a
ld a, TRAINERCARDSTATE_PAGE2_LOADGFX
2015-11-17 12:54:03 -08:00
ld [wJumptableIndex], a
ret
2018-01-02 07:04:21 -08:00
.Unreferenced_KantoCheck:
ld a, [wKantoBadges]
2015-11-17 12:54:03 -08:00
and a
ret z
ld a, TRAINERCARDSTATE_PAGE3_LOADGFX
2015-11-17 12:54:03 -08:00
ld [wJumptableIndex], a
ret
2015-12-28 07:57:04 -08:00
2018-06-24 07:09:41 -07:00
TrainerCard_Page2_LoadGFX:
2015-11-17 12:54:03 -08:00
call ClearSprites
hlcoord 0, 8
2015-12-28 07:57:04 -08:00
ld d, 6
call TrainerCard_InitBorder
2015-11-17 12:54:03 -08:00
call WaitBGMap
ld de, LeaderGFX
2017-12-28 04:32:33 -08:00
ld hl, vTiles2 tile $29
2018-01-14 16:43:35 -08:00
lb bc, BANK(LeaderGFX), 86
2015-11-17 12:54:03 -08:00
call Request2bpp
ld de, BadgeGFX
2017-12-28 04:32:33 -08:00
ld hl, vTiles0 tile $00
2018-01-14 16:43:35 -08:00
lb bc, BANK(BadgeGFX), 44
2015-11-17 12:54:03 -08:00
call Request2bpp
2015-12-28 07:57:04 -08:00
call TrainerCard_Page2_3_InitObjectsAndStrings
call TrainerCard_IncrementJumptable
2015-11-17 12:54:03 -08:00
ret
2018-06-24 07:09:41 -07:00
TrainerCard_Page2_Joypad:
2015-12-28 07:57:04 -08:00
ld hl, TrainerCard_JohtoBadgesOAM
call TrainerCard_Page2_3_AnimateBadges
2015-11-17 12:54:03 -08:00
ld hl, hJoyLast
ld a, [hl]
and A_BUTTON
2015-12-28 07:57:04 -08:00
jr nz, .Quit
2015-11-17 12:54:03 -08:00
ld a, [hl]
and D_LEFT
2015-12-28 07:57:04 -08:00
jr nz, .d_left
2015-11-17 12:54:03 -08:00
ret
2015-12-28 07:57:04 -08:00
.d_left
ld a, TRAINERCARDSTATE_PAGE1_LOADGFX
2015-11-17 12:54:03 -08:00
ld [wJumptableIndex], a
ret
2018-01-02 07:04:21 -08:00
.Unreferenced_KantoCheck:
ld a, [wKantoBadges]
2015-11-17 12:54:03 -08:00
and a
ret z
ld a, TRAINERCARDSTATE_PAGE3_LOADGFX
2015-11-17 12:54:03 -08:00
ld [wJumptableIndex], a
ret
.Quit:
ld a, TRAINERCARDSTATE_QUIT
2015-11-17 12:54:03 -08:00
ld [wJumptableIndex], a
ret
2018-06-24 07:09:41 -07:00
TrainerCard_Page3_LoadGFX:
2015-11-17 12:54:03 -08:00
call ClearSprites
hlcoord 0, 8
2015-12-28 07:57:04 -08:00
ld d, 6
call TrainerCard_InitBorder
2015-11-17 12:54:03 -08:00
call WaitBGMap
ld de, LeaderGFX2
2017-12-28 04:32:33 -08:00
ld hl, vTiles2 tile $29
2018-01-14 16:43:35 -08:00
lb bc, BANK(LeaderGFX2), 86
2015-11-17 12:54:03 -08:00
call Request2bpp
ld de, BadgeGFX2
2017-12-28 04:32:33 -08:00
ld hl, vTiles0 tile $00
2018-01-14 16:43:35 -08:00
lb bc, BANK(BadgeGFX2), 44
2015-11-17 12:54:03 -08:00
call Request2bpp
2015-12-28 07:57:04 -08:00
call TrainerCard_Page2_3_InitObjectsAndStrings
call TrainerCard_IncrementJumptable
2015-11-17 12:54:03 -08:00
ret
2018-06-24 07:09:41 -07:00
TrainerCard_Page3_Joypad:
2015-12-28 07:57:04 -08:00
ld hl, TrainerCard_JohtoBadgesOAM
call TrainerCard_Page2_3_AnimateBadges
2015-11-17 12:54:03 -08:00
ld hl, hJoyLast
ld a, [hl]
and D_LEFT
2015-11-17 14:56:49 -08:00
jr nz, .left
2015-11-17 12:54:03 -08:00
ld a, [hl]
and D_RIGHT
2015-11-17 14:56:49 -08:00
jr nz, .right
2015-11-17 12:54:03 -08:00
ret
2015-11-17 14:56:49 -08:00
.left
ld a, TRAINERCARDSTATE_PAGE2_LOADGFX
2015-11-17 12:54:03 -08:00
ld [wJumptableIndex], a
ret
2015-11-17 14:56:49 -08:00
.right
ld a, TRAINERCARDSTATE_PAGE1_LOADGFX
2015-11-17 12:54:03 -08:00
ld [wJumptableIndex], a
ret
2018-06-24 07:09:41 -07:00
TrainerCard_PrintTopHalfOfCard:
2015-11-17 12:54:03 -08:00
hlcoord 0, 0
2015-12-28 07:57:04 -08:00
ld d, 5
call TrainerCard_InitBorder
2015-11-17 12:54:03 -08:00
hlcoord 2, 2
2015-12-28 07:57:04 -08:00
ld de, .Name_Money
2015-11-17 12:54:03 -08:00
call PlaceString
hlcoord 2, 4
2015-12-28 07:57:04 -08:00
ld de, .ID_No
call TrainerCardSetup_PlaceTilemapString
2015-11-17 12:54:03 -08:00
hlcoord 7, 2
2018-01-23 14:39:09 -08:00
ld de, wPlayerName
2015-11-17 12:54:03 -08:00
call PlaceString
hlcoord 5, 4
2018-01-23 14:39:09 -08:00
ld de, wPlayerID
2015-11-17 12:54:03 -08:00
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
hlcoord 7, 6
2018-01-23 14:39:09 -08:00
ld de, wMoney
2015-11-17 12:54:03 -08:00
lb bc, PRINTNUM_MONEY | 3, 6
call PrintNum
hlcoord 1, 3
2015-12-28 07:57:04 -08:00
ld de, .HorizontalDivider
call TrainerCardSetup_PlaceTilemapString
2015-11-17 12:54:03 -08:00
hlcoord 14, 1
lb bc, 5, 7
xor a
ldh [hGraphicStartTile], a
predef PlaceGraphic
2015-11-17 12:54:03 -08:00
ret
2015-12-28 07:57:04 -08:00
2018-06-24 07:09:41 -07:00
.Name_Money:
2015-11-17 12:54:03 -08:00
db "NAME/"
next ""
next "MONEY@"
2018-06-24 07:09:41 -07:00
.ID_No:
db $27, $28, -1 ; ID NO
2015-11-17 12:54:03 -08:00
2018-06-24 07:09:41 -07:00
.HorizontalDivider:
db $25, $25, $25, $25, $25, $25, $25, $25, $25, $25, $25, $25, $26, -1 ; ____________>
2015-11-17 12:54:03 -08:00
2018-06-24 07:09:41 -07:00
TrainerCard_Page1_PrintDexCaught_GameTime:
2015-11-17 12:54:03 -08:00
hlcoord 2, 10
2015-12-28 07:57:04 -08:00
ld de, .Dex_PlayTime
2015-11-17 12:54:03 -08:00
call PlaceString
hlcoord 10, 15
2015-12-28 07:57:04 -08:00
ld de, .Badges
2015-11-17 12:54:03 -08:00
call PlaceString
2018-01-23 14:39:09 -08:00
ld hl, wPokedexCaught
ld b, wEndPokedexCaught - wPokedexCaught
2015-11-17 12:54:03 -08:00
call CountSetBits
ld de, wNumSetBits
2015-11-17 12:54:03 -08:00
hlcoord 15, 10
lb bc, 1, 3
call PrintNum
2015-12-28 07:57:04 -08:00
call TrainerCard_Page1_PrintGameTime
2015-11-17 12:54:03 -08:00
hlcoord 2, 8
2015-12-28 07:57:04 -08:00
ld de, .StatusTilemap
call TrainerCardSetup_PlaceTilemapString
ld a, [wStatusFlags]
2018-01-22 12:40:43 -08:00
bit STATUSFLAGS_POKEDEX_F, a
2015-11-17 12:54:03 -08:00
ret nz
hlcoord 1, 9
lb bc, 2, 17
call ClearBox
ret
.Dex_PlayTime:
2015-11-17 12:54:03 -08:00
db "#DEX"
next "PLAY TIME@"
db "@" ; unused
2015-11-17 12:54:03 -08:00
.Badges:
2015-11-17 12:54:03 -08:00
db " BADGESâ–¶@"
2018-06-24 07:09:41 -07:00
.StatusTilemap:
db $29, $2a, $2b, $2c, $2d, -1
2015-11-17 12:54:03 -08:00
2018-06-24 07:09:41 -07:00
TrainerCard_Page2_3_InitObjectsAndStrings:
2015-11-17 12:54:03 -08:00
hlcoord 2, 8
2015-12-28 07:57:04 -08:00
ld de, .BadgesTilemap
call TrainerCardSetup_PlaceTilemapString
2015-11-17 12:54:03 -08:00
hlcoord 2, 10
ld a, $29
2015-12-28 07:57:04 -08:00
ld c, 4
.loop
call TrainerCard_Page2_3_PlaceLeadersFaces
2015-11-17 12:54:03 -08:00
rept 4
inc hl
endr
dec c
2015-12-28 07:57:04 -08:00
jr nz, .loop
2015-11-17 12:54:03 -08:00
hlcoord 2, 13
ld a, $51
2015-12-28 07:57:04 -08:00
ld c, 4
.loop2
call TrainerCard_Page2_3_PlaceLeadersFaces
2015-11-17 12:54:03 -08:00
rept 4
inc hl
endr
dec c
2015-12-28 07:57:04 -08:00
jr nz, .loop2
2015-11-17 12:54:03 -08:00
xor a
ld [wTrainerCardBadgeFrameCounter], a
2015-12-28 07:57:04 -08:00
ld hl, TrainerCard_JohtoBadgesOAM
call TrainerCard_Page2_3_OAMUpdate
2015-11-17 12:54:03 -08:00
ret
2015-12-28 07:57:04 -08:00
2018-06-24 07:09:41 -07:00
.BadgesTilemap:
db $79, $7a, $7b, $7c, $7d, -1 ; "BADGES"
2015-11-17 12:54:03 -08:00
2018-06-24 07:09:41 -07:00
TrainerCardSetup_PlaceTilemapString:
2015-12-28 07:57:04 -08:00
.loop
2015-11-17 12:54:03 -08:00
ld a, [de]
cp -1
2015-11-17 12:54:03 -08:00
ret z
ld [hli], a
inc de
2015-12-28 07:57:04 -08:00
jr .loop
2015-11-17 12:54:03 -08:00
2018-06-24 07:09:41 -07:00
TrainerCard_InitBorder:
ld e, SCREEN_WIDTH
2015-12-28 07:57:04 -08:00
.loop1
2015-11-17 12:54:03 -08:00
ld a, $23
ld [hli], a
dec e
2015-12-28 07:57:04 -08:00
jr nz, .loop1
2015-11-17 12:54:03 -08:00
ld a, $23
ld [hli], a
ld e, SCREEN_HEIGHT - 1
2015-12-28 07:57:04 -08:00
ld a, " "
.loop2
2015-11-17 12:54:03 -08:00
ld [hli], a
dec e
2015-12-28 07:57:04 -08:00
jr nz, .loop2
2015-11-17 12:54:03 -08:00
ld a, $1c
ld [hli], a
ld a, $23
ld [hli], a
2015-12-28 07:57:04 -08:00
.loop3
2015-11-17 12:54:03 -08:00
ld a, $23
ld [hli], a
2015-12-28 07:57:04 -08:00
ld e, SCREEN_HEIGHT
2015-12-28 07:57:04 -08:00
ld a, " "
.loop4
2015-11-17 12:54:03 -08:00
ld [hli], a
dec e
2015-12-28 07:57:04 -08:00
jr nz, .loop4
2015-11-17 12:54:03 -08:00
ld a, $23
ld [hli], a
dec d
2015-12-28 07:57:04 -08:00
jr nz, .loop3
2015-11-17 12:54:03 -08:00
ld a, $23
ld [hli], a
ld a, $24
ld [hli], a
2015-12-28 07:57:04 -08:00
ld e, SCREEN_HEIGHT - 1
2015-12-28 07:57:04 -08:00
ld a, " "
.loop5
2015-11-17 12:54:03 -08:00
ld [hli], a
dec e
2015-12-28 07:57:04 -08:00
jr nz, .loop5
2015-11-17 12:54:03 -08:00
ld a, $23
ld [hli], a
ld e, SCREEN_WIDTH
2015-12-28 07:57:04 -08:00
.loop6
2015-11-17 12:54:03 -08:00
ld a, $23
ld [hli], a
dec e
2015-12-28 07:57:04 -08:00
jr nz, .loop6
2015-11-17 12:54:03 -08:00
ret
2018-06-24 07:09:41 -07:00
TrainerCard_Page2_3_PlaceLeadersFaces:
2015-11-17 12:54:03 -08:00
push de
push hl
ld [hli], a
inc a
ld [hli], a
inc a
ld [hli], a
inc a
ld [hli], a
inc a
2015-12-28 07:57:04 -08:00
ld de, SCREEN_WIDTH - 3
2015-11-17 12:54:03 -08:00
add hl, de
ld [hli], a
inc a
ld [hli], a
inc a
ld [hli], a
inc a
2015-12-28 07:57:04 -08:00
ld de, SCREEN_WIDTH - 3
2015-11-17 12:54:03 -08:00
add hl, de
ld [hli], a
inc a
ld [hli], a
inc a
ld [hli], a
inc a
pop hl
pop de
ret
2018-06-24 07:09:41 -07:00
TrainerCard_Page1_PrintGameTime:
2015-11-17 12:54:03 -08:00
hlcoord 11, 12
2018-01-23 14:39:09 -08:00
ld de, wGameTimeHours
2015-11-17 12:54:03 -08:00
lb bc, 2, 4
call PrintNum
inc hl
2018-01-23 14:39:09 -08:00
ld de, wGameTimeMinutes
2015-11-17 12:54:03 -08:00
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNum
ldh a, [hVBlankCounter]
2015-11-17 12:54:03 -08:00
and $1f
ret nz
hlcoord 15, 12
ld a, [hl]
xor " " ^ $2e ; alternate between space and small colon ($2e) tiles
2015-11-17 12:54:03 -08:00
ld [hl], a
ret
2018-06-24 07:09:41 -07:00
TrainerCard_Page2_3_AnimateBadges:
ldh a, [hVBlankCounter]
and %111
2015-11-17 12:54:03 -08:00
ret nz
ld a, [wTrainerCardBadgeFrameCounter]
2015-11-17 12:54:03 -08:00
inc a
and %111
ld [wTrainerCardBadgeFrameCounter], a
2015-12-28 07:57:04 -08:00
jr TrainerCard_Page2_3_OAMUpdate
2015-11-17 12:54:03 -08:00
2018-06-24 07:09:41 -07:00
TrainerCard_Page2_3_OAMUpdate:
2015-11-17 14:56:49 -08:00
; copy flag array pointer
2015-11-17 12:54:03 -08:00
ld a, [hli]
ld e, a
ld a, [hli]
2015-11-17 14:56:49 -08:00
; get flag array
2015-11-17 12:54:03 -08:00
ld d, a
ld a, [de]
ld c, a
2018-01-30 11:52:46 -08:00
ld de, wVirtualOAMSprite00
2018-01-10 10:47:57 -08:00
ld b, NUM_JOHTO_BADGES
2015-11-17 14:56:49 -08:00
.loop
2015-11-17 12:54:03 -08:00
srl c
push bc
2015-11-17 14:56:49 -08:00
jr nc, .skip_badge
2015-11-17 12:54:03 -08:00
push hl
2015-11-17 14:56:49 -08:00
ld a, [hli] ; y
2015-11-17 12:54:03 -08:00
ld b, a
2015-11-17 14:56:49 -08:00
ld a, [hli] ; x
2015-11-17 12:54:03 -08:00
ld c, a
2015-11-17 14:56:49 -08:00
ld a, [hli] ; pal
ld [wTrainerCardBadgeAttributes], a
ld a, [wTrainerCardBadgeFrameCounter]
2015-11-17 12:54:03 -08:00
add l
ld l, a
ld a, 0
adc h
ld h, a
ld a, [hl]
ld [wTrainerCardBadgeTileID], a
2015-12-28 07:57:04 -08:00
call .PrepOAM
2015-11-17 12:54:03 -08:00
pop hl
2015-11-17 14:56:49 -08:00
.skip_badge
ld bc, $b ; 3 + 2 * 4
2015-11-17 12:54:03 -08:00
add hl, bc
pop bc
dec b
2015-11-17 14:56:49 -08:00
jr nz, .loop
2015-11-17 12:54:03 -08:00
ret
2018-06-24 07:09:41 -07:00
.PrepOAM:
ld a, [wTrainerCardBadgeTileID]
and 1 << 7
2015-11-17 14:56:49 -08:00
jr nz, .xflip
ld hl, .facing1
2015-12-28 07:57:04 -08:00
jr .loop2
2015-11-17 14:56:49 -08:00
.xflip
ld hl, .facing2
2015-12-28 07:57:04 -08:00
.loop2
2015-11-17 12:54:03 -08:00
ld a, [hli]
2018-01-10 10:47:57 -08:00
cp -1
2015-11-17 12:54:03 -08:00
ret z
add b
2018-01-10 10:47:57 -08:00
ld [de], a ; y
2015-11-17 12:54:03 -08:00
inc de
2015-11-17 14:56:49 -08:00
2015-11-17 12:54:03 -08:00
ld a, [hli]
add c
2018-01-10 10:47:57 -08:00
ld [de], a ; x
2015-11-17 12:54:03 -08:00
inc de
2015-11-17 14:56:49 -08:00
ld a, [wTrainerCardBadgeTileID]
and $ff ^ (1 << 7)
2015-11-17 12:54:03 -08:00
add [hl]
2018-01-10 10:47:57 -08:00
ld [de], a ; tile id
2015-11-17 12:54:03 -08:00
inc hl
inc de
2015-11-17 14:56:49 -08:00
ld a, [wTrainerCardBadgeAttributes]
2015-11-17 12:54:03 -08:00
add [hl]
2018-01-10 10:47:57 -08:00
ld [de], a ; attributes
2015-11-17 12:54:03 -08:00
inc hl
inc de
2015-12-28 07:57:04 -08:00
jr .loop2
2018-06-24 07:09:41 -07:00
.facing1
2018-01-10 10:47:57 -08:00
dsprite 0, 0, 0, 0, $00, 0
dsprite 0, 0, 1, 0, $01, 0
dsprite 1, 0, 0, 0, $02, 0
dsprite 1, 0, 1, 0, $03, 0
2015-11-17 14:56:49 -08:00
db -1
2018-06-24 07:09:41 -07:00
.facing2
2018-01-10 10:47:57 -08:00
dsprite 0, 0, 0, 0, $01, 0 | X_FLIP
dsprite 0, 0, 1, 0, $00, 0 | X_FLIP
dsprite 1, 0, 0, 0, $03, 0 | X_FLIP
dsprite 1, 0, 1, 0, $02, 0 | X_FLIP
2015-11-17 14:56:49 -08:00
db -1
2015-11-17 12:54:03 -08:00
2018-06-24 07:09:41 -07:00
TrainerCard_JohtoBadgesOAM:
2015-11-17 12:54:03 -08:00
; Template OAM data for each badge on the trainer card.
; Format:
; y, x, palette
; cycle 1: face tile, in1 tile, in2 tile, in3 tile
; cycle 2: face tile, in1 tile, in2 tile, in3 tile
dw wJohtoBadges
2015-11-17 12:54:03 -08:00
; Zephyrbadge
2015-11-17 14:56:49 -08:00
db $68, $18, 0
db $00, $20, $24, $20 | (1 << 7)
db $00, $20, $24, $20 | (1 << 7)
2015-11-17 12:54:03 -08:00
; Hivebadge
2015-11-17 14:56:49 -08:00
db $68, $38, 0
db $04, $20, $24, $20 | (1 << 7)
db $04, $20, $24, $20 | (1 << 7)
2015-11-17 12:54:03 -08:00
; Plainbadge
2015-11-17 14:56:49 -08:00
db $68, $58, 0
db $08, $20, $24, $20 | (1 << 7)
db $08, $20, $24, $20 | (1 << 7)
2015-11-17 12:54:03 -08:00
; Fogbadge
2015-11-17 14:56:49 -08:00
db $68, $78, 0
db $0c, $20, $24, $20 | (1 << 7)
db $0c, $20, $24, $20 | (1 << 7)
2015-11-17 12:54:03 -08:00
; Mineralbadge
2015-11-17 14:56:49 -08:00
db $80, $38, 0
db $10, $20, $24, $20 | (1 << 7)
db $10, $20, $24, $20 | (1 << 7)
2015-11-17 12:54:03 -08:00
; Stormbadge
2015-11-17 14:56:49 -08:00
db $80, $18, 0
db $14, $20, $24, $20 | (1 << 7)
db $14, $20, $24, $20 | (1 << 7)
2015-11-17 12:54:03 -08:00
; Glacierbadge
2015-11-17 14:56:49 -08:00
db $80, $58, 0
db $18, $20, $24, $20 | (1 << 7)
db $18, $20, $24, $20 | (1 << 7)
2015-11-17 12:54:03 -08:00
; Risingbadge
; X-flips on alternate cycles.
2015-11-17 14:56:49 -08:00
db $80, $78, 0
db $1c, $20, $24, $20 | (1 << 7)
db $1c | (1 << 7), $20, $24, $20 | (1 << 7)
2015-11-17 12:54:03 -08:00
CardStatusGFX: INCBIN "gfx/trainer_card/card_status.2bpp"
2015-11-17 12:54:03 -08:00
LeaderGFX: INCBIN "gfx/trainer_card/leaders.2bpp"
LeaderGFX2: INCBIN "gfx/trainer_card/leaders.2bpp"
BadgeGFX: INCBIN "gfx/trainer_card/badges.2bpp"
BadgeGFX2: INCBIN "gfx/trainer_card/badges.2bpp"
2015-11-17 12:54:03 -08:00
CardRightCornerGFX: INCBIN "gfx/trainer_card/card_right_corner.2bpp"