fork/m-overlay
git clone https://git.julia.blue/fork/m-overlay
0b8a1a7
settings-overhaul
1-- Mario Kart Wii (NTSC-U, v1.0) (Issue #17) 2 3-- Code based on RSBE01-2.lua 4 5local core =require ( "games.core" ) 6 7local game ={ 8memorymap ={} 9} 10 11local ptr_addr =0x809B8F4C --> addr + 0x08 -> addr + 0x0A -> the controller structs 12local ctrl_offset =0xB0 13 14local controllers ={ -- TODO: fix port issues 15ctrl_offset * 0 , 16ctrl_offset * 1 , 17ctrl_offset * 2 , 18ctrl_offset * 3 , 19} 20 21local controller_struct ={ 22[ 0x00 ] ={ type ="short" , name ="%d.buttons.pressed" } , 23[ 0x02 ] ={ type ="float" , name ="%d.joystick.x" } , 24[ 0x06 ] ={ type ="float" , name ="%d.joystick.y" } , 25[ 0x96 ] ={ type ="float" , name ="%d.cstick.x" } , 26[ 0x9A ] ={ type ="float" , name ="%d.cstick.y" } , 27[ 0x8C ] ={ type ="byte" , name ="%d.analog.l" } , 28[ 0x8D ] ={ type ="byte" , name ="%d.analog.r" } , 29[ 0x90 ] ={ type ="byte" , name ="%d.plugged" } , 30} 31 32game . memorymap [ ptr_addr ] ={ 33type ="pointer" ; 34name ="controller" ; 35struct ={ 36[ 0x08 ] ={ 37type ="pointer" ; 38struct ={} 39} 40} 41} 42 43local ptr_offset =0x0A 44local controller_ptr =game . memorymap [ ptr_addr ]. struct [ 0x08 ]. struct 45 46for port , address in ipairs ( controllers ) do 47for offset , info in pairs ( controller_struct ) do 48controller_ptr [ ptr_offset + address + offset ] ={ 49type =info . type ; 50debug =info . debug ; 51name =info . name : format ( port ); 52} 53end 54end 55 56game . translateAxis =function ( x , y ) return x , y end 57game . translateTriggers =core . translateTriggers 58 59return game