Dummy Game

This commit is contained in:
PikalaxALT 2015-12-28 17:09:53 -05:00
parent 57d4cb0edf
commit a2a2668233
15 changed files with 539 additions and 514 deletions

View File

@ -88,6 +88,17 @@
const POKEDEX_SHOW_7 ; $56 const POKEDEX_SHOW_7 ; $56
const POKEDEX_SHOW_8 ; $57 const POKEDEX_SHOW_8 ; $57
const_def
const MAPRADIO_POKEMON_CHANNEL
const MAPRADIO_OAKS_MON_TALK
const MAPRADIO_POKEDEX_SHOW
const MAPRADIO_PKMN_MUSIC
const MAPRADIO_LUCKY_CHANNEL
const MAPRADIO_UNOWN
const MAPRADIO_PLACES_PEOPLE
const MAPRADIO_LETS_ALL_SING
const MAPRADIO_ROCKET
const_def const_def
const BUENA_MON const BUENA_MON
const BUENA_ITEM const BUENA_ITEM

View File

@ -349,22 +349,22 @@ MAX_OUTDOOR_SPRITES EQU 23
const FACING_1F const FACING_1F
const_def const_def
const SPRITEANIMSTRUCT_INDEX const SPRITEANIMSTRUCT_INDEX ; 0
const SPRITEANIMSTRUCT_FRAMESET_ID const SPRITEANIMSTRUCT_FRAMESET_ID ; 1
const SPRITEANIMSTRUCT_ANIM_SEQ_ID const SPRITEANIMSTRUCT_ANIM_SEQ_ID ; 2
const SPRITEANIMSTRUCT_TILE_ID const SPRITEANIMSTRUCT_TILE_ID ; 3
const SPRITEANIMSTRUCT_XCOORD const SPRITEANIMSTRUCT_XCOORD ; 4
const SPRITEANIMSTRUCT_YCOORD const SPRITEANIMSTRUCT_YCOORD ; 5
const SPRITEANIMSTRUCT_XOFFSET const SPRITEANIMSTRUCT_XOFFSET ; 6
const SPRITEANIMSTRUCT_YOFFSET const SPRITEANIMSTRUCT_YOFFSET ; 7
const SPRITEANIMSTRUCT_DURATION const SPRITEANIMSTRUCT_DURATION ; 8
const SPRITEANIMSTRUCT_DURATIONOFFSET const SPRITEANIMSTRUCT_DURATIONOFFSET ; 9
const SPRITEANIMSTRUCT_FRAME const SPRITEANIMSTRUCT_FRAME ; a
const SPRITEANIMSTRUCT_0B const SPRITEANIMSTRUCT_0B ; b
const SPRITEANIMSTRUCT_0C const SPRITEANIMSTRUCT_0C ; c
const SPRITEANIMSTRUCT_0D const SPRITEANIMSTRUCT_0D ; d
const SPRITEANIMSTRUCT_0E const SPRITEANIMSTRUCT_0E ; e
const SPRITEANIMSTRUCT_0F const SPRITEANIMSTRUCT_0F ; f
const_def const_def
const SPRITE_ANIM_FRAMESET_00 const SPRITE_ANIM_FRAMESET_00

View File

@ -1,12 +1,12 @@
_DummyGame: ; e1e5b (38:5e5b) _DummyGame: ; e1e5b (38:5e5b)
call Functione1e67 call .LoadGFXAndPals
call DelayFrame call DelayFrame
.asm_e1e61 .loop
call Functione1ebb call .JumptableLoop
jr nc, .asm_e1e61 jr nc, .loop
ret ret
Functione1e67: ; e1e67 (38:5e67) .LoadGFXAndPals
call DisableLCD call DisableLCD
ld b, SCGB_08 ld b, SCGB_08
call GetSGBLayout call GetSGBLayout
@ -16,7 +16,7 @@ Functione1e67: ; e1e67 (38:5e67)
call Decompress call Decompress
ld hl, Unknown_e00ed ld hl, Unknown_e00ed
ld de, VTiles0 tile $00 ld de, VTiles0 tile $00
ld bc, $40 ld bc, 4 tiles
ld a, BANK(Unknown_e00ed) ld a, BANK(Unknown_e00ed)
call FarCopyBytes call FarCopyBytes
ld a, $8 ld a, $8
@ -42,403 +42,397 @@ Functione1e67: ; e1e67 (38:5e67)
call DmgToCgbObjPal0 call DmgToCgbObjPal0
ret ret
Functione1ebb: ; e1ebb (38:5ebb) .JumptableLoop
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
bit 7, a bit 7, a
jr nz, .asm_e1ed0 jr nz, .quit
call Functione1ed2 call .ExecuteJumptable
callab PlaySpriteAnimations callab PlaySpriteAnimations
call DelayFrame call DelayFrame
and a and a
ret ret
.asm_e1ed0
.quit
scf scf
ret ret
Functione1ed2: ; e1ed2 (38:5ed2) .ExecuteJumptable
ld a, [wJumptableIndex] jumptable .Jumptable, wJumptableIndex
ld e, a
ld d, 0
ld hl, Jumptable_e1ee1
rept 2
add hl, de
endr
ld a, [hli]
ld h, [hl]
ld l, a
jp [hl]
; e1ee1 (38:5ee1)
Jumptable_e1ee1: ; e1ee1 .Jumptable
dw Functione1ef3 dw .RestartGame
dw Functione1efb dw .ResetBoard
dw Functione1f1c dw .InitBoardTilemapAndCursorObject
dw Functione1f42 dw .CheckTriesRemaining
dw Functione1f61 dw .PickCard1
dw Functione1f8b dw .PickCard2
dw Functione1fba dw .DelayPickAgain
dw Functione1fcc dw .RevealAll
dw Functione2000 dw .AskPlayAgain
; e1ef3
Functione1ef3: ; e1ef3 .RestartGame
call Functione2152 call DummyGame_InitStrings
ld hl, wJumptableIndex ld hl, wJumptableIndex
inc [hl] inc [hl]
ret ret
; e1efb
Functione1efb: ; e1efb .ResetBoard
call ret_e00ed call ret_e00ed
jr nc, .asm_e1f06 jr nc, .proceed
ld hl, wJumptableIndex ld hl, wJumptableIndex
set 7, [hl] set 7, [hl]
ret ret
.asm_e1f06 .proceed
call Functione209d call DummyGame_InitBoard
ld hl, wJumptableIndex ld hl, wJumptableIndex
inc [hl] inc [hl]
xor a xor a
ld [wc708], a ld [wDummyGameCounter], a
ld hl, wc703 ld hl, wDummyGameLastMatches
rept 4 rept 4
ld [hli], a ld [hli], a
endr endr
ld [hl], a ld [hl], a
ld [wc709], a ld [wDummyGameNumCardsMatched], a
.InitBoardTilemapAndCursorObject
Functione1f1c: ; e1f1c ld hl, wDummyGameCounter
ld hl, wc708
ld a, [hl] ld a, [hl]
cp $2d cp 45
jr nc, .asm_e1f30 jr nc, .spawn_object
inc [hl] inc [hl]
call Functione2183 call DummyGame_Card2Coord
xor a xor a
ld [wc6fd], a ld [wDummyGameLastCardPicked], a
call Functione2128 call DummyGame_PlaceCard
ret ret
.asm_e1f30 .spawn_object
ld de, $341c depixel 6, 3, 4, 4
ld a, $c ld a, SPRITE_ANIM_INDEX_0C
call _InitSpriteAnimStruct call _InitSpriteAnimStruct
ld a, $5 ld a, 5
ld [wc702], a ld [wDummyGameNumberTriesRemaining], a
ld hl, wJumptableIndex ld hl, wJumptableIndex
inc [hl] inc [hl]
ret ret
; e1f42
Functione1f42: ; e1f42 .CheckTriesRemaining
ld a, [wc702] ld a, [wDummyGameNumberTriesRemaining]
hlcoord 17, 0 hlcoord 17, 0
add $f6 add "0"
ld [hl], a ld [hl], a
ld hl, wc702 ld hl, wDummyGameNumberTriesRemaining
ld a, [hl] ld a, [hl]
and a and a
jr nz, .asm_e1f58 jr nz, .next_try
ld a, $7 ld a, $7
ld [wJumptableIndex], a ld [wJumptableIndex], a
ret ret
.asm_e1f58 .next_try
dec [hl] dec [hl]
xor a xor a
ld [wcf64], a ld [wcf64], a
ld hl, wJumptableIndex ld hl, wJumptableIndex
inc [hl] inc [hl]
.PickCard1
Functione1f61: ; e1f61
ld a, [wcf64] ld a, [wcf64]
and a and a
ret z ret z
dec a dec a
ld e, a ld e, a
ld d, $0 ld d, 0
ld hl, wc6d0 ld hl, wDummyGameCards
add hl, de add hl, de
ld a, [hl] ld a, [hl]
cp $ff cp -1
ret z ret z
ld [wc6fd], a ld [wDummyGameLastCardPicked], a
ld [wPlayerMinimized], a ld [wDummyGameCard1], a
ld a, e ld a, e
ld [EnemyScreens], a ld [wDummyGameCard1Location], a
call Functione2183 call DummyGame_Card2Coord
call Functione2128 call DummyGame_PlaceCard
xor a xor a
ld [wcf64], a ld [wcf64], a
ld hl, wJumptableIndex ld hl, wJumptableIndex
inc [hl] inc [hl]
ret ret
; e1f8b
Functione1f8b: ; e1f8b .PickCard2
ld a, [wcf64] ld a, [wcf64]
and a and a
ret z ret z
dec a dec a
ld hl, EnemyScreens ld hl, wDummyGameCard1Location
cp [hl] cp [hl]
ret z ret z
ld e, a ld e, a
ld d, $0 ld d, 0
ld hl, wc6d0 ld hl, wDummyGameCards
add hl, de add hl, de
ld a, [hl] ld a, [hl]
cp $ff cp -1
ret z ret z
ld [wc6fd], a ld [wDummyGameLastCardPicked], a
ld [PlayerScreens], a ld [wDummyGameCard2], a
ld a, e ld a, e
ld [wc701], a ld [wDummyGameCard2Location], a
call Functione2183 call DummyGame_Card2Coord
call Functione2128 call DummyGame_PlaceCard
ld a, $40 ld a, 64
ld [wc708], a ld [wDummyGameCounter], a
ld hl, wJumptableIndex ld hl, wJumptableIndex
inc [hl] inc [hl]
.DelayPickAgain
Functione1fba: ; e1fba ld hl, wDummyGameCounter
ld hl, wc708
ld a, [hl] ld a, [hl]
and a and a
jr z, .asm_e1fc3 jr z, .PickAgain
dec [hl] dec [hl]
ret ret
.asm_e1fc3 .PickAgain
call Functione2010 call DummyGame_CheckMatch
ld a, $3 ld a, $3
ld [wJumptableIndex], a ld [wJumptableIndex], a
ret ret
; e1fcc
Functione1fcc: ; e1fcc .RevealAll
ld a, [hJoypadPressed] ld a, [hJoypadPressed]
and A_BUTTON and A_BUTTON
ret z ret z
xor a xor a
ld [wc708], a ld [wDummyGameCounter], a
.asm_e1fd5 .RevelationLoop
ld hl, wc708 ld hl, wDummyGameCounter
ld a, [hl] ld a, [hl]
cp $2d cp 45
jr nc, .asm_e1ff9 jr nc, .finish_round
inc [hl] inc [hl]
push af push af
call Functione2183 call DummyGame_Card2Coord
pop af pop af
push hl push hl
ld e, a ld e, a
ld d, $0 ld d, $0
ld hl, wc6d0 ld hl, wDummyGameCards
add hl, de add hl, de
ld a, [hl] ld a, [hl]
pop hl pop hl
cp $ff cp -1
jr z, .asm_e1fd5 jr z, .RevelationLoop
ld [wc6fd], a ld [wDummyGameLastCardPicked], a
call Functione2128 call DummyGame_PlaceCard
jr .asm_e1fd5 jr .RevelationLoop
.asm_e1ff9 .finish_round
call WaitPressAorB_BlinkCursor call WaitPressAorB_BlinkCursor
ld hl, wJumptableIndex ld hl, wJumptableIndex
inc [hl] inc [hl]
.AskPlayAgain
Functione2000: ; e2000
call ret_e00ed call ret_e00ed
jr nc, .asm_e200b jr nc, .restart
ld hl, wJumptableIndex ld hl, wJumptableIndex
set 7, [hl] set 7, [hl]
ret ret
.asm_e200b .restart
xor a xor a
ld [wJumptableIndex], a ld [wJumptableIndex], a
ret ret
; e2010 ; e2010
Functione2010: ; e2010 DummyGame_CheckMatch: ; e2010
ld hl, wPlayerMinimized ld hl, wDummyGameCard1
ld a, [hli] ld a, [hli]
cp [hl] cp [hl]
jr nz, .asm_e2066 jr nz, .no_match
ld a, [EnemyScreens]
call Functione2183 ld a, [wDummyGameCard1Location]
call Functione2142 call DummyGame_Card2Coord
ld a, [wc701] call DummyGame_DeleteCard
call Functione2183
call Functione2142 ld a, [wDummyGameCard2Location]
ld a, [EnemyScreens] call DummyGame_Card2Coord
call DummyGame_DeleteCard
ld a, [wDummyGameCard1Location]
ld e, a ld e, a
ld d, $0 ld d, $0
ld hl, wc6d0 ld hl, wDummyGameCards
add hl, de add hl, de
ld [hl], $ff ld [hl], -1
ld a, [wc701]
ld a, [wDummyGameCard2Location]
ld e, a ld e, a
ld d, $0 ld d, 0
ld hl, wc6d0 ld hl, wDummyGameCards
add hl, de add hl, de
ld [hl], $ff ld [hl], -1
ld hl, wc703
.asm_e2044 ld hl, wDummyGameLastMatches
.find_empty_slot
ld a, [hli] ld a, [hli]
and a and a
jr nz, .asm_e2044 jr nz, .find_empty_slot
dec hl dec hl
ld a, [wPlayerMinimized] ld a, [wDummyGameCard1]
ld [hl], a ld [hl], a
ld [wc6fd], a ld [wDummyGameLastCardPicked], a
ld hl, wc709 ld hl, wDummyGameNumCardsMatched
ld e, [hl] ld e, [hl]
rept 2
inc [hl] inc [hl]
endr inc [hl]
ld d, $0 ld d, 0
hlcoord 5, 0 hlcoord 5, 0
add hl, de add hl, de
call Functione2128 call DummyGame_PlaceCard
ld hl, UnknownText_0xe2083 ld hl, .VictoryText
call PrintText call PrintText
ret ret
.asm_e2066 .no_match
xor a xor a
ld [wc6fd], a ld [wDummyGameLastCardPicked], a
ld a, [EnemyScreens]
call Functione2183 ld a, [wDummyGameCard1Location]
call Functione2128 call DummyGame_Card2Coord
ld a, [wc701] call DummyGame_PlaceCard
call Functione2183
call Functione2128 ld a, [wDummyGameCard2Location]
ld hl, UnknownText_0xe2098 call DummyGame_Card2Coord
call DummyGame_PlaceCard
ld hl, DummyGameText_Darn
call PrintText call PrintText
ret ret
; e2083
UnknownText_0xe2083: ; 0xe2083 .VictoryText
start_asm start_asm
; 0xe2084
Functione2084: ; e2084
push bc push bc
hlcoord 2, 13 hlcoord 2, 13
call Functione2128 call DummyGame_PlaceCard
ld hl, UnknownText_0xe2093 ld hl, DummyGameText_Yeah
pop bc pop bc
rept 3
inc bc inc bc
endr inc bc
inc bc
ret ret
; e2093 ; e2093
UnknownText_0xe2093: ; 0xe2093 DummyGameText_Yeah: ; 0xe2093
; , yeah! ; , yeah!
text_jump UnknownText_0x1c1a5b text_jump UnknownText_0x1c1a5b
db "@" db "@"
; 0xe2098 ; 0xe2098
UnknownText_0xe2098: ; 0xe2098 DummyGameText_Darn: ; 0xe2098
; Darn… ; Darn…
text_jump UnknownText_0x1c1a65 text_jump UnknownText_0x1c1a65
db "@" db "@"
; 0xe209d ; 0xe209d
Functione209d: ; e209d DummyGame_InitBoard: ; e209d
ld hl, wc6d0 ld hl, wDummyGameCards
ld bc, $2d ld bc, wDummyGameCardsEnd - wDummyGameCards
xor a xor a
call ByteFill call ByteFill
call Functione2101 call DummyGame_GetDistributionOfTiles
ld c, $2
ld c, 2
ld b, [hl] ld b, [hl]
call Functione20e5 call DummyGame_SampleTilePlacement
ld c, $8
ld c, 8
ld b, [hl] ld b, [hl]
call Functione20e5 call DummyGame_SampleTilePlacement
ld c, $4
ld c, 4
ld b, [hl] ld b, [hl]
call Functione20e5 call DummyGame_SampleTilePlacement
ld c, $7
ld c, 7
ld b, [hl] ld b, [hl]
call Functione20e5 call DummyGame_SampleTilePlacement
ld c, $3
ld c, 3
ld b, [hl] ld b, [hl]
call Functione20e5 call DummyGame_SampleTilePlacement
ld c, $6
ld c, 6
ld b, [hl] ld b, [hl]
call Functione20e5 call DummyGame_SampleTilePlacement
ld c, $1
ld c, 1
ld b, [hl] ld b, [hl]
call Functione20e5 call DummyGame_SampleTilePlacement
ld c, $5
ld hl, wc6d0 ld c, 5
ld b, $2d ld hl, wDummyGameCards
.asm_e20db ld b, wDummyGameCardsEnd - wDummyGameCards
.loop
ld a, [hl] ld a, [hl]
and a and a
jr nz, .asm_e20e0 jr nz, .no_load
ld [hl], c ld [hl], c
.no_load
.asm_e20e0
inc hl inc hl
dec b dec b
jr nz, .asm_e20db jr nz, .loop
ret ret
; e20e5 ; e20e5
Functione20e5: ; e20e5 DummyGame_SampleTilePlacement: ; e20e5
push hl push hl
ld de, wc6d0 ld de, wDummyGameCards
.asm_e20e9 .loop
call Random call Random
and $3f and %00111111
cp $2d cp 45
jr nc, .asm_e20e9 jr nc, .loop
ld l, a ld l, a
ld h, $0 ld h, 0
add hl, de add hl, de
ld a, [hl] ld a, [hl]
and a and a
jr nz, .asm_e20e9 jr nz, .loop
ld [hl], c ld [hl], c
dec b dec b
jr nz, .asm_e20e9 jr nz, .loop
pop hl pop hl
inc hl inc hl
ret ret
; e2101 ; e2101
Functione2101: ; e2101 DummyGame_GetDistributionOfTiles: ; e2101
ld a, [wMenuCursorY] ld a, [wMenuCursorY]
dec a dec a
ld l, a ld l, a
ld h, 0 ld h, 0
rept 3
add hl, hl add hl, hl
endr add hl, hl
ld de, Unknown_e2110 add hl, hl
ld de, .distributions
add hl, de add hl, de
ret ret
; e2110
Unknown_e2110: ; e2110 .distributions
db $02, $03, $06, $06, $06, $08, $08, $06 db $02, $03, $06, $06, $06, $08, $08, $06
db $02, $02, $04, $06, $06, $08, $08, $09 db $02, $02, $04, $06, $06, $08, $08, $09
db $02, $02, $02, $04, $07, $08, $08, $0c db $02, $02, $02, $04, $07, $08, $08, $0c
; e2128 ; e2128
Functione2128: ; e2128 DummyGame_PlaceCard: ; e2128
ld a, [wc6fd] ld a, [wDummyGameLastCardPicked]
sla a sla a
sla a sla a
add $4 add 4
ld [hli], a ld [hli], a
inc a inc a
ld [hld], a ld [hld], a
@ -451,9 +445,10 @@ Functione2128: ; e2128
ld c, 3 ld c, 3
call DelayFrames call DelayFrames
ret ret
; e2142 ; e2142
Functione2142: ; e2142 DummyGame_DeleteCard: ; e2142
ld a, $1 ld a, $1
ld [hli], a ld [hli], a
ld [hld], a ld [hld], a
@ -464,60 +459,61 @@ Functione2142: ; e2142
ld c, 3 ld c, 3
call DelayFrames call DelayFrames
ret ret
; e2152 ; e2152
Functione2152: ; e2152 DummyGame_InitStrings: ; e2152
hlcoord 0, 0 hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, $1 ld a, $1
call ByteFill call ByteFill
hlcoord 0, 0 hlcoord 0, 0
ld de, String_e2177 ld de, .japstr1
call PlaceString call PlaceString
hlcoord 15, 0 hlcoord 15, 0
ld de, String_e217d ld de, .japstr2
call PlaceString call PlaceString
ld hl, UnknownText_0xe2176 ld hl, .dummy_text
call PrintText call PrintText
ret ret
; e2176
UnknownText_0xe2176: ; 0xe2176 .dummy_text
db "@" db "@"
; 0xe2177 .japstr1
db "とったもの@"
String_e2177: db "とったもの@" .japstr2
String_e217d: db "あと かい@" db "あと かい@"
; e2183 ; e2183
Functione2183: ; e2183 DummyGame_Card2Coord: ; e2183
ld d, $0 ld d, 0
.asm_e2185 .find_row
sub $9 sub 9
jr c, .asm_e218c jr c, .found_row
inc d inc d
jr .asm_e2185 jr .find_row
.asm_e218c .found_row
add $9 add 9
ld e, a ld e, a
hlcoord 1, 2 hlcoord 1, 2
ld bc, $28 ld bc, 2 * SCREEN_WIDTH
.asm_e2195 .loop2
ld a, d ld a, d
and a and a
jr z, .asm_e219d jr z, .done
add hl, bc add hl, bc
dec d dec d
jr .asm_e2195 jr .loop2
.asm_e219d .done
sla e sla e
add hl, de add hl, de
ret ret
; e21a1 ; e21a1
Functione21a1: ; e21a1 (38:61a1) DummyGame_InterpretJoypad_AnimateCursor: ; e21a1 (38:61a1)
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
cp $7 cp $7
jr nc, .quit jr nc, .quit
@ -541,13 +537,13 @@ Functione21a1: ; e21a1 (38:61a1)
ret ret
.quit .quit
ld hl, 0 ld hl, SPRITEANIMSTRUCT_INDEX
add hl, bc add hl, bc
ld [hl], $0 ld [hl], $0
ret ret
.pressed_a .pressed_a
ld hl, $c ld hl, SPRITEANIMSTRUCT_0C
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
inc a inc a
@ -555,60 +551,61 @@ Functione21a1: ; e21a1 (38:61a1)
ret ret
.pressed_left .pressed_left
ld hl, $6 ld hl, SPRITEANIMSTRUCT_XOFFSET
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
and a and a
ret z ret z
sub $10 sub 1 tiles
ld [hl], a ld [hl], a
ld hl, $c ld hl, SPRITEANIMSTRUCT_0C
add hl, bc add hl, bc
dec [hl] dec [hl]
ret ret
.pressed_right .pressed_right
ld hl, $6 ld hl, SPRITEANIMSTRUCT_XOFFSET
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
cp $80 cp (9 - 1) tiles
ret z ret z
add $10 add 1 tiles
ld [hl], a ld [hl], a
ld hl, $c ld hl, SPRITEANIMSTRUCT_0C
add hl, bc add hl, bc
inc [hl] inc [hl]
ret ret
.pressed_up .pressed_up
ld hl, $7 ld hl, SPRITEANIMSTRUCT_YOFFSET
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
and a and a
ret z ret z
sub $10 sub 1 tiles
ld [hl], a ld [hl], a
ld hl, $c ld hl, SPRITEANIMSTRUCT_0C
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
sub $9 sub 9
ld [hl], a ld [hl], a
ret ret
.pressed_down .pressed_down
ld hl, $7 ld hl, SPRITEANIMSTRUCT_YOFFSET
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
cp $40 cp (5 - 1) tiles
ret z ret z
add $10 add 1 tiles
ld [hl], a ld [hl], a
ld hl, $c ld hl, SPRITEANIMSTRUCT_0C
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
add $9 add 9
ld [hl], a ld [hl], a
ret ret
; e2221 (38:6221) ; e2221 (38:6221)
LZ_e2221: ; e2221 LZ_e2221: ; e2221

View File

@ -27,7 +27,7 @@ SendMailToPC: ; 4456e
call ByteFill call ByteFill
ld a, MON_ITEM ld a, MON_ITEM
call GetPartyParamLocation call GetPartyParamLocation
ld [hl], $0 ld [hl], 0
ld hl, sMailboxCount ld hl, sMailboxCount
inc [hl] inc [hl]
call CloseSRAM call CloseSRAM
@ -355,7 +355,7 @@ InitMail: ; 0x447b9
ret ret
; 0x447da ; 0x447da
Function447da: ; 0x447da MailboxPC_GetMailAuthor: ; 0x447da
dec a dec a
ld hl, sMailbox1Author ld hl, sMailbox1Author
ld bc, MAIL_STRUCT_LENGTH ld bc, MAIL_STRUCT_LENGTH
@ -373,10 +373,10 @@ Function447da: ; 0x447da
ret ret
; 0x447fb ; 0x447fb
Function447fb: ; 0x447fb MailboxPC_PrintMailAuthor: ; 0x447fb
push de push de
ld a, [MenuSelection] ld a, [MenuSelection]
call Function447da call MailboxPC_GetMailAuthor
pop hl pop hl
jp PlaceString jp PlaceString
; 0x44806 ; 0x44806
@ -384,11 +384,11 @@ Function447fb: ; 0x447fb
MailboxPC: ; 0x44806 MailboxPC: ; 0x44806
xor a xor a
ld [OBPals + 8 * 6], a ld [OBPals + 8 * 6], a
ld a, $1 ld a, 1
ld [wCurMessageIndex], a ld [wCurMessageIndex], a
.loop .loop
call InitMail call InitMail
ld hl, MenuData4494c ld hl, .TopMenuDataHeader
call CopyMenuDataHeader call CopyMenuDataHeader
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
@ -406,9 +406,9 @@ MailboxPC: ; 0x44806
ld [wCurMessageIndex], a ld [wCurMessageIndex], a
ld a, [wMenuJoypad] ld a, [wMenuJoypad]
cp $2 cp B_BUTTON
jr z, .exit jr z, .exit
call Function4484a call .Submenu
jr .loop jr .loop
.exit .exit
@ -416,18 +416,18 @@ MailboxPC: ; 0x44806
ret ret
; 0x4484a ; 0x4484a
Function4484a: ; 0x4484a .Submenu: ; 0x4484a
ld hl, MenuData44964 ld hl, .SubMenuDataHeader
call LoadMenuDataHeader call LoadMenuDataHeader
call VerticalMenu call VerticalMenu
call ExitMenu call ExitMenu
jr c, .exit jr c, .subexit
ld a, [wMenuCursorY] ld a, [wMenuCursorY]
dec a dec a
ld hl, .JumpTable ld hl, .JumpTable
rst JumpTable rst JumpTable
.exit .subexit
ret ret
; 0x44861 ; 0x44861
@ -455,7 +455,7 @@ Function4484a: ; 0x4484a
ld a, [MenuSelection] ld a, [MenuSelection]
dec a dec a
call .GetMailType call .GetMailType
ld a, $1 ld a, 1
ld [wItemQuantityChangeBuffer], a ld [wItemQuantityChangeBuffer], a
ld hl, NumItems ld hl, NumItems
call ReceiveItem call ReceiveItem
@ -557,30 +557,30 @@ Function4484a: ; 0x4484a
.Cancel .Cancel
ret ret
MenuData4494c: ; 0x4494c .TopMenuDataHeader: ; 0x4494c
db %01000000 ; flags db %01000000 ; flags
db 1, 8 ; start coords db 1, 8 ; start coords
db 10, 18 ; end coords db 10, 18 ; end coords
dw .MenuData2 dw .TopMenuData2
db 1 ; default option db 1 ; default option
.MenuData2 .TopMenuData2
db %00010000 ; flags db %00010000 ; flags
db 4, 0 ; rows/columns? db 4, 0 ; rows/columns?
db 1 ; horizontal spacing? db 1 ; horizontal spacing?
dbw 0, wMailboxCount ; text pointer dbw 0, wMailboxCount ; text pointer
dba Function447fb dba MailboxPC_PrintMailAuthor
dbw 0,0 dba NULL
dbw 0,0 dba NULL
MenuData44964: ; 0x44964 .SubMenuDataHeader: ; 0x44964
db %01000000 ; flags db %01000000 ; flags
db 0, 0 ; start coords db 0, 0 ; start coords
db 9, $d ; end coords db 9, 13 ; end coords
dw .MenuData2 dw .SubMenuData2
db 1 ; default option db 1 ; default option
.MenuData2 .SubMenuData2
db %10000000 ; flags db %10000000 ; flags
db 4 ; items db 4 ; items
db "READ MAIL@" db "READ MAIL@"

View File

@ -413,7 +413,7 @@ DoAnimFrame: ; 8d24b
ret ret
.fourteen: ; 8d47c (23:547c) .fourteen: ; 8d47c (23:547c)
callab Functione21a1 callab DummyGame_InterpretJoypad_AnimateCursor
ret ret
.sixteen: ; 8d483 (23:5483) .sixteen: ; 8d483 (23:5483)

View File

@ -202,7 +202,7 @@ HomepageScript:
Radio1Script: Radio1Script:
opentext opentext
writebyte $0 writebyte MAPRADIO_POKEMON_CHANNEL
special MapRadio special MapRadio
closetext closetext
end end
@ -210,7 +210,7 @@ Radio1Script:
Radio2Script: Radio2Script:
; Lucky Channel ; Lucky Channel
opentext opentext
writebyte $4 writebyte MAPRADIO_LUCKY_CHANNEL
special MapRadio special MapRadio
closetext closetext
end end
@ -1807,59 +1807,59 @@ GameCornerCoinVendorScript: ; 0xbcdcd
CoinVendor_IntroScript: ; 0xbcde0 CoinVendor_IntroScript: ; 0xbcde0
farwritetext CoinVendor_IntroText farwritetext CoinVendor_IntroText
CoinVendor_SellCoinsMenuScript: ; 0xbcde4 .loop: ; 0xbcde4
special Special_DisplayMoneyAndCoinBalance special Special_DisplayMoneyAndCoinBalance
loadmenudata CoinVendor_MenuDataHeader loadmenudata .MenuDataHeader
verticalmenu verticalmenu
closewindow closewindow
if_equal $1, CoinVendor_Buy50CoinsScript if_equal $1, .Buy50
if_equal $2, CoinVendor_Buy500CoinsScript if_equal $2, .Buy500
jump CoinVendor_CancelScript jump .Cancel
; 0xbcdf7 ; 0xbcdf7
CoinVendor_Buy50CoinsScript: ; 0xbcdf7 .Buy50: ; 0xbcdf7
checkcoins 9949 checkcoins 9949
if_equal $0, CoinVendor_CoinCaseFullScript if_equal $0, .CoinCaseFull
checkmoney $0, 1000 checkmoney $0, 1000
if_equal $2, CoinVendor_NotEnoughMoneyScript if_equal $2, .NotEnoughMoney
givecoins 50 givecoins 50
takemoney $0, 1000 takemoney $0, 1000
waitsfx waitsfx
playsound SFX_TRANSACTION playsound SFX_TRANSACTION
farwritetext CoinVendor_Buy50CoinsText farwritetext CoinVendor_Buy50CoinsText
waitbutton waitbutton
jump CoinVendor_SellCoinsMenuScript jump .loop
; 0xbce1b ; 0xbce1b
CoinVendor_Buy500CoinsScript: ; 0xbce1b .Buy500: ; 0xbce1b
checkcoins 9499 checkcoins 9499
if_equal $0, CoinVendor_CoinCaseFullScript if_equal $0, .CoinCaseFull
checkmoney $0, 10000 checkmoney $0, 10000
if_equal $2, CoinVendor_NotEnoughMoneyScript if_equal $2, .NotEnoughMoney
givecoins 500 givecoins 500
takemoney $0, 10000 takemoney $0, 10000
waitsfx waitsfx
playsound SFX_TRANSACTION playsound SFX_TRANSACTION
farwritetext CoinVendor_Buy500CoinsText farwritetext CoinVendor_Buy500CoinsText
waitbutton waitbutton
jump CoinVendor_SellCoinsMenuScript jump .loop
; 0xbce3f ; 0xbce3f
CoinVendor_NotEnoughMoneyScript: ; 0xbce3f .NotEnoughMoney: ; 0xbce3f
farwritetext CoinVendor_NotEnoughMoneyText farwritetext CoinVendor_NotEnoughMoneyText
waitbutton waitbutton
closetext closetext
end end
; 0xbce46 ; 0xbce46
CoinVendor_CoinCaseFullScript: ; 0xbce46 .CoinCaseFull: ; 0xbce46
farwritetext CoinVendor_CoinCaseFullText farwritetext CoinVendor_CoinCaseFullText
waitbutton waitbutton
closetext closetext
end end
; 0xbce4d ; 0xbce4d
CoinVendor_CancelScript: ; 0xbce4d .Cancel: ; 0xbce4d
farwritetext CoinVendor_CancelText farwritetext CoinVendor_CancelText
waitbutton waitbutton
closetext closetext
@ -1867,15 +1867,14 @@ CoinVendor_CancelScript: ; 0xbce4d
; 0xbce54 ; 0xbce54
CoinVendor_MenuDataHeader: ; 0xbce54 .MenuDataHeader
db $40 ; flags db $40 ; flags
db 04, 00 ; start coords db 04, 00 ; start coords
db 11, 15 ; end coords db 11, 15 ; end coords
dw CoinVendor_MenuData2 dw .MenuData2
db 1 ; default option db 1 ; default option
; 0xbce5c
CoinVendor_MenuData2: ; 0xbce5c .MenuData2
db $80 ; flags db $80 ; flags
db 3 ; items db 3 ; items
db " 50 : ¥1000@" db " 50 : ¥1000@"

170
home.asm
View File

@ -1984,173 +1984,3 @@ ReinitSpriteAnimFrame:: ; 3b3c
INCLUDE "home/audio.asm" INCLUDE "home/audio.asm"
INCLUDE "home/mobile.asm" INCLUDE "home/mobile.asm"
Function3eea:: ; 3eea
push hl
push bc
ld de, AttrMap - TileMap
add hl, de
inc b
inc b
inc c
inc c
call Function3f35
pop bc
pop hl
call Function3f47
ret
; 3efd
Function3efd:: ; 3efd
push hl
hlcoord 0, 12
ld b, 4
ld c, 18
call Function3f0d
pop hl
call PrintTextBoxText
ret
; 3f0d
Function3f0d:: ; 3f0d
push hl
push bc
ld de, AttrMap - TileMap
add hl, de
inc b
inc b
inc c
inc c
call Function3f35
pop bc
pop hl
call TextBoxBorder
ret
; 3f20
Function3f20:: ; 3f20
hlcoord 0, 0, AttrMap
ld b, $6
ld c, $14
call Function3f35
hlcoord 0, 0
ld b, $4
ld c, $12
call Function3f47
ret
; 3f35
Function3f35:: ; 3f35
ld a, $6
ld de, $0014
.asm_3f3a
push bc
push hl
.asm_3f3c
ld [hli], a
dec c
jr nz, .asm_3f3c
pop hl
add hl, de
pop bc
dec b
jr nz, .asm_3f3a
ret
; 3f47
Function3f47:: ; 3f47
push bc
call Function3f58
pop bc
.asm_3f4c
push bc
call Function3f68
pop bc
dec b
jr nz, .asm_3f4c
call Function3f60
ret
; 3f58
Function3f58:: ; 3f58
ld a, $63
ld d, $62
ld e, $64
jr Function3f6e
Function3f60:: ; 3f60
ld a, $68
ld d, $67
ld e, $69
jr Function3f6e
Function3f68:: ; 3f68
ld a, $7f
ld d, $65
ld e, $66
Function3f6e:: ; 3f6e
push hl
ld [hl], d
inc hl
.asm_3f71
ld [hli], a
dec c
jr nz, .asm_3f71
ld [hl], e
pop hl
ld de, $0014
add hl, de
ret
; 3f7c
Function3f7c:: ; 3f7c
call MenuBoxCoord2Tile
call GetMenuBoxDims
dec b
dec c
call Function3eea
ret
; 3f88
Function3f88:: ; 3f88
ld hl, wDecompressScratch
ld b, $0
.asm_3f8d
push bc
ld c, $8
.asm_3f90
ld a, [de]
inc de
cpl
ld [hl], $0
inc hl
ld [hli], a
dec c
jr nz, .asm_3f90
pop bc
dec c
jr nz, .asm_3f8d
ret
; 3f9f
Function3f9f:: ; 3f9f
ld hl, wDecompressScratch
.asm_3fa2
push bc
ld c, $8
.asm_3fa5
ld a, [de]
inc de
inc de
cpl
ld [hl], $0
inc hl
ld [hli], a
dec c
jr nz, .asm_3fa5
pop bc
dec c
jr nz, .asm_3fa2
ret
; 3fb5

View File

@ -92,26 +92,26 @@ Timer:: ; 3e93
ld a, [$c822] ld a, [$c822]
bit 1, a bit 1, a
jr nz, .skip_Function1118de jr nz, .skip_Timer
ld a, [rSC] ld a, [rSC]
and 1 << rSC_ON and 1 << rSC_ON
jr nz, .skip_Function1118de jr nz, .skip_Timer
ld a, [hROMBank] ld a, [hROMBank]
push af push af
ld a, BANK(Function1118de) ld a, BANK(_Timer)
ld [$c981], a ld [$c981], a
rst Bankswitch rst Bankswitch
call Function1118de call _Timer
pop bc pop bc
ld a, b ld a, b
ld [$c981], a ld [$c981], a
rst Bankswitch rst Bankswitch
.skip_Function1118de .skip_Timer
ld a, [rTMA] ld a, [rTMA]
ld [rTIMA], a ld [rTIMA], a
@ -142,3 +142,174 @@ Function3ed7:: ; 3ed7
ld a, [wdc02] ld a, [wdc02]
ret ret
; 3eea ; 3eea
Function3eea:: ; 3eea
push hl
push bc
ld de, AttrMap - TileMap
add hl, de
inc b
inc b
inc c
inc c
call Function3f35
pop bc
pop hl
call MobileHome_PlaceBox
ret
; 3efd
Function3efd:: ; 3efd
; unreferenced
push hl
hlcoord 0, 12
ld b, 4
ld c, 18
call .fill_attr
pop hl
call PrintTextBoxText
ret
; 3f0d
.fill_attr
push hl
push bc
ld de, AttrMap - TileMap
add hl, de
inc b
inc b
inc c
inc c
call Function3f35
pop bc
pop hl
call TextBoxBorder
ret
; 3f20
Function3f20:: ; 3f20
hlcoord 0, 0, AttrMap
ld b, 6
ld c, 20
call Function3f35
hlcoord 0, 0
ld b, 4
ld c, 18
call MobileHome_PlaceBox
ret
; 3f35
Function3f35:: ; 3f35
ld a, 6
ld de, SCREEN_WIDTH
.row
push bc
push hl
.col
ld [hli], a
dec c
jr nz, .col
pop hl
add hl, de
pop bc
dec b
jr nz, .row
ret
; 3f47
MobileHome_PlaceBox: ; 3f47
push bc
call .FillTop
pop bc
.RowLoop
push bc
call .FillMiddle
pop bc
dec b
jr nz, .RowLoop
call .FillBottom
ret
; 3f58
.FillTop
ld a, $63
ld d, $62
ld e, $64
jr .FillRow
.FillBottom
ld a, $68
ld d, $67
ld e, $69
jr .FillRow
.FillMiddle
ld a, $7f
ld d, $65
ld e, $66
.FillRow
push hl
ld [hl], d
inc hl
.FillLoop
ld [hli], a
dec c
jr nz, .FillLoop
ld [hl], e
pop hl
ld de, SCREEN_WIDTH
add hl, de
ret
; 3f7c
Function3f7c:: ; 3f7c
call MenuBoxCoord2Tile
call GetMenuBoxDims
dec b
dec c
call Function3eea
ret
; 3f88
Function3f88:: ; 3f88
ld hl, wDecompressScratch
ld b, 0
.row
push bc
ld c, 1 tiles / 2
.col
ld a, [de]
inc de
cpl
ld [hl], 0
inc hl
ld [hli], a
dec c
jr nz, .col
pop bc
dec c
jr nz, .row
ret
; 3f9f
Function3f9f:: ; 3f9f
ld hl, wDecompressScratch
.row
push bc
ld c, 1 tiles / 2
.col
ld a, [de]
inc de
inc de
cpl
ld [hl], $0
inc hl
ld [hli], a
dec c
jr nz, .col
pop bc
dec c
jr nz, .row
ret
; 3fb5

View File

@ -3859,7 +3859,7 @@ Function1118c2: ; 1118c2 (44:58c2)
inc [hl] inc [hl]
ret ret
Function1118de:: ; 1118de (44:58de) _Timer:: ; 1118de (44:58de)
ld a, [$c80b] ld a, [$c80b]
cp $4 cp $4
call z, Function111b3c call z, Function111b3c

View File

@ -13177,6 +13177,7 @@ Unknown_e00ed:
; game were meant to be here. ; game were meant to be here.
ret_e00ed: ; e00ed (38:40ed) ret_e00ed: ; e00ed (38:40ed)
; How many coins?
ret ret
; e00ee (38:40ee) ; e00ee (38:40ee)

View File

@ -1,4 +1,5 @@
Function1700b0: ; 1700b0 Function1700b0: ; 1700b0
; special
call InitBattleTowerChallengeRAM call InitBattleTowerChallengeRAM
callba Function118121 callba Function118121
ret ret

View File

@ -1004,7 +1004,7 @@ Function106464:: ; 106464
Function10649b: ; 10649b Function10649b: ; 10649b
ld a, [TextBoxFrame] ld a, [TextBoxFrame]
and $7 and $7
ld bc, $30 ld bc, 3 tiles
ld hl, Frames ld hl, Frames
call AddNTimes call AddNTimes
ld d, h ld d, h

View File

@ -142,7 +142,6 @@ Function11811a: ; 11811a
Function118121: ; 118121 Function118121: ; 118121
xor a xor a
ld [wcd38], a ld [wcd38], a
Function118125: ; 118125 Function118125: ; 118125
call Function1183cb call Function1183cb
ld a, $3 ld a, $3
@ -155,16 +154,15 @@ Function118125: ; 118125
push af push af
ld a, $3 ld a, $3
ld [rSVBK], a ld [rSVBK], a
.asm_11813e .loop
call JoyTextDelay call JoyTextDelay
call Function118473 call Function118473
ld a, [wcf66] ld a, [wcf66]
cp $f cp $f
jr c, .asm_118151 jr c, .skip
ld a, [wcd34] ld a, [wcd34]
ld [wcf66], a ld [wcf66], a
.skip
.asm_118151
call Function11854d call Function11854d
call Function11a8fa call Function11a8fa
callba Function115dd3 callba Function115dd3
@ -173,7 +171,7 @@ Function118125: ; 118125
ld a, [wcf66] ld a, [wcf66]
ld hl, wcd33 ld hl, wcd33
cp [hl] cp [hl]
jr nz, .asm_11813e jr nz, .loop
xor a xor a
ld [w3_d000], a ld [w3_d000], a
pop af pop af
@ -552,12 +550,12 @@ Function118473: ; 118473
inc a inc a
ld [wcd68], a ld [wcd68], a
cp 99 cp 99
jr z, .asm_1184a0 jr z, .ninety_nine
xor a xor a
ld [wcd67], a ld [wcd67], a
ret ret
.asm_1184a0 .ninety_nine
xor a xor a
ld [wcd65], a ld [wcd65], a
ret ret

View File

@ -4631,7 +4631,9 @@ Function17f53d: ; 17f53d
push af push af
ld a, $1 ld a, $1
ld [rSVBK], a ld [rSVBK], a
call Function17f555 call Function17f555
pop af pop af
ld [rSVBK], a ld [rSVBK], a
call ExitAllMenus call ExitAllMenus
@ -4639,21 +4641,20 @@ Function17f53d: ; 17f53d
; 17f555 ; 17f555
Function17f555: ; 17f555 Function17f555: ; 17f555
.asm_17f555 .loop
call JoyTextDelay call JoyTextDelay
call Function17f5ae call .RunJumptable
ld a, [wc303] ld a, [wc303]
bit 7, a bit 7, a
jr nz, .asm_17f56a jr nz, .quit
callba Function104000 callba Function104000
jr .asm_17f555 jr .loop
.asm_17f56a .quit
call Function17f56e call .deinit
ret ret
; 17f56e
Function17f56e: ; 17f56e .deinit
ld a, [wc300] ld a, [wc300]
cp $22 cp $22
jr z, .asm_17f597 jr z, .asm_17f597
@ -4695,11 +4696,11 @@ Function17f56e: ; 17f56e
ret ret
; 17f5ae ; 17f5ae
Function17f5ae: ; 17f5ae .RunJumptable: ; 17f5ae
jumptable Table17f5bd, wc303 jumptable .Jumptable, wc303
; 17f5bd ; 17f5bd
Table17f5bd: ; 17f5bd .Jumptable: ; 17f5bd
dw Function17f5c3 dw Function17f5c3
dw Function17ff23 dw Function17ff23
dw Function17f5d2 dw Function17f5d2
@ -4858,26 +4859,26 @@ Palette_17f6af: ; 17f6af
Function17f6b7: ; 17f6b7 Function17f6b7: ; 17f6b7
ld a, [wc300] ld a, [wc300]
call Function17f6cd call .bcd_two_digits
inc hl inc hl
ld a, [wc302] ld a, [wc302]
and $f and $f
call Function17f6d8 call .bcd_digit
ld a, [wc301] ld a, [wc301]
call Function17f6cd call .bcd_two_digits
ret ret
; 17f6cd ; 17f6cd
Function17f6cd: ; 17f6cd .bcd_two_digits: ; 17f6cd
ld c, a ld c, a
and $f0 and $f0
swap a swap a
call Function17f6d8 call .bcd_digit
ld a, c ld a, c
and $f and $f
Function17f6d8: ; 17f6d8 .bcd_digit: ; 17f6d8
add $f6 add "0"
ld [hli], a ld [hli], a
ret ret
; 17f6dc ; 17f6dc

View File

@ -787,8 +787,8 @@ PlayerSAtkLevel:: ; c6cf
ds 1 ds 1
trademon: MACRO trademon: MACRO
\1Species:: ds 1 ; wc6d0 | wc702 \1Species:: ds 1 ; wc6d0 | wDummyGameNumberTriesRemaining
\1SpeciesName:: ds PKMN_NAME_LENGTH ; wc6d1 | wc703 \1SpeciesName:: ds PKMN_NAME_LENGTH ; wc6d1 | wDummyGameLastMatches
\1Nickname:: ds PKMN_NAME_LENGTH ; wc6dc | wc70e \1Nickname:: ds PKMN_NAME_LENGTH ; wc6dc | wc70e
\1SenderName:: ds NAME_LENGTH ; wc6e7 | wc719 \1SenderName:: ds NAME_LENGTH ; wc6e7 | wc719
\1OTName:: ds NAME_LENGTH ; wc6f2 | wc724 \1OTName:: ds NAME_LENGTH ; wc6f2 | wc724
@ -858,6 +858,22 @@ wDiscardPileEnd::
wCardFlipEnd:: wCardFlipEnd::
ds wCardFlip - @ ds wCardFlip - @
; Dummy Game
; c6d0
wDummyGame::
wDummyGameCards:: ds 9 * 5
wDummyGameCardsEnd::
wDummyGameLastCardPicked:: ds 1 ; c6fd
wDummyGameCard1:: ds 1 ; c6fe
wDummyGameCard2:: ds 1 ; c6ff
wDummyGameCard1Location:: ds 1 ; c700
wDummyGameCard2Location:: ds 1 ; c701
wDummyGameNumberTriesRemaining:: ds 1 ; c702
wDummyGameLastMatches:: ds 5 ; c703
wDummyGameCounter:: ds 1 ; c708
wDummyGameNumCardsMatched:: ds 1 ; c709
wDummyGameEnd::
ds wDummyGame - @
; Unown Puzzle ; Unown Puzzle
wUnownPuzzle:: wUnownPuzzle::
wPuzzlePieces:: wPuzzlePieces::