fork/m-overlay
git clone https://git.julia.blue/fork/m-overlay
6dbc289
master
1-- Naruto - Clash of Ninja Revolution 3 (NTSC-U v1.0) 2 3local core =require ( "games.core" ) 4 5local game =core . newGame () 6 7local polling_addresses ={ 80x803BDC00 , 90x803BDC30 , 10} 11 12local controllers ={ 13[ 1 ] =0xC * 0 , 14[ 2 ] =0xC * 1 , 15[ 3 ] =0xC * 2 , 16[ 4 ] =0xC * 3 , 17} 18 19local controller_struct ={ 20[ 0x0 ] ={ type ="short" , name ="controller.%d.buttons.pressed" } , 21[ 0x2 ] ={ type ="sbyte" , name ="controller.%d.joystick.x" } , 22[ 0x3 ] ={ type ="sbyte" , name ="controller.%d.joystick.y" } , 23[ 0x4 ] ={ type ="sbyte" , name ="controller.%d.cstick.x" } , 24[ 0x5 ] ={ type ="sbyte" , name ="controller.%d.cstick.y" } , 25[ 0x6 ] ={ type ="byte" , name ="controller.%d.analog.l" } , 26[ 0x7 ] ={ type ="byte" , name ="controller.%d.analog.r" } , 27[ 0xA ] ={ type ="byte" , name ="controller.%d.plugged" } , 28} 29 30for _ , polling_addr in ipairs ( polling_addresses ) do 31-- For every polling address.. 32for port , controller_addr in ipairs ( controllers ) do 33-- For every controller 34for offset , info in pairs ( controller_struct ) do 35game . memorymap [ polling_addr + controller_addr + offset ] ={ 36type =info . type , 37debug =info . debug , 38name =info . name : format ( port ), 39} 40end 41end 42end 43 44function game . translateJoyStick ( x , y ) 45x =x / 100 46y =y / 100 47return x , y 48end 49 50game . translateCStick =game . translateJoyStick 51 52return game