fork/m-overlay
git clone https://git.julia.blue/fork/m-overlay
7277dd1
master
1-- Mario Party 6 (NTSC v1.0) 2 3-- strange fact about this game: it straight up doesn't use the d-pad 4 5local core =require ( "games.core" ) 6 7local game =core . newGame () 8 9local addr =0x802BFFD0 10 11local controllers ={ 12[ 1 ] =addr , 13[ 2 ] =addr + 1 , 14[ 3 ] =addr + 2 , 15[ 4 ] =addr + 3 , 16} 17 18local controller_struct ={ 19-- [0x00] = { type = "short", name = "controller.%d.buttons.pressed" }, 20[ 44 ] ={ type ="sbyte" , name ="controller.%d.joystick.x" } , 21[ 40 ] ={ type ="sbyte" , name ="controller.%d.joystick.y" } , 22[ 36 ] ={ type ="sbyte" , name ="controller.%d.cstick.x" } , 23[ 32 ] ={ type ="sbyte" , name ="controller.%d.cstick.y" } , 24[ 28 ] ={ type ="byte" , name ="controller.%d.analog.l" } , 25[ 24 ] ={ type ="byte" , name ="controller.%d.analog.r" } , 26[ 8 ] ={ type ="u8" , name ="controller.%d.plugged" } , -- similar to melee, where plugging in a controller sets a byte to 00 and unplugging does nothing 27} 28 29for port in ipairs ( controllers ) do 30game . memorymap [ controllers [ 1 ] + ( port - 1 ) * 2 ] ={ 31type ="short" , 32name =( "controller.%d.buttons.pressed" ): format ( port ), 33} 34end 35 36for port , address in ipairs ( controllers ) do 37for offset , info in pairs ( controller_struct ) do 38game . memorymap [ address + offset ] ={ 39type =info . type , 40debug =info . debug , 41name =info . name : format ( port ), 42} 43end 44end 45 46function game . translateJoyStick ( x , y ) 47x =x / 56 48y =y / 56 49return x , y 50end 51 52function game . translateCStick ( x , y ) 53x =x / 44 54y =y / 44 55return x , y 56end 57 58return game