简易个体努力查看器
之前做过的东西。这个肯定是不如版主早期那个作品美观的,不过还是发出来做个记录
一样的和初始村蓝胖对话查看效果,如果想自己更改示例脚本也已经给出了- .gba
- .thumb
- .loadtable "header/CharTable.txt"
- .include "header/ArmipsMacros.asm"
- .create "3.0.gba",0x8000000
- .close
- .open "test.gba","3.0.gba", 0x8000000
- .macro WindowTemplate, bg, tilemapLeft, tilemapTop, width, height, paletteNum, baseBlock
- .align 2
- .byte bg
- .byte tilemapLeft
- .byte tilemapTop
- .byte width
- .byte height
- .byte paletteNum
- .halfword baseBlock
- .endmacro
- .macro BgTemplate, bg, charBaseIndex, mapBaseIndex, screenSize, paletteMode, priority, baseTile
- .align 4
- .word (bg) | (charBaseIndex << 2) | (mapBaseIndex << 4) | (screenSize << 9) | (paletteMode << 11) | (priority << 12) | (baseTile << 14)
- .endmacro
- .macro FillBgTilemapBufferRect, bg, tileNum, x, y, width, height, pal
- mov r0, width
- str r0, [sp]
- mov r0, height
- str r0, [sp, #4]
- mov r0, pal
- str r0, [sp, #8]
- mov r0, bg
- ldr r1, =0x1A2
- add r1, (tileNum - 0x1A2)
- mov r2, x
- mov r3, y
- ldr r4, =(0x08002804|1)
- bl call_bx2
- .endmacro
- .org 0x08F80000
- .func MainFunc
- push {lr}
- ldr r0, =(CB2_Main|1)
- ldr r3, =(0x08000540|1)
- bl call_bx
- ldr r3, =(0x08098E54|1)
- bl call_bx
- pop {pc}
- .endfunc
- .pool
- .func CB2_Main
- push {lr}
- ldr r1, =0x030022C0
- mov r2, #0x87
- lsl r2, #3
- add r1, r2
- mov r0, #0
- strb r0, [r1] ;gMain.state
- ldr r3, =(0x080AC378|1)
- bl call_bx
- ldr r3, =(0x08085D34|1)
- bl call_bx
- ldr r0, =(CB2_ShowIVEV|1)
- ldr r3, =(0x08000540|1)
- bl call_bx
- ldr r1, =0x030022C0
- ldr r0, =(0x080861CC|1)
- str r0, [r1, #8]
- pop {pc}
-
- .func CB2_ShowIVEV
- push {r4-r7, lr}
- mov r4, r8
- push {r4}
- add sp, #-12
- ldr r1, =0x030022C0
- mov r2, #0x87
- lsl r2, #3
- add r1, r2
- ldrb r0, [r1] ;gMain.state
- ldr r1, =Switch
- lsl r0, #1
- ldrh r0, [r0, r1]
- add r0, pc
- bx r0
- SetVBlankCallback:
- mov r0, #0
- ldr r3, =(0x080006F0|1)
- bl call_bx
- b AddState
- InitBgsAndWindows:
- mov r3, #0xC0
- ldr r2, =0x06017000
- lsl r3, #19
- ClearLoop:
- mov r1, #0x80
- lsl r1, #5
- mov r12, r1
- add r3, r12
- cmp r3, r2
- bne ClearLoop
- mov r3, sp
- add r2, r3, #6
- ldr r3, =0x040000D4
- str r2, [r3]
- mov r2, #0xA0
- lsl r2, #19
- str r2, [r3, #4]
- ldr r2, =0x81000200
- str r2, [r3, #8]
- mov r0, #0
- ldr r3, =(0x080017BC|1)
- bl call_bx
- mov r0, #0
- ldr r1, =sShowEVIVBgTemplates
- mov r2, #2
- ldr r3, =(0x080017E8|1)
- bl call_bx
- mov r0, #0
- mov r1, #0
- mov r2, #0
- ldr r3, =(0x08001D04|1)
- bl call_bx
- mov r0, #0
- mov r1, #0
- mov r2, #0
- ldr r3, =(0x08001E7C|1)
- mov r0, #1
- mov r1, #0
- mov r2, #0
- ldr r3, =(0x08001D04|1)
- bl call_bx
- mov r0, #1
- mov r1, #0
- mov r2, #0
- ldr r3, =(0x08001E7C|1)
- bl call_bx
- ldr r0, =sShowEVIVWinTemplates
- ldr r3, =(0x080031C0|1)
- bl call_bx
- ldr r3, =(0x080045B0|1)
- bl call_bx
- mov r0, #0
- mov r1, #12
- lsl r1, #10
- add r1, #0x40
- ldr r3, =(0x080010B4|1)
- bl call_bx
- mov r0, #0
- ldr r3, =(0x08001B30|1)
- bl call_bx
- mov r0, #1
- ldr r3, =(0x08001B30|1)
- bl call_bx
- b AddState
- ResetData:
- ldr r3, =(0x080A1A74|1)
- bl call_bx
- ldr r3, =(0x080B9FB8|1)
- bl call_bx
- ldr r3, =(0x080A8F50|1)
- bl call_bx
- ldr r3, =(0x08006974|1)
- bl call_bx
- b AddState
- LoadBoxTiles:
- ldr r0, =0x03005D90
- ldr r0, [r0]
- ldrb r0, [r0, #0x14]
- lsr r0, #3
- ldr r3, =(0x08098758|1)
- bl call_bx
- ldr r1, [r0]
- mov r2, #0x90
- lsl r2, #1
- ldr r3, =0x1A2
- mov r0, #1
- ldr r4, =(0x08001944|1)
- bl call_bx2
- b AddState
- LoadWindowPalette:
- ldr r0, =0x0855C6A0
- mov r1, #0
- mov r2, #2
- ldr r3, =(0x080A1938|1)
- bl call_bx
- ldr r0, =0x03005D90
- ldr r0, [r0]
- ldrb r0, [r0, #0x14]
- lsr r0, #3
- ldr r3, =(0x08098758|1)
- bl call_bx
- ldr r0, [r0, #4]
- mov r1, #0x70
- mov r2, #0x20
- ldr r3, =(0x080A1938|1)
- bl call_bx
- b AddState
- LoadTextPalette:
- ldr r0, =0x0855C604
- mov r1, #0x10
- mov r2, #0x20
- ldr r3, =(0x080A1938|1)
- bl call_bx
- b AddState
- DrawAndPutControl:
- mov r0, #1
- ldr r3, =(0x0800378C|1)
- bl call_bx
- bl DrawTextControl
- b AddState
- WaitState:
- b AddState
- DrawAndPutMonIVEV:
- mov r0, #0
- ldr r3, =(0x0800378C|1)
- bl call_bx
- mov r0, #0
- bl DrawMonIVEV
- b AddState
- FillBgTilemapBufferRects:
- bl FillBgTilemap
- b AddState
- CreateSpritesAndTask:
- ldr r0, =(Task_ShowIVEVFadeIn|1)
- ldr r3, =(0x080A8FB0|1)
- bl call_bx
- mov r5, r0
- ldr r2, =0x03005E00
- mov r1, #40
- mul r0, r1
- add r2, r0
- mov r0, #1
- strh r0, [r2, #8] ;tMonId
- ldr r0, =0x020244E9
- ldrb r6, [r0]
- ldr r0, =0x020244EC
- mov r8, r0
- mov r7, #0
- CreateSpritesLoop:
- cmp r7, r6
- bge CreateSpritesLoopEnd
- mov r0, r8
- mov r1, #100
- mul r1, r7
- add r0, r1
- mov r1, #0
- mov r2, #0
- ldr r3, =(0x0806A518|1)
- bl call_bx
- str r0, [sp, #4]
- mov r0, #1
- str r0, [sp, #8]
- str r0, [sp]
- mov r0, r8
- mov r1, #100
- mul r1, r7
- add r0, r1
- mov r1, #0xB
- mov r2, #0
- ldr r3, =(0x0806A518|1)
- bl call_bx
- mov r4, r0
- ldr r3, =(0x080D2F68|1)
- bl call_bx
- mov r0, r4
- ldr r2, =PoiX
- ldrb r2, [r2, r7]
- ldr r1, =(0x08007428|1)
- mov r3, #0x10
- ldr r4, =(0x080D2CC4|1)
- bl call_bx2
- ldr r1, =0x02020630
- mov r2, #0x44
- mul r2, r0
- add r1, r2
- ldrh r2, [r1, #4]
- ldr r3, =0xF3FF
- and r2, r3
- strh r2, [r1, #4]
- mov r1, r5
- ldr r3, =0x03005E00
- mov r2, #40
- mul r1, r2
- add r3, r1
- add r3, #9
- strb r0, [r3, r7]
- add r7, #1
- b CreateSpritesLoop
- CreateSpritesLoopEnd:
- ldrb r0, [r3]
- ldr r1, =0x02020630
- mov r2, #0x44
- mul r2, r0
- add r1, r2
- ldr r0, =(0x080D3014|1)
- str r0, [r1, #0x1C]
- b AddState
- FadeAndChangeCallBack:
- mov r0, #0
- str r0, [sp]
- neg r0, r0
- mov r1, #0
- mov r2, #0x10
- mov r3, #0
- ldr r4, =(0x080A1AD4|1)
- bl call_bx2
- ldr r0, =(0x080BA4C8|1)
- ldr r3, =(0x080006F0|1)
- bl call_bx
- ldr r0, =(0x080BA4B0|1)
- ldr r3, =(0x08000540|1)
- bl call_bx
- AddState:
- ldr r1, =0x030022C0
- mov r0, #0x87
- lsl r0, #3
- add r1, r0
- ldrb r0, [r1]
- add r0, #1
- strb r0, [r1]
- add sp, #12
- pop {r4}
- mov r8, r4
- pop {r4-r7, pc}
- .endfunc
- .pool
- .func DrawTextControl
- push {r4, lr}
- add sp, #-12
- mov r0, #1
- mov r1, #17
- ldr r3, =(0x08003C48|1)
- bl call_bx
- mov r0, #1
- str r0, [sp]
- mov r0, #0xFF
- str r0, [sp, #4]
- mov r0, #0
- str r0, [sp, #8]
- mov r0, #1
- mov r1, #1
- ldr r2, =gText_Control
- mov r3, #8
- ldr r4, =(0x080045D0|1)
- bl call_bx2
- mov r0, #1
- mov r1, #3
- ldr r3, =(0x08003658|1)
- bl call_bx
- add sp, #12
- pop {r4, pc}
- .endfunc
- .pool
- .func DrawMonIVEV
- push {r4-r6, lr}
- add sp, #-16
- mov r5, r0
- mov r0, #0
- mov r1, #17
- ldr r3, =(0x08003C48|1)
- bl call_bx
- mov r0, #32
- str r0, [sp]
- mov r0, #0xFF
- str r0, [sp, #4]
- mov r0, #0
- str r0, [sp, #8]
- mov r0, #0
- mov r1, #1
- ldr r2, =gText_Frame
- mov r3, #8
- ldr r4, =(0x080045D0|1)
- bl call_bx2
- ldr r0, =0x02021FC4
- mov r1, #0xFF
- strb r1, [r0]
- ldr r0, =0x020244EC
- mov r1, #100
- mul r1, r5
- add r5, r1, r0
- mov r6, #0
- BufferIVLoop:
- cmp r6, #6
- bge BufferIVLoopEnd
- mov r0, r5
- mov r1, #0x27
- add r1, r6
- mov r2, #0
- ldr r3, =(0x0806A518|1)
- bl call_bx
- mov r1, r0
- add r0, sp, #12
- mov r2, #2
- mov r3, #3
- ldr r4, =(0x08008CC0|1)
- bl call_bx2
- ldr r0, =0x02021FC4
- add r1, sp, #12
- ldr r3, =(0x08008BC0|1)
- bl call_bx
- ldr r0, =0x02021FC4
- ldr r1, =gText_Blank
- ldr r3, =(0x08008BC0|1)
- bl call_bx
- add r6, #1
- b BufferIVLoop
- BufferIVLoopEnd:
- ldr r0, =0x02021FC4
- ldr r1, =gText_LineFeed
- ldr r3, =(0x08008BC0|1)
- bl call_bx
- mov r6, #0
- BufferEVLoop:
- cmp r6, #6
- bge BufferEVLoopEnd
- mov r0, r5
- mov r1, #0x1A
- add r1, r6
- mov r2, #0
- ldr r3, =(0x0806A518|1)
- bl call_bx
- mov r1, r0
- add r0, sp, #12
- mov r2, #2
- mov r3, #3
- ldr r4, =(0x08008CC0|1)
- bl call_bx2
- ldr r0, =0x02021FC4
- add r1, sp, #12
- ldr r3, =(0x08008BC0|1)
- bl call_bx
- ldr r0, =0x02021FC4
- ldr r1, =gText_Blank
- ldr r3, =(0x08008BC0|1)
- bl call_bx
- add r6, #1
- b BufferEVLoop
- BufferEVLoopEnd:
- mov r0, #48
- str r0, [sp]
- mov r0, #0xFF
- str r0, [sp, #4]
- mov r0, #0
- str r0, [sp, #8]
- mov r0, #0
- mov r1, #1
- ldr r2, =0x02021FC4
- mov r3, #35
- ldr r4, =(0x080045D0|1)
- bl call_bx2
- mov r0, #0
- mov r1, #3
- ldr r3, =(0x08003658|1)
- bl call_bx
- add sp, #16
- pop {r4-r6, pc}
- .endfunc
- .pool
- .func FillBgTilemap
- push {r4, lr}
- add sp, #-12
- FillBgTilemapBufferRect 1, 0x1A2, 1, 0, 1, 1, 7
- FillBgTilemapBufferRect 1, 0x1A3, 2, 0, 26, 1, 7
- FillBgTilemapBufferRect 1, 0x1A4, 28, 0, 1, 1, 7
- FillBgTilemapBufferRect 1, 0x1A5, 1, 1, 1, 14, 7
- FillBgTilemapBufferRect 1, 0x1A7, 28, 1, 1, 14, 7
- FillBgTilemapBufferRect 1, 0x1A8, 1, 15, 1, 1, 7
- FillBgTilemapBufferRect 1, 0x1A9, 2, 15, 26, 1, 7
- FillBgTilemapBufferRect 1, 0x1AA, 28, 15, 1, 1, 7
- FillBgTilemapBufferRect 1, 0x1A2, 1, 16, 1, 1, 7
- FillBgTilemapBufferRect 1, 0x1A3, 2, 16, 26, 1, 7
- FillBgTilemapBufferRect 1, 0x1A4, 28, 16, 1, 1, 7
- FillBgTilemapBufferRect 1, 0x1A5, 1, 17, 1, 2, 7
- FillBgTilemapBufferRect 1, 0x1A7, 28, 17, 1, 2, 7
- FillBgTilemapBufferRect 1, 0x1A8, 1, 19, 1, 1, 7
- FillBgTilemapBufferRect 1, 0x1A9, 2, 19, 26, 1, 7
- FillBgTilemapBufferRect 1, 0x1AA, 28, 19, 1, 1, 7
- mov r0, #1
- ldr r3, =(0x0800236C|1)
- bl call_bx
- add sp, #12
- pop {r4, pc}
- .endfunc
- .pool
- .func Task_ShowIVEVFadeIn
- ldr r1, =0x02037FD4
- ldrb r1, [r1, #7]
- mov r2, #0x80
- and r1, r2
- cmp r1, #0
- bne FadeInBack
- ldr r1, =0x03005E00
- mov r2, #40
- mul r0, r2
- add r0, r1
- ldr r1, =(Task_ShowIVEVProcessInput|1)
- str r1, [r0]
- FadeInBack:
- bx lr
- .endfunc
- .pool
- .func Task_ShowIVEVProcessInput
- push {r4-r5, lr}
- add sp, #-4
- ldr r1, =0x03005E00
- mov r2, #40
- mul r0, r2
- add r5, r0, r1
- ldr r0, =0x030022C0
- ldrh r0, [r0, #0x2E]
- cmp r0, #2
- beq B_Pressed
- cmp r0, #0x10
- beq Right_Pressed
- cmp r0, #0x20
- beq Left_Pressed
- b InputEnd
- B_Pressed:
- mov r0, #0
- str r0, [sp]
- neg r0, r0
- mov r1, #0
- mov r2, #0
- mov r3, #0x10
- ldr r4, =(0x080A1AD4|1)
- bl call_bx2
- ldr r0, =(Task_ShowIVEVFadeOut|1)
- str r0, [r5]
- b InputEnd
- Right_Pressed:
- ldrb r3, [r5, #8]
- mov r1, r5
- add r1, #8
- ldrb r0, [r3, r1]
- ldr r1, =0x02020630
- mov r2, #0x44
- mul r2, r0
- add r1, r2
- ldr r2, =(0x08007428|1)
- str r2, [r1, #0x1C]
- ldr r1, =0x020244E9
- ldrb r1, [r1]
- cmp r3, r1
- bge BackToOne
- add r3, #1
- b RightNext
- BackToOne:
- mov r3, #1
- RightNext:
- strb r3, [r5, #8]
- mov r1, r5
- add r1, #8
- ldrb r0, [r3, r1]
- ldr r1, =0x02020630
- mov r2, #0x44
- mul r2, r0
- add r1, r2
- ldr r2, =(0x080D3014|1)
- str r2, [r1, #0x1C]
- sub r0, r3, #1
- bl DrawMonIVEV
- b InputEnd
- Left_Pressed:
- ldrb r3, [r5, #8]
- mov r1, r5
- add r1, #8
- ldrb r0, [r3, r1]
- ldr r1, =0x02020630
- mov r2, #0x44
- mul r2, r0
- add r1, r2
- ldr r2, =(0x08007428|1)
- str r2, [r1, #0x1C]
- mov r1, #1
- cmp r3, r1
- ble BackToMax
- sub r3, #1
- b LeftNext
- BackToMax:
- ldr r3, =0x020244E9
- ldrb r3, [r3]
- LeftNext:
- strb r3, [r5, #8]
- mov r1, r5
- add r1, #8
- ldrb r0, [r3, r1]
- ldr r1, =0x02020630
- mov r2, #0x44
- mul r2, r0
- add r1, r2
- ldr r2, =(0x080D3014|1)
- str r2, [r1, #0x1C]
- sub r0, r3, #1
- bl DrawMonIVEV
- InputEnd:
- add sp, #4
- pop {r4-r5, pc}
- .endfunc
- .pool
- .func Task_ShowIVEVFadeOut
- push {lr}
- ldr r1, =0x02037FD4
- ldrb r1, [r1, #7]
- mov r2, #0x80
- and r1, r2
- cmp r1, #0
- bne FadeOutBack
- ldr r3, =(0x080A909C|1)
- bl call_bx
- ldr r3, =(0x08003604|1)
- bl call_bx
- ldr r0, =0x030022C0
- ldr r0, [r0, #8]
- ldr r3, =(0x08000540|1)
- bl call_bx
- FadeOutBack:
- pop {pc}
- .endfunc
- .pool
- .func call_bx
- bx r3
- .endfunc
- .pool
- .func call_bx2
- bx r4
- .endfunc
- .pool
- Switch:
- .halfword (SetVBlankCallback - SetVBlankCallback + 1)
- .halfword (InitBgsAndWindows - SetVBlankCallback + 1)
- .halfword (ResetData - SetVBlankCallback + 1)
- .halfword (LoadBoxTiles - SetVBlankCallback + 1)
- .halfword (LoadWindowPalette - SetVBlankCallback + 1)
- .halfword (LoadTextPalette - SetVBlankCallback + 1)
- .halfword (DrawAndPutControl - SetVBlankCallback + 1)
- .halfword (WaitState - SetVBlankCallback + 1)
- .halfword (DrawAndPutMonIVEV - SetVBlankCallback + 1)
- .halfword (FillBgTilemapBufferRects - SetVBlankCallback + 1)
- .halfword (CreateSpritesAndTask - SetVBlankCallback + 1)
- .halfword (FadeAndChangeCallBack - SetVBlankCallback + 1)
- sShowEVIVBgTemplates:
- BgTemplate 1, 1, 30, 0, 0, 0, 0
- BgTemplate 0, 1, 31, 0, 0, 1, 0
- sShowEVIVWinTemplates:
- WindowTemplate 1, 2, 1, 26, 14, 1, 2
- WindowTemplate 0, 2, 17, 26, 2, 1, 0x16E
- WindowTemplate 0xFF, 0, 0, 0, 0, 0, 0
- PoiX:
- .byte 0x25, 0x45, 0x65, 0x85, 0xA5, 0xC5
- gText_Control:
- .string 0xF8, 0x08, 0xF8, 0x09, "选择精灵" , 0x00, 0xF8, 0x01, "退出"
- gText_Frame:
- .string 0xFC, 0x11, 0x1B, "HP", 0xFC, 0x11, 0x0E, "ATT DEF SPE SPA SPD\nIV\nEV"
- gText_Blank:
- .string " "
- gText_LineFeed:
- .string "\n"
- Script_ShowEVIV:
- lock
- faceplayer
- callasm (MainFunc|1)
- waitstate
- release
- end
-
- .org 0x089C0DFC
- .word Script_ShowEVIV
- .close
复制代码 |