Skip to content

Commit

Permalink
Merge pull request #8 from Eebit/port-banim-fastforward
Browse files Browse the repository at this point in the history
Port "battle animation fast forward" patch to FE6J and FE7U
  • Loading branch information
laqieer authored Jan 21, 2025
2 parents 2d1d3d1 + f5777ee commit 171cea3
Show file tree
Hide file tree
Showing 12 changed files with 312 additions and 0 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
@Hook 080426F0 @FE6J
@Hook 0804B314 @FE7U
@Hook 08050C44 @FE8J
@Hook 0804FED0 @FE8U (InBattleMainRoutine; 0x0804FE40)
@r0 VCount

.thumb
.macro blh to, reg=r3
ldr \reg, =\to
mov lr, \reg
.short 0xf800
.endm

LDR r3, =0x02023B20 @ FE6J (gKeyStObj)
@ LDR r3, =0x02024C78 @ FE7U (gKeysInstance)
@ LDR r3, =0x02024CC0 @ FE8J FE8U ([email protected] )
LDRH r3, [r3, #0x4] @ [email protected]
ldr r2, PressButton
AND r3 ,r2
beq WaitExit

@Aボタンが押されているので早くする!

@Dummy GeneralVBlankHandler
ldr r1, =0x03007FF8 @FE6J FE7U FE8J FE8U IRQCheckFlags
mov r0, #0x1
strh r0, [r1, #0x0] @IRQCheckFlags
blh 0x08000F20 @FE6J IncGameTime
@blh 0x08000F48 @FE7U IncGameTime
@blh 0x08000cf0 @FE8J IncrementGlobalClock
@blh 0x08000d40 @FE8U IncrementGlobalClock

ldr r0, =0x020258cc @FE6J gProcTreeRootArray
@ldr r0, =0x02026a30 @FE7U gProcTreeRoots
@ldr r0, =0x02026A70 @FE8J FE8U 6CPointer@MainArray[0].pointer
ldr r0, [r0, #0x0]
blh 0x08003E44 @FE6J Proc_Run
@blh 0x08004690 @FE7U Proc_Run
@blh 0x08002dd4 @FE8J Exec6C
@blh 0x08002e84 @FE8U Exec6C

blh 0x08002dc4 @FE6J SyncLoOam
@blh 0x08003338 @FE7U SyncLoOam
@blh 0x080020cc @FE8J FlushPrimaryOAM
@blh 0x0800217c @FE8U FlushPrimaryOAM

ldr r1, =0x0202aa08 @FE6J gBmSt
@ldr r1, =0x0202bbb8 @FE7U gBmStatus
@ldr r1, =0x0202BCAC @FE8J [email protected]
@ldr r1, =0x0202BCB0 @FE8U [email protected]
ldrb r0, [r1, #0x0] @[email protected]
cmp r0, #0x0
beq Exit
mov r0, #0x0
strb r0, [r1, #0x0] @[email protected]
blh 0x080010CC @FE7J SyncDispIo
@blh 0x080011B0 @FE7U SyncDispIo
@blh 0x08000e4c @FE8J FlushLCDControl
@blh 0x08000e9c @FE8U FlushLCDControl
blh 0x08001478 @FE6J SyncBgsAndPal
@blh 0x080016EC @FE7U SyncBgsAndPal
@blh 0x080010fc @FE8J FlushBackgrounds
@blh 0x0800114c @FE8U FlushBackgrounds
blh 0x08002C04 @FE6J ApplyDataMoves
@blh 0x08003178 @FE7U ApplyDataMoves
@blh 0x08001fd8 @FE8J FlushTiles
@blh 0x08002088 @FE8U FlushTiles
blh 0x08002d6c @FE6J SyncHiOam
@blh 0x080032E0 @FE7U SyncHiOam
@blh 0x08002088 @FE8J FlushSecondaryOAM
@blh 0x08002138 @FE8U FlushSecondaryOAM
b Exit

WaitExit:
@Aボタンが押されていないので、VBlankIntrWaitで待機させる
blh 0x0809dd30 @FE6J VBlankIntrWait
@blh 0x080BFA6C @FE7U VBlankIntrWait
@blh 0x080d63d8 @FE8J VBlankIntrWait
@blh 0x080d16dc @FE8U VBlankIntrWait

Exit:
pop {r0}
bx r0

.ltorg
PressButton:
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PressButton=$88
WaitExit=$4C
Exit=$52
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
PUSH
ORG 0x426F0 //FE6J
//ORG 0x4B314 //FE7U
//ORG 0x50C44 //FE8J
//ORG 0x4FED0 //FE8U
jumpToHack(FastBattleAnimation)
POP

ALIGN 4
FastBattleAnimation:
#incbin "FastBattleAnimation.dmp"
WORD 0x0100 //R Button

//A Button 0x0001
//B Button 0x0002
//L Button 0x0200
//R Button 0x0100
//Top Button 0x0040
//Buttom Button 0x0080
//Left Button 0x0020
//Right Button 0x0010
//Start Button 0x0004
//Select Button 0x0008
//L and R 0x0300

ALIGN 4
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
NAME=Rボタンで戦闘アニメを早送りできるようにする 20220531(Install)
NAME.en=Allow fast-forwarding of battle animations with the R button 20220531(Install)
NAME.zh=Allow fast-forwarding of battle animations with the R button 20220531(Install)

TYPE=EA
TAG=#EVENT
EA=Install.event

INFO=戦闘アニメーション中に特定のボタンを押せば早送りできるようにします。\r\nエミュレータのフレームスキップとは異なりBGMは早送りされずアニメーションだけを早送りします。\r\nCircleの同様の実装と比べて、いくつかのメリットがあります。\r\n1つは、長い戦闘アニメーションが、逆に遅延する副作用がないためです。\r\n2つ目は、魔法も早送りできることです。\r\n以前はAボタンでしたが、Rボタンにするのが慣習になっているので、変更しました

INFO.en=Allows fast-forwarding by pressing the some button during combat animations.\r\nUnlike frame skipping on emulators, the BGM is not fast-forwarded, only the animation is fast-forwarded.\r\nCompared to a similar implementation in Circle, this has several advantages.\r\nOne is that long combat animations do not have the side-effect of being delayed in the opposite direction.\r\nThe second is that magic can also be fast-forwarded.\r\nIt used to be the A button, but it is customary to use the R button, so we changed it
INFO.zh=Allows fast-forwarding by pressing the some button during combat animations.\r\nUnlike frame skipping on emulators, the BGM is not fast-forwarded, only the animation is fast-forwarded.\r\nCompared to a similar implementation in Circle, this has several advantages.\r\nOne is that long combat animations do not have the side-effect of being delayed in the opposite direction.\r\nThe second is that magic can also be fast-forwarded.\r\nIt used to be the A button, but it is customary to use the R button, so we changed it


//既に適応されたかどうか
PATCHED_IF:0x426F0=0x00 0x4B 0x18 0x47

AUTHOR=7743, Eebit (FE6J/FE7U)

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
NAME=Rボタンで戦闘アニメを早送りできるようにする 20220531(Edit)
NAME.en=Allow fast-forwarding of battle animations with the R button 20220531(Edit)
NAME.zh=Allow fast-forwarding of battle animations with the R button 20220531(Edit)

TYPE=ADDR
TAG=#EVENT
EA=Install.event

INFO=戦闘アニメーション中に特定のボタンを押せば早送りできるようにします。\r\nエミュレータのフレームスキップとは異なりBGMは早送りされずアニメーションだけを早送りします。\r\nCircleの同様の実装と比べて、いくつかのメリットがあります。\r\n1つは、長い戦闘アニメーションが、逆に遅延する副作用がないためです。\r\n2つ目は、魔法も早送りできることです。\r\n以前はAボタンでしたが、Rボタンにするのが慣習になっているので、変更しました

INFO.en=Allows fast-forwarding by pressing the some button during combat animations.\r\nUnlike frame skipping on emulators, the BGM is not fast-forwarded, only the animation is fast-forwarded.\r\nCompared to a similar implementation in Circle, this has several advantages.\r\nOne is that long combat animations do not have the side-effect of being delayed in the opposite direction.\r\nThe second is that magic can also be fast-forwarded.\r\nIt used to be the A button, but it is customary to use the R button, so we changed it
INFO.zh=Allows fast-forwarding by pressing the some button during combat animations.\r\nUnlike frame skipping on emulators, the BGM is not fast-forwarded, only the animation is fast-forwarded.\r\nCompared to a similar implementation in Circle, this has several advantages.\r\nOne is that long combat animations do not have the side-effect of being delayed in the opposite direction.\r\nThe second is that magic can also be fast-forwarded.\r\nIt used to be the A button, but it is customary to use the R button, so we changed it


//既に適応されたかどうか
IF:0x426F0=0x00 0x4B 0x18 0x47

ADDRESS=$FGREP4ENDA FastBattleAnimation.dmp
COMBO=A Button|0x01 0x00|B Button|0x02 0x00|L Button|0x00 0x02|R Button|0x00 0x01|Top Button|0x40 0x00|Buttom Button|0x80 0x00|Left Button|0x20 0x00|Right Button|0x10 0x00|Start Button|0x04 0x00|Select Button|0x08 0x00

AUTHOR=7743

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
@Hook 080426F0 @FE6J
@Hook 0804B314 @FE7U
@Hook 08050C44 @FE8J
@Hook 0804FED0 @FE8U (InBattleMainRoutine; 0x0804FE40)
@r0 VCount

.thumb
.macro blh to, reg=r3
ldr \reg, =\to
mov lr, \reg
.short 0xf800
.endm

@ LDR r3, =0x02023B20 @ FE6J (gKeyStObj)
LDR r3, =0x02024C78 @ FE7U (gKeysInstance)
@ LDR r3, =0x02024CC0 @ FE8J FE8U ([email protected] )
LDRH r3, [r3, #0x4] @ [email protected]
ldr r2, PressButton
AND r3 ,r2
beq WaitExit

@Aボタンが押されているので早くする!

@Dummy GeneralVBlankHandler
ldr r1, =0x03007FF8 @FE6J FE7U FE8J FE8U IRQCheckFlags
mov r0, #0x1
strh r0, [r1, #0x0] @IRQCheckFlags
@blh 0x08000F20 @FE6J IncGameTime
blh 0x08000F48 @FE7U IncGameTime
@blh 0x08000cf0 @FE8J IncrementGlobalClock
@blh 0x08000d40 @FE8U IncrementGlobalClock

@ldr r0, =0x020258cc @FE6J gProcTreeRootArray
ldr r0, =0x02026a30 @FE7U gProcTreeRoots
@ldr r0, =0x02026A70 @FE8J FE8U 6CPointer@MainArray[0].pointer
ldr r0, [r0, #0x0]
@blh 0x08003E44 @FE6J Proc_Run
blh 0x08004690 @FE7U Proc_Run
@blh 0x08002dd4 @FE8J Exec6C
@blh 0x08002e84 @FE8U Exec6C

@blh 0x08002dc4 @FE6J SyncLoOam
blh 0x08003338 @FE7U SyncLoOam
@blh 0x080020cc @FE8J FlushPrimaryOAM
@blh 0x0800217c @FE8U FlushPrimaryOAM

@ldr r1, =0x0202aa08 @FE6J gBmSt
ldr r1, =0x0202bbb8 @FE7U gBmStatus
@ldr r1, =0x0202BCAC @FE8J [email protected]
@ldr r1, =0x0202BCB0 @FE8U [email protected]
ldrb r0, [r1, #0x0] @[email protected]
cmp r0, #0x0
beq Exit
mov r0, #0x0
strb r0, [r1, #0x0] @[email protected]
@blh 0x080010CC @FE7J SyncDispIo
blh 0x080011B0 @FE7U SyncDispIo
@blh 0x08000e4c @FE8J FlushLCDControl
@blh 0x08000e9c @FE8U FlushLCDControl
@blh 0x08001478 @FE6J SyncBgsAndPal
blh 0x080016EC @FE7U SyncBgsAndPal
@blh 0x080010fc @FE8J FlushBackgrounds
@blh 0x0800114c @FE8U FlushBackgrounds
@blh 0x08002C04 @FE6J ApplyDataMoves
blh 0x08003178 @FE7U ApplyDataMoves
@blh 0x08001fd8 @FE8J FlushTiles
@blh 0x08002088 @FE8U FlushTiles
@blh 0x08002d6c @FE6J SyncHiOam
blh 0x080032E0 @FE7U SyncHiOam
@blh 0x08002088 @FE8J FlushSecondaryOAM
@blh 0x08002138 @FE8U FlushSecondaryOAM
b Exit

WaitExit:
@Aボタンが押されていないので、VBlankIntrWaitで待機させる
@blh 0x0809dd30 @FE6J VBlankIntrWait
blh 0x080BFA6C @FE7U VBlankIntrWait
@blh 0x080d63d8 @FE8J VBlankIntrWait
@blh 0x080d16dc @FE8U VBlankIntrWait

Exit:
pop {r0}
bx r0

.ltorg
PressButton:
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PressButton=$88
WaitExit=$4C
Exit=$52
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
PUSH
//ORG 0x426F0 //FE6J
ORG 0x4B314 //FE7U
//ORG 0x50C44 //FE8J
//ORG 0x4FED0 //FE8U
jumpToHack(FastBattleAnimation)
POP

ALIGN 4
FastBattleAnimation:
#incbin "FastBattleAnimation.dmp"
WORD 0x0100 //R Button

//A Button 0x0001
//B Button 0x0002
//L Button 0x0200
//R Button 0x0100
//Top Button 0x0040
//Buttom Button 0x0080
//Left Button 0x0020
//Right Button 0x0010
//Start Button 0x0004
//Select Button 0x0008
//L and R 0x0300

ALIGN 4
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
NAME=Rボタンで戦闘アニメを早送りできるようにする 20220531(Install)
NAME.en=Allow fast-forwarding of battle animations with the R button 20220531(Install)
NAME.zh=Allow fast-forwarding of battle animations with the R button 20220531(Install)

TYPE=EA
TAG=#EVENT
EA=Install.event

INFO=戦闘アニメーション中に特定のボタンを押せば早送りできるようにします。\r\nエミュレータのフレームスキップとは異なりBGMは早送りされずアニメーションだけを早送りします。\r\nCircleの同様の実装と比べて、いくつかのメリットがあります。\r\n1つは、長い戦闘アニメーションが、逆に遅延する副作用がないためです。\r\n2つ目は、魔法も早送りできることです。\r\n以前はAボタンでしたが、Rボタンにするのが慣習になっているので、変更しました

INFO.en=Allows fast-forwarding by pressing the some button during combat animations.\r\nUnlike frame skipping on emulators, the BGM is not fast-forwarded, only the animation is fast-forwarded.\r\nCompared to a similar implementation in Circle, this has several advantages.\r\nOne is that long combat animations do not have the side-effect of being delayed in the opposite direction.\r\nThe second is that magic can also be fast-forwarded.\r\nIt used to be the A button, but it is customary to use the R button, so we changed it
INFO.zh=Allows fast-forwarding by pressing the some button during combat animations.\r\nUnlike frame skipping on emulators, the BGM is not fast-forwarded, only the animation is fast-forwarded.\r\nCompared to a similar implementation in Circle, this has several advantages.\r\nOne is that long combat animations do not have the side-effect of being delayed in the opposite direction.\r\nThe second is that magic can also be fast-forwarded.\r\nIt used to be the A button, but it is customary to use the R button, so we changed it


//既に適応されたかどうか
PATCHED_IF:0x4B314=0x00 0x4B 0x18 0x47

AUTHOR=7743, Eebit (FE6J/FE7U)

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
NAME=Rボタンで戦闘アニメを早送りできるようにする 20220531(Edit)
NAME.en=Allow fast-forwarding of battle animations with the R button 20220531(Edit)
NAME.zh=Allow fast-forwarding of battle animations with the R button 20220531(Edit)

TYPE=ADDR
TAG=#EVENT
EA=Install.event

INFO=戦闘アニメーション中に特定のボタンを押せば早送りできるようにします。\r\nエミュレータのフレームスキップとは異なりBGMは早送りされずアニメーションだけを早送りします。\r\nCircleの同様の実装と比べて、いくつかのメリットがあります。\r\n1つは、長い戦闘アニメーションが、逆に遅延する副作用がないためです。\r\n2つ目は、魔法も早送りできることです。\r\n以前はAボタンでしたが、Rボタンにするのが慣習になっているので、変更しました

INFO.en=Allows fast-forwarding by pressing the some button during combat animations.\r\nUnlike frame skipping on emulators, the BGM is not fast-forwarded, only the animation is fast-forwarded.\r\nCompared to a similar implementation in Circle, this has several advantages.\r\nOne is that long combat animations do not have the side-effect of being delayed in the opposite direction.\r\nThe second is that magic can also be fast-forwarded.\r\nIt used to be the A button, but it is customary to use the R button, so we changed it
INFO.zh=Allows fast-forwarding by pressing the some button during combat animations.\r\nUnlike frame skipping on emulators, the BGM is not fast-forwarded, only the animation is fast-forwarded.\r\nCompared to a similar implementation in Circle, this has several advantages.\r\nOne is that long combat animations do not have the side-effect of being delayed in the opposite direction.\r\nThe second is that magic can also be fast-forwarded.\r\nIt used to be the A button, but it is customary to use the R button, so we changed it


//既に適応されたかどうか
IF:0x4B314=0x00 0x4B 0x18 0x47

ADDRESS=$FGREP4ENDA FastBattleAnimation.dmp
COMBO=A Button|0x01 0x00|B Button|0x02 0x00|L Button|0x00 0x02|R Button|0x00 0x01|Top Button|0x40 0x00|Buttom Button|0x80 0x00|Left Button|0x20 0x00|Right Button|0x10 0x00|Start Button|0x04 0x00|Select Button|0x08 0x00

AUTHOR=7743

0 comments on commit 171cea3

Please sign in to comment.