Skip to content

Commit

Permalink
split out menu extraction code
Browse files Browse the repository at this point in the history
  • Loading branch information
JLaferri committed May 25, 2024
1 parent ce73837 commit 72b587b
Show file tree
Hide file tree
Showing 7 changed files with 246 additions and 13 deletions.
9 changes: 9 additions & 0 deletions Common/Common.s
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ add \reg, r3, r4
.set CONST_ExiWrite, 1 # arg value to make an EXI write

# For Slippi communication
.set CONST_SlippiCmdSendMenuFrame, 0x3E
.set CONST_SlippiCmdGetFrame, 0x76
.set CONST_SlippiCmdCheckForReplay, 0x88
.set CONST_SlippiCmdCheckForStockSteal,0x89
Expand Down Expand Up @@ -612,6 +613,14 @@ add \reg, r3, r4
.set isWidescreen,-0x5020
.set OFST_R13_SB_ADDR,-0x503C # Scene buffer, persists throughout scenes

################################################################################
# CSS Screen Player Cursor State Offsets
################################################################################
.set CSS_CURSOR_STRUCT_PTR_P1, 0x804A0BC0
.set CSS_CURSOR_STRUCT_PTR_P2, 0x804A0BC4
.set CSS_CURSOR_STRUCT_PTR_P3, 0x804A0BC8
.set CSS_CURSOR_STRUCT_PTR_P4, 0x804A0BCC

################################################################################
# Log levels
################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
################################################################################

.include "Common/Common.s"
.include "Recording/Recording.s"

.set PAYLOAD_LEN, 0x40
.set EXI_BUF_LEN, PAYLOAD_LEN + 1
Expand All @@ -22,15 +21,15 @@ backup STACK_FREE_SPACE

# check if NOT VS Mode
getMinorMajor r8
cmpwi r8, 0x0202
cmpwi r8, SCENE_VERSUS_IN_GAME
beq Injection_Exit
cmpwi r8, 0x0208
cmpwi r8, SCENE_ONLINE_IN_GAME
beq Injection_Exit

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, CMD_MENU_FRAME # Command byte
li r4, CONST_SlippiCmdSendMenuFrame # Command byte
stb r4, 0x0(r3)

# Two bytes for major / minor scene
Expand Down
7 changes: 7 additions & 0 deletions Output/InjectionLists/list_netplay.json
Original file line number Diff line number Diff line change
Expand Up @@ -2085,6 +2085,13 @@
"Codetype": "Auto",
"Annotation": "Online/Optional/ShowAllyIndicator/ShowAllyIndicator.asm",
"Tags": ""
},
{
"InjectionAddress": "801A4FA4",
"Name": "Optional: Extract Menu Info",
"Codetype": "Auto",
"Annotation": "Common/ExtractMenuInfo/SendMenuFrame.asm",
"Tags": ""
}
]
}
105 changes: 105 additions & 0 deletions Output/Netplay/GALE01r2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7081,3 +7081,108 @@ C0230064 BA810008
BA810008 800100B4
382100B0 7C0803A6
60000000 00000000
$Optional: Extract Menu Info [altf4, Fizzi]
*Extracts menu info. Useful for bots.
C21A4FA4 00000065 #Common/ExtractMenuInfo/SendMenuFrame.asm
7C0802A6 90010004
9421FF64 BE81006C
3D008048 81089D30
5508443E 2C080202
418202EC 2C080208
418202E4 38610008
3863001F 54630034
3880003E 98830000
B1030001 3C80804A
60840BC0 80840000
2C040000 40820018
3CA00000 60A50000
90A30003 90A30007
48000014 80A4000C
90A30003 80A40010
90A30007 3C80804A
60840BC4 80840000
2C040000 40820018
3CA00000 60A50000
90A3000B 90A3000F
48000014 80A4000C
90A3000B 80A40010
90A3000F 3C80804A
60840BC8 80840000
2C040000 40820018
3CA00000 60A50000
90A30013 90A30017
48000014 80A4000C
90A30013 80A40010
90A30017 3C80804A
60840BCC 80840000
2C040000 40820018
3CA00000 60A50000
90A3001B 90A3001F
48000014 80A4000C
90A3001B 80A40010
90A3001F 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 3C800000
60840000 9083002D
2C080002 40820064
3C80804A 60840BC0
80840000 38840005
88840000 9883002D
3C80804A 60840BC4
80840000 38840005
88840000 9883002E
3C80804A 60840BC8
80840000 38840005
88840000 9883002F
3C80804A 60840BCC
80840000 38840005
88840000 98830030
3C800000 60840000
90830031 3C800000
60840000 90830035
2C080102 41820010
2C080108 41820008
48000054 3C80804D
60847820 80840000
38840010 80840000
38840028 80840000
38840038 80840000
90830031 3C80804D
60847820 80840000
38840010 80840000
38840028 80840000
3884003C 80840000
90830035 3C808047
60849D60 80840000
90830039 3C80804A
608404F0 88840000
9883003D 3C80804A
608404F3 88840000
9883003E 3C80803F
60840E09 88840000
9883003F 38800041
38A00001 3D808000
618C55F0 7D8903A6
4E800421 BA81006C
800100A0 3821009C
7C0803A6 80790000
60000000 00000000
105 changes: 105 additions & 0 deletions Output/Netplay/GALJ01r2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7080,3 +7080,108 @@ C0230064 BA810008
BA810008 800100B4
382100B0 7C0803A6
60000000 00000000
$Optional: Extract Menu Info [altf4, Fizzi]
*Extracts menu info. Useful for bots.
C21A4FA4 00000065 #Common/ExtractMenuInfo/SendMenuFrame.asm
7C0802A6 90010004
9421FF64 BE81006C
3D008048 81089D30
5508443E 2C080202
418202EC 2C080208
418202E4 38610008
3863001F 54630034
3880003E 98830000
B1030001 3C80804A
60840BC0 80840000
2C040000 40820018
3CA00000 60A50000
90A30003 90A30007
48000014 80A4000C
90A30003 80A40010
90A30007 3C80804A
60840BC4 80840000
2C040000 40820018
3CA00000 60A50000
90A3000B 90A3000F
48000014 80A4000C
90A3000B 80A40010
90A3000F 3C80804A
60840BC8 80840000
2C040000 40820018
3CA00000 60A50000
90A30013 90A30017
48000014 80A4000C
90A30013 80A40010
90A30017 3C80804A
60840BCC 80840000
2C040000 40820018
3CA00000 60A50000
90A3001B 90A3001F
48000014 80A4000C
90A3001B 80A40010
90A3001F 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 3C800000
60840000 9083002D
2C080002 40820064
3C80804A 60840BC0
80840000 38840005
88840000 9883002D
3C80804A 60840BC4
80840000 38840005
88840000 9883002E
3C80804A 60840BC8
80840000 38840005
88840000 9883002F
3C80804A 60840BCC
80840000 38840005
88840000 98830030
3C800000 60840000
90830031 3C800000
60840000 90830035
2C080102 41820010
2C080108 41820008
48000054 3C80804D
60847820 80840000
38840010 80840000
38840028 80840000
38840038 80840000
90830031 3C80804D
60847820 80840000
38840010 80840000
38840028 80840000
3884003C 80840000
90830035 3C808047
60849D60 80840000
90830039 3C80804A
608404F0 88840000
9883003D 3C80804A
608404F3 88840000
9883003E 3C80803F
60840E09 88840000
9883003F 38800041
38A00001 3D808000
618C55F0 7D8903A6
4E800421 BA81006C
800100A0 3821009C
7C0803A6 80790000
60000000 00000000
9 changes: 0 additions & 9 deletions Recording/Recording.s
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
.set CMD_FRAME_BOOKEND, 0x3C
.set CMD_GAME_END, 0x39
.set COMMAND_COUNT, 10 # number of possible commands
.set CMD_MENU_FRAME, 0x3E # Not executed while in a recorded game

################################################################################
# Payload lengths
Expand Down Expand Up @@ -80,11 +79,3 @@
################################################################################
.set PlayerBlockSize,0x2600
.set LCancelStatus,0x25FF

################################################################################
# CSS Screen Player Cursor State Offsets
################################################################################
.set CSS_CURSOR_STRUCT_PTR_P1, 0x804A0BC0
.set CSS_CURSOR_STRUCT_PTR_P2, 0x804A0BC4
.set CSS_CURSOR_STRUCT_PTR_P3, 0x804A0BC8
.set CSS_CURSOR_STRUCT_PTR_P4, 0x804A0BCC
17 changes: 17 additions & 0 deletions netplay.json
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,23 @@
"isRecursive": true
}
]
},
{
"name": "Optional: Extract Menu Info",
"authors": [
"altf4",
"Fizzi"
],
"description": [
"Extracts menu info. Useful for bots."
],
"build": [
{
"type": "injectFolder",
"sourceFolder": "Common/ExtractMenuInfo",
"isRecursive": true
}
]
}
]
}

0 comments on commit 72b587b

Please sign in to comment.