Committing old shinkai progress

It's in a better state than when it started soooo
This commit is contained in:
Llinos Evans 2024-07-30 01:11:00 +01:00
parent 7e6d4d8c7f
commit 8d9afdcd2b
5 changed files with 83 additions and 55 deletions

View file

@ -1323,27 +1323,6 @@ _OakPCText4::
line "OAK's PC closed." line "OAK's PC closed."
done done
_TrainerRankingExplanationText:: ; unreferenced
text "Triple-theme"
line "trainer ranking!"
para "The SAVE file you"
line "just sent might"
cont "make the rankings!"
para ""
done
_TrainerRankingNoDataText:: ; unreferenced
text "There is no"
line "ranking data."
para "Link to obtain"
line "ranking data."
para ""
done
_MemoryGameYeahText:: _MemoryGameYeahText::
text " , yeah!" text " , yeah!"
done done

View file

@ -1,4 +1,21 @@
; MemoryMinigame.Jumptable indices
const_def
const MEMORYGAME_RESTART_GAME
const MEMORYGAME_RESTART_BOARD
const MEMORYGAME_INIT_BOARD_AND_CURSOR
const MEMORYGAME_CHECK_TRIES_REMAINING
const MEMORYGAME_PICK_CARD_1
const MEMORYGAME_PICK_CARD_2
const MEMORYGAME_DELAY_PICK_AGAIN
const MEMORYGAME_REVEAL_ALL
const MEMORYGAME_ASK_PLAY_AGAIN
DEF MEMORYGAME_END_LOOP_F EQU 7
_MemoryGame: _MemoryGame:
; Always start off with 256 coins
;IF DEF(_DEBUG)
; givecoins 256
;endc
call .LoadGFXAndPals call .LoadGFXAndPals
call DelayFrame call DelayFrame
.loop .loop
@ -11,28 +28,38 @@ _MemoryGame:
ld b, SCGB_DIPLOMA ld b, SCGB_DIPLOMA
call GetSGBLayout call GetSGBLayout
callfar ClearSpriteAnims callfar ClearSpriteAnims
ld hl, MemoryGameLZ ld hl, MemoryGameTiles
ld de, vTiles2 tile $00 ld de, vTiles2 tile $00
call Decompress call Decompress
ld hl, MemoryGameGFX ld hl, MemoryGameGFX
ld de, vTiles0 tile $00 ld de, vTiles0 tile $00
ld bc, 4 tiles ld bc, 4 tiles
ld a, BANK(MemoryGameGFX) ld a, BANK(MemoryGameGFX)
call FarCopyBytes call FarCopyBytes
ld a, SPRITE_ANIM_DICT_ARROW_CURSOR
ld a, SPRITE_ANIM_INDEX_MEMORY_GAME_CURSOR
ld hl, MemoryGameGloveGFX
ld de, vTiles0
ld bc, $4 tiles
ld a, BANK(MemoryGameGloveGFX)
call FarCopyBytes
ld hl, wSpriteAnimDict ld hl, wSpriteAnimDict
ld [hli], a ld [hli], a
ld [hl], $00 ld [hl], 0
hlcoord 0, 0 hlcoord 0, 0
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
xor a xor a
call ByteFill call ByteFill
xor a xor a
ldh [hSCY], a ldh [hSCY], a
ldh [hSCX], a ldh [hSCX], a
ldh [rWY], a ldh [rWY], a
ld [wJumptableIndex], a ld [wJumptableIndex], a
ld a, $1 ld a, 1
ldh [hBGMapMode], a ldh [hBGMapMode], a
ld a, LCDC_DEFAULT ld a, LCDC_DEFAULT
ldh [rLCDC], a ldh [rLCDC], a
@ -44,7 +71,7 @@ _MemoryGame:
.JumptableLoop: .JumptableLoop:
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
bit 7, a bit MEMORYGAME_END_LOOP_F, a
jr nz, .quit jr nz, .quit
call .ExecuteJumptable call .ExecuteJumptable
callfar PlaySpriteAnimations callfar PlaySpriteAnimations
@ -80,7 +107,7 @@ _MemoryGame:
call UnusedCursor_InterpretJoypad_AnimateCursor call UnusedCursor_InterpretJoypad_AnimateCursor
jr nc, .proceed jr nc, .proceed
ld hl, wJumptableIndex ld hl, wJumptableIndex
set 7, [hl] set MEMORYGAME_END_LOOP_F, [hl]
ret ret
.proceed .proceed
@ -95,6 +122,7 @@ rept 4
endr endr
ld [hl], a ld [hl], a
ld [wMemoryGameNumCardsMatched], a ld [wMemoryGameNumCardsMatched], a
.InitBoardTilemapAndCursorObject: .InitBoardTilemapAndCursorObject:
ld hl, wMemoryGameCounter ld hl, wMemoryGameCounter
ld a, [hl] ld a, [hl]
@ -126,7 +154,7 @@ endr
ld a, [hl] ld a, [hl]
and a and a
jr nz, .next_try jr nz, .next_try
ld a, $7 ld a, MEMORYGAME_REVEAL_ALL
ld [wJumptableIndex], a ld [wJumptableIndex], a
ret ret
@ -136,6 +164,7 @@ endr
ld [wMemoryGameCardChoice], a ld [wMemoryGameCardChoice], a
ld hl, wJumptableIndex ld hl, wJumptableIndex
inc [hl] inc [hl]
.PickCard1: .PickCard1:
ld a, [wMemoryGameCardChoice] ld a, [wMemoryGameCardChoice]
and a and a
@ -185,6 +214,7 @@ endr
ld [wMemoryGameCounter], a ld [wMemoryGameCounter], a
ld hl, wJumptableIndex ld hl, wJumptableIndex
inc [hl] inc [hl]
.DelayPickAgain: .DelayPickAgain:
ld hl, wMemoryGameCounter ld hl, wMemoryGameCounter
ld a, [hl] ld a, [hl]
@ -195,7 +225,7 @@ endr
.PickAgain: .PickAgain:
call MemoryGame_CheckMatch call MemoryGame_CheckMatch
ld a, $3 ld a, MEMORYGAME_CHECK_TRIES_REMAINING
ld [wJumptableIndex], a ld [wJumptableIndex], a
ret ret
@ -205,6 +235,7 @@ endr
ret z ret z
xor a xor a
ld [wMemoryGameCounter], a ld [wMemoryGameCounter], a
.RevelationLoop: .RevelationLoop:
ld hl, wMemoryGameCounter ld hl, wMemoryGameCounter
ld a, [hl] ld a, [hl]
@ -231,11 +262,12 @@ endr
call WaitPressAorB_BlinkCursor call WaitPressAorB_BlinkCursor
ld hl, wJumptableIndex ld hl, wJumptableIndex
inc [hl] inc [hl]
.AskPlayAgain: .AskPlayAgain:
call UnusedCursor_InterpretJoypad_AnimateCursor call UnusedCursor_InterpretJoypad_AnimateCursor
jr nc, .restart jr nc, .restart
ld hl, wJumptableIndex ld hl, wJumptableIndex
set 7, [hl] set MEMORYGAME_END_LOOP_F, [hl]
ret ret
.restart .restart
@ -304,29 +336,29 @@ MemoryGame_CheckMatch:
call MemoryGame_Card2Coord call MemoryGame_Card2Coord
call MemoryGame_PlaceCard call MemoryGame_PlaceCard
ld hl, MemoryGameDarnText ld hl, .DarnText
call PrintText call PrintText
ret ret
.VictoryText: .VictoryText:
text_asm start_asm
push bc push bc
hlcoord 2, 13 hlcoord 2, 13
call MemoryGame_PlaceCard call MemoryGame_PlaceCard
ld hl, MemoryGameYeahText ld hl, .YeahText
pop bc pop bc
inc bc inc bc
inc bc inc bc
inc bc inc bc
ret ret
MemoryGameYeahText: .YeahText:
text_far _MemoryGameYeahText text "Yeah!"
text_end done
MemoryGameDarnText: .DarnText:
text_far _MemoryGameDarnText text "Darn<...>"
text_end done
MemoryGame_InitBoard: MemoryGame_InitBoard:
ld hl, wMemoryGameCards ld hl, wMemoryGameCards
@ -377,6 +409,7 @@ MemoryGame_InitBoard:
jr nz, .loop jr nz, .loop
ret ret
MemoryGame_SampleTilePlacement: MemoryGame_SampleTilePlacement:
push hl push hl
ld de, wMemoryGameCards ld de, wMemoryGameCards
@ -434,7 +467,7 @@ MemoryGame_PlaceCard:
ret ret
MemoryGame_DeleteCard: MemoryGame_DeleteCard:
ld a, $1 ld a, 1
ld [hli], a ld [hli], a
ld [hld], a ld [hld], a
ld bc, SCREEN_WIDTH ld bc, SCREEN_WIDTH
@ -448,13 +481,13 @@ MemoryGame_DeleteCard:
MemoryGame_InitStrings: MemoryGame_InitStrings:
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, .japstr1 ld de, .str1
call PlaceString call PlaceString
hlcoord 15, 0 hlcoord 15, 0
ld de, .japstr2 ld de, .str2
call PlaceString call PlaceString
ld hl, .dummy_text ld hl, .dummy_text
call PrintText call PrintText
@ -462,10 +495,10 @@ MemoryGame_InitStrings:
.dummy_text .dummy_text
db "@" db "@"
.japstr1 .str1
db "とったもの@" db "SCORE@"
.japstr2 .str2
db "あと かい@" db "TURNS@"
MemoryGame_Card2Coord: MemoryGame_Card2Coord:
ld d, 0 ld d, 0
@ -493,9 +526,9 @@ MemoryGame_Card2Coord:
add hl, de add hl, de
ret ret
MemoryGame_InterpretJoypad_AnimateCursor: MemoryGame_InterpretJoypad_AnimateCursor: ; Called from sprite animation routine?
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
cp $7 cp MEMORYGAME_REVEAL_ALL
jr nc, .quit jr nc, .quit
call JoyTextDelay call JoyTextDelay
ld hl, hJoypadPressed ld hl, hJoypadPressed
@ -519,7 +552,7 @@ MemoryGame_InterpretJoypad_AnimateCursor:
.quit .quit
ld hl, SPRITEANIMSTRUCT_INDEX ld hl, SPRITEANIMSTRUCT_INDEX
add hl, bc add hl, bc
ld [hl], $0 ld [hl], 0
ret ret
.pressed_a .pressed_a
@ -582,9 +615,14 @@ MemoryGame_InterpretJoypad_AnimateCursor:
ld hl, SPRITEANIMSTRUCT_VAR1 ld hl, SPRITEANIMSTRUCT_VAR1
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
add 9 add a, 9
ld [hl], a ld [hl], a
ret ret
MemoryGameLZ: MemoryGameTiles: INCBIN "gfx/memory_game/memory_game.2bpp.lz"
INCBIN "gfx/memory_game/memory_game.2bpp.lz"
MemoryGameGloveGFX:: INCBIN "gfx/memory_game/glove.2bpp"
MemoryWantToPlayText:
text "Want to play?"
done

BIN
gfx/memory_game/glove.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

View file

@ -195,6 +195,8 @@ DebugItemScript:
giveitem DOME_FOSSIL, 2 giveitem DOME_FOSSIL, 2
giveitem HELIX_FOSSIL, 2 giveitem HELIX_FOSSIL, 2
giveitem OLD_AMBER, 2 giveitem OLD_AMBER, 2
giveitem COIN_CASE
givecoins 2500
closetext closetext
end end
@ -364,6 +366,12 @@ DebugDollShopAlreadyBoughtText:
line "that!" line "that!"
done done
MemoryGameScript:
refreshscreen
special UnusedMemoryGame
closetext
end
DebugRoom_MapEvents: DebugRoom_MapEvents:
db 0, 0 ; filler db 0, 0 ; filler
@ -396,3 +404,4 @@ DebugRoom_MapEvents:
object_event 19, 13, SPRITE_NURSE, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_PURPLE, OBJECTTYPE_SCRIPT, 0, DebugItemScript, -1 object_event 19, 13, SPRITE_NURSE, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_PURPLE, OBJECTTYPE_SCRIPT, 0, DebugItemScript, -1
object_event 18, 13, SPRITE_SAFARI_ZONE_WORKER, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, TrainerTestScript, -1 object_event 18, 13, SPRITE_SAFARI_ZONE_WORKER, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, TrainerTestScript, -1
object_event 20, 13, SPRITE_FISHER, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, DebugDollShopScript, -1 object_event 20, 13, SPRITE_FISHER, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, DebugDollShopScript, -1
object_event 25, 15, SPRITE_WILL, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, MemoryGameScript, -1

View file

@ -1,5 +1,7 @@
SECTION "HRAM", HRAM SECTION "HRAM", HRAM
hScriptVar:: db ; Used in the finished Shinkai port from Pokeprism.
hROMBankBackup:: db hROMBankBackup:: db
hFarByte:: hFarByte::
hTempBank:: db hTempBank:: db
@ -11,7 +13,7 @@ hRTCHours:: db
hRTCMinutes:: db hRTCMinutes:: db
hRTCSeconds:: db hRTCSeconds:: db
ds 2 ds 1
hHours:: db hHours:: db
ds 1 ds 1