static READ16_HANDLER( forgottn_dial_0_r )
{
const int dial_8[8] = { 0,256,512,768,1024,1280,1536,1792 };
int value3 = readinputport(7);
if ((value3&0xf) == 15)
directional = 0;
if ((value3&0xf) == 14)
directional = 0;
if ((value3&0xf) == 10)
directional = 1;
if ((value3&0xf) == 11)
directional = 2;
if ((value3&0xf) == 9)
directional = 3;
if ((value3&0xf) == 13)
directional = 4;
if ((value3&0xf) == 5)
directional = 5;
if ((value3&0xf) == 7)
directional = 6;
if ((value3&0xf) == 6)
directional = 7;
ShootSound = ShootSound + 1;
if (ShootSound >= 120)
{
ShootSound = 120;
directional = 0;
}
// usrintf_showmessage("%i",ShootSound);
return ((dial_8[directional] - dial[0]) >> (8*offset)) & 0xff;
}
static WRITE16_HANDLER( cps1_sound_command_w )
{
if (ACCESSING_LSB)
{
soundlatch_w(0,data & 0xff);
if (data == 47)
{
ShootSound = 0;
}
if ( data == 49)
{
ShootSound = 0;
}
//usrintf_showmessage("%i",data);
}
}
Forgotten worlds example