fork/m-overlay
git clone https://git.julia.blue/fork/m-overlay
6cea4f9
main
1-- Mario Golf - Toadstool Tour (JP v1.0) 2 3local core =require ( "games.core" ) 4 5local game =core . newGame () 6 7local controllers ={ 8[ 1 ] =0x8026EF60 + 0x38 * 0 , 9[ 2 ] =0x8026EF60 + 0x38 * 1 , 10[ 3 ] =0x8026EF60 + 0x38 * 2 , 11[ 4 ] =0x8026EF60 + 0x38 * 3 , 12} 13 14local controller_struct ={ 15[ 0x00 ] ={ type ="u16" , name ="controller.%d.buttons.pressed" } , 16[ 0x02 ] ={ type ="u16" , name ="controller.%d.buttons.pressed_previous" } , 17[ 0x04 ] ={ type ="u16" , name ="controller.%d.buttons.instant" } , 18[ 0x06 ] ={ type ="u16" , name ="controller.%d.buttons.released" } , 19[ 0x1B ] ={ type ="u8" , name ="controller.%d.analog.byte.l" } , 20[ 0x1C ] ={ type ="u8" , name ="controller.%d.analog.byte.r" } , 21[ 0x1D ] ={ type ="u8" , name ="controller.%d.plugged" } , 22[ 0x20 ] ={ type ="float" , name ="controller.%d.joystick.x" } , 23[ 0x24 ] ={ type ="float" , name ="controller.%d.joystick.y" } , 24[ 0x28 ] ={ type ="float" , name ="controller.%d.cstick.x" } , 25[ 0x2C ] ={ type ="float" , name ="controller.%d.cstick.y" } , 26[ 0x30 ] ={ type ="float" , name ="controller.%d.analog.l" } , 27[ 0x34 ] ={ type ="float" , name ="controller.%d.analog.r" } , 28} 29 30for port , address in ipairs ( controllers ) do 31for offset , info in pairs ( controller_struct ) do 32game . memorymap [ address + offset ] ={ 33type =info . type , 34debug =info . debug , 35name =info . name : format ( port ), 36} 37end 38end 39 40game . translateJoyStick =function ( x , y ) return x , y end 41game . translateCStick =function ( x , y ) return x , y end 42game . translateTriggers =function ( l , r ) return l , r end 43 44return game