Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move StartGame__5GGameFv to inline assembly
Browse files Browse the repository at this point in the history
bwrsandman committed Jan 5, 2025
1 parent 1942bb7 commit bbc1457
Showing 5 changed files with 93 additions and 102 deletions.
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -155,8 +155,8 @@ set(SOURCES
asm/unprocessed/runblack.reassemble.0472.005497f0-00549900.asm
asm/unprocessed/runblack.reassemble.0476.00549900-0054a180.asm
asm/unprocessed/runblack.reassemble.0479.0054a180-0054c180.asm
c/Game.0480.0054c180-0054c187.c
asm/unprocessed/runblack.reassemble.0480.0054c190-0054ff80.asm
c/Game.0480.0054c180-0054c2d6.c
asm/unprocessed/runblack.reassemble.0480.0054c2e0-0054ff80.asm
asm/unprocessed/runblack.reassemble.0483.0054ff80-00551ee0.asm
asm/unprocessed/runblack.reassemble.0486.00551ee0-005525e0.asm
asm/unprocessed/runblack.reassemble.0490.005525e0-005529e0.asm
Original file line number Diff line number Diff line change
@@ -421,10 +421,6 @@
.extern _jmp_addr_0x00871f00
.extern _jmp_addr_0x008a5b3a

.globl _jmp_addr_0x0054c190
.globl _jmp_addr_0x0054c1eb
.globl _jmp_addr_0x0054c269
.globl _jmp_addr_0x0054c2d0
.globl _jmp_addr_0x0054c340
.globl _jmp_addr_0x0054c377
.globl _jmp_addr_0x0054c37e
@@ -744,95 +740,7 @@
.globl _jmp_addr_0x0054ff09
.globl _jmp_addr_0x0054ff40

// Snippet: asm, [0x0054c190, 0x0054ff60)
_jmp_addr_0x0054c190: {disp32} mov eax, dword ptr [data_bytes + 0x33b95c] // 0x0054c190 a15c19d000
sub esp, 0x10 // 0x0054c195 83ec10
push ebx // 0x0054c198 53
push esi // 0x0054c199 56
xor.s ebx, ebx // 0x0054c19a 33db
mov.s esi, ecx // 0x0054c19c 8bf1
{disp32} mov dword ptr [eax + 0x00250180], ebx // 0x0054c19e 899880012500
call _jmp_addr_0x0054f3b0 // 0x0054c1a4 e807320000
cmp eax, 0x01 // 0x0054c1a9 83f801
{disp32} jne _jmp_addr_0x0054c2d0 // 0x0054c1ac 0f851e010000
cmp byte ptr [data_bytes + 0x380ac1], bl // 0x0054c1b2 381dc16ad400
{disp32} jne _jmp_addr_0x0054c2d0 // 0x0054c1b8 0f8512010000
push edi // 0x0054c1be 57
call _jmp_addr_0x006419f0 // 0x0054c1bf e82c580f00
{disp32} mov edi, dword ptr [data_bytes + 0x30a6e8] // 0x0054c1c4 8b3de806cd00
cmp.s edi, ebx // 0x0054c1ca 3bfb
{disp8} je _jmp_addr_0x0054c1eb // 0x0054c1cc 741d
{disp32} mov ecx, dword ptr [edi + 0x0000e92c] // 0x0054c1ce 8b8f2ce90000
{disp8} mov dword ptr [ecx + 0x08], ebx // 0x0054c1d4 895908
{disp32} mov ecx, dword ptr [edi + 0x0000e928] // 0x0054c1d7 8b8f28e90000
call _jmp_addr_0x00837d40 // 0x0054c1dd e85ebb2e00
push edi // 0x0054c1e2 57
call _jmp_addr_0x007aee98 // 0x0054c1e3 e8b02c2600
add esp, 0x04 // 0x0054c1e8 83c404
_jmp_addr_0x0054c1eb: {disp32} mov edi, dword ptr [rdata_bytes + 0x1c4] // 0x0054c1eb 8b3dc4918a00
{disp32} mov dword ptr [data_bytes + 0x30a6e8], ebx // 0x0054c1f1 891de806cd00
call edi // 0x0054c1f7 ffd7
{disp32} fld dword ptr [esi + 0x00205e70] // 0x0054c1f9 d986705e2000
{disp32} fcomp dword ptr [rdata_bytes + 0x1398] // 0x0054c1ff d81d98a38a00
{disp32} mov dword ptr [esi + 0x00205e68], eax // 0x0054c205 8986685e2000
{disp32} mov dword ptr [esi + 0x00205e6c], ebx // 0x0054c20b 899e6c5e2000
fnstsw ax // 0x0054c211 dfe0
test ah, 0x40 // 0x0054c213 f6c440
{disp8} jne _jmp_addr_0x0054c269 // 0x0054c216 7551
{disp32} mov edx, dword ptr [esi + 0x00205e70] // 0x0054c218 8b96705e2000
{disp32} mov dword ptr [esi + 0x00205e74], edx // 0x0054c21e 8996745e2000
call edi // 0x0054c224 ffd7
sub eax, dword ptr [esi + 0x00205e68] // 0x0054c226 2b86685e2000
{disp8} mov dword ptr [esp + 0x0c], eax // 0x0054c22c 8944240c
{disp32} mov eax, dword ptr [esi + 0x00205e6c] // 0x0054c230 8b866c5e2000
{disp8} mov dword ptr [esp + 0x10], ebx // 0x0054c236 895c2410
{disp8} fild qword ptr [esp + 0x0c] // 0x0054c23a df6c240c
{disp8} mov dword ptr [esp + 0x0c], eax // 0x0054c23e 8944240c
{disp8} mov dword ptr [esp + 0x10], ebx // 0x0054c242 895c2410
{disp32} fmul dword ptr [esi + 0x00205e70] // 0x0054c246 d88e705e2000
{disp8} fiadd dword ptr [esp + 0x0c] // 0x0054c24c da44240c
call _jmp_addr_0x007a1400 // 0x0054c250 e8ab512500
{disp32} mov dword ptr [esi + 0x00205e6c], eax // 0x0054c255 89866c5e2000
call edi // 0x0054c25b ffd7
{disp32} mov dword ptr [esi + 0x00205e68], eax // 0x0054c25d 8986685e2000
{disp32} mov dword ptr [esi + 0x00205e70], ebx // 0x0054c263 899e705e2000
_jmp_addr_0x0054c269: {disp32} mov ecx, dword ptr [esi + 0x00205e74] // 0x0054c269 8b8e745e2000
{disp32} mov dword ptr [esi + 0x00205e70], 0x3727c5ac // 0x0054c26f c786705e2000acc52737
{disp8} mov dword ptr [esp + 0x0c], ecx // 0x0054c279 894c240c
call edi // 0x0054c27d ffd7
{disp32} mov ecx, dword ptr [esi + 0x00205e68] // 0x0054c27f 8b8e685e2000
{disp32} mov edx, dword ptr [esi + 0x00205e6c] // 0x0054c285 8b966c5e2000
sub.s eax, ecx // 0x0054c28b 2bc1
{disp8} mov dword ptr [esp + 0x14], eax // 0x0054c28d 89442414
{disp8} mov dword ptr [esp + 0x18], ebx // 0x0054c291 895c2418
{disp8} fild qword ptr [esp + 0x14] // 0x0054c295 df6c2414
{disp8} mov dword ptr [esp + 0x14], edx // 0x0054c299 89542414
{disp8} mov dword ptr [esp + 0x18], ebx // 0x0054c29d 895c2418
{disp32} fmul dword ptr [esi + 0x00205e70] // 0x0054c2a1 d88e705e2000
{disp8} fiadd dword ptr [esp + 0x14] // 0x0054c2a7 da442414
call _jmp_addr_0x007a1400 // 0x0054c2ab e850512500
{disp32} mov dword ptr [esi + 0x00205e6c], eax // 0x0054c2b0 89866c5e2000
call edi // 0x0054c2b6 ffd7
{disp32} mov dword ptr [esi + 0x00205e68], eax // 0x0054c2b8 8986685e2000
{disp8} mov eax, dword ptr [esp + 0x0c] // 0x0054c2be 8b44240c
mov.s ecx, esi // 0x0054c2c2 8bce
{disp32} mov dword ptr [esi + 0x00205e70], eax // 0x0054c2c4 8986705e2000
call _jmp_addr_0x0054cf20 // 0x0054c2ca e8510c0000
pop edi // 0x0054c2cf 5f
_jmp_addr_0x0054c2d0: pop esi // 0x0054c2d0 5e
pop ebx // 0x0054c2d1 5b
add esp, 0x10 // 0x0054c2d2 83c410
ret // 0x0054c2d5 c3
nop // 0x0054c2d6 90
nop // 0x0054c2d7 90
nop // 0x0054c2d8 90
nop // 0x0054c2d9 90
nop // 0x0054c2da 90
nop // 0x0054c2db 90
nop // 0x0054c2dc 90
nop // 0x0054c2dd 90
nop // 0x0054c2de 90
nop // 0x0054c2df 90
// Snippet: asm, [0x0054c2e0, 0x0054ff60)
sub esp, 0x08 // 0x0054c2e0 83ec08
push esi // 0x0054c2e3 56
mov.s esi, ecx // 0x0054c2e4 8bf1
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
.extern _jmp_addr_0x0053c480
.extern _jmp_addr_0x0053ce70
.extern _jmp_addr_0x00544f80
.extern _jmp_addr_0x0054c190
.extern @StartGame__5GGameFv@4
.extern _jmp_addr_0x0054d610
.extern _jmp_addr_0x0054eb40
.extern _jmp_addr_0x0054ec80
@@ -1006,7 +1006,7 @@ _jmp_addr_0x00641ed3: {disp32} mov al, byte ptr [data_bytes + 0x30a6dd]
{disp32} mov eax, dword ptr [data_bytes + 0x2387f8] // 0x00641ee7 a1f8e7bf00
mov dword ptr [eax], edx // 0x00641eec 8910
{disp32} mov ecx, dword ptr [data_bytes + 0x33b95c] // 0x00641eee 8b0d5c19d000
call _jmp_addr_0x0054c190 // 0x00641ef4 e897a2f0ff
call @StartGame__5GGameFv@4 // 0x00641ef4 e897a2f0ff
{disp32} mov ecx, dword ptr [data_bytes + 0x33b95c] // 0x00641ef9 8b0d5c19d000
call _jmp_addr_0x0054ec80 // 0x00641eff e87ccdf0ff
{disp32} mov eax, dword ptr [data_bytes + 0x33b95c] // 0x00641f04 a15c19d000
5 changes: 0 additions & 5 deletions src/c/Game.0480.0054c180-0054c187.c

This file was deleted.

88 changes: 88 additions & 0 deletions src/c/Game.0480.0054c180-0054c2d6.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#include "Game.h"
#include <sys/cdefs.h>

struct GCamera* __fastcall GetCamera__5GGameFv(struct GGame* this) {
return this->camera;
}

void __fastcall StartGame__5GGameFv(struct GGame* this) {
__asm__(
" {disp32} mov eax, dword ptr [data_bytes + 0x33b95c]\n" // 0x0054c190 a15c19d000
" sub esp, 0x10\n" // 0x0054c195 83ec10
" push ebx\n" // 0x0054c198 53
" push esi\n" // 0x0054c199 56
" xor.s ebx, ebx\n" // 0x0054c19a 33db
" mov.s esi, ecx\n" // 0x0054c19c 8bf1
" {disp32} mov dword ptr [eax + 0x00250180], ebx\n" // 0x0054c19e 899880012500
" call _jmp_addr_0x0054f3b0\n" // 0x0054c1a4 e807320000
" cmp eax, 0x01\n" // 0x0054c1a9 83f801
" {disp32} jne _jmp_addr_0x0054c2d0\n" // 0x0054c1ac 0f851e010000
" cmp byte ptr [data_bytes + 0x380ac1], bl\n" // 0x0054c1b2 381dc16ad400
" {disp32} jne _jmp_addr_0x0054c2d0\n" // 0x0054c1b8 0f8512010000
" push edi\n" // 0x0054c1be 57
" call _jmp_addr_0x006419f0\n" // 0x0054c1bf e82c580f00
" {disp32} mov edi, dword ptr [data_bytes + 0x30a6e8]\n" // 0x0054c1c4 8b3de806cd00
" cmp.s edi, ebx\n" // 0x0054c1ca 3bfb
" {disp8} je _jmp_addr_0x0054c1eb\n" // 0x0054c1cc 741d
" {disp32} mov ecx, dword ptr [edi + 0x0000e92c]\n" // 0x0054c1ce 8b8f2ce90000
" {disp8} mov dword ptr [ecx + 0x08], ebx\n" // 0x0054c1d4 895908
" {disp32} mov ecx, dword ptr [edi + 0x0000e928]\n" // 0x0054c1d7 8b8f28e90000
" call _jmp_addr_0x00837d40\n" // 0x0054c1dd e85ebb2e00
" push edi\n" // 0x0054c1e2 57
" call _jmp_addr_0x007aee98\n" // 0x0054c1e3 e8b02c2600
" add esp, 0x04\n" // 0x0054c1e8 83c404
"_jmp_addr_0x0054c1eb: {disp32} mov edi, dword ptr [rdata_bytes + 0x1c4]\n" // 0x0054c1eb 8b3dc4918a00
" {disp32} mov dword ptr [data_bytes + 0x30a6e8], ebx\n" // 0x0054c1f1 891de806cd00
" call edi\n" // 0x0054c1f7 ffd7
" {disp32} fld dword ptr [esi + 0x00205e70]\n" // 0x0054c1f9 d986705e2000
" {disp32} fcomp dword ptr [rdata_bytes + 0x1398]\n" // 0x0054c1ff d81d98a38a00
" {disp32} mov dword ptr [esi + 0x00205e68], eax\n" // 0x0054c205 8986685e2000
" {disp32} mov dword ptr [esi + 0x00205e6c], ebx\n" // 0x0054c20b 899e6c5e2000
" fnstsw ax\n" // 0x0054c211 dfe0
" test ah, 0x40\n" // 0x0054c213 f6c440
" {disp8} jne _jmp_addr_0x0054c269\n" // 0x0054c216 7551
" {disp32} mov edx, dword ptr [esi + 0x00205e70]\n" // 0x0054c218 8b96705e2000
" {disp32} mov dword ptr [esi + 0x00205e74], edx\n" // 0x0054c21e 8996745e2000
" call edi\n" // 0x0054c224 ffd7
" sub eax, dword ptr [esi + 0x00205e68]\n" // 0x0054c226 2b86685e2000
" {disp8} mov dword ptr [esp + 0x0c], eax\n" // 0x0054c22c 8944240c
" {disp32} mov eax, dword ptr [esi + 0x00205e6c]\n" // 0x0054c230 8b866c5e2000
" {disp8} mov dword ptr [esp + 0x10], ebx\n" // 0x0054c236 895c2410
" {disp8} fild qword ptr [esp + 0x0c]\n" // 0x0054c23a df6c240c
" {disp8} mov dword ptr [esp + 0x0c], eax\n" // 0x0054c23e 8944240c
" {disp8} mov dword ptr [esp + 0x10], ebx\n" // 0x0054c242 895c2410
" {disp32} fmul dword ptr [esi + 0x00205e70]\n" // 0x0054c246 d88e705e2000
" {disp8} fiadd dword ptr [esp + 0x0c]\n" // 0x0054c24c da44240c
" call _jmp_addr_0x007a1400\n" // 0x0054c250 e8ab512500
" {disp32} mov dword ptr [esi + 0x00205e6c], eax\n" // 0x0054c255 89866c5e2000
" call edi\n" // 0x0054c25b ffd7
" {disp32} mov dword ptr [esi + 0x00205e68], eax\n" // 0x0054c25d 8986685e2000
" {disp32} mov dword ptr [esi + 0x00205e70], ebx\n" // 0x0054c263 899e705e2000
"_jmp_addr_0x0054c269: {disp32} mov ecx, dword ptr [esi + 0x00205e74]\n" // 0x0054c269 8b8e745e2000
" {disp32} mov dword ptr [esi + 0x00205e70], 0x3727c5ac\n" // 0x0054c26f c786705e2000acc52737
" {disp8} mov dword ptr [esp + 0x0c], ecx\n" // 0x0054c279 894c240c
" call edi\n" // 0x0054c27d ffd7
" {disp32} mov ecx, dword ptr [esi + 0x00205e68]\n" // 0x0054c27f 8b8e685e2000
" {disp32} mov edx, dword ptr [esi + 0x00205e6c]\n" // 0x0054c285 8b966c5e2000
" sub.s eax, ecx\n" // 0x0054c28b 2bc1
" {disp8} mov dword ptr [esp + 0x14], eax\n" // 0x0054c28d 89442414
" {disp8} mov dword ptr [esp + 0x18], ebx\n" // 0x0054c291 895c2418
" {disp8} fild qword ptr [esp + 0x14]\n" // 0x0054c295 df6c2414
" {disp8} mov dword ptr [esp + 0x14], edx\n" // 0x0054c299 89542414
" {disp8} mov dword ptr [esp + 0x18], ebx\n" // 0x0054c29d 895c2418
" {disp32} fmul dword ptr [esi + 0x00205e70]\n" // 0x0054c2a1 d88e705e2000
" {disp8} fiadd dword ptr [esp + 0x14]\n" // 0x0054c2a7 da442414
" call _jmp_addr_0x007a1400\n" // 0x0054c2ab e850512500
" {disp32} mov dword ptr [esi + 0x00205e6c], eax\n" // 0x0054c2b0 89866c5e2000
" call edi\n" // 0x0054c2b6 ffd7
" {disp32} mov dword ptr [esi + 0x00205e68], eax\n" // 0x0054c2b8 8986685e2000
" {disp8} mov eax, dword ptr [esp + 0x0c]\n" // 0x0054c2be 8b44240c
" mov.s ecx, esi\n" // 0x0054c2c2 8bce
" {disp32} mov dword ptr [esi + 0x00205e70], eax\n" // 0x0054c2c4 8986705e2000
" call _jmp_addr_0x0054cf20\n" // 0x0054c2ca e8510c0000
" pop edi\n" // 0x0054c2cf 5f
"_jmp_addr_0x0054c2d0: pop esi\n" // 0x0054c2d0 5e
" pop ebx\n" // 0x0054c2d1 5b
" add esp, 0x10\n" // 0x0054c2d2 83c410
);
}

0 comments on commit bbc1457

Please sign in to comment.