2015-11-16 19:29:54 -08:00
|
|
|
GFX_49c0c: ; 49c0c
|
|
|
|
INCBIN "gfx/unknown/049c0c.2bpp"
|
|
|
|
; 49cdc
|
|
|
|
|
|
|
|
MainMenu: ; 49cdc
|
|
|
|
xor a
|
|
|
|
ld [wc2d7], a
|
|
|
|
call Function49ed0
|
|
|
|
ld b, SCGB_08
|
|
|
|
call GetSGBLayout
|
|
|
|
call SetPalettes
|
|
|
|
ld hl, GameTimerPause
|
|
|
|
res 0, [hl]
|
2015-12-20 09:54:08 -08:00
|
|
|
call MainMenu_GetWhichMenu
|
2015-12-18 17:07:09 -08:00
|
|
|
ld [wWhichIndexSet], a
|
2015-12-20 09:54:08 -08:00
|
|
|
call MainMenu_PrintCurrentTimeAndDay
|
|
|
|
ld hl, .MenuDataHeader
|
2015-11-16 19:29:54 -08:00
|
|
|
call LoadMenuDataHeader
|
2015-12-20 09:54:08 -08:00
|
|
|
call MainMenuJoypadLoop
|
2015-12-24 19:58:42 -08:00
|
|
|
call CloseWindow
|
2015-11-16 19:29:54 -08:00
|
|
|
jr c, .quit
|
|
|
|
call ClearTileMap
|
|
|
|
ld a, [MenuSelection]
|
2015-12-20 09:54:08 -08:00
|
|
|
ld hl, .Jumptable
|
2015-11-16 19:29:54 -08:00
|
|
|
rst JumpTable
|
|
|
|
jr MainMenu
|
|
|
|
|
|
|
|
.quit
|
|
|
|
ret
|
|
|
|
; 49d14
|
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
.MenuDataHeader: ; 49d14
|
2015-11-16 19:29:54 -08:00
|
|
|
db $40 ; flags
|
|
|
|
db 00, 00 ; start coords
|
|
|
|
db 07, 16 ; end coords
|
2015-12-20 09:54:08 -08:00
|
|
|
dw .MenuData2
|
2015-11-16 19:29:54 -08:00
|
|
|
db 1 ; default option
|
|
|
|
; 49d1c
|
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
.MenuData2: ; 49d1c
|
2015-11-16 19:29:54 -08:00
|
|
|
db $80 ; flags
|
|
|
|
db 0 ; items
|
|
|
|
dw MainMenuItems
|
2015-12-13 11:15:16 -08:00
|
|
|
dw PlaceMenuStrings
|
2015-12-20 09:54:08 -08:00
|
|
|
dw .Strings
|
2015-11-16 19:29:54 -08:00
|
|
|
; 49d20
|
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
.Strings: ; 49d24
|
2015-11-16 19:29:54 -08:00
|
|
|
db "CONTINUE@"
|
|
|
|
db "NEW GAME@"
|
|
|
|
db "OPTION@"
|
|
|
|
db "MYSTERY GIFT@"
|
|
|
|
db "MOBILE@"
|
|
|
|
db "MOBILE STUDIUM@"
|
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
.Jumptable: ; 0x49d60
|
|
|
|
jumptable_start
|
|
|
|
jumptable MainMenu_Continue
|
|
|
|
jumptable MainMenu_NewGame
|
|
|
|
jumptable MainMenu_Options
|
|
|
|
jumptable MainMenu_MysteryGift
|
|
|
|
jumptable MainMenu_Mobile
|
|
|
|
jumptable MainMenu_MobileStudium
|
2015-11-16 19:29:54 -08:00
|
|
|
; 0x49d6c
|
|
|
|
|
|
|
|
CONTINUE EQU 0
|
|
|
|
NEW_GAME EQU 1
|
|
|
|
OPTION EQU 2
|
|
|
|
MYSTERY_GIFT EQU 3
|
|
|
|
MOBILE EQU 4
|
|
|
|
MOBILE_STUDIUM EQU 5
|
|
|
|
|
|
|
|
MainMenuItems:
|
|
|
|
|
|
|
|
NewGameMenu: ; 0x49d6c
|
|
|
|
db 2
|
|
|
|
db NEW_GAME
|
|
|
|
db OPTION
|
2015-12-19 11:48:30 -08:00
|
|
|
db -1
|
2015-11-16 19:29:54 -08:00
|
|
|
|
|
|
|
ContinueMenu: ; 0x49d70
|
|
|
|
db 3
|
|
|
|
db CONTINUE
|
|
|
|
db NEW_GAME
|
|
|
|
db OPTION
|
2015-12-19 11:48:30 -08:00
|
|
|
db -1
|
2015-11-16 19:29:54 -08:00
|
|
|
|
|
|
|
MobileMysteryMenu: ; 0x49d75
|
|
|
|
db 5
|
|
|
|
db CONTINUE
|
|
|
|
db NEW_GAME
|
|
|
|
db OPTION
|
|
|
|
db MYSTERY_GIFT
|
|
|
|
db MOBILE
|
2015-12-19 11:48:30 -08:00
|
|
|
db -1
|
2015-11-16 19:29:54 -08:00
|
|
|
|
|
|
|
MobileMenu: ; 0x49d7c
|
|
|
|
db 4
|
|
|
|
db CONTINUE
|
|
|
|
db NEW_GAME
|
|
|
|
db OPTION
|
|
|
|
db MOBILE
|
2015-12-19 11:48:30 -08:00
|
|
|
db -1
|
2015-11-16 19:29:54 -08:00
|
|
|
|
|
|
|
MobileStudiumMenu: ; 0x49d82
|
|
|
|
db 5
|
|
|
|
db CONTINUE
|
|
|
|
db NEW_GAME
|
|
|
|
db OPTION
|
|
|
|
db MOBILE
|
|
|
|
db MOBILE_STUDIUM
|
2015-12-19 11:48:30 -08:00
|
|
|
db -1
|
2015-11-16 19:29:54 -08:00
|
|
|
|
|
|
|
MysteryMobileStudiumMenu: ; 0x49d89
|
|
|
|
db 6
|
|
|
|
db CONTINUE
|
|
|
|
db NEW_GAME
|
|
|
|
db OPTION
|
|
|
|
db MYSTERY_GIFT
|
|
|
|
db MOBILE
|
|
|
|
db MOBILE_STUDIUM
|
2015-12-19 11:48:30 -08:00
|
|
|
db -1
|
2015-11-16 19:29:54 -08:00
|
|
|
|
|
|
|
MysteryMenu: ; 0x49d91
|
|
|
|
db 4
|
|
|
|
db CONTINUE
|
|
|
|
db NEW_GAME
|
|
|
|
db OPTION
|
|
|
|
db MYSTERY_GIFT
|
2015-12-19 11:48:30 -08:00
|
|
|
db -1
|
2015-11-16 19:29:54 -08:00
|
|
|
|
|
|
|
MysteryStudiumMenu: ; 0x49d97
|
|
|
|
db 5
|
|
|
|
db CONTINUE
|
|
|
|
db NEW_GAME
|
|
|
|
db OPTION
|
|
|
|
db MYSTERY_GIFT
|
|
|
|
db MOBILE_STUDIUM
|
2015-12-19 11:48:30 -08:00
|
|
|
db -1
|
2015-11-16 19:29:54 -08:00
|
|
|
|
|
|
|
StudiumMenu: ; 0x49d9e
|
|
|
|
db 4
|
|
|
|
db CONTINUE
|
|
|
|
db NEW_GAME
|
|
|
|
db OPTION
|
|
|
|
db MOBILE_STUDIUM
|
2015-12-19 11:48:30 -08:00
|
|
|
db -1
|
2015-11-16 19:29:54 -08:00
|
|
|
|
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
MainMenu_GetWhichMenu: ; 49da4
|
2015-11-16 19:29:54 -08:00
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
2015-11-17 20:29:14 -08:00
|
|
|
ld a, [wSaveFileExists]
|
2015-11-16 19:29:54 -08:00
|
|
|
and a
|
|
|
|
jr nz, .next
|
2015-12-20 09:54:08 -08:00
|
|
|
ld a, $0 ; New Game
|
2015-11-16 19:29:54 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.next
|
|
|
|
ld a, [hCGB]
|
|
|
|
cp $1
|
|
|
|
ld a, $1
|
|
|
|
ret nz
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, BANK(sNumDailyMysteryGiftPartnerIDs)
|
2015-11-16 19:29:54 -08:00
|
|
|
call GetSRAMBank
|
2015-11-22 21:21:21 -08:00
|
|
|
ld a, [sNumDailyMysteryGiftPartnerIDs]
|
2015-12-20 09:54:08 -08:00
|
|
|
cp -1
|
2015-11-16 19:29:54 -08:00
|
|
|
call CloseSRAM
|
2015-12-20 09:54:08 -08:00
|
|
|
jr nz, .mystery_gift
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [StatusFlags]
|
|
|
|
bit 7, a
|
2015-12-20 09:54:08 -08:00
|
|
|
ld a, $1 ; Continue
|
2015-11-16 19:29:54 -08:00
|
|
|
jr z, .ok
|
|
|
|
jr .ok
|
|
|
|
|
|
|
|
.ok
|
|
|
|
jr .ok2
|
|
|
|
|
|
|
|
.ok2
|
2015-12-20 09:54:08 -08:00
|
|
|
ld a, $1 ; Continue
|
2015-11-16 19:29:54 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
.mystery_gift
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [StatusFlags]
|
|
|
|
bit 7, a
|
|
|
|
jr z, .ok3
|
|
|
|
jr .ok3
|
|
|
|
|
|
|
|
.ok3
|
|
|
|
jr .ok4
|
|
|
|
|
|
|
|
.ok4
|
2015-12-20 09:54:08 -08:00
|
|
|
ld a, $6 ; Mystery Gift
|
2015-11-16 19:29:54 -08:00
|
|
|
ret
|
|
|
|
; 49de4
|
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
MainMenuJoypadLoop: ; 49de4
|
2015-11-16 19:29:54 -08:00
|
|
|
call SetUpMenu
|
2015-12-20 09:54:08 -08:00
|
|
|
.loop
|
|
|
|
call MainMenu_PrintCurrentTimeAndDay
|
2015-12-19 11:48:30 -08:00
|
|
|
ld a, [w2DMenuFlags1]
|
2015-11-16 19:29:54 -08:00
|
|
|
set 5, a
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [w2DMenuFlags1], a
|
2015-11-16 19:29:54 -08:00
|
|
|
call Function1f1a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuJoypad]
|
2015-12-20 09:54:08 -08:00
|
|
|
cp B_BUTTON
|
|
|
|
jr z, .b_button
|
|
|
|
cp A_BUTTON
|
|
|
|
jr z, .a_button
|
|
|
|
jr .loop
|
2015-11-16 19:29:54 -08:00
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
.a_button
|
2015-11-16 19:29:54 -08:00
|
|
|
call PlayClickSFX
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
.b_button
|
2015-11-16 19:29:54 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 49e09
|
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
MainMenu_PrintCurrentTimeAndDay: ; 49e09
|
2015-11-17 20:29:14 -08:00
|
|
|
ld a, [wSaveFileExists]
|
2015-11-16 19:29:54 -08:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
xor a
|
|
|
|
ld [hBGMapMode], a
|
2015-12-20 09:54:08 -08:00
|
|
|
call .PlaceBox
|
2015-11-16 19:29:54 -08:00
|
|
|
ld hl, Options
|
|
|
|
ld a, [hl]
|
|
|
|
push af
|
2015-12-20 09:54:08 -08:00
|
|
|
set NO_TEXT_SCROLL, [hl]
|
|
|
|
call .PlaceTime
|
2015-11-16 19:29:54 -08:00
|
|
|
pop af
|
|
|
|
ld [Options], a
|
|
|
|
ld a, $1
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
ret
|
|
|
|
; 49e27
|
|
|
|
|
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
.PlaceBox: ; 49e27
|
2015-11-20 08:47:52 -08:00
|
|
|
call CheckRTCStatus
|
2015-11-16 19:29:54 -08:00
|
|
|
and $80
|
2015-12-20 09:54:08 -08:00
|
|
|
jr nz, .TimeFail
|
2015-11-16 19:29:54 -08:00
|
|
|
hlcoord 0, 14
|
2015-12-20 09:54:08 -08:00
|
|
|
ld b, 2
|
|
|
|
ld c, 18
|
2015-11-16 19:29:54 -08:00
|
|
|
call TextBox
|
|
|
|
ret
|
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
.TimeFail
|
2015-11-16 19:29:54 -08:00
|
|
|
call SpeechTextBox
|
|
|
|
ret
|
|
|
|
; 49e3d
|
|
|
|
|
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
.PlaceTime: ; 49e3d
|
2015-11-17 20:29:14 -08:00
|
|
|
ld a, [wSaveFileExists]
|
2015-11-16 19:29:54 -08:00
|
|
|
and a
|
|
|
|
ret z
|
2015-11-20 08:47:52 -08:00
|
|
|
call CheckRTCStatus
|
2015-11-16 19:29:54 -08:00
|
|
|
and $80
|
2015-12-20 09:54:08 -08:00
|
|
|
jp nz, .PrintTimeNotSet
|
2015-11-16 19:29:54 -08:00
|
|
|
call UpdateTime
|
|
|
|
call GetWeekday
|
|
|
|
ld b, a
|
|
|
|
decoord 1, 15
|
2015-12-20 09:54:08 -08:00
|
|
|
call .PlaceCurrentDay
|
2015-11-16 19:29:54 -08:00
|
|
|
decoord 4, 16
|
|
|
|
ld a, [hHours]
|
|
|
|
ld c, a
|
|
|
|
callba PrintHour
|
|
|
|
ld [hl], ":"
|
|
|
|
inc hl
|
|
|
|
ld de, hMinutes
|
|
|
|
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
|
|
|
|
call PrintNum
|
|
|
|
ret
|
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
.min
|
|
|
|
; unreferenced
|
2015-11-16 19:29:54 -08:00
|
|
|
db "min.@"
|
|
|
|
; 49e75
|
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
.PrintTimeNotSet: ; 49e75
|
2015-11-16 19:29:54 -08:00
|
|
|
hlcoord 1, 14
|
|
|
|
ld de, .TimeNotSet
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
; 49e7f
|
|
|
|
|
|
|
|
.TimeNotSet ; 49e7f
|
|
|
|
db "TIME NOT SET@"
|
|
|
|
; 49e8c
|
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
.UnusedText ; 49e8c
|
|
|
|
; Clock time unknown
|
2015-11-16 19:29:54 -08:00
|
|
|
text_jump UnknownText_0x1c5182
|
|
|
|
db "@"
|
|
|
|
; 49e91
|
|
|
|
|
2015-12-20 09:54:08 -08:00
|
|
|
.PlaceCurrentDay: ; 49e91
|
2015-11-16 19:29:54 -08:00
|
|
|
push de
|
|
|
|
ld hl, .Days
|
|
|
|
ld a, b
|
|
|
|
call GetNthString
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
pop hl
|
|
|
|
call PlaceString
|
|
|
|
ld h, b
|
|
|
|
ld l, c
|
|
|
|
ld de, .Day
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
; 49ea8
|
|
|
|
|
|
|
|
.Days
|
|
|
|
db "SUN@"
|
|
|
|
db "MON@"
|
|
|
|
db "TUES@"
|
|
|
|
db "WEDNES@"
|
|
|
|
db "THURS@"
|
|
|
|
db "FRI@"
|
|
|
|
db "SATUR@"
|
|
|
|
.Day
|
|
|
|
db "DAY@"
|
|
|
|
; 49ed0
|
|
|
|
|
|
|
|
Function49ed0: ; 49ed0
|
|
|
|
xor a
|
|
|
|
ld [hMapAnims], a
|
|
|
|
call ClearTileMap
|
|
|
|
call LoadFontsExtra
|
|
|
|
call LoadStandardFont
|
2015-12-19 11:48:30 -08:00
|
|
|
call ClearWindowData
|
2015-11-16 19:29:54 -08:00
|
|
|
ret
|
|
|
|
; 49ee0
|
|
|
|
|
|
|
|
|
|
|
|
MainMenu_NewGame: ; 49ee0
|
|
|
|
callba NewGame
|
|
|
|
ret
|
|
|
|
; 49ee7
|
|
|
|
|
|
|
|
MainMenu_Options: ; 49ee7
|
|
|
|
callba OptionsMenu
|
|
|
|
ret
|
|
|
|
; 49eee
|
|
|
|
|
|
|
|
MainMenu_Continue: ; 49eee
|
|
|
|
callba Continue
|
|
|
|
ret
|
|
|
|
; 49ef5
|
|
|
|
|
|
|
|
MainMenu_MysteryGift: ; 49ef5
|
|
|
|
callba MysteryGift
|
|
|
|
ret
|
|
|
|
; 49efc
|