ckosmic / g64

Garry's Mod addon that uses libsm64 to put Mario in the game
112 stars 7 forks source link

Snag porting to Linux Gmod #47

Open paulguy opened 2 years ago

paulguy commented 2 years ago

Not sure if there's any interest in a Linux port, but I've made some efforts with getting this to compile and run in the Linux 64 bit gmod, but I seem to have hit an odd problem that I don't understand as it deals with something more Mario-specific, so I don't really know how to narrow down what the cause could be.

So far, both binaries compile and will load in gmod and I can enter the path to my ROM (same MD5 as is on the README), but it'll crash at a point when spawning the Mario in:

#0  process_display_list (dl=0x162b86d0) at src/gfx_adapter.c:67
#1  0x00007fff08373d89 in gSPDisplayList (pkt=0x20, dl=0x162b86d0) at src/gfx_adapter.c:206
#2  0x00007fff083a5990 in geo_process_master_list_sub (node=0x161627e0) at src/decomp/game/rendering_graph_node.c:184
#3  0x00007fff083a5b2d in geo_process_master_list (node=0x161627e0) at src/decomp/game/rendering_graph_node.c:234
#4  0x00007fff083a7e9c in geo_process_node_and_siblings (firstNode=0x161627e0) at src/decomp/game/rendering_graph_node.c:1001
#5  0x00007fff083a8353 in geo_process_root_hack_single_node (node=0x162b8470) at src/decomp/game/rendering_graph_node.c:1157
#6  0x00007fff08374f03 in sm64_mario_tick (marioId=0, inputs=0x7fffffffcae0, outState=0x7fffffffcb00, outBuffers=0xc16d258)
    at src/libsm64.c:329
#7  0x00007fff0823a1f3 in MarioTick__Imp(GarrysMod::Lua::ILuaBase*) ()
    at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/garrysmod/lua/bin/gmcl_g64_linux64.dll
#8  0x00007fff08239ec9 in MarioTick(lua_State*) ()
    at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/garrysmod/lua/bin/gmcl_g64_linux64.dll
#9  0x00007fff6d269875 in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/lua_shared_client.so
#10 0x00007fff6d25b8b2 in lua_pcall () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/lua_shared_client.so
#11 0x00007fff6d21d19c in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/lua_shared_client.so
#12 0x00007fff6d225665 in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/lua_shared_client.so
#13 0x00007fff6d21df3e in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/lua_shared_client.so
#14 0x00007fff72ccd54a in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/client_client.so
#15 0x00007fff72cb6e07 in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/client_client.so
#16 0x00007fff72b37d14 in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/client_client.so
#17 0x00007fff72aab2ef in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/client_client.so
#18 0x00007fff91f41589 in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/engine_client.so
#19 0x00007fff91f4b011 in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/engine_client.so
#20 0x00007fff91f4b38e in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/engine_client.so
#21 0x00007fff91facc36 in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/engine_client.so
#22 0x00007fff91faa345 in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/engine_client.so
#23 0x00007fff91faa46a in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/engine_client.so
#24 0x00007fff921068d9 in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/engine_client.so
#25 0x00007fff91fab13c in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/engine_client.so
#26 0x00007ffff7a30c09 in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/launcher_client.so
#27 0x00007ffff7a30c09 in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/launcher_client.so
#28 0x00007ffff7a0d644 in  () at /home/paul/.local/share/Steam/steamapps/common/GarrysMod/bin/linux64/launcher_client.so
#29 0x0000000000400a56 in main ()

Anyway, not sure if you're interested in getting this working. If needed I can explain what I had to do to get things to compile and load (it wasn't much, really), this is beyond my understanding though. I looked at the data pointed to by the displaylist and I can see that it seems to be junk. There're no valid graphics commands as far as I can tell until much further down but it just seems to be incidental nonsense values and the parameters to the command are just junk that causes a extremely out of bounds pointer dereference.

EGAMatsu commented 2 years ago

any updates?

paulguy commented 2 years ago

any updates?

Sorry, nothing. I was sick for a while and this was a while ago too and whatever was wrong was well above my head, so I was pretty much stuck anyway.