Merge branch 'master' into pokemon
This commit is contained in:
+32
-31
@@ -1,48 +1,49 @@
|
||||
*.exe
|
||||
*.o
|
||||
*.i
|
||||
*.elf
|
||||
*.gba
|
||||
*.1bpp
|
||||
*.4bpp
|
||||
*.8bpp
|
||||
*.gbapal
|
||||
*.lz
|
||||
*.rl
|
||||
*.pcm
|
||||
*.latfont
|
||||
*.hwjpnfont
|
||||
*.fwjpnfont
|
||||
*.DS_Store
|
||||
*.bak
|
||||
*.bat
|
||||
sound/**/*.bin
|
||||
src/*.s
|
||||
tools/agbcc
|
||||
tools/binutils
|
||||
ld_script_ruby.txt
|
||||
ld_script_sapphire.txt
|
||||
*.map
|
||||
*.diff
|
||||
*.dump
|
||||
*.elf
|
||||
*.exe
|
||||
*.fwjpnfont
|
||||
*.gba
|
||||
*.gbapal
|
||||
*.hwjpnfont
|
||||
*.i
|
||||
*.id0
|
||||
*.id1
|
||||
*.id2
|
||||
*.nam
|
||||
*.til
|
||||
.fuse*
|
||||
*.latfont
|
||||
*.ld
|
||||
tags
|
||||
types_*.taghl
|
||||
*.swp
|
||||
*.swo
|
||||
*.lz
|
||||
*.map
|
||||
*.nam
|
||||
*.o
|
||||
*.pcm
|
||||
*.pl
|
||||
*.rl
|
||||
*.s.old
|
||||
*.s.old2
|
||||
*.dump
|
||||
*.sa*
|
||||
*.swo
|
||||
*.swp
|
||||
*.til
|
||||
.fuse*
|
||||
.idea/
|
||||
Thumbs.db
|
||||
build/
|
||||
.idea/
|
||||
cmake-build-*
|
||||
*.DS_Store
|
||||
*.pl
|
||||
*.bak
|
||||
ld_script_ruby.txt
|
||||
ld_script_sapphire.txt
|
||||
sound/**/*.bin
|
||||
src/*.s
|
||||
src/data/items.h
|
||||
tags
|
||||
tools/agbcc
|
||||
tools/binutils
|
||||
tools/br_ips/br_ips
|
||||
tools/br_ips/ips_patch
|
||||
types_*.taghl
|
||||
|
||||
@@ -244,10 +244,10 @@ $(OBJ_DIR)/ld_script.ld: ld_script.txt $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_comm
|
||||
|
||||
$(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS)
|
||||
cd $(OBJ_DIR) && ../../$(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(LIB)
|
||||
$(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent
|
||||
|
||||
$(ROM): $(ELF)
|
||||
$(OBJCOPY) -O binary $< $@
|
||||
$(FIX) $@ -p -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent
|
||||
$(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0x9000000 $< $@
|
||||
|
||||
berry_fix/berry_fix.gba:
|
||||
@$(MAKE) -C berry_fix
|
||||
|
||||
+4
-4
@@ -2102,7 +2102,7 @@ _0814E6E0:
|
||||
movs r1, 0
|
||||
adds r2, r4, 0
|
||||
movs r3, 0xD
|
||||
bl SetWindowBorderStyle
|
||||
bl DrawStdFrameWithCustomTileAndPalette
|
||||
b _0814E7F8
|
||||
.align 2, 0
|
||||
_0814E700: .4byte 0x0000021d
|
||||
@@ -2246,7 +2246,7 @@ sub_814E80C: @ 814E80C
|
||||
adds r5, r4, r0
|
||||
ldrb r0, [r5]
|
||||
movs r1, 0x1
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
ldrb r0, [r5]
|
||||
bl RemoveWindow
|
||||
adds r0, r4, 0
|
||||
@@ -2314,7 +2314,7 @@ _0814E876:
|
||||
movs r1, 0
|
||||
adds r2, r4, 0
|
||||
movs r3, 0xD
|
||||
bl SetWindowBorderStyle
|
||||
bl DrawStdFrameWithCustomTileAndPalette
|
||||
b _0814EA66
|
||||
.align 2, 0
|
||||
_0814E8A8: .4byte gUnknown_846E3F0
|
||||
@@ -2499,7 +2499,7 @@ _0814EA3C: .4byte gMain
|
||||
_0814EA40:
|
||||
ldrb r0, [r7, 0x2]
|
||||
movs r1, 0x1
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
ldrb r0, [r7, 0x2]
|
||||
bl ClearWindowTilemap
|
||||
ldrb r0, [r7, 0x2]
|
||||
|
||||
+7
-7
@@ -1974,7 +1974,7 @@ _0813DC86:
|
||||
movs r1, 0x2
|
||||
movs r2, 0
|
||||
movs r3, 0x2
|
||||
bl ProgramAndPlaceMenuCursorOnWindow
|
||||
bl Menu_InitCursor
|
||||
movs r0, 0x6
|
||||
bl sub_813EA08
|
||||
adds r4, r0, 0
|
||||
@@ -2051,7 +2051,7 @@ sub_813DDA0: @ 813DDA0
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
beq _0813DDFE
|
||||
bl ProcessMenuInputNoWrapAround
|
||||
bl Menu_ProcessInputNoWrapAround
|
||||
lsls r0, 24
|
||||
asrs r4, r0, 24
|
||||
movs r0, 0x2
|
||||
@@ -3509,7 +3509,7 @@ _0813EA38:
|
||||
movs r1, 0
|
||||
movs r2, 0xA
|
||||
movs r3, 0xC
|
||||
bl SetWindowBorderStyle
|
||||
bl DrawStdFrameWithCustomTileAndPalette
|
||||
b _0813EA60
|
||||
.align 2, 0
|
||||
_0813EA4C: .4byte gUnknown_203F38C
|
||||
@@ -3519,7 +3519,7 @@ _0813EA54:
|
||||
movs r1, 0
|
||||
movs r2, 0x1
|
||||
movs r3, 0xE
|
||||
bl SetWindowBorderStyle
|
||||
bl DrawStdFrameWithCustomTileAndPalette
|
||||
_0813EA60:
|
||||
movs r0, 0x2
|
||||
bl ScheduleBgCopyTilemapToVram
|
||||
@@ -3545,7 +3545,7 @@ sub_813EA78: @ 813EA78
|
||||
movs r1, 0
|
||||
movs r2, 0x1
|
||||
movs r3, 0xE
|
||||
bl SetWindowBorderStyle
|
||||
bl DrawStdFrameWithCustomTileAndPalette
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
@@ -3562,7 +3562,7 @@ sub_813EA98: @ 813EA98
|
||||
adds r4, r0
|
||||
ldrb r0, [r4]
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
ldrb r0, [r4]
|
||||
bl ClearWindowTilemap
|
||||
ldrb r0, [r4]
|
||||
@@ -3589,7 +3589,7 @@ sub_813EACC: @ 813EACC
|
||||
cmp r0, 0xFF
|
||||
beq _0813EB04
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow_BorderThickness2
|
||||
bl ClearDialogWindowAndFrameToTransparent
|
||||
ldrb r0, [r4]
|
||||
bl ClearWindowTilemap
|
||||
ldrb r0, [r4]
|
||||
|
||||
@@ -1,162 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_80D9614
|
||||
sub_80D9614: @ 80D9614
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x4
|
||||
mov r10, r0
|
||||
ldr r0, [sp, 0x24]
|
||||
ldr r4, [sp, 0x28]
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
mov r9, r1
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
str r2, [sp]
|
||||
lsls r3, 24
|
||||
lsls r0, 24
|
||||
lsrs r7, r0, 24
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
mov r8, r4
|
||||
movs r0, 0
|
||||
lsrs r4, r3, 24
|
||||
cmp r0, r8
|
||||
bcs _080D968E
|
||||
_080D9646:
|
||||
ldr r2, [sp]
|
||||
movs r3, 0
|
||||
adds r6, r4, 0x1
|
||||
adds r0, 0x1
|
||||
mov r12, r0
|
||||
cmp r3, r7
|
||||
bcs _080D9678
|
||||
lsls r5, r4, 6
|
||||
_080D9656:
|
||||
lsls r0, r2, 1
|
||||
adds r0, r5
|
||||
add r0, r10
|
||||
mov r1, r9
|
||||
strh r1, [r0]
|
||||
adds r1, r2, 0x1
|
||||
adds r0, r1, 0
|
||||
asrs r0, 5
|
||||
lsls r0, 5
|
||||
subs r0, r1, r0
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
adds r0, r3, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
cmp r3, r7
|
||||
bcc _080D9656
|
||||
_080D9678:
|
||||
adds r0, r6, 0
|
||||
asrs r0, 5
|
||||
lsls r0, 5
|
||||
subs r0, r6, r0
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
mov r1, r12
|
||||
lsls r0, r1, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, r8
|
||||
bcc _080D9646
|
||||
_080D968E:
|
||||
add sp, 0x4
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80D9614
|
||||
|
||||
thumb_func_start sub_80D96A0
|
||||
sub_80D96A0: @ 80D96A0
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x4
|
||||
mov r10, r0
|
||||
ldr r0, [sp, 0x24]
|
||||
ldr r4, [sp, 0x28]
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
str r2, [sp]
|
||||
lsls r3, 24
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r12, r0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
mov r9, r4
|
||||
movs r0, 0
|
||||
adds r5, r1, 0
|
||||
lsrs r4, r3, 24
|
||||
cmp r0, r9
|
||||
bcs _080D971A
|
||||
_080D96D0:
|
||||
ldr r2, [sp]
|
||||
movs r3, 0
|
||||
adds r7, r4, 0x1
|
||||
adds r0, 0x1
|
||||
mov r8, r0
|
||||
cmp r3, r12
|
||||
bcs _080D9704
|
||||
lsls r6, r4, 6
|
||||
_080D96E0:
|
||||
lsls r0, r2, 1
|
||||
adds r0, r6
|
||||
add r0, r10
|
||||
ldrh r1, [r5]
|
||||
strh r1, [r0]
|
||||
adds r5, 0x2
|
||||
adds r1, r2, 0x1
|
||||
adds r0, r1, 0
|
||||
asrs r0, 5
|
||||
lsls r0, 5
|
||||
subs r0, r1, r0
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
adds r0, r3, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
cmp r3, r12
|
||||
bcc _080D96E0
|
||||
_080D9704:
|
||||
adds r0, r7, 0
|
||||
asrs r0, 5
|
||||
lsls r0, 5
|
||||
subs r0, r7, r0
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
mov r1, r8
|
||||
lsls r0, r1, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, r9
|
||||
bcc _080D96D0
|
||||
_080D971A:
|
||||
add sp, 0x4
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80D96A0
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
||||
@@ -120,7 +120,7 @@ _080F5660:
|
||||
movs r1, 0x1
|
||||
movs r2, 0x1
|
||||
movs r3, 0xF
|
||||
bl SetWindowBorderStyle
|
||||
bl DrawStdFrameWithCustomTileAndPalette
|
||||
movs r0, 0x1
|
||||
str r0, [sp]
|
||||
str r0, [sp, 0x4]
|
||||
@@ -304,7 +304,7 @@ _080F57D4:
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0
|
||||
bne _080F57FE
|
||||
bl sub_81100E8
|
||||
bl DestroyYesNoMenu
|
||||
adds r0, r6, 0
|
||||
bl DestroyTask
|
||||
bl FreeAllWindowBuffers
|
||||
|
||||
-607
@@ -1,607 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_80F4BFC
|
||||
sub_80F4BFC: @ 80F4BFC
|
||||
push {lr}
|
||||
bl LoadOam
|
||||
bl ProcessSpriteCopyRequests
|
||||
bl TransferPlttBuffer
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80F4BFC
|
||||
|
||||
thumb_func_start sub_80F4C10
|
||||
sub_80F4C10: @ 80F4C10
|
||||
push {r4,lr}
|
||||
ldr r4, _080F4C40 @ =gUnknown_203AB48
|
||||
ldr r0, _080F4C44 @ =0x00001004
|
||||
bl AllocZeroed
|
||||
str r0, [r4]
|
||||
movs r1, 0
|
||||
strb r1, [r0]
|
||||
ldr r0, [r4]
|
||||
strb r1, [r0, 0x1]
|
||||
ldr r0, [r4]
|
||||
strb r1, [r0, 0x2]
|
||||
bl sub_80F4E24
|
||||
ldr r0, _080F4C48 @ =sub_80F4C68
|
||||
movs r1, 0
|
||||
bl CreateTask
|
||||
ldr r0, _080F4C4C @ =sub_80F4C50
|
||||
bl SetMainCallback2
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080F4C40: .4byte gUnknown_203AB48
|
||||
_080F4C44: .4byte 0x00001004
|
||||
_080F4C48: .4byte sub_80F4C68
|
||||
_080F4C4C: .4byte sub_80F4C50
|
||||
thumb_func_end sub_80F4C10
|
||||
|
||||
thumb_func_start sub_80F4C50
|
||||
sub_80F4C50: @ 80F4C50
|
||||
push {lr}
|
||||
bl RunTasks
|
||||
bl AnimateSprites
|
||||
bl BuildOamBuffer
|
||||
bl UpdatePaletteFade
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80F4C50
|
||||
|
||||
thumb_func_start sub_80F4C68
|
||||
sub_80F4C68: @ 80F4C68
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
ldr r0, _080F4C84 @ =gUnknown_203AB48
|
||||
ldr r0, [r0]
|
||||
ldrb r0, [r0, 0x2]
|
||||
cmp r0, 0x8
|
||||
bhi _080F4D30
|
||||
lsls r0, 2
|
||||
ldr r1, _080F4C88 @ =_080F4C8C
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.align 2, 0
|
||||
_080F4C84: .4byte gUnknown_203AB48
|
||||
_080F4C88: .4byte _080F4C8C
|
||||
.align 2, 0
|
||||
_080F4C8C:
|
||||
.4byte _080F4CB0
|
||||
.4byte _080F4CB8
|
||||
.4byte _080F4CBE
|
||||
.4byte _080F4CCA
|
||||
.4byte _080F4CDC
|
||||
.4byte _080F4CFC
|
||||
.4byte _080F4D02
|
||||
.4byte _080F4D10
|
||||
.4byte _080F4D22
|
||||
_080F4CB0:
|
||||
movs r0, 0
|
||||
bl SetVBlankCallback
|
||||
b _080F4D50
|
||||
_080F4CB8:
|
||||
bl sub_80F4E40
|
||||
b _080F4D50
|
||||
_080F4CBE:
|
||||
bl sub_80F4F9C
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _080F4D5A
|
||||
b _080F4D50
|
||||
_080F4CCA:
|
||||
ldr r1, _080F4CD8 @ =gUnknown_84154E8
|
||||
movs r0, 0x1
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl CopyToBgTilemapBuffer
|
||||
b _080F4D50
|
||||
.align 2, 0
|
||||
_080F4CD8: .4byte gUnknown_84154E8
|
||||
_080F4CDC:
|
||||
bl sub_8088F84
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
beq _080F4CF2
|
||||
movs r1, 0x80
|
||||
lsls r1, 1
|
||||
movs r0, 0x14
|
||||
bl SetGpuReg
|
||||
b _080F4D50
|
||||
_080F4CF2:
|
||||
movs r0, 0x14
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
b _080F4D50
|
||||
_080F4CFC:
|
||||
bl sub_80F5018
|
||||
b _080F4D50
|
||||
_080F4D02:
|
||||
movs r0, 0
|
||||
bl CopyBgTilemapBufferToVram
|
||||
movs r0, 0x1
|
||||
bl CopyBgTilemapBufferToVram
|
||||
b _080F4D50
|
||||
_080F4D10:
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
movs r1, 0
|
||||
str r1, [sp]
|
||||
movs r2, 0x10
|
||||
movs r3, 0
|
||||
bl BeginNormalPaletteFade
|
||||
b _080F4D50
|
||||
_080F4D22:
|
||||
ldr r0, _080F4D2C @ =sub_80F4BFC
|
||||
bl SetVBlankCallback
|
||||
b _080F4D50
|
||||
.align 2, 0
|
||||
_080F4D2C: .4byte sub_80F4BFC
|
||||
_080F4D30:
|
||||
ldr r0, _080F4D64 @ =gPaletteFade
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _080F4D50
|
||||
movs r0, 0x5
|
||||
bl PlayFanfareByFanfareNum
|
||||
ldr r0, _080F4D68 @ =gTasks
|
||||
lsls r1, r4, 2
|
||||
adds r1, r4
|
||||
lsls r1, 3
|
||||
adds r1, r0
|
||||
ldr r0, _080F4D6C @ =sub_80F4D74
|
||||
str r0, [r1]
|
||||
_080F4D50:
|
||||
ldr r0, _080F4D70 @ =gUnknown_203AB48
|
||||
ldr r1, [r0]
|
||||
ldrb r0, [r1, 0x2]
|
||||
adds r0, 0x1
|
||||
strb r0, [r1, 0x2]
|
||||
_080F4D5A:
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080F4D64: .4byte gPaletteFade
|
||||
_080F4D68: .4byte gTasks
|
||||
_080F4D6C: .4byte sub_80F4D74
|
||||
_080F4D70: .4byte gUnknown_203AB48
|
||||
thumb_func_end sub_80F4C68
|
||||
|
||||
thumb_func_start sub_80F4D74
|
||||
sub_80F4D74: @ 80F4D74
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
ldr r4, _080F4D90 @ =gUnknown_203AB48
|
||||
ldr r0, [r4]
|
||||
ldrb r1, [r0]
|
||||
cmp r1, 0x1
|
||||
beq _080F4DA8
|
||||
cmp r1, 0x1
|
||||
bgt _080F4D94
|
||||
cmp r1, 0
|
||||
beq _080F4D9A
|
||||
b _080F4DD6
|
||||
.align 2, 0
|
||||
_080F4D90: .4byte gUnknown_203AB48
|
||||
_080F4D94:
|
||||
cmp r1, 0x2
|
||||
beq _080F4DD0
|
||||
b _080F4DD6
|
||||
_080F4D9A:
|
||||
movs r0, 0
|
||||
bl WaitFanfare
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _080F4DD6
|
||||
b _080F4DC2
|
||||
_080F4DA8:
|
||||
ldr r0, _080F4DCC @ =gMain
|
||||
ldrh r0, [r0, 0x2E]
|
||||
ands r1, r0
|
||||
cmp r1, 0
|
||||
beq _080F4DD6
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
movs r1, 0
|
||||
str r1, [sp]
|
||||
movs r2, 0
|
||||
movs r3, 0x10
|
||||
bl BeginNormalPaletteFade
|
||||
_080F4DC2:
|
||||
ldr r1, [r4]
|
||||
ldrb r0, [r1]
|
||||
adds r0, 0x1
|
||||
strb r0, [r1]
|
||||
b _080F4DD6
|
||||
.align 2, 0
|
||||
_080F4DCC: .4byte gMain
|
||||
_080F4DD0:
|
||||
adds r0, r2, 0
|
||||
bl sub_80F4DE0
|
||||
_080F4DD6:
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80F4D74
|
||||
|
||||
thumb_func_start sub_80F4DE0
|
||||
sub_80F4DE0: @ 80F4DE0
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
ldr r0, _080F4E18 @ =gPaletteFade
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
cmp r5, 0
|
||||
bne _080F4E10
|
||||
adds r0, r2, 0
|
||||
bl DestroyTask
|
||||
bl FreeAllWindowBuffers
|
||||
ldr r4, _080F4E1C @ =gUnknown_203AB48
|
||||
ldr r0, [r4]
|
||||
bl Free
|
||||
str r5, [r4]
|
||||
ldr r0, _080F4E20 @ =sub_80568FC
|
||||
bl SetMainCallback2
|
||||
_080F4E10:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080F4E18: .4byte gPaletteFade
|
||||
_080F4E1C: .4byte gUnknown_203AB48
|
||||
_080F4E20: .4byte sub_80568FC
|
||||
thumb_func_end sub_80F4DE0
|
||||
|
||||
thumb_func_start sub_80F4E24
|
||||
sub_80F4E24: @ 80F4E24
|
||||
push {lr}
|
||||
bl ResetSpriteData
|
||||
bl ResetPaletteFade
|
||||
bl FreeAllSpritePalettes
|
||||
bl ResetTasks
|
||||
bl ScanlineEffect_Stop
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80F4E24
|
||||
|
||||
thumb_func_start sub_80F4E40
|
||||
sub_80F4E40: @ 80F4E40
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
sub sp, 0x10
|
||||
movs r3, 0xC0
|
||||
lsls r3, 19
|
||||
movs r4, 0xC0
|
||||
lsls r4, 9
|
||||
add r0, sp, 0xC
|
||||
mov r8, r0
|
||||
add r2, sp, 0x8
|
||||
movs r6, 0
|
||||
ldr r1, _080F4F88 @ =0x040000d4
|
||||
movs r5, 0x80
|
||||
lsls r5, 5
|
||||
ldr r7, _080F4F8C @ =0x81000800
|
||||
movs r0, 0x81
|
||||
lsls r0, 24
|
||||
mov r12, r0
|
||||
_080F4E66:
|
||||
strh r6, [r2]
|
||||
add r0, sp, 0x8
|
||||
str r0, [r1]
|
||||
str r3, [r1, 0x4]
|
||||
str r7, [r1, 0x8]
|
||||
ldr r0, [r1, 0x8]
|
||||
adds r3, r5
|
||||
subs r4, r5
|
||||
cmp r4, r5
|
||||
bhi _080F4E66
|
||||
strh r6, [r2]
|
||||
add r2, sp, 0x8
|
||||
str r2, [r1]
|
||||
str r3, [r1, 0x4]
|
||||
lsrs r0, r4, 1
|
||||
mov r2, r12
|
||||
orrs r0, r2
|
||||
str r0, [r1, 0x8]
|
||||
ldr r0, [r1, 0x8]
|
||||
movs r0, 0xE0
|
||||
lsls r0, 19
|
||||
movs r3, 0x80
|
||||
lsls r3, 3
|
||||
movs r4, 0
|
||||
str r4, [sp, 0xC]
|
||||
ldr r2, _080F4F88 @ =0x040000d4
|
||||
mov r1, r8
|
||||
str r1, [r2]
|
||||
str r0, [r2, 0x4]
|
||||
lsrs r0, r3, 2
|
||||
movs r1, 0x85
|
||||
lsls r1, 24
|
||||
orrs r0, r1
|
||||
str r0, [r2, 0x8]
|
||||
ldr r0, [r2, 0x8]
|
||||
movs r1, 0xA0
|
||||
lsls r1, 19
|
||||
add r0, sp, 0x8
|
||||
strh r4, [r0]
|
||||
str r0, [r2]
|
||||
str r1, [r2, 0x4]
|
||||
lsrs r3, 1
|
||||
movs r0, 0x81
|
||||
lsls r0, 24
|
||||
orrs r3, r0
|
||||
str r3, [r2, 0x8]
|
||||
ldr r0, [r2, 0x8]
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0
|
||||
bl ResetBgsAndClearDma3BusyFlags
|
||||
ldr r1, _080F4F90 @ =gUnknown_8415A08
|
||||
movs r0, 0
|
||||
movs r2, 0x2
|
||||
bl InitBgsFromTemplates
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
movs r0, 0x2
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0x2
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
movs r0, 0x3
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0x3
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
ldr r0, _080F4F94 @ =gUnknown_8415A10
|
||||
bl InitWindows
|
||||
bl DeactivateAllTextPrinters
|
||||
movs r1, 0x82
|
||||
lsls r1, 5
|
||||
movs r0, 0
|
||||
bl SetGpuReg
|
||||
ldr r0, _080F4F98 @ =gUnknown_203AB48
|
||||
ldr r1, [r0]
|
||||
adds r1, 0x4
|
||||
movs r0, 0x1
|
||||
bl SetBgTilemapBuffer
|
||||
movs r0, 0
|
||||
bl ShowBg
|
||||
movs r0, 0x1
|
||||
bl ShowBg
|
||||
movs r5, 0x1E
|
||||
str r5, [sp]
|
||||
movs r4, 0x14
|
||||
str r4, [sp, 0x4]
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl FillBgTilemapBufferRect_Palette0
|
||||
str r5, [sp]
|
||||
str r4, [sp, 0x4]
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl FillBgTilemapBufferRect_Palette0
|
||||
add sp, 0x10
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080F4F88: .4byte 0x040000d4
|
||||
_080F4F8C: .4byte 0x81000800
|
||||
_080F4F90: .4byte gUnknown_8415A08
|
||||
_080F4F94: .4byte gUnknown_8415A10
|
||||
_080F4F98: .4byte gUnknown_203AB48
|
||||
thumb_func_end sub_80F4E40
|
||||
|
||||
thumb_func_start sub_80F4F9C
|
||||
sub_80F4F9C: @ 80F4F9C
|
||||
push {lr}
|
||||
sub sp, 0x4
|
||||
ldr r0, _080F4FB4 @ =gUnknown_203AB48
|
||||
ldr r0, [r0]
|
||||
ldrb r0, [r0, 0x1]
|
||||
cmp r0, 0x1
|
||||
beq _080F4FC8
|
||||
cmp r0, 0x1
|
||||
bgt _080F4FB8
|
||||
cmp r0, 0
|
||||
beq _080F4FC2
|
||||
b _080F4FF8
|
||||
.align 2, 0
|
||||
_080F4FB4: .4byte gUnknown_203AB48
|
||||
_080F4FB8:
|
||||
cmp r0, 0x2
|
||||
beq _080F4FE0
|
||||
cmp r0, 0x3
|
||||
beq _080F4FEE
|
||||
b _080F4FF8
|
||||
_080F4FC2:
|
||||
bl ResetTempTileDataBuffers
|
||||
b _080F5000
|
||||
_080F4FC8:
|
||||
ldr r1, _080F4FDC @ =gUnknown_84147C0
|
||||
movs r0, 0
|
||||
str r0, [sp]
|
||||
movs r0, 0x1
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl DecompressAndCopyTileDataToVram
|
||||
b _080F5000
|
||||
.align 2, 0
|
||||
_080F4FDC: .4byte gUnknown_84147C0
|
||||
_080F4FE0:
|
||||
bl FreeTempTileDataBuffersIfPossible
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
bne _080F5000
|
||||
b _080F500A
|
||||
_080F4FEE:
|
||||
ldr r0, _080F4FFC @ =gUnknown_8415954
|
||||
movs r1, 0
|
||||
movs r2, 0x40
|
||||
bl LoadPalette
|
||||
_080F4FF8:
|
||||
movs r0, 0x1
|
||||
b _080F500C
|
||||
.align 2, 0
|
||||
_080F4FFC: .4byte gUnknown_8415954
|
||||
_080F5000:
|
||||
ldr r0, _080F5014 @ =gUnknown_203AB48
|
||||
ldr r1, [r0]
|
||||
ldrb r0, [r1, 0x1]
|
||||
adds r0, 0x1
|
||||
strb r0, [r1, 0x1]
|
||||
_080F500A:
|
||||
movs r0, 0
|
||||
_080F500C:
|
||||
add sp, 0x4
|
||||
pop {r1}
|
||||
bx r1
|
||||
.align 2, 0
|
||||
_080F5014: .4byte gUnknown_203AB48
|
||||
thumb_func_end sub_80F4F9C
|
||||
|
||||
thumb_func_start sub_80F5018
|
||||
sub_80F5018: @ 80F5018
|
||||
push {r4-r6,lr}
|
||||
sub sp, 0xAC
|
||||
bl DynamicPlaceholderTextUtil_Reset
|
||||
ldr r0, _080F5040 @ =gSaveBlock2Ptr
|
||||
ldr r1, [r0]
|
||||
movs r0, 0
|
||||
bl DynamicPlaceholderTextUtil_SetPlaceholderPtr
|
||||
bl sub_8088F84
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
beq _080F5048
|
||||
ldr r1, _080F5044 @ =gUnknown_841B68F
|
||||
movs r0, 0x1
|
||||
bl DynamicPlaceholderTextUtil_SetPlaceholderPtr
|
||||
b _080F5050
|
||||
.align 2, 0
|
||||
_080F5040: .4byte gSaveBlock2Ptr
|
||||
_080F5044: .4byte gUnknown_841B68F
|
||||
_080F5048:
|
||||
ldr r1, _080F50E0 @ =gUnknown_841B698
|
||||
movs r0, 0x1
|
||||
bl DynamicPlaceholderTextUtil_SetPlaceholderPtr
|
||||
_080F5050:
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl FillWindowPixelBuffer
|
||||
ldr r1, _080F50E4 @ =gUnknown_841B60E
|
||||
add r0, sp, 0xC
|
||||
bl DynamicPlaceholderTextUtil_ExpandPlaceholders
|
||||
movs r5, 0x1
|
||||
negs r5, r5
|
||||
movs r0, 0x2
|
||||
add r1, sp, 0xC
|
||||
adds r2, r5, 0
|
||||
bl GetStringWidth
|
||||
lsrs r2, r0, 1
|
||||
movs r4, 0x78
|
||||
subs r2, r4, r2
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
ldr r6, _080F50E8 @ =gUnknown_8415A04
|
||||
str r6, [sp]
|
||||
str r5, [sp, 0x4]
|
||||
add r0, sp, 0xC
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0
|
||||
movs r1, 0x2
|
||||
movs r3, 0x4
|
||||
bl AddTextPrinterParameterized3
|
||||
ldr r1, _080F50EC @ =gUnknown_841B619
|
||||
add r0, sp, 0xC
|
||||
bl DynamicPlaceholderTextUtil_ExpandPlaceholders
|
||||
movs r0, 0x2
|
||||
add r1, sp, 0xC
|
||||
adds r2, r5, 0
|
||||
bl GetStringWidth
|
||||
lsrs r0, 1
|
||||
subs r4, r0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
str r6, [sp]
|
||||
str r5, [sp, 0x4]
|
||||
add r0, sp, 0xC
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0
|
||||
movs r1, 0x2
|
||||
adds r2, r4, 0
|
||||
movs r3, 0x1E
|
||||
bl AddTextPrinterParameterized3
|
||||
str r6, [sp]
|
||||
movs r0, 0
|
||||
str r0, [sp, 0x4]
|
||||
ldr r0, _080F50F0 @ =gUnknown_841B684
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0
|
||||
movs r1, 0x2
|
||||
movs r2, 0x78
|
||||
movs r3, 0x69
|
||||
bl AddTextPrinterParameterized3
|
||||
movs r0, 0
|
||||
bl PutWindowTilemap
|
||||
add sp, 0xAC
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080F50E0: .4byte gUnknown_841B698
|
||||
_080F50E4: .4byte gUnknown_841B60E
|
||||
_080F50E8: .4byte gUnknown_8415A04
|
||||
_080F50EC: .4byte gUnknown_841B619
|
||||
_080F50F0: .4byte gUnknown_841B684
|
||||
thumb_func_end sub_80F5018
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
||||
@@ -9,13 +9,13 @@
|
||||
sub_80CA618: @ 80CA618
|
||||
push {lr}
|
||||
bl sub_8112364
|
||||
ldr r0, _080CA62C @ =sub_80F4C10
|
||||
ldr r0, _080CA62C @ =CB2_ShowDiploma
|
||||
bl SetMainCallback2
|
||||
bl ScriptContext2_Enable
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080CA62C: .4byte sub_80F4C10
|
||||
_080CA62C: .4byte CB2_ShowDiploma
|
||||
thumb_func_end sub_80CA618
|
||||
|
||||
thumb_func_start sub_80CA630
|
||||
@@ -2076,7 +2076,7 @@ sub_80CB580: @ 80CB580
|
||||
movs r1, 0
|
||||
adds r2, r5, 0
|
||||
movs r3, 0xD
|
||||
bl SetWindowBorderStyle
|
||||
bl DrawStdFrameWithCustomTileAndPalette
|
||||
ldrb r0, [r4]
|
||||
ldr r2, _080CB630 @ =gUnknown_8418075
|
||||
movs r1, 0x2
|
||||
@@ -2141,7 +2141,7 @@ sub_80CB63C: @ 80CB63C
|
||||
ldr r4, _080CB654 @ =gUnknown_2039A0C
|
||||
ldrb r0, [r4]
|
||||
movs r1, 0x1
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
ldrb r0, [r4]
|
||||
bl RemoveWindow
|
||||
pop {r4}
|
||||
@@ -2862,7 +2862,7 @@ sub_80CBBAC: @ 80CBBAC
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0x1
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
ldrh r0, [r4, 0x22]
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
|
||||
+6
-6
@@ -1607,7 +1607,7 @@ sub_80F2AA4: @ 80F2AA4
|
||||
movs r1, 0x1E
|
||||
movs r2, 0
|
||||
movs r3, 0xC
|
||||
bl CreateWindow_SnapRight_StdPal
|
||||
bl CreateTopBarWindowLoadPalette
|
||||
movs r0, 0x3
|
||||
bl Save_LoadGameData
|
||||
lsls r0, 24
|
||||
@@ -1894,7 +1894,7 @@ _080F2CB4:
|
||||
adds r0, r5, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl Menu_PrintHelpSystemUIHeader
|
||||
bl TopBarWindowPrintTwoStrings
|
||||
b _080F2D34
|
||||
.align 2, 0
|
||||
_080F2D08: .4byte 0xffff0000
|
||||
@@ -1911,7 +1911,7 @@ _080F2D24:
|
||||
adds r0, r5, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl Menu_PrintHelpSystemUIHeader
|
||||
bl TopBarWindowPrintTwoStrings
|
||||
_080F2D34:
|
||||
ldr r0, _080F2D58 @ =gTasks
|
||||
ldr r1, [sp, 0x14]
|
||||
@@ -2298,7 +2298,7 @@ sub_80F3030: @ 80F3030
|
||||
bl HideBg
|
||||
movs r0, 0x3
|
||||
bl HideBg
|
||||
bl sub_810F740
|
||||
bl DestroyTopBarWindow
|
||||
bl FreeAllWindowBuffers
|
||||
movs r0, 0x1
|
||||
bl UnsetBgTilemapBuffer
|
||||
@@ -2342,7 +2342,7 @@ sub_80F30A4: @ 80F30A4
|
||||
ldr r0, _080F30FC @ =gText_ABUTTONExit
|
||||
movs r1, 0x8
|
||||
movs r2, 0x1
|
||||
bl PrintTextOnRightSnappedWindow
|
||||
bl TopBarWindowPrintString
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl DrawDialogueFrame
|
||||
@@ -2750,7 +2750,7 @@ sub_80F33DC: @ 80F33DC
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
movs r3, 0xD
|
||||
bl SetWindowBorderStyle
|
||||
bl DrawStdFrameWithCustomTileAndPalette
|
||||
movs r7, 0
|
||||
str r7, [sp]
|
||||
str r7, [sp, 0x4]
|
||||
|
||||
+3
-3
@@ -3715,7 +3715,7 @@ _08109AD4:
|
||||
movs r1, 0x2
|
||||
movs r2, 0
|
||||
movs r3, 0x2
|
||||
bl ProgramAndPlaceMenuCursorOnWindow
|
||||
bl Menu_InitCursor
|
||||
movs r0, 0x6
|
||||
movs r1, 0
|
||||
bl sub_810B9DC
|
||||
@@ -3791,7 +3791,7 @@ sub_8109BE4: @ 8109BE4
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
beq _08109C42
|
||||
bl ProcessMenuInputNoWrapAround
|
||||
bl Menu_ProcessInputNoWrapAround
|
||||
lsls r0, 24
|
||||
asrs r4, r0, 24
|
||||
movs r0, 0x2
|
||||
@@ -6507,7 +6507,7 @@ _0810B290:
|
||||
movs r0, 0x5
|
||||
bl PlaySE
|
||||
movs r0, 0x1
|
||||
bl MoveMenuCursorNoWrapAround
|
||||
bl Menu_MoveCursorNoWrapAround
|
||||
b _0810B36C
|
||||
_0810B29E:
|
||||
movs r0, 0x5
|
||||
|
||||
+1
-1
@@ -8586,7 +8586,7 @@ _0811A168:
|
||||
_0811A174:
|
||||
cmp r5, 0
|
||||
beq _0811A186
|
||||
bl sub_81100E8
|
||||
bl DestroyYesNoMenu
|
||||
movs r0, 0
|
||||
strb r0, [r4]
|
||||
movs r0, 0x3
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ sub_810EBE0: @ 810EBE0
|
||||
adds r4, r0
|
||||
ldrb r0, [r4]
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
ldrb r0, [r4]
|
||||
bl ClearWindowTilemap
|
||||
ldrb r0, [r4]
|
||||
|
||||
-3455
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -3799,8 +3799,8 @@ _080568F4: .4byte gFieldCallback
|
||||
_080568F8: .4byte FieldCallback_ReturnToEventScript2
|
||||
thumb_func_end CB2_ReturnToFieldContinueScriptPlayMapMusic
|
||||
|
||||
thumb_func_start sub_80568FC
|
||||
sub_80568FC: @ 80568FC
|
||||
thumb_func_start CB2_Overworld
|
||||
CB2_Overworld: @ 80568FC
|
||||
push {lr}
|
||||
bl sub_80569BC
|
||||
ldr r1, _08056910 @ =gFieldCallback
|
||||
@@ -3812,7 +3812,7 @@ sub_80568FC: @ 80568FC
|
||||
.align 2, 0
|
||||
_08056910: .4byte gFieldCallback
|
||||
_08056914: .4byte sub_807DF7C
|
||||
thumb_func_end sub_80568FC
|
||||
thumb_func_end CB2_Overworld
|
||||
|
||||
thumb_func_start sub_8056918
|
||||
sub_8056918: @ 8056918
|
||||
|
||||
+18
-18
@@ -3234,7 +3234,7 @@ sub_8120328: @ 8120328
|
||||
bne _0812035E
|
||||
movs r0, 0x6
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
movs r0, 0x6
|
||||
bl ClearWindowTilemap
|
||||
_0812035E:
|
||||
@@ -3302,7 +3302,7 @@ sub_81203B8: @ 81203B8
|
||||
beq _08120410
|
||||
movs r0, 0x6
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
movs r0, 0x6
|
||||
bl ClearWindowTilemap
|
||||
bl MenuHelpers_LinkSomething
|
||||
@@ -6507,7 +6507,7 @@ sub_8121CE4: @ 8121CE4
|
||||
cmp r0, 0xFF
|
||||
beq _08121D04
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
ldrb r0, [r4]
|
||||
bl RemoveWindow
|
||||
movs r0, 0xFF
|
||||
@@ -6608,7 +6608,7 @@ _08121DB0:
|
||||
movs r1, 0
|
||||
movs r2, 0x58
|
||||
movs r3, 0xF
|
||||
bl SetWindowBorderStyle
|
||||
bl DrawStdFrameWithCustomTileAndPalette
|
||||
ldr r4, _08121DF0 @ =gStringVar4
|
||||
ldr r1, _08121DF4 @ =gUnknown_845A2E8
|
||||
lsls r0, r6, 2
|
||||
@@ -6770,7 +6770,7 @@ _08121ED2:
|
||||
movs r1, 0
|
||||
movs r2, 0x4F
|
||||
movs r3, 0xD
|
||||
bl SetWindowBorderStyle
|
||||
bl DrawStdFrameWithCustomTileAndPalette
|
||||
cmp r4, 0x3
|
||||
bne _08121F00
|
||||
ldr r0, [r6]
|
||||
@@ -6854,7 +6854,7 @@ _08121F7A:
|
||||
movs r1, 0x2
|
||||
movs r2, 0
|
||||
movs r3, 0x2
|
||||
bl sub_810F774
|
||||
bl Menu_InitCursorInternal
|
||||
movs r0, 0x2
|
||||
bl ScheduleBgCopyTilemapToVram
|
||||
ldr r0, [r4]
|
||||
@@ -6882,7 +6882,7 @@ sub_8121FC0: @ 8121FC0
|
||||
movs r1, 0
|
||||
movs r2, 0x4F
|
||||
movs r3, 0xD
|
||||
bl SetWindowBorderStyle
|
||||
bl DrawStdFrameWithCustomTileAndPalette
|
||||
ldr r2, _08122008 @ =gTextFlags
|
||||
ldrb r0, [r2]
|
||||
movs r1, 0x1
|
||||
@@ -6947,7 +6947,7 @@ sub_8122034: @ 8122034
|
||||
movs r1, 0
|
||||
movs r2, 0x4F
|
||||
movs r3, 0xD
|
||||
bl SetWindowBorderStyle
|
||||
bl DrawStdFrameWithCustomTileAndPalette
|
||||
ldr r0, [r4]
|
||||
ldrb r0, [r0, 0xC]
|
||||
pop {r4}
|
||||
@@ -7054,7 +7054,7 @@ sub_8122110: @ 8122110
|
||||
bl ClearWindowTilemap
|
||||
adds r0, r4, 0
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow_BorderThickness2
|
||||
bl ClearDialogWindowAndFrameToTransparent
|
||||
adds r0, r4, 0
|
||||
bl RemoveWindow
|
||||
movs r0, 0x2
|
||||
@@ -8550,27 +8550,27 @@ sub_8122C5C: @ 8122C5C
|
||||
ldrb r0, [r0, 0x17]
|
||||
cmp r0, 0x3
|
||||
bhi _08122CA0
|
||||
bl ProcessMenuInputNoWrapAround_other
|
||||
bl Menu_ProcessInputNoWrapAround_other
|
||||
b _08122CA4
|
||||
.align 2, 0
|
||||
_08122C94: .4byte gPaletteFade
|
||||
_08122C98: .4byte gTasks+0x8
|
||||
_08122C9C: .4byte gUnknown_203B09C
|
||||
_08122CA0:
|
||||
bl ProcessMenuInput_other
|
||||
bl Menu_ProcessInput_other
|
||||
_08122CA4:
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
movs r0, 0
|
||||
ldrsh r4, [r7, r0]
|
||||
bl GetMenuCursorPos
|
||||
bl Menu_GetCursorPos
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r4, r0
|
||||
beq _08122CCE
|
||||
ldr r0, _08122D14 @ =gUnknown_203B09C
|
||||
ldr r4, [r0]
|
||||
bl GetMenuCursorPos
|
||||
bl Menu_GetCursorPos
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
adds r4, 0xF
|
||||
@@ -8578,7 +8578,7 @@ _08122CA4:
|
||||
ldrb r0, [r4]
|
||||
bl sub_8122138
|
||||
_08122CCE:
|
||||
bl GetMenuCursorPos
|
||||
bl Menu_GetCursorPos
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r7]
|
||||
@@ -11600,7 +11600,7 @@ sub_81245A4: @ 81245A4
|
||||
push {r4-r7,lr}
|
||||
lsls r0, 24
|
||||
lsrs r6, r0, 24
|
||||
bl GetMenuCursorPos
|
||||
bl Menu_GetCursorPos
|
||||
ldr r5, _08124610 @ =gUnknown_203B09C
|
||||
ldr r1, [r5]
|
||||
lsls r0, 24
|
||||
@@ -13684,7 +13684,7 @@ _08125680:
|
||||
mov r1, r8
|
||||
movs r2, 0
|
||||
movs r3, 0x2
|
||||
bl ProgramAndPlaceMenuCursorOnWindow
|
||||
bl Menu_InitCursor
|
||||
movs r0, 0x2
|
||||
bl ScheduleBgCopyTilemapToVram
|
||||
add sp, 0x10
|
||||
@@ -13706,7 +13706,7 @@ sub_81256C0: @ 81256C0
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
adds r5, r4, 0
|
||||
bl ProcessMenuInput
|
||||
bl Menu_ProcessInput
|
||||
lsls r0, 24
|
||||
asrs r1, r0, 24
|
||||
movs r0, 0x2
|
||||
@@ -13813,7 +13813,7 @@ sub_8125790: @ 8125790
|
||||
ldr r0, [r0]
|
||||
adds r0, 0xC
|
||||
bl sub_8121CE4
|
||||
bl GetMenuCursorPos
|
||||
bl Menu_GetCursorPos
|
||||
ldr r1, _081257C4 @ =gUnknown_203B0A0
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
|
||||
+14
-14
@@ -187,7 +187,7 @@ _080EB77E:
|
||||
movs r1, 0x2
|
||||
movs r2, 0
|
||||
movs r3, 0x2
|
||||
bl ProgramAndPlaceMenuCursorOnWindow
|
||||
bl Menu_InitCursor
|
||||
movs r0, 0
|
||||
bl ScheduleBgCopyTilemapToVram
|
||||
ldr r1, _080EB814 @ =gTasks
|
||||
@@ -223,7 +223,7 @@ sub_80EB81C: @ 80EB81C
|
||||
lsls r6, r1, 3
|
||||
ldr r7, _080EB870 @ =gTasks+0x8
|
||||
adds r4, r6, r7
|
||||
bl ProcessMenuInputNoWrapAround
|
||||
bl Menu_ProcessInputNoWrapAround
|
||||
lsls r0, 24
|
||||
asrs r5, r0, 24
|
||||
movs r0, 0x2
|
||||
@@ -237,7 +237,7 @@ sub_80EB81C: @ 80EB81C
|
||||
bl PlaySE
|
||||
ldrb r0, [r4, 0x14]
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
ldrb r0, [r4, 0x14]
|
||||
bl ClearWindowTilemap
|
||||
ldrb r0, [r4, 0x14]
|
||||
@@ -256,7 +256,7 @@ _080EB874: .4byte sub_80EB9B8
|
||||
_080EB878:
|
||||
ldrb r0, [r4, 0x14]
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
ldrb r0, [r4, 0x14]
|
||||
bl ClearWindowTilemap
|
||||
ldrb r0, [r4, 0x14]
|
||||
@@ -488,7 +488,7 @@ _080EBA1E:
|
||||
movs r1, 0x2
|
||||
movs r2, 0
|
||||
movs r3, 0x2
|
||||
bl ProgramAndPlaceMenuCursorOnWindow
|
||||
bl Menu_InitCursor
|
||||
movs r0, 0
|
||||
bl ScheduleBgCopyTilemapToVram
|
||||
ldr r1, _080EBA88 @ =gUnknown_84021DC
|
||||
@@ -541,7 +541,7 @@ sub_80EBAB8: @ 80EBAB8
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _080EBAE8
|
||||
bl GetMenuCursorPos
|
||||
bl Menu_GetCursorPos
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _080EBB64
|
||||
@@ -557,7 +557,7 @@ _080EBAE8:
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _080EBB20
|
||||
bl GetMenuCursorPos
|
||||
bl Menu_GetCursorPos
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x2
|
||||
@@ -566,9 +566,9 @@ _080EBAE8:
|
||||
bl PlaySE
|
||||
movs r0, 0x1
|
||||
_080EBB04:
|
||||
bl MoveMenuCursor
|
||||
bl Menu_MoveCursor
|
||||
ldr r4, _080EBB1C @ =gUnknown_84021DC
|
||||
bl GetMenuCursorPos
|
||||
bl Menu_GetCursorPos
|
||||
lsls r0, 24
|
||||
lsrs r0, 22
|
||||
adds r0, r4
|
||||
@@ -586,7 +586,7 @@ _080EBB20:
|
||||
movs r0, 0x5
|
||||
bl PlaySE
|
||||
ldr r4, _080EBB48 @ =gUnknown_8402208
|
||||
bl GetMenuCursorPos
|
||||
bl Menu_GetCursorPos
|
||||
lsls r0, 24
|
||||
lsrs r0, 21
|
||||
adds r4, 0x4
|
||||
@@ -752,7 +752,7 @@ _080EBC78: .4byte sub_80EBCAC
|
||||
_080EBC7C:
|
||||
ldrb r0, [r4, 0x14]
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
ldrb r0, [r4, 0x14]
|
||||
bl ClearWindowTilemap
|
||||
ldrb r0, [r4, 0x14]
|
||||
@@ -861,7 +861,7 @@ sub_80EBD48: @ 80EBD48
|
||||
adds r4, r0
|
||||
ldrb r0, [r4, 0x14]
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
ldrb r0, [r4, 0x14]
|
||||
bl ClearWindowTilemap
|
||||
ldrb r0, [r4, 0x14]
|
||||
@@ -1341,7 +1341,7 @@ sub_80EC0D8: @ 80EC0D8
|
||||
movs r1, 0x2
|
||||
movs r2, 0
|
||||
movs r3, 0x2
|
||||
bl ProgramAndPlaceMenuCursorOnWindow
|
||||
bl Menu_InitCursor
|
||||
movs r0, 0
|
||||
bl ScheduleBgCopyTilemapToVram
|
||||
ldr r1, _080EC154 @ =gTasks
|
||||
@@ -1369,7 +1369,7 @@ sub_80EC15C: @ 80EC15C
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
adds r6, r5, 0
|
||||
bl ProcessMenuInput_other
|
||||
bl Menu_ProcessInput_other
|
||||
lsls r0, 24
|
||||
asrs r4, r0, 24
|
||||
movs r0, 0x2
|
||||
|
||||
+3
-3
@@ -220,8 +220,8 @@ _08088F7C:
|
||||
bx r1
|
||||
thumb_func_end sub_8088F58
|
||||
|
||||
thumb_func_start sub_8088F84
|
||||
sub_8088F84: @ 8088F84
|
||||
thumb_func_start HasAllKantoMons
|
||||
HasAllKantoMons: @ 8088F84
|
||||
push {r4,r5,lr}
|
||||
movs r0, 0
|
||||
_08088F88:
|
||||
@@ -277,6 +277,6 @@ _08088FE8:
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8088F84
|
||||
thumb_func_end HasAllKantoMons
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
||||
|
||||
@@ -5304,7 +5304,7 @@ sub_814A218: @ 814A218
|
||||
_0814A22C: .4byte gUnknown_203F3D8
|
||||
_0814A230:
|
||||
bl sub_814A6CC
|
||||
bl sub_81100E8
|
||||
bl DestroyYesNoMenu
|
||||
movs r0, 0
|
||||
bl CopyBgTilemapBufferToVram
|
||||
ldr r1, [r5]
|
||||
|
||||
@@ -1703,7 +1703,7 @@ sub_811D2D0: @ 811D2D0
|
||||
bl ClearWindowTilemap
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
movs r0, 0
|
||||
movs r1, 0x1
|
||||
bl CopyWindowToVram
|
||||
|
||||
@@ -1466,7 +1466,7 @@ _0808C454:
|
||||
strh r0, [r5, 0x8]
|
||||
b _0808C69C
|
||||
_0808C45C:
|
||||
bl ProcessMenuInput
|
||||
bl Menu_ProcessInput
|
||||
lsls r0, 24
|
||||
asrs r0, 24
|
||||
strh r0, [r5, 0xC]
|
||||
@@ -1665,8 +1665,8 @@ _0808C5D8:
|
||||
_0808C5F4:
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
bl MoveMenuCursor
|
||||
bl GetMenuCursorPos
|
||||
bl Menu_MoveCursor
|
||||
bl Menu_GetCursorPos
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r5, 0xA]
|
||||
@@ -1699,8 +1699,8 @@ _0808C624:
|
||||
strh r6, [r5, 0xA]
|
||||
_0808C63C:
|
||||
movs r0, 0x1
|
||||
bl MoveMenuCursor
|
||||
bl GetMenuCursorPos
|
||||
bl Menu_MoveCursor
|
||||
bl Menu_GetCursorPos
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r5, 0xA]
|
||||
@@ -1861,7 +1861,7 @@ sub_808C72C: @ 808C72C
|
||||
movs r1, 0x2
|
||||
movs r2, 0
|
||||
movs r3, 0x2
|
||||
bl ProgramAndPlaceMenuCursorOnWindow
|
||||
bl Menu_InitCursor
|
||||
mov r0, r10
|
||||
strh r5, [r0]
|
||||
add sp, 0xC
|
||||
@@ -8349,7 +8349,7 @@ sub_808FCE8: @ 808FCE8
|
||||
lsls r4, 24
|
||||
asrs r4, 24
|
||||
adds r0, r4, 0
|
||||
bl MoveMenuCursorNoWrapAround
|
||||
bl Menu_MoveCursorNoWrapAround
|
||||
add sp, 0xC
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
@@ -8363,7 +8363,7 @@ sub_808FD20: @ 808FD20
|
||||
push {lr}
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
movs r0, 0
|
||||
bl ScheduleBgCopyTilemapToVram
|
||||
pop {r0}
|
||||
@@ -18931,7 +18931,7 @@ sub_8094E88: @ 8094E88
|
||||
movs r1, 0
|
||||
movs r2, 0xB
|
||||
movs r3, 0xE
|
||||
bl SetWindowBorderStyle
|
||||
bl DrawStdFrameWithCustomTileAndPalette
|
||||
ldr r2, [r5]
|
||||
adds r0, r2, r4
|
||||
ldrb r0, [r0]
|
||||
@@ -18961,7 +18961,7 @@ sub_8094E88: @ 8094E88
|
||||
movs r1, 0x1
|
||||
movs r2, 0
|
||||
movs r3, 0x2
|
||||
bl ProgramAndPlaceMenuCursorOnWindow
|
||||
bl Menu_InitCursor
|
||||
movs r0, 0
|
||||
bl ScheduleBgCopyTilemapToVram
|
||||
ldr r0, [r5]
|
||||
@@ -19023,7 +19023,7 @@ _08094FB6:
|
||||
bl PlaySE
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
bl MoveMenuCursor
|
||||
bl Menu_MoveCursor
|
||||
b _08094FF2
|
||||
.align 2, 0
|
||||
_08094FD0: .4byte gMain
|
||||
@@ -19035,10 +19035,10 @@ _08094FD4:
|
||||
movs r0, 0x5
|
||||
bl PlaySE
|
||||
movs r0, 0x1
|
||||
bl MoveMenuCursor
|
||||
bl Menu_MoveCursor
|
||||
b _08094FF2
|
||||
_08094FEA:
|
||||
bl GetMenuCursorPos
|
||||
bl Menu_GetCursorPos
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
_08094FF2:
|
||||
@@ -19077,7 +19077,7 @@ sub_8095024: @ 8095024
|
||||
adds r0, r4
|
||||
ldrb r0, [r0]
|
||||
movs r1, 0x1
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
ldr r0, [r5]
|
||||
adds r0, r4
|
||||
ldrb r0, [r0]
|
||||
|
||||
+13
-13
@@ -271,7 +271,7 @@ _0809CB32:
|
||||
movs r1, 0x2
|
||||
movs r2, 0x8
|
||||
movs r3, 0x2
|
||||
bl sub_810FBE8
|
||||
bl MultichoiceList_PrintItems
|
||||
b _0809CB7A
|
||||
.align 2, 0
|
||||
_0809CB54: .4byte sub_809D6D4
|
||||
@@ -290,7 +290,7 @@ _0809CB5C:
|
||||
movs r1, 0x2
|
||||
movs r2, 0x8
|
||||
movs r3, 0x2
|
||||
bl sub_810FBE8
|
||||
bl MultichoiceList_PrintItems
|
||||
_0809CB7A:
|
||||
movs r0, 0xE
|
||||
str r0, [sp]
|
||||
@@ -301,7 +301,7 @@ _0809CB7A:
|
||||
movs r1, 0x2
|
||||
movs r2, 0
|
||||
movs r3, 0x2
|
||||
bl ProgramAndPlaceMenuCursorOnWindow
|
||||
bl Menu_InitCursor
|
||||
ldr r0, [sp, 0x18]
|
||||
adds r1, r7, 0
|
||||
adds r2, r5, 0
|
||||
@@ -475,10 +475,10 @@ _0809CCD0:
|
||||
ldrsh r0, [r5, r1]
|
||||
cmp r0, 0
|
||||
bne _0809CCDE
|
||||
bl ProcessMenuInputNoWrapAround
|
||||
bl Menu_ProcessInputNoWrapAround
|
||||
b _0809CCE2
|
||||
_0809CCDE:
|
||||
bl ProcessMenuInput
|
||||
bl Menu_ProcessInput
|
||||
_0809CCE2:
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
@@ -562,7 +562,7 @@ _0809CD78:
|
||||
bl FillWindowPixelBuffer
|
||||
ldr r4, _0809CDAC @ =gUnknown_83E0738
|
||||
_0809CD82:
|
||||
bl GetMenuCursorPos
|
||||
bl Menu_GetCursorPos
|
||||
lsls r0, 24
|
||||
lsrs r0, 22
|
||||
adds r0, r4
|
||||
@@ -587,7 +587,7 @@ _0809CDB0:
|
||||
movs r1, 0x11
|
||||
bl FillWindowPixelBuffer
|
||||
ldr r4, _0809CDE8 @ =gUnknown_83E0748
|
||||
bl GetMenuCursorPos
|
||||
bl Menu_GetCursorPos
|
||||
lsls r0, 24
|
||||
lsrs r0, 22
|
||||
adds r0, r4
|
||||
@@ -833,7 +833,7 @@ _0809CF08:
|
||||
movs r1, 0x1
|
||||
adds r2, r5, 0
|
||||
movs r3, 0x10
|
||||
bl sub_8110104
|
||||
bl MultichoiceGrid_PrintItems
|
||||
ldrb r0, [r4, 0x14]
|
||||
str r5, [sp]
|
||||
str r7, [sp, 0x4]
|
||||
@@ -843,7 +843,7 @@ _0809CF08:
|
||||
movs r1, 0x1
|
||||
movs r2, 0
|
||||
movs r3, 0x1
|
||||
bl sub_811030C
|
||||
bl MultichoiceGrid_InitCursor
|
||||
movs r0, 0
|
||||
bl ScheduleBgCopyTilemapToVram
|
||||
_0809CFB8:
|
||||
@@ -874,7 +874,7 @@ sub_809CFDC: @ 809CFDC
|
||||
lsls r0, 3
|
||||
ldr r1, _0809D018 @ =gTasks+0x8
|
||||
adds r5, r0, r1
|
||||
bl sub_8110650
|
||||
bl Menu_ProcessInputGridLayout
|
||||
lsls r0, 24
|
||||
asrs r1, r0, 24
|
||||
movs r0, 0x2
|
||||
@@ -1138,7 +1138,7 @@ _0809D1FA:
|
||||
movs r1, 0x2
|
||||
movs r2, 0
|
||||
movs r3, 0x2
|
||||
bl ProgramAndPlaceMenuCursorOnWindow
|
||||
bl Menu_InitCursor
|
||||
movs r0, 0
|
||||
mov r1, r9
|
||||
adds r2, r6, 0
|
||||
@@ -1721,7 +1721,7 @@ sub_809D6B0: @ 809D6B0
|
||||
bl ClearWindowTilemap
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x1
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
adds r0, r4, 0
|
||||
bl RemoveWindow
|
||||
pop {r4}
|
||||
@@ -1946,7 +1946,7 @@ _0809D844:
|
||||
movs r1, 0x2
|
||||
movs r2, 0
|
||||
movs r3, 0x2
|
||||
bl ProgramAndPlaceMenuCursorOnWindow
|
||||
bl Menu_InitCursor
|
||||
movs r0, 0
|
||||
mov r1, r9
|
||||
adds r2, r7, 0
|
||||
|
||||
+9
-9
@@ -74,7 +74,7 @@ _0809AAF8:
|
||||
movs r1, 0x2
|
||||
movs r2, 0
|
||||
movs r3, 0x2
|
||||
bl ProgramAndPlaceMenuCursorOnWindow
|
||||
bl Menu_InitCursor
|
||||
ldrb r0, [r4]
|
||||
bl PutWindowTilemap
|
||||
ldrb r0, [r4]
|
||||
@@ -194,7 +194,7 @@ sub_809AC10: @ 809AC10
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
adds r5, r4, 0
|
||||
bl ProcessMenuInputNoWrapAround
|
||||
bl Menu_ProcessInputNoWrapAround
|
||||
lsls r0, 24
|
||||
asrs r1, r0, 24
|
||||
movs r0, 0x2
|
||||
@@ -211,7 +211,7 @@ sub_809AC10: @ 809AC10
|
||||
b _0809AC52
|
||||
_0809AC3C:
|
||||
ldr r4, _0809AC58 @ =gUnknown_83DF09C
|
||||
bl GetMenuCursorPos
|
||||
bl Menu_GetCursorPos
|
||||
lsls r0, 24
|
||||
lsrs r0, 21
|
||||
adds r4, 0x4
|
||||
@@ -332,7 +332,7 @@ sub_809AD24: @ 809AD24
|
||||
ldr r4, _0809AD3C @ =gUnknown_2039950
|
||||
ldrb r0, [r4]
|
||||
movs r1, 0x2
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
ldrb r0, [r4]
|
||||
bl RemoveWindow
|
||||
pop {r4}
|
||||
@@ -2396,10 +2396,10 @@ _0809BDD4:
|
||||
bl sub_809B73C
|
||||
movs r0, 0x3
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
movs r0, 0x3
|
||||
bl ClearWindowTilemap
|
||||
movs r0, 0x1
|
||||
@@ -2442,10 +2442,10 @@ _0809BE54:
|
||||
bl sub_809B73C
|
||||
movs r0, 0x3
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
movs r0, 0x3
|
||||
bl ClearWindowTilemap
|
||||
movs r0, 0x1
|
||||
@@ -2601,7 +2601,7 @@ sub_809BF98: @ 809BF98
|
||||
adds r4, r5, r6
|
||||
movs r0, 0x2
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow_BorderThickness2
|
||||
bl ClearDialogWindowAndFrameToTransparent
|
||||
ldrb r0, [r4, 0xE]
|
||||
movs r1, 0x1
|
||||
bl sub_809B57C
|
||||
|
||||
+2
-2
@@ -4607,7 +4607,7 @@ sub_8141AD8: @ 8141AD8
|
||||
lsls r4, 24
|
||||
asrs r4, 24
|
||||
adds r0, r4, 0
|
||||
bl MoveMenuCursorNoWrapAround
|
||||
bl Menu_MoveCursorNoWrapAround
|
||||
bl sub_814112C
|
||||
movs r1, 0x1
|
||||
str r1, [r0, 0x28]
|
||||
@@ -4627,7 +4627,7 @@ sub_8141B18: @ 8141B18
|
||||
ldr r0, [r4, 0x28]
|
||||
cmp r0, 0
|
||||
beq _08141B2E
|
||||
bl sub_81100E8
|
||||
bl DestroyYesNoMenu
|
||||
movs r0, 0
|
||||
str r0, [r4, 0x28]
|
||||
_08141B2E:
|
||||
|
||||
+7
-7
@@ -220,7 +220,7 @@ sub_806EF18: @ 806EF18
|
||||
ldr r4, _0806EF40 @ =gUnknown_2037101
|
||||
ldrb r0, [r4]
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
ldrb r0, [r4]
|
||||
movs r1, 0x2
|
||||
bl CopyWindowToVram
|
||||
@@ -438,7 +438,7 @@ _0806F0C4:
|
||||
movs r1, 0x2
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl ProgramAndPlaceMenuCursorOnWindow
|
||||
bl Menu_InitCursor
|
||||
strb r0, [r4]
|
||||
bl MenuHelpers_LinkSomething
|
||||
lsls r0, 24
|
||||
@@ -663,7 +663,7 @@ sub_806F280: @ 806F280
|
||||
bl PlaySE
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
bl MoveMenuCursor
|
||||
bl Menu_MoveCursor
|
||||
ldr r4, _0806F360 @ =gUnknown_20370F4
|
||||
strb r0, [r4]
|
||||
bl MenuHelpers_LinkSomething
|
||||
@@ -698,7 +698,7 @@ _0806F2D2:
|
||||
movs r0, 0x5
|
||||
bl PlaySE
|
||||
movs r0, 0x1
|
||||
bl MoveMenuCursor
|
||||
bl Menu_MoveCursor
|
||||
ldr r4, _0806F360 @ =gUnknown_20370F4
|
||||
strb r0, [r4]
|
||||
bl MenuHelpers_LinkSomething
|
||||
@@ -1080,7 +1080,7 @@ sub_806F5C8: @ 806F5C8
|
||||
_0806F5E4:
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow_BorderThickness2
|
||||
bl ClearDialogWindowAndFrameToTransparent
|
||||
bl sub_806F14C
|
||||
bl sub_812B248
|
||||
ldr r1, _0806F5FC @ =gUnknown_20370F0
|
||||
@@ -1093,7 +1093,7 @@ _0806F600: .4byte sub_806F280
|
||||
_0806F604:
|
||||
movs r0, 0
|
||||
movs r1, 0x1
|
||||
bl ClearMenuWindow_BorderThickness2
|
||||
bl ClearDialogWindowAndFrameToTransparent
|
||||
bl sub_80696C0
|
||||
bl ScriptContext2_Disable
|
||||
bl sub_812B248
|
||||
@@ -2019,7 +2019,7 @@ sub_806FCF4: @ 806FCF4
|
||||
movs r1, 0
|
||||
adds r2, r4, 0
|
||||
movs r3, 0xD
|
||||
bl SetWindowBorderStyle
|
||||
bl DrawStdFrameWithCustomTileAndPalette
|
||||
ldr r4, _0806FE60 @ =gStringVar4
|
||||
movs r0, 0x3
|
||||
adds r1, r4, 0
|
||||
|
||||
+3
-3
@@ -3379,7 +3379,7 @@ _0804E208:
|
||||
movs r1, 0x3
|
||||
movs r2, 0x10
|
||||
movs r3, 0x2
|
||||
bl sub_810FC80
|
||||
bl UnionRoomAndTradeMenuPrintOptions
|
||||
movs r0, 0x10
|
||||
str r0, [sp]
|
||||
movs r0, 0x2
|
||||
@@ -3390,7 +3390,7 @@ _0804E208:
|
||||
movs r1, 0x3
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl ProgramAndPlaceMenuCursorOnWindow
|
||||
bl Menu_InitCursor
|
||||
movs r0, 0x1
|
||||
bl PutWindowTilemap
|
||||
movs r0, 0x1
|
||||
@@ -3533,7 +3533,7 @@ _0804E384: .4byte 0x06010000
|
||||
sub_804E388: @ 804E388
|
||||
push {lr}
|
||||
sub sp, 0x4
|
||||
bl ProcessMenuInputNoWrapAround
|
||||
bl Menu_ProcessInputNoWrapAround
|
||||
lsls r0, 24
|
||||
asrs r0, 24
|
||||
movs r1, 0x1
|
||||
|
||||
+2
-2
@@ -1070,7 +1070,7 @@ _080898BE:
|
||||
adds r0, 0x1
|
||||
strb r0, [r5, 0x1]
|
||||
_080898CE:
|
||||
bl sub_8088F84
|
||||
bl HasAllKantoMons
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
beq _080898DE
|
||||
@@ -1117,7 +1117,7 @@ _08089918:
|
||||
_0808991C:
|
||||
bl sub_8088F58
|
||||
strb r0, [r5, 0x3]
|
||||
bl sub_8088F84
|
||||
bl HasAllKantoMons
|
||||
adds r6, r5, 0
|
||||
adds r6, 0x4D
|
||||
strb r0, [r6]
|
||||
|
||||
@@ -499,7 +499,7 @@ _081287FE:
|
||||
.align 2, 0
|
||||
_0812880C: .4byte gUnknown_203B0E0
|
||||
_08128810:
|
||||
bl ProcessMenuInput
|
||||
bl Menu_ProcessInput
|
||||
lsls r0, 24
|
||||
asrs r0, 8
|
||||
lsrs r6, r0, 16
|
||||
@@ -534,7 +534,7 @@ _08128848:
|
||||
movs r0, 0x5
|
||||
bl PlaySE
|
||||
movs r0, 0x1
|
||||
bl MoveMenuCursor
|
||||
bl Menu_MoveCursor
|
||||
b _081288CE
|
||||
.align 2, 0
|
||||
_08128864: .4byte gMain
|
||||
@@ -4299,7 +4299,7 @@ sub_812A424: @ 812A424
|
||||
movs r1, 0x2
|
||||
movs r2, 0
|
||||
movs r3, 0x2
|
||||
bl ProgramAndPlaceMenuCursorOnWindow
|
||||
bl Menu_InitCursor
|
||||
_0812A4F0:
|
||||
add sp, 0x14
|
||||
pop {r3}
|
||||
@@ -4329,7 +4329,7 @@ sub_812A51C: @ 812A51C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
ldr r0, [r4]
|
||||
ldrb r0, [r0, 0x18]
|
||||
bl ClearWindowTilemap
|
||||
@@ -4366,7 +4366,7 @@ _0812A564: .4byte gUnknown_203B0E4
|
||||
thumb_func_start sub_812A568
|
||||
sub_812A568: @ 812A568
|
||||
push {lr}
|
||||
bl ProcessMenuInput
|
||||
bl Menu_ProcessInput
|
||||
lsls r0, 24
|
||||
asrs r0, 24
|
||||
pop {r1}
|
||||
@@ -4568,7 +4568,7 @@ sub_812A6F4: @ 812A6F4
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
ldr r0, [r4]
|
||||
ldrb r0, [r0, 0x1E]
|
||||
bl ClearWindowTilemap
|
||||
@@ -4987,7 +4987,7 @@ sub_812AA10: @ 812AA10
|
||||
movs r1, 0x2
|
||||
movs r2, 0xE
|
||||
movs r3, 0x5
|
||||
bl sub_810FC80
|
||||
bl UnionRoomAndTradeMenuPrintOptions
|
||||
bl sub_81296F4
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
@@ -5000,7 +5000,7 @@ sub_812AA10: @ 812AA10
|
||||
movs r1, 0x2
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl ProgramAndPlaceMenuCursorOnWindow
|
||||
bl Menu_InitCursor
|
||||
movs r0, 0x3
|
||||
bl PutWindowTilemap
|
||||
add sp, 0xC
|
||||
@@ -5015,7 +5015,7 @@ sub_812AA64: @ 812AA64
|
||||
push {lr}
|
||||
movs r0, 0x3
|
||||
movs r1, 0
|
||||
bl ClearMenuWindow
|
||||
bl ClearStdWindowAndFrameToTransparent
|
||||
movs r0, 0x3
|
||||
bl ClearWindowTilemap
|
||||
pop {r0}
|
||||
|
||||
BIN
Binary file not shown.
+1
-21
@@ -345,24 +345,6 @@ gUnknown_8414588:: @ 8414588
|
||||
gUnknown_84145BC:: @ 84145BC
|
||||
.incbin "baserom.gba", 0x4145BC, 0x204
|
||||
|
||||
gUnknown_84147C0:: @ 84147C0
|
||||
.incbin "baserom.gba", 0x4147C0, 0xD28
|
||||
|
||||
gUnknown_84154E8:: @ 84154E8
|
||||
.incbin "baserom.gba", 0x4154E8, 0x46C
|
||||
|
||||
gUnknown_8415954:: @ 8415954
|
||||
.incbin "baserom.gba", 0x415954, 0xB0
|
||||
|
||||
gUnknown_8415A04:: @ 8415A04
|
||||
.incbin "baserom.gba", 0x415A04, 0x4
|
||||
|
||||
gUnknown_8415A08:: @ 8415A08
|
||||
.incbin "baserom.gba", 0x415A08, 0x8
|
||||
|
||||
gUnknown_8415A10:: @ 8415A10
|
||||
.incbin "baserom.gba", 0x415A10, 0x10
|
||||
|
||||
@ strings
|
||||
|
||||
.section .rodata.841EE44
|
||||
@@ -823,9 +805,7 @@ gUnknown_8454000:: @ 8454000
|
||||
gUnknown_8454003:: @ 8454003
|
||||
.incbin "baserom.gba", 0x454003, 0x2615
|
||||
|
||||
gUnknown_8456618:: @ 8456618
|
||||
.incbin "baserom.gba", 0x456618, 0x4
|
||||
|
||||
@ menu.o
|
||||
@ quest_log.o
|
||||
@ link_rfu_3.o
|
||||
.section .rodata.8456C74
|
||||
|
||||
+1
-1
@@ -441,7 +441,7 @@ gSpecials:: @ 815FD60
|
||||
def_special sub_8147594
|
||||
def_special sub_80CD034
|
||||
def_special sub_815D834
|
||||
def_special sub_8088F84
|
||||
def_special HasAllKantoMons
|
||||
def_special sub_80CD074
|
||||
def_special sub_80CD098
|
||||
def_special sub_811B15C
|
||||
|
||||
+2285
-327
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
@@ -0,0 +1,35 @@
|
||||
JASC-PAL
|
||||
0100
|
||||
32
|
||||
123 205 172
|
||||
255 0 255
|
||||
222 230 139
|
||||
205 246 156
|
||||
230 222 164
|
||||
197 238 172
|
||||
205 230 213
|
||||
213 246 172
|
||||
205 230 164
|
||||
238 255 156
|
||||
197 238 172
|
||||
222 230 238
|
||||
222 238 238
|
||||
213 246 172
|
||||
246 238 172
|
||||
238 238 139
|
||||
123 205 172
|
||||
255 0 255
|
||||
255 0 255
|
||||
246 246 205
|
||||
230 230 148
|
||||
230 230 148
|
||||
230 230 148
|
||||
238 238 164
|
||||
222 222 148
|
||||
255 238 180
|
||||
238 230 164
|
||||
238 222 180
|
||||
246 246 164
|
||||
246 230 131
|
||||
246 230 172
|
||||
222 238 222
|
||||
+39
-32
@@ -17,44 +17,51 @@ struct MenuAction
|
||||
} func;
|
||||
};
|
||||
|
||||
void AddTextPrinterParameterized3(u8, u8, u8, u8, const void *, s8, const u8 *);
|
||||
void sub_8198070(u8 windowId, bool8 copyToVram);
|
||||
void SetWindowTemplateFields(struct WindowTemplate* template, u8 priority, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 palNum, u16 baseBlock);
|
||||
void SetWindowBorderStyle(u8 windowId, bool8 copyToVram, u16 tileStart, u8 palette);
|
||||
void ScheduleBgCopyTilemapToVram(u8 bgNum);
|
||||
void PrintMenuTable(u8 idx, u8 nstrs, const struct MenuAction *strs);
|
||||
void InitMenuInUpperLeftCornerPlaySoundWhenAPressed(u8 idx, u8 nstrs,u8);
|
||||
u8 GetMenuCursorPos(void);
|
||||
s8 ProcessMenuInput(void);
|
||||
s8 ProcessMenuInputNoWrapAround(void);
|
||||
void ResetTempTileDataBuffers(void);
|
||||
void *DecompressAndCopyTileDataToVram(u8 bg_id, const void *src, u32 size, u16 offset, u8 mode);
|
||||
bool8 FreeTempTileDataBuffersIfPossible(void);
|
||||
u64 sub_8198A50(struct WindowTemplate*, u8, u8, u8, u8, u8, u8, u16); // returns something but it isn't used, fix when menu.s is decomp'd
|
||||
s8 Menu_ProcessInputNoWrapClearOnChoose(void);
|
||||
void DoScheduledBgTilemapCopiesToVram(void);
|
||||
void ClearScheduledBgCopiesToVram(void);
|
||||
// menu2
|
||||
void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 x, u8 y, const struct TextColor * color, s8 speed, const u8 * str);
|
||||
void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const struct TextColor *color, s8 speed, const u8 *str);
|
||||
void sub_8197B1C(u8 windowId, bool8 copyToVram, u16 a2, u16 a3);
|
||||
void ClearMenuWindow(u8 windowId, bool8 copyToVram);
|
||||
void *DecompressAndCopyTileDataToVram2(u8 bgId, const void *src, u32 size, u16 offset, u8 mode);
|
||||
void CreateWindow_SnapRight_StdPal(u8, u8, u8, u8, u16);
|
||||
void Menu_PrintHelpSystemUIHeader(const u8 *, const u8 *, u8, u32, u8);
|
||||
void PrintTextOnRightSnappedWindow(const u8 *, u32, u8);
|
||||
void sub_810F71C(void);
|
||||
void sub_810F740(void);
|
||||
u8 ProgramAndPlaceMenuCursorOnWindow(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPosition);
|
||||
void CreateYesNoMenu(const struct WindowTemplate *, u8, u8, u8, u16, u8, u8);
|
||||
void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 a2, u8 a3);
|
||||
void AddTextPrinterParameterized5(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16), u8 letterSpacing, u8 lineSpacing);
|
||||
void sub_812E6DC(u8 windowId, const u8 * src, u16 x, u16 y);
|
||||
void StartBlendTask(u8 eva_start, u8 evb_start, u8 eva_end, u8 evb_end, u8 ev_step, u8 priority);
|
||||
bool8 IsBlendTaskActive(void);
|
||||
void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *a8);
|
||||
void ClearMenuWindow_BorderThickness2(u8 windowId, u8 a1);
|
||||
void PrintTextArray(u8, u8, u8, u8, u8, u8, const struct MenuAction *);
|
||||
u8 sub_812EA78(u16 species, u32 personality, u8 a2);
|
||||
s8 sub_812EAE4(u16 species, u32 personality, u8 a2);
|
||||
|
||||
// list_menu
|
||||
void sub_8107CD8(u8 palOffset, u16 speciesId);
|
||||
void sub_8107CF8(u8 windowId, u16 speciesId, u32 personality, u16 x, u16 y);
|
||||
void sub_8107D38(u8, u8);
|
||||
void sub_8107D38(u8 palOffset, u8 palId);
|
||||
void BlitMoveInfoIcon(u8 windowId, u8 iconId, u16 x, u16 y);
|
||||
|
||||
// menu
|
||||
s8 Menu_ProcessInputGridLayout(void);
|
||||
u8 MultichoiceGrid_InitCursor(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth, u8 cols, u8 rows, u8 cursorPos);
|
||||
void MultichoiceGrid_PrintItems(u8 windowId, u8 fontId, u8 itemWidth, u8 itemHeight, u8 cols, u8 rows, const struct MenuAction *strs);
|
||||
void DestroyYesNoMenu(void);
|
||||
s8 Menu_ProcessInputNoWrapClearOnChoose(void);
|
||||
void CreateYesNoMenu(const struct WindowTemplate *window, u8 fontId, u8 left, u8 top, u16 baseTileNum, u8 paletteNum, u8 initialCursorPos);
|
||||
void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *orderArray);
|
||||
void UnionRoomAndTradeMenuPrintOptions(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const struct MenuAction *strs);
|
||||
void MultichoiceList_PrintItems(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, u8 letterSpacing, u8 lineSpacing);
|
||||
void PrintTextArray(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *strs);
|
||||
s8 Menu_ProcessInputNoWrapAround_other(void);
|
||||
s8 Menu_ProcessInput_other(void);
|
||||
s8 Menu_ProcessInputNoWrapAround(void);
|
||||
s8 Menu_ProcessInput(void);
|
||||
u8 Menu_GetCursorPos(void);
|
||||
u8 Menu_MoveCursorNoWrapAround(s8 cursorDelta);
|
||||
u8 Menu_MoveCursor(s8 cursorDelta);
|
||||
u8 Menu_InitCursor(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos);
|
||||
u8 Menu_InitCursorInternal(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos, bool8 APressMuted);
|
||||
void TopBarWindowPrintTwoStrings(const u8 *string, const u8 *string2, bool8 fgColorChooser, u8 notUsed, bool8 copyToVram);
|
||||
void TopBarWindowPrintString(const u8 *string, u8 unUsed, bool8 copyToVram);
|
||||
void ClearTopBarWindow(void);
|
||||
void DestroyTopBarWindow(void);
|
||||
u8 CreateTopBarWindowLoadPalette(u8 bg, u8 width, u8 yPos, u8 palette, u16 baseTile);
|
||||
void ClearStdWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram);
|
||||
void DrawStdFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 baseTileNum, u8 paletteNum);
|
||||
void ClearDialogWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram);
|
||||
void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 tileNum, u8 paletteNum);
|
||||
struct WindowTemplate SetWindowTemplateFields(u8 bg, u8 left, u8 top, u8 width, u8 height, u8 paletteNum, u16 baseBlock);
|
||||
|
||||
#endif // GUARD_MENU_H
|
||||
|
||||
+11
-14
@@ -4,29 +4,26 @@
|
||||
#include "global.h"
|
||||
#include "task.h"
|
||||
|
||||
// Exported type declarations
|
||||
|
||||
struct YesNoFuncTable {
|
||||
struct YesNoFuncTable
|
||||
{
|
||||
TaskFunc yesFunc;
|
||||
TaskFunc noFunc;
|
||||
};
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
|
||||
void sub_812225C(u16 *, u16 *, u8, u8);
|
||||
void sub_8122298(u16 *, u16 *, u8, u8, u8);
|
||||
void sub_8121F68(u8 taskId, const struct YesNoFuncTable *data);
|
||||
bool8 sub_81221AC(void);
|
||||
bool16 RunTextPrinters_CheckActive(u8 textPrinterId);
|
||||
bool8 sub_80BF72C(void);
|
||||
bool8 sub_80BF748(void);
|
||||
bool8 MenuHelpers_LinkSomething(void);
|
||||
void SetVBlankHBlankCallbacksToNull(void);
|
||||
void ResetAllBgsCoordinatesAndBgCntRegs(void);
|
||||
u8 sub_80BF8E4(void);
|
||||
u8 AdjustQuantityAccordingToDPadInput(s16 * a0, u16 a1);
|
||||
void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 arg2, u8 arg3, u8 fontId, u8 textSpeed, const u8 *string, void *taskFunc);
|
||||
void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 arg2, u8 arg3, u8 arg4, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo);
|
||||
bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1);
|
||||
void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 tileNum, u8 paletteNum, u8 fontId, u8 textSpeed, const u8 *string, void *taskFunc);
|
||||
void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 fontId, u8 left, u8 top, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo);
|
||||
u8 GetLRKeysState(void);
|
||||
u8 sub_80BF66C(void);
|
||||
bool8 sub_80BF6A8(u16 itemId);
|
||||
bool8 itemid_80BF6D8_mail_related(u16 itemId);
|
||||
void ClearVramOamPltt(void);
|
||||
|
||||
#endif //GUARD_MENU_HELPERS_H
|
||||
|
||||
+36
-36
@@ -5,48 +5,48 @@
|
||||
#include "text.h"
|
||||
#include "task.h"
|
||||
|
||||
void sub_81973A4(void);
|
||||
void sub_81973C4(u8, u8);
|
||||
void sub_819746C(u8 windowId, bool8 copyToVram);
|
||||
void sub_81973FC(u8, u8);
|
||||
void ClearScheduledBgCopiesToVram(void);
|
||||
void ScheduleBgCopyTilemapToVram(u8 bgId);
|
||||
void DoScheduledBgTilemapCopiesToVram(void);
|
||||
void ResetTempTileDataBuffers(void);
|
||||
bool8 FreeTempTileDataBuffersIfPossible(void);
|
||||
void *DecompressAndCopyTileDataToVram(u8 bgId, const void *src, u32 size, u16 offset, u8 mode);
|
||||
void *DecompressAndCopyTileDataToVram2(u8 bgId, const void *src, u32 size, u16 offset, u8 mode);
|
||||
void DecompressAndLoadBgGfxUsingHeap(u8 bgId, const void *src, u32 size, u16 offset, u8 mode);
|
||||
void DecompressAndLoadBgGfxUsingHeap2(u8 bgId, const void *src, u32 size, u16 offset, u8 mode);
|
||||
void * MallocAndDecompress(const void * src, u32 * size);
|
||||
void SetBgRectPal(u8 bgId, u8 left, u8 top, u8 width, u8 height, u8 palette);
|
||||
void CopyRectIntoAltRect(u8 bgId, u16 *dest, u8 left, u8 top, u8 width, u8 height);
|
||||
void ResetBgPositions(void);
|
||||
void InitStandardTextBoxWindows(void);
|
||||
void FreeAllOverworldWindowBuffers(void);
|
||||
void ResetBg0(void);
|
||||
u16 RunTextPrinters_CheckPrinter0Active(void);
|
||||
u16 AddTextPrinterParameterized2(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16), u8 fgColor, u8 bgColor, u8 shadowColor);
|
||||
void DisplayItemMessageOnField(u8 taskId, u8 bgId, const u8 *src, TaskFunc callback);
|
||||
void sub_8197434(u8 a0, u8 a1);
|
||||
void SetStandardWindowBorderStyle(u8 a0, u8 a1);
|
||||
void sub_8197930(void);
|
||||
u8 GetPlayerTextSpeed(void);
|
||||
void ClearDialogWindowAndFrame(u8, u8);
|
||||
u8 GetTextSpeedSetting(void);
|
||||
void AddTextPrinterDiffStyle(bool8 allowSkippingDelayWithButtonPress);
|
||||
void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress);
|
||||
void AddTextPrinterWithCustomSpeedForMessage(bool8 allowSkippingDelayWithButtonPress, u8 speed);
|
||||
void sub_80F6E9C(void);
|
||||
void DrawDialogueFrame(u8 windowId, bool8 transfer);
|
||||
void DrawStdWindowFrame(u8 windowId, bool8 copyNow);
|
||||
void ClearDialogWindowAndFrame(u8 windowId, bool8 copyToVram);
|
||||
void ClearStdWindowAndFrame(u8 taskId, bool8 copyNow);
|
||||
void sub_80F771C(bool8 copyToVram);
|
||||
void SetStdWindowBorderStyle(u8 windowId, bool8 copyToVram);
|
||||
void sub_80F7768(u8 windowId, bool8 copyToVram);
|
||||
void Menu_LoadStdPal(void);
|
||||
void Menu_LoadStdPalAt(u16 offset);
|
||||
void DisplayItemMessageOnField(u8 taskId, u8 bgId, const u8 *src, TaskFunc callback);
|
||||
void DisplayYesNoMenuDefaultYes(void);
|
||||
void DisplayYesNoMenuDefaultNo(void);
|
||||
u8 GetTextSpeedSetting(void);
|
||||
u8 sub_80F78E0(u8 height);
|
||||
u8 GetStartMenuWindowId(void);
|
||||
void RemoveStartMenuWindow(void);
|
||||
u16 GetStdWindowBaseTileNum(void);
|
||||
void sub_80F7974(const u8 * text);
|
||||
void sub_80F7998(void);
|
||||
void sub_80F79A4(void);
|
||||
void DrawStdWindowFrame(u8 windowId, bool8 copyNow);
|
||||
void InitStandardTextBoxWindows(void);
|
||||
void ResetBg0(void);
|
||||
void ResetBgPositions(void);
|
||||
void CopyRectIntoAltRect(u8 bgId, u16 *dest, u8 left, u8 top, u8 width, u8 height);
|
||||
void SetBgRectPal(u8 bgId, u8 left, u8 top, u8 width, u8 height, u8 palette);
|
||||
void DecompressAndLoadBgGfxUsingHeap(u8 bgId, const void *src, u32 size, u16 offset, u8 mode);
|
||||
void DecompressAndLoadBgGfxUsingHeap2(u8 bgId, const void *src, u32 size, u16 offset, u8 mode);
|
||||
void Menu_LoadStdPal(void);
|
||||
void Menu_LoadStdPalAt(u16);
|
||||
void * MallocAndDecompress(const void * src, u32 * size);
|
||||
u16 GetStdWindowBaseTileNum(void);
|
||||
void ClearStdWindowAndFrame(u8 taskId, bool8 copyNow);
|
||||
void sub_80F6E9C(void);
|
||||
void sub_80F771C(bool8 copyToVram);
|
||||
void AddTextPrinterWithCustomSpeedForMessage(bool8 allowSkippingDelayWithButtonPress, u8 speed);
|
||||
void AddTextPrinterDiffStyle(bool8 allowSkippingDelayWithButtonPress);
|
||||
void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress);
|
||||
void SetStdWindowBorderStyle(u8 windowId, bool8 copyToVram);
|
||||
void sub_80F7768(u8 windowId, bool8 copyToVram);
|
||||
void DisplayYesNoMenuDefaultYes(void);
|
||||
void DisplayYesNoMenuDefaultNo(void);
|
||||
u8 sub_80F78E0(u8 windowId);
|
||||
u8 GetStartMenuWindowId(void);
|
||||
void RemoveStartMenuWindow(void);
|
||||
void SetDefaultFontsPointer(void);
|
||||
|
||||
#endif // GUARD_NEW_MENU_HELPERS_H
|
||||
|
||||
@@ -104,6 +104,7 @@ extern bool8 (* gFieldCallback2)(void);
|
||||
|
||||
void SetLastHealLocationWarp(u8 healLocaionId);
|
||||
void sub_8055864(u8 mapGroup, u8 mapNum);
|
||||
void CB2_Overworld(void);
|
||||
void CB2_NewGame(void);
|
||||
bool8 Overworld_MapTypeAllowsTeleportAndFly(u8 mapType);
|
||||
void Overworld_ResetStateAfterTeleport(void);
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ struct PaletteFadeControl
|
||||
|
||||
extern struct PaletteFadeControl gPaletteFade;
|
||||
extern u32 gPlttBufferTransferPending;
|
||||
extern u8 *gPaletteDecompressionBuffer;
|
||||
extern u8 *gUnknown_203AAB0;
|
||||
extern u16 gPlttBufferUnfaded[PLTT_BUFFER_SIZE];
|
||||
extern u16 gPlttBufferFaded[PLTT_BUFFER_SIZE];
|
||||
|
||||
|
||||
+2
-1
@@ -7,7 +7,8 @@ void ResetPokedex(void);
|
||||
void CopyMonCategoryText(u16 species, u8 *dst);
|
||||
u16 GetPokedexHeightWeight(u16 dexNum, u8 data);
|
||||
u16 GetNationalPokedexCount(u8);
|
||||
u16 GetHoennPokedexCount(u8);
|
||||
u16 GetKantoPokedexCount(u8);
|
||||
bool16 HasAllKantoMons(void);
|
||||
u8 CreateDexDisplayMonDataTask(u16 dexNum, u32 trainerId, u32 personality);
|
||||
|
||||
enum
|
||||
|
||||
@@ -12,7 +12,6 @@ void StopMapMusic(void);
|
||||
void FadeOutMapMusic(u8 speed);
|
||||
void FadeOutAndPlayNewMapMusic(u16 songNum, u8 speed);
|
||||
void FadeOutAndFadeInNewMapMusic(u16 songNum, u8 fadeOutSpeed, u8 fadeInSpeed);
|
||||
void FadeInNewMapMusic(u16 songNum, u8 speed);
|
||||
bool8 IsNotWaitingForBGMStop(void);
|
||||
void PlayFanfareByFanfareNum(u8 fanfareNum);
|
||||
bool8 WaitFanfare(bool8 stop);
|
||||
|
||||
+8
-1
@@ -175,7 +175,7 @@ extern const u8 gUnknown_841665C[];
|
||||
extern const u8 gUnknown_8416690[];
|
||||
extern const u8 gUnknown_84166A7[];
|
||||
extern const u8 gUnknown_84169DC[];
|
||||
|
||||
extern const u8 gUnknown_841623D[];
|
||||
extern const u8 gUnknown_84162BD[];
|
||||
extern const u8 gUnknown_841D148[];
|
||||
|
||||
@@ -189,4 +189,11 @@ extern const u8 gText_BadEgg[];
|
||||
extern const u8 gText_PkmnsXPreventsSwitching[];
|
||||
extern u8 *gUnknown_83FD5D0[];
|
||||
|
||||
// diploma
|
||||
extern const u8 gUnknown_841B60E[];
|
||||
extern const u8 gUnknown_841B619[];
|
||||
extern const u8 gUnknown_841B684[];
|
||||
extern const u8 gUnknown_841B68F[];
|
||||
extern const u8 gUnknown_841B698[];
|
||||
|
||||
#endif //GUARD_STRINGS_H
|
||||
|
||||
+6
-10
@@ -196,7 +196,7 @@ SECTIONS {
|
||||
asm/battle_message.o(.text);
|
||||
src/math_util.o(.text);
|
||||
src/roulette_util.o(.text);
|
||||
asm/cable_car_util.o(.text);
|
||||
src/cable_car_util.o(.text);
|
||||
src/save.o(.text);
|
||||
src/mystery_event_script.o(.text);
|
||||
asm/field_effect_helpers.o(.text);
|
||||
@@ -213,7 +213,7 @@ SECTIONS {
|
||||
asm/battle_anim_special.o(.text);
|
||||
asm/hall_of_fame.o(.text);
|
||||
asm/credits.o(.text);
|
||||
asm/diploma.o(.text);
|
||||
src/diploma.o(.text);
|
||||
asm/save_failed_screen.o(.text);
|
||||
asm/clear_save_data_screen.o(.text);
|
||||
asm/evolution_graphics.o(.text);
|
||||
@@ -233,7 +233,7 @@ SECTIONS {
|
||||
src/vs_seeker.o(.text);
|
||||
src/item_pc.o(.text);
|
||||
asm/mailbox_pc.o(.text);
|
||||
asm/menu.o(.text);
|
||||
src/menu.o(.text);
|
||||
src/quest_log.o(.text);
|
||||
asm/link_rfu_3.o(.text);
|
||||
asm/pokemon_special_anim.o(.text);
|
||||
@@ -420,6 +420,7 @@ SECTIONS {
|
||||
data/data_83FECCC.o(.rodata);
|
||||
src/intro.o(.rodata);
|
||||
data/data_83FECCC.o(.rodata.battle_anim_special);
|
||||
src/diploma.o(.rodata);
|
||||
data/strings.o(.rodata);
|
||||
data/data_83FECCC.o(.rodata.841EE44);
|
||||
src/new_menu_helpers.o(.rodata);
|
||||
@@ -432,6 +433,7 @@ SECTIONS {
|
||||
src/vs_seeker.o(.rodata);
|
||||
src/item_pc.o(.rodata);
|
||||
data/data_83FECCC.o(.rodata.8453F6C);
|
||||
src/menu.o(.rodata);
|
||||
src/quest_log.o(.rodata);
|
||||
data/data_83FECCC.o(.rodata.8456C74);
|
||||
src/help_system_812B1E0.o(.rodata);
|
||||
@@ -541,13 +543,7 @@ SECTIONS {
|
||||
data/multiboot_pokemon_colosseum.o(.rodata);
|
||||
} =0
|
||||
|
||||
gap1 :
|
||||
{
|
||||
gap1_start = ABSOLUTE(.);
|
||||
BYTE(0xFF)
|
||||
. = 0x8D00000 - gap1_start;
|
||||
} =0xFF
|
||||
|
||||
. = 0x08D00000;
|
||||
gfx_data :
|
||||
ALIGN(4)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "window.h"
|
||||
#include "text_window.h"
|
||||
#include "menu_helpers.h"
|
||||
#include "new_menu_helpers.h"
|
||||
#include "menu.h"
|
||||
#include "money.h"
|
||||
#include "bag.h"
|
||||
@@ -240,7 +241,7 @@ void sub_810B958(const u8 * str)
|
||||
void sub_810B994(void)
|
||||
{
|
||||
u32 x;
|
||||
SetWindowBorderStyle(2, FALSE, 0x081, 0x0C);
|
||||
DrawStdFrameWithCustomTileAndPalette(2, FALSE, 0x081, 0x0C);
|
||||
x = 0x40 - GetStringWidth(0, gText_DepositItem, 0);
|
||||
AddTextPrinterParameterized(2, 0, gText_DepositItem, x / 2, 1, 0, NULL);
|
||||
}
|
||||
@@ -252,11 +253,11 @@ u8 sub_810B9DC(u8 a0, u8 a1)
|
||||
gUnknown_203AD34[a0] = AddWindow(&gUnknown_8453104[a0 + a1]);
|
||||
if (a0 != 6)
|
||||
{
|
||||
SetWindowBorderStyle(gUnknown_203AD34[a0], FALSE, 0x064, 0x0E);
|
||||
DrawStdFrameWithCustomTileAndPalette(gUnknown_203AD34[a0], FALSE, 0x064, 0x0E);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetWindowBorderStyle(gUnknown_203AD34[a0], FALSE, 0x081, 0x0C);
|
||||
DrawStdFrameWithCustomTileAndPalette(gUnknown_203AD34[a0], FALSE, 0x081, 0x0C);
|
||||
}
|
||||
ScheduleBgCopyTilemapToVram(0);
|
||||
}
|
||||
@@ -265,7 +266,7 @@ u8 sub_810B9DC(u8 a0, u8 a1)
|
||||
|
||||
void sub_810BA3C(u8 a0)
|
||||
{
|
||||
ClearMenuWindow(gUnknown_203AD34[a0], FALSE);
|
||||
ClearStdWindowAndFrameToTransparent(gUnknown_203AD34[a0], FALSE);
|
||||
ClearWindowTilemap(gUnknown_203AD34[a0]);
|
||||
RemoveWindow(gUnknown_203AD34[a0]);
|
||||
ScheduleBgCopyTilemapToVram(0);
|
||||
@@ -285,7 +286,7 @@ void sub_810BA9C(u8 a0)
|
||||
{
|
||||
if (gUnknown_203AD34[a0] != 0xFF)
|
||||
{
|
||||
ClearMenuWindow_BorderThickness2(gUnknown_203AD34[a0], FALSE);
|
||||
ClearDialogWindowAndFrameToTransparent(gUnknown_203AD34[a0], FALSE);
|
||||
ClearWindowTilemap(gUnknown_203AD34[a0]);
|
||||
RemoveWindow(gUnknown_203AD34[a0]);
|
||||
PutWindowTilemap(1);
|
||||
|
||||
+4
-6
@@ -97,7 +97,7 @@ void sub_815EFBC(u8 windowId, u32 powder, u8 x, u8 y, u8 speed)
|
||||
|
||||
void sub_815F014(u8 windowId, u16 baseBlock, u8 palette, u32 powder)
|
||||
{
|
||||
SetWindowBorderStyle(windowId, FALSE, baseBlock, palette);
|
||||
DrawStdFrameWithCustomTileAndPalette(windowId, FALSE, baseBlock, palette);
|
||||
AddTextPrinterParameterized(windowId, 0, gOtherText_Powder, 0, 0, -1, NULL);
|
||||
sub_815EFBC(windowId, powder, 39, 12, 0);
|
||||
}
|
||||
@@ -110,13 +110,11 @@ void sub_815F070(void)
|
||||
void sub_815F094(void)
|
||||
{
|
||||
struct WindowTemplate template;
|
||||
struct WindowTemplate template2;
|
||||
|
||||
if (sub_81119D4(sub_809D6D4) != TRUE)
|
||||
{
|
||||
SetWindowTemplateFields(&template, 0, 1, 1, 8, 3, 15, 32);
|
||||
template2 = template;
|
||||
gUnknown_203F464 = AddWindow(&template2);
|
||||
template = SetWindowTemplateFields(0, 1, 1, 8, 3, 15, 32);
|
||||
gUnknown_203F464 = AddWindow(&template);
|
||||
FillWindowPixelBuffer(gUnknown_203F464, 0);
|
||||
PutWindowTilemap(gUnknown_203F464);
|
||||
TextWindow_SetStdFrame0_WithPal(gUnknown_203F464, 0x21D, 0xD0);
|
||||
@@ -127,6 +125,6 @@ void sub_815F094(void)
|
||||
void sub_815F114(void)
|
||||
{
|
||||
ClearWindowTilemap(gUnknown_203F464);
|
||||
ClearMenuWindow(gUnknown_203F464, 1);
|
||||
ClearStdWindowAndFrameToTransparent(gUnknown_203F464, 1);
|
||||
RemoveWindow(gUnknown_203F464);
|
||||
}
|
||||
|
||||
@@ -202,12 +202,12 @@ void BuyMenuDisplayMessage(u8 taskId, const u8 *text, TaskFunc callback)
|
||||
|
||||
void BuyMenuQuantityBoxNormalBorder(u8 windowId, bool8 copyToVram)
|
||||
{
|
||||
SetWindowBorderStyle(windowId, copyToVram, 0x1, 0xD);
|
||||
DrawStdFrameWithCustomTileAndPalette(windowId, copyToVram, 0x1, 0xD);
|
||||
}
|
||||
|
||||
void BuyMenuQuantityBoxThinBorder(u8 windowId, bool8 copyToVram)
|
||||
{
|
||||
SetWindowBorderStyle(windowId, copyToVram, 0xA, 0xF);
|
||||
DrawStdFrameWithCustomTileAndPalette(windowId, copyToVram, 0xA, 0xF);
|
||||
}
|
||||
|
||||
void BuyMenuConfirmPurchase(u8 taskId, const struct YesNoFuncTable *yesNo)
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
#include "global.h"
|
||||
|
||||
void CableCarUtil_FillWrapped(void *dest, u16 value, u8 left, u8 top, u8 width, u8 height)
|
||||
{
|
||||
u8 i;
|
||||
u8 j;
|
||||
u8 x;
|
||||
u8 y;
|
||||
|
||||
for (i = 0, y = top; i < height; i++)
|
||||
{
|
||||
for (x = left, j = 0; j < width; j++)
|
||||
{
|
||||
*(u16 *)&((u8 *)dest)[y * 64 + x * 2] = value;
|
||||
x = (x + 1) % 32;
|
||||
}
|
||||
y = (y + 1) % 32;
|
||||
}
|
||||
}
|
||||
|
||||
void CableCarUtil_CopyWrapped(void *dest, const u16 *src, u8 left, u8 top, u8 width, u8 height)
|
||||
{
|
||||
u8 i;
|
||||
u8 j;
|
||||
u8 x;
|
||||
u8 y;
|
||||
const u16 *_src;
|
||||
|
||||
for (i = 0, _src = src, y = top; i < height; i++)
|
||||
{
|
||||
for (x = left, j = 0; j < width; j++)
|
||||
{
|
||||
*(u16 *)&((u8 *)dest)[y * 64 + x * 2] = *_src++;
|
||||
x = (x + 1) % 32;
|
||||
}
|
||||
y = (y + 1) % 32;
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -61,7 +61,7 @@ void PrintCoinsString_Parameterized(u8 windowId, u32 coinAmount, u8 x, u8 y, u8
|
||||
|
||||
void sub_80D0674(u8 windowId, u16 tileStart, u8 palette, u32 coinAmount)
|
||||
{
|
||||
SetWindowBorderStyle(windowId, FALSE, tileStart, palette);
|
||||
DrawStdFrameWithCustomTileAndPalette(windowId, FALSE, tileStart, palette);
|
||||
AddTextPrinterParameterized(windowId, 2, gUnknown_8417C2D, 0, 0, 0xFF, 0);
|
||||
PrintCoinsString_Parameterized(windowId, coinAmount, 0x10, 0xC, 0);
|
||||
}
|
||||
@@ -80,15 +80,14 @@ void PrintCoinsString(u32 coinAmount)
|
||||
|
||||
void ShowCoinsWindow(u32 coinAmount, u8 x, u8 y)
|
||||
{
|
||||
struct WindowTemplate template, template2;
|
||||
struct WindowTemplate template;
|
||||
|
||||
SetWindowTemplateFields(&template, 0, x + 1, y + 1, 8, 3, 0xF, 0x20);
|
||||
template2 = template; // again, why...
|
||||
sCoinsWindowId = AddWindow(&template2);
|
||||
template = SetWindowTemplateFields(0, x + 1, y + 1, 8, 3, 0xF, 0x20);
|
||||
sCoinsWindowId = AddWindow(&template);
|
||||
FillWindowPixelBuffer(sCoinsWindowId, 0);
|
||||
PutWindowTilemap(sCoinsWindowId);
|
||||
TextWindow_SetStdFrame0_WithPal(sCoinsWindowId, 0x21D, 0xD0);
|
||||
SetWindowBorderStyle(sCoinsWindowId, FALSE, 0x21D, 0xD);
|
||||
DrawStdFrameWithCustomTileAndPalette(sCoinsWindowId, FALSE, 0x21D, 0xD);
|
||||
AddTextPrinterParameterized(sCoinsWindowId, 2, gUnknown_8417C2D, 0, 0, 0xFF, 0);
|
||||
PrintCoinsString(coinAmount);
|
||||
}
|
||||
@@ -96,6 +95,6 @@ void ShowCoinsWindow(u32 coinAmount, u8 x, u8 y)
|
||||
void HideCoinsWindow(void)
|
||||
{
|
||||
ClearWindowTilemap(sCoinsWindowId);
|
||||
ClearMenuWindow(sCoinsWindowId, TRUE);
|
||||
ClearStdWindowAndFrameToTransparent(sCoinsWindowId, TRUE);
|
||||
RemoveWindow(sCoinsWindowId);
|
||||
}
|
||||
|
||||
+285
@@ -0,0 +1,285 @@
|
||||
#include "global.h"
|
||||
#include "bg.h"
|
||||
#include "constants/fanfares.h"
|
||||
#include "dynamic_placeholder_text_util.h"
|
||||
#include "gba/macro.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "main.h"
|
||||
#include "malloc.h"
|
||||
#include "menu.h"
|
||||
#include "new_menu_helpers.h"
|
||||
#include "overworld.h"
|
||||
#include "palette.h"
|
||||
#include "pokedex.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "sound.h"
|
||||
#include "sprite.h"
|
||||
#include "strings.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
#include "window.h"
|
||||
#include "diploma.h"
|
||||
|
||||
struct Diploma
|
||||
{
|
||||
u8 state;
|
||||
u8 gfxStep;
|
||||
u8 callbackStep;
|
||||
u16 tilemapBuffer[0x800];
|
||||
};
|
||||
|
||||
static EWRAM_DATA struct Diploma *gDiploma = NULL;
|
||||
|
||||
static void DiplomaBgInit(void);
|
||||
static void DiplomaPrintText(void);
|
||||
static u8 DiplomaLoadGfx(void);
|
||||
static void DiplomaVblankHandler(void);
|
||||
static void CB2_DiplomaInit(void);
|
||||
static void Task_WaitForExit(u8);
|
||||
static void Task_DiplomaInit(u8);
|
||||
static void Task_DiplomaReturnToOverworld(u8);
|
||||
|
||||
static const u32 gUnknown_84147C0[] = INCBIN_U32("graphics/diploma/unk_84147C0.4bpp.lz");
|
||||
static const u32 gUnknown_84154E8[] = INCBIN_U32("graphics/diploma/unk_84154E8.bin.lz");
|
||||
static const u16 gUnknown_8415954[] = INCBIN_U16("graphics/diploma/unk_8415954.gbapal");
|
||||
|
||||
static const u8 gUnknown_8415994[] = _("{HIGHLIGHT TRANSPARENT}プレイヤー");
|
||||
static const u8 gUnknown_841599D[] = _("{HIGHLIGHT TRANSPARENT}さま");
|
||||
static const u8 gUnknown_84159A3[] = _("{HIGHLIGHT TRANSPARENT}ホウエン");
|
||||
static const u8 gUnknown_84159AB[] = _("{HIGHLIGHT TRANSPARENT}ぜんこく");
|
||||
static const u8 gUnknown_84159B3[] = _("{HIGHLIGHT TRANSPARENT} ポケモンずかんを\nみごと かんせい させた\nいだいなこうせきを たたえ\nここに しょうめい します");
|
||||
static const u8 gUnknown_84159ED[] = _("{COLOR RED}{HIGHLIGHT TRANSPARENT}ゲームフリーク");
|
||||
static const u8 gUnknown_84159FB[] = _("{COLOR RED}{HIGHLIGHT TRANSPARENT}");
|
||||
|
||||
static const ALIGNED(4) struct TextColor gUnknown_8415A04 = {0, 2, 3};
|
||||
|
||||
static const struct BgTemplate gUnknown_8415A08[] = {
|
||||
{
|
||||
.bg = 0,
|
||||
.charBaseIndex = 0,
|
||||
.mapBaseIndex = 31,
|
||||
.screenSize = 0,
|
||||
.paletteMode = 0,
|
||||
.priority = 0,
|
||||
.baseTile = 1,
|
||||
}, {
|
||||
.bg = 1,
|
||||
.charBaseIndex = 1,
|
||||
.mapBaseIndex = 29,
|
||||
.screenSize = 1,
|
||||
.paletteMode = 0,
|
||||
.priority = 1,
|
||||
.baseTile = 0,
|
||||
}
|
||||
};
|
||||
|
||||
static const struct WindowTemplate gUnknown_8415A10[] = {
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 0,
|
||||
.tilemapTop = 2,
|
||||
.width = 29,
|
||||
.height = 16,
|
||||
.paletteNum = 15,
|
||||
.baseBlock = 0x000
|
||||
}, DUMMY_WIN_TEMPLATE
|
||||
};
|
||||
|
||||
static void VCBC_DiplomaOam(void)
|
||||
{
|
||||
LoadOam();
|
||||
ProcessSpriteCopyRequests();
|
||||
TransferPlttBuffer();
|
||||
}
|
||||
|
||||
void CB2_ShowDiploma(void)
|
||||
{
|
||||
gDiploma = AllocZeroed(sizeof(*gDiploma));
|
||||
gDiploma->state = 0;
|
||||
gDiploma->gfxStep = 0;
|
||||
gDiploma->callbackStep = 0;
|
||||
DiplomaBgInit();
|
||||
CreateTask(Task_DiplomaInit, 0);
|
||||
SetMainCallback2(CB2_DiplomaInit);
|
||||
}
|
||||
|
||||
static void CB2_DiplomaInit(void)
|
||||
{
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
static void Task_DiplomaInit(u8 taskId)
|
||||
{
|
||||
switch (gDiploma->callbackStep)
|
||||
{
|
||||
case 0:
|
||||
SetVBlankCallback(NULL);
|
||||
break;
|
||||
case 1:
|
||||
DiplomaVblankHandler();
|
||||
break;
|
||||
case 2:
|
||||
if (!DiplomaLoadGfx())
|
||||
{
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
CopyToBgTilemapBuffer(1, gUnknown_84154E8, 0, 0);
|
||||
break;
|
||||
case 4:
|
||||
if (HasAllKantoMons())
|
||||
{
|
||||
SetGpuReg(REG_OFFSET_BG1HOFS, 0x80 << 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetGpuReg(REG_OFFSET_BG1HOFS, 0);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
DiplomaPrintText();
|
||||
break;
|
||||
case 6:
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
break;
|
||||
case 7:
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
|
||||
break;
|
||||
case 8:
|
||||
SetVBlankCallback(VCBC_DiplomaOam);
|
||||
break;
|
||||
default:
|
||||
if (gPaletteFade.active)
|
||||
{
|
||||
break;
|
||||
}
|
||||
PlayFanfareByFanfareNum(FANFARE_05);
|
||||
gTasks[taskId].func = Task_WaitForExit;
|
||||
}
|
||||
gDiploma->callbackStep++;
|
||||
}
|
||||
|
||||
static void Task_WaitForExit(u8 taskId)
|
||||
{
|
||||
switch (gDiploma->state)
|
||||
{
|
||||
case 0:
|
||||
if (WaitFanfare(0))
|
||||
{
|
||||
gDiploma->state++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
|
||||
gDiploma->state++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
Task_DiplomaReturnToOverworld(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void Task_DiplomaReturnToOverworld(u8 taskId)
|
||||
{
|
||||
if (gPaletteFade.active)
|
||||
return;
|
||||
DestroyTask(taskId);
|
||||
FreeAllWindowBuffers();
|
||||
FREE_AND_SET_NULL(gDiploma);
|
||||
SetMainCallback2(CB2_Overworld);
|
||||
}
|
||||
|
||||
static void DiplomaBgInit(void)
|
||||
{
|
||||
ResetSpriteData();
|
||||
ResetPaletteFade();
|
||||
FreeAllSpritePalettes();
|
||||
ResetTasks();
|
||||
ScanlineEffect_Stop();
|
||||
}
|
||||
|
||||
static void DiplomaVblankHandler(void)
|
||||
{
|
||||
void *vram = (void *)VRAM;
|
||||
DmaClearLarge16(3, vram, VRAM_SIZE, 0x1000);
|
||||
DmaClear32(3, (void *)OAM, OAM_SIZE);
|
||||
DmaClear16(3, (void *)PLTT, PLTT_SIZE);
|
||||
SetGpuReg(REG_OFFSET_DISPCNT, 0);
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
InitBgsFromTemplates(0, gUnknown_8415A08, 2);
|
||||
ChangeBgX(0, 0, 0);
|
||||
ChangeBgY(0, 0, 0);
|
||||
ChangeBgX(1, 0, 0);
|
||||
ChangeBgY(1, 0, 0);
|
||||
ChangeBgX(2, 0, 0);
|
||||
ChangeBgY(2, 0, 0);
|
||||
ChangeBgX(3, 0, 0);
|
||||
ChangeBgY(3, 0, 0);
|
||||
InitWindows(gUnknown_8415A10);
|
||||
DeactivateAllTextPrinters();
|
||||
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_1D_MAP | DISPCNT_OBJ_ON);
|
||||
SetBgTilemapBuffer(1, gDiploma->tilemapBuffer);
|
||||
ShowBg(0);
|
||||
ShowBg(1);
|
||||
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20);
|
||||
FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 30, 20);
|
||||
}
|
||||
|
||||
static u8 DiplomaLoadGfx(void)
|
||||
{
|
||||
switch (gDiploma->gfxStep)
|
||||
{
|
||||
case 0:
|
||||
ResetTempTileDataBuffers();
|
||||
break;
|
||||
case 1:
|
||||
DecompressAndCopyTileDataToVram(1, gUnknown_84147C0, 0, 0, 0);
|
||||
break;
|
||||
case 2:
|
||||
if (!(FreeTempTileDataBuffersIfPossible() == 1))
|
||||
{
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
case 3:
|
||||
LoadPalette(gUnknown_8415954, 0, 0x40);
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
gDiploma->gfxStep++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void DiplomaPrintText(void)
|
||||
{
|
||||
u8 arr[160];
|
||||
u32 width;
|
||||
DynamicPlaceholderTextUtil_Reset();
|
||||
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gSaveBlock2Ptr->playerName);
|
||||
if (HasAllKantoMons())
|
||||
{
|
||||
DynamicPlaceholderTextUtil_SetPlaceholderPtr(1, gUnknown_841B68F);
|
||||
}
|
||||
else
|
||||
{
|
||||
DynamicPlaceholderTextUtil_SetPlaceholderPtr(1, gUnknown_841B698);
|
||||
}
|
||||
FillWindowPixelBuffer(0, 0);
|
||||
DynamicPlaceholderTextUtil_ExpandPlaceholders(arr, gUnknown_841B60E);
|
||||
width = GetStringWidth(2, arr, -1);
|
||||
AddTextPrinterParameterized3(0, 2, 0x78 - (width / 2), 4, &gUnknown_8415A04, -1, arr);
|
||||
DynamicPlaceholderTextUtil_ExpandPlaceholders(arr, gUnknown_841B619);
|
||||
width = GetStringWidth(2, arr, -1);
|
||||
AddTextPrinterParameterized3(0, 0x2, 0x78 - (width / 2), 0x1E, &gUnknown_8415A04, -1, arr);
|
||||
AddTextPrinterParameterized3(0, 0x2, 0x78, 0x69, &gUnknown_8415A04, 0, gUnknown_841B684);
|
||||
PutWindowTilemap(0);
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "sound.h"
|
||||
#include "string_util.h"
|
||||
#include "menu.h"
|
||||
#include "new_menu_helpers.h"
|
||||
#include "constants/songs.h"
|
||||
#include "fldeff.h"
|
||||
|
||||
@@ -85,7 +86,7 @@ static void sub_80E58A0(u8 taskId)
|
||||
sub_811F818(gUnknown_203B0A0.unk9, 0);
|
||||
gUnknown_203B0A0.unk9 = gUnknown_203B0A0.unkA;
|
||||
sub_811F818(gUnknown_203B0A0.unkA, 1);
|
||||
ClearMenuWindow(6, 0);
|
||||
ClearStdWindowAndFrameToTransparent(6, 0);
|
||||
ClearWindowTilemap(6);
|
||||
sub_8121D0C(0);
|
||||
gTasks[taskId].func = sub_811FB28;
|
||||
|
||||
@@ -52,8 +52,8 @@ static void StartSweetScentFieldEffect(void)
|
||||
u8 taskId;
|
||||
|
||||
PlaySE(SE_W260);
|
||||
gPaletteDecompressionBuffer = (u8 *)Alloc(0x400);
|
||||
CpuFastSet(gPlttBufferUnfaded, gPaletteDecompressionBuffer, 0x100);
|
||||
gUnknown_203AAB0 = (u8 *)Alloc(0x400);
|
||||
CpuFastSet(gPlttBufferUnfaded, gUnknown_203AAB0, 0x100);
|
||||
CpuFastSet(gPlttBufferFaded, gPlttBufferUnfaded, 0x100);
|
||||
BeginNormalPaletteFade(~(1 << (gSprites[GetPlayerAvatarObjectId()].oam.paletteNum + 16)), 4, 0, 8, RGB(31, 0, 0));
|
||||
taskId = CreateTask(TrySweetScentEncounter, 0);
|
||||
@@ -72,7 +72,7 @@ static void TrySweetScentEncounter(u8 taskId)
|
||||
data[0] = 0;
|
||||
if (SweetScentWildEncounter() == TRUE)
|
||||
{
|
||||
Free(gPaletteDecompressionBuffer);
|
||||
Free(gUnknown_203AAB0);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
else
|
||||
@@ -92,9 +92,9 @@ static void FailSweetScentEncounter(u8 taskId)
|
||||
{
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
CpuFastSet(gPaletteDecompressionBuffer, gPlttBufferUnfaded, 0x100);
|
||||
CpuFastSet(gUnknown_203AAB0, gPlttBufferUnfaded, 0x100);
|
||||
sub_807B070();
|
||||
Free(gPaletteDecompressionBuffer);
|
||||
Free(gUnknown_203AAB0);
|
||||
ScriptContext1_SetupScript(EventScript_FailSweetScent);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
+10
-10
@@ -845,7 +845,7 @@ static void Task_ItemPcSubmenuInit(u8 taskId)
|
||||
ItemPc_SetBorderStyleOnWindow(4);
|
||||
windowId = ItemPc_GetOrCreateSubwindow(0);
|
||||
PrintTextArray(4, 2, 8, 2, GetFontAttribute(2, FONTATTR_MAX_LETTER_HEIGHT) + 2, 3, sItemPcSubmenuOptions);
|
||||
ProgramAndPlaceMenuCursorOnWindow(4, 2, 0, 2, GetFontAttribute(2, FONTATTR_MAX_LETTER_HEIGHT) + 2, 3, 0);
|
||||
Menu_InitCursor(4, 2, 0, 2, GetFontAttribute(2, FONTATTR_MAX_LETTER_HEIGHT) + 2, 3, 0);
|
||||
CopyItemName(ItemPc_GetItemIdBySlotId(data[1]), gStringVar1);
|
||||
StringExpandPlaceholders(gStringVar4, gOtherText_StrVar1);
|
||||
ItemPc_AddTextPrinterParameterized(windowId, 2, gStringVar4, 0, 2, 1, 0, 0, 1);
|
||||
@@ -855,7 +855,7 @@ static void Task_ItemPcSubmenuInit(u8 taskId)
|
||||
|
||||
static void Task_ItemPcSubmenuRun(u8 taskId)
|
||||
{
|
||||
s8 input = ProcessMenuInputNoWrapAround();
|
||||
s8 input = Menu_ProcessInputNoWrapAround();
|
||||
switch (input)
|
||||
{
|
||||
case -1:
|
||||
@@ -874,7 +874,7 @@ static void Task_ItemPcWithdraw(u8 taskId)
|
||||
{
|
||||
s16 * data = gTasks[taskId].data;
|
||||
|
||||
ClearMenuWindow(4, FALSE);
|
||||
ClearStdWindowAndFrameToTransparent(4, FALSE);
|
||||
ItemPc_DestroySubwindow(0);
|
||||
ClearWindowTilemap(4);
|
||||
data[8] = 1;
|
||||
@@ -998,7 +998,7 @@ static void Task_ItemPcHandleWithdrawMultiple(u8 taskId)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
ClearMenuWindow(3, FALSE);
|
||||
ClearStdWindowAndFrameToTransparent(3, FALSE);
|
||||
ItemPc_DestroySubwindow(1);
|
||||
ClearWindowTilemap(3);
|
||||
PutWindowTilemap(0);
|
||||
@@ -1014,7 +1014,7 @@ static void Task_ItemPcGive(u8 taskId)
|
||||
{
|
||||
if (CalculatePlayerPartyCount() == 0)
|
||||
{
|
||||
ClearMenuWindow(4, FALSE);
|
||||
ClearStdWindowAndFrameToTransparent(4, FALSE);
|
||||
ItemPc_DestroySubwindow(0);
|
||||
ClearWindowTilemap(4);
|
||||
PutWindowTilemap(0);
|
||||
@@ -1045,7 +1045,7 @@ static void gTask_ItemPcWaitButtonAndExitSubmenu(u8 taskId)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
ClearMenuWindow_BorderThickness2(5, 0);
|
||||
ClearDialogWindowAndFrameToTransparent(5, 0);
|
||||
ClearWindowTilemap(5);
|
||||
PutWindowTilemap(1);
|
||||
ItemPc_PrintOrRemoveCursor(data[0], 1);
|
||||
@@ -1058,7 +1058,7 @@ static void Task_ItemPcCancel(u8 taskId)
|
||||
{
|
||||
s16 * data = gTasks[taskId].data;
|
||||
|
||||
ClearMenuWindow(4, FALSE);
|
||||
ClearStdWindowAndFrameToTransparent(4, FALSE);
|
||||
ItemPc_DestroySubwindow(0);
|
||||
ClearWindowTilemap(4);
|
||||
PutWindowTilemap(0);
|
||||
@@ -1116,7 +1116,7 @@ static void ItemPc_AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8
|
||||
|
||||
static void ItemPc_SetBorderStyleOnWindow(u8 windowId)
|
||||
{
|
||||
SetWindowBorderStyle(windowId, FALSE, 0x3C0, 0x0E);
|
||||
DrawStdFrameWithCustomTileAndPalette(windowId, FALSE, 0x3C0, 0x0E);
|
||||
}
|
||||
|
||||
static u8 ItemPc_GetOrCreateSubwindow(u8 idx)
|
||||
@@ -1124,7 +1124,7 @@ static u8 ItemPc_GetOrCreateSubwindow(u8 idx)
|
||||
if (sSubmenuWindowIds[idx] == 0xFF)
|
||||
{
|
||||
sSubmenuWindowIds[idx] = AddWindow(&gUnknown_8453FD0[idx]);
|
||||
SetWindowBorderStyle(sSubmenuWindowIds[idx], TRUE, 0x3A3, 0x0C);
|
||||
DrawStdFrameWithCustomTileAndPalette(sSubmenuWindowIds[idx], TRUE, 0x3A3, 0x0C);
|
||||
}
|
||||
|
||||
return sSubmenuWindowIds[idx];
|
||||
@@ -1132,7 +1132,7 @@ static u8 ItemPc_GetOrCreateSubwindow(u8 idx)
|
||||
|
||||
static void ItemPc_DestroySubwindow(u8 idx)
|
||||
{
|
||||
ClearMenuWindow(sSubmenuWindowIds[idx], FALSE);
|
||||
ClearStdWindowAndFrameToTransparent(sSubmenuWindowIds[idx], FALSE);
|
||||
ClearWindowTilemap(sSubmenuWindowIds[idx]); // redundant
|
||||
RemoveWindow(sSubmenuWindowIds[idx]);
|
||||
sSubmenuWindowIds[idx] = 0xFF;
|
||||
|
||||
+878
@@ -0,0 +1,878 @@
|
||||
#include "global.h"
|
||||
#include "bg.h"
|
||||
#include "malloc.h"
|
||||
#include "menu.h"
|
||||
#include "menu_helpers.h"
|
||||
#include "new_menu_helpers.h"
|
||||
#include "string_util.h"
|
||||
#include "strings.h"
|
||||
#include "task.h"
|
||||
#include "text_window.h"
|
||||
#include "window.h"
|
||||
#include "sound.h"
|
||||
#include "palette.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
struct Menu
|
||||
{
|
||||
u8 left;
|
||||
u8 top;
|
||||
s8 cursorPos;
|
||||
s8 minCursorPos;
|
||||
s8 maxCursorPos;
|
||||
u8 windowId;
|
||||
u8 fontId;
|
||||
u8 optionWidth;
|
||||
u8 optionHeight;
|
||||
u8 columns;
|
||||
u8 rows;
|
||||
bool8 APressMuted;
|
||||
};
|
||||
|
||||
static EWRAM_DATA struct Menu sMenu = {0};
|
||||
static EWRAM_DATA u16 sTileNum = 0;
|
||||
static EWRAM_DATA u8 sPaletteNum = 0;
|
||||
static EWRAM_DATA u8 sYesNoWindowId = 0;
|
||||
static EWRAM_DATA u8 sTopBarWindowId = 0;
|
||||
|
||||
static void WindowFunc_DrawDialogFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum);
|
||||
static void WindowFunc_ClearDialogWindowAndFrameNullPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum);
|
||||
static void WindowFunc_DrawStdFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum);
|
||||
static void WindowFunc_ClearStdWindowAndFrameToTransparent(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum);
|
||||
static u8 MultichoiceGrid_MoveCursor(s8 deltaX, s8 deltaY);
|
||||
|
||||
static const struct TextColor gUnknown_8456618 =
|
||||
{
|
||||
.fgColor = 15,
|
||||
.bgColor = 1,
|
||||
.shadowColor = 2,
|
||||
};
|
||||
|
||||
void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 tileNum, u8 paletteNum)
|
||||
{
|
||||
sTileNum = tileNum;
|
||||
sPaletteNum = paletteNum;
|
||||
CallWindowFunction(windowId, WindowFunc_DrawDialogFrameWithCustomTileAndPalette);
|
||||
FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
|
||||
PutWindowTilemap(windowId);
|
||||
if (copyToVram == TRUE)
|
||||
CopyWindowToVram(windowId, 3);
|
||||
}
|
||||
|
||||
// not used
|
||||
static void DrawDialogFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 tileNum)
|
||||
{
|
||||
sTileNum = tileNum;
|
||||
sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM);
|
||||
CallWindowFunction(windowId, WindowFunc_DrawDialogFrameWithCustomTileAndPalette);
|
||||
FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
|
||||
PutWindowTilemap(windowId);
|
||||
if (copyToVram == TRUE)
|
||||
CopyWindowToVram(windowId, 3);
|
||||
}
|
||||
|
||||
static void WindowFunc_DrawDialogFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
||||
{
|
||||
FillBgTilemapBufferRect(bg, sTileNum, tilemapLeft - 2, tilemapTop - 1, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 1, tilemapLeft - 1, tilemapTop - 1, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 2, tilemapLeft, tilemapTop - 1, width, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 3, tilemapLeft + width, tilemapTop - 1, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 4, tilemapLeft + width + 1, tilemapTop - 1, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 5, tilemapLeft - 2, tilemapTop, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 6, tilemapLeft - 1, tilemapTop, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 8, tilemapLeft + width, tilemapTop, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 9, tilemapLeft + width + 1, tilemapTop, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 10, tilemapLeft - 2, tilemapTop + 1, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 11, tilemapLeft - 1, tilemapTop + 1, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 12, tilemapLeft + width, tilemapTop + 1, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 13, tilemapLeft + width + 1, tilemapTop + 1, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(sTileNum + 10), tilemapLeft - 2, tilemapTop + 2, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(sTileNum + 11), tilemapLeft - 1, tilemapTop + 2, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(sTileNum + 12), tilemapLeft + width, tilemapTop + 2, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(sTileNum + 13), tilemapLeft + width + 1, tilemapTop + 2, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(sTileNum + 5), tilemapLeft - 2, tilemapTop + 3, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(sTileNum + 6), tilemapLeft - 1, tilemapTop + 3, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(sTileNum + 8), tilemapLeft + width, tilemapTop + 3, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(sTileNum + 9), tilemapLeft + width + 1, tilemapTop + 3, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(sTileNum), tilemapLeft - 2, tilemapTop + 4, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(sTileNum + 1), tilemapLeft - 1, tilemapTop + 4, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(sTileNum + 2), tilemapLeft, tilemapTop + 4, width, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(sTileNum + 3), tilemapLeft + width, tilemapTop + 4, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(sTileNum + 4), tilemapLeft + width + 1, tilemapTop + 4, 1, 1, sPaletteNum);
|
||||
}
|
||||
|
||||
void ClearDialogWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram)
|
||||
{
|
||||
// The palette slot doesn't matter, since the tiles are transparent.
|
||||
CallWindowFunction(windowId, WindowFunc_ClearDialogWindowAndFrameNullPalette);
|
||||
FillWindowPixelBuffer(windowId, PIXEL_FILL(0));
|
||||
ClearWindowTilemap(windowId);
|
||||
if (copyToVram == TRUE)
|
||||
CopyWindowToVram(windowId, 3);
|
||||
}
|
||||
|
||||
static void WindowFunc_ClearDialogWindowAndFrameNullPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
||||
{
|
||||
FillBgTilemapBufferRect(bg, 0, tilemapLeft - 2, tilemapTop - 1, width + 4, height + 2, 0);
|
||||
}
|
||||
|
||||
void DrawStdFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 baseTileNum, u8 paletteNum)
|
||||
{
|
||||
sTileNum = baseTileNum;
|
||||
sPaletteNum = paletteNum;
|
||||
CallWindowFunction(windowId, WindowFunc_DrawStdFrameWithCustomTileAndPalette);
|
||||
FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
|
||||
PutWindowTilemap(windowId);
|
||||
if (copyToVram == TRUE)
|
||||
CopyWindowToVram(windowId, 3);
|
||||
}
|
||||
|
||||
// not used
|
||||
static void DrawStdFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 baseTileNum)
|
||||
{
|
||||
sTileNum = baseTileNum;
|
||||
sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM);
|
||||
CallWindowFunction(windowId, WindowFunc_DrawStdFrameWithCustomTileAndPalette);
|
||||
FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
|
||||
PutWindowTilemap(windowId);
|
||||
if (copyToVram == TRUE)
|
||||
CopyWindowToVram(windowId, 3);
|
||||
}
|
||||
|
||||
static void WindowFunc_DrawStdFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
||||
{
|
||||
FillBgTilemapBufferRect(bg, sTileNum, tilemapLeft - 1, tilemapTop - 1, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 1, tilemapLeft, tilemapTop - 1, width, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 2, tilemapLeft + width, tilemapTop - 1, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 3, tilemapLeft - 1, tilemapTop, 1, height, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 5, tilemapLeft + width, tilemapTop, 1, height, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 6, tilemapLeft - 1, tilemapTop + height, 1, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 7, tilemapLeft, tilemapTop + height, width, 1, sPaletteNum);
|
||||
FillBgTilemapBufferRect(bg, sTileNum + 8, tilemapLeft + width, tilemapTop + height, 1, 1, sPaletteNum);
|
||||
}
|
||||
|
||||
void ClearStdWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram)
|
||||
{
|
||||
CallWindowFunction(windowId, WindowFunc_ClearStdWindowAndFrameToTransparent);
|
||||
FillWindowPixelBuffer(windowId, PIXEL_FILL(0));
|
||||
ClearWindowTilemap(windowId);
|
||||
if (copyToVram == TRUE)
|
||||
CopyWindowToVram(windowId, 3);
|
||||
}
|
||||
|
||||
static void WindowFunc_ClearStdWindowAndFrameToTransparent(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
||||
{
|
||||
FillBgTilemapBufferRect(bg, 0, tilemapLeft - 1, tilemapTop - 1, width + 2, height + 2, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
The following functions are used for handling top bar window
|
||||
in hall of fame screen and story mode screen before oak intro.
|
||||
However, you can still designate a yPos value to place that bar
|
||||
as well as the bar width.
|
||||
The xPos is simply computed according to width (always right aligned).
|
||||
*/
|
||||
u8 CreateTopBarWindowLoadPalette(u8 bg, u8 width, u8 yPos, u8 palette, u16 baseTile)
|
||||
{
|
||||
struct WindowTemplate window;
|
||||
|
||||
memset(&window, 0, sizeof(window));
|
||||
if (bg > 3)
|
||||
window.bg = 0;
|
||||
else
|
||||
window.bg = bg;
|
||||
window.tilemapTop = yPos;
|
||||
window.height = 2;
|
||||
window.tilemapLeft = 0x1E - width;
|
||||
window.width = width;
|
||||
window.paletteNum = palette;
|
||||
window.baseBlock = baseTile;
|
||||
sTopBarWindowId = AddWindow(&window);
|
||||
if (palette > 15)
|
||||
palette = 15 * 16;
|
||||
else
|
||||
palette *= 16;
|
||||
LoadPalette(stdpal_get(2), palette, 0x20);
|
||||
return sTopBarWindowId;
|
||||
}
|
||||
|
||||
void TopBarWindowPrintString(const u8 *string, u8 unused, bool8 copyToVram)
|
||||
{
|
||||
s32 width;
|
||||
|
||||
if (sTopBarWindowId != 0xFF)
|
||||
{
|
||||
PutWindowTilemap(sTopBarWindowId);
|
||||
FillWindowPixelBuffer(sTopBarWindowId, PIXEL_FILL(15));
|
||||
width = GetStringWidth(0, string, 0);
|
||||
AddTextPrinterParameterized3(sTopBarWindowId, 0, -20 - width, 1, &gUnknown_8456618, 0, string);
|
||||
if (copyToVram)
|
||||
CopyWindowToVram(sTopBarWindowId, 3);
|
||||
}
|
||||
}
|
||||
|
||||
void TopBarWindowPrintTwoStrings(const u8 *string, const u8 *string2, bool8 fgColorChooser, u8 unused, bool8 copyToVram)
|
||||
{
|
||||
struct TextColor color;
|
||||
s32 fgColor, width;
|
||||
|
||||
if ( sTopBarWindowId != 0xFF )
|
||||
{
|
||||
if (fgColorChooser)
|
||||
{
|
||||
color.fgColor = 0;
|
||||
color.bgColor = 1;
|
||||
color.shadowColor = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
color.fgColor = 15;
|
||||
color.bgColor = 1;
|
||||
color.shadowColor = 2;
|
||||
}
|
||||
|
||||
PutWindowTilemap(sTopBarWindowId);
|
||||
FillWindowPixelBuffer(sTopBarWindowId, PIXEL_FILL(15));
|
||||
if (string2)
|
||||
{
|
||||
width = GetStringWidth(0, string2, 0);
|
||||
AddTextPrinterParameterized3(sTopBarWindowId, 0, -20 - width, 1, &color, 0, string2);
|
||||
}
|
||||
AddTextPrinterParameterized4(sTopBarWindowId, 1, 4, 1, 0, 0, &color, 0, string);
|
||||
if (copyToVram)
|
||||
CopyWindowToVram(sTopBarWindowId, 3);
|
||||
}
|
||||
}
|
||||
|
||||
// not used
|
||||
static void CopyTopBarWindowToVram(void)
|
||||
{
|
||||
if (sTopBarWindowId != 0xFF)
|
||||
CopyWindowToVram(sTopBarWindowId, 3);
|
||||
}
|
||||
|
||||
void ClearTopBarWindow(void)
|
||||
{
|
||||
if (sTopBarWindowId != 0xFF)
|
||||
{
|
||||
FillWindowPixelBuffer(sTopBarWindowId, PIXEL_FILL(15));
|
||||
CopyWindowToVram(sTopBarWindowId, 3);
|
||||
}
|
||||
}
|
||||
|
||||
void DestroyTopBarWindow(void)
|
||||
{
|
||||
if (sTopBarWindowId != 0xFF)
|
||||
{
|
||||
FillWindowPixelBuffer(sTopBarWindowId, PIXEL_FILL(0));
|
||||
ClearWindowTilemap(sTopBarWindowId);
|
||||
CopyWindowToVram(sTopBarWindowId, 3);
|
||||
RemoveWindow(sTopBarWindowId);
|
||||
sTopBarWindowId = 0xFF;
|
||||
}
|
||||
}
|
||||
|
||||
u8 Menu_InitCursorInternal(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos, bool8 APressMuted)
|
||||
{
|
||||
s32 pos;
|
||||
|
||||
sMenu.left = left;
|
||||
sMenu.top = top;
|
||||
sMenu.minCursorPos = 0;
|
||||
sMenu.maxCursorPos = numChoices - 1;
|
||||
sMenu.windowId = windowId;
|
||||
sMenu.fontId = fontId;
|
||||
sMenu.optionHeight = cursorHeight;
|
||||
sMenu.APressMuted = APressMuted;
|
||||
pos = initialCursorPos;
|
||||
if (pos < 0 || pos > sMenu.maxCursorPos)
|
||||
sMenu.cursorPos = 0;
|
||||
else
|
||||
sMenu.cursorPos = pos;
|
||||
|
||||
Menu_MoveCursor(0);
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
|
||||
u8 Menu_InitCursor(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos)
|
||||
{
|
||||
return Menu_InitCursorInternal(windowId, fontId, left, top, cursorHeight, numChoices, initialCursorPos, 0);
|
||||
}
|
||||
|
||||
// not used
|
||||
static u8 sub_810F818(u8 windowId, u8 fontId, u8 left, u8 top, u8 numChoices, u8 initialCursorPos)
|
||||
{
|
||||
return Menu_InitCursor(windowId, fontId, left, top, GetMenuCursorDimensionByFont(fontId, 1), numChoices, initialCursorPos);
|
||||
}
|
||||
|
||||
static void Menu_RedrawCursor(u8 oldPos, u8 newPos)
|
||||
{
|
||||
u8 width, height;
|
||||
|
||||
width = GetMenuCursorDimensionByFont(sMenu.fontId, 0);
|
||||
height = GetMenuCursorDimensionByFont(sMenu.fontId, 1);
|
||||
FillWindowPixelRect(sMenu.windowId, 1, sMenu.left, sMenu.optionHeight * oldPos + sMenu.top, width, height);
|
||||
AddTextPrinterParameterized(sMenu.windowId, sMenu.fontId, gFameCheckerText_ListMenuCursor, sMenu.left, sMenu.optionHeight * newPos + sMenu.top, 0, 0);
|
||||
}
|
||||
|
||||
u8 Menu_MoveCursor(s8 cursorDelta)
|
||||
{
|
||||
u8 oldPos = sMenu.cursorPos;
|
||||
s32 newPos = sMenu.cursorPos + cursorDelta;
|
||||
|
||||
if (newPos < sMenu.minCursorPos)
|
||||
sMenu.cursorPos = sMenu.maxCursorPos;
|
||||
else if (newPos > sMenu.maxCursorPos)
|
||||
sMenu.cursorPos = sMenu.minCursorPos;
|
||||
else
|
||||
sMenu.cursorPos += cursorDelta;
|
||||
Menu_RedrawCursor(oldPos, sMenu.cursorPos);
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
|
||||
u8 Menu_MoveCursorNoWrapAround(s8 cursorDelta)
|
||||
{
|
||||
u8 oldPos = sMenu.cursorPos;
|
||||
s32 newPos = sMenu.cursorPos + cursorDelta;
|
||||
|
||||
if (newPos < sMenu.minCursorPos)
|
||||
sMenu.cursorPos = sMenu.minCursorPos;
|
||||
else if (newPos > sMenu.maxCursorPos)
|
||||
sMenu.cursorPos = sMenu.maxCursorPos;
|
||||
else
|
||||
sMenu.cursorPos += cursorDelta;
|
||||
|
||||
Menu_RedrawCursor(oldPos, sMenu.cursorPos);
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
|
||||
u8 Menu_GetCursorPos(void)
|
||||
{
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
|
||||
s8 Menu_ProcessInput(void)
|
||||
{
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
if (!sMenu.APressMuted)
|
||||
PlaySE(SE_SELECT);
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
return MENU_B_PRESSED;
|
||||
}
|
||||
else if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Menu_MoveCursor(-1);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
else if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Menu_MoveCursor(1);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
|
||||
s8 Menu_ProcessInputNoWrapAround(void)
|
||||
{
|
||||
u8 oldPos = sMenu.cursorPos;
|
||||
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
if (!sMenu.APressMuted)
|
||||
PlaySE(SE_SELECT);
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
return MENU_B_PRESSED;
|
||||
}
|
||||
else if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
if (oldPos != Menu_MoveCursorNoWrapAround(-1))
|
||||
PlaySE(SE_SELECT);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
else if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
if (oldPos != Menu_MoveCursorNoWrapAround(1))
|
||||
PlaySE(SE_SELECT);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
|
||||
s8 Menu_ProcessInput_other(void)
|
||||
{
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
if (!sMenu.APressMuted)
|
||||
PlaySE(SE_SELECT);
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
return MENU_B_PRESSED;
|
||||
}
|
||||
else if (JOY_REPT(DPAD_ANY) == DPAD_UP)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Menu_MoveCursor(-1);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
else if (JOY_REPT(DPAD_ANY) == DPAD_DOWN)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Menu_MoveCursor(1);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
|
||||
s8 Menu_ProcessInputNoWrapAround_other(void)
|
||||
{
|
||||
u8 oldPos = sMenu.cursorPos;
|
||||
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
if (!sMenu.APressMuted)
|
||||
PlaySE(SE_SELECT);
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
return MENU_B_PRESSED;
|
||||
}
|
||||
else if (JOY_REPT(DPAD_ANY) == DPAD_UP)
|
||||
{
|
||||
if (oldPos != Menu_MoveCursorNoWrapAround(-1))
|
||||
PlaySE(SE_SELECT);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
else if (JOY_REPT(DPAD_ANY) == DPAD_DOWN)
|
||||
{
|
||||
if (oldPos != Menu_MoveCursorNoWrapAround(1))
|
||||
PlaySE(SE_SELECT);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
|
||||
void PrintTextArray(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *strs)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
for (i = 0; i < itemCount; i++)
|
||||
AddTextPrinterParameterized(windowId, fontId, strs[i].text, left, (lineHeight * i) + top, 0xFF, NULL);
|
||||
CopyWindowToVram(windowId, 2);
|
||||
}
|
||||
|
||||
void MultichoiceList_PrintItems(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, u8 letterSpacing, u8 lineSpacing)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
for (i = 0; i < itemCount; i++)
|
||||
AddTextPrinterParameterized5(windowId, fontId, strs[i].text, left, (lineHeight * i) + top, 0xFF, NULL, letterSpacing, lineSpacing);
|
||||
CopyWindowToVram(windowId, 2);
|
||||
}
|
||||
|
||||
void UnionRoomAndTradeMenuPrintOptions(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const struct MenuAction *strs)
|
||||
{
|
||||
u8 left = GetMenuCursorDimensionByFont(fontId, 0);
|
||||
|
||||
PrintTextArray(windowId, fontId, left, 0, lineHeight, itemCount, strs);
|
||||
}
|
||||
|
||||
void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *orderArray)
|
||||
{
|
||||
u8 i;
|
||||
struct TextPrinterTemplate printer;
|
||||
|
||||
printer.windowId = windowId;
|
||||
printer.fontId = fontId;
|
||||
printer.fgColor = GetFontAttribute(fontId, FONTATTR_COLOR_FOREGROUND);
|
||||
printer.bgColor = GetFontAttribute(fontId, FONTATTR_COLOR_BACKGROUND);
|
||||
printer.shadowColor = GetFontAttribute(fontId, FONTATTR_COLOR_SHADOW);
|
||||
printer.unk = GetFontAttribute(fontId, FONTATTR_UNKNOWN);
|
||||
printer.letterSpacing = letterSpacing;
|
||||
printer.lineSpacing = GetFontAttribute(fontId, FONTATTR_LINE_SPACING);
|
||||
printer.x = left;
|
||||
printer.currentX = left;
|
||||
for (i = 0; i < itemCount; i++)
|
||||
{
|
||||
printer.currentChar = strs[orderArray[i]].text;
|
||||
printer.y = (lineHeight * i) + top;
|
||||
printer.currentY = printer.y;
|
||||
AddTextPrinter(&printer, 0xFF, NULL);
|
||||
}
|
||||
CopyWindowToVram(windowId, 2);
|
||||
}
|
||||
|
||||
// not used
|
||||
static void sub_810FDE4(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *orderArray)
|
||||
{
|
||||
AddItemMenuActionTextPrinters(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 0, GetFontAttribute(fontId, FONTATTR_LETTER_SPACING), lineHeight, itemCount, strs, orderArray);
|
||||
}
|
||||
|
||||
struct WindowTemplate SetWindowTemplateFields(u8 bg, u8 left, u8 top, u8 width, u8 height, u8 paletteNum, u16 baseBlock)
|
||||
{
|
||||
struct WindowTemplate template;
|
||||
|
||||
template.bg = bg;
|
||||
template.tilemapLeft = left;
|
||||
template.tilemapTop = top;
|
||||
template.width = width;
|
||||
template.height = height;
|
||||
template.paletteNum = paletteNum;
|
||||
template.baseBlock = baseBlock;
|
||||
return template;
|
||||
}
|
||||
|
||||
// not used
|
||||
static u16 CreateWindowTemplate(u8 bg, u8 left, u8 top, u8 width, u8 height, u8 paletteNum, u16 baseBlock)
|
||||
{
|
||||
struct WindowTemplate template = SetWindowTemplateFields(bg, left, top, width, height, paletteNum, baseBlock);
|
||||
return AddWindow(&template);
|
||||
}
|
||||
|
||||
void CreateYesNoMenu(const struct WindowTemplate *window, u8 fontId, u8 left, u8 top, u16 baseTileNum, u8 paletteNum, u8 initialCursorPos)
|
||||
{
|
||||
struct TextPrinterTemplate textSubPrinter;
|
||||
|
||||
sYesNoWindowId = AddWindow(window);
|
||||
DrawStdFrameWithCustomTileAndPalette(sYesNoWindowId, 1, baseTileNum, paletteNum);
|
||||
textSubPrinter.currentChar = gUnknown_841623D;
|
||||
textSubPrinter.windowId = sYesNoWindowId;
|
||||
textSubPrinter.fontId = fontId;
|
||||
textSubPrinter.x = GetMenuCursorDimensionByFont(fontId, 0) + left;
|
||||
textSubPrinter.y = top;
|
||||
textSubPrinter.currentX = textSubPrinter.x;
|
||||
textSubPrinter.currentY = textSubPrinter.y;
|
||||
textSubPrinter.fgColor = GetFontAttribute(fontId, FONTATTR_COLOR_FOREGROUND);
|
||||
textSubPrinter.bgColor = GetFontAttribute(fontId, FONTATTR_COLOR_BACKGROUND);
|
||||
textSubPrinter.shadowColor = GetFontAttribute(fontId, FONTATTR_COLOR_SHADOW);
|
||||
textSubPrinter.unk = GetFontAttribute(fontId, FONTATTR_UNKNOWN);
|
||||
textSubPrinter.letterSpacing = GetFontAttribute(fontId, FONTATTR_LETTER_SPACING);
|
||||
textSubPrinter.lineSpacing = GetFontAttribute(fontId, FONTATTR_LINE_SPACING);
|
||||
AddTextPrinter(&textSubPrinter, 0xFF, NULL);
|
||||
Menu_InitCursor(sYesNoWindowId, fontId, left, top, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_HEIGHT) + textSubPrinter.lineSpacing, 2, initialCursorPos);
|
||||
}
|
||||
|
||||
// not used
|
||||
static void CreateYesNoMenu2(const struct WindowTemplate *window, u8 paletteNum, u16 baseTileNum, u8 initialCursorPos)
|
||||
{
|
||||
CreateYesNoMenu(window, paletteNum, 0, 0, baseTileNum, initialCursorPos, 0);
|
||||
}
|
||||
|
||||
s8 Menu_ProcessInputNoWrapClearOnChoose(void)
|
||||
{
|
||||
s8 result = Menu_ProcessInputNoWrapAround();
|
||||
if (result != MENU_NOTHING_CHOSEN)
|
||||
DestroyYesNoMenu();
|
||||
return result;
|
||||
}
|
||||
|
||||
void DestroyYesNoMenu(void)
|
||||
{
|
||||
ClearStdWindowAndFrameToTransparent(sYesNoWindowId, TRUE);
|
||||
RemoveWindow(sYesNoWindowId);
|
||||
}
|
||||
|
||||
void MultichoiceGrid_PrintItems(u8 windowId, u8 fontId, u8 itemWidth, u8 itemHeight, u8 cols, u8 rows, const struct MenuAction *strs)
|
||||
{
|
||||
u8 width, i, j, yOffset;
|
||||
|
||||
fontId = fontId;
|
||||
itemWidth = itemWidth;
|
||||
itemHeight = itemHeight;
|
||||
width = GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH);
|
||||
yOffset = (16 - GetFontAttribute(fontId, FONTATTR_MAX_LETTER_HEIGHT)) / 2;
|
||||
for (i = 0; i < rows; ++i)
|
||||
for (j = 0; j < cols; ++j)
|
||||
AddTextPrinterParameterized(windowId, fontId, strs[i * cols + j].text, itemWidth * j + width, yOffset + itemHeight * i, 0xFF, 0);
|
||||
CopyWindowToVram(windowId, 2);
|
||||
}
|
||||
|
||||
//not used
|
||||
static void MultichoiceGrid_PrintItemsCustomOrder(u8 windowId, u8 fontId, u8 itemWidth, u8 itemHeight, u8 cols, u8 rows, const struct MenuAction *strs, const u8 *orderArray)
|
||||
{
|
||||
u8 width, i, j;
|
||||
|
||||
fontId = fontId;
|
||||
itemWidth = itemWidth;
|
||||
itemHeight = itemHeight;
|
||||
width = GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH);
|
||||
for (i = 0; i < rows; ++i)
|
||||
for (j = 0; j < cols; ++j)
|
||||
AddTextPrinterParameterized(windowId, fontId, strs[orderArray[i * cols + j]].text, itemWidth * j + width, itemHeight * i, 0xFF, 0);
|
||||
CopyWindowToVram(windowId, 2);
|
||||
}
|
||||
|
||||
static u8 MultichoiceGrid_InitCursorInternal(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth, u8 cursorHeight, u8 cols, u8 rows, u8 numChoices, u8 cursorPos)
|
||||
{
|
||||
s32 pos;
|
||||
|
||||
sMenu.left = left;
|
||||
sMenu.top = top;
|
||||
sMenu.minCursorPos = 0;
|
||||
sMenu.maxCursorPos = numChoices - 1;
|
||||
sMenu.windowId = windowId;
|
||||
sMenu.fontId = fontId;
|
||||
sMenu.optionWidth = optionWidth;
|
||||
sMenu.optionHeight = cursorHeight;
|
||||
sMenu.columns = cols;
|
||||
sMenu.rows = rows;
|
||||
pos = cursorPos;
|
||||
if (pos < 0 || pos > sMenu.maxCursorPos)
|
||||
sMenu.cursorPos = 0;
|
||||
else
|
||||
sMenu.cursorPos = pos;
|
||||
MultichoiceGrid_MoveCursor(0, 0);
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
|
||||
u8 MultichoiceGrid_InitCursor(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth, u8 cols, u8 rows, u8 cursorPos)
|
||||
{
|
||||
s32 cursorHeight = 16;
|
||||
u8 numChoices = cols * rows;
|
||||
|
||||
return MultichoiceGrid_InitCursorInternal(windowId, fontId, left, top, optionWidth, cursorHeight, cols, rows, numChoices, cursorPos);
|
||||
}
|
||||
|
||||
static void MultichoiceGrid_RedrawCursor(u8 oldCursorPos, u8 newCursorPos)
|
||||
{
|
||||
u8 cursorWidth = GetMenuCursorDimensionByFont(sMenu.fontId, 0);
|
||||
u8 cursorHeight = GetMenuCursorDimensionByFont(sMenu.fontId, 1);
|
||||
u8 xPos = (oldCursorPos % sMenu.columns) * sMenu.optionWidth + sMenu.left;
|
||||
u8 yPos = (oldCursorPos / sMenu.columns) * sMenu.optionHeight + sMenu.top;
|
||||
|
||||
FillWindowPixelRect(sMenu.windowId, PIXEL_FILL(1), xPos, yPos, cursorWidth, cursorHeight);
|
||||
xPos = (newCursorPos % sMenu.columns) * sMenu.optionWidth + sMenu.left;
|
||||
yPos = (newCursorPos / sMenu.columns) * sMenu.optionHeight + sMenu.top;
|
||||
AddTextPrinterParameterized(sMenu.windowId, sMenu.fontId, gFameCheckerText_ListMenuCursor, xPos, yPos, 0, 0);
|
||||
}
|
||||
|
||||
static u8 MultichoiceGrid_MoveCursor(s8 deltaX, s8 deltaY)
|
||||
{
|
||||
u8 oldPos = sMenu.cursorPos;
|
||||
|
||||
if (deltaX)
|
||||
{
|
||||
if ((sMenu.cursorPos % sMenu.columns) + deltaX < 0)
|
||||
sMenu.cursorPos += sMenu.columns - 1;
|
||||
else if ((sMenu.cursorPos % sMenu.columns) + deltaX >= sMenu.columns)
|
||||
sMenu.cursorPos = (sMenu.cursorPos / sMenu.columns) * sMenu.columns;
|
||||
else
|
||||
sMenu.cursorPos += deltaX;
|
||||
}
|
||||
if (deltaY)
|
||||
{
|
||||
if ((sMenu.cursorPos / sMenu.columns) + deltaY < 0)
|
||||
sMenu.cursorPos += sMenu.columns * (sMenu.rows - 1);
|
||||
else if ((sMenu.cursorPos / sMenu.columns) + deltaY >= sMenu.rows)
|
||||
sMenu.cursorPos -= sMenu.columns * (sMenu.rows - 1);
|
||||
else
|
||||
sMenu.cursorPos += (sMenu.columns * deltaY);
|
||||
}
|
||||
if (sMenu.cursorPos > sMenu.maxCursorPos)
|
||||
{
|
||||
sMenu.cursorPos = oldPos;
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
else
|
||||
{
|
||||
MultichoiceGrid_RedrawCursor(oldPos, sMenu.cursorPos);
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
}
|
||||
|
||||
static u8 MultichoiceGrid_MoveCursorIfValid(s8 deltaX, s8 deltaY)
|
||||
{
|
||||
u8 oldPos = sMenu.cursorPos;
|
||||
|
||||
if (deltaX)
|
||||
{
|
||||
if (((sMenu.cursorPos % sMenu.columns) + deltaX >= 0) && ((sMenu.cursorPos % sMenu.columns) + deltaX < sMenu.columns))
|
||||
sMenu.cursorPos += deltaX;
|
||||
}
|
||||
if (deltaY)
|
||||
{
|
||||
if (((sMenu.cursorPos / sMenu.columns) + deltaY >= 0) && ((sMenu.cursorPos / sMenu.columns) + deltaY < sMenu.rows))
|
||||
sMenu.cursorPos += (sMenu.columns * deltaY);
|
||||
}
|
||||
if (sMenu.cursorPos > sMenu.maxCursorPos)
|
||||
{
|
||||
sMenu.cursorPos = oldPos;
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
else
|
||||
{
|
||||
MultichoiceGrid_RedrawCursor(oldPos, sMenu.cursorPos);
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
}
|
||||
|
||||
// not used
|
||||
static s8 sub_81105A0(void)
|
||||
{
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
return MENU_B_PRESSED;
|
||||
}
|
||||
else if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
MultichoiceGrid_MoveCursor(0, -1);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
else if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
MultichoiceGrid_MoveCursor(0, 1);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
else if (JOY_NEW(DPAD_LEFT) || GetLRKeysState() == 1)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
MultichoiceGrid_MoveCursor(-1, 0);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysState() == 2)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
MultichoiceGrid_MoveCursor(1, 0);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
|
||||
s8 Menu_ProcessInputGridLayout(void)
|
||||
{
|
||||
u8 oldPos = sMenu.cursorPos;
|
||||
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
return MENU_B_PRESSED;
|
||||
}
|
||||
else if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
if (oldPos != MultichoiceGrid_MoveCursorIfValid(0, -1))
|
||||
PlaySE(SE_SELECT);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
else if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
if (oldPos != MultichoiceGrid_MoveCursorIfValid(0, 1))
|
||||
PlaySE(SE_SELECT);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
else if (JOY_NEW(DPAD_LEFT) || GetLRKeysState() == 1)
|
||||
{
|
||||
if (oldPos != MultichoiceGrid_MoveCursorIfValid(-1, 0))
|
||||
PlaySE(SE_SELECT);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysState() == 2)
|
||||
{
|
||||
if (oldPos != MultichoiceGrid_MoveCursorIfValid(1, 0))
|
||||
PlaySE(SE_SELECT);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
|
||||
// not used
|
||||
static s8 sub_81106F4(void)
|
||||
{
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
return MENU_B_PRESSED;
|
||||
}
|
||||
else if (JOY_REPT(DPAD_ANY) == DPAD_UP)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
MultichoiceGrid_MoveCursor(0, -1);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
else if (JOY_REPT(DPAD_ANY) == DPAD_DOWN)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
MultichoiceGrid_MoveCursor(0, 1);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
else if (JOY_REPT(DPAD_ANY) == DPAD_LEFT || sub_80BF66C() == 1)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
MultichoiceGrid_MoveCursor(-1, 0);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
else if (JOY_REPT(DPAD_ANY) == DPAD_RIGHT || sub_80BF66C() == 2)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
MultichoiceGrid_MoveCursor(1, 0);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
|
||||
// not used
|
||||
static s8 sub_81107A0(void)
|
||||
{
|
||||
u8 oldPos = sMenu.cursorPos;
|
||||
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
return sMenu.cursorPos;
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
return MENU_B_PRESSED;
|
||||
}
|
||||
else if (JOY_REPT(DPAD_ANY) == DPAD_UP)
|
||||
{
|
||||
if (oldPos != MultichoiceGrid_MoveCursorIfValid(0, -1))
|
||||
PlaySE(SE_SELECT);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
else if (JOY_REPT(DPAD_ANY) == DPAD_DOWN)
|
||||
{
|
||||
if (oldPos != MultichoiceGrid_MoveCursorIfValid(0, 1))
|
||||
PlaySE(SE_SELECT);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
else if (JOY_REPT(DPAD_ANY) == DPAD_LEFT || sub_80BF66C() == 1)
|
||||
{
|
||||
if (oldPos != MultichoiceGrid_MoveCursorIfValid(-1, 0))
|
||||
PlaySE(SE_SELECT);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
else if (JOY_REPT(DPAD_ANY) == DPAD_RIGHT || sub_80BF66C() == 2)
|
||||
{
|
||||
if (oldPos != MultichoiceGrid_MoveCursorIfValid(1, 0))
|
||||
PlaySE(SE_SELECT);
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
return MENU_NOTHING_CHOSEN;
|
||||
}
|
||||
+1
-1
@@ -504,7 +504,7 @@ void sub_812E6DC(u8 windowId, const u8 * src, u16 x, u16 y)
|
||||
|
||||
// Yeah, no, I'm not bothering with this
|
||||
NAKED
|
||||
void sub_819A080(void * a0, void * a1, u16 a2, u16 a3, u16 a4, u16 a5, u16 a6, u16 a7)
|
||||
static void sub_812E768(void * a0, void * a1, u16 a2, u16 a3, u16 a4, u16 a5, u16 a6, u16 a7)
|
||||
{
|
||||
asm_unified("\tpush {r4-r7,lr}\n"
|
||||
"\tmov r7, r10\n"
|
||||
|
||||
+4
-4
@@ -22,10 +22,10 @@ static EWRAM_DATA u8 gUnknown_20399D0 = {0};
|
||||
|
||||
static void Task_ContinueTaskAfterMessagePrints(u8 taskId);
|
||||
|
||||
void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 arg2, u8 arg3, u8 fontId, u8 textSpeed, const u8 *string, void *taskFunc)
|
||||
void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 tileNum, u8 paletteNum, u8 fontId, u8 textSpeed, const u8 *string, void *taskFunc)
|
||||
{
|
||||
gUnknown_20399D0 = windowId;
|
||||
DrawDialogFrameWithCustomTileAndPalette(windowId, TRUE, arg2, arg3);
|
||||
DrawDialogFrameWithCustomTileAndPalette(windowId, TRUE, tileNum, paletteNum);
|
||||
|
||||
if (string != gStringVar4)
|
||||
StringExpandPlaceholders(gStringVar4, string);
|
||||
@@ -64,9 +64,9 @@ static void Task_CallYesOrNoCallback(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 arg2, u8 arg3, u8 arg4, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo)
|
||||
void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 fontId, u8 left, u8 top, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo)
|
||||
{
|
||||
CreateYesNoMenu(template, arg2, arg3, arg4, tileStart, palette, 0);
|
||||
CreateYesNoMenu(template, fontId, left, top, tileStart, palette, 0);
|
||||
gUnknown_20399C8 = yesNo;
|
||||
gTasks[taskId].func = Task_CallYesOrNoCallback;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "decompress.h"
|
||||
#include "malloc.h"
|
||||
#include "menu.h"
|
||||
#include "new_menu_helpers.h"
|
||||
#include "pokemon_icon.h"
|
||||
#include "mystery_gift_menu.h"
|
||||
#include "menu_indicators.h"
|
||||
|
||||
+5
-6
@@ -109,7 +109,7 @@ void PrintMoneyAmount(u8 windowId, u8 x, u8 y, int amount, u8 speed)
|
||||
|
||||
void PrintMoneyAmountInMoneyBoxWithBorder(u8 windowId, u16 tileStart, u8 pallete, int amount)
|
||||
{
|
||||
SetWindowBorderStyle(windowId, FALSE, tileStart, pallete);
|
||||
DrawStdFrameWithCustomTileAndPalette(windowId, FALSE, tileStart, pallete);
|
||||
AddTextPrinterParameterized(windowId, 2, gUnknown_8419CE7, 0, 0, 0xFF, 0);
|
||||
PrintMoneyAmountInMoneyBox(windowId, amount, 0);
|
||||
}
|
||||
@@ -121,11 +121,10 @@ void ChangeAmountInMoneyBox(int amount)
|
||||
|
||||
void DrawMoneyBox(int amount, u8 x, u8 y)
|
||||
{
|
||||
struct WindowTemplate template, template2;
|
||||
struct WindowTemplate template;
|
||||
|
||||
SetWindowTemplateFields(&template, 0, x + 1, y + 1, 8, 3, 15, 8);
|
||||
template2 = template;
|
||||
sMoneyBoxWindowId = AddWindow(&template2);
|
||||
template = SetWindowTemplateFields(0, x + 1, y + 1, 8, 3, 15, 8);
|
||||
sMoneyBoxWindowId = AddWindow(&template);
|
||||
FillWindowPixelBuffer(sMoneyBoxWindowId, 0);
|
||||
PutWindowTilemap(sMoneyBoxWindowId);
|
||||
TextWindow_SetStdFrame0_WithPal(sMoneyBoxWindowId, 0x21D, 0xD0);
|
||||
@@ -134,7 +133,7 @@ void DrawMoneyBox(int amount, u8 x, u8 y)
|
||||
|
||||
void HideMoneyBox(void)
|
||||
{
|
||||
ClearMenuWindow(sMoneyBoxWindowId, FALSE);
|
||||
ClearStdWindowAndFrameToTransparent(sMoneyBoxWindowId, FALSE);
|
||||
CopyWindowToVram(sMoneyBoxWindowId, 2);
|
||||
RemoveWindow(sMoneyBoxWindowId);
|
||||
}
|
||||
|
||||
@@ -603,7 +603,7 @@ void sub_80F771C(bool8 copyToVram)
|
||||
|
||||
void SetStdWindowBorderStyle(u8 windowId, bool8 copyToVram)
|
||||
{
|
||||
SetWindowBorderStyle(windowId, copyToVram, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM);
|
||||
DrawStdFrameWithCustomTileAndPalette(windowId, copyToVram, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM);
|
||||
}
|
||||
|
||||
void sub_80F7768(u8 windowId, bool8 copyToVram)
|
||||
@@ -671,10 +671,8 @@ u8 sub_80F78E0(u8 height)
|
||||
{
|
||||
if (sStartMenuWindowId == 0xFF)
|
||||
{
|
||||
struct WindowTemplate wTemp1, wTemp2;
|
||||
SetWindowTemplateFields(&wTemp1, 0, 0x16, 1, 7, height * 2 - 1, DLG_WINDOW_PALETTE_NUM, 0x13D);
|
||||
wTemp2 = wTemp1;
|
||||
sStartMenuWindowId = AddWindow(&wTemp2);
|
||||
struct WindowTemplate template = SetWindowTemplateFields(0, 0x16, 1, 7, height * 2 - 1, DLG_WINDOW_PALETTE_NUM, 0x13D);
|
||||
sStartMenuWindowId = AddWindow(&template);
|
||||
PutWindowTilemap(sStartMenuWindowId);
|
||||
}
|
||||
return sStartMenuWindowId;
|
||||
|
||||
+28
-28
@@ -37,7 +37,7 @@ struct OakSpeechResources
|
||||
u16 unk_0010;
|
||||
u16 unk_0012;
|
||||
u16 unk_0014[4];
|
||||
u8 unk_001C[3];
|
||||
struct TextColor textColor;
|
||||
u8 textSpeed;
|
||||
u8 filler_0020[0x1800];
|
||||
u8 bg2TilemapBuffer[0x400];
|
||||
@@ -546,7 +546,7 @@ static void Task_OaksSpeech1(u8 taskId)
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
break;
|
||||
case 7:
|
||||
CreateWindow_SnapRight_StdPal(0, 30, 0, 13, 0x1C4);
|
||||
CreateTopBarWindowLoadPalette(0, 30, 0, 13, 0x1C4);
|
||||
FillBgTilemapBufferRect_Palette0(1, 0xD00F, 0, 0, 30, 2);
|
||||
FillBgTilemapBufferRect_Palette0(1, 0xD002, 0, 2, 30, 1);
|
||||
FillBgTilemapBufferRect_Palette0(1, 0xD00E, 0, 19, 30, 1);
|
||||
@@ -572,7 +572,7 @@ static void Task_OaksSpeech1(u8 taskId)
|
||||
|
||||
static void CreateHelpDocsPage1(void)
|
||||
{
|
||||
Menu_PrintHelpSystemUIHeader(gText_Controls, gText_ABUTTONNext, 0, 0, 1);
|
||||
TopBarWindowPrintTwoStrings(gText_Controls, gText_ABUTTONNext, 0, 0, 1);
|
||||
sOakSpeechResources->unk_0014[0] = AddWindow(sHelpDocsWindowTemplatePtrs[sOakSpeechResources->unk_0012]);
|
||||
PutWindowTilemap(sOakSpeechResources->unk_0014[0]);
|
||||
FillWindowPixelBuffer(sOakSpeechResources->unk_0014[0], 0x00);
|
||||
@@ -592,7 +592,7 @@ static void Task_OakSpeech4(u8 taskId)
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintTextOnRightSnappedWindow(gText_ABUTTONNext_BBUTTONBack, 0, 1);
|
||||
TopBarWindowPrintString(gText_ABUTTONNext_BBUTTONBack, 0, 1);
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
sOakSpeechResources->unk_0014[i] = AddWindow(&sHelpDocsWindowTemplatePtrs[sOakSpeechResources->unk_0012][i]);
|
||||
@@ -716,8 +716,8 @@ static void Task_OakSpeech6(u8 taskId)
|
||||
else
|
||||
{
|
||||
PlayBGM(BGM_FRLG_GAME_EXPLANATION_MIDDLE);
|
||||
sub_810F71C();
|
||||
PrintTextOnRightSnappedWindow(gText_ABUTTONNext, 0, 1);
|
||||
ClearTopBarWindow();
|
||||
TopBarWindowPrintString(gText_ABUTTONNext, 0, 1);
|
||||
sOakSpeechResources->unk_0008 = MallocAndDecompress(sNewGameAdventureIntroTilemap, &sp14);
|
||||
CopyToBgTilemapBufferRect(1, sOakSpeechResources->unk_0008, 0, 2, 30, 19);
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
@@ -793,13 +793,13 @@ static void Task_OakSpeech7(u8 taskId)
|
||||
AddTextPrinterParameterized4(data[14], 2, 3, 5, 1, 0, &sTextColor_OakSpeech, 0, sNewGameAdventureIntroTextPointers[sOakSpeechResources->unk_0012]);
|
||||
if (sOakSpeechResources->unk_0012 == 0)
|
||||
{
|
||||
sub_810F71C();
|
||||
PrintTextOnRightSnappedWindow(gText_ABUTTONNext, 0, 1);
|
||||
ClearTopBarWindow();
|
||||
TopBarWindowPrintString(gText_ABUTTONNext, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_810F71C();
|
||||
PrintTextOnRightSnappedWindow(gText_ABUTTONNext_BBUTTONBack, 0, 1);
|
||||
ClearTopBarWindow();
|
||||
TopBarWindowPrintString(gText_ABUTTONNext_BBUTTONBack, 0, 1);
|
||||
}
|
||||
gMain.state++;
|
||||
}
|
||||
@@ -846,7 +846,7 @@ static void Task_OakSpeech8(u8 taskId)
|
||||
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
sub_810F740();
|
||||
DestroyTopBarWindow();
|
||||
FillWindowPixelBuffer(data[14], 0x00);
|
||||
ClearWindowTilemap(data[14]);
|
||||
CopyWindowToVram(data[14], 3);
|
||||
@@ -1054,17 +1054,17 @@ static void Task_OakSpeech19(u8 taskId)
|
||||
{
|
||||
gTasks[taskId].data[13] = AddWindow(&sNewGameAdventureIntroWindowTemplates[1]);
|
||||
PutWindowTilemap(gTasks[taskId].data[13]);
|
||||
SetWindowBorderStyle(gTasks[taskId].data[13], 1, GetStdWindowBaseTileNum(), 14);
|
||||
DrawStdFrameWithCustomTileAndPalette(gTasks[taskId].data[13], 1, GetStdWindowBaseTileNum(), 14);
|
||||
FillWindowPixelBuffer(gTasks[taskId].data[13], 0x11);
|
||||
sOakSpeechResources->unk_001C[0] = 1;
|
||||
sOakSpeechResources->unk_001C[1] = 2;
|
||||
sOakSpeechResources->unk_001C[2] = 3;
|
||||
AddTextPrinterParameterized3(gTasks[taskId].data[13], 2, 8, 1, sOakSpeechResources->unk_001C, 0, gText_Boy);
|
||||
sOakSpeechResources->unk_001C[0] = 1;
|
||||
sOakSpeechResources->unk_001C[1] = 2;
|
||||
sOakSpeechResources->unk_001C[2] = 3;
|
||||
AddTextPrinterParameterized3(gTasks[taskId].data[13], 2, 8, 17, sOakSpeechResources->unk_001C, 0, gText_Girl);
|
||||
ProgramAndPlaceMenuCursorOnWindow(gTasks[taskId].data[13], 2, 0, 1, GetFontAttribute(2, 1) + 2, 2, 0);
|
||||
sOakSpeechResources->textColor.fgColor = 1;
|
||||
sOakSpeechResources->textColor.bgColor = 2;
|
||||
sOakSpeechResources->textColor.shadowColor = 3;
|
||||
AddTextPrinterParameterized3(gTasks[taskId].data[13], 2, 8, 1, &sOakSpeechResources->textColor, 0, gText_Boy);
|
||||
sOakSpeechResources->textColor.fgColor = 1;
|
||||
sOakSpeechResources->textColor.bgColor = 2;
|
||||
sOakSpeechResources->textColor.shadowColor = 3;
|
||||
AddTextPrinterParameterized3(gTasks[taskId].data[13], 2, 8, 17, &sOakSpeechResources->textColor, 0, gText_Girl);
|
||||
Menu_InitCursor(gTasks[taskId].data[13], 2, 0, 1, GetFontAttribute(2, 1) + 2, 2, 0);
|
||||
CopyWindowToVram(gTasks[taskId].data[13], 3);
|
||||
gTasks[taskId].func = Task_OakSpeech20;
|
||||
}
|
||||
@@ -1072,7 +1072,7 @@ static void Task_OakSpeech19(u8 taskId)
|
||||
|
||||
static void Task_OakSpeech20(u8 taskId)
|
||||
{
|
||||
s8 input = ProcessMenuInputNoWrapAround();
|
||||
s8 input = Menu_ProcessInputNoWrapAround();
|
||||
switch (input)
|
||||
{
|
||||
case 0:
|
||||
@@ -1092,7 +1092,7 @@ static void Task_OakSpeech20(u8 taskId)
|
||||
static void Task_OakSpeech21(u8 taskId)
|
||||
{
|
||||
s16 * data = gTasks[taskId].data;
|
||||
ClearMenuWindow(data[13], 1);
|
||||
ClearStdWindowAndFrameToTransparent(data[13], 1);
|
||||
RemoveWindow(data[13]);
|
||||
data[13] = 0;
|
||||
ClearDialogWindowAndFrame(0, 1);
|
||||
@@ -1176,7 +1176,7 @@ static void Task_OakSpeech28(u8 taskId)
|
||||
static void Task_OakSpeech29(u8 taskId)
|
||||
{
|
||||
s16 * data = gTasks[taskId].data;
|
||||
s8 input = ProcessMenuInput();
|
||||
s8 input = Menu_ProcessInput();
|
||||
switch (input)
|
||||
{
|
||||
case 1:
|
||||
@@ -1184,7 +1184,7 @@ static void Task_OakSpeech29(u8 taskId)
|
||||
case 3:
|
||||
case 4:
|
||||
PlaySE(SE_SELECT);
|
||||
ClearMenuWindow(data[13], TRUE);
|
||||
ClearStdWindowAndFrameToTransparent(data[13], TRUE);
|
||||
RemoveWindow(data[13]);
|
||||
GetDefaultName(sOakSpeechResources->unk_0010, input - 1);
|
||||
data[15] = 1;
|
||||
@@ -1211,7 +1211,7 @@ static void Task_OakSpeech25(u8 taskId)
|
||||
}
|
||||
else
|
||||
{
|
||||
ClearMenuWindow(gTasks[taskId].data[13], 1);
|
||||
ClearStdWindowAndFrameToTransparent(gTasks[taskId].data[13], 1);
|
||||
RemoveWindow(gTasks[taskId].data[13]);
|
||||
DoNamingScreen(4, gSaveBlock1Ptr->rivalName, 0, 0, 0, CB2_ReturnFromNamingScreen);
|
||||
}
|
||||
@@ -1850,7 +1850,7 @@ static void PrintNameChoiceOptions(u8 taskId, u8 state)
|
||||
|
||||
data[13] = AddWindow(&sNewGameAdventureIntroWindowTemplates[3]);
|
||||
PutWindowTilemap(data[13]);
|
||||
SetWindowBorderStyle(data[13], 1, GetStdWindowBaseTileNum(), 14);
|
||||
DrawStdFrameWithCustomTileAndPalette(data[13], 1, GetStdWindowBaseTileNum(), 14);
|
||||
FillWindowPixelBuffer(gTasks[taskId].data[13], 0x11);
|
||||
AddTextPrinterParameterized(data[13], 2, gOtherText_NewName, 8, 1, 0, NULL);
|
||||
if (state == 0)
|
||||
@@ -1861,7 +1861,7 @@ static void PrintNameChoiceOptions(u8 taskId, u8 state)
|
||||
{
|
||||
AddTextPrinterParameterized(data[13], 2, textPtrs[i], 8, 16 * (i + 1) + 1, 0, NULL);
|
||||
}
|
||||
ProgramAndPlaceMenuCursorOnWindow(data[13], 2, 0, 1, 16, 5, 0);
|
||||
Menu_InitCursor(data[13], 2, 0, 1, 16, 5, 0);
|
||||
CopyWindowToVram(data[13], 3);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "link.h"
|
||||
#include "quest_log_8150454.h"
|
||||
#include "quest_log.h"
|
||||
#include "new_menu_helpers.h"
|
||||
|
||||
u8 gUnknown_3005E88;
|
||||
|
||||
|
||||
+1
-1
@@ -169,7 +169,7 @@ void FadeOutAndFadeInNewMapMusic(u16 songNum, u8 fadeOutSpeed, u8 fadeInSpeed)
|
||||
sMapMusicFadeInSpeed = fadeInSpeed;
|
||||
}
|
||||
|
||||
void FadeInNewMapMusic(u16 songNum, u8 speed)
|
||||
static void FadeInNewMapMusic(u16 songNum, u8 speed)
|
||||
{
|
||||
FadeInNewBGM(songNum, speed);
|
||||
sCurrentMapMusic = songNum;
|
||||
|
||||
+18
-18
@@ -795,7 +795,7 @@ static void Task_SelectTMAction_FromFieldBag(u8 taskId)
|
||||
sTMCaseDynamicResources->numMenuActions = NELEMS(sMenuActionIndices_UnionRoom);
|
||||
}
|
||||
AddItemMenuActionTextPrinters(sTMCaseDynamicResources->contextMenuWindowId, 2, GetMenuCursorDimensionByFont(2, 0), 2, 0, GetFontAttribute(2, 1) + 2, sTMCaseDynamicResources->numMenuActions, sMenuActions_UseGiveExit, sTMCaseDynamicResources->menuActionIndices);
|
||||
ProgramAndPlaceMenuCursorOnWindow(sTMCaseDynamicResources->contextMenuWindowId, 2, 0, 2, GetFontAttribute(2, 1) + 2, sTMCaseDynamicResources->numMenuActions, 0);
|
||||
Menu_InitCursor(sTMCaseDynamicResources->contextMenuWindowId, 2, 0, 2, GetFontAttribute(2, 1) + 2, sTMCaseDynamicResources->numMenuActions, 0);
|
||||
strbuf = Alloc(256);
|
||||
GetTMNumberAndMoveString(strbuf, gSpecialVar_ItemId);
|
||||
StringAppend(strbuf, gText_IsSelected);
|
||||
@@ -817,7 +817,7 @@ static void Task_TMContextMenu_HandleInput(u8 taskId)
|
||||
|
||||
if (sub_80BF72C() != TRUE)
|
||||
{
|
||||
input = ProcessMenuInputNoWrapAround();
|
||||
input = Menu_ProcessInputNoWrapAround();
|
||||
switch (input)
|
||||
{
|
||||
case -1:
|
||||
@@ -837,7 +837,7 @@ static void Task_TMContextMenu_HandleInput(u8 taskId)
|
||||
static void TMHMContextMenuAction_Use(u8 taskId)
|
||||
{
|
||||
RemoveTMContextMenu(&sTMCaseDynamicResources->contextMenuWindowId);
|
||||
ClearMenuWindow(2, 0);
|
||||
ClearStdWindowAndFrameToTransparent(2, 0);
|
||||
ClearWindowTilemap(2);
|
||||
PutWindowTilemap(0);
|
||||
ScheduleBgCopyTilemapToVram(0);
|
||||
@@ -859,7 +859,7 @@ static void TMHMContextMenuAction_Give(u8 taskId)
|
||||
s16 * data = gTasks[taskId].data;
|
||||
u16 itemId = BagGetItemIdByPocketPosition(POCKET_TM_CASE, data[1]);
|
||||
RemoveTMContextMenu(&sTMCaseDynamicResources->contextMenuWindowId);
|
||||
ClearMenuWindow(2, 0);
|
||||
ClearStdWindowAndFrameToTransparent(2, 0);
|
||||
ClearWindowTilemap(2);
|
||||
PutWindowTilemap(1);
|
||||
PutWindowTilemap(4);
|
||||
@@ -912,7 +912,7 @@ static void Subtask_CloseContextMenuAndReturnToMain(u8 taskId)
|
||||
DestroyListMenuTask(data[0], &sTMCaseStaticResources.scrollOffset, &sTMCaseStaticResources.selectedRow);
|
||||
data[0] = ListMenuInit(&gMultiuseListMenuTemplate, sTMCaseStaticResources.scrollOffset, sTMCaseStaticResources.selectedRow);
|
||||
PrintListMenuCursorByID_WithColorIdx(data[0], 1);
|
||||
ClearMenuWindow_BorderThickness2(6, 0);
|
||||
ClearDialogWindowAndFrameToTransparent(6, 0);
|
||||
ClearWindowTilemap(6);
|
||||
PutWindowTilemap(1);
|
||||
PutWindowTilemap(4);
|
||||
@@ -927,7 +927,7 @@ static void TMHMContextMenuAction_Exit(u8 taskId)
|
||||
s16 * data = gTasks[taskId].data;
|
||||
|
||||
RemoveTMContextMenu(&sTMCaseDynamicResources->contextMenuWindowId);
|
||||
ClearMenuWindow(2, 0);
|
||||
ClearStdWindowAndFrameToTransparent(2, 0);
|
||||
ClearWindowTilemap(2);
|
||||
PutWindowTilemap(0);
|
||||
PrintListMenuCursorByID_WithColorIdx(data[0], 1);
|
||||
@@ -1016,8 +1016,8 @@ static void Task_SaleOfTMsCancelled(u8 taskId)
|
||||
{
|
||||
s16 * data = gTasks[taskId].data;
|
||||
|
||||
ClearMenuWindow(8, 0);
|
||||
ClearMenuWindow_BorderThickness2(6, 0);
|
||||
ClearStdWindowAndFrameToTransparent(8, 0);
|
||||
ClearDialogWindowAndFrameToTransparent(6, 0);
|
||||
PutWindowTilemap(0);
|
||||
PutWindowTilemap(1);
|
||||
PutWindowTilemap(3);
|
||||
@@ -1065,7 +1065,7 @@ static void Task_QuantitySelect_HandleInput(u8 taskId)
|
||||
else if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
ClearMenuWindow(7, 0);
|
||||
ClearStdWindowAndFrameToTransparent(7, 0);
|
||||
ScheduleBgCopyTilemapToVram(0);
|
||||
ScheduleBgCopyTilemapToVram(1);
|
||||
RemoveTMCaseScrollIndicatorArrowPair();
|
||||
@@ -1074,9 +1074,9 @@ static void Task_QuantitySelect_HandleInput(u8 taskId)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
ClearMenuWindow(7, 0);
|
||||
ClearMenuWindow(8, 0);
|
||||
ClearMenuWindow_BorderThickness2(6, 0);
|
||||
ClearStdWindowAndFrameToTransparent(7, 0);
|
||||
ClearStdWindowAndFrameToTransparent(8, 0);
|
||||
ClearDialogWindowAndFrameToTransparent(6, 0);
|
||||
PutWindowTilemap(3);
|
||||
PutWindowTilemap(0);
|
||||
PutWindowTilemap(1);
|
||||
@@ -1123,8 +1123,8 @@ static void Task_AfterSale_ReturnToList(u8 taskId)
|
||||
if (JOY_NEW(A_BUTTON) || JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
ClearMenuWindow(8, 0);
|
||||
ClearMenuWindow_BorderThickness2(6, 0);
|
||||
ClearStdWindowAndFrameToTransparent(8, 0);
|
||||
ClearDialogWindowAndFrameToTransparent(6, 0);
|
||||
PutWindowTilemap(1);
|
||||
PutWindowTilemap(3);
|
||||
PutWindowTilemap(4);
|
||||
@@ -1249,7 +1249,7 @@ static void Task_TMCaseDude_Playback(u8 taskId)
|
||||
{
|
||||
FillBG2RowWithPalette_2timesNplus1(0);
|
||||
BeginNormalPaletteFade(0x00000400, 0, 6, 0, 0);
|
||||
ClearMenuWindow_BorderThickness2(6, 0);
|
||||
ClearDialogWindowAndFrameToTransparent(6, 0);
|
||||
ScheduleBgCopyTilemapToVram(1);
|
||||
data[8]++;
|
||||
}
|
||||
@@ -1322,12 +1322,12 @@ static void AddTextPrinterParameterized_ColorByIndex(u8 windowId, u8 fontId, con
|
||||
|
||||
static void TMCase_SetWindowBorder1(u8 windowId)
|
||||
{
|
||||
SetWindowBorderStyle(windowId, FALSE, 0x5B, 0x0E);
|
||||
DrawStdFrameWithCustomTileAndPalette(windowId, FALSE, 0x5B, 0x0E);
|
||||
}
|
||||
|
||||
static void TMCase_SetWindowBorder2(u8 windowId)
|
||||
{
|
||||
SetWindowBorderStyle(windowId, FALSE, 0x78, 0x0D);
|
||||
DrawStdFrameWithCustomTileAndPalette(windowId, FALSE, 0x78, 0x0D);
|
||||
}
|
||||
|
||||
static void TMCase_PrintMessageWithFollowupTask(u8 taskId, u8 windowId, const u8 * str, TaskFunc func)
|
||||
@@ -1420,7 +1420,7 @@ static u8 AddTMContextMenu(u8 * a0, u8 a1)
|
||||
|
||||
static void RemoveTMContextMenu(u8 * a0)
|
||||
{
|
||||
ClearMenuWindow(*a0, FALSE);
|
||||
ClearStdWindowAndFrameToTransparent(*a0, FALSE);
|
||||
ClearWindowTilemap(*a0);
|
||||
RemoveWindow(*a0);
|
||||
ScheduleBgCopyTilemapToVram(0);
|
||||
|
||||
+1
-1
@@ -1299,7 +1299,7 @@ void sub_815E720(void)
|
||||
void sub_815E88C(void)
|
||||
{
|
||||
u8 windowId = VarGet(VAR_0x4001);
|
||||
ClearMenuWindow(windowId, TRUE);
|
||||
ClearStdWindowAndFrameToTransparent(windowId, TRUE);
|
||||
RemoveWindow(windowId);
|
||||
}
|
||||
|
||||
|
||||
+3
-18
@@ -1079,7 +1079,7 @@ gUnknown_2039A34: @ 2039A34
|
||||
.include "src/save.o"
|
||||
.include "src/mystery_event_script.o"
|
||||
|
||||
gPaletteDecompressionBuffer: @ 203AAB0
|
||||
gUnknown_203AAB0: @ 203AAB0
|
||||
.space 0x4
|
||||
|
||||
gUnknown_203AAB4: @ 203AAB4
|
||||
@@ -1118,8 +1118,7 @@ gUnknown_203AB40: @ 203AB40
|
||||
gUnknown_203AB44: @ 203AB44
|
||||
.space 0x4
|
||||
|
||||
gUnknown_203AB48: @ 203AB48
|
||||
.space 0x4
|
||||
.include "src/diploma.o"
|
||||
|
||||
gUnknown_203AB4C: @ 203AB4C
|
||||
.space 0x4
|
||||
@@ -1222,21 +1221,7 @@ gUnknown_203ADDC: @ 203ADDC
|
||||
gUnknown_203ADE0: @ 203ADE0
|
||||
.space 0x4
|
||||
|
||||
gUnknown_203ADE4: @ 203ADE4
|
||||
.space 0xC
|
||||
|
||||
gUnknown_203ADF0: @ 203ADF0
|
||||
.space 0x2
|
||||
|
||||
gUnknown_203ADF2: @ 203ADF2
|
||||
.space 0x1
|
||||
|
||||
gUnknown_203ADF3: @ 203ADF3
|
||||
.space 0x1
|
||||
|
||||
gUnknown_203ADF4: @ 203ADF4
|
||||
.space 0x4
|
||||
|
||||
.include "src/menu.o"
|
||||
.include "src/quest_log.o"
|
||||
|
||||
gUnknown_203B04C: @ 203B04C
|
||||
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
OBJDUMP="./tools/binutils/bin/arm-none-eabi-objdump -D -bbinary -marmv4t -Mforce-thumb"
|
||||
OPTIONS="--start-address=$1 --stop-address=$2"
|
||||
$OBJDUMP $OPTIONS baserom.gba > baserom.dump
|
||||
$OBJDUMP $OPTIONS pokefirered.gba > pokefirered.dump
|
||||
diff -u baserom.dump pokefirered.dump
|
||||
+3147
File diff suppressed because it is too large
Load Diff
+250
-222
@@ -1,45 +1,46 @@
|
||||
/*
|
||||
"$Id: gbafix.c,v 1.2 2008-07-30 17:12:51 wntrmute Exp $"
|
||||
"$Id: gbafix.c,v 1.2 2008-07-30 17:12:51 wntrmute Exp $"
|
||||
|
||||
DevkitPro GBA ROM fix utility
|
||||
DevkitPro GBA ROM fix utility
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
USA.
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
USA.
|
||||
|
||||
Please report all bugs and problems through the bug tracker at
|
||||
"http://sourceforge.net/tracker/?group_id=114505&atid=668551".
|
||||
Please report all bugs and problems through the bug tracker at
|
||||
"http://sourceforge.net/tracker/?group_id=114505&atid=668551".
|
||||
|
||||
"$Header: /lvm/shared/ds/ds/cvs/devkitpro-cvsbackup/tools/gba/gbatools/gbafix.c,v 1.2 2008-07-30 17:12:51 wntrmute Exp $"
|
||||
"$Header: /lvm/shared/ds/ds/cvs/devkitpro-cvsbackup/tools/gba/gbatools/gbafix.c,v 1.2 2008-07-30 17:12:51 wntrmute Exp $"
|
||||
|
||||
*/
|
||||
//---------------------------------------------------------------------------------
|
||||
// gbafix.c
|
||||
//---------------------------------------------------------------------------------
|
||||
/*
|
||||
Gameboy Advance ROM fixer (by Dark Fader / BlackThunder / WinterMute / Diegoisawesome)
|
||||
Validates header of GBA roms.
|
||||
Gameboy Advance ROM fixer (by Dark Fader / BlackThunder / WinterMute / Diegoisawesome)
|
||||
Validates header of GBA roms.
|
||||
|
||||
History
|
||||
-------
|
||||
v1.06 - added output silencing, (Diegoisawesome)
|
||||
v1.05 - added debug offset argument, (Diegoisawesome)
|
||||
v1.04 - converted to plain C, (WinterMute)
|
||||
v1.03 - header.fixed, header.device_type
|
||||
v1.02 - redefined the options (rgbfix style), checksum=0
|
||||
v1.01 - fix in parameters
|
||||
v1.00 - logo, complement
|
||||
History
|
||||
-------
|
||||
v1.07 - added support for ELF input, (PikalaxALT)
|
||||
v1.06 - added output silencing, (Diegoisawesome)
|
||||
v1.05 - added debug offset argument, (Diegoisawesome)
|
||||
v1.04 - converted to plain C, (WinterMute)
|
||||
v1.03 - header.fixed, header.device_type
|
||||
v1.02 - redefined the options (rgbfix style), checksum=0
|
||||
v1.01 - fix in parameters
|
||||
v1.00 - logo, complement
|
||||
*/
|
||||
|
||||
#pragma pack(1)
|
||||
@@ -48,26 +49,27 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include "elf.h"
|
||||
|
||||
#define VER "1.06"
|
||||
#define ARGV argv[arg]
|
||||
#define VALUE (ARGV+2)
|
||||
#define NUMBER strtoul(VALUE, NULL, 0)
|
||||
#define VER "1.07"
|
||||
#define ARGV argv[arg]
|
||||
#define VALUE (ARGV+2)
|
||||
#define NUMBER strtoul(VALUE, NULL, 0)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t start_code; // B instruction
|
||||
uint8_t logo[0xA0-0x04]; // logo data
|
||||
uint8_t title[0xC]; // game title name
|
||||
uint32_t game_code; //
|
||||
uint16_t maker_code; //
|
||||
uint8_t fixed; // 0x96
|
||||
uint8_t unit_code; // 0x00
|
||||
uint8_t device_type; // 0x00
|
||||
uint8_t unused[7]; //
|
||||
uint8_t game_version; // 0x00
|
||||
uint8_t complement; // 800000A0..800000BC
|
||||
uint16_t checksum; // 0x0000
|
||||
uint32_t start_code; // B instruction
|
||||
uint8_t logo[0xA0-0x04]; // logo data
|
||||
uint8_t title[0xC]; // game title name
|
||||
uint32_t game_code; //
|
||||
uint16_t maker_code; //
|
||||
uint8_t fixed; // 0x96
|
||||
uint8_t unit_code; // 0x00
|
||||
uint8_t device_type; // 0x00
|
||||
uint8_t unused[7]; //
|
||||
uint8_t game_version; // 0x00
|
||||
uint8_t complement; // 800000A0..800000BC
|
||||
uint16_t checksum; // 0x0000
|
||||
} Header;
|
||||
|
||||
|
||||
@@ -77,55 +79,55 @@ unsigned short checksum_without_header = 0;
|
||||
|
||||
const Header good_header =
|
||||
{
|
||||
// start_code
|
||||
0xEA00002E,
|
||||
// logo
|
||||
{ 0x24,0xFF,0xAE,0x51,0x69,0x9A,0xA2,0x21,0x3D,0x84,0x82,0x0A,0x84,0xE4,0x09,0xAD,
|
||||
0x11,0x24,0x8B,0x98,0xC0,0x81,0x7F,0x21,0xA3,0x52,0xBE,0x19,0x93,0x09,0xCE,0x20,
|
||||
0x10,0x46,0x4A,0x4A,0xF8,0x27,0x31,0xEC,0x58,0xC7,0xE8,0x33,0x82,0xE3,0xCE,0xBF,
|
||||
0x85,0xF4,0xDF,0x94,0xCE,0x4B,0x09,0xC1,0x94,0x56,0x8A,0xC0,0x13,0x72,0xA7,0xFC,
|
||||
0x9F,0x84,0x4D,0x73,0xA3,0xCA,0x9A,0x61,0x58,0x97,0xA3,0x27,0xFC,0x03,0x98,0x76,
|
||||
0x23,0x1D,0xC7,0x61,0x03,0x04,0xAE,0x56,0xBF,0x38,0x84,0x00,0x40,0xA7,0x0E,0xFD,
|
||||
0xFF,0x52,0xFE,0x03,0x6F,0x95,0x30,0xF1,0x97,0xFB,0xC0,0x85,0x60,0xD6,0x80,0x25,
|
||||
0xA9,0x63,0xBE,0x03,0x01,0x4E,0x38,0xE2,0xF9,0xA2,0x34,0xFF,0xBB,0x3E,0x03,0x44,
|
||||
0x78,0x00,0x90,0xCB,0x88,0x11,0x3A,0x94,0x65,0xC0,0x7C,0x63,0x87,0xF0,0x3C,0xAF,
|
||||
0xD6,0x25,0xE4,0x8B,0x38,0x0A,0xAC,0x72,0x21,0xD4,0xF8,0x07 } ,
|
||||
// title
|
||||
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
|
||||
// game code
|
||||
0x00000000,
|
||||
// maker code
|
||||
0x3130,
|
||||
// fixed
|
||||
0x96,
|
||||
// unit_code
|
||||
0x00,
|
||||
// device type
|
||||
0x00,
|
||||
// unused
|
||||
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
|
||||
// game version
|
||||
0x00,
|
||||
// complement
|
||||
0x00,
|
||||
// checksum
|
||||
0x0000
|
||||
// start_code
|
||||
0xEA00002E,
|
||||
// logo
|
||||
{ 0x24,0xFF,0xAE,0x51,0x69,0x9A,0xA2,0x21,0x3D,0x84,0x82,0x0A,0x84,0xE4,0x09,0xAD,
|
||||
0x11,0x24,0x8B,0x98,0xC0,0x81,0x7F,0x21,0xA3,0x52,0xBE,0x19,0x93,0x09,0xCE,0x20,
|
||||
0x10,0x46,0x4A,0x4A,0xF8,0x27,0x31,0xEC,0x58,0xC7,0xE8,0x33,0x82,0xE3,0xCE,0xBF,
|
||||
0x85,0xF4,0xDF,0x94,0xCE,0x4B,0x09,0xC1,0x94,0x56,0x8A,0xC0,0x13,0x72,0xA7,0xFC,
|
||||
0x9F,0x84,0x4D,0x73,0xA3,0xCA,0x9A,0x61,0x58,0x97,0xA3,0x27,0xFC,0x03,0x98,0x76,
|
||||
0x23,0x1D,0xC7,0x61,0x03,0x04,0xAE,0x56,0xBF,0x38,0x84,0x00,0x40,0xA7,0x0E,0xFD,
|
||||
0xFF,0x52,0xFE,0x03,0x6F,0x95,0x30,0xF1,0x97,0xFB,0xC0,0x85,0x60,0xD6,0x80,0x25,
|
||||
0xA9,0x63,0xBE,0x03,0x01,0x4E,0x38,0xE2,0xF9,0xA2,0x34,0xFF,0xBB,0x3E,0x03,0x44,
|
||||
0x78,0x00,0x90,0xCB,0x88,0x11,0x3A,0x94,0x65,0xC0,0x7C,0x63,0x87,0xF0,0x3C,0xAF,
|
||||
0xD6,0x25,0xE4,0x8B,0x38,0x0A,0xAC,0x72,0x21,0xD4,0xF8,0x07 } ,
|
||||
// title
|
||||
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
|
||||
// game code
|
||||
0x00000000,
|
||||
// maker code
|
||||
0x3130,
|
||||
// fixed
|
||||
0x96,
|
||||
// unit_code
|
||||
0x00,
|
||||
// device type
|
||||
0x00,
|
||||
// unused
|
||||
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
|
||||
// game version
|
||||
0x00,
|
||||
// complement
|
||||
0x00,
|
||||
// checksum
|
||||
0x0000
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
char HeaderComplement()
|
||||
/*---------------------------------------------------------------------------------
|
||||
Calculate Header complement check
|
||||
Calculate Header complement check
|
||||
---------------------------------------------------------------------------------*/
|
||||
{
|
||||
int n;
|
||||
char c = 0;
|
||||
char *p = (char *)&header + 0xA0;
|
||||
for (n=0; n<0xBD-0xA0; n++)
|
||||
{
|
||||
c += *p++;
|
||||
}
|
||||
return -(0x19+c);
|
||||
int n;
|
||||
char c = 0;
|
||||
char *p = (char *)&header + 0xA0;
|
||||
for (n=0; n<0xBD-0xA0; n++)
|
||||
{
|
||||
c += *p++;
|
||||
}
|
||||
return -(0x19+c);
|
||||
}
|
||||
|
||||
|
||||
@@ -133,157 +135,183 @@ char HeaderComplement()
|
||||
int main(int argc, char *argv[])
|
||||
//---------------------------------------------------------------------------------
|
||||
{
|
||||
int arg;
|
||||
char *argfile = 0;
|
||||
FILE *infile;
|
||||
int silent = 0;
|
||||
int arg;
|
||||
char *argfile = 0;
|
||||
FILE *infile;
|
||||
int silent = 0;
|
||||
int schedule_pad = 0;
|
||||
|
||||
int size,bit;
|
||||
int size,bit;
|
||||
|
||||
// show syntax
|
||||
if (argc <= 1)
|
||||
{
|
||||
printf("GBA ROM fixer v"VER" by Dark Fader / BlackThunder / WinterMute / Diegoisawesome \n");
|
||||
printf("Syntax: gbafix <rom.gba> [-p] [-t[title]] [-c<game_code>] [-m<maker_code>] [-r<version>] [-d<debug>] [--silent]\n");
|
||||
printf("\n");
|
||||
printf("parameters:\n");
|
||||
printf(" -p Pad to next exact power of 2. No minimum size!\n");
|
||||
printf(" -t[<title>] Patch title. Stripped filename if none given.\n");
|
||||
printf(" -c<game_code> Patch game code (four characters)\n");
|
||||
printf(" -m<maker_code> Patch maker code (two characters)\n");
|
||||
printf(" -r<version> Patch game version (number)\n");
|
||||
printf(" -d<debug> Enable debugging handler and set debug entry point (0 or 1)\n");
|
||||
printf(" --silent Silence non-error output\n");
|
||||
return -1;
|
||||
}
|
||||
// show syntax
|
||||
if (argc <= 1)
|
||||
{
|
||||
printf("GBA ROM fixer v"VER" by Dark Fader / BlackThunder / WinterMute / Diegoisawesome \n");
|
||||
printf("Syntax: gbafix <rom.gba> [-p] [-t[title]] [-c<game_code>] [-m<maker_code>] [-r<version>] [-d<debug>] [--silent]\n");
|
||||
printf("\n");
|
||||
printf("parameters:\n");
|
||||
printf(" -p Pad to next exact power of 2. No minimum size!\n");
|
||||
printf(" -t[<title>] Patch title. Stripped filename if none given.\n");
|
||||
printf(" -c<game_code> Patch game code (four characters)\n");
|
||||
printf(" -m<maker_code> Patch maker code (two characters)\n");
|
||||
printf(" -r<version> Patch game version (number)\n");
|
||||
printf(" -d<debug> Enable debugging handler and set debug entry point (0 or 1)\n");
|
||||
printf(" --silent Silence non-error output\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// get filename
|
||||
for (arg=1; arg<argc; arg++)
|
||||
{
|
||||
if (ARGV[0] != '-') { argfile=ARGV; }
|
||||
if (strncmp("--silent", &ARGV[0], 7) == 0) { silent = 1; }
|
||||
}
|
||||
// get filename
|
||||
for (arg=1; arg<argc; arg++)
|
||||
{
|
||||
if (ARGV[0] != '-') { argfile=ARGV; }
|
||||
if (strncmp("--silent", &ARGV[0], 7) == 0) { silent = 1; }
|
||||
}
|
||||
|
||||
// check filename
|
||||
if (!argfile)
|
||||
{
|
||||
fprintf(stderr, "Filename needed!\n");
|
||||
return -1;
|
||||
}
|
||||
// check filename
|
||||
if (!argfile)
|
||||
{
|
||||
fprintf(stderr, "Filename needed!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// read file
|
||||
infile = fopen(argfile, "r+b");
|
||||
if (!infile) { fprintf(stderr, "Error opening input file!\n"); return -1; }
|
||||
fseek(infile, 0, SEEK_SET);
|
||||
fread(&header, sizeof(header), 1, infile);
|
||||
uint32_t sh_offset = 0;
|
||||
|
||||
// fix some data
|
||||
memcpy(header.logo, good_header.logo, sizeof(header.logo));
|
||||
memcpy(&header.fixed, &good_header.fixed, sizeof(header.fixed));
|
||||
memcpy(&header.device_type, &good_header.device_type, sizeof(header.device_type));
|
||||
// read file
|
||||
infile = fopen(argfile, "r+b");
|
||||
if (!infile) { fprintf(stderr, "Error opening input file!\n"); return -1; }
|
||||
fseek(infile, sh_offset, SEEK_SET);
|
||||
fread(&header, sizeof(header), 1, infile);
|
||||
|
||||
// parse command line
|
||||
for (arg=1; arg<argc; arg++)
|
||||
{
|
||||
if ((ARGV[0] == '-'))
|
||||
{
|
||||
switch (ARGV[1])
|
||||
{
|
||||
case 'p': // pad
|
||||
{
|
||||
fseek(infile, 0, SEEK_END);
|
||||
size = ftell(infile);
|
||||
for (bit=31; bit>=0; bit--) if (size & (1<<bit)) break;
|
||||
if (size != (1<<bit))
|
||||
{
|
||||
int todo = (1<<(bit+1)) - size;
|
||||
while (todo--) fputc(0xFF, infile);
|
||||
}
|
||||
fseek(infile, 0, SEEK_SET);
|
||||
break;
|
||||
}
|
||||
// elf check
|
||||
Elf32_Shdr secHeader;
|
||||
if (memcmp(&header, ELFMAG, 4) == 0) {
|
||||
Elf32_Ehdr *elfHeader = (Elf32_Ehdr *)&header;
|
||||
fseek(infile, elfHeader->e_shoff, SEEK_SET);
|
||||
int i;
|
||||
for (i = 0; i < elfHeader->e_shnum; i++) {
|
||||
fread(&secHeader, sizeof(Elf32_Shdr), 1, infile);
|
||||
if (secHeader.sh_type == SHT_PROGBITS && secHeader.sh_addr == elfHeader->e_entry) break;
|
||||
}
|
||||
if (i == elfHeader->e_shnum) { fprintf(stderr, "Error finding entry point!\n"); return 1; }
|
||||
fseek(infile, secHeader.sh_offset, SEEK_SET);
|
||||
sh_offset = secHeader.sh_offset;
|
||||
fread(&header, sizeof(header), 1, infile);
|
||||
}
|
||||
|
||||
case 't': // title
|
||||
{
|
||||
char title[256];
|
||||
memset(title, 0, sizeof(title));
|
||||
if (VALUE[0])
|
||||
{
|
||||
strncpy(title, VALUE, sizeof(header.title));
|
||||
}
|
||||
else
|
||||
{
|
||||
// use filename
|
||||
char s[256], *begin=s, *t; strcpy(s, argfile);
|
||||
t = strrchr(s, '\\'); if (t) begin = t+1;
|
||||
t = strrchr(s, '/'); if (t) begin = t+1;
|
||||
t = strrchr(s, '.'); if (t) *t = 0;
|
||||
strncpy(title, begin, sizeof(header.title));
|
||||
if (!silent) printf("%s\n",begin);
|
||||
}
|
||||
memcpy(header.title, title, sizeof(header.title)); // copy
|
||||
break;
|
||||
}
|
||||
// fix some data
|
||||
memcpy(header.logo, good_header.logo, sizeof(header.logo));
|
||||
memcpy(&header.fixed, &good_header.fixed, sizeof(header.fixed));
|
||||
memcpy(&header.device_type, &good_header.device_type, sizeof(header.device_type));
|
||||
|
||||
case 'c': // game code
|
||||
{
|
||||
//if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; }
|
||||
//header.game_code = NUMBER;
|
||||
header.game_code = VALUE[0] | VALUE[1]<<8 | VALUE[2]<<16 | VALUE[3]<<24;
|
||||
break;
|
||||
}
|
||||
// parse command line
|
||||
for (arg=1; arg<argc; arg++)
|
||||
{
|
||||
if ((ARGV[0] == '-'))
|
||||
{
|
||||
switch (ARGV[1])
|
||||
{
|
||||
case 'p': // pad
|
||||
{
|
||||
schedule_pad = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
case 'm': // maker code
|
||||
{
|
||||
//if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; }
|
||||
//header.maker_code = (unsigned short)NUMBER;
|
||||
header.maker_code = VALUE[0] | VALUE[1]<<8;
|
||||
break;
|
||||
}
|
||||
case 't': // title
|
||||
{
|
||||
char title[256];
|
||||
memset(title, 0, sizeof(title));
|
||||
if (VALUE[0])
|
||||
{
|
||||
strncpy(title, VALUE, sizeof(header.title));
|
||||
}
|
||||
else
|
||||
{
|
||||
// use filename
|
||||
char s[256], *begin=s, *t; strcpy(s, argfile);
|
||||
t = strrchr(s, '\\'); if (t) begin = t+1;
|
||||
t = strrchr(s, '/'); if (t) begin = t+1;
|
||||
t = strrchr(s, '.'); if (t) *t = 0;
|
||||
strncpy(title, begin, sizeof(header.title));
|
||||
if (!silent) printf("%s\n",begin);
|
||||
}
|
||||
memcpy(header.title, title, sizeof(header.title)); // copy
|
||||
break;
|
||||
}
|
||||
|
||||
case 'v': // ignored, compatability with other gbafix
|
||||
{
|
||||
break;
|
||||
}
|
||||
case 'c': // game code
|
||||
{
|
||||
//if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; }
|
||||
//header.game_code = NUMBER;
|
||||
header.game_code = VALUE[0] | VALUE[1]<<8 | VALUE[2]<<16 | VALUE[3]<<24;
|
||||
break;
|
||||
}
|
||||
|
||||
case 'r': // version
|
||||
{
|
||||
if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; }
|
||||
header.game_version = (unsigned char)NUMBER;
|
||||
break;
|
||||
}
|
||||
case 'm': // maker code
|
||||
{
|
||||
//if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; }
|
||||
//header.maker_code = (unsigned short)NUMBER;
|
||||
header.maker_code = VALUE[0] | VALUE[1]<<8;
|
||||
break;
|
||||
}
|
||||
|
||||
case 'd': // debug
|
||||
{
|
||||
if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; }
|
||||
header.logo[0x9C-0x04] = 0xA5; // debug enable
|
||||
header.device_type = (unsigned char)((NUMBER & 1) << 7); // debug handler entry point
|
||||
break;
|
||||
}
|
||||
case '-': // long arguments
|
||||
{
|
||||
if (strncmp("silent", &ARGV[2], 6) == 0) { continue; }
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
printf("Invalid option: %s\n", ARGV);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
case 'v': // ignored, compatability with other gbafix
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
// update complement check & total checksum
|
||||
header.complement = 0;
|
||||
header.checksum = 0; // must be 0
|
||||
header.complement = HeaderComplement();
|
||||
//header.checksum = checksum_without_header + HeaderChecksum();
|
||||
case 'r': // version
|
||||
{
|
||||
if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; }
|
||||
header.game_version = (unsigned char)NUMBER;
|
||||
break;
|
||||
}
|
||||
|
||||
fseek(infile, 0, SEEK_SET);
|
||||
fwrite(&header, sizeof(header), 1, infile);
|
||||
fclose(infile);
|
||||
case 'd': // debug
|
||||
{
|
||||
if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; }
|
||||
header.logo[0x9C-0x04] = 0xA5; // debug enable
|
||||
header.device_type = (unsigned char)((NUMBER & 1) << 7); // debug handler entry point
|
||||
break;
|
||||
}
|
||||
case '-': // long arguments
|
||||
{
|
||||
if (strncmp("silent", &ARGV[2], 6) == 0) { continue; }
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
printf("Invalid option: %s\n", ARGV);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!silent) printf("ROM fixed!\n");
|
||||
// update complement check & total checksum
|
||||
header.complement = 0;
|
||||
header.checksum = 0; // must be 0
|
||||
header.complement = HeaderComplement();
|
||||
//header.checksum = checksum_without_header + HeaderChecksum();
|
||||
|
||||
return 0;
|
||||
if (schedule_pad) {
|
||||
if (sh_offset != 0) {
|
||||
fprintf(stderr, "Warning: Cannot safely pad an ELF\n");
|
||||
} else {
|
||||
fseek(infile, 0, SEEK_END);
|
||||
size = ftell(infile);
|
||||
for (bit=31; bit>=0; bit--) if (size & (1<<bit)) break;
|
||||
if (size != (1<<bit))
|
||||
{
|
||||
int todo = (1<<(bit+1)) - size;
|
||||
while (todo--) fputc(0xFF, infile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fseek(infile, sh_offset, SEEK_SET);
|
||||
fwrite(&header, sizeof(header), 1, infile);
|
||||
fclose(infile);
|
||||
|
||||
if (!silent) printf("ROM fixed!\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user