fork/m-overlay
git clone https://git.julia.blue/fork/m-overlay
7277dd1
v2.1.1a
1-- The Legend of Zelda: Collectors Edition (NTSC-J v1.0) 2 3local core =require ( "games.core" ) 4 5local controllerLocations ={ 6menu =0x80141918 , 7oot =0x80132758 , 8mm =0x80142458 , 9z1 =0x800AD1C0 , 10z2 =0x800ACAA0 , 11} 12 13local game =core . newGame () 14 15game . memorymap ={ 16[ 0x80BD7ECB ] ={ type ="u8" , name ="oot.ucode" } , 17[ 0x80CB4B0B ] ={ type ="u8" , name ="mm.ucode" } , 18[ 0x80081CE4 ] ={ type ="u8" , name ="z1.qfc" } , 19[ 0x80081D44 ] ={ type ="u8" , name ="z2.qfc" } , 20} 21 22for gamename , addr in pairs ( controllerLocations ) do 23local controllers ={ 24[ 1 ] =addr + 0xC * 0 , 25[ 2 ] =addr + 0xC * 1 , 26[ 3 ] =addr + 0xC * 2 , 27[ 4 ] =addr + 0xC * 3 , 28} 29 30local controller_struct ={ 31[ 0x0 ] ={ type ="short" , name ="controller.%s.%d.buttons.pressed" } , 32[ 0x2 ] ={ type ="sbyte" , name ="controller.%s.%d.joystick.x" } , 33[ 0x3 ] ={ type ="sbyte" , name ="controller.%s.%d.joystick.y" } , 34[ 0x4 ] ={ type ="sbyte" , name ="controller.%s.%d.cstick.x" } , 35[ 0x5 ] ={ type ="sbyte" , name ="controller.%s.%d.cstick.y" } , 36[ 0x6 ] ={ type ="byte" , name ="controller.%s.%d.analog.l" } , 37[ 0x7 ] ={ type ="byte" , name ="controller.%s.%d.analog.r" } , 38[ 0xA ] ={ type ="byte" , name ="controller.%s.%d.plugged" } , 39} 40 41for port , address in ipairs ( controllers ) do 42for offset , info in pairs ( controller_struct ) do 43game . memorymap [ address + offset ] ={ 44type =info . type , 45debug =info . debug , 46name =info . name : format ( gamename , port ), 47} 48end 49end 50end 51 52return game