diff --git a/Output/Console/g_core.bin b/Output/Console/g_core.bin index 37386f0a..40144c23 100644 Binary files a/Output/Console/g_core.bin and b/Output/Console/g_core.bin differ diff --git a/Output/Console/g_core_porta.bin b/Output/Console/g_core_porta.bin index d2a81a9a..abbf2761 100644 Binary files a/Output/Console/g_core_porta.bin and b/Output/Console/g_core_porta.bin differ diff --git a/Output/Netplay/GALE01r2.ini b/Output/Netplay/GALE01r2.ini index f99f6fd4..8dab0f29 100644 --- a/Output/Netplay/GALE01r2.ini +++ b/Output/Netplay/GALE01r2.ini @@ -908,18 +908,6 @@ $Enable OSReport Print on Crash (1.02) [UnclePunch] $Slippi Recording [Fizzi, Achilles, UnclePunch] *Used in conjunction with Slippi plugged into PortB to extract game data -C21A4FA4 0000000B #Recording/EXIOnStackExample.asm -7C0802A6 90010004 -9421FF94 BE810008 -7C230B78 38630038 -3863001F 54630034 -388000D0 98830000 -38800014 38A00001 -3D808000 618C55F0 -7D8903A6 4E800421 -BA810008 80010070 -3821006C 7C0803A6 -80790000 00000000 040679BC 38802600 #Recording/ExtendPlayerBlock.asm C23219EC 00000012 #Recording/FlushFrameBuffer.asm 7C0802A6 90010004 @@ -1229,6 +1217,79 @@ A0640002 B07D0031 BA810008 800100B4 382100B0 7C0803A6 881F2219 00000000 +C21A4FA4 00000048 #Recording/SendMenuFrame.asm +7C0802A6 90010004 +9421FF6F BE810008 +38610038 3863001F +54630034 3D808000 +618C5604 7D8903A6 +4E800421 2C030001 +418201F4 3880003E +98830000 3C808048 +80849D30 5484443E +B0830001 3C808111 +60848DEC 80840000 +90830003 3C808111 +60848DF0 80840000 +90830007 3C808111 +6084826C 80840000 +9083000B 3C808111 +60848270 80840000 +9083000F 3C808111 +608476EC 80840000 +90830013 3C808111 +608476F0 80840000 +90830017 3C808111 +6084674C 80840000 +9083001B 3C808111 +60846750 80840000 +9083001F 3C80804D +60846CF2 88840000 +98830023 3C80804D +60846CAD 88840000 +98830024 3C80803F +60840E08 88840000 +98830025 3C80803F +60840E2C 88840000 +98830026 3C80803F +60840E50 88840000 +98830027 3C80803F +60840E74 88840000 +98830028 3C80803F +60840E0A 88840000 +98830029 3C80803F +60840E2E 88840000 +9883002A 3C80803F +60840E52 88840000 +9883002B 3C80803F +60840E76 88840000 +9883002C 3C80804A +60840BC0 80840000 +38840005 88840000 +9883002D 3C80804A +60840BC4 80840000 +38840005 88840000 +9883002E 3C80804A +60840BC8 80840000 +38840005 88840000 +9883002F 3C80804A +60840BCC 80840000 +38840005 88840000 +98830030 3C8080BD +6084A810 80840000 +38840028 80840000 +38840038 80840000 +90830031 3C8080BD +6084A810 80840000 +38840028 80840000 +3884003C 80840000 +90830035 38800039 +38A00001 3D808000 +618C55F0 7D8903A6 +4E800421 BA810008 +80010095 38210091 +7C0803A6 80790000 +60000000 00000000 C2005604 00000007 #Recording/ShouldRecord.asm 3C608048 80639D30 5463443E 2C030202 diff --git a/Output/Netplay/GALJ01r2.ini b/Output/Netplay/GALJ01r2.ini index eecb792d..cd10ecfb 100644 --- a/Output/Netplay/GALJ01r2.ini +++ b/Output/Netplay/GALJ01r2.ini @@ -908,18 +908,6 @@ $Enable OSReport Print on Crash (1.02) [UnclePunch] $Slippi Recording [Fizzi, Achilles, UnclePunch] *Used in conjunction with Slippi plugged into PortB to extract game data -C21A4FA4 0000000B #Recording/EXIOnStackExample.asm -7C0802A6 90010004 -9421FF94 BE810008 -7C230B78 38630038 -3863001F 54630034 -388000D0 98830000 -38800014 38A00001 -3D808000 618C55F0 -7D8903A6 4E800421 -BA810008 80010070 -3821006C 7C0803A6 -80790000 00000000 040679BC 38802600 #Recording/ExtendPlayerBlock.asm C23219EC 00000012 #Recording/FlushFrameBuffer.asm 7C0802A6 90010004 @@ -1229,6 +1217,79 @@ A0640002 B07D0031 BA810008 800100B4 382100B0 7C0803A6 881F2219 00000000 +C21A4FA4 00000048 #Recording/SendMenuFrame.asm +7C0802A6 90010004 +9421FF6F BE810008 +38610038 3863001F +54630034 3D808000 +618C5604 7D8903A6 +4E800421 2C030001 +418201F4 3880003E +98830000 3C808048 +80849D30 5484443E +B0830001 3C808111 +60848DEC 80840000 +90830003 3C808111 +60848DF0 80840000 +90830007 3C808111 +6084826C 80840000 +9083000B 3C808111 +60848270 80840000 +9083000F 3C808111 +608476EC 80840000 +90830013 3C808111 +608476F0 80840000 +90830017 3C808111 +6084674C 80840000 +9083001B 3C808111 +60846750 80840000 +9083001F 3C80804D +60846CF2 88840000 +98830023 3C80804D +60846CAD 88840000 +98830024 3C80803F +60840E08 88840000 +98830025 3C80803F +60840E2C 88840000 +98830026 3C80803F +60840E50 88840000 +98830027 3C80803F +60840E74 88840000 +98830028 3C80803F +60840E0A 88840000 +98830029 3C80803F +60840E2E 88840000 +9883002A 3C80803F +60840E52 88840000 +9883002B 3C80803F +60840E76 88840000 +9883002C 3C80804A +60840BC0 80840000 +38840005 88840000 +9883002D 3C80804A +60840BC4 80840000 +38840005 88840000 +9883002E 3C80804A +60840BC8 80840000 +38840005 88840000 +9883002F 3C80804A +60840BCC 80840000 +38840005 88840000 +98830030 3C8080BD +6084A810 80840000 +38840028 80840000 +38840038 80840000 +90830031 3C8080BD +6084A810 80840000 +38840028 80840000 +3884003C 80840000 +90830035 38800039 +38A00001 3D808000 +618C55F0 7D8903A6 +4E800421 BA810008 +80010095 38210091 +7C0803A6 80790000 +60000000 00000000 C2005604 00000007 #Recording/ShouldRecord.asm 3C608048 80639D30 5463443E 2C030202 diff --git a/Recording/EXIOnStackExample.asm b/Recording/EXIOnStackExample.asm deleted file mode 100644 index 1d46714a..00000000 --- a/Recording/EXIOnStackExample.asm +++ /dev/null @@ -1,26 +0,0 @@ -################################################################################ -# Address: 0x801a4fa4 -################################################################################ -.include "Common/Common.s" -.include "Recording/Recording.s" - -.set PAYLOAD_LEN, 0x13 -.set EXI_BUF_LEN, PAYLOAD_LEN + 1 - -.set STACK_FREE_SPACE, EXI_BUF_LEN + 0x20 # Add 0x20 to deal with byte alignment - -.set STACK_OFST_EXI_BUF, BKP_FREE_SPACE_OFFSET - -backup STACK_FREE_SPACE -addi r3, sp, STACK_OFST_EXI_BUF # This is the start address for the free space -byteAlign32 r3 # Align to next 32 byte boundary - -li r4, 0xD0 # Command byte -stb r4, 0(r3) - -li r4, EXI_BUF_LEN -li r5, CONST_ExiWrite -branchl r12, FN_EXITransferBuffer - -restore STACK_FREE_SPACE -lwz r3, 0(r25) # replaced code line diff --git a/Recording/Recording.s b/Recording/Recording.s index 8353f153..ae99da80 100644 --- a/Recording/Recording.s +++ b/Recording/Recording.s @@ -11,6 +11,7 @@ .set CMD_ITEM, 0x3B .set CMD_FRAME_BOOKEND, 0x3C .set CMD_GAME_END, 0x39 +.set CMD_MENU_FRAME, 0x3E .set COMMAND_COUNT, 10 # number of possible commands # Payload lengths, if any additional data is added, these must be incremented diff --git a/Recording/SendMenuFrame.asm b/Recording/SendMenuFrame.asm new file mode 100644 index 00000000..6fffce2a --- /dev/null +++ b/Recording/SendMenuFrame.asm @@ -0,0 +1,189 @@ +################################################################################ +# Address: 0x801a4fa4 +################################################################################ + +################################################################################ +# Routine: SendMenuFrame +# ------------------------------------------------------------------------------ +# Description: Gets menu information and sends it to the Slippi device +################################################################################ + +.include "Common/Common.s" +.include "Recording/Recording.s" + +.set PAYLOAD_LEN, 0x38 +.set EXI_BUF_LEN, PAYLOAD_LEN + 1 + +.set STACK_FREE_SPACE, EXI_BUF_LEN + 0x20 # Add 0x20 to deal with byte alignment + +.set STACK_OFST_EXI_BUF, BKP_FREE_SPACE_OFFSET + +backup STACK_FREE_SPACE +addi r3, sp, STACK_OFST_EXI_BUF # This is the start address for the free space +byteAlign32 r3 # Align to next 32 byte boundary + +# check if NOT VS Mode +branchl r12,FN_ShouldRecord +cmpwi r3,0x1 +beq Injection_Exit + + +li r4, CMD_MENU_FRAME # Command byte +stb r4, 0x0(r3) + +# Two bytes for major / minor scene +getMinorMajor r4 +sth r4, 0x1(r3) + +# send player 1 cursor x position +load r4 0x81118DEC +lwz r4, 0(r4) +stw r4, 0x3(r3) + +# send player 1 cursor y position +load r4 0x81118DF0 +lwz r4, 0(r4) +stw r4, 0x7(r3) + +# send player 2 cursor x position +load r4 0x8111826C +lwz r4, 0(r4) +stw r4, 0xB(r3) + +# send player 2 cursor y position +load r4 0x81118270 +lwz r4, 0(r4) +stw r4, 0xF(r3) + +# send player 3 cursor x position +load r4 0x811176EC +lwz r4, 0(r4) +stw r4, 0x13(r3) + +# send player 3 cursor y position +load r4 0x811176F0 +lwz r4, 0(r4) +stw r4, 0x17(r3) + +# send player 4 cursor x position +load r4 0x8111674C +lwz r4, 0(r4) +stw r4, 0x1B(r3) + +# send player 4 cursor y position +load r4 0x81116750 +lwz r4, 0(r4) +stw r4, 0x1F(r3) + +# Ready to fight banner visible (one byte) +# banner "swoops in" frame by frame +# value of 10 is fully invisible (not ready to play) +# value of 0 is fully visible (ready to play) +load r4 0x804d6cf2 +lbz r4, 0(r4) +stb r4, 0x23(r3) + +# Stage selected (one byte) +load r4 0x804D6CAD +lbz r4, 0(r4) +stb r4, 0x24(r3) + +# controller port statuses at CSS (each one byte) +# 0 == Human +# 1 == CPU +# 3 == Off +# Player 1 +load r4 0x803F0E08 +lbz r4, 0(r4) +stb r4, 0x25(r3) +# Player 2 +load r4 0x803F0E2C +lbz r4, 0(r4) +stb r4, 0x26(r3) +# Player 3 +load r4 0x803F0E50 +lbz r4, 0(r4) +stb r4, 0x27(r3) +# Player 4 +load r4 0x803F0E74 +lbz r4, 0(r4) +stb r4, 0x28(r3) + +# Character selected (each one byte) +# Player 1 +load r4 0x803F0E0A +lbz r4, 0(r4) +stb r4, 0x29(r3) +# Player 2 +load r4 0x803F0E2E +lbz r4, 0(r4) +stb r4, 0x2A(r3) +# Player 3 +load r4 0x803F0E52 +lbz r4, 0(r4) +stb r4, 0x2B(r3) +# Player 4 +load r4 0x803F0E76 +lbz r4, 0(r4) +stb r4, 0x2C(r3) + +# Coin down +# 0 == No coin +# 1 == Coin in hand +# 2 == Coin down +# 3 == Not plugged in +# Player 1 +load r4 0x804a0bc0 +lwz r4, 0(r4) +addi r4, r4, 5 +lbz r4, 0(r4) +stb r4, 0x2D(r3) +# Player 2 +load r4 0x804a0bc4 +lwz r4, 0(r4) +addi r4, r4, 5 +lbz r4, 0(r4) +stb r4, 0x2E(r3) +# Player 3 +load r4 0x804a0bc8 +lwz r4, 0(r4) +addi r4, r4, 5 +lbz r4, 0(r4) +stb r4, 0x2F(r3) +# Player 4 +load r4 0x804a0bcc +lwz r4, 0(r4) +addi r4, r4, 5 +lbz r4, 0(r4) +stb r4, 0x30(r3) + +# Stage Select Cursor X +# 4-byte float +load r4 0x80bda810 +lwz r4, 0(r4) +addi r4, r4, 0x28 +lwz r4, 0(r4) +addi r4, r4, 0x38 +lwz r4, 0(r4) +stw r4, 0x31(r3) + +# Stage Select Cursor y +# 4-byte float +load r4 0x80bda810 +lwz r4, 0(r4) +addi r4, r4, 0x28 +lwz r4, 0(r4) +addi r4, r4, 0x3C +lwz r4, 0(r4) +stw r4, 0x35(r3) + +#------------- Transfer Buffer ------------ +# r3 is the buffer arg, but it's already set +li r4, EXI_BUF_LEN +li r5, CONST_ExiWrite +branchl r12, FN_EXITransferBuffer + +Injection_Exit: + +restore STACK_FREE_SPACE +lwz r3, 0(r25) # replaced code line