mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
naomi: Add jvs command 0x32, crazy taxi starts ! [O. Galibert]
This commit is contained in:
parent
8586b98aab
commit
09cbc1ef08
@ -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;
|
||||
|
@ -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);
|
||||
};
|
||||
|
@ -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)
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user