naomi: Add jvs command 0x32, crazy taxi starts ! [O. Galibert]

This commit is contained in:
Olivier Galibert 2011-05-03 19:26:59 +00:00
parent 8586b98aab
commit 09cbc1ef08
4 changed files with 26 additions and 1 deletions

View File

@ -73,6 +73,7 @@ void jvs_device::message(UINT8 dest, const UINT8 *send_buffer, UINT32 send_size,
} else if(len == 0) {
// Incorrect parameter
*d++ = 0x02;
break;
} else
s += len;
}
@ -149,6 +150,12 @@ int jvs_device::handle_message(const UINT8 *send_buffer, UINT32 send_size, UINT8
*recv_buffer++ = 0x01;
return analogs(recv_buffer, send_buffer[1]) ? 2 : 0;
case 0x32:
if(send_size < 2 || send_size < 2+send_buffer[1])
return 0;
*recv_buffer++ = 0x01;
return swoutputs(send_buffer[1], send_buffer+2) ? 2+send_buffer[1] : 0;
case 0x38:
if(send_size < 3)
return 0;
@ -205,6 +212,11 @@ bool jvs_device::analogs(UINT8 *&buf, UINT8 count)
return false;
}
bool jvs_device::swoutputs(UINT8 count, const UINT8 *vals)
{
return false;
}
bool jvs_device::swoutputs(UINT8 id, UINT8 val)
{
return false;

View File

@ -20,6 +20,8 @@ public:
bool get_address_set_line();
protected:
UINT32 jvs_outputs;
void handle_output(const char *tag, UINT8 id, UINT8 val);
// device-level overrides
@ -35,6 +37,7 @@ protected:
virtual bool switches(UINT8 *&buf, UINT8 count_players, UINT8 bytes_per_switch);
virtual bool coin_counters(UINT8 *&buf, UINT8 count);
virtual bool analogs(UINT8 *&buf, UINT8 count);
virtual bool swoutputs(UINT8 count, const UINT8 *vals);
virtual bool swoutputs(UINT8 id, UINT8 val);
private:
@ -42,7 +45,6 @@ private:
jvs_device *next_device;
UINT8 jvs_address;
UINT32 jvs_reset_counter;
UINT32 jvs_outputs;
int handle_message(const UINT8 *send_buffer, UINT32 send_size, UINT8 *&recv_buffer);
};

View File

@ -132,6 +132,16 @@ bool sega_837_13551::analogs(UINT8 *&buf, UINT8 count)
return true;
}
bool sega_837_13551::swoutputs(UINT8 count, const UINT8 *vals)
{
if(count > 1)
return false;
jvs_outputs = vals[0] & 0x3f;
logerror("837-13551: output %02x\n", jvs_outputs);
input_port_write_safe(machine(), port_tag[11], jvs_outputs, 0x3f);
return true;
}
bool sega_837_13551::swoutputs(UINT8 id, UINT8 val)
{
if(id > 6)

View File

@ -44,6 +44,7 @@ protected:
virtual bool switches(UINT8 *&buf, UINT8 count_players, UINT8 bytes_per_switch);
virtual bool coin_counters(UINT8 *&buf, UINT8 count);
virtual bool analogs(UINT8 *&buf, UINT8 count);
virtual bool swoutputs(UINT8 count, const UINT8 *vals);
virtual bool swoutputs(UINT8 id, UINT8 val);
private: