mirror of
https://github.com/holub/mame
synced 2025-06-06 04:43:45 +03:00
(nw) misc cleanup:
* get rid of most assert_always * get rid of a few MCFG_*_OVERRIDE
This commit is contained in:
parent
cc25024f79
commit
dac7094f34
@ -544,9 +544,10 @@ inline void drcbe_x64::normalize_commutative(be_parameter &inner, be_parameter &
|
||||
|
||||
inline int32_t drcbe_x64::offset_from_rbp(const void *ptr)
|
||||
{
|
||||
int64_t delta = reinterpret_cast<uint8_t *>(const_cast<void *>(ptr)) - m_rbpvalue;
|
||||
assert_always((int32_t)delta == delta, "offset_from_rbp: delta out of range");
|
||||
return (int32_t)delta;
|
||||
const int64_t delta = reinterpret_cast<const uint8_t *>(ptr) - m_rbpvalue;
|
||||
if (int32_t(delta) != delta)
|
||||
throw emu_fatalerror("drcbe_x64::offset_from_rbp: delta out of range");
|
||||
return int32_t(delta);
|
||||
}
|
||||
|
||||
|
||||
@ -558,7 +559,7 @@ inline int32_t drcbe_x64::offset_from_rbp(const void *ptr)
|
||||
|
||||
inline int drcbe_x64::get_base_register_and_offset(x86code *&dst, void *target, uint8_t reg, int32_t &offset)
|
||||
{
|
||||
int64_t delta = (uint8_t *)target - m_rbpvalue;
|
||||
const int64_t delta = reinterpret_cast<uint8_t *>(target) - m_rbpvalue;
|
||||
if (short_immediate(delta))
|
||||
{
|
||||
offset = delta;
|
||||
@ -567,7 +568,7 @@ inline int drcbe_x64::get_base_register_and_offset(x86code *&dst, void *target,
|
||||
else
|
||||
{
|
||||
offset = 0;
|
||||
emit_mov_r64_imm(dst, reg, (uintptr_t)target); // mov reg,target
|
||||
emit_mov_r64_imm(dst, reg, uintptr_t(target)); // mov reg,target
|
||||
return reg;
|
||||
}
|
||||
}
|
||||
@ -580,12 +581,12 @@ inline int drcbe_x64::get_base_register_and_offset(x86code *&dst, void *target,
|
||||
|
||||
inline void drcbe_x64::emit_smart_call_r64(x86code *&dst, x86code *target, uint8_t reg)
|
||||
{
|
||||
int64_t delta = target - (dst + 5);
|
||||
const int64_t delta = target - (dst + 5);
|
||||
if (short_immediate(delta))
|
||||
emit_call(dst, target); // call target
|
||||
else
|
||||
{
|
||||
emit_mov_r64_imm(dst, reg, (uintptr_t)target); // mov reg,target
|
||||
emit_mov_r64_imm(dst, reg, uintptr_t(target)); // mov reg,target
|
||||
emit_call_r64(dst, reg); // call reg
|
||||
}
|
||||
}
|
||||
@ -598,7 +599,7 @@ inline void drcbe_x64::emit_smart_call_r64(x86code *&dst, x86code *target, uint8
|
||||
|
||||
inline void drcbe_x64::emit_smart_call_m64(x86code *&dst, x86code **target)
|
||||
{
|
||||
int64_t delta = *target - (dst + 5);
|
||||
const int64_t delta = *target - (dst + 5);
|
||||
if (short_immediate(delta))
|
||||
emit_call(dst, *target); // call *target
|
||||
else
|
||||
|
@ -110,35 +110,32 @@ image_init_result diablo_image_device::call_load()
|
||||
image_init_result diablo_image_device::call_create(int create_format, util::option_resolution *create_args)
|
||||
{
|
||||
int err;
|
||||
uint32_t sectorsize, hunksize;
|
||||
uint32_t cylinders, heads, sectors, totalsectors;
|
||||
|
||||
assert_always(create_args != nullptr, "Expected create_args to not be nullptr");
|
||||
cylinders = create_args->lookup_int('C');
|
||||
heads = create_args->lookup_int('H');
|
||||
sectors = create_args->lookup_int('S');
|
||||
sectorsize = create_args->lookup_int('L') * sizeof(uint16_t);
|
||||
hunksize = create_args->lookup_int('K');
|
||||
if (!create_args)
|
||||
throw emu_fatalerror("diablo_image_device::call_create: Expected create_args to not be nullptr");
|
||||
|
||||
totalsectors = cylinders * heads * sectors;
|
||||
const uint32_t cylinders = create_args->lookup_int('C');
|
||||
const uint32_t heads = create_args->lookup_int('H');
|
||||
const uint32_t sectors = create_args->lookup_int('S');
|
||||
const uint32_t sectorsize = create_args->lookup_int('L') * sizeof(uint16_t);
|
||||
const uint32_t hunksize = create_args->lookup_int('K');
|
||||
|
||||
const uint32_t totalsectors = cylinders * heads * sectors;
|
||||
|
||||
/* create the CHD file */
|
||||
chd_codec_type compression[4] = { CHD_CODEC_NONE };
|
||||
err = m_origchd.create(image_core_file(), (uint64_t)totalsectors * (uint64_t)sectorsize, hunksize, sectorsize, compression);
|
||||
if (err != CHDERR_NONE)
|
||||
goto error;
|
||||
return image_init_result::FAIL;
|
||||
|
||||
/* if we created the image and hence, have metadata to set, set the metadata */
|
||||
err = m_origchd.write_metadata(HARD_DISK_METADATA_TAG, 0, string_format(HARD_DISK_METADATA_FORMAT, cylinders, heads, sectors, sectorsize));
|
||||
m_origchd.close();
|
||||
|
||||
if (err != CHDERR_NONE)
|
||||
goto error;
|
||||
return image_init_result::FAIL;
|
||||
|
||||
return internal_load_dsk();
|
||||
|
||||
error:
|
||||
return image_init_result::FAIL;
|
||||
}
|
||||
|
||||
void diablo_image_device::call_unload()
|
||||
|
@ -131,44 +131,39 @@ image_init_result harddisk_image_device::call_load()
|
||||
image_init_result harddisk_image_device::call_create(int create_format, util::option_resolution *create_args)
|
||||
{
|
||||
int err;
|
||||
uint32_t sectorsize, hunksize;
|
||||
uint32_t cylinders, heads, sectors, totalsectors;
|
||||
|
||||
assert_always(create_args != nullptr, "Expected create_args to not be nullptr");
|
||||
cylinders = create_args->lookup_int('C');
|
||||
heads = create_args->lookup_int('H');
|
||||
sectors = create_args->lookup_int('S');
|
||||
sectorsize = create_args->lookup_int('L');
|
||||
hunksize = create_args->lookup_int('K');
|
||||
if (!create_args)
|
||||
throw emu_fatalerror("harddisk_image_device::call_create: Expected create_args to not be nullptr");
|
||||
|
||||
totalsectors = cylinders * heads * sectors;
|
||||
const uint32_t cylinders = create_args->lookup_int('C');
|
||||
const uint32_t heads = create_args->lookup_int('H');
|
||||
const uint32_t sectors = create_args->lookup_int('S');
|
||||
const uint32_t sectorsize = create_args->lookup_int('L');
|
||||
const uint32_t hunksize = create_args->lookup_int('K');
|
||||
|
||||
const uint32_t totalsectors = cylinders * heads * sectors;
|
||||
|
||||
/* create the CHD file */
|
||||
chd_codec_type compression[4] = { CHD_CODEC_NONE };
|
||||
err = m_origchd.create(image_core_file(), (uint64_t)totalsectors * (uint64_t)sectorsize, hunksize, sectorsize, compression);
|
||||
if (err != CHDERR_NONE)
|
||||
goto error;
|
||||
return image_init_result::FAIL;
|
||||
|
||||
/* if we created the image and hence, have metadata to set, set the metadata */
|
||||
err = m_origchd.write_metadata(HARD_DISK_METADATA_TAG, 0, string_format(HARD_DISK_METADATA_FORMAT, cylinders, heads, sectors, sectorsize));
|
||||
m_origchd.close();
|
||||
|
||||
if (err != CHDERR_NONE)
|
||||
goto error;
|
||||
return image_init_result::FAIL;
|
||||
|
||||
return internal_load_hd();
|
||||
|
||||
error:
|
||||
return image_init_result::FAIL;
|
||||
}
|
||||
|
||||
void harddisk_image_device::call_unload()
|
||||
{
|
||||
/* Check if there is an image_unload callback defined */
|
||||
if ( !m_device_image_unload.isnull() )
|
||||
{
|
||||
if (!m_device_image_unload.isnull())
|
||||
m_device_image_unload(*this);
|
||||
}
|
||||
|
||||
if (m_hard_disk_handle != nullptr)
|
||||
{
|
||||
|
@ -510,6 +510,6 @@ void riot6532_device::device_timer(emu_timer &timer, device_timer_id id, int par
|
||||
timer_end();
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in riot6532_device::device_timer");
|
||||
throw emu_fatalerror("Unknown id in riot6532_device::device_timer");
|
||||
}
|
||||
}
|
||||
|
@ -347,9 +347,7 @@ void pia6821_device::set_out_ca2(int data)
|
||||
else
|
||||
{
|
||||
if (m_out_ca2_needs_pulled)
|
||||
{
|
||||
logerror("Warning! No port CA2 write handler. Previous value has been lost!\n");
|
||||
}
|
||||
|
||||
m_out_ca2_needs_pulled = true;
|
||||
}
|
||||
@ -378,9 +376,7 @@ void pia6821_device::set_out_cb2(int data)
|
||||
else
|
||||
{
|
||||
if (m_out_cb2_needs_pulled)
|
||||
{
|
||||
logerror("Warning! No port CB2 write handler. Previous value has been lost!\n");
|
||||
}
|
||||
|
||||
m_out_cb2_needs_pulled = true;
|
||||
}
|
||||
@ -402,16 +398,14 @@ uint8_t pia6821_device::port_a_r()
|
||||
update_interrupts();
|
||||
|
||||
// CA2 is configured as output and in read strobe mode
|
||||
if(c2_output(m_ctl_a) && c2_strobe_mode(m_ctl_a))
|
||||
if (c2_output(m_ctl_a) && c2_strobe_mode(m_ctl_a))
|
||||
{
|
||||
// this will cause a transition low
|
||||
set_out_ca2(false);
|
||||
|
||||
// if the CA2 strobe is cleared by the E, reset it right away
|
||||
if(strobe_e_reset(m_ctl_a))
|
||||
{
|
||||
if (strobe_e_reset(m_ctl_a))
|
||||
set_out_ca2(true);
|
||||
}
|
||||
}
|
||||
|
||||
LOG("PIA port A read = %02X\n", ret);
|
||||
@ -426,7 +420,7 @@ uint8_t pia6821_device::port_a_r()
|
||||
|
||||
uint8_t pia6821_device::ddr_a_r()
|
||||
{
|
||||
uint8_t ret = m_ddr_a;
|
||||
const uint8_t ret = m_ddr_a;
|
||||
|
||||
LOG("PIA DDR A read = %02X\n", ret);
|
||||
|
||||
@ -440,16 +434,14 @@ uint8_t pia6821_device::ddr_a_r()
|
||||
|
||||
uint8_t pia6821_device::port_b_r()
|
||||
{
|
||||
uint8_t ret = get_in_b_value();
|
||||
const uint8_t ret = get_in_b_value();
|
||||
|
||||
// This read will implicitly clear the IRQ B1 flag. If CB2 is in write-strobe
|
||||
// mode with CB1 restore, and a CB1 active transition set the flag,
|
||||
// clearing it will cause CB2 to go high again. Note that this is different
|
||||
// from what happens with port A.
|
||||
if(m_irq_b1 && c2_strobe_mode(m_ctl_b) && strobe_c1_reset(m_ctl_b))
|
||||
{
|
||||
if (m_irq_b1 && c2_strobe_mode(m_ctl_b) && strobe_c1_reset(m_ctl_b))
|
||||
set_out_cb2(true);
|
||||
}
|
||||
|
||||
// IRQ flags implicitly cleared by a read
|
||||
m_irq_b1 = false;
|
||||
@ -468,7 +460,7 @@ uint8_t pia6821_device::port_b_r()
|
||||
|
||||
uint8_t pia6821_device::ddr_b_r()
|
||||
{
|
||||
uint8_t ret = m_ddr_b;
|
||||
const uint8_t ret = m_ddr_b;
|
||||
|
||||
LOG("PIA DDR B read = %02X\n", ret);
|
||||
|
||||
@ -509,15 +501,11 @@ uint8_t pia6821_device::control_a_r()
|
||||
ret = m_ctl_a;
|
||||
|
||||
// set the IRQ flags if we have pending IRQs
|
||||
if(m_irq_a1)
|
||||
{
|
||||
if (m_irq_a1)
|
||||
ret |= PIA_IRQ1;
|
||||
}
|
||||
|
||||
if(m_irq_a2 && c2_input(m_ctl_a))
|
||||
{
|
||||
if (m_irq_a2 && c2_input(m_ctl_a))
|
||||
ret |= PIA_IRQ2;
|
||||
}
|
||||
|
||||
LOG("PIA control A read = %02X\n", ret);
|
||||
|
||||
@ -554,15 +542,11 @@ uint8_t pia6821_device::control_b_r()
|
||||
ret = m_ctl_b;
|
||||
|
||||
// set the IRQ flags if we have pending IRQs
|
||||
if(m_irq_b1)
|
||||
{
|
||||
if (m_irq_b1)
|
||||
ret |= PIA_IRQ1;
|
||||
}
|
||||
|
||||
if(m_irq_b2 && c2_input(m_ctl_b))
|
||||
{
|
||||
if (m_irq_b2 && c2_input(m_ctl_b))
|
||||
ret |= PIA_IRQ2;
|
||||
}
|
||||
|
||||
LOG("PIA control B read = %02X\n", ret);
|
||||
|
||||
@ -580,36 +564,22 @@ uint8_t pia6821_device::read(offs_t offset)
|
||||
|
||||
switch (offset & 0x03)
|
||||
{
|
||||
default: // impossible
|
||||
case 0x00:
|
||||
if (output_selected(m_ctl_a))
|
||||
{
|
||||
ret = port_a_r();
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = ddr_a_r();
|
||||
}
|
||||
break;
|
||||
default: // impossible
|
||||
case 0x00:
|
||||
ret = output_selected(m_ctl_a) ? port_a_r() : ddr_a_r();
|
||||
break;
|
||||
|
||||
case 0x01:
|
||||
ret = control_a_r();
|
||||
break;
|
||||
case 0x01:
|
||||
ret = control_a_r();
|
||||
break;
|
||||
|
||||
case 0x02:
|
||||
if (output_selected(m_ctl_b))
|
||||
{
|
||||
ret = port_b_r();
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = ddr_b_r();
|
||||
}
|
||||
break;
|
||||
case 0x02:
|
||||
ret = output_selected(m_ctl_b) ? port_b_r() : ddr_b_r();
|
||||
break;
|
||||
|
||||
case 0x03:
|
||||
ret = control_b_r();
|
||||
break;
|
||||
case 0x03:
|
||||
ret = control_b_r();
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -624,20 +594,18 @@ uint8_t pia6821_device::read(offs_t offset)
|
||||
void pia6821_device::send_to_out_a_func(const char* message)
|
||||
{
|
||||
// input pins are pulled high
|
||||
uint8_t data = get_out_a_value();
|
||||
const uint8_t data = get_out_a_value();
|
||||
|
||||
LOG("PIA %s = %02X\n", message, data);
|
||||
|
||||
if(!m_out_a_handler.isnull())
|
||||
if (!m_out_a_handler.isnull())
|
||||
{
|
||||
m_out_a_handler((offs_t) 0, data);
|
||||
m_out_a_handler(offs_t(0), data);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_out_a_needs_pulled)
|
||||
{
|
||||
if (m_out_a_needs_pulled)
|
||||
logerror("Warning! No port A write handler. Previous value has been lost!\n");
|
||||
}
|
||||
|
||||
m_out_a_needs_pulled = true;
|
||||
}
|
||||
@ -651,20 +619,18 @@ void pia6821_device::send_to_out_a_func(const char* message)
|
||||
void pia6821_device::send_to_out_b_func(const char* message)
|
||||
{
|
||||
// input pins are high-impedance - we just send them as zeros for backwards compatibility
|
||||
uint8_t data = get_out_b_value();
|
||||
const uint8_t data = get_out_b_value();
|
||||
|
||||
LOG("PIA %s = %02X\n", message, data);
|
||||
|
||||
if(!m_out_b_handler.isnull())
|
||||
if (!m_out_b_handler.isnull())
|
||||
{
|
||||
m_out_b_handler((offs_t)0, data);
|
||||
m_out_b_handler(offs_t(0), data);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_out_b_needs_pulled)
|
||||
{
|
||||
if (m_out_b_needs_pulled)
|
||||
logerror("Warning! No port B write handler. Previous value has been lost!\n");
|
||||
}
|
||||
|
||||
m_out_b_needs_pulled = true;
|
||||
}
|
||||
@ -690,20 +656,9 @@ void pia6821_device::port_a_w(uint8_t data)
|
||||
|
||||
void pia6821_device::ddr_a_w(uint8_t data)
|
||||
{
|
||||
if(data == 0x00)
|
||||
{
|
||||
LOGSETUP("PIA DDR A write = %02X (input mode)\n", data);
|
||||
}
|
||||
else if(data == 0xff)
|
||||
{
|
||||
LOGSETUP("PIA DDR A write = %02X (output mode)\n", data);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGSETUP("PIA DDR A write = %02X (mixed mode)\n", data);
|
||||
}
|
||||
LOGSETUP("PIA DDR A write = %02X (%s mode)\n", data, (0x00 == data) ? "input" : (0xff == data) ? "output" : "mixed");
|
||||
|
||||
if(m_ddr_a != data)
|
||||
if (m_ddr_a != data)
|
||||
{
|
||||
// DDR changed, call the callback again
|
||||
m_ddr_a = data;
|
||||
@ -725,16 +680,14 @@ void pia6821_device::port_b_w(uint8_t data)
|
||||
send_to_out_b_func("port B write");
|
||||
|
||||
// CB2 in write strobe mode
|
||||
if(c2_strobe_mode(m_ctl_b))
|
||||
if (c2_strobe_mode(m_ctl_b))
|
||||
{
|
||||
// this will cause a transition low
|
||||
set_out_cb2(false);
|
||||
|
||||
// if the CB2 strobe is cleared by the E, reset it right away
|
||||
if(strobe_e_reset(m_ctl_b))
|
||||
{
|
||||
if (strobe_e_reset(m_ctl_b))
|
||||
set_out_cb2(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -745,20 +698,9 @@ void pia6821_device::port_b_w(uint8_t data)
|
||||
|
||||
void pia6821_device::ddr_b_w(uint8_t data)
|
||||
{
|
||||
if (data == 0x00)
|
||||
{
|
||||
LOGSETUP("PIA DDR B write = %02X (input mode)\n", data);
|
||||
}
|
||||
else if (data == 0xff)
|
||||
{
|
||||
LOGSETUP("PIA DDR B write = %02X (output mode)\n", data);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGSETUP("PIA DDR B write = %02X (mixed mode)\n", data);
|
||||
}
|
||||
LOGSETUP("PIA DDR B write = %02X (%s mode)\n", data, (0x00 == data) ? "input" : (0xff == data) ? "output" : "mixed");
|
||||
|
||||
if(m_ddr_b != data)
|
||||
if (m_ddr_b != data)
|
||||
{
|
||||
// DDR changed, call the callback again
|
||||
m_ddr_b = data;
|
||||
@ -783,20 +725,13 @@ void pia6821_device::control_a_w(uint8_t data)
|
||||
m_ctl_a = data;
|
||||
|
||||
// CA2 is configured as output
|
||||
if(c2_output(m_ctl_a))
|
||||
if (c2_output(m_ctl_a))
|
||||
{
|
||||
bool temp;
|
||||
|
||||
if(c2_set_mode(m_ctl_a))
|
||||
{
|
||||
// set/reset mode - bit value determines the new output
|
||||
temp = c2_set(m_ctl_a);
|
||||
}
|
||||
if (c2_set_mode(m_ctl_a))
|
||||
temp = c2_set(m_ctl_a); // set/reset mode - bit value determines the new output
|
||||
else
|
||||
{
|
||||
// strobe mode - output is always high unless strobed
|
||||
temp = true;
|
||||
}
|
||||
temp = true; // strobe mode - output is always high unless strobed
|
||||
|
||||
set_out_ca2(temp);
|
||||
}
|
||||
@ -812,8 +747,6 @@ void pia6821_device::control_a_w(uint8_t data)
|
||||
|
||||
void pia6821_device::control_b_w(uint8_t data)
|
||||
{
|
||||
bool temp;
|
||||
|
||||
// bit 7 and 6 are read only
|
||||
data &= 0x3f;
|
||||
|
||||
@ -822,16 +755,11 @@ void pia6821_device::control_b_w(uint8_t data)
|
||||
// update the control register
|
||||
m_ctl_b = data;
|
||||
|
||||
bool temp;
|
||||
if (c2_set_mode(m_ctl_b))
|
||||
{
|
||||
// set/reset mode - bit value determines the new output
|
||||
temp = c2_set(m_ctl_b);
|
||||
}
|
||||
temp = c2_set(m_ctl_b); // set/reset mode - bit value determines the new output
|
||||
else
|
||||
{
|
||||
// strobe mode - output is always high unless strobed
|
||||
temp = true;
|
||||
}
|
||||
temp = true; // strobe mode - output is always high unless strobed
|
||||
|
||||
set_out_cb2(temp);
|
||||
|
||||
@ -848,36 +776,28 @@ void pia6821_device::write(offs_t offset, uint8_t data)
|
||||
{
|
||||
switch (offset & 0x03)
|
||||
{
|
||||
default: // impossible
|
||||
case 0x00:
|
||||
if (output_selected(m_ctl_a))
|
||||
{
|
||||
port_a_w(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
ddr_a_w(data);
|
||||
}
|
||||
break;
|
||||
default: // impossible
|
||||
case 0x00:
|
||||
if (output_selected(m_ctl_a))
|
||||
port_a_w(data);
|
||||
else
|
||||
ddr_a_w(data);
|
||||
break;
|
||||
|
||||
case 0x01:
|
||||
control_a_w( data);
|
||||
break;
|
||||
case 0x01:
|
||||
control_a_w( data);
|
||||
break;
|
||||
|
||||
case 0x02:
|
||||
if(output_selected(m_ctl_b))
|
||||
{
|
||||
port_b_w(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
ddr_b_w(data);
|
||||
}
|
||||
break;
|
||||
case 0x02:
|
||||
if (output_selected(m_ctl_b))
|
||||
port_b_w(data);
|
||||
else
|
||||
ddr_b_w(data);
|
||||
break;
|
||||
|
||||
case 0x03:
|
||||
control_b_w(data);
|
||||
break;
|
||||
case 0x03:
|
||||
control_b_w(data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -888,7 +808,8 @@ void pia6821_device::write(offs_t offset, uint8_t data)
|
||||
|
||||
void pia6821_device::set_a_input(uint8_t data)
|
||||
{
|
||||
assert_always(m_in_a_handler.isnull(), "pia6821_device::set_a_input() called when m_in_a_handler set");
|
||||
if (!m_in_a_handler.isnull())
|
||||
throw emu_fatalerror("pia6821_device::set_a_input() called when m_in_a_handler set");
|
||||
|
||||
LOG("Set PIA input port A = %02X\n", data);
|
||||
|
||||
@ -913,7 +834,7 @@ void pia6821_device::write_porta(uint8_t data)
|
||||
|
||||
void pia6821_device::write_porta_line(int line, bool state)
|
||||
{
|
||||
uint8_t mask = 1 << line;
|
||||
const uint8_t mask = 1 << line;
|
||||
if (state)
|
||||
set_a_input(m_in_a | mask);
|
||||
else
|
||||
@ -942,7 +863,7 @@ WRITE_LINE_MEMBER( pia6821_device::ca1_w )
|
||||
LOGCA1("Set PIA input CA1 = %d\n", state);
|
||||
|
||||
// the new state has caused a transition
|
||||
if((m_in_ca1 != state) && ((state && c1_low_to_high(m_ctl_a)) || (!state && c1_high_to_low(m_ctl_a))))
|
||||
if ((m_in_ca1 != state) && ((state && c1_low_to_high(m_ctl_a)) || (!state && c1_high_to_low(m_ctl_a))))
|
||||
{
|
||||
LOGCA1("CA1 triggering\n");
|
||||
|
||||
@ -953,10 +874,8 @@ WRITE_LINE_MEMBER( pia6821_device::ca1_w )
|
||||
update_interrupts();
|
||||
|
||||
// CA2 is configured as output and in read strobe mode and cleared by a CA1 transition
|
||||
if(c2_output(m_ctl_a) && c2_strobe_mode(m_ctl_a) && strobe_c1_reset(m_ctl_a))
|
||||
{
|
||||
if (c2_output(m_ctl_a) && c2_strobe_mode(m_ctl_a) && strobe_c1_reset(m_ctl_a))
|
||||
set_out_ca2(true);
|
||||
}
|
||||
}
|
||||
|
||||
// set the new value for CA1
|
||||
@ -974,7 +893,7 @@ WRITE_LINE_MEMBER( pia6821_device::ca2_w )
|
||||
LOG("Set PIA input CA2 = %d\n", state);
|
||||
|
||||
// if input mode and the new state has caused a transition
|
||||
if(c2_input(m_ctl_a) && (m_in_ca2 != state) && ((state && c2_low_to_high(m_ctl_a)) || (!state && c2_high_to_low(m_ctl_a))))
|
||||
if (c2_input(m_ctl_a) && (m_in_ca2 != state) && ((state && c2_low_to_high(m_ctl_a)) || (!state && c2_high_to_low(m_ctl_a))))
|
||||
{
|
||||
LOG("CA2 triggering\n");
|
||||
|
||||
@ -1012,8 +931,7 @@ bool pia6821_device::ca2_output_z()
|
||||
{
|
||||
m_out_ca2_needs_pulled = false;
|
||||
|
||||
// If it's an output, output the bit, if it's an input, it's
|
||||
// pulled up
|
||||
// If it's an output, output the bit, if it's an input, it's pulled up
|
||||
return m_out_ca2 | c2_input(m_ctl_a);
|
||||
}
|
||||
|
||||
@ -1024,7 +942,8 @@ bool pia6821_device::ca2_output_z()
|
||||
|
||||
void pia6821_device::write_portb(uint8_t data)
|
||||
{
|
||||
assert_always(m_in_b_handler.isnull(), "pia_set_input_b() called when in_b_func implemented");
|
||||
if (!m_in_b_handler.isnull())
|
||||
throw emu_fatalerror("pia6821_device::write_portb() called when in_b_func implemented");
|
||||
|
||||
LOG("Set PIA input port B = %02X\n", data);
|
||||
|
||||
@ -1039,7 +958,7 @@ void pia6821_device::write_portb(uint8_t data)
|
||||
|
||||
void pia6821_device::write_portb_line(int line, bool state)
|
||||
{
|
||||
uint8_t mask = 1 << line;
|
||||
const uint8_t mask = 1 << line;
|
||||
|
||||
if (state)
|
||||
write_portb(m_in_b | mask);
|
||||
@ -1069,7 +988,7 @@ WRITE_LINE_MEMBER( pia6821_device::cb1_w )
|
||||
LOG("Set PIA input CB1 = %d\n", state);
|
||||
|
||||
// the new state has caused a transition
|
||||
if((m_in_cb1 != state) && ((state && c1_low_to_high(m_ctl_b)) || (!state && c1_high_to_low(m_ctl_b))))
|
||||
if ((m_in_cb1 != state) && ((state && c1_low_to_high(m_ctl_b)) || (!state && c1_high_to_low(m_ctl_b))))
|
||||
{
|
||||
LOG("CB1 triggering\n");
|
||||
|
||||
@ -1145,17 +1064,17 @@ bool pia6821_device::cb2_output_z()
|
||||
// control byte wrappers
|
||||
//-------------------------------------------------
|
||||
|
||||
bool pia6821_device::irq1_enabled(uint8_t c) { return bool((c >> 0) & 0x01); }
|
||||
bool pia6821_device::c1_low_to_high(uint8_t c) { return bool((c >> 1) & 0x01); }
|
||||
bool pia6821_device::c1_high_to_low(uint8_t c) { return !bool((c >> 1) & 0x01); }
|
||||
bool pia6821_device::output_selected(uint8_t c) { return bool((c >> 2) & 0x01); }
|
||||
bool pia6821_device::irq2_enabled(uint8_t c) { return bool((c >> 3) & 0x01); }
|
||||
bool pia6821_device::strobe_e_reset(uint8_t c) { return bool((c >> 3) & 0x01); }
|
||||
bool pia6821_device::strobe_c1_reset(uint8_t c) { return !bool((c >> 3) & 0x01); }
|
||||
bool pia6821_device::c2_set(uint8_t c) { return bool((c >> 3) & 0x01); }
|
||||
bool pia6821_device::c2_low_to_high(uint8_t c) { return bool((c >> 4) & 0x01); }
|
||||
bool pia6821_device::c2_high_to_low(uint8_t c) { return !bool((c >> 4) & 0x01); }
|
||||
bool pia6821_device::c2_set_mode(uint8_t c) { return bool((c >> 4) & 0x01); }
|
||||
bool pia6821_device::c2_strobe_mode(uint8_t c) { return !bool((c >> 4) & 0x01); }
|
||||
bool pia6821_device::c2_output(uint8_t c) { return bool((c >> 5) & 0x01); }
|
||||
bool pia6821_device::c2_input(uint8_t c) { return !bool((c >> 5) & 0x01); }
|
||||
inline bool pia6821_device::irq1_enabled(uint8_t c) { return bool(BIT(c, 0)); }
|
||||
inline bool pia6821_device::c1_low_to_high(uint8_t c) { return bool(BIT(c, 1)); }
|
||||
inline bool pia6821_device::c1_high_to_low(uint8_t c) { return !bool(BIT(c, 1)); }
|
||||
inline bool pia6821_device::output_selected(uint8_t c) { return bool(BIT(c, 2)); }
|
||||
inline bool pia6821_device::irq2_enabled(uint8_t c) { return bool(BIT(c, 3)); }
|
||||
inline bool pia6821_device::strobe_e_reset(uint8_t c) { return bool(BIT(c, 3)); }
|
||||
inline bool pia6821_device::strobe_c1_reset(uint8_t c) { return !bool(BIT(c, 3)); }
|
||||
inline bool pia6821_device::c2_set(uint8_t c) { return bool(BIT(c, 3)); }
|
||||
inline bool pia6821_device::c2_low_to_high(uint8_t c) { return bool(BIT(c, 4)); }
|
||||
inline bool pia6821_device::c2_high_to_low(uint8_t c) { return !bool(BIT(c, 4)); }
|
||||
inline bool pia6821_device::c2_set_mode(uint8_t c) { return bool(BIT(c, 4)); }
|
||||
inline bool pia6821_device::c2_strobe_mode(uint8_t c) { return !bool(BIT(c, 4)); }
|
||||
inline bool pia6821_device::c2_output(uint8_t c) { return bool(BIT(c, 5)); }
|
||||
inline bool pia6821_device::c2_input(uint8_t c) { return !bool(BIT(c, 5)); }
|
||||
|
@ -10,7 +10,9 @@
|
||||
|
||||
#include "emu.h"
|
||||
#include "ds2404.h"
|
||||
#include <time.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <time.h> // FIXME: re-write in terms of device_rtc_interface and remove this
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
@ -34,7 +36,7 @@ ds2404_device::ds2404_device(const machine_config &mconfig, const char *tag, dev
|
||||
m_a2(0),
|
||||
m_state_ptr(0)
|
||||
{
|
||||
memset(m_ram, 0, sizeof(m_ram));
|
||||
std::fill(std::begin(m_ram), std::end(m_ram), 0);
|
||||
}
|
||||
|
||||
|
||||
@ -315,23 +317,17 @@ void ds2404_device::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
switch(id)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
// tick
|
||||
for(auto & elem : m_rtc)
|
||||
for(auto &elem : m_rtc)
|
||||
{
|
||||
elem++;
|
||||
if(elem != 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
assert_always(false, "Unknown id in ds2404_device::device_timer");
|
||||
break;
|
||||
throw emu_fatalerror("Unknown id in ds2404_device::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ void meters_device::device_reset()
|
||||
void meters_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
if (id >= m_number_mtr)
|
||||
assert_always(false, "Unknown id in meters_device::device_timer");
|
||||
throw emu_fatalerror("Unknown id in meters_device::device_timer");
|
||||
|
||||
m_meter_info[param].count++;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ void upd7002_device::device_reset()
|
||||
|
||||
READ_LINE_MEMBER( upd7002_device::eoc_r )
|
||||
{
|
||||
return (m_status>>7)&0x01;
|
||||
return BIT(m_status, 7);
|
||||
}
|
||||
|
||||
|
||||
@ -71,41 +71,42 @@ void upd7002_device::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
{
|
||||
case TIMER_CONVERSION_COMPLETE:
|
||||
{
|
||||
int counter_value = param;
|
||||
if (counter_value==m_conversion_counter)
|
||||
{
|
||||
// this really always does a 12 bit conversion
|
||||
m_data1 = m_digitalvalue>>8;
|
||||
m_data0 = m_digitalvalue&0xf0;
|
||||
int counter_value = param;
|
||||
if (counter_value == m_conversion_counter)
|
||||
{
|
||||
// this really always does a 12 bit conversion
|
||||
m_data1 = m_digitalvalue >> 8;
|
||||
m_data0 = m_digitalvalue & 0xf0;
|
||||
|
||||
// set the status register with top 2 MSB, not busy and conversion complete
|
||||
m_status = (m_status & 0x0f)|((m_data1 & 0xc0)>>2)|0x40;
|
||||
// set the status register with top 2 MSB, not busy and conversion complete
|
||||
m_status = (m_status & 0x0f) | ((m_data1 & 0xc0) >> 2) | 0x40;
|
||||
|
||||
// call the EOC function with EOC from status
|
||||
// eoc_r(0) this has just been set to 0
|
||||
if (!m_eoc_cb.isnull()) m_eoc_cb(0);
|
||||
m_conversion_counter=0;
|
||||
// call the EOC function with EOC from status
|
||||
// eoc_r(0) this has just been set to 0
|
||||
if (!m_eoc_cb.isnull()) m_eoc_cb(0);
|
||||
m_conversion_counter=0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
assert_always(false, "Unknown id in upd7002_device::device_timer");
|
||||
throw emu_fatalerror("Unknown id in upd7002_device::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint8_t upd7002_device::read(offs_t offset)
|
||||
{
|
||||
switch(offset&0x03)
|
||||
switch (offset & 0x03)
|
||||
{
|
||||
case 0:
|
||||
return m_status;
|
||||
case 0:
|
||||
return m_status;
|
||||
|
||||
case 1:
|
||||
return m_data1;
|
||||
case 1:
|
||||
return m_data1;
|
||||
|
||||
case 2: case 3:
|
||||
return m_data0;
|
||||
case 2:
|
||||
case 3:
|
||||
return m_data0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -116,9 +117,9 @@ void upd7002_device::write(offs_t offset, uint8_t data)
|
||||
{
|
||||
/* logerror("write to uPD7002 $%02X = $%02X\n",offset,data); */
|
||||
|
||||
switch(offset&0x03)
|
||||
switch (offset & 0x03)
|
||||
{
|
||||
case 0:
|
||||
case 0:
|
||||
/*
|
||||
Data Latch/AD start
|
||||
D0 and D1 together define which one of the four input channels is selected
|
||||
@ -152,17 +153,20 @@ void upd7002_device::write(offs_t offset, uint8_t data)
|
||||
{
|
||||
// 12 bit conversion takes 10ms
|
||||
timer_set(attotime::from_msec(10), TIMER_CONVERSION_COMPLETE, m_conversion_counter);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
// 8 bit conversion takes 4ms
|
||||
timer_set(attotime::from_msec(4), TIMER_CONVERSION_COMPLETE, m_conversion_counter);
|
||||
}
|
||||
break;
|
||||
|
||||
case 1: case 2:
|
||||
case 1:
|
||||
case 2:
|
||||
/* Nothing */
|
||||
break;
|
||||
|
||||
case 3:
|
||||
case 3:
|
||||
/* Test Mode: Used for inspecting the device, The data input-output terminals assume an input
|
||||
state and are connected to the A/D counter. Therefore, the A/D conversion data
|
||||
read out after this is meaningless.
|
||||
|
@ -91,7 +91,8 @@ void ym2203_device::device_start()
|
||||
/* Initialize FM emurator */
|
||||
int rate = clock()/72; /* ??? */
|
||||
m_chip = ym2203_init(this,clock(),rate,&ym2203_device::static_timer_handler,&ym2203_device::static_irq_handler,&psgintf);
|
||||
assert_always(m_chip != nullptr, "Error creating YM2203 chip");
|
||||
if (!m_chip)
|
||||
throw emu_fatalerror("ym2203_device(%s): Error creating YM2203 chip", tag());
|
||||
}
|
||||
|
||||
void ym2203_device::device_clock_changed()
|
||||
|
@ -97,10 +97,11 @@ void ym2608_device::device_start()
|
||||
|
||||
/* initialize YM2608 */
|
||||
m_chip = ym2608_init(this,clock(),rate,
|
||||
&ym2608_device::static_internal_read_byte,
|
||||
&ym2608_device::static_external_read_byte, &ym2608_device::static_external_write_byte,
|
||||
&ym2608_device::static_timer_handler,&ym2608_device::static_irq_handler,&psgintf);
|
||||
assert_always(m_chip != nullptr, "Error creating YM2608 chip");
|
||||
&ym2608_device::static_internal_read_byte,
|
||||
&ym2608_device::static_external_read_byte, &ym2608_device::static_external_write_byte,
|
||||
&ym2608_device::static_timer_handler,&ym2608_device::static_irq_handler,&psgintf);
|
||||
if (!m_chip)
|
||||
throw emu_fatalerror("ym2608_device(%s): Error creating YM2608 chip", tag());
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
|
@ -117,9 +117,10 @@ void ym2610_device::device_start()
|
||||
|
||||
/**** initialize YM2610 ****/
|
||||
m_chip = ym2610_init(this, clock(), rate,
|
||||
&ym2610_device::static_adpcm_a_read_byte, &ym2610_device::static_adpcm_b_read_byte,
|
||||
&ym2610_device::static_timer_handler, &ym2610_device::static_irq_handler, &psgintf);
|
||||
assert_always(m_chip != nullptr, "Error creating YM2610 chip");
|
||||
&ym2610_device::static_adpcm_a_read_byte, &ym2610_device::static_adpcm_b_read_byte,
|
||||
&ym2610_device::static_timer_handler, &ym2610_device::static_irq_handler, &psgintf);
|
||||
if (!m_chip)
|
||||
throw emu_fatalerror("ym2610_device(%s): Error creating YM2610 chip", tag());
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
|
@ -91,7 +91,8 @@ void ym2612_device::device_start()
|
||||
|
||||
/**** initialize YM2612 ****/
|
||||
m_chip = ym2612_init(this,clock(),rate,&ym2612_device::static_timer_handler,&ym2612_device::static_irq_handler);
|
||||
assert_always(m_chip != nullptr, "Error creating YM2612 chip");
|
||||
if (!m_chip)
|
||||
throw emu_fatalerror("ym2612_device(%s): Error creating YM2612 chip", tag());
|
||||
}
|
||||
|
||||
void ym2612_device::device_clock_changed()
|
||||
|
@ -78,7 +78,8 @@ void ymf262_device::device_start()
|
||||
|
||||
/* stream system initialize */
|
||||
m_chip = ymf262_init(this,clock(),rate);
|
||||
assert_always(m_chip != nullptr, "Error creating YMF262 chip");
|
||||
if (!m_chip)
|
||||
throw emu_fatalerror("ymf262_device(%s): Error creating YMF262 chip", tag());
|
||||
|
||||
m_stream = machine().sound().stream_alloc(*this,0,4,rate);
|
||||
|
||||
|
@ -82,7 +82,8 @@ void ym3526_device::device_start()
|
||||
|
||||
/* stream system initialize */
|
||||
m_chip = ym3526_init(this, clock(), rate);
|
||||
assert_always(m_chip != nullptr, "Error creating YM3526 chip");
|
||||
if (!m_chip)
|
||||
throw emu_fatalerror("ym3526_device(%s): Error creating YM3526 chip", tag());
|
||||
|
||||
calculate_rates();
|
||||
|
||||
|
@ -82,7 +82,8 @@ void ym3812_device::device_start()
|
||||
|
||||
/* stream system initialize */
|
||||
m_chip = ym3812_init(this, clock(), rate);
|
||||
assert_always(m_chip != nullptr, "Error creating YM3812 chip");
|
||||
if (!m_chip)
|
||||
throw emu_fatalerror("ym3812_device(%s): Error creating YM3812 chip", tag());
|
||||
|
||||
calculate_rates();
|
||||
|
||||
|
@ -81,7 +81,8 @@ void y8950_device::device_start()
|
||||
|
||||
/* stream system initialize */
|
||||
m_chip = y8950_init(this,clock(),rate);
|
||||
assert_always(m_chip != nullptr, "Error creating Y8950 chip");
|
||||
if (!m_chip)
|
||||
throw emu_fatalerror("y8950_device(%s): Error creating Y8950 chip", tag());
|
||||
|
||||
/* ADPCM ROM data */
|
||||
y8950_set_delta_t_memory(m_chip, &y8950_device::static_read_byte, &y8950_device::static_write_byte);
|
||||
|
@ -246,13 +246,15 @@ bool discrete_task::process(void)
|
||||
int avail;
|
||||
|
||||
avail = sn->linked_outbuf->ptr - sn->ptr;
|
||||
assert_always(avail >= 0, "task_callback: available samples are negative");
|
||||
if (avail < 0)
|
||||
throw emu_fatalerror("discrete_task::process: available samples are negative");
|
||||
if (avail < samples)
|
||||
samples = avail;
|
||||
}
|
||||
|
||||
m_samples -= samples;
|
||||
assert_always(m_samples >=0, "task_callback: task_samples got negative");
|
||||
if (m_samples < 0)
|
||||
throw emu_fatalerror("discrete_task::process: m_samples got negative");
|
||||
while (samples > 0)
|
||||
{
|
||||
/* step */
|
||||
|
@ -417,7 +417,7 @@ void pokey_device::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
m_IRQST |= (param & 0xff);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in pokey_device::device_timer");
|
||||
throw emu_fatalerror("Unknown id in pokey_device::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,8 @@ void tia_device::device_start()
|
||||
{
|
||||
m_channel = stream_alloc(0, 1, clock());
|
||||
m_chip = tia_sound_init(this, clock(), clock(), 16);
|
||||
assert_always(m_chip != nullptr, "Error creating TIA chip");
|
||||
if (!m_chip)
|
||||
throw emu_fatalerror("tia_device(%s): Error creating TIA chip", tag());
|
||||
}
|
||||
|
||||
|
||||
|
@ -618,7 +618,7 @@ void upd7759_device::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
break;
|
||||
|
||||
default:
|
||||
assert_always(false, "Unknown id in upd7759_device::device_timer");
|
||||
throw emu_fatalerror("Unknown id in upd7759_device::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1346,7 +1346,7 @@ void ymf271_device::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
break;
|
||||
|
||||
default:
|
||||
assert_always(false, "Unknown id in ymf271_device::device_timer");
|
||||
throw emu_fatalerror("Unknown id in ymf271_device::device_timer");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1038,7 +1038,8 @@ void ymf278b_device::device_start()
|
||||
/* stream system initialize */
|
||||
int ymf262_clock = clock() / (19/8.0);
|
||||
m_ymf262 = ymf262_init(this, ymf262_clock, ymf262_clock / 288);
|
||||
assert_always(m_ymf262 != nullptr, "Error creating YMF262 chip");
|
||||
if (!m_ymf262)
|
||||
throw emu_fatalerror("ymf278b_device(%s): Error creating YMF262 chip", tag());
|
||||
|
||||
m_stream_ymf262 = machine().sound().stream_alloc(*this, 0, 4, ymf262_clock / 288);
|
||||
|
||||
|
@ -636,7 +636,7 @@ void ymz280b_device::device_reset()
|
||||
m_ext_mem_address = 0;
|
||||
|
||||
/* clear other voice parameters */
|
||||
for (auto & elem : m_voice)
|
||||
for (auto &elem : m_voice)
|
||||
{
|
||||
struct YMZ280BVoice *voice = &elem;
|
||||
|
||||
@ -653,7 +653,7 @@ void ymz280b_device::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
if (id < 8)
|
||||
update_irq_state_timer_common( id );
|
||||
else
|
||||
assert_always(false, "Unknown id in ymz280b_device::device_timer");
|
||||
throw emu_fatalerror("Unknown id in ymz280b_device::device_timer");
|
||||
}
|
||||
|
||||
|
||||
|
@ -1577,16 +1577,14 @@ READ32_MEMBER(gba_lcd_device::video_r)
|
||||
break;
|
||||
}
|
||||
|
||||
assert_always(offset < ARRAY_LENGTH(reg_names) / 2, "Not enough register names in gba_lcd_device");
|
||||
if (offset >= ARRAY_LENGTH(reg_names) / 2)
|
||||
throw emu_fatalerror("gba_lcd_device::video_r: Not enough register names in gba_lcd_device");
|
||||
|
||||
if (ACCESSING_BITS_0_15)
|
||||
{
|
||||
verboselog(*this, 2, "GBA I/O Read: %s = %04x\n", reg_names[offset * 2], retval & 0x0000ffff);
|
||||
}
|
||||
|
||||
if (ACCESSING_BITS_16_31)
|
||||
{
|
||||
verboselog(*this, 2, "GBA I/O Read: %s = %04x\n", reg_names[offset * 2 + 1], (retval & 0xffff0000) >> 16);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
@ -1595,16 +1593,14 @@ WRITE32_MEMBER(gba_lcd_device::video_w)
|
||||
{
|
||||
COMBINE_DATA(&m_regs[offset]);
|
||||
|
||||
assert_always(offset < ARRAY_LENGTH(reg_names) / 2, "Not enough register names in gba_lcd_device");
|
||||
if (offset >= ARRAY_LENGTH(reg_names) / 2)
|
||||
throw emu_fatalerror("gba_lcd_device::video_w: Not enough register names in gba_lcd_device");
|
||||
|
||||
if (ACCESSING_BITS_0_15)
|
||||
{
|
||||
verboselog(*this, 2, "GBA I/O Write: %s = %04x\n", reg_names[offset * 2], data & 0x0000ffff);
|
||||
}
|
||||
|
||||
if (ACCESSING_BITS_16_31)
|
||||
{
|
||||
verboselog(*this, 2, "GBA I/O Write: %s = %04x\n", reg_names[offset * 2 + 1], (data & 0xffff0000) >> 16);
|
||||
}
|
||||
|
||||
switch (offset)
|
||||
{
|
||||
|
@ -5751,7 +5751,8 @@ voodoo_device::raster_info *voodoo_device::add_rasterizer(voodoo_device *vd, con
|
||||
raster_info *info = &vd->rasterizer[vd->next_rasterizer++];
|
||||
int hash = cinfo->compute_hash();
|
||||
|
||||
assert_always(vd->next_rasterizer <= MAX_RASTERIZERS, "Out of space for new rasterizers!");
|
||||
if (vd->next_rasterizer > MAX_RASTERIZERS)
|
||||
throw emu_fatalerror("voodoo_device::add_rasterizer: Out of space for new rasterizers!");
|
||||
|
||||
/* make a copy of the info */
|
||||
*info = *cinfo;
|
||||
|
@ -625,7 +625,8 @@ bool device_image_interface::support_command_line_image_creation() const
|
||||
|
||||
void device_image_interface::battery_load(void *buffer, int length, int fill)
|
||||
{
|
||||
assert_always(buffer && (length > 0), "Must specify sensical buffer/length");
|
||||
if (!buffer || (length <= 0))
|
||||
throw emu_fatalerror("device_image_interface::battery_load: Must specify sensical buffer/length");
|
||||
|
||||
osd_file::error filerr;
|
||||
int bytes_read = 0;
|
||||
@ -643,7 +644,8 @@ void device_image_interface::battery_load(void *buffer, int length, int fill)
|
||||
|
||||
void device_image_interface::battery_load(void *buffer, int length, void *def_buffer)
|
||||
{
|
||||
assert_always(buffer && (length > 0), "Must specify sensical buffer/length");
|
||||
if (!buffer || (length <= 0))
|
||||
throw emu_fatalerror("device_image_interface::battery_load: Must specify sensical buffer/length");
|
||||
|
||||
osd_file::error filerr;
|
||||
int bytes_read = 0;
|
||||
@ -670,7 +672,8 @@ void device_image_interface::battery_load(void *buffer, int length, void *def_bu
|
||||
|
||||
void device_image_interface::battery_save(const void *buffer, int length)
|
||||
{
|
||||
assert_always(buffer && (length > 0), "Must specify sensical buffer/length");
|
||||
if (!buffer || (length <= 0))
|
||||
throw emu_fatalerror("device_image_interface::battery_save: Must specify sensical buffer/length");
|
||||
|
||||
if (!device().machine().options().nvram_save())
|
||||
return;
|
||||
|
@ -243,7 +243,7 @@ protected:
|
||||
|
||||
void clear_error();
|
||||
|
||||
void check_for_file() const { assert_always(m_file, "Illegal operation on unmounted image"); }
|
||||
void check_for_file() const { if (!m_file) throw emu_fatalerror("%s(%s): Illegal operation on unmounted image", device().shortname(), device().tag()); }
|
||||
|
||||
void setup_working_directory();
|
||||
bool try_change_working_directory(const std::string &subdir);
|
||||
|
@ -345,7 +345,8 @@ void device_palette_interface::allocate_palette(u32 numentries)
|
||||
m_shadow_group = numgroups++;
|
||||
if (palette_hilights_enabled())
|
||||
m_hilight_group = numgroups++;
|
||||
assert_always(numentries * numgroups <= 65536, "Palette has more than 65536 colors.");
|
||||
if (numentries * numgroups > 65536)
|
||||
throw emu_fatalerror("%s(%s): Palette has more than 65536 colors.", device().shortname(), device().tag());
|
||||
|
||||
// allocate a palette object containing all the colors and groups
|
||||
m_palette = palette_t::alloc(numentries, numgroups);
|
||||
|
@ -9,9 +9,10 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "screen.h"
|
||||
#include "tilemap.h"
|
||||
|
||||
#include "screen.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// INLINE FUNCTIONS
|
||||
|
@ -298,11 +298,11 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MAME_EMU_TILEMAP_H
|
||||
#define MAME_EMU_TILEMAP_H
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
|
@ -58,13 +58,13 @@ void geebee_sound_device::device_timer(emu_timer &timer, device_timer_id id, int
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case TIMER_VOLUME_DECAY:
|
||||
if (--m_volume < 0)
|
||||
m_volume = 0;
|
||||
break;
|
||||
case TIMER_VOLUME_DECAY:
|
||||
if (--m_volume < 0)
|
||||
m_volume = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
assert_always(false, "Unknown id in geebee_device::device_timer");
|
||||
default:
|
||||
throw emu_fatalerror("Unknown id in geebee_device::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -240,10 +240,7 @@ inline void snes_sound_device::update_timer_tick(u8 which)
|
||||
void snes_sound_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
if (id != TIMER_TICK_ID)
|
||||
{
|
||||
assert_always(false, "Unknown id in snes_sound_device::device_timer");
|
||||
return;
|
||||
}
|
||||
throw emu_fatalerror("Unknown id in snes_sound_device::device_timer");
|
||||
|
||||
for (int ch = 0; ch < 3; ch++)
|
||||
update_timer_tick(ch);
|
||||
|
@ -225,11 +225,11 @@ void t5182_device::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case SETIRQ_CB:
|
||||
setirq_callback(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in t5182_device::device_timer");
|
||||
case SETIRQ_CB:
|
||||
setirq_callback(ptr, param);
|
||||
break;
|
||||
default:
|
||||
throw emu_fatalerror("Unknown id in t5182_device::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,18 +75,18 @@ void warpwarp_sound_device::device_timer(emu_timer &timer, device_timer_id id, i
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case TIMER_SOUND_VOLUME_DECAY:
|
||||
if (--m_sound_volume < 0)
|
||||
m_sound_volume = 0;
|
||||
break;
|
||||
case TIMER_SOUND_VOLUME_DECAY:
|
||||
if (--m_sound_volume < 0)
|
||||
m_sound_volume = 0;
|
||||
break;
|
||||
|
||||
case TIMER_MUSIC_VOLUME_DECAY:
|
||||
if (--m_music_volume < 0)
|
||||
m_music_volume = 0;
|
||||
break;
|
||||
case TIMER_MUSIC_VOLUME_DECAY:
|
||||
if (--m_music_volume < 0)
|
||||
m_music_volume = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
assert_always(false, "Unknown id in warpwarp_sound_device::device_timer");
|
||||
default:
|
||||
throw emu_fatalerror("Unknown id in warpwarp_sound_device::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ void _2mindril_state::device_timer(emu_timer &timer, device_timer_id id, int par
|
||||
m_defender_sensor = param;
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in _2mindril_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in _2mindril_state::device_timer");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -101,7 +101,7 @@ void acefruit_state::acefruit_update_irq(int vpos)
|
||||
switch( color )
|
||||
{
|
||||
case 0x0c:
|
||||
m_maincpu->set_input_line(0, HOLD_LINE );
|
||||
m_maincpu->set_input_line(0, HOLD_LINE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -116,15 +116,15 @@ void acefruit_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
{
|
||||
case TIMER_ACEFRUIT_REFRESH:
|
||||
|
||||
m_screen->update_partial(vpos );
|
||||
acefruit_update_irq(vpos);
|
||||
m_screen->update_partial(vpos);
|
||||
acefruit_update_irq(vpos);
|
||||
|
||||
vpos = ( ( vpos / 8 ) + 1 ) * 8;
|
||||
vpos = ((vpos / 8) + 1) * 8;
|
||||
|
||||
m_refresh_timer->adjust( m_screen->time_until_pos(vpos) );
|
||||
break;
|
||||
m_refresh_timer->adjust(m_screen->time_until_pos(vpos));
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in acefruit_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in acefruit_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -168,7 +168,7 @@ void amust_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
m_beep->set_state(0);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in amust_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in amust_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -434,7 +434,7 @@ void argo_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
|
||||
membank("boot")->set_entry(0);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in argo_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in argo_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1754,7 +1754,7 @@ void aristmk4_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
switch (id)
|
||||
{
|
||||
case TIMER_POWER_FAIL: power_fail(); break;
|
||||
default: assert_always(false, "Unknown id in aristmk4_state::device_timer");
|
||||
default: throw emu_fatalerror("Unknown id in aristmk4_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ void artmagic_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
update_irq_state();
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in artmagic_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in artmagic_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ void asterix_state::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in asterix_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in asterix_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -262,7 +262,7 @@ void astinvad_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
kamizake_int_gen(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in astinvad_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in astinvad_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -243,7 +243,7 @@ void asuka_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
m_maincpu->set_input_line(5, HOLD_LINE);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in asuka_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in asuka_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ void st_state::device_timer(emu_timer &timer, device_timer_id id, int param, voi
|
||||
blitter_tick();
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in st_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in st_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -302,7 +302,7 @@ void beezer_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
{
|
||||
case TIMER_DAC: dac_update_cb(); break;
|
||||
case TIMER_SCANLINE: scanline_cb(); break;
|
||||
default: assert_always(false, "Unknown id in beezer_state::device_timer");
|
||||
default: throw emu_fatalerror("Unknown id in beezer_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ void boxer_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
periodic_callback(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in boxer_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in boxer_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ void c10_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
|
||||
membank("boot")->set_entry(0);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in c10_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in c10_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ void capbowl_state::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
update(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in capbowl_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in capbowl_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -902,7 +902,7 @@ void cat_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
|
||||
counter_6ms_callback(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in cat_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in cat_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ void cball_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
interrupt_callback(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in cball_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in cball_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -364,7 +364,7 @@ void cidelsa_state::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
m_reset = 1;
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in cidelsa_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in cidelsa_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,9 +27,7 @@ There also are unpopulated locations that might fit a YM3812 and YM3014.
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
#include "tilemap.h"
|
||||
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "machine/i8255.h"
|
||||
#include "machine/nvram.h"
|
||||
@ -37,6 +35,11 @@ There also are unpopulated locations that might fit a YM3812 and YM3014.
|
||||
#include "sound/ay8910.h"
|
||||
#include "video/ramdac.h"
|
||||
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
#include "tilemap.h"
|
||||
|
||||
|
||||
class clpoker_state : public driver_device
|
||||
{
|
||||
public:
|
||||
@ -49,6 +52,12 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void clpoker(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void video_start() override;
|
||||
|
||||
private:
|
||||
DECLARE_WRITE8_MEMBER(output_a_w);
|
||||
DECLARE_WRITE8_MEMBER(output_b_w);
|
||||
DECLARE_WRITE8_MEMBER(output_c_w);
|
||||
@ -58,14 +67,10 @@ public:
|
||||
|
||||
u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
void clpoker(machine_config &config);
|
||||
void io_map(address_map &map);
|
||||
void prg_map(address_map &map);
|
||||
void ramdac_map(address_map &map);
|
||||
protected:
|
||||
virtual void video_start() override;
|
||||
|
||||
private:
|
||||
TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_fg_tile_info);
|
||||
|
||||
|
@ -149,7 +149,7 @@ void dec8_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in dec8_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in dec8_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -854,7 +854,7 @@ void dectalk_state::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
outfifo_read_cb(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in dectalk_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in dectalk_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ void destroyr_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
frame_callback(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in destroyr_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in destroyr_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ void fgoal_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
interrupt_callback(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in fgoal_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in fgoal_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -186,7 +186,7 @@ void flyball_state::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
break;
|
||||
|
||||
default:
|
||||
assert_always(false, "Unknown id in flyball_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in flyball_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,7 @@ void fm7_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
|
||||
fm77av_vsync(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in fm7_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in fm7_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -434,7 +434,7 @@ void fuuki16_state::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
m_raster_interrupt_timer->adjust(m_screen->frame_period());
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in fuuki16_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in fuuki16_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -492,7 +492,7 @@ void fuuki32_state::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
m_raster_interrupt_timer->adjust(m_screen->frame_period());
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in fuuki32_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in fuuki32_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -221,7 +221,7 @@ void gaplus_base_state::device_timer(emu_timer &timer, device_timer_id id, int p
|
||||
namcoio1_run(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in gaplus_base_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in gaplus_base_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -707,7 +707,7 @@ void gottlieb_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
nmi_clear(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in gottlieb_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in gottlieb_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -462,7 +462,7 @@ void gpworld_state::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
m_maincpu->set_input_line(0, CLEAR_LINE);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in gpworld_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in gpworld_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ void gunbustr_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
m_maincpu->set_input_line(5, HOLD_LINE);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in gunbustr_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in gunbustr_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,13 +148,11 @@ void h19_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
|
||||
m_bellactive = false;
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in h19_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in h19_state::device_timer");
|
||||
}
|
||||
|
||||
if (!m_keyclickactive && !m_bellactive)
|
||||
{
|
||||
m_beep->set_state(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -438,7 +438,7 @@ void intv_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
|
||||
intv_btb_fill(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in intv_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in intv_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -692,7 +692,7 @@ void itech8_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
delayed_z80_control_w(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in itech8_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in itech8_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,6 +114,8 @@
|
||||
#include "jclub2o.lh"
|
||||
#include "jclub2.lh"
|
||||
|
||||
namespace {
|
||||
|
||||
// Common between all hardware (jclub2o, jclub2 and darkhors)
|
||||
class common_state : public driver_device
|
||||
{
|
||||
@ -235,6 +237,14 @@ public:
|
||||
m_gfxdecode(*this, "gfxdecode")
|
||||
{ }
|
||||
|
||||
void init_darkhors();
|
||||
|
||||
void darkhors(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void video_start() override;
|
||||
|
||||
private:
|
||||
DECLARE_WRITE32_MEMBER(input_sel_w);
|
||||
DECLARE_READ32_MEMBER(input_r);
|
||||
DECLARE_WRITE32_MEMBER(out1_w);
|
||||
@ -248,12 +258,8 @@ public:
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
void init_darkhors();
|
||||
DECLARE_VIDEO_START(darkhors);
|
||||
|
||||
void darkhors(machine_config &config);
|
||||
void darkhors_map(address_map &map);
|
||||
private:
|
||||
|
||||
required_shared_ptr<uint32_t> m_tmapram;
|
||||
required_shared_ptr<uint32_t> m_tmapscroll;
|
||||
required_shared_ptr<uint32_t> m_tmapram2;
|
||||
@ -391,8 +397,10 @@ void darkhors_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
|
||||
}
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(darkhors_state,darkhors)
|
||||
void darkhors_state::video_start()
|
||||
{
|
||||
common_state::video_start();
|
||||
|
||||
m_tmap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(darkhors_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS,16,16, 0x40,0x40);
|
||||
m_tmap2= &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(darkhors_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS,16,16, 0x40,0x40);
|
||||
m_tmap->set_transparent_pen(0);
|
||||
@ -1232,7 +1240,6 @@ void darkhors_state::darkhors(machine_config &config)
|
||||
PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 0x10000);
|
||||
|
||||
GFXDECODE(config, m_gfxdecode, m_palette, gfx_darkhors);
|
||||
MCFG_VIDEO_START_OVERRIDE(darkhors_state, darkhors)
|
||||
|
||||
// layout
|
||||
config.set_default_layout(layout_jclub2);
|
||||
@ -1531,6 +1538,8 @@ void darkhors_state::init_darkhors()
|
||||
}
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
// Older hardware (ST-0020 + ST-0016)
|
||||
GAME( 1994, jclub2v100, jclub2v112, jclub2o, jclub2v100, jclub2o_state, init_jclub2o, ROT0, "Seta", "Jockey Club II (v1.00, older hardware)", MACHINE_IMPERFECT_GRAPHICS )
|
||||
|
@ -354,7 +354,7 @@ void kinst_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
m_maincpu->set_input_line(0, CLEAR_LINE);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in kinst_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in kinst_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -457,7 +457,7 @@ void laserbat_state_base::device_timer(emu_timer &timer, device_timer_id id, int
|
||||
video_line(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in laserbat_state_base::device_timer");
|
||||
throw emu_fatalerror("Unknown id in laserbat_state_base::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -488,7 +488,7 @@ void m10_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
|
||||
interrupt_callback(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in m10_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in m10_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ void mekd2_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in mekd2_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in mekd2_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ void metro_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
update_irq_state();
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in metro_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in metro_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ void mgolf_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
interrupt_callback(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in mgolf_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in mgolf_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -212,7 +212,7 @@ void mjsister_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
dac_callback(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in mjsister_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in mjsister_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -425,12 +425,12 @@ void mlanding_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case TIMER_DMA_COMPLETE:
|
||||
m_dma_busy = 0;
|
||||
break;
|
||||
case TIMER_DMA_COMPLETE:
|
||||
m_dma_busy = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
assert_always(false, "Unknown id in mlanding_state::device_timer");
|
||||
default:
|
||||
throw emu_fatalerror("Unknown id in mlanding_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -271,7 +271,7 @@ void nightmare_state::device_timer(emu_timer &timer, device_timer_id id, int par
|
||||
m_reset = 1;
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in nightmare_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in nightmare_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -251,7 +251,7 @@ void notetaker_state::device_timer(emu_timer &timer, device_timer_id id, int par
|
||||
timer_fifoclk(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in notetaker_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in notetaker_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -414,7 +414,7 @@ void okean240_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
membank("boot")->set_entry(0);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in okean240_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in okean240_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -918,7 +918,7 @@ void c1p_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
|
||||
m_beeper->set_clock(300);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in sb2m600_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in c1p_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ void parodius_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in parodius_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in parodius_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -404,7 +404,7 @@ void pc88va_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
pc88va_fdc_motor_start_1(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in pc88va_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in pc88va_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ void pcfx_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
|
||||
pad_func(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in pcfx_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in pcfx_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ void pentagon_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
irq_off(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in pentagon_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in pentagon_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ void plan80_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
membank("boot")->set_entry(0);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in plan80_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in plan80_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -250,7 +250,7 @@ void sol20_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
sol20_boot(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in sol20_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in sol20_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -590,7 +590,7 @@ void rabbit_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
m_maincpu->set_input_line(m_bltirqlevel, HOLD_LINE);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in rabbit_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in rabbit_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ void rollerg_state::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in rollerg_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in rollerg_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ void samcoupe_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
sam_video_update_callback(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in samcoupe_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in samcoupe_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -605,7 +605,7 @@ void segaorun_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
}
|
||||
|
||||
default:
|
||||
assert_always(false, "Unknown id in segaorun_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in segaorun_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ void simpsons_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
m_maincpu->set_input_line(KONAMI_FIRQ_LINE, HOLD_LINE);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in simpsons_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in simpsons_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ void slapshot_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
m_maincpu->set_input_line(6, HOLD_LINE);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in slapshot_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in slapshot_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -399,7 +399,7 @@ void socrates_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
clear_irq_cb(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in socrates_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in socrates_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ void spacefb_state::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
interrupt_callback(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in spacefb_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in spacefb_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -689,7 +689,7 @@ void spectrum_state::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
spectrum_UpdateScreenBitmap();
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in spectrum_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in spectrum_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ void sprint4_state::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
nmi_callback(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in sprint4_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in sprint4_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -326,6 +326,11 @@ public:
|
||||
|
||||
void swyft(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
|
||||
private:
|
||||
required_device<m68008_device> m_maincpu;
|
||||
optional_device<centronics_device> m_ctx;
|
||||
@ -344,10 +349,6 @@ private:
|
||||
optional_ioport m_y6;
|
||||
optional_ioport m_y7;*/
|
||||
|
||||
DECLARE_MACHINE_START(swyft);
|
||||
DECLARE_MACHINE_RESET(swyft);
|
||||
DECLARE_VIDEO_START(swyft);
|
||||
|
||||
uint32_t screen_update_swyft(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
DECLARE_READ8_MEMBER(bitlatch_r);
|
||||
@ -577,7 +578,7 @@ void swyft_state::swyft_mem(address_map &map)
|
||||
map(0x0e4000, 0x0e4fff).rw(FUNC(swyft_state::swyft_via1_r), FUNC(swyft_state::swyft_via1_w));
|
||||
}
|
||||
|
||||
MACHINE_START_MEMBER(swyft_state,swyft)
|
||||
void swyft_state::machine_start()
|
||||
{
|
||||
for (auto &via : m_via)
|
||||
{
|
||||
@ -588,11 +589,11 @@ MACHINE_START_MEMBER(swyft_state,swyft)
|
||||
}
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(swyft_state,swyft)
|
||||
void swyft_state::machine_reset()
|
||||
{
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(swyft_state,swyft)
|
||||
void swyft_state::video_start()
|
||||
{
|
||||
}
|
||||
|
||||
@ -757,10 +758,6 @@ void swyft_state::swyft(machine_config &config)
|
||||
M68008(config, m_maincpu, XTAL(15'897'600)/2); //MC68008P8, Y1=15.8976Mhz, clock GUESSED at Y1 / 2
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &swyft_state::swyft_mem);
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(swyft_state,swyft)
|
||||
MCFG_MACHINE_RESET_OVERRIDE(swyft_state,swyft)
|
||||
MCFG_VIDEO_START_OVERRIDE(swyft_state,swyft)
|
||||
|
||||
/* video hardware */
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||
screen.set_raw(15.8976_MHz_XTAL / 2, 500, 0, 320, 265, 0, 242); // total guess
|
||||
|
@ -289,7 +289,7 @@ INPUT_PORTS_END
|
||||
outfifo_read_cb(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in symbolics_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in symbolics_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ void sys2900_state::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
membank("boot")->set_entry(0);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in sys2900_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in sys2900_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -537,7 +537,7 @@ void taitof2_state::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
m_maincpu->set_input_line(6, HOLD_LINE);
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in taitof2_state::device_timer");
|
||||
throw emu_fatalerror("Unknown id in taitof2_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user