diff options
118 files changed, 1849 insertions, 869 deletions
diff --git a/hash/gba.xml b/hash/gba.xml index 08d873e1426..e8f9981a092 100644 --- a/hash/gba.xml +++ b/hash/gba.xml @@ -13022,7 +13022,7 @@ <feature name="u1" value="U1 GPIO MASKROM" /> <dataarea name="rom" size="16777216"> <!-- 2nd half (8MB) filled with 0xff, verified on the real cart --> - <rom name="agb-bgop-2.u1" size="16777216" crc="0c3aa538" sha1="3e38901cecad2c8ae3e5d91375af6fa5d7734c19"/> + <rom name="agb-bgop-2.u1" size="16777216" crc="f7cd830c" sha1="c3ab25e65f59c5d80d45b605a2c55ba666362be5"/> </dataarea> </part> </software> diff --git a/hash/saitek_egr.xml b/hash/saitek_egr.xml new file mode 100644 index 00000000000..49c783b4bd3 --- /dev/null +++ b/hash/saitek_egr.xml @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> + +<softwarelist name="saitek_egr" description="Saitek Endgame ROM"> + +<!-- Extension ROM, sold separately, placed in ROM socket through hatch on the back --> +<!-- Used in: Stratos, Turbo King, Corona, Simultano chess computers, Maestro and Analyst modules --> + + <software name="egr"> + <description>Endgame ROM (ver. 1)</description> + <year>1988</year> + <publisher>Saitek</publisher> + <part name="extrom" interface="saitek_egr"> + <dataarea name="rom" size="0x8000"> + <rom name="egr.bin" size="0x8000" crc="1f9800c8" sha1="6147ad3de65b897fa5f6ab06b2f8597403d6e32e" /> + </dataarea> + </part> + </software> + + <software name="egr2" cloneof="egr"> + <description>Endgame ROM (ver. 2)</description> + <year>1988</year> + <publisher>Saitek</publisher> + <part name="extrom" interface="saitek_egr"> + <dataarea name="rom" size="0x8000"> + <rom name="egr2.bin" size="0x8000" crc="9f751516" sha1="c46053b0af55856f2a6871d4aa65b3bd0e7d865f" /> + </dataarea> + </part> + </software> + +</softwarelist> diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 3c17413b24b..846c4053427 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -1686,6 +1686,8 @@ if (BUSES["S100"]~=null) then MAME_DIR .. "src/devices/bus/s100/nsmdsa.h", MAME_DIR .. "src/devices/bus/s100/nsmdsad.cpp", MAME_DIR .. "src/devices/bus/s100/nsmdsad.h", + MAME_DIR .. "src/devices/bus/s100/poly16k.cpp", + MAME_DIR .. "src/devices/bus/s100/poly16k.h", MAME_DIR .. "src/devices/bus/s100/polyfdc.cpp", MAME_DIR .. "src/devices/bus/s100/polyfdc.h", MAME_DIR .. "src/devices/bus/s100/polyvti.cpp", diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index 4430d442e01..aff892df782 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -4376,6 +4376,7 @@ files { createMAMEProjects(_target, _subtarget, "wing") files { + MAME_DIR .. "src/mame/drivers/lucky37.cpp", MAME_DIR .. "src/mame/drivers/lucky74.cpp", MAME_DIR .. "src/mame/includes/lucky74.h", MAME_DIR .. "src/mame/video/lucky74.cpp", diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 8e94821db0b..2a3049e20d1 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -4035,6 +4035,7 @@ files { MAME_DIR .. "src/mame/drivers/rvoice.cpp", MAME_DIR .. "src/mame/drivers/sacstate.cpp", MAME_DIR .. "src/mame/drivers/sartorius.cpp", + MAME_DIR .. "src/mame/drivers/sb8085.cpp", MAME_DIR .. "src/mame/drivers/sbrain.cpp", MAME_DIR .. "src/mame/drivers/seattlecmp.cpp", MAME_DIR .. "src/mame/drivers/sh4robot.cpp", diff --git a/src/devices/bus/s100/poly16k.cpp b/src/devices/bus/s100/poly16k.cpp new file mode 100644 index 00000000000..98861545d39 --- /dev/null +++ b/src/devices/bus/s100/poly16k.cpp @@ -0,0 +1,137 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/********************************************************************** + + PolyMorphic Systems 16K RAM Card + + This is a mostly straightforward S-100 dynamic RAM board using + the Intel 3242 controller to generate refresh timings. The one + slightly unexpected IC on this board is a SN74LS283 adder, which + allows the RAM to be addressed in a contiguous block beginning at + any 4K boundary. + +**********************************************************************/ + +#include "emu.h" +#include "poly16k.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> poly_16k_ram_device + +class poly_16k_ram_device : public device_t, public device_s100_card_interface +{ +public: + // construction/destruction + poly_16k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + // device-specific overrides + virtual ioport_constructor device_input_ports() const override; + virtual void device_start() override; + + // S-100 memory access handlers + virtual u8 s100_smemr_r(offs_t offset) override; + virtual void s100_mwrt_w(offs_t offset, u8 data) override; + + // internal state + std::unique_ptr<u8[]> m_ram; + +private: + // object finder + required_ioport m_dsw; +}; + +DEFINE_DEVICE_TYPE_PRIVATE(S100_POLY_16K, device_s100_card_interface, poly_16k_ram_device, "poly16k", "PolyMorphic Systems 16K RAM Card") + + +//************************************************************************** +// CONFIGURATION SETTINGS +//************************************************************************** + +static INPUT_PORTS_START(poly16k) + PORT_START("DSW") + PORT_DIPNAME(0xf, 0xd, "RAM Space") PORT_DIPLOCATION("SW:1,2,3,4") + PORT_DIPSETTING(0xf, "0000-3FFFH") + PORT_DIPSETTING(0xe, "1000-4FFFH") + PORT_DIPSETTING(0xd, "2000-5FFFH") + PORT_DIPSETTING(0xc, "3000-6FFFH") + PORT_DIPSETTING(0xb, "4000-7FFFH") + PORT_DIPSETTING(0xa, "5000-8FFFH") + PORT_DIPSETTING(0x9, "6000-9FFFH") + PORT_DIPSETTING(0x8, "7000-AFFFH") + PORT_DIPSETTING(0x7, "8000-BFFFH") + PORT_DIPSETTING(0x6, "9000-CFFFH") + PORT_DIPSETTING(0x5, "A000-DFFFH") + PORT_DIPSETTING(0x4, "B000-EFFFH") + PORT_DIPSETTING(0x3, "C000-FFFFH") + PORT_DIPSETTING(0x2, "D000-FFFFH, 0000-0FFFH") + PORT_DIPSETTING(0x1, "E000-FFFFH, 0000-1FFFH") + PORT_DIPSETTING(0x0, "F000-FFFFH, 0000-2FFFH") +INPUT_PORTS_END + + +//************************************************************************** +// DEVICE DEFINITION +//************************************************************************** + +//------------------------------------------------- +// poly_16k_ram_device - constructor +//------------------------------------------------- + +poly_16k_ram_device::poly_16k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, S100_POLY_16K, tag, owner, clock) + , device_s100_card_interface(mconfig, *this) + , m_dsw(*this, "DSW") +{ +} + + +//------------------------------------------------- +// device_input_ports - input port construction +//------------------------------------------------- + +ioport_constructor poly_16k_ram_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(poly16k); +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void poly_16k_ram_device::device_start() +{ + m_ram = make_unique_clear<u8[]>(0x4000); + save_pointer(NAME(m_ram), 0x4000); +} + + +//------------------------------------------------- +// s100_smemr_r - memory read +//------------------------------------------------- + +u8 poly_16k_ram_device::s100_smemr_r(offs_t offset) +{ + u16 addr = offset + (u16(m_dsw->read() + 1) << 12); + if (addr < 0x4000) + return m_ram[addr]; + else + return 0xff; +} + + +//------------------------------------------------- +// s100_mwrt_w - memory write +//------------------------------------------------- + +void poly_16k_ram_device::s100_mwrt_w(offs_t offset, u8 data) +{ + u16 addr = offset + (u16(m_dsw->read() + 1) << 12); + if (addr < 0x4000) + m_ram[addr] = data; +} diff --git a/src/devices/bus/s100/poly16k.h b/src/devices/bus/s100/poly16k.h new file mode 100644 index 00000000000..a69fbf49369 --- /dev/null +++ b/src/devices/bus/s100/poly16k.h @@ -0,0 +1,18 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/********************************************************************** + + PolyMorphic Systems 16K RAM Card + +**********************************************************************/ + +#ifndef MAME_BUS_S100_POLY16K_H +#define MAME_BUS_S100_POLY16K_H + +#pragma once + +#include "bus/s100/s100.h" + +DECLARE_DEVICE_TYPE(S100_POLY_16K, device_s100_card_interface) + +#endif // MAME_BUS_S100_POLY16K_H diff --git a/src/devices/bus/s100/polyvti.cpp b/src/devices/bus/s100/polyvti.cpp index 03ba6a39413..973e89c0693 100644 --- a/src/devices/bus/s100/polyvti.cpp +++ b/src/devices/bus/s100/polyvti.cpp @@ -63,6 +63,8 @@ private: // internal state std::unique_ptr<u8[]> m_video_ram; + bool m_kbd_int; + bool m_kbd_stb; }; DEFINE_DEVICE_TYPE_PRIVATE(S100_POLY_VTI, device_s100_card_interface, poly_vti_device, "polyvti", "PolyMorphic Systems Video Terminal Interface") @@ -78,8 +80,13 @@ poly_vti_device::poly_vti_device(const machine_config &mconfig, const char *tag, void poly_vti_device::device_start() { + m_kbd_int = true; + m_kbd_stb = false; // TODO: 8212 strobe input + m_video_ram = make_unique_clear<u8[]>(0x400); save_pointer(NAME(m_video_ram), 0x400); + save_item(NAME(m_kbd_int)); + save_item(NAME(m_kbd_stb)); } const u8 poly_vti_device::s_mcm6571a_shift[] = @@ -179,7 +186,12 @@ void poly_vti_device::s100_mwrt_w(offs_t offset, u8 data) u8 poly_vti_device::s100_sinp_r(offs_t offset) { if ((offset & 0xfc00) >> 10 == m_address->read()) - return m_kbdlatch->read(machine().dummy_space(), 0); + { + if (BIT(offset, 0)) + return m_kbd_stb << 7 | 0x7e | m_kbd_int; + else + return m_kbdlatch->read(); + } return 0xff; } @@ -190,12 +202,14 @@ void poly_vti_device::kbd_put(u8 data) { if (data==8) data=127; // fix backspace - m_kbdlatch->strobe(machine().dummy_space(), 0, data); + m_kbdlatch->strobe(data); } } WRITE_LINE_MEMBER(poly_vti_device::kbd_int_w) { + m_kbd_int = !state; + // TODO: jumper selectable m_bus->vi2_w(state); } diff --git a/src/devices/machine/i8155.cpp b/src/devices/machine/i8155.cpp index b5027368633..c8cb11f0216 100644 --- a/src/devices/machine/i8155.cpp +++ b/src/devices/machine/i8155.cpp @@ -443,74 +443,91 @@ uint8_t i8155_device::io_r(offs_t offset) return data; } - //------------------------------------------------- -// register_w - register write +// write_command - set port modes and start/stop +// timer //------------------------------------------------- -void i8155_device::register_w(int offset, uint8_t data) +void i8155_device::write_command(uint8_t data) { - switch (offset & 0x07) + uint8_t old_command = std::exchange(m_command, data); + + LOGMASKED(LOG_PORT, "Port A Mode: %s\n", (data & COMMAND_PA) ? "output" : "input"); + LOGMASKED(LOG_PORT, "Port B Mode: %s\n", (data & COMMAND_PB) ? "output" : "input"); + + LOGMASKED(LOG_PORT, "Port A Interrupt: %s\n", (data & COMMAND_IEA) ? "enabled" : "disabled"); + LOGMASKED(LOG_PORT, "Port B Interrupt: %s\n", (data & COMMAND_IEB) ? "enabled" : "disabled"); + + if ((data & COMMAND_PA) && (~old_command & COMMAND_PA)) + m_out_pa_cb((offs_t)0, m_output[PORT_A]); + if ((data & COMMAND_PB) && (~old_command & COMMAND_PB)) + m_out_pb_cb((offs_t)0, m_output[PORT_B]); + + switch (data & COMMAND_PC_MASK) { - case REGISTER_COMMAND: - m_command = data; + case COMMAND_PC_ALT_1: + LOGMASKED(LOG_PORT, "Port C Mode: Alt 1 (PC0-PC5 input)\n"); + break; - LOGMASKED(LOG_PORT, "Port A Mode: %s\n", (data & COMMAND_PA) ? "output" : "input"); - LOGMASKED(LOG_PORT, "Port B Mode: %s\n", (data & COMMAND_PB) ? "output" : "input"); + case COMMAND_PC_ALT_2: + LOGMASKED(LOG_PORT, "Port C Mode: Alt 2 (PC0-PC5 output)\n"); + if ((old_command & COMMAND_PC_MASK) != COMMAND_PC_ALT_2) + m_out_pc_cb((offs_t)0, m_output[PORT_C]); + break; - LOGMASKED(LOG_PORT, "Port A Interrupt: %s\n", (data & COMMAND_IEA) ? "enabled" : "disabled"); - LOGMASKED(LOG_PORT, "Port B Interrupt: %s\n", (data & COMMAND_IEB) ? "enabled" : "disabled"); + case COMMAND_PC_ALT_3: + LOGMASKED(LOG_PORT, "Port C Mode: Alt 3 (PC0-PC2 A handshake, PC3-PC5 output)\n"); + break; - switch (data & COMMAND_PC_MASK) - { - case COMMAND_PC_ALT_1: - LOGMASKED(LOG_PORT, "Port C Mode: Alt 1\n"); - break; + case COMMAND_PC_ALT_4: + LOGMASKED(LOG_PORT, "Port C Mode: Alt 4 (PC0-PC2 A handshake, PC3-PC5 B handshake)\n"); + break; + } - case COMMAND_PC_ALT_2: - LOGMASKED(LOG_PORT, "Port C Mode: Alt 2\n"); - break; + switch (data & COMMAND_TM_MASK) + { + case COMMAND_TM_NOP: + // do not affect counter operation + break; - case COMMAND_PC_ALT_3: - LOGMASKED(LOG_PORT, "Port C Mode: Alt 3\n"); - break; + case COMMAND_TM_STOP: + // NOP if timer has not started, stop counting if the timer is running + LOGMASKED(LOG_PORT, "Timer Command: Stop\n"); + timer_stop_count(); + break; - case COMMAND_PC_ALT_4: - LOGMASKED(LOG_PORT, "Port C Mode: Alt 4\n"); - break; - } + case COMMAND_TM_STOP_AFTER_TC: + // stop immediately after present TC is reached (NOP if timer has not started) + LOGMASKED(LOG_PORT, "Timer Command: Stop after TC\n"); + break; - switch (data & COMMAND_TM_MASK) - { - case COMMAND_TM_NOP: - // do not affect counter operation - break; + case COMMAND_TM_START: + LOGMASKED(LOG_PORT, "Timer Command: Start\n"); - case COMMAND_TM_STOP: - // NOP if timer has not started, stop counting if the timer is running - LOGMASKED(LOG_PORT, "Timer Command: Stop\n"); - timer_stop_count(); - break; - - case COMMAND_TM_STOP_AFTER_TC: - // stop immediately after present TC is reached (NOP if timer has not started) - LOGMASKED(LOG_PORT, "Timer Command: Stop after TC\n"); - break; - - case COMMAND_TM_START: - LOGMASKED(LOG_PORT, "Timer Command: Start\n"); - - if (m_timer->enabled()) - { - // if timer is running, start the new mode and CNT length immediately after present TC is reached - } - else - { - // load mode and CNT length and start immediately after loading (if timer is not running) - timer_reload_count(); - } - break; + if (m_timer->enabled()) + { + // if timer is running, start the new mode and CNT length immediately after present TC is reached } + else + { + // load mode and CNT length and start immediately after loading (if timer is not running) + timer_reload_count(); + } + break; + } +} + + +//------------------------------------------------- +// register_w - register write +//------------------------------------------------- + +void i8155_device::register_w(int offset, uint8_t data) +{ + switch (offset & 0x07) + { + case REGISTER_COMMAND: + write_command(data); break; case REGISTER_PORT_A: diff --git a/src/devices/machine/i8155.h b/src/devices/machine/i8155.h index 2d6e49b2063..a4fe5b2938f 100644 --- a/src/devices/machine/i8155.h +++ b/src/devices/machine/i8155.h @@ -116,6 +116,7 @@ private: inline int get_port_mode(int port); inline uint8_t read_port(int port); inline void write_port(int port, uint8_t data); + void write_command(uint8_t data); void register_w(int offset, uint8_t data); }; diff --git a/src/devices/machine/i8212.cpp b/src/devices/machine/i8212.cpp index c6428fe7c13..c6cf46eafe5 100644 --- a/src/devices/machine/i8212.cpp +++ b/src/devices/machine/i8212.cpp @@ -120,7 +120,7 @@ void i8212_device::device_reset() // read - data latch read //------------------------------------------------- -READ8_MEMBER(i8212_device::read) +uint8_t i8212_device::read() { if (!machine().side_effects_disabled()) { @@ -150,7 +150,7 @@ IRQ_CALLBACK_MEMBER(i8212_device::inta_cb) // write - data latch write //------------------------------------------------- -WRITE8_MEMBER(i8212_device::write) +void i8212_device::write(uint8_t data) { // clear interrupt line m_write_int(CLEAR_LINE); @@ -171,7 +171,7 @@ WRITE8_MEMBER(i8212_device::write) // strobe - data input strobe //------------------------------------------------- -WRITE8_MEMBER(i8212_device::strobe) +void i8212_device::strobe(uint8_t data) { if (get_mode() == mode::INPUT) { diff --git a/src/devices/machine/i8212.h b/src/devices/machine/i8212.h index 5168d98c714..efd84d11813 100644 --- a/src/devices/machine/i8212.h +++ b/src/devices/machine/i8212.h @@ -44,12 +44,12 @@ public: auto md_rd_callback() { return m_read_md.bind(); } // data read handlers - DECLARE_READ8_MEMBER(read); + uint8_t read(); IRQ_CALLBACK_MEMBER(inta_cb); // data write handlers - DECLARE_WRITE8_MEMBER(write); - DECLARE_WRITE8_MEMBER(strobe); + void write(uint8_t data); + void strobe(uint8_t data); // line write handlers DECLARE_WRITE_LINE_MEMBER(stb_w); diff --git a/src/devices/machine/sensorboard.cpp b/src/devices/machine/sensorboard.cpp index 2fd22010ec3..27b118905ea 100644 --- a/src/devices/machine/sensorboard.cpp +++ b/src/devices/machine/sensorboard.cpp @@ -14,7 +14,7 @@ can be made to look completely different with external artwork. This device 'steals' the Shift and Ctrl keys, so don't use them in the driver. But if you must, these inputs can be disabled with set_mod_enable(false). In here, they're used for forcing sensor/piece inputs (a normal click activates -both at the same time). +both at the same time). Also used with board initialization. If you use this device in a slot, or add multiple of them, make sure to override the outputs with output_cb() to avoid collisions. @@ -51,6 +51,7 @@ sensorboard_device::sensorboard_device(const machine_config &mconfig, const char m_custom_spawn_cb(*this), m_custom_output_cb(*this) { + m_nosensors = false; m_magnets = false; m_inductive = false; m_ui_enabled = 3; @@ -186,18 +187,10 @@ void sensorboard_device::device_reset() sensorboard_device &sensorboard_device::set_type(sb_type type) { + m_nosensors = (type == NOSENSORS); m_inductive = (type == INDUCTIVE); m_magnets = (type == MAGNETS) || m_inductive; - if (type == NOSENSORS) - { - set_mod_enable(false); - set_delay(attotime::never); - } - - if (m_inductive) - set_mod_enable(false); - return *this; } @@ -401,7 +394,7 @@ INPUT_CHANGED_MEMBER(sensorboard_device::sensor) if (!newval) return; - if (m_sensorpos != -1 || m_inp_ui->read() & 1) + if (m_sensorpos != -1 || (m_inp_ui->read() & 1 && !m_inductive && !m_nosensors)) return; u8 pos = (u8)(uintptr_t)param; @@ -538,6 +531,27 @@ INPUT_CHANGED_MEMBER(sensorboard_device::ui_init) if (init) m_custom_init_cb(0); + // rotate pieces + if (m_inp_ui->read() & 2) + { + u8 tempstate[0x100]; + for (int y = 0; y < m_height; y++) + for (int x = 0; x < m_width; x++) + tempstate[m_width * (m_height - 1 - y) + (m_width - 1 - x)] = m_curstate[m_width * y + x]; + + memcpy(m_curstate, tempstate, m_height * m_width); + } + + // reset undo + if (m_inp_ui->read() & 1) + { + memcpy(m_history[0], m_curstate, m_height * m_width); + + m_upointer = 0; + m_ufirst = 0; + m_ulast = 0; + } + refresh(); } @@ -687,8 +701,8 @@ static INPUT_PORTS_START( sensorboard ) PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("SS_CHECK", 1<<15, EQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_spawn, 16) PORT_NAME("Spawn Piece 16") PORT_START("UI") - PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1, NOTEQUALS, 0) PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_NAME("Modifier Force Sensor") // hold while clicking to force sensor (ignore piece) - PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1, NOTEQUALS, 0) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_NAME("Modifier Force Piece") // hold while clicking to force piece (ignore sensor) + PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1, NOTEQUALS, 0) PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_NAME("Modifier 2 / Force Sensor") // hold while clicking to force sensor (ignore piece) + PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1, NOTEQUALS, 0) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_NAME("Modifier 1 / Force Piece") // hold while clicking to force piece (ignore sensor) PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sensorboard_device, check_sensor_busy, nullptr) // check if any sensor is busy / pressed (read-only) PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 2, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_hand, 0) PORT_NAME("Remove Piece") PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 2, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_undo, 0) PORT_NAME("Undo Buffer First") diff --git a/src/devices/machine/sensorboard.h b/src/devices/machine/sensorboard.h index 1cdb0a8c327..9eef956b5ab 100644 --- a/src/devices/machine/sensorboard.h +++ b/src/devices/machine/sensorboard.h @@ -92,6 +92,7 @@ private: devcb_read8 m_custom_spawn_cb; devcb_write16 m_custom_output_cb; + bool m_nosensors; bool m_magnets; bool m_inductive; u8 m_width; diff --git a/src/devices/video/imagetek_i4100.cpp b/src/devices/video/imagetek_i4100.cpp index f67278263bc..19bf5e2ee35 100644 --- a/src/devices/video/imagetek_i4100.cpp +++ b/src/devices/video/imagetek_i4100.cpp @@ -1082,7 +1082,7 @@ inline uint8_t imagetek_i4100_device::get_tile_pix( uint16_t code, uint8_t x, ui gfx_element *gfx1 = gfx(big ? 3 : 1); uint32_t tile2 = big ? ((tile & 0xfffff) + ((code & 0xf) << 3)) : ((tile & 0xfffff) + ((code & 0xf) << 1)); - const uint16_t* data; + const uint8_t* data; uint8_t flipxy = (code & 0x6000) >> 13; if (tile2 < gfx1->elements()) @@ -1115,7 +1115,7 @@ inline uint8_t imagetek_i4100_device::get_tile_pix( uint16_t code, uint8_t x, ui gfx_element *gfx1 = gfx(big ? 2 : 0); uint32_t tile2 = big ? ((tile & 0xfffff) + ((code & 0xf) << 2)) : ((tile & 0xfffff) + (code & 0xf)); - const uint16_t* data; + const uint8_t* data; uint8_t flipxy = (code & 0x6000) >> 13; if (tile2 < gfx1->elements()) diff --git a/src/devices/video/stvvdp2.cpp b/src/devices/video/stvvdp2.cpp index 91e0f9f4ba0..91d127499fd 100644 --- a/src/devices/video/stvvdp2.cpp +++ b/src/devices/video/stvvdp2.cpp @@ -2458,7 +2458,7 @@ void saturn_state::stv_vdp2_drawgfxzoom( if( gfx ) { const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); - const uint16_t *source_base = gfx->get_data(code % gfx->elements()); + const uint8_t *source_base = gfx->get_data(code % gfx->elements()); //int sprite_screen_height = (scaley*gfx->height()+0x8000)>>16; //int sprite_screen_width = (scalex*gfx->width()+0x8000)>>16; @@ -2530,7 +2530,7 @@ void saturn_state::stv_vdp2_drawgfxzoom( { for( y=sy; y<ey; y++ ) { - const uint16_t *source = source_base + (y_index>>16) * gfx->rowbytes(); + const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes(); uint32_t *dest = &dest_bmp.pix32(y); int x, x_index = x_index_base; @@ -2552,7 +2552,7 @@ void saturn_state::stv_vdp2_drawgfxzoom( { for( y=sy; y<ey; y++ ) { - const uint16_t *source = source_base + (y_index>>16) * gfx->rowbytes(); + const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes(); uint32_t *dest = &dest_bmp.pix32(y); int x, x_index = x_index_base; @@ -2574,7 +2574,7 @@ void saturn_state::stv_vdp2_drawgfxzoom( { for( y=sy; y<ey; y++ ) { - const uint16_t *source = source_base + (y_index>>16) * gfx->rowbytes(); + const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes(); uint32_t *dest = &dest_bmp.pix32(y); int x, x_index = x_index_base; @@ -3031,7 +3031,7 @@ void saturn_state::stv_vdp2_drawgfx_alpha(bitmap_rgb32 &dest_bmp,const rectangle int transparency, int alpha) { const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); - const uint16_t *source_base = gfx->get_data(code % gfx->elements()); + const uint8_t *source_base = gfx->get_data(code % gfx->elements()); int x_index_base, y_index, sx, sy, ex, ey; int xinc, yinc; @@ -3083,7 +3083,7 @@ void saturn_state::stv_vdp2_drawgfx_alpha(bitmap_rgb32 &dest_bmp,const rectangle { for (y = sy; y < ey; y++) { - const uint16_t *source = source_base + y_index*gfx->rowbytes(); + const uint8_t *source = source_base + y_index*gfx->rowbytes(); uint32_t *dest = &dest_bmp.pix32(y); int x_index = x_index_base; for (x = sx; x < ex; x++) @@ -3108,7 +3108,7 @@ void saturn_state::stv_vdp2_drawgfx_transpen(bitmap_rgb32 &dest_bmp,const rectan int transparency) { const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); - const uint16_t *source_base = gfx->get_data(code % gfx->elements()); + const uint8_t *source_base = gfx->get_data(code % gfx->elements()); int x_index_base, y_index, sx, sy, ex, ey; int xinc, yinc; @@ -3160,7 +3160,7 @@ void saturn_state::stv_vdp2_drawgfx_transpen(bitmap_rgb32 &dest_bmp,const rectan { for (y = sy; y < ey; y++) { - const uint16_t *source = source_base + y_index*gfx->rowbytes(); + const uint8_t *source = source_base + y_index*gfx->rowbytes(); uint32_t *dest = &dest_bmp.pix32(y); int x_index = x_index_base; for (x = sx; x < ex; x++) diff --git a/src/emu/digfx.cpp b/src/emu/digfx.cpp index acc1c5f1176..0055421b80c 100644 --- a/src/emu/digfx.cpp +++ b/src/emu/digfx.cpp @@ -249,33 +249,16 @@ void device_gfx_interface::decode_gfx(const gfx_decode_entry *gfxdecodeinfo) // otherwise, just use the line modulo else { - if (glcopy.planeoffset[1] != GFX_RAW) // 8bpp RAW case + int base = gfx.start; + int end = region_length/8; + int linemod = glcopy.yoffset[0]; + while (glcopy.total > 0) { - int base = gfx.start; - int end = region_length/8; - int linemod = glcopy.yoffset[0]; - while (glcopy.total > 0) - { - int elementbase = base + (glcopy.total - 1) * glcopy.charincrement / 8; - int lastpixelbase = elementbase + glcopy.height * linemod / 8 - 1; - if (lastpixelbase < end) - break; - glcopy.total--; - } - } - else // 16bpp RAW case - { - int base = gfx.start; - int end = region_length/16; - int linemod = glcopy.yoffset[0]; - while (glcopy.total > 0) - { - int elementbase = base + (glcopy.total - 1) * glcopy.charincrement / 16; - int lastpixelbase = elementbase + glcopy.height * linemod / 16 - 1; - if (lastpixelbase < end) - break; - glcopy.total--; - } + int elementbase = base + (glcopy.total - 1) * glcopy.charincrement / 8; + int lastpixelbase = elementbase + glcopy.height * linemod / 8 - 1; + if (lastpixelbase < end) + break; + glcopy.total--; } } diff --git a/src/emu/digfx.h b/src/emu/digfx.h index 1c9ebc2d6c5..b991ff15f12 100644 --- a/src/emu/digfx.h +++ b/src/emu/digfx.h @@ -24,7 +24,7 @@ //************************************************************************** constexpr u8 MAX_GFX_ELEMENTS = 32; -constexpr u16 MAX_GFX_PLANES = 16; +constexpr u16 MAX_GFX_PLANES = 8; // HBMAME - needed by monaco constexpr u16 MAX_GFX_SIZE = 64; @@ -39,9 +39,7 @@ constexpr u16 MAX_GFX_SIZE = 64; #define GFX_RAW 0x12345678 #define GFXLAYOUT_RAW( name, width, height, linemod, charmod ) \ -const gfx_layout name = { width, height, RGN_FRAC(1,1), 8, { GFX_RAW, 0 }, { 0 }, { linemod }, charmod }; -#define GFXLAYOUT_RAW16( name, width, height, linemod, charmod ) \ -const gfx_layout name = { width, height, RGN_FRAC(1,1), 16, { GFX_RAW, GFX_RAW }, { 0 }, { linemod }, charmod }; +const gfx_layout name = { width, height, RGN_FRAC(1,1), 8, { GFX_RAW }, { 0 }, { linemod }, charmod }; // When planeoffset[0] is set to GFX_RAW, the gfx data is left as-is, with no conversion. // No buffer is allocated for the decoded data, and gfxdata is set to point to the source // data. diff --git a/src/emu/drawgfx.cpp b/src/emu/drawgfx.cpp index 5e317deb464..841ae7c670f 100644 --- a/src/emu/drawgfx.cpp +++ b/src/emu/drawgfx.cpp @@ -86,61 +86,53 @@ gfxdecode_device::gfxdecode_device(const machine_config &mconfig, const char *ta // gfx_element - constructor //------------------------------------------------- -gfx_element::gfx_element(device_palette_interface *palette, const u8 *base, u32 total, u16 width, u16 height, u32 rowbytes, u32 total_colors, u32 color_base, u32 color_granularity) - : m_palette(palette) - , m_width(0) - , m_height(0) - , m_startx(0) - , m_starty(0) - , m_origwidth(0) - , m_origheight(0) - , m_total_elements(1) - , m_color_base(0) - , m_color_depth(0) - , m_color_granularity(0) - , m_total_colors(0) - , m_line_modulo(0) - , m_char_modulo(0) - , m_srcdata(nullptr) - , m_dirtyseq(1) - , m_gfxdata(nullptr) - , m_layout_is_raw(true) - , m_layout_is_16bpp(false) - , m_layout_planes(0) - , m_layout_xormask(0) - , m_layout_charincrement(0) -{ - if (!total) total = 1; - // set the layout - set_raw_layout(base, width, height, total, rowbytes*8, width*height*8); - m_color_base = color_base; - m_color_depth = m_color_granularity = color_granularity; - m_total_colors = (total_colors - color_base) / color_granularity; +gfx_element::gfx_element(device_palette_interface *palette, u8 *base, u16 width, u16 height, u32 rowbytes, u32 total_colors, u32 color_base, u32 color_granularity) + : m_palette(palette), + m_width(width), + m_height(height), + m_startx(0), + m_starty(0), + m_origwidth(width), + m_origheight(height), + m_total_elements(1), + m_color_base(color_base), + m_color_depth(color_granularity), + m_color_granularity(color_granularity), + m_total_colors((total_colors - color_base) / color_granularity), + m_line_modulo(rowbytes), + m_char_modulo(0), + m_srcdata(base), + m_dirtyseq(1), + m_gfxdata(base), + m_layout_is_raw(true), + m_layout_planes(0), + m_layout_xormask(0), + m_layout_charincrement(0) +{ } gfx_element::gfx_element(device_palette_interface *palette, const gfx_layout &gl, const u8 *srcdata, u32 xormask, u32 total_colors, u32 color_base) - : m_palette(palette) - , m_width(0) - , m_height(0) - , m_startx(0) - , m_starty(0) - , m_origwidth(0) - , m_origheight(0) - , m_total_elements(0) - , m_color_base(color_base) - , m_color_depth(0) - , m_color_granularity(0) - , m_total_colors(total_colors) - , m_line_modulo(0) - , m_char_modulo(0) - , m_srcdata(nullptr) - , m_dirtyseq(1) - , m_gfxdata(nullptr) - , m_layout_is_raw(false) - , m_layout_is_16bpp(false) - , m_layout_planes(0) - , m_layout_xormask(xormask) - , m_layout_charincrement(0) + : m_palette(palette), + m_width(0), + m_height(0), + m_startx(0), + m_starty(0), + m_origwidth(0), + m_origheight(0), + m_total_elements(0), + m_color_base(color_base), + m_color_depth(0), + m_color_granularity(0), + m_total_colors(total_colors), + m_line_modulo(0), + m_char_modulo(0), + m_srcdata(nullptr), + m_dirtyseq(1), + m_gfxdata(nullptr), + m_layout_is_raw(false), + m_layout_planes(0), + m_layout_xormask(xormask), + m_layout_charincrement(0) { // set the layout set_layout(gl, srcdata); @@ -164,7 +156,6 @@ void gfx_element::set_layout(const gfx_layout &gl, const u8 *srcdata) // copy data from the layout m_layout_is_raw = (gl.planeoffset[0] == GFX_RAW); - m_layout_is_16bpp = (gl.planeoffset[1] == GFX_RAW); m_layout_planes = gl.planes; m_layout_charincrement = gl.charincrement; @@ -175,22 +166,15 @@ void gfx_element::set_layout(const gfx_layout &gl, const u8 *srcdata) m_layout_planeoffset.clear(); m_layout_xoffset.clear(); m_layout_yoffset.clear(); + m_gfxdata_allocated.clear(); // modulos are determined for us by the layout - if (m_layout_is_16bpp) - { - m_line_modulo = gl.yoffs(0) / 16; - m_char_modulo = gl.charincrement / 16; - } - else - { - m_line_modulo = gl.yoffs(0) / 8; - m_char_modulo = gl.charincrement / 8; - } + m_line_modulo = gl.yoffs(0) / 8; + m_char_modulo = gl.charincrement / 8; - // allocate memory for the data - m_gfxdata_allocated.resize(m_total_elements * m_char_modulo); - m_gfxdata = &m_gfxdata_allocated[0]; + // RAW graphics must have a pointer up front + assert(srcdata != nullptr); + m_gfxdata = const_cast<u8 *>(srcdata); } // decoded graphics case @@ -241,26 +225,11 @@ void gfx_element::set_raw_layout(const u8 *srcdata, u32 width, u32 height, u32 t layout.total = total; layout.planes = 8; layout.planeoffset[0] = GFX_RAW; - layout.planeoffset[1] = 0; layout.yoffset[0] = linemod; layout.charincrement = charmod; set_layout(layout, srcdata); } -void gfx_element::set_raw_layout(const u16 *srcdata, u32 width, u32 height, u32 total, u32 linemod, u32 charmod) -{ - gfx_layout layout = { 0 }; - layout.width = width; - layout.height = height; - layout.total = total; - layout.planes = 8; - layout.planeoffset[0] = GFX_RAW; - layout.planeoffset[1] = GFX_RAW; - layout.yoffset[0] = linemod; - layout.charincrement = charmod; - set_layout(layout, (const u8 *)srcdata); -} - //------------------------------------------------- // set_source - set the source data for a gfx_element @@ -270,6 +239,7 @@ void gfx_element::set_source(const u8 *source) { m_srcdata = source; memset(&m_dirty[0], 1, elements()); + if (m_layout_is_raw) m_gfxdata = const_cast<u8 *>(source); } @@ -291,9 +261,16 @@ void gfx_element::set_source_and_total(const u8 *source, u32 total) if (m_color_depth <= 32) m_pen_usage.resize(m_total_elements); - // allocate memory for the data - m_gfxdata_allocated.resize(m_total_elements * m_char_modulo); - m_gfxdata = &m_gfxdata_allocated[0]; + if (m_layout_is_raw) + { + m_gfxdata = const_cast<u8 *>(source); + } + else + { + // allocate memory for the data + m_gfxdata_allocated.resize(m_total_elements * m_char_modulo); + m_gfxdata = &m_gfxdata_allocated[0]; + } } @@ -322,49 +299,10 @@ void gfx_element::set_source_clip(u32 xoffs, u32 width, u32 yoffs, u32 height) void gfx_element::decode(u32 code) { // don't decode GFX_RAW - if (m_layout_is_raw) - { - if (m_layout_is_16bpp) - { - // zap the data to 0 - u16 *decode_base = m_gfxdata + code * m_char_modulo; - const u16 *base = ((const u16 *)m_srcdata) + code * m_char_modulo; - memset(decode_base, 0, m_char_modulo); - - // iterate over rows - for (int y = 0; y < m_origheight; y++) - { - const u16 *sp = base + y * m_line_modulo; - u16 *dp = decode_base + y * m_line_modulo; - - // iterate over columns - for (int x = 0; x < m_origwidth; x++) - dp[x] = sp[x]; - } - } - else - { - // zap the data to 0 - u16 *decode_base = m_gfxdata + code * m_char_modulo; - const u8 *base = m_srcdata + code * m_char_modulo; - memset(decode_base, 0, m_char_modulo); - - // iterate over rows - for (int y = 0; y < m_origheight; y++) - { - const u8 *sp = base + y * m_line_modulo; - u16 *dp = decode_base + y * m_line_modulo; - - // iterate over columns - for (int x = 0; x < m_origwidth; x++) - dp[x] = sp[x]; - } - } - } - else + if (!m_layout_is_raw) { // zap the data to 0 - u16 *decode_base = m_gfxdata + code * m_char_modulo; + u8 *decode_base = m_gfxdata + code * m_char_modulo; memset(decode_base, 0, m_char_modulo); // iterate over planes @@ -379,7 +317,7 @@ void gfx_element::decode(u32 code) for (int y = 0; y < m_origheight; y++) { int yoffs = planeoffs + m_layout_yoffset[y]; - u16 *dp = decode_base + y * m_line_modulo; + u8 *dp = decode_base + y * m_line_modulo; // iterate over columns for (int x = 0; x < m_origwidth; x++) @@ -393,7 +331,7 @@ void gfx_element::decode(u32 code) if (code < m_pen_usage.size()) { // iterate over data, creating a bitmask of live pens - const u16 *dp = m_gfxdata + code * m_char_modulo; + const u8 *dp = m_gfxdata + code * m_char_modulo; u32 usage = 0; for (int y = 0; y < m_origheight; y++) { @@ -450,7 +388,7 @@ void gfx_element::transpen(bitmap_ind16 &dest, const rectangle &cliprect, u32 trans_pen) { // special case invalid pens to opaque - if (trans_pen > 0xffff) + if (trans_pen > 0xff) return opaque(dest, cliprect, code, color, flipx, flipy, destx, desty); // use pen usage to optimize @@ -478,7 +416,7 @@ void gfx_element::transpen(bitmap_rgb32 &dest, const rectangle &cliprect, u32 trans_pen) { // special case invalid pens to opaque - if (trans_pen > 0xffff) + if (trans_pen > 0xff) return opaque(dest, cliprect, code, color, flipx, flipy, destx, desty); // use pen usage to optimize @@ -716,7 +654,7 @@ void gfx_element::zoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, return transpen(dest, cliprect, code, color, flipx, flipy, destx, desty, trans_pen); // special case invalid pens to opaque - if (trans_pen > 0xffff) + if (trans_pen > 0xff) return zoom_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, scalex, scaley); // use pen usage to optimize @@ -748,7 +686,7 @@ void gfx_element::zoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, return transpen(dest, cliprect, code, color, flipx, flipy, destx, desty, trans_pen); // special case invalid pens to opaque - if (trans_pen > 0xffff) + if (trans_pen > 0xff) return zoom_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, scalex, scaley); // use pen usage to optimize @@ -1008,7 +946,7 @@ void gfx_element::prio_transpen(bitmap_ind16 &dest, const rectangle &cliprect, bitmap_ind8 &priority, u32 pmask, u32 trans_pen) { // special case invalid pens to opaque - if (trans_pen > 0xffff) + if (trans_pen > 0xff) return prio_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, priority, pmask); // use pen usage to optimize @@ -1038,7 +976,7 @@ void gfx_element::prio_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, bitmap_ind8 &priority, u32 pmask, u32 trans_pen) { // special case invalid pens to opaque - if (trans_pen > 0xffff) + if (trans_pen > 0xff) return prio_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, priority, pmask); // use pen usage to optimize @@ -1301,7 +1239,7 @@ void gfx_element::prio_zoom_transpen(bitmap_ind16 &dest, const rectangle &clipre return prio_transpen(dest, cliprect, code, color, flipx, flipy, destx, desty, priority, pmask, trans_pen); // special case invalid pens to opaque - if (trans_pen > 0xffff) + if (trans_pen > 0xff) return prio_zoom_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, scalex, scaley, priority, pmask); // use pen usage to optimize @@ -1336,7 +1274,7 @@ void gfx_element::prio_zoom_transpen(bitmap_rgb32 &dest, const rectangle &clipre return prio_transpen(dest, cliprect, code, color, flipx, flipy, destx, desty, priority, pmask, trans_pen); // special case invalid pens to opaque - if (trans_pen > 0xffff) + if (trans_pen > 0xff) return prio_zoom_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, scalex, scaley, priority, pmask); // use pen usage to optimize diff --git a/src/emu/drawgfx.h b/src/emu/drawgfx.h index 16902a6c932..4d3f4d0e0c9 100644 --- a/src/emu/drawgfx.h +++ b/src/emu/drawgfx.h @@ -152,7 +152,7 @@ public: gfx_element(); #endif gfx_element(device_palette_interface *palette, const gfx_layout &gl, const u8 *srcdata, u32 xormask, u32 total_colors, u32 color_base); - gfx_element(device_palette_interface *palette, const u8 *base, u32 total, u16 width, u16 height, u32 rowbytes, u32 total_colors, u32 color_base, u32 color_granularity); + gfx_element(device_palette_interface *palette, u8 *base, u16 width, u16 height, u32 rowbytes, u32 total_colors, u32 color_base, u32 color_granularity); // getters device_palette_interface &palette() const { return *m_palette; } @@ -173,7 +173,6 @@ public: // setters void set_layout(const gfx_layout &gl, const u8 *srcdata); void set_raw_layout(const u8 *srcdata, u32 width, u32 height, u32 total, u32 linemod, u32 charmod); - void set_raw_layout(const u16 *srcdata, u32 width, u32 height, u32 total, u32 linemod, u32 charmod); void set_source(const u8 *source); void set_source_and_total(const u8 *source, u32 total); void set_xormask(u32 xormask) { m_layout_xormask = xormask; } @@ -187,7 +186,7 @@ public: void mark_dirty(u32 code) { if (code < elements()) { m_dirty[code] = 1; m_dirtyseq++; } } void mark_all_dirty() { memset(&m_dirty[0], 1, elements()); } - const u16 *get_data(u32 code) + const u8 *get_data(u32 code) { assert(code < elements()); if (code < m_dirty.size() && m_dirty[code]) decode(code); @@ -271,40 +270,39 @@ private: void decode(u32 code); // internal state - device_palette_interface *m_palette; // palette used for drawing (optional when used as a pure decoder) - - u16 m_width; // current pixel width of each element (changeable with source clipping) - u16 m_height; // current pixel height of each element (changeable with source clipping) - u16 m_startx; // current source clip X offset - u16 m_starty; // current source clip Y offset - - u16 m_origwidth; // starting pixel width of each element - u16 m_origheight; // staring pixel height of each element - u32 m_total_elements; // total number of decoded elements - - u32 m_color_base; // base color for rendering - u16 m_color_depth; // number of colors each pixel can represent - u16 m_color_granularity; // number of colors for each color code - u32 m_total_colors; // number of color codes - - u32 m_line_modulo; // bytes between each row of data - u32 m_char_modulo; // bytes between each element - const u8 * m_srcdata; // pointer to the source data for decoding - u32 m_dirtyseq; // sequence number; incremented each time a tile is dirtied - - u16 * m_gfxdata; // pointer to decoded pixel data, 16bpp - std::vector<u16> m_gfxdata_allocated; // allocated decoded pixel data, 8bpp - std::vector<u8> m_dirty; // dirty array for detecting chars that need decoding - std::vector<u32> m_pen_usage; // bitmask of pens that are used (pens 0-31 only) - - bool m_layout_is_raw; // raw layout? - bool m_layout_is_16bpp; // 16bpp raw layout? - u8 m_layout_planes; // bit planes in the layout - u32 m_layout_xormask; // xor mask applied to each bit offset - u32 m_layout_charincrement; // per-character increment in source data - std::vector<u32> m_layout_planeoffset; // plane offsets - std::vector<u32> m_layout_xoffset; // X offsets - std::vector<u32> m_layout_yoffset; // Y offsets + device_palette_interface *m_palette; // palette used for drawing (optional when used as a pure decoder) + + u16 m_width; // current pixel width of each element (changeable with source clipping) + u16 m_height; // current pixel height of each element (changeable with source clipping) + u16 m_startx; // current source clip X offset + u16 m_starty; // current source clip Y offset + + u16 m_origwidth; // starting pixel width of each element + u16 m_origheight; // staring pixel height of each element + u32 m_total_elements; // total number of decoded elements + + u32 m_color_base; // base color for rendering + u16 m_color_depth; // number of colors each pixel can represent + u16 m_color_granularity; // number of colors for each color code + u32 m_total_colors; // number of color codes + + u32 m_line_modulo; // bytes between each row of data + u32 m_char_modulo; // bytes between each element + const u8 * m_srcdata; // pointer to the source data for decoding + u32 m_dirtyseq; // sequence number; incremented each time a tile is dirtied + + u8 * m_gfxdata; // pointer to decoded pixel data, 8bpp + std::vector<u8> m_gfxdata_allocated; // allocated decoded pixel data, 8bpp + std::vector<u8> m_dirty; // dirty array for detecting chars that need decoding + std::vector<u32> m_pen_usage; // bitmask of pens that are used (pens 0-31 only) + + bool m_layout_is_raw; // raw layout? + u8 m_layout_planes; // bit planes in the layout + u32 m_layout_xormask; // xor mask applied to each bit offset + u32 m_layout_charincrement; // per-character increment in source data + std::vector<u32> m_layout_planeoffset;// plane offsets + std::vector<u32> m_layout_xoffset; // X offsets + std::vector<u32> m_layout_yoffset; // Y offsets }; diff --git a/src/emu/drawgfxm.h b/src/emu/drawgfxm.h index e6f2b363272..6361ed8bf92 100644 --- a/src/emu/drawgfxm.h +++ b/src/emu/drawgfxm.h @@ -470,7 +470,7 @@ while (0) do { \ g_profiler.start(PROFILER_DRAWGFX); \ do { \ - const u16 *srcdata; \ + const u8 *srcdata; \ s32 destendx, destendy; \ s32 srcx, srcy; \ s32 curx, cury; \ @@ -549,7 +549,7 @@ do { { \ PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, destx); \ PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \ - const u16 *srcptr = srcdata; \ + const u8 *srcptr = srcdata; \ srcdata += dy; \ \ /* iterate over unrolled blocks of 4 */ \ @@ -584,7 +584,7 @@ do { { \ PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, destx); \ PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \ - const u16 *srcptr = srcdata; \ + const u8 *srcptr = srcdata; \ srcdata += dy; \ \ /* iterate over unrolled blocks of 4 */ \ @@ -642,7 +642,7 @@ do { do { \ g_profiler.start(PROFILER_DRAWGFX); \ do { \ - const u16 *srcdata; \ + const u8 *srcdata; \ u32 dstwidth, dstheight; \ s32 destendx, destendy; \ s32 srcx, srcy; \ @@ -730,7 +730,7 @@ do { { \ PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, destx); \ PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \ - const u16 *srcptr = srcdata + (srcy >> 16) * rowbytes(); \ + const u8 *srcptr = srcdata + (srcy >> 16) * rowbytes(); \ s32 cursrcx = srcx; \ srcy += dy; \ \ diff --git a/src/emu/tilemap.cpp b/src/emu/tilemap.cpp index 460e511336e..c5c0ff16ad3 100644 --- a/src/emu/tilemap.cpp +++ b/src/emu/tilemap.cpp @@ -401,7 +401,7 @@ tilemap_t &tilemap_t::init(tilemap_manager &manager, device_gfx_interface &decod // set up the default tile data memset(&m_tileinfo, 0, sizeof(m_tileinfo)); m_tileinfo.decoder = &decoder; - m_tileinfo.pen_mask = 0xffff; + m_tileinfo.pen_mask = 0xff; m_tileinfo.gfxnum = 0xff; // allocate transparency mapping data @@ -780,7 +780,7 @@ g_profiler.stop(); // the palette_base //------------------------------------------------- -u8 tilemap_t::tile_draw(const u16 *pendata, u32 x0, u32 y0, u32 palette_base, u8 category, u8 group, u8 flags, u16 pen_mask) +u8 tilemap_t::tile_draw(const u8 *pendata, u32 x0, u32 y0, u32 palette_base, u8 category, u8 group, u8 flags, u8 pen_mask) { // OR in the force layer flags category |= flags & (TILE_FORCE_LAYER0 | TILE_FORCE_LAYER1 | TILE_FORCE_LAYER2); @@ -816,7 +816,7 @@ u8 tilemap_t::tile_draw(const u16 *pendata, u32 x0, u32 y0, u32 palette_base, u8 int xoffs = 0; for (u16 tx = 0; tx < m_tilewidth; tx++) { - u16 pen = (*pendata++) & pen_mask; + u8 pen = (*pendata++) & pen_mask; u8 map = penmap[pen]; pixptr[xoffs] = palette_base + pen; flagsptr[xoffs] = map | category; diff --git a/src/emu/tilemap.h b/src/emu/tilemap.h index d73b3a23ef0..15794247a4f 100644 --- a/src/emu/tilemap.h +++ b/src/emu/tilemap.h @@ -372,13 +372,13 @@ typedef u32 tilemap_memory_index; struct tile_data { device_gfx_interface *decoder; // set in tilemap_t::init() - const u16 * pen_data; // required + const u8 * pen_data; // required const u8 * mask_data; // required pen_t palette_base; // defaults to 0 u8 category; // defaults to 0; range from 0..15 u8 group; // defaults to 0; range from 0..TILEMAP_NUM_GROUPS u8 flags; // defaults to 0; one or more of TILE_* flags above - u16 pen_mask; // defaults to 0xff; mask to apply to pen_data while rendering the tile + u8 pen_mask; // defaults to 0xff; mask to apply to pen_data while rendering the tile u8 gfxnum; // defaults to 0xff; specify index of gfx for auto-invalidation on dirty u32 code; @@ -421,7 +421,7 @@ class tilemap_t static const logical_index INVALID_LOGICAL_INDEX = (logical_index)~0; // maximum index in each array - static const pen_t MAX_PEN_TO_FLAGS = 65536; + static const pen_t MAX_PEN_TO_FLAGS = 256; protected: // tilemap_manager controls our allocations @@ -548,7 +548,7 @@ private: // internal drawing void pixmap_update(); void tile_update(logical_index logindex, u32 col, u32 row); - u8 tile_draw(const u16 *pendata, u32 x0, u32 y0, u32 palette_base, u8 category, u8 group, u8 flags, u16 pen_mask); + u8 tile_draw(const u8 *pendata, u32 x0, u32 y0, u32 palette_base, u8 category, u8 group, u8 flags, u8 pen_mask); u8 tile_apply_bitmask(const u8 *maskdata, u32 x0, u32 y0, u8 category, u8 flags); void configure_blit_parameters(blit_parameters &blit, bitmap_ind8 &priority_bitmap, const rectangle &cliprect, u32 flags, u8 priority, u8 priority_mask); template<class _BitmapClass> void draw_common(screen_device &screen, _BitmapClass &dest, const rectangle &cliprect, u32 flags, u8 priority, u8 priority_mask); diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp index d77fe21bf62..9a374f66095 100644 --- a/src/frontend/mame/luaengine.cpp +++ b/src/frontend/mame/luaengine.cpp @@ -1218,6 +1218,7 @@ void lua_engine::initialize() "load", &running_machine::schedule_load, "system", &running_machine::system, "video", &running_machine::video, + "sound", &running_machine::sound, "render", &running_machine::render, "ioport", &running_machine::ioport, "parameters", &running_machine::parameters, @@ -1870,6 +1871,23 @@ void lua_engine::initialize() "throttled", sol::property(&video_manager::throttled, &video_manager::set_throttled), "throttle_rate", sol::property(&video_manager::throttle_rate, &video_manager::set_throttle_rate)); +/* sound_manager library + * + * manager:machine():sound() + * + * sound:start_recording() - begin audio recording + * sound:stop_recording() - end audio recording + * sound:ui_mute(turn_off) - turns on/off UI sound + * sound:system_mute() - turns on/off system sound + * sound:attenuation - sound attenuation + */ + sol().registry().new_usertype<sound_manager>("sound", "new", sol::no_constructor, + "start_recording", &sound_manager::start_recording, + "stop_recording", &sound_manager::stop_recording, + "ui_mute", &sound_manager::ui_mute, + "debugger_mute", &sound_manager::debugger_mute, + "system_mute", &sound_manager::system_mute, + "attenuation", sol::property(&sound_manager::attenuation, &sound_manager::set_attenuation)); /* input_manager library * diff --git a/src/frontend/mame/ui/viewgfx.cpp b/src/frontend/mame/ui/viewgfx.cpp index 1714757d233..ff9ebd08016 100644 --- a/src/frontend/mame/ui/viewgfx.cpp +++ b/src/frontend/mame/ui/viewgfx.cpp @@ -714,7 +714,7 @@ static void gfxset_handler(mame_ui_manager &mui, render_container &container, ui ypixel = (cellypix - 2) - ypixel; if (info.rotate[set] & ORIENTATION_SWAP_XY) std::swap(xpixel, ypixel); - uint16_t pixdata = gfx.get_data(code)[xpixel + ypixel * gfx.rowbytes()]; + uint8_t pixdata = gfx.get_data(code)[xpixel + ypixel * gfx.rowbytes()]; util::stream_format(title_buf, " #%X:%X @ %d,%d = %X", code, info.color[set], xpixel, ypixel, gfx.colorbase() + info.color[set] * gfx.granularity() + pixdata); @@ -982,13 +982,13 @@ static void gfxset_draw_item(running_machine &machine, gfx_element &gfx, int ind for (y = 0; y < height; y++) { uint32_t *dest = &bitmap.pix32(dsty + y, dstx); - const uint16_t *src = gfx.get_data(index); + const uint8_t *src = gfx.get_data(index); // loop over columns in the cell for (x = 0; x < width; x++) { int effx = x, effy = y; - const uint16_t *s; + const uint8_t *s; // compute effective x,y values after rotation if (!(rotate & ORIENTATION_SWAP_XY)) diff --git a/src/hbmame/includes/cps1.h b/src/hbmame/includes/cps1.h index cc4c12a78ad..1487b6636b0 100644 --- a/src/hbmame/includes/cps1.h +++ b/src/hbmame/includes/cps1.h @@ -236,7 +236,7 @@ public: int m_palette_align; int m_palette_size; int m_stars_rom_size; - uint16_t m_empty_tile[32*32]; + uint8_t m_empty_tile[32*32]; int m_cps_version; /* fcrash video config */ diff --git a/src/hbmame/includes/cps2.h b/src/hbmame/includes/cps2.h index 1eb113cfbe4..13b98c1ca41 100644 --- a/src/hbmame/includes/cps2.h +++ b/src/hbmame/includes/cps2.h @@ -226,7 +226,7 @@ public: int m_palette_align; int m_palette_size; int m_stars_rom_size; - uint16_t m_empty_tile[32*32]; + uint8_t m_empty_tile[32*32]; int m_cps_version; /* devices */ diff --git a/src/mame/arcade.flt b/src/mame/arcade.flt index 985b48bac95..124ad994026 100644 --- a/src/mame/arcade.flt +++ b/src/mame/arcade.flt @@ -661,6 +661,7 @@ lsasquad.cpp ltcasino.cpp ltd.cpp luckgrln.cpp +lucky37.cpp lucky74.cpp luckybal.cpp lvcards.cpp diff --git a/src/mame/audio/bzone.cpp b/src/mame/audio/bzone.cpp index 8172d686685..9e0567aa57d 100644 --- a/src/mame/audio/bzone.cpp +++ b/src/mame/audio/bzone.cpp @@ -388,7 +388,7 @@ static DISCRETE_SOUND_START(bzone_discrete) DISCRETE_SOUND_END -WRITE8_MEMBER(bzone_state::bzone_sounds_w) +void bzone_state::bzone_sounds_w(uint8_t data) { m_discrete->write(BZ_INPUT, data); diff --git a/src/mame/audio/redbaron.cpp b/src/mame/audio/redbaron.cpp index edf8a8c901c..4e1f9d2a85b 100644 --- a/src/mame/audio/redbaron.cpp +++ b/src/mame/audio/redbaron.cpp @@ -219,7 +219,7 @@ void redbaron_sound_device::sound_stream_update(sound_stream &stream, stream_sam } -WRITE8_MEMBER( redbaron_sound_device::sounds_w ) +void redbaron_sound_device::sounds_w(uint8_t data) { /* If sound is off, don't bother playing samples */ if( data == m_latch ) diff --git a/src/mame/audio/redbaron.h b/src/mame/audio/redbaron.h index 2294d905fda..c5c81cb3264 100644 --- a/src/mame/audio/redbaron.h +++ b/src/mame/audio/redbaron.h @@ -14,7 +14,7 @@ class redbaron_sound_device : public device_t, public device_sound_interface public: redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - DECLARE_WRITE8_MEMBER( sounds_w ); + void sounds_w(uint8_t data); protected: // device-level overrides diff --git a/src/mame/drivers/1945kiii.cpp b/src/mame/drivers/1945kiii.cpp index ca2b22d41c5..a17c8ad962a 100644 --- a/src/mame/drivers/1945kiii.cpp +++ b/src/mame/drivers/1945kiii.cpp @@ -129,7 +129,7 @@ void k3_state::k3_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx_eleme { /* Start drawing */ const u16 pal = gfx->colorbase() + gfx->granularity() * (color % gfx->colors()); - const u16 *source_base = gfx->get_data(code % gfx->elements()); + const u8 *source_base = gfx->get_data(code % gfx->elements()); int xinc = flipx ? -1 : 1; int yinc = flipy ? -1 : 1; @@ -171,12 +171,12 @@ void k3_state::k3_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx_eleme { // skip if inner loop doesn't draw anything for (int y = sy; y < ey; y++) { - const u16 *source = source_base + y_index * gfx->rowbytes(); + const u8 *source = source_base + y_index * gfx->rowbytes(); u16 *dest = &dest_bmp.pix16(y); int x_index = x_index_base; for (int x = sx; x < ex; x++) { - const u16 c = source[x_index]; + u8 c = source[x_index]; if (c != transparent_color) { if (flicker) // verified from PCB (reference : https://www.youtube.com/watch?v=ooXyyvpW1O0) diff --git a/src/mame/drivers/acefruit.cpp b/src/mame/drivers/acefruit.cpp index 7982b28ee9c..c3ebc08de7b 100644 --- a/src/mame/drivers/acefruit.cpp +++ b/src/mame/drivers/acefruit.cpp @@ -179,7 +179,7 @@ uint32_t acefruit_state::screen_update_acefruit(screen_device &screen, bitmap_in for( x = 0; x < 16; x++ ) { int sprite = ( m_spriteram[ ( spriteindex / 64 ) % 6 ] & 0xf ) ^ 0xf; - const uint16_t *gfxdata = gfx->get_data(sprite); + const uint8_t *gfxdata = gfx->get_data(sprite); for( y = 0; y < 8; y++ ) { diff --git a/src/mame/drivers/aquarium.cpp b/src/mame/drivers/aquarium.cpp index b04b04270d6..0a18960d945 100644 --- a/src/mame/drivers/aquarium.cpp +++ b/src/mame/drivers/aquarium.cpp @@ -341,14 +341,14 @@ void aquarium_state::expand_gfx(int low, int hi) u8 *dest = srcdata; for (int c = 0; c < gfx_l->elements(); c++) { - const u16 *c0base = gfx_l->get_data(c); - const u16 *c1base = gfx_h->get_data(c); + const u8 *c0base = gfx_l->get_data(c); + const u8 *c1base = gfx_h->get_data(c); // loop over height for (int y = 0; y < gfx_l->height(); y++) { - const u16 *c0 = c0base; - const u16 *c1 = c1base; + const u8 *c0 = c0base; + const u8 *c1 = c1base; for (int x = 0; x < gfx_l->width(); x++) { diff --git a/src/mame/drivers/bzone.cpp b/src/mame/drivers/bzone.cpp index ea90f27e544..cc8fc1e7753 100644 --- a/src/mame/drivers/bzone.cpp +++ b/src/mame/drivers/bzone.cpp @@ -242,7 +242,7 @@ void redbaron_state::machine_start() void redbaron_state::machine_reset() { - earom_control_w(machine().dummy_space(), 0, 0); + earom_control_w(0); } @@ -273,7 +273,7 @@ CUSTOM_INPUT_MEMBER(bzone_state::clock_r) } -WRITE8_MEMBER(bzone_state::bzone_coin_counter_w) +void bzone_state::bzone_coin_counter_w(offs_t offset, uint8_t data) { machine().bookkeeping().coin_counter_w(offset,data); } @@ -286,15 +286,15 @@ WRITE8_MEMBER(bzone_state::bzone_coin_counter_w) * *************************************/ -READ8_MEMBER(redbaron_state::redbaron_joy_r) +uint8_t redbaron_state::redbaron_joy_r() { return m_fake_ports[m_rb_input_select ? 0 : 1]->read(); } -WRITE8_MEMBER(redbaron_state::redbaron_joysound_w) +void redbaron_state::redbaron_joysound_w(uint8_t data) { m_rb_input_select = data & 1; - m_redbaronsound->sounds_w(space, offset, data); + m_redbaronsound->sounds_w(data); } @@ -305,18 +305,18 @@ WRITE8_MEMBER(redbaron_state::redbaron_joysound_w) * *************************************/ -READ8_MEMBER(redbaron_state::earom_read) +uint8_t redbaron_state::earom_read() { return m_earom->data(); } -WRITE8_MEMBER(redbaron_state::earom_write) +void redbaron_state::earom_write(offs_t offset, uint8_t data) { m_earom->set_address((offset ^ 0x20) & 0x3f); m_earom->set_data(data); } -WRITE8_MEMBER(redbaron_state::earom_control_w) +void redbaron_state::earom_control_w(uint8_t data) { // CK = EDB0, C1 = /EDB2, C2 = EDB1, CS1 = EDB3, /CS2 = GND m_earom->set_control(BIT(data, 3), 1, !BIT(data, 2), BIT(data, 1)); @@ -369,10 +369,10 @@ void redbaron_state::redbaron_map(address_map &map) map(0x1806, 0x1806).r("mathbox", FUNC(mathbox_device::hi_r)); map(0x1808, 0x1808).w(FUNC(redbaron_state::redbaron_joysound_w)); /* and select joystick pot also */ map(0x180a, 0x180a).nopw(); /* sound reset, yet todo */ - map(0x180c, 0x180c).w(FUNC(redbaron_state::earom_control_w)); + map(0x180c, 0x180c).nopr().w(FUNC(redbaron_state::earom_control_w)); map(0x1810, 0x181f).rw("pokey", FUNC(pokey_device::read), FUNC(pokey_device::write)); map(0x1820, 0x185f).rw(FUNC(redbaron_state::earom_read), FUNC(redbaron_state::earom_write)); - map(0x1860, 0x187f).w("mathbox", FUNC(mathbox_device::go_w)); + map(0x1860, 0x187f).nopr().w("mathbox", FUNC(mathbox_device::go_w)); map(0x2000, 0x2fff).ram().share("avg:vectorram").region("maincpu", 0x2000); map(0x3000, 0x7fff).rom(); } @@ -875,13 +875,13 @@ ROM_END * *************************************/ -READ8_MEMBER(bzone_state::analog_data_r) +uint8_t bzone_state::analog_data_r() { return m_analog_data; } -WRITE8_MEMBER(bzone_state::analog_select_w) +void bzone_state::analog_select_w(offs_t offset, uint8_t data) { static const char *const analog_port[] = { "AN0", "AN1", "AN2" }; @@ -896,8 +896,8 @@ void bzone_state::init_bradley() space.install_ram(0x400, 0x7ff); space.install_read_port(0x1808, 0x1808, "1808"); space.install_read_port(0x1809, 0x1809, "1809"); - space.install_read_handler(0x180a, 0x180a, read8_delegate(FUNC(bzone_state::analog_data_r),this)); - space.install_write_handler(0x1848, 0x1850, write8_delegate(FUNC(bzone_state::analog_select_w),this)); + space.install_read_handler(0x180a, 0x180a, read8smo_delegate(FUNC(bzone_state::analog_data_r),this)); + space.install_write_handler(0x1848, 0x1850, write8sm_delegate(FUNC(bzone_state::analog_select_w),this)); } diff --git a/src/mame/drivers/coolridr.cpp b/src/mame/drivers/coolridr.cpp index 7cae64bde71..4bc6129aeb0 100644 --- a/src/mame/drivers/coolridr.cpp +++ b/src/mame/drivers/coolridr.cpp @@ -589,7 +589,7 @@ void coolridr_state::video_start() #define COOLRIDERS_DRAWGFX_CORE(PIXEL_TYPE, COOL_PIXEL_OP) \ do { \ do { \ - const uint16_t *srcdata; \ + const uint8_t *srcdata; \ int32_t destendx, destendy; \ int32_t srcx, srcy; \ int32_t curx, cury; \ @@ -667,7 +667,7 @@ do { for (cury = desty; cury <= destendy; cury++) \ { \ PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \ - const uint16_t *srcptr = srcdata; \ + const uint8_t *srcptr = srcdata; \ srcdata += dy; \ \ /* iterate over unrolled blocks of 4 */ \ @@ -699,7 +699,7 @@ do { for (cury = desty; cury <= destendy; cury++) \ { \ PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \ - const uint16_t *srcptr = srcdata; \ + const uint8_t *srcptr = srcdata; \ srcdata += dy; \ \ /* iterate over unrolled blocks of 4 */ \ diff --git a/src/mame/drivers/cps3.cpp b/src/mame/drivers/cps3.cpp index 508e079a174..5986ad19a8a 100644 --- a/src/mame/drivers/cps3.cpp +++ b/src/mame/drivers/cps3.cpp @@ -529,7 +529,7 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle // const pen_t *pal = &gfx->colortable[gfx->granularity() * (color % gfx->colors())]; u32 palbase = (gfx->granularity() * color) & 0x1ffff; const pen_t *pal = &m_mame_colours[palbase]; - const u16 *source_base = gfx->get_data(code % gfx->elements()); + const u8 *source_base = gfx->get_data(code % gfx->elements()); int sprite_screen_height = (scaley*gfx->height()+0x8000)>>16; int sprite_screen_width = (scalex*gfx->width()+0x8000)>>16; @@ -595,7 +595,7 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle { for (int y = sy; y < ey; y++) { - const u16 *source = source_base + (y_index>>16) * gfx->rowbytes(); + const u8 *source = source_base + (y_index>>16) * gfx->rowbytes(); u32 *dest = &dest_bmp.pix32(y); int x_index = x_index_base; @@ -611,7 +611,7 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle { for (int y = sy; y < ey; y++) { - const u16 *source = source_base + (y_index>>16) * gfx->rowbytes(); + const u8 *source = source_base + (y_index>>16) * gfx->rowbytes(); u32 *dest = &dest_bmp.pix32(y); int x_index = x_index_base; @@ -628,7 +628,7 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle { for (int y = sy; y < ey; y++) { - const u16 *source = source_base + (y_index>>16) * gfx->rowbytes(); + const u8 *source = source_base + (y_index>>16) * gfx->rowbytes(); u32 *dest = &dest_bmp.pix32(y); int x_index = x_index_base; @@ -645,7 +645,7 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle { for (int y = sy; y < ey; y++) { - const u16 *source = source_base + (y_index>>16) * gfx->rowbytes(); + const u8 *source = source_base + (y_index>>16) * gfx->rowbytes(); u32 *dest = &dest_bmp.pix32(y); int x_index = x_index_base; diff --git a/src/mame/drivers/gamecstl.cpp b/src/mame/drivers/gamecstl.cpp index 0bb7ddc9671..947eaced689 100644 --- a/src/mame/drivers/gamecstl.cpp +++ b/src/mame/drivers/gamecstl.cpp @@ -138,7 +138,7 @@ void gamecstl_state::video_start() void gamecstl_state::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y) { int i,j; - const uint16_t *dp; + const uint8_t *dp; int index = 0; dp = gfx->get_data(ch); diff --git a/src/mame/drivers/gstream.cpp b/src/mame/drivers/gstream.cpp index 127ee1ac57f..42cc5dc63ad 100644 --- a/src/mame/drivers/gstream.cpp +++ b/src/mame/drivers/gstream.cpp @@ -183,7 +183,6 @@ private: int m_oki_bank[2]; int m_toggle; int m_xoffset; - bool m_is_rgb; DECLARE_WRITE32_MEMBER(vram_w); template<int Layer> DECLARE_WRITE16_MEMBER(scrollx_w); @@ -199,8 +198,11 @@ private: virtual void video_start() override; uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void draw_bg(bitmap_rgb32 &bitmap, const rectangle &cliprect, int map, uint32_t* ram); - void drawgfx_rgb(bitmap_rgb32 &bitmap,const rectangle &clip,gfx_element *gfx, - u32 code,u32 color,bool flipx,bool flipy,int offsx,int offsy); + void drawgfx_transpen_x2222(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx,gfx_element *gfx2, + uint32_t code, int flipx, int flipy, int32_t destx, int32_t desty); + + void rearrange_sprite_data(uint8_t* ROM, uint32_t* NEW, uint32_t* NEW2); + void rearrange_tile_data(uint8_t* ROM, uint32_t* NEW, uint32_t* NEW2); required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; @@ -547,44 +549,23 @@ static const gfx_layout layout32x32 = 32*32*8, }; - -static const gfx_layout layout16x16x16 = -{ - 16,16, - RGN_FRAC(1,1), - 16, - { STEP16(0,1) }, - { STEP16(0,16) }, - { STEP16(0,16*16) }, - 16*16*16, -}; - - -static const gfx_layout layout32x32x16 = -{ - 32,32, - RGN_FRAC(1,1), - 16, - { STEP16(0,1) }, - { STEP32(0,16) }, - { STEP32(0,16*32) }, - 32*32*16, -}; - - static GFXDECODE_START( gfx_gstream ) - GFXDECODE_ENTRY( "gfx2", 0, layout32x32, 0x1000, 4 ) - GFXDECODE_ENTRY( "gfx3", 0, layout32x32, 0x1400, 4 ) - GFXDECODE_ENTRY( "gfx4", 0, layout32x32, 0x1800, 4 ) + GFXDECODE_ENTRY( "gfx2", 0, layout32x32, 0x1000, 4 ) + GFXDECODE_ENTRY( "gfx3", 0, layout32x32, 0x1400, 4 ) + GFXDECODE_ENTRY( "gfx4", 0, layout32x32, 0x1800, 4 ) GFXDECODE_ENTRY( "gfx1", 0, layout16x16, 0, 32 ) GFXDECODE_END static GFXDECODE_START( gfx_x2222 ) - GFXDECODE_ENTRY( "gfx2", 0, layout32x32x16, 0, 1 ) - GFXDECODE_ENTRY( "gfx3", 0, layout32x32x16, 0, 1 ) - GFXDECODE_ENTRY( "gfx4", 0, layout32x32x16, 0, 1 ) - GFXDECODE_ENTRY( "gfx1", 0, layout16x16x16, 0, 1 ) + GFXDECODE_ENTRY( "gfx2", 0, layout32x32, 0, 0x80 ) + GFXDECODE_ENTRY( "gfx3", 0, layout32x32, 0, 0x80 ) + GFXDECODE_ENTRY( "gfx4", 0, layout32x32, 0, 0x80 ) + GFXDECODE_ENTRY( "gfx1", 0, layout16x16, 0, 0x80 ) + GFXDECODE_ENTRY( "gfx1_lower", 0, layout16x16, 0, 0x80 ) + GFXDECODE_ENTRY( "gfx2_lower", 0, layout32x32, 0, 0x80 ) + GFXDECODE_ENTRY( "gfx3_lower", 0, layout32x32, 0, 0x80 ) + GFXDECODE_ENTRY( "gfx4_lower", 0, layout32x32, 0, 0x80 ) GFXDECODE_END @@ -593,67 +574,152 @@ void gstream_state::video_start() } -void gstream_state::drawgfx_rgb(bitmap_rgb32 &bitmap,const rectangle &clip,gfx_element *gfx, - u32 code,u32 color,bool flipx,bool flipy,int offsx,int offsy) +// custom drawgfx function for x2222 to draw RGB data instead of indexed data, needed because our regular drawgfx and tilemap code don't support that +void gstream_state::drawgfx_transpen_x2222(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx,gfx_element *gfx2, + uint32_t code, int flipx, int flipy, int32_t destx, int32_t desty) { - /* Start drawing */ - const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); - const u16 *source_base = gfx->get_data(code % gfx->elements()); + // use pen usage to optimize + code %= gfx->elements(); + const pen_t *rgb = m_palette->pens(); // 16 bit BGR + + // render + + do { + g_profiler.start(PROFILER_DRAWGFX); + do { + const uint8_t *srcdata, *srcdata2; + int32_t destendx, destendy; + int32_t srcx, srcy; + int32_t curx, cury; + int32_t dy; + + assert(dest.valid()); + assert(gfx != nullptr); + assert(dest.cliprect().contains(cliprect)); + assert(code < gfx->elements()); + + /* ignore empty/invalid cliprects */ + if (cliprect.empty()) + break; + + /* compute final pixel in X and exit if we are entirely clipped */ + destendx = destx + gfx->width() - 1; + if (destx > cliprect.max_x || destendx < cliprect.min_x) + break; + + /* apply left clip */ + srcx = 0; + if (destx < cliprect.min_x) + { + srcx = cliprect.min_x - destx; + destx = cliprect.min_x; + } - int xinc = flipx ? -1 : 1; - int yinc = flipy ? -1 : 1; + /* apply right clip */ + if (destendx > cliprect.max_x) + destendx = cliprect.max_x; - int x_index_base = flipx ? gfx->width() - 1 : 0; - int y_index = flipy ? gfx->height() - 1 : 0; + /* compute final pixel in Y and exit if we are entirely clipped */ + destendy = desty + gfx->height() - 1; + if (desty > cliprect.max_y || destendy < cliprect.min_y) + break; - // start coordinates - int sx = offsx; - int sy = offsy; + /* apply top clip */ + srcy = 0; + if (desty < cliprect.min_y) + { + srcy = cliprect.min_y - desty; + desty = cliprect.min_y; + } - // end coordinates - int ex = sx + gfx->width(); - int ey = sy + gfx->height(); + /* apply bottom clip */ + if (destendy > cliprect.max_y) + destendy = cliprect.max_y; - if (sx < clip.min_x) - { // clip left - int pixels = clip.min_x - sx; - sx += pixels; - x_index_base += xinc * pixels; - } - if (sy < clip.min_y) - { // clip top - int pixels = clip.min_y - sy; - sy += pixels; - y_index += yinc * pixels; - } - // NS 980211 - fixed incorrect clipping - if (ex > clip.max_x + 1) - { // clip right - ex = clip.max_x + 1; - } - if (ey > clip.max_y + 1) - { // clip bottom - ey = clip.max_y + 1; - } + /* apply X flipping */ + if (flipx) + srcx = gfx->width() - 1 - srcx; - if (ex > sx) - { // skip if inner loop doesn't draw anything - for (int y = sy; y < ey; y++) - { - const u16 *source = source_base + y_index * gfx->rowbytes(); - u32 *dest = &bitmap.pix32(y); - int x_index = x_index_base; - for (int x = sx; x < ex; x++) + /* apply Y flipping */ + dy = gfx->rowbytes(); + if (flipy) + { + srcy = gfx->height() - 1 - srcy; + dy = -dy; + } + + /* fetch the source data */ + srcdata = gfx->get_data(code); + srcdata2 = gfx2->get_data(code); + + /* compute how many blocks of 4 pixels we have */ + uint32_t leftovers = (destendx + 1 - destx); + + /* adjust srcdata to point to the first source pixel of the row */ + srcdata += srcy * gfx->rowbytes() + srcx; + srcdata2 += srcy * gfx->rowbytes() + srcx; + + /* non-flipped 16bpp case */ + if (!flipx) { - const u16 c = source[x_index]; - if (c != 0) // draw this pixel when rom data is not 0 - dest[x] = pal[c]; + /* iterate over pixels in Y */ + for (cury = desty; cury <= destendy; cury++) + { + uint32_t *destptr = &dest.pix32(cury, destx); + const uint8_t *srcptr = srcdata; + const uint8_t *srcptr2 = srcdata2; + srcdata += dy; + srcdata2 += dy; + + /* iterate over leftover pixels */ + for (curx = 0; curx < leftovers; curx++) + { + uint32_t srcdata = (srcptr[0]); + uint32_t srcdata2 = (srcptr2[0]); + + uint16_t full = (srcdata | (srcdata2 << 8)); + if (full != 0) + destptr[0] = rgb[full]; + + srcptr++; + srcptr2++; + destptr++; + } + } + } - x_index += xinc; + /* flipped 16bpp case */ + else + { + /* iterate over pixels in Y */ + for (cury = desty; cury <= destendy; cury++) + { + uint32_t *destptr = &dest.pix32(cury, destx); + const uint8_t *srcptr = srcdata; + const uint8_t *srcptr2 = srcdata2; + + srcdata += dy; + srcdata2 += dy; + + /* iterate over leftover pixels */ + for (curx = 0; curx < leftovers; curx++) + { + uint32_t srcdata = (srcptr[0]); + uint32_t srcdata2 = (srcptr2[0]); + + uint16_t full = (srcdata | (srcdata2 << 8)); + if (full != 0) + destptr[0] = rgb[full]; + + srcptr--; + srcptr2--; + destptr++; + } + } } - y_index += yinc; - } - } + } while (0); + g_profiler.stop(); + } while (0); } void gstream_state::draw_bg(bitmap_rgb32 &bitmap, const rectangle &cliprect, int map, uint32_t* ram ) @@ -674,8 +740,8 @@ void gstream_state::draw_bg(bitmap_rgb32 &bitmap, const rectangle &cliprect, int int pal = (vram_data & 0xc000) >> 14; int code = (vram_data & 0x0fff); - if (m_is_rgb) - drawgfx_rgb(bitmap,cliprect,m_gfxdecode->gfx(map),code,pal,0,0,(x*32)-(scrollx&0x1f)-m_xoffset,(y*32)-(scrolly&0x1f)); + if (m_gfxdecode->gfx(map+5)) + drawgfx_transpen_x2222(bitmap,cliprect,m_gfxdecode->gfx(map),m_gfxdecode->gfx(map+5),code,0,0,(x*32)-(scrollx&0x1f)-m_xoffset,(y*32)-(scrolly&0x1f)); else m_gfxdecode->gfx(map)->transpen(bitmap,cliprect,code,pal,0,0,(x*32)-(scrollx&0x1f)-m_xoffset,(y*32)-(scrolly&0x1f),0); @@ -709,10 +775,12 @@ uint32_t gstream_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma //popmessage("(1) %08x %08x (2) %08x %08x (3) %08x %08x", m_scrollx[0], m_scrolly[0], m_scrollx[1], m_scrolly[1], m_scrollx[2], m_scrolly[2] ); bitmap.fill(0,cliprect); + draw_bg(bitmap, cliprect, 2, m_vram + 0x800/4); draw_bg(bitmap, cliprect, 1, m_vram + 0x400/4); draw_bg(bitmap, cliprect, 0, m_vram + 0x000/4); // move on top for x2222 , check + for (i = 0x0000 / 4; i < 0x4000 / 4; i += 4) { /* Upper bits are used by the tilemaps */ @@ -721,12 +789,13 @@ uint32_t gstream_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma int y = m_vram[i + 2] & 0xff; int col = m_vram[i + 3] & 0x1f; - if (m_is_rgb) + if (m_gfxdecode->gfx(4)) { - drawgfx_rgb(bitmap, cliprect, m_gfxdecode->gfx(3), code, col, 0, 0, x - m_xoffset, y); - drawgfx_rgb(bitmap, cliprect, m_gfxdecode->gfx(3), code, col, 0, 0, x - m_xoffset, y-0x100); - drawgfx_rgb(bitmap, cliprect, m_gfxdecode->gfx(3), code, col, 0, 0, x - m_xoffset - 0x200, y); - drawgfx_rgb(bitmap, cliprect, m_gfxdecode->gfx(3), code, col, 0, 0, x - m_xoffset - 0x200, y-0x100); + drawgfx_transpen_x2222(bitmap, cliprect, m_gfxdecode->gfx(3), m_gfxdecode->gfx(4), code, 0, 0, x - m_xoffset, y); + drawgfx_transpen_x2222(bitmap, cliprect, m_gfxdecode->gfx(3), m_gfxdecode->gfx(4), code, 0, 0, x - m_xoffset, y-0x100); + drawgfx_transpen_x2222(bitmap, cliprect, m_gfxdecode->gfx(3), m_gfxdecode->gfx(4), code, 0, 0, x - m_xoffset - 0x200, y); + drawgfx_transpen_x2222(bitmap, cliprect, m_gfxdecode->gfx(3), m_gfxdecode->gfx(4), code, 0, 0, x - m_xoffset - 0x200 , y-0x100); + } else { @@ -734,6 +803,7 @@ uint32_t gstream_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma m_gfxdecode->gfx(3)->transpen(bitmap, cliprect, code, col, 0, 0, x - m_xoffset, y-0x100, 0); m_gfxdecode->gfx(3)->transpen(bitmap, cliprect, code, col, 0, 0, x - m_xoffset - 0x200, y, 0); m_gfxdecode->gfx(3)->transpen(bitmap, cliprect, code, col, 0, 0, x - m_xoffset - 0x200, y-0x100, 0); + } } return 0; @@ -868,28 +938,53 @@ ROM_START( x2222 ) ROM_REGION32_BE( 0x0200000, "misc", 0 ) /* other code */ ROM_LOAD( "test.hye", 0x000000, 0x0112dda, CRC(c1142b2f) SHA1(5807930820a53604013a6ac66e4d4ebe3628e1fc) ) // the above binary was built from this - /* x2222 uses raw rgb16 data rather than 8bpp indexed */ - ROM_REGION( 0x1000000, "gfx1", 0 ) /* sprite tiles (16x16x16) */ - ROM_LOAD64_WORD_SWAP( "spr11.bin", 0x000000, 0x200000, CRC(1d15b444) SHA1(27ace509a7e4ec2e62453636acf444a861bb85ce) ) - ROM_LOAD64_WORD_SWAP( "spr21.bin", 0x800000, 0x1b8b00, CRC(1c392be2) SHA1(775882f588a8bef33a79fa4f25754a47dc82cb30) ) - ROM_LOAD64_WORD_SWAP( "spr12.bin", 0x000002, 0x200000, CRC(73225936) SHA1(50507c52b932198659e08d22d3c0a92e7c69e5ba) ) - ROM_LOAD64_WORD_SWAP( "spr22.bin", 0x800002, 0x1b8b00, CRC(cf7ebfa1) SHA1(c968dcf768e5598240f5a131414a5607899b4bef) ) - ROM_LOAD64_WORD_SWAP( "spr13.bin", 0x000004, 0x200000, CRC(52595c51) SHA1(a161a5f433aa7aa2f7824ea6b9b70d73ca63b62d) ) - ROM_LOAD64_WORD_SWAP( "spr23.bin", 0x800004, 0x1b8b00, CRC(d894461e) SHA1(14dccfa8c762d928eaea0ac4cfff7d1272b69fdd) ) - ROM_LOAD64_WORD_SWAP( "spr14.bin", 0x000006, 0x200000, CRC(f6cd6599) SHA1(170ea7a9a26fd8038df53fb333357766dabbe7c2) ) - ROM_LOAD64_WORD_SWAP( "spr24.bin", 0x800006, 0x1b8b00, CRC(9542cb08) SHA1(d40c1f0b7d3e9deb12284c2f2c2df0ac43cb6cd2) ) - - ROM_REGION( 0x400000, "gfx2", 0 ) /* bg tiles (32x32x16) */ - ROM_LOAD32_WORD_SWAP( "bg31.bin", 0x000000, 0x11ac00, CRC(12e67bc2) SHA1(18618a8931af3b3aeab34fd50424a7ffb3da6458) ) - ROM_LOAD32_WORD_SWAP( "bg32.bin", 0x000002, 0x11ac00, CRC(95afa0da) SHA1(e534bc0874329475ce7efa836000fe29fc76c44c) ) - - ROM_REGION( 0x400000, "gfx3", 0 ) /* bg tiles (32x32x16) */ - ROM_LOAD32_WORD_SWAP( "bg21.bin", 0x000000, 0x1c8400, CRC(a10220f8) SHA1(9aa43a8e23cdf55d8623d2694b04971eaced9ba9) ) - ROM_LOAD32_WORD_SWAP( "bg22.bin", 0x000002, 0x1c8400, CRC(966f7c1d) SHA1(4699a3014c7e66d0dabd8d7982f43114b71181b7) ) - - ROM_REGION( 0x400000, "gfx4", 0 ) /* bg tiles (32x32x16) */ - ROM_LOAD32_WORD_SWAP( "bg11.bin", 0x000000, 0x1bc800, CRC(68975462) SHA1(7a2458a3d2465b727f4f5bf45685f35eb4885975) ) - ROM_LOAD32_WORD_SWAP( "bg12.bin", 0x000002, 0x1bc800, CRC(feef1240) SHA1(9eb123a19ade74d8b3ce4df0b04ca97c03fb9fdc) ) + /* x2222 uses raw rgb16 data rather than 8bpp indexed, in order to use the same gfx decodes with a custom draw routine we arrange the data into 2 8bpp regions on init */ + ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 ) /* sprite tiles (16x16x8) */ + /* filled in at init*/ + + ROM_REGION( 0x200000, "gfx2", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */ + /* filled in at init*/ + + ROM_REGION( 0x200000, "gfx3", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */ + /* filled in at init*/ + + ROM_REGION( 0x200000, "gfx4", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */ + /* filled in at init*/ + + /* 2nd 8-bits */ + ROM_REGION( 0x800000, "gfx1_lower", ROMREGION_ERASE00 ) /* sprite tiles (16x16x8) */ + /* filled in at init*/ + + ROM_REGION( 0x200000, "gfx2_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */ + /* filled in at init*/ + + ROM_REGION( 0x200000, "gfx3_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */ + /* filled in at init*/ + + ROM_REGION( 0x200000, "gfx4_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */ + /* filled in at init*/ + + ROM_REGION( 0x1000000, "sprites", 0 ) /* sprite tiles (16x16x16) */ + ROM_LOAD( "spr11.bin", 0x000000, 0x200000, CRC(1d15b444) SHA1(27ace509a7e4ec2e62453636acf444a861bb85ce) ) + ROM_LOAD( "spr21.bin", 0x200000, 0x1b8b00, CRC(1c392be2) SHA1(775882f588a8bef33a79fa4f25754a47dc82cb30) ) + ROM_LOAD( "spr12.bin", 0x400000, 0x200000, CRC(73225936) SHA1(50507c52b932198659e08d22d3c0a92e7c69e5ba) ) + ROM_LOAD( "spr22.bin", 0x600000, 0x1b8b00, CRC(cf7ebfa1) SHA1(c968dcf768e5598240f5a131414a5607899b4bef) ) + ROM_LOAD( "spr13.bin", 0x800000, 0x200000, CRC(52595c51) SHA1(a161a5f433aa7aa2f7824ea6b9b70d73ca63b62d) ) + ROM_LOAD( "spr23.bin", 0xa00000, 0x1b8b00, CRC(d894461e) SHA1(14dccfa8c762d928eaea0ac4cfff7d1272b69fdd) ) + ROM_LOAD( "spr14.bin", 0xc00000, 0x200000, CRC(f6cd6599) SHA1(170ea7a9a26fd8038df53fb333357766dabbe7c2) ) + ROM_LOAD( "spr24.bin", 0xe00000, 0x1b8b00, CRC(9542cb08) SHA1(d40c1f0b7d3e9deb12284c2f2c2df0ac43cb6cd2) ) + + ROM_REGION( 0x400000, "bg1", 0 ) /* bg tiles (32x32x16) */ + ROM_LOAD16_BYTE( "bg31.bin", 0x000000, 0x11ac00, CRC(12e67bc2) SHA1(18618a8931af3b3aeab34fd50424a7ffb3da6458) ) + ROM_LOAD16_BYTE( "bg32.bin", 0x000001, 0x11ac00, CRC(95afa0da) SHA1(e534bc0874329475ce7efa836000fe29fc76c44c) ) + + ROM_REGION( 0x400000, "bg2", 0 ) /* bg tiles (32x32x16) */ + ROM_LOAD16_BYTE( "bg21.bin", 0x000000, 0x1c8400, CRC(a10220f8) SHA1(9aa43a8e23cdf55d8623d2694b04971eaced9ba9) ) + ROM_LOAD16_BYTE( "bg22.bin", 0x000001, 0x1c8400, CRC(966f7c1d) SHA1(4699a3014c7e66d0dabd8d7982f43114b71181b7) ) + + ROM_REGION( 0x400000, "bg3", 0 ) /* bg tiles (32x32x16) */ + ROM_LOAD16_BYTE( "bg11.bin", 0x000000, 0x1bc800, CRC(68975462) SHA1(7a2458a3d2465b727f4f5bf45685f35eb4885975) ) + ROM_LOAD16_BYTE( "bg12.bin", 0x000001, 0x1bc800, CRC(feef1240) SHA1(9eb123a19ade74d8b3ce4df0b04ca97c03fb9fdc) ) // no idea what the sound hw is? ROM_REGION( 0x100000, "oki1", ROMREGION_ERASE00 ) @@ -905,28 +1000,53 @@ ROM_START( x2222o ) ROM_REGION32_BE( 0x0200000, "misc", 0 ) /* other code */ ROM_LOAD( "older.hye", 0x000000, 0x010892f, CRC(cf3a004e) SHA1(1cba64cfa235b9540f33a5ee0cc02dfd267e00fc) ) // this corresponds to the older.bin we're using, for reference - /* x2222 uses raw rgb16 data rather than 8bpp indexed */ - ROM_REGION( 0x1000000, "gfx1", 0 ) /* sprite tiles (16x16x16) */ // these sprite ROMs have the Boss tiles in the wrong location for the prototype program rom - ROM_LOAD64_WORD_SWAP( "spr11.bin", 0x000000, 0x200000, BAD_DUMP CRC(1d15b444) SHA1(27ace509a7e4ec2e62453636acf444a861bb85ce) ) - ROM_LOAD64_WORD_SWAP( "spr21.bin", 0x800000, 0x1b8b00, BAD_DUMP CRC(1c392be2) SHA1(775882f588a8bef33a79fa4f25754a47dc82cb30) ) - ROM_LOAD64_WORD_SWAP( "spr12.bin", 0x000002, 0x200000, BAD_DUMP CRC(73225936) SHA1(50507c52b932198659e08d22d3c0a92e7c69e5ba) ) - ROM_LOAD64_WORD_SWAP( "spr22.bin", 0x800002, 0x1b8b00, BAD_DUMP CRC(cf7ebfa1) SHA1(c968dcf768e5598240f5a131414a5607899b4bef) ) - ROM_LOAD64_WORD_SWAP( "spr13.bin", 0x000004, 0x200000, BAD_DUMP CRC(52595c51) SHA1(a161a5f433aa7aa2f7824ea6b9b70d73ca63b62d) ) - ROM_LOAD64_WORD_SWAP( "spr23.bin", 0x800004, 0x1b8b00, BAD_DUMP CRC(d894461e) SHA1(14dccfa8c762d928eaea0ac4cfff7d1272b69fdd) ) - ROM_LOAD64_WORD_SWAP( "spr14.bin", 0x000006, 0x200000, BAD_DUMP CRC(f6cd6599) SHA1(170ea7a9a26fd8038df53fb333357766dabbe7c2) ) - ROM_LOAD64_WORD_SWAP( "spr24.bin", 0x800006, 0x1b8b00, BAD_DUMP CRC(9542cb08) SHA1(d40c1f0b7d3e9deb12284c2f2c2df0ac43cb6cd2) ) - - ROM_REGION( 0x400000, "gfx2", 0 ) /* bg tiles (32x32x16) */ - ROM_LOAD32_WORD_SWAP( "bg31.bin", 0x000000, 0x11ac00, CRC(12e67bc2) SHA1(18618a8931af3b3aeab34fd50424a7ffb3da6458) ) - ROM_LOAD32_WORD_SWAP( "bg32.bin", 0x000002, 0x11ac00, CRC(95afa0da) SHA1(e534bc0874329475ce7efa836000fe29fc76c44c) ) - - ROM_REGION( 0x400000, "gfx3", 0 ) /* bg tiles (32x32x16) */ - ROM_LOAD32_WORD_SWAP( "bg21.bin", 0x000000, 0x1c8400, CRC(a10220f8) SHA1(9aa43a8e23cdf55d8623d2694b04971eaced9ba9) ) - ROM_LOAD32_WORD_SWAP( "bg22.bin", 0x000002, 0x1c8400, CRC(966f7c1d) SHA1(4699a3014c7e66d0dabd8d7982f43114b71181b7) ) - - ROM_REGION( 0x400000, "gfx4", 0 ) /* bg tiles (32x32x16) */ - ROM_LOAD32_WORD_SWAP( "bg11.bin", 0x000000, 0x1bc800, CRC(68975462) SHA1(7a2458a3d2465b727f4f5bf45685f35eb4885975) ) - ROM_LOAD32_WORD_SWAP( "bg12.bin", 0x000002, 0x1bc800, CRC(feef1240) SHA1(9eb123a19ade74d8b3ce4df0b04ca97c03fb9fdc) ) + /* x2222 uses raw rgb16 data rather than 8bpp indexed, in order to use the same gfx decodes with a custom draw routine we arrange the data into 2 8bpp regions on init */ + ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 ) /* sprite tiles (16x16x8) */ + /* filled in at init*/ + + ROM_REGION( 0x200000, "gfx2", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */ + /* filled in at init*/ + + ROM_REGION( 0x200000, "gfx3", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */ + /* filled in at init*/ + + ROM_REGION( 0x200000, "gfx4", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */ + /* filled in at init*/ + + /* 2nd 8-bits */ + ROM_REGION( 0x800000, "gfx1_lower", ROMREGION_ERASE00 ) /* sprite tiles (16x16x8) */ + /* filled in at init*/ + + ROM_REGION( 0x200000, "gfx2_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */ + /* filled in at init*/ + + ROM_REGION( 0x200000, "gfx3_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */ + /* filled in at init*/ + + ROM_REGION( 0x200000, "gfx4_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */ + /* filled in at init*/ + + ROM_REGION( 0x1000000, "sprites", 0 ) /* sprite tiles (16x16x16) */ // these sprite ROMs have the Boss tiles in the wrong location for the prototype program rom + ROM_LOAD( "spr11.bin", 0x000000, 0x200000, BAD_DUMP CRC(1d15b444) SHA1(27ace509a7e4ec2e62453636acf444a861bb85ce) ) + ROM_LOAD( "spr21.bin", 0x200000, 0x1b8b00, BAD_DUMP CRC(1c392be2) SHA1(775882f588a8bef33a79fa4f25754a47dc82cb30) ) + ROM_LOAD( "spr12.bin", 0x400000, 0x200000, BAD_DUMP CRC(73225936) SHA1(50507c52b932198659e08d22d3c0a92e7c69e5ba) ) + ROM_LOAD( "spr22.bin", 0x600000, 0x1b8b00, BAD_DUMP CRC(cf7ebfa1) SHA1(c968dcf768e5598240f5a131414a5607899b4bef) ) + ROM_LOAD( "spr13.bin", 0x800000, 0x200000, BAD_DUMP CRC(52595c51) SHA1(a161a5f433aa7aa2f7824ea6b9b70d73ca63b62d) ) + ROM_LOAD( "spr23.bin", 0xa00000, 0x1b8b00, BAD_DUMP CRC(d894461e) SHA1(14dccfa8c762d928eaea0ac4cfff7d1272b69fdd) ) + ROM_LOAD( "spr14.bin", 0xc00000, 0x200000, BAD_DUMP CRC(f6cd6599) SHA1(170ea7a9a26fd8038df53fb333357766dabbe7c2) ) + ROM_LOAD( "spr24.bin", 0xe00000, 0x1b8b00, BAD_DUMP CRC(9542cb08) SHA1(d40c1f0b7d3e9deb12284c2f2c2df0ac43cb6cd2) ) + + ROM_REGION( 0x400000, "bg1", 0 ) /* bg tiles (32x32x16) */ + ROM_LOAD16_BYTE( "bg31.bin", 0x000000, 0x11ac00, CRC(12e67bc2) SHA1(18618a8931af3b3aeab34fd50424a7ffb3da6458) ) + ROM_LOAD16_BYTE( "bg32.bin", 0x000001, 0x11ac00, CRC(95afa0da) SHA1(e534bc0874329475ce7efa836000fe29fc76c44c) ) + + ROM_REGION( 0x400000, "bg2", 0 ) /* bg tiles (32x32x16) */ + ROM_LOAD16_BYTE( "bg21.bin", 0x000000, 0x1c8400, CRC(a10220f8) SHA1(9aa43a8e23cdf55d8623d2694b04971eaced9ba9) ) + ROM_LOAD16_BYTE( "bg22.bin", 0x000001, 0x1c8400, CRC(966f7c1d) SHA1(4699a3014c7e66d0dabd8d7982f43114b71181b7) ) + + ROM_REGION( 0x400000, "bg3", 0 ) /* bg tiles (32x32x16) */ + ROM_LOAD16_BYTE( "bg11.bin", 0x000000, 0x1bc800, CRC(68975462) SHA1(7a2458a3d2465b727f4f5bf45685f35eb4885975) ) + ROM_LOAD16_BYTE( "bg12.bin", 0x000001, 0x1bc800, CRC(feef1240) SHA1(9eb123a19ade74d8b3ce4df0b04ca97c03fb9fdc) ) // no idea what the sound hw is? ROM_REGION( 0x100000, "oki1", ROMREGION_ERASE00 ) @@ -971,17 +1091,40 @@ void gstream_state::init_gstream() m_maincpu->space(AS_PROGRAM).install_read_handler(0xd1ee0, 0xd1ee3, read32_delegate(FUNC(gstream_state::gstream_speedup_r), this)); m_xoffset = 2; - m_is_rgb = false; } +void gstream_state::rearrange_tile_data(uint8_t* ROM, uint32_t* NEW, uint32_t* NEW2) +{ + int i; + for (i = 0; i < 0x80000; i++) + { + NEW[i] = (ROM[(i * 8) + 0x000000] << 0) | (ROM[(i * 8) + 0x000001] << 8) | (ROM[(i * 8) + 0x000004] << 16) | (ROM[(i * 8) + 0x000005] << 24); + NEW2[i] = (ROM[(i * 8) + 0x000002] << 0) | (ROM[(i * 8) + 0x000003] << 8) | (ROM[(i * 8) + 0x000006] << 16) | (ROM[(i * 8) + 0x000007] << 24); + } +} + +void gstream_state::rearrange_sprite_data(uint8_t* ROM, uint32_t* NEW, uint32_t* NEW2) +{ + int i; + for (i = 0; i < 0x200000; i++) + { + NEW[i] = (ROM[(i * 2) + 0xc00000] << 24) | (ROM[(i * 2) + 0x800000] << 16) | (ROM[(i * 2) + 0x400000] << 8) | (ROM[(i * 2) + 0x000000] << 0); + NEW2[i] = (ROM[(i * 2) + 0xc00001] << 24) | (ROM[(i * 2) + 0x800001] << 16) | (ROM[(i * 2) + 0x400001] << 8) | (ROM[(i * 2) + 0x000001] << 0); + } +} + void gstream_state::init_x2222() { m_maincpu->space(AS_PROGRAM).install_read_handler(0x7ffac, 0x7ffaf, read32_delegate(FUNC(gstream_state::x2222_speedup_r), this)); // older m_maincpu->space(AS_PROGRAM).install_read_handler(0x84e3c, 0x84e3f, read32_delegate(FUNC(gstream_state::x2222_speedup2_r), this)); // newer + rearrange_sprite_data(memregion("sprites")->base(), (uint32_t*)memregion("gfx1")->base(), (uint32_t*)memregion("gfx1_lower")->base() ); + rearrange_tile_data(memregion("bg1")->base(), (uint32_t*)memregion("gfx2")->base(), (uint32_t*)memregion("gfx2_lower")->base()); + rearrange_tile_data(memregion("bg2")->base(), (uint32_t*)memregion("gfx3")->base(), (uint32_t*)memregion("gfx3_lower")->base()); + rearrange_tile_data(memregion("bg3")->base(), (uint32_t*)memregion("gfx4")->base(), (uint32_t*)memregion("gfx4_lower")->base()); + m_xoffset = 0; - m_is_rgb = true; } diff --git a/src/mame/drivers/hp9k.cpp b/src/mame/drivers/hp9k.cpp index 75215a1e8b9..c10eed0913b 100644 --- a/src/mame/drivers/hp9k.cpp +++ b/src/mame/drivers/hp9k.cpp @@ -353,7 +353,7 @@ GFXDECODE_END void hp9k_state::putChar(uint8_t thec,int x,int y,bitmap_ind16 &bitmap) { - const uint16_t* pchar=m_gfxdecode->gfx(0)->get_data(thec); + const uint8_t* pchar=m_gfxdecode->gfx(0)->get_data(thec); for (int py=0;py<HP9816_CHDIMY;py++) { diff --git a/src/mame/drivers/lucky37.cpp b/src/mame/drivers/lucky37.cpp new file mode 100644 index 00000000000..f803972b8ed --- /dev/null +++ b/src/mame/drivers/lucky37.cpp @@ -0,0 +1,194 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* + This hardware seems to be an evolution of the one found in lucky37.cpp. Its main components are: + * A001 CPU block, containing probably a Z80 or compatible CPU and ROM(s) (not dumped). + Dumper description after opening it: 3 unknown/white chips, which had no pins, with no markings. + * HD647180X0P6 MCU with internal ROM (not dumped) + * 1 32.000 MHz and 1 21.000 MHz XTALs + * 1 OKI M6295V with 1.056 MHz resonator + * 1 custom 06B30P + * 1 custom 101B10P + * 6 8-dip banks + * 1 MB8421-12L + + Exact markings on CPU block and MCU from the PCBs the games were dumped from: + + Lucky 37: + A001: marked A 9A2. Sticker: 8907 1990.6 L-37 TYPE301 + MCU: Sticker: 8907 1990.6 L-37 M.COM + + Lucky 25: + A001: marked B 9F2. No sticker + MCU: No sticker + + Lucky 21: + A001: marked A 9B2. Sticker: 8907 199(unreadable) L-21 TYPE302 + MCU: Sticker: 8907 1990.6 L-21 M.COM + + + Lucky 21-D: + A001: marked B 9G1. Sticker: 8907 1991.03 L-21-D BET/WON + MCU: Sticker: 8907 1990.10 L21-D M.COM + + Not much can be done until main CPU and MCU ROMs are dumped. +*/ + +#include "emu.h" + +#include "cpu/z80/z80.h" +#include "cpu/z180/z180.h" +#include "machine/mb8421.h" +#include "machine/nvram.h" +#include "sound/okim6295.h" +#include "screen.h" +#include "speaker.h" + +class lucky37_state : public driver_device +{ +public: + lucky37_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag) + { } + + void lucky37(machine_config &config); +}; + +static INPUT_PORTS_START( lucky37 ) + PORT_START("DSW1") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW1:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW1:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW1:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW1:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW1:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW1:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW1:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW1:8") + + PORT_START("DSW2") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW2:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW2:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW2:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW2:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW2:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW2:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW2:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW2:8") + + PORT_START("DSW3") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW3:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW3:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW3:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW3:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW3:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW3:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW3:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW3:8") + + PORT_START("DSW4") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW4:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW4:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW4:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW4:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW4:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW4:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW4:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW4:8") + + PORT_START("DSW5") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW5:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW5:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW5:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW5:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW5:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW5:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW5:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW5:8") + + PORT_START("DSW6") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW6:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW6:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW6:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW6:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW6:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW6:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW6:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW6:8") +INPUT_PORTS_END + +void lucky37_state::lucky37(machine_config &config) +{ + /* basic machine hardware */ + Z80(config, "maincpu", 32_MHz_XTAL / 8); // not verified +} + +ROM_START( lucky21 ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "a001-a9b2", 0x0000, 0x10000, NO_DUMP ) + + ROM_REGION( 0x8000, "mcu", 0 ) + ROM_LOAD( "internal_rom", 0x0000, 0x8000, NO_DUMP ) + + ROM_REGION( 0xc0000, "unsorted", 0 ) + ROM_LOAD( "1.bin", 0x00000, 0x20000, CRC(2198b736) SHA1(556fd89dc9d1183a672324b7e1bb6350331459d2) ) + ROM_LOAD( "2.bin", 0x20000, 0x20000, CRC(fe7bbfef) SHA1(5b1413d26049e4e5c04e05a71f552d2999d57ed5) ) + ROM_LOAD( "3.bin", 0x40000, 0x20000, CRC(c4c3f642) SHA1(4dba751f74717e4ef158f21c3e2a1b2d4802bb51) ) + ROM_LOAD( "4.bin", 0x60000, 0x20000, CRC(358d3791) SHA1(d3e01008dbfc0daea255053f1d269e898d8698ea) ) + ROM_LOAD( "5.bin", 0x80000, 0x20000, CRC(0331c70a) SHA1(e6ace84001bfbbd78acdd30c8d5f631705731e81) ) + ROM_LOAD( "7.bin", 0xa0000, 0x20000, CRC(e43403d2) SHA1(3beddbd0476d88aa5f7b918b95fec382c28a4fe5) ) +ROM_END + +ROM_START( lucky21d ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "a001-b9g1", 0x0000, 0x10000, NO_DUMP ) + + ROM_REGION( 0x8000, "mcu", 0 ) + ROM_LOAD( "internal_rom", 0x0000, 0x8000, NO_DUMP ) + + ROM_REGION( 0xe0000, "unsorted", 0 ) + ROM_LOAD( "1.bin", 0x00000, 0x20000, CRC(e512ec6d) SHA1(28925c54edc002ee9d575e2ef53bccb02df176a0) ) + ROM_LOAD( "2.bin", 0x20000, 0x20000, CRC(8ffcb12c) SHA1(36c395765c8f50cf76eee18bf6c81a6bf20afb09) ) + ROM_LOAD( "3.bin", 0x40000, 0x20000, CRC(23b72a30) SHA1(dca28dadb4ed4200a37e77706b4db003e07f7336) ) + ROM_LOAD( "4.bin", 0x60000, 0x20000, CRC(f47ee6d7) SHA1(97235e053e2913041953be37352c51ab8399a209) ) + ROM_LOAD( "5.bin", 0x80000, 0x20000, CRC(ba7c7d3b) SHA1(cb849218ec9716f4ed48115ab0a091a2d19d5314) ) + ROM_LOAD( "6.bin", 0xa0000, 0x20000, CRC(f20ef81e) SHA1(5db3f106b555b98518ef0e5b11cc582369e52ff8) ) + ROM_LOAD( "7.bin", 0xc0000, 0x20000, CRC(e43403d2) SHA1(3beddbd0476d88aa5f7b918b95fec382c28a4fe5) ) +ROM_END + +ROM_START( lucky25 ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "a001-b9f2", 0x0000, 0x10000, NO_DUMP ) + + ROM_REGION( 0x8000, "mcu", 0 ) + ROM_LOAD( "internal_rom", 0x0000, 0x8000, NO_DUMP ) + + ROM_REGION( 0xc0000, "unsorted", 0 ) + ROM_LOAD( "1.bin", 0x00000, 0x20000, CRC(e504afa8) SHA1(efc984037ca692de44d7f829fec6445315bf5a54) ) + ROM_LOAD( "2.bin", 0x20000, 0x20000, CRC(d81e51cc) SHA1(273c93bf0657da4921de55ffdfba0940ff90bc15) ) + ROM_LOAD( "3.bin", 0x40000, 0x20000, CRC(4dc0e8c4) SHA1(3dd5b64dbe6d503872e06fcb9e9a85b645accf8c) ) + ROM_LOAD( "4.bin", 0x60000, 0x20000, CRC(f449eae6) SHA1(07830626a4d68a6ee3721f5306addfaf05c319ca) ) + ROM_LOAD( "5.bin", 0x80000, 0x20000, CRC(d10202a3) SHA1(3a866bc0585f90c5cfd75ba1ced2912a8a448678) ) + ROM_LOAD( "6.bin", 0xa0000, 0x20000, CRC(6c551fee) SHA1(d69a7badfa05fa35d3cad1cf565ad554f927c4b4) ) +ROM_END + +ROM_START( lucky37 ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "a001-a9a2", 0x0000, 0x10000, NO_DUMP ) + + ROM_REGION( 0x8000, "mcu", 0 ) + ROM_LOAD( "internal_rom", 0x0000, 0x8000, NO_DUMP ) + + ROM_REGION( 0xc0000, "unsorted", 0 ) + ROM_LOAD( "1.bin", 0x00000, 0x20000, CRC(15729cbb) SHA1(2e3255f0ff2e084311be41c908ab5a2be8c1b25d) ) + ROM_LOAD( "2.bin", 0x20000, 0x20000, CRC(4a48de16) SHA1(f74fabc3523126e935ccedd8e5efbe1d1c8b80ee) ) + ROM_LOAD( "3.bin", 0x40000, 0x20000, CRC(84a4535c) SHA1(8f6ff1503e5fd5ee6f9f2ff101c4958fad040321) ) + ROM_LOAD( "4.bin", 0x60000, 0x20000, CRC(bd6d49ff) SHA1(b19be51a93b76e506eab8f1cee898b1750c2ee96) ) + ROM_LOAD( "5.bin", 0x80000, 0x20000, CRC(a8fad083) SHA1(85c963859a0432b26ed66ad6e4edc56071ac55a3) ) + ROM_LOAD( "6.bin", 0xa0000, 0x20000, CRC(3283c1b7) SHA1(7a30dd55216b47332ea7c18c2378352f405b2f0a) ) +ROM_END + +GAME( 199?, lucky21, 0, lucky37, lucky37, lucky37_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky 21", MACHINE_IS_SKELETON ) +GAME( 199?, lucky21d, 0, lucky37, lucky37, lucky37_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky 21-D", MACHINE_IS_SKELETON ) +GAME( 199?, lucky25, 0, lucky37, lucky37, lucky37_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky 25", MACHINE_IS_SKELETON ) +GAME( 199?, lucky37, 0, lucky37, lucky37, lucky37_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky 37", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/lucky74.cpp b/src/mame/drivers/lucky74.cpp index eef05d50adb..2cade54aa04 100644 --- a/src/mame/drivers/lucky74.cpp +++ b/src/mame/drivers/lucky74.cpp @@ -241,7 +241,7 @@ _ - Regarding the abobe diagram, there are 2 different states controlled by both 06B53P. + Regarding the above diagram, there are 2 different states controlled by both 06B53P. Each state arrange a different palette that will be assigned to each graphics bank. As we can see here, same pin of different PROMs are connected together in parallel. @@ -304,7 +304,7 @@ Test Mode CANCEL DE E0 00 DF EF 01 "call attendant" Coin EF E0 00 DF F6 01 "ready?" - (*) "big" and "small" are splitted from the sample "big or small". + (*) "big" and "small" are split from the sample "big or small". So, you can easily see that writes to ports 0x00-0x01 define the start (pos) offset, @@ -331,7 +331,7 @@ devices from this hardware, plus V-Sync, H-Sync and (V+H)-Sync (composite) frequencies. All generated clocks are proportional to the Clock In (12MHz). There are not fixed or - harcoded frequencies. + hardcoded frequencies. Pinout diff --git a/src/mame/drivers/mediagx.cpp b/src/mame/drivers/mediagx.cpp index 5d6b36d1ce1..61f4cfae945 100644 --- a/src/mame/drivers/mediagx.cpp +++ b/src/mame/drivers/mediagx.cpp @@ -276,7 +276,7 @@ void mediagx_state::video_start() void mediagx_state::draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y) { int i,j; - const uint16_t *dp; + const uint8_t *dp; int index = 0; const pen_t *pens = &m_palette->pen(0); @@ -287,7 +287,7 @@ void mediagx_state::draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, g uint32_t *p = &bitmap.pix32(j); for (i=x; i < x+8; i++) { - uint16_t pen = dp[index++]; + uint8_t pen = dp[index++]; if (pen) p[i] = pens[gfx->colorbase() + (att & 0xf)]; else diff --git a/src/mame/drivers/mindset.cpp b/src/mame/drivers/mindset.cpp index 3f3f006a381..eee0e5169ad 100644 --- a/src/mame/drivers/mindset.cpp +++ b/src/mame/drivers/mindset.cpp @@ -313,8 +313,19 @@ void mindset_state::dispctrl_w(u16 data) { u16 chg = m_dispctrl ^ data; m_dispctrl = data; - if(chg & 0xff00) - logerror("display control %04x\n", m_dispctrl); + if(chg & 0xff88) + logerror("display control %s bank=%c %s %s h=%d ppx=%d w=%s interlace=%d rreg=%d indicator=%s wreg=%d\n", + m_dispctrl & 0x8000 ? "?15" : "?!15", + m_dispctrl & 0x4000 ? '1' : '0', + m_dispctrl & 0x2000 ? "ibm" : "native", + m_dispctrl & 0x1000 ? "?12" : "?!12", + m_dispctrl & 0x0800 ? "400" : "200", + (m_dispctrl & 0x0600) >> 9, + m_dispctrl & 0x0100 ? "320" : "640", + m_dispctrl & 0x0080 ? "on" : "off", + (m_dispctrl & 0x0070) >> 4, + m_dispctrl & 0x0008 ? "on" : "off", + m_dispctrl & 7); } u16 mindset_state::dispreg_r() @@ -329,6 +340,7 @@ u16 mindset_state::dispreg_r() } case 5: { // wants 0080 set to be able to upload the palette + // may be a field indicator return 0x0080; } } @@ -339,7 +351,7 @@ u16 mindset_state::dispreg_r() void mindset_state::dispreg_w(u16 data) { - switch(m_dispctrl & 0xf) { + switch(m_dispctrl & 0x7) { case 0: m_screenpos = data; logerror("screen position (%d, %d)\n", (data >> 8) & 15, (data >> 12) & 15); @@ -377,21 +389,20 @@ void mindset_state::dispreg_w(u16 data) } case 4: { data = sw(data); - u8 r = 0x11*(((data & 0x4000) >> 11) | (data & 7)); - u8 g = 0x11*(((data & 0x2000) >> 10) | ((data & 0x38) >> 3)); - u8 b = 0x11*(((data & 0x1000) >> 9) | ((data & 0x1c0) >> 6)); - - if(!(data & 0x8000)) { - r = r * 0.75; - g = g * 0.75; - b = b * 0.75; - } + u8 r = (0x49*(data & 7)) >> 1; + u8 g = (0x49*((data & 0x38) >> 3)) >> 1; + u8 b = (0x49*((data & 0x1c0) >> 6)) >> 1; + m_palette[m_borderidx] = (r << 16) | (g << 8) | b; m_genlock[m_borderidx] = data & 0x0200; logerror("palette[%x] = %04x -> %06x.%d\n", m_borderidx, data, m_palette[m_borderidx], m_genlock[m_borderidx]); m_borderidx = (m_borderidx + 1) & 0xf; break; } + case 5: { + logerror("genlock %s%s, extra=%c\n", data & 0x0200 ? "on" : "off", data & 0x0100 ? " fixed" : "", data & 0x0400 ? '1' : '0'); + break; + } default: logerror("display reg[%x] = %04x\n", m_dispctrl & 0xf, data); diff --git a/src/mame/drivers/mpu4vid.cpp b/src/mame/drivers/mpu4vid.cpp index b90d5df28a1..38311f62c20 100644 --- a/src/mame/drivers/mpu4vid.cpp +++ b/src/mame/drivers/mpu4vid.cpp @@ -416,7 +416,7 @@ SCN2674_DRAW_CHARACTER_MEMBER(mpu4vid_state::display_pixels) if(!lg) { uint16_t tile = m_vid_mainram[address & 0x7fff]; - const uint16_t *line = m_gfxdecode->gfx(m_gfx_index+0)->get_data(tile & 0xfff); + const uint8_t *line = m_gfxdecode->gfx(m_gfx_index+0)->get_data(tile & 0xfff); int offset = m_gfxdecode->gfx(m_gfx_index+0)->rowbytes() * linecount; for(int i = 0; i < 8; i++) bitmap.pix32(y, x + i) = (tile >> 12) ? m_palette->pen(line[offset + i]) : m_palette->black_pen(); diff --git a/src/mame/drivers/pinball2k.cpp b/src/mame/drivers/pinball2k.cpp index c301f55354a..6d337040e06 100644 --- a/src/mame/drivers/pinball2k.cpp +++ b/src/mame/drivers/pinball2k.cpp @@ -166,7 +166,7 @@ void pinball2k_state::video_start() void pinball2k_state::draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y) { int i,j; - const uint16_t *dp; + const uint8_t *dp; int index = 0; const pen_t *pens = m_palette->pens(); @@ -177,7 +177,7 @@ void pinball2k_state::draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t *p = &bitmap.pix32(j); for (i=x; i < x+8; i++) { - uint16_t pen = dp[index++]; + uint8_t pen = dp[index++]; if (pen) p[i] = pens[gfx->colorbase() + (att & 0xf)]; else diff --git a/src/mame/drivers/pk8020.cpp b/src/mame/drivers/pk8020.cpp index eb3bb7fb4e0..08c507743d9 100644 --- a/src/mame/drivers/pk8020.cpp +++ b/src/mame/drivers/pk8020.cpp @@ -2,10 +2,20 @@ // copyright-holders:Miodrag Milanovic, AJR /*************************************************************************** - PK-8020 driver by Miodrag Milanovic - based on work of Sergey Erokhin from pk8020.narod.ru +PK-8020 driver by Miodrag Milanovic + based on work of Sergey Erokhin from pk8020.narod.ru - 18/07/2008 Preliminary driver. +2008-07-18 Preliminary driver. + +Cassette is "best guess", as I was unable to locate any recordings, and +also do not know the commands to save and load. SAVE and LOAD appear when +F2 or shift-F2 pressed (in Korvet), but only produce errors. + +Status as at 2019-07-19: +Korvet - can boot CP/M, but the keyboard then doesn't work. +Neiva - keyboard not working +BK8T - keyboard not working, stuck at a "config" screen. +Kontur - needs to boot from a floppy and we don't have any that work ****************************************************************************/ @@ -306,8 +316,9 @@ void pk8020_state::pk8020(machine_config &config) SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); - //CASSETTE(config, m_cass).set_default_state(CASSETTE_PLAY); - //m_cass->add_route(ALL_OUTPUTS, "mono", 0.05); + CASSETTE(config, m_cass); + m_cass->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED); + m_cass->add_route(ALL_OUTPUTS, "mono", 0.05); CENTRONICS(config, m_printer, centronics_devices, nullptr); m_printer->busy_handler().set(m_inr, FUNC(pic8259_device::ir6_w)).invert(); @@ -378,7 +389,7 @@ ROM_END /* Driver */ /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -COMP( 1987, korvet, 0, 0, pk8020, pk8020, pk8020_state, empty_init, "<unknown>", "PK8020 Korvet", MACHINE_SUPPORTS_SAVE) -COMP( 1987, neiva, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "<unknown>", "PK8020 Neiva", MACHINE_SUPPORTS_SAVE) -COMP( 1987, kontur, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "<unknown>", "PK8020 Kontur", MACHINE_SUPPORTS_SAVE) -COMP( 1987, bk8t, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "<unknown>", "BK-8T", MACHINE_SUPPORTS_SAVE) +COMP( 1987, korvet, 0, 0, pk8020, pk8020, pk8020_state, empty_init, "<unknown>", "PK8020 Korvet", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE) +COMP( 1987, neiva, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "<unknown>", "PK8020 Neiva", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE) +COMP( 1987, kontur, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "<unknown>", "PK8020 Kontur", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE) +COMP( 1987, bk8t, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "<unknown>", "BK-8T", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE) diff --git a/src/mame/drivers/poly88.cpp b/src/mame/drivers/poly88.cpp index d4f80d7fb15..4d78faaf828 100644 --- a/src/mame/drivers/poly88.cpp +++ b/src/mame/drivers/poly88.cpp @@ -9,6 +9,10 @@ Poly-88 driver by Miodrag Milanovic All input must be UPPERcase. +11K is the minimal amount of user RAM required to run BASIC. PolyMorphic's +"System 16" package shipped with 16K of RAM (as did the 8813), though some +of their lesser systems did not. + ToDo: - Polyphase format not working because 8251 device doesn't support sync. @@ -43,6 +47,7 @@ at least some models of the Poly-88 are known to have used.) #include "emu.h" #include "includes/poly88.h" +#include "bus/s100/poly16k.h" #include "bus/s100/polyfdc.h" #include "bus/s100/polyvti.h" #include "bus/s100/seals8k.h" @@ -99,6 +104,7 @@ static void poly88_s100_devices(device_slot_interface &device) device.option_add("vti", S100_POLY_VTI); device.option_add("8ksc", S100_8K_SC); device.option_add("8kscbb", S100_8K_SC_BB); + device.option_add("poly16k", S100_POLY_16K); device.option_add("polyfdc", S100_POLY_FDC); } @@ -106,8 +112,16 @@ DEVICE_INPUT_DEFAULTS_START(poly88_vti_1800) DEVICE_INPUT_DEFAULTS("ADDRESS", 0x3f, 0x06) // 1800-1FFF DEVICE_INPUT_DEFAULTS_END -DEVICE_INPUT_DEFAULTS_START(poly88_8ksc_2000) - DEVICE_INPUT_DEFAULTS("DSW", 0xff, 0xfd) // 2000-3FFF +DEVICE_INPUT_DEFAULTS_START(poly88_16k_2000) + DEVICE_INPUT_DEFAULTS("DSW", 0xf, 0xd) // 2000-5FFF +DEVICE_INPUT_DEFAULTS_END + +DEVICE_INPUT_DEFAULTS_START(poly88_16k_6000) + DEVICE_INPUT_DEFAULTS("DSW", 0xf, 0x9) // 6000-9FFF +DEVICE_INPUT_DEFAULTS_END + +DEVICE_INPUT_DEFAULTS_START(poly88_16k_a000) + DEVICE_INPUT_DEFAULTS("DSW", 0xf, 0x5) // A000-DFFF DEVICE_INPUT_DEFAULTS_END void poly88_state::poly88(machine_config &config) @@ -152,10 +166,15 @@ void poly88_state::poly88(machine_config &config) m_s100->vi2().set(FUNC(poly88_state::vi2_w)); m_s100->vi5().set(FUNC(poly88_state::vi5_w)); + // Poly-88 backplane has 5 slots, but CPU uses one S100_SLOT(config, m_s100_slot[0], poly88_s100_devices, "vti"); - S100_SLOT(config, m_s100_slot[1], poly88_s100_devices, nullptr); + S100_SLOT(config, m_s100_slot[1], poly88_s100_devices, "poly16k"); S100_SLOT(config, m_s100_slot[2], poly88_s100_devices, nullptr); S100_SLOT(config, m_s100_slot[3], poly88_s100_devices, nullptr); + + m_s100_slot[1]->set_option_device_input_defaults("poly16k", DEVICE_INPUT_DEFAULTS_NAME(poly88_16k_2000)); + m_s100_slot[2]->set_option_device_input_defaults("poly16k", DEVICE_INPUT_DEFAULTS_NAME(poly88_16k_6000)); + m_s100_slot[3]->set_option_device_input_defaults("poly16k", DEVICE_INPUT_DEFAULTS_NAME(poly88_16k_a000)); } void poly88_state::poly8813(machine_config &config) @@ -164,9 +183,8 @@ void poly88_state::poly8813(machine_config &config) m_onboard_io->set_addrmap(0, &poly88_state::poly8813_io); m_s100_slot[0]->set_option_device_input_defaults("vti", DEVICE_INPUT_DEFAULTS_NAME(poly88_vti_1800)); - m_s100_slot[1]->set_default_option("8ksc"); - m_s100_slot[1]->set_option_device_input_defaults("8ksc", DEVICE_INPUT_DEFAULTS_NAME(poly88_8ksc_2000)); - m_s100_slot[2]->set_default_option("polyfdc"); + m_s100_slot[1]->set_default_option("polyfdc"); + m_s100_slot[2]->set_default_option("poly16k"); // Poly-8813 backplane has 10 slots, but CPU uses one S100_SLOT(config, m_s100_slot[4], poly88_s100_devices, nullptr); @@ -174,6 +192,10 @@ void poly88_state::poly8813(machine_config &config) S100_SLOT(config, m_s100_slot[6], poly88_s100_devices, nullptr); S100_SLOT(config, m_s100_slot[7], poly88_s100_devices, nullptr); S100_SLOT(config, m_s100_slot[8], poly88_s100_devices, nullptr); + + m_s100_slot[2]->set_option_device_input_defaults("poly16k", DEVICE_INPUT_DEFAULTS_NAME(poly88_16k_2000)); + m_s100_slot[3]->set_option_device_input_defaults("poly16k", DEVICE_INPUT_DEFAULTS_NAME(poly88_16k_6000)); + m_s100_slot[4]->set_option_device_input_defaults("poly16k", DEVICE_INPUT_DEFAULTS_NAME(poly88_16k_a000)); } /* ROM definition */ diff --git a/src/mame/drivers/saitek_stratos.cpp b/src/mame/drivers/saitek_stratos.cpp index d297f030b19..16544f69ae5 100644 --- a/src/mame/drivers/saitek_stratos.cpp +++ b/src/mame/drivers/saitek_stratos.cpp @@ -5,11 +5,14 @@ Scisys Kasparov Stratos Chess Computer TODO: -- add LCD (188:88, 88:88, and 7*7 DMD bottom-left) +- emulate LCD at lower level, probably an MCU with embedded LCDC +- add LCD 7*7 DMD, it's in m_lcd_data[0x30 to 0x3b] but scrambled - corona: different addressmap, 64 leds -- add endgame rom (softwarelist?) +- tking different internal artwork +- interrupt timing is derived from the main XTAL, but result should be similar with 5MHz and 5.67MHz, + there are a couple of "FREQ. SEL" nodes on the PCB, maybe related (not the ones in input ports) +- does nvram.u7 work? it's cleared during boot, but not used after - clean up driver -- does nvram.u7 work? ***************************************************************************/ @@ -20,8 +23,14 @@ TODO: #include "machine/timer.h" #include "sound/dac.h" #include "sound/volt_reg.h" -#include "speaker.h" #include "video/pwm.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" + +#include "softlist.h" +#include "speaker.h" + +#include <algorithm> // internal artwork #include "saitek_stratos.lh" // clickable @@ -34,13 +43,14 @@ public: m_maincpu(*this, "maincpu"), m_nvram(*this, "nvram.u7"), m_rombank(*this, "rombank"), - m_extbank(*this, "extbank"), m_nvrambank(*this, "nvrambank"), - m_irqtimer(*this, "irqtimer"), m_lcd_busy(*this, "lcd_busy"), m_board(*this, "board"), m_display(*this, "display"), m_dac(*this, "dac"), + m_extrom(*this, "extrom"), + m_out_digit(*this, "digit%u", 0U), + m_out_lcd(*this, "lcd%u.%u.%u", 0U, 0U, 0U), m_inputs(*this, "IN.%u", 0) { } @@ -49,6 +59,7 @@ public: void tking2(machine_config &config); DECLARE_INPUT_CHANGED_MEMBER(cpu_freq) { set_cpu_freq(); } + DECLARE_INPUT_CHANGED_MEMBER(acl_button) { if (newval) power_off(); } DECLARE_INPUT_CHANGED_MEMBER(go_button); private: @@ -61,99 +72,122 @@ private: DECLARE_READ8_MEMBER(lcd_r); DECLARE_WRITE8_MEMBER(lcd_w); - void stratos_mem(address_map &map); + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(extrom_load); + DECLARE_READ8_MEMBER(extrom_r); + + void main_map(address_map &map); - TIMER_DEVICE_CALLBACK_MEMBER(interrupt); void set_cpu_freq(); std::unique_ptr<uint8_t[]> m_nvram_data; u8 m_select; u8 m_control; u8 m_led_data; - bool m_lcd_written; + bool m_power; - //u8 m_lcd_address; - //u8 m_lcd_ram[0x100]; - //u8 m_lcd_latch; + u8 m_lcd_address; + u8 m_lcd_count; + u8 m_lcd_data[0x40]; - u8 m_lcd_data; - void show_leds(); + void update_leds(); + void update_lcd(); + void power_off(); virtual void machine_reset() override; virtual void machine_start() override; required_device<m65c02_device> m_maincpu; required_device<nvram_device> m_nvram; required_memory_bank m_rombank; - required_memory_bank m_extbank; required_memory_bank m_nvrambank; - required_device<timer_device> m_irqtimer; required_device<timer_device> m_lcd_busy; required_device<sensorboard_device> m_board; required_device<pwm_display_device> m_display; required_device<dac_bit_interface> m_dac; - required_ioport_array<8> m_inputs; + required_device<generic_slot_device> m_extrom; + output_finder<8+1> m_out_digit; + output_finder<4, 16, 4> m_out_lcd; + required_ioport_array<8+1> m_inputs; }; void stratos_state::machine_start() { + // resolve handlers + m_out_digit.resolve(); + m_out_lcd.resolve(); + m_nvram_data = std::make_unique<uint8_t[]>(0x2000); m_nvram->set_base(m_nvram_data.get(), 0x2000); m_rombank->configure_entries(0, 2, memregion("maincpu")->base(), 0x8000); - m_extbank->configure_entries(0, 2, memregion("ext")->base(), 0x4000); m_nvrambank->configure_entries(0, 2, m_nvram_data.get(), 0x1000); - m_control = 0x40; + m_control = 0x00; + m_select = 0x00; } void stratos_state::machine_reset() { + m_power = true; set_cpu_freq(); - m_control = 0x40; - m_select = 0x00; m_rombank->set_entry(0); - m_extbank->set_entry(0); m_nvrambank->set_entry(0); } void stratos_state::set_cpu_freq() { m_maincpu->set_unscaled_clock((ioport("FAKE")->read() & 1) ? 5.67_MHz_XTAL : 5_MHz_XTAL); - - attotime period = attotime::from_hz(m_maincpu->unscaled_clock() / 0x10000); - m_irqtimer->adjust(period, 0, period); } -void stratos_state::show_leds() +void stratos_state::update_leds() { m_display->matrix_partial(0, 2, 1 << (m_control >> 5 & 1), (~m_led_data & 0xff) | (~m_control << 6 & 0x100)); } -TIMER_DEVICE_CALLBACK_MEMBER(stratos_state::interrupt) -{ - m_maincpu->set_input_line(M65C02_IRQ_LINE, HOLD_LINE); -} - INPUT_CHANGED_MEMBER(stratos_state::go_button) { - if (newval && ~m_control & 0x40) + if (newval && !m_power) { m_maincpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); machine_reset(); } } +DEVICE_IMAGE_LOAD_MEMBER(stratos_state::extrom_load) +{ + u32 size = m_extrom->common_get_size("rom"); + + // 32KB ROM only? + if (size != 0x8000) + { + image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid file size"); + return image_init_result::FAIL; + } + + m_extrom->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); + m_extrom->common_load_rom(m_extrom->get_rom_base(), size, "rom"); + + return image_init_result::PASS; +} + +READ8_MEMBER(stratos_state::extrom_r) +{ + u16 bank = BIT(m_control, 1) * 0x4000; + return (m_extrom->exists()) ? m_extrom->read_rom(offset | bank) : 0xff; +} + + WRITE8_MEMBER(stratos_state::p2000_w) { - m_dac->write(0); // guessed + // d0-d3: input/led mux + // d4-d7: chessboard led data m_select = data; - m_display->matrix_partial(2, 4, ~m_select >> 4 & 0xf, 1 << (m_select & 0xf)); } READ8_MEMBER(stratos_state::p2200_r) { + // d0-d7: chessboard sensors return ~m_board->read_file(m_select & 0xf); } @@ -164,9 +198,11 @@ WRITE8_MEMBER(stratos_state::p2200_w) WRITE8_MEMBER(stratos_state::p2400_w) { + // d0-d7: button leds data m_led_data = data; + update_leds(); - show_leds(); + m_dac->write(0); // guessed } READ8_MEMBER(stratos_state::control_r) @@ -180,53 +216,102 @@ READ8_MEMBER(stratos_state::control_r) if (m_lcd_busy->enabled()) data |= 0x20; - // battery low? - data |= 0x80; + // battery low + data |= m_inputs[8]->read(); } + // read button panel if (sel < 8) data |= m_inputs[sel]->read() << 5; - return data; } +void stratos_state::power_off() +{ + m_power = false; + m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + + // clear display + m_display->matrix(0, 0); + + std::fill_n(m_lcd_data, ARRAY_LENGTH(m_lcd_data), 0); + update_lcd(); +} + WRITE8_MEMBER(stratos_state::control_w) { u8 prev = m_control; - m_control = data; + + // d0: main rom bank + // d1: ext rom bank + // d1: nvram bank? m_rombank->set_entry(data >> 0 & 1); - m_extbank->set_entry(data >> 1 & 1); // ? m_nvrambank->set_entry((data >> 1) & 1); - show_leds(); + // d2: mode led state + // d5: button leds select + update_leds(); // d6 falling edge: power-off request if (~data & prev & 0x40) - { - m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); - - // clear display - m_display->matrix(0, 0); - } + power_off(); } +void stratos_state::update_lcd() +{ + // output individual segments + for (int i = 0; i < 0x40; i++) + for (int j = 0; j < 4; j++) + m_out_lcd[i >> 4][i & 0xf][j] = BIT(m_lcd_data[i], j); + + m_out_digit[0] = 0; // where? + + // upper digits + for (int i = 0; i < 4; i++) + m_out_digit[i + 1] = (m_lcd_data[0x01 + i * 2] << 4 | m_lcd_data[0x01 + i * 2 + 1]) & 0x7f; + + // lower digits + for (int i = 0; i < 4; i++) + m_out_digit[i + 5] = (m_lcd_data[0x11 + i * 2] << 4 | m_lcd_data[0x11 + i * 2 + 1]) & 0x7f; +} READ8_MEMBER(stratos_state::lcd_r) { + // unknown, maybe resets lcd controller return 0; } WRITE8_MEMBER(stratos_state::lcd_w) { - m_lcd_data = data; - m_lcd_written = true; + // d0-d3: lcd data + // d4-d7: unused? + data &= 0xf; + + if (m_lcd_count == 0) + m_lcd_address = data; + else + { + // write to lcd row + if (m_lcd_address > 0 && m_lcd_address <= 4) + m_lcd_data[(((m_lcd_address - 1) << 4) + (m_lcd_count - 1)) & 0x3f] = data; + } + + // it expects a specific number of writes for each row + const u8 maxcount[5] = { 1, 9, 9, 1, 12 }; + if (m_lcd_address > 4 || m_lcd_count == maxcount[m_lcd_address]) + { + m_lcd_count = 0; + update_lcd(); + } + else + m_lcd_count++; m_lcd_busy->adjust(attotime::from_usec(50)); // ? } -void stratos_state::stratos_mem(address_map &map) +void stratos_state::main_map(address_map &map) { map(0x0000, 0x1fff).ram().share("nvram.u6"); map(0x2000, 0x2000).w(FUNC(stratos_state::p2000_w)); @@ -235,7 +320,7 @@ void stratos_state::stratos_mem(address_map &map) map(0x2600, 0x2600).rw(FUNC(stratos_state::control_r), FUNC(stratos_state::control_w)); map(0x2800, 0x37ff).bankrw("nvrambank"); map(0x3800, 0x3800).rw(FUNC(stratos_state::lcd_r), FUNC(stratos_state::lcd_w)); - map(0x4000, 0x7fff).bankr("extbank"); + map(0x4000, 0x7fff).r(FUNC(stratos_state::extrom_r)); map(0x8000, 0xffff).bankr("rombank"); } @@ -243,7 +328,7 @@ static INPUT_PORTS_START( stratos ) PORT_START("IN.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Set Up") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_L) PORT_NAME("Level") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_CUSTOM) // freq sel PORT_START("IN.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("Sound") @@ -268,20 +353,26 @@ static INPUT_PORTS_START( stratos ) PORT_START("IN.5") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_EQUALS) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME("Function") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_CUSTOM) // freq sel PORT_START("IN.6") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Library") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Info") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_CUSTOM) // freq sel PORT_START("IN.7") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Analysis") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Normal") + PORT_START("IN.8") + PORT_CONFNAME( 0x80, 0x80, "Battery Status" ) + PORT_CONFSETTING( 0x00, "Low" ) + PORT_CONFSETTING( 0x80, DEF_STR( Normal ) ) + PORT_START("RESET") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_CHANGED_MEMBER(DEVICE_SELF, stratos_state, go_button, nullptr) PORT_NAME("Go") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, stratos_state, acl_button, nullptr) PORT_NAME("ACL") PORT_START("FAKE") PORT_CONFNAME( 0x01, 0x00, "CPU Frequency" ) PORT_CHANGED_MEMBER(DEVICE_SELF, stratos_state, cpu_freq, nullptr) // factory set @@ -289,11 +380,19 @@ static INPUT_PORTS_START( stratos ) PORT_CONFSETTING( 0x01, "5.67MHz" ) INPUT_PORTS_END +static INPUT_PORTS_START( tking2 ) + PORT_INCLUDE( stratos ) + + PORT_MODIFY("IN.5") + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_CUSTOM) +INPUT_PORTS_END + void stratos_state::stratos(machine_config &config) { /* basic machine hardware */ M65C02(config, m_maincpu, 5_MHz_XTAL); // see set_cpu_freq - m_maincpu->set_addrmap(AS_PROGRAM, &stratos_state::stratos_mem); + m_maincpu->set_addrmap(AS_PROGRAM, &stratos_state::main_map); + m_maincpu->set_periodic_int(FUNC(stratos_state::irq0_line_hold), attotime::from_hz(75)); NVRAM(config, "nvram.u6", nvram_device::DEFAULT_ALL_0); NVRAM(config, "nvram.u7", nvram_device::DEFAULT_ALL_0); @@ -302,7 +401,6 @@ void stratos_state::stratos(machine_config &config) m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess)); m_board->set_delay(attotime::from_msec(350)); - TIMER(config, "irqtimer").configure_generic(FUNC(stratos_state::interrupt)); TIMER(config, "lcd_busy").configure_generic(timer_device::expired_delegate()); /* video hardware */ @@ -313,6 +411,12 @@ void stratos_state::stratos(machine_config &config) SPEAKER(config, "speaker").front_center(); DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); VOLTAGE_REGULATOR(config, "vref").add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); + + /* extension rom */ + GENERIC_CARTSLOT(config, m_extrom, generic_plain_slot, "saitek_egr", "bin"); + m_extrom->set_device_load(FUNC(stratos_state::extrom_load), this); + + SOFTWARE_LIST(config, "cart_list").set_original("saitek_egr"); } void stratos_state::corona(machine_config &config) @@ -335,63 +439,52 @@ ROM_START( stratos ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("w1y01f_728m_u3.u3", 0x0000, 0x8000, CRC(b58a7256) SHA1(75b3a3a65f4ca8d52aa5b17a06319bff59d9014f) ) ROM_LOAD("bw1_819n_u4.u4", 0x8000, 0x8000, CRC(cb0de631) SHA1(f78d40213be21775966cbc832d64acd9b73de632) ) - - ROM_REGION( 0x8000, "ext", 0 ) - ROM_FILL( 0x0000, 0x8000, 0xff ) ROM_END -ROM_START( stratosl ) +ROM_START( stratosa ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("w1y01f_728l_u3.u3", 0x0000, 0x8000, CRC(19a22058) SHA1(a5ca54d870c70b7ce9c7be2951800bf49cc57527) ) ROM_LOAD("bw1_819n_u4.u4", 0x8000, 0x8000, CRC(cb0de631) SHA1(f78d40213be21775966cbc832d64acd9b73de632) ) - - ROM_REGION( 0x8000, "ext", 0 ) - ROM_FILL( 0x0000, 0x8000, 0xff ) ROM_END -ROM_START( tking ) +ROM_START( tking ) // PCB rev. 10 ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("y01f_713d_u3.u3", 0x0000, 0x8000, CRC(b8c6d853) SHA1(98923f44bbbd2ea17c269850971d3df229e6057e) ) ROM_LOAD("y01f_712a_u4.u4", 0x8000, 0x8000, CRC(7d3f8f7b) SHA1(8be5d8d988ff0577ccfec0a773bfd94599f2534f) ) - - ROM_REGION( 0x8000, "ext", 0 ) - ROM_FILL( 0x0000, 0x8000, 0xff ) ROM_END -ROM_START( tkingl ) +ROM_START( tkinga ) // PCB rev. 3, also PCB rev. 5 ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("w1y01f_728l_u3.u3", 0x0000, 0x8000, CRC(19a22058) SHA1(a5ca54d870c70b7ce9c7be2951800bf49cc57527) ) ROM_LOAD("y01f-b_819o_u4.u4", 0x8000, 0x8000, CRC(336040d4) SHA1(aca662b8cc4d6bafd61ca158c768ba8896117169) ) - - ROM_REGION( 0x8000, "ext", 0 ) - ROM_FILL( 0x0000, 0x8000, 0xff ) ROM_END -ROM_START( tkingp ) +ROM_START( tkingb ) // PCB rev. 7 ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("w1y01f_728p_u3.u3", 0x0000, 0x8000, CRC(ad77f83e) SHA1(598fdb1e40267d9d43a3d8f287723070b9afa349) ) ROM_LOAD("y01f-b_819o_u4.u4", 0x8000, 0x8000, CRC(336040d4) SHA1(aca662b8cc4d6bafd61ca158c768ba8896117169) ) - - ROM_REGION( 0x8000, "ext", 0 ) - ROM_FILL( 0x0000, 0x8000, 0xff ) ROM_END ROM_START( corona ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD("w2_708g_u2-a.u2", 0x0000, 0x8000, CRC(52568bb4) SHA1(83fe91787e17bbefc2b3ec651ddb11c88990060d) ) - ROM_LOAD("bw2_708a_u3-b.u3", 0x8000, 0x8000, CRC(32848f73) SHA1(a447543e3eb4757f9afed26fde77b66985eb96a7) ) + ROM_LOAD("w2_708g_u2.u2", 0x0000, 0x8000, CRC(52568bb4) SHA1(83fe91787e17bbefc2b3ec651ddb11c88990060d) ) + ROM_LOAD("bw2_708a_u3.u3", 0x8000, 0x8000, CRC(32848f73) SHA1(a447543e3eb4757f9afed26fde77b66985eb96a7) ) +ROM_END - ROM_REGION( 0x8000, "ext", 0 ) - ROM_FILL( 0x0000, 0x8000, 0xff ) +ROM_START( coronaa ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("w2_a14c_u2.u2", 0x0000, 0x8000, CRC(be82e199) SHA1(cfcc573774b6907ed137dca01fa7f3fce493a89f) ) + ROM_LOAD("bw2_a14_u3.u3", 0x8000, 0x8000, CRC(abe87285) SHA1(b15f7ddeac78d252cf413ba4085523e44c6d15df) ) ROM_END /* YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS */ -CONS( 1986, stratos, 0, 0, stratos, stratos, stratos_state, empty_init, "SciSys", "Kasparov Stratos (rev. M)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1986, stratosl, stratos, 0, stratos, stratos, stratos_state, empty_init, "SciSys", "Kasparov Stratos (rev. L)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1986, stratos, 0, 0, stratos, stratos, stratos_state, empty_init, "SciSys", "Kasparov Stratos (set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1986, stratosa, stratos, 0, stratos, stratos, stratos_state, empty_init, "SciSys", "Kasparov Stratos (set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1990, tking, 0, 0, tking2, stratos, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (rev. D)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK ) // aka Turbo King II -CONS( 1988, tkingl, tking, 0, stratos, stratos, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (rev. L)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1988, tkingp, tking, 0, stratos, stratos, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (rev. P)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1990, tking, 0, 0, tking2, tking2, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (set 1, ver. D)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) // aka Turbo King II +CONS( 1988, tkinga, tking, 0, stratos, stratos, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) // oldest? +CONS( 1988, tkingb, tking, 0, stratos, stratos, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (set 3)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1988, corona, 0, 0, corona, stratos, stratos_state, empty_init, "Saitek", "Kasparov Corona (rev. G)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1988, corona, 0, 0, corona, stratos, stratos_state, empty_init, "Saitek", "Kasparov Corona (ver. D+)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) // aka Corona II +CONS( 1988, coronaa, corona, 0, corona, stratos, stratos_state, empty_init, "Saitek", "Kasparov Corona (ver. D)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/sb8085.cpp b/src/mame/drivers/sb8085.cpp new file mode 100644 index 00000000000..240f1ba3404 --- /dev/null +++ b/src/mame/drivers/sb8085.cpp @@ -0,0 +1,312 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + Preliminary driver for Space Byte 8085 CPU. + + This is an early Intel 8085-based single-board computer whose onboard + I/O consists of RS232 ports for a CRT and serial printer and a parallel + interface intended for use with ICOM's FD 3700 or Frugal Floppy disk + controller. The resident monitor program also supports the Tarbell + cassette tape interface and the PolyMorphic Systems Video Terminal + Interface. + + The bus connector is only somewhat S-100 compatible. Anticipating the + draft IEEE standard, no clock signal is placed on pin 25 or 49 (though + documentation recommends jumpering pin 49 to the 3.072 MHz clock on pin + 24 for the VTI). The conventional INT and VI0-7 pins are disregarded in + favor of collecting the four 8085-specific interrupts on pins 12-15 in + ascending order of priority. SDSB/CDSB/ASDB/DODSB are also disregarded, + and there is an alternate PHOLD input on pin 16. + + Space Byte also advertised a 16K static RAM board and a 2708/2716 + EPROM programmer for use in this system. + +***************************************************************************/ + +#include "emu.h" + +#include "cpu/i8085/i8085.h" +#include "bus/rs232/rs232.h" +#include "bus/s100/s100.h" +#include "bus/s100/polyvti.h" +#include "bus/s100/seals8k.h" +#include "machine/i8155.h" +#include "machine/i8251.h" + +class sb8085_state : public driver_device +{ +public: + sb8085_state(const machine_config &config, device_type type, const char *tag) + : driver_device(config, type, tag) + , m_maincpu(*this, "maincpu") + , m_i8155(*this, "i8155") + , m_usart(*this, "usart") + , m_crt(*this, "crt") + , m_printer(*this, "printer") + , m_s100(*this, "s100") + , m_program(*this, "program") + , m_config_select(*this, "SELECT") + , m_portd(*this, "PORTD") + { + } + + static constexpr feature_type unemulated_features() { return feature::DISK | feature::TAPE; } + + void sb8085(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + bool board_selected(offs_t offset); + u8 mem_r(offs_t offset); + void mem_w(offs_t offset, u8 data); + u8 in_r(offs_t offset); + void out_w(offs_t offset, u8 data); + DECLARE_WRITE_LINE_MEMBER(phantom_disable_w); + + DECLARE_WRITE_LINE_MEMBER(printer_select_w); + DECLARE_WRITE_LINE_MEMBER(usart_txd_w); + DECLARE_WRITE_LINE_MEMBER(crt_rts_w); + DECLARE_WRITE_LINE_MEMBER(printer_rts_w); + + void mem_map(address_map &map); + void io_map(address_map &map); + + required_device<i8085a_cpu_device> m_maincpu; + required_device<i8155_device> m_i8155; + required_device<i8251_device> m_usart; + required_device<rs232_port_device> m_crt; + required_device<rs232_port_device> m_printer; + required_device<s100_bus_device> m_s100; + required_region_ptr<u8> m_program; + required_ioport m_config_select; + required_ioport m_portd; + + bool m_phantom; + bool m_printer_select; + bool m_usart_txd; + bool m_crt_rts; + bool m_printer_rts; +}; + +void sb8085_state::machine_start() +{ + m_printer_select = false; + m_usart_txd = true; + m_crt_rts = true; + m_printer_rts = true; + + // Pins 6, 8, 5 (printer) are tied to +12 + m_crt->write_dtr(0); + m_printer->write_rts(0); + m_printer->write_dtr(0); + + save_item(NAME(m_phantom)); + save_item(NAME(m_printer_select)); + save_item(NAME(m_usart_txd)); + save_item(NAME(m_crt_rts)); + save_item(NAME(m_printer_rts)); +} + +void sb8085_state::machine_reset() +{ + m_phantom = false; +} + +bool sb8085_state::board_selected(offs_t offset) +{ + if (!m_phantom) + return true; + + ioport_value config = m_config_select->read(); + return !BIT(config, 1) || (offset & 0xe000) == (BIT(config, 0) ? 0xe000 : 0xc000); +} + +u8 sb8085_state::mem_r(offs_t offset) +{ + if (board_selected(offset)) + { + if ((offset & 0x1c00) < 0x0c00) + return m_program[offset & 0xfff]; + else if ((offset & 0x1c00) >= 0x1800) + return m_i8155->memory_r(offset & 0xff); + else + return 0xff; + } + else + return m_s100->smemr_r(offset); +} + +void sb8085_state::mem_w(offs_t offset, u8 data) +{ + if (board_selected(offset)) + { + if ((offset & 0x1c00) >= 0x1800) + m_i8155->memory_w(offset & 0xff, data); + } + else + m_s100->mwrt_w(offset, data); +} + +u8 sb8085_state::in_r(offs_t offset) +{ + offset |= offset << 8; + if (board_selected(offset)) + { + if ((offset & 0x1c00) == 0x0000) + return m_usart->read(BIT(offset, 8)); + else if ((offset & 0x1c00) == 0x0c00) + return m_portd->read() ^ 0xff; + else if ((offset & 0x1c00) >= 0x1800) + return m_i8155->io_r(offset & 7); + else + return 0xff; + } + else + return m_s100->sinp_r(offset); +} + +void sb8085_state::out_w(offs_t offset, u8 data) +{ + offset |= offset << 8; + if (board_selected(offset)) + { + if ((offset & 0x1c00) == 0x0000) + m_usart->write(BIT(offset, 8), data); + else if ((offset & 0x1c00) >= 0x1800) + m_i8155->io_w(offset & 7, data); + } + else + m_s100->sout_w(offset, data); +} + +WRITE_LINE_MEMBER(sb8085_state::phantom_disable_w) +{ + if (!state) + m_phantom = true; +} + +WRITE_LINE_MEMBER(sb8085_state::printer_select_w) +{ + if (state && m_printer_select) + { + m_printer_select = false; + m_crt->write_txd(m_usart_txd); + m_printer->write_txd(1); + m_usart->write_cts(m_crt_rts); + } + else if (!state && !m_printer_select) + { + m_printer_select = true; + m_crt->write_txd(1); + m_printer->write_txd(m_usart_txd); + m_usart->write_cts(m_printer_rts); + } +} + +WRITE_LINE_MEMBER(sb8085_state::usart_txd_w) +{ + m_usart_txd = state; + if (m_printer_select) + m_printer->write_txd(state); + else + m_crt->write_txd(state); +} + +WRITE_LINE_MEMBER(sb8085_state::crt_rts_w) +{ + m_crt_rts = state; + if (!m_printer_select) + m_usart->write_cts(state); +} + +WRITE_LINE_MEMBER(sb8085_state::printer_rts_w) +{ + m_printer_rts = state; + if (m_printer_select) + m_usart->write_cts(state); +} + +void sb8085_state::mem_map(address_map &map) +{ + map(0x0000, 0xffff).rw(FUNC(sb8085_state::mem_r), FUNC(sb8085_state::mem_w)); +} + +void sb8085_state::io_map(address_map &map) +{ + map(0x00, 0xff).rw(FUNC(sb8085_state::in_r), FUNC(sb8085_state::out_w)); +} + +INPUT_PORTS_START(sb8085) + PORT_START("SELECT") + PORT_CONFNAME(3, 2, "Board select") + PORT_CONFSETTING(0, "Single board") + PORT_CONFSETTING(2, "C000-DFFFH") + PORT_CONFSETTING(3, "E000-FFFFH") + + PORT_START("PORTD") + PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNKNOWN) // from disk connector +INPUT_PORTS_END + + +static void sb8085_s100_devices(device_slot_interface &device) +{ + device.option_add("vti", S100_POLY_VTI); + device.option_add("8ksc", S100_8K_SC); + device.option_add("8kscbb", S100_8K_SC_BB); +} + +static DEVICE_INPUT_DEFAULTS_START(terminal) + DEVICE_INPUT_DEFAULTS("RS232_RXBAUD", 0xff, RS232_BAUD_9600) + DEVICE_INPUT_DEFAULTS("RS232_TXBAUD", 0xff, RS232_BAUD_9600) + DEVICE_INPUT_DEFAULTS("RS232_STARTBITS", 0xff, RS232_STARTBITS_1) + DEVICE_INPUT_DEFAULTS("RS232_DATABITS", 0xff, RS232_DATABITS_7) + DEVICE_INPUT_DEFAULTS("RS232_PARITY", 0xff, RS232_PARITY_EVEN) + DEVICE_INPUT_DEFAULTS("RS232_STOPBITS", 0xff, RS232_STOPBITS_2) +DEVICE_INPUT_DEFAULTS_END + +void sb8085_state::sb8085(machine_config &config) +{ + I8085A(config, m_maincpu, 6.144_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &sb8085_state::mem_map); + m_maincpu->set_addrmap(AS_IO, &sb8085_state::io_map); + m_maincpu->in_sid_func().set(m_crt, FUNC(rs232_port_device::rxd_r)); + + I8155(config, m_i8155, 6.144_MHz_XTAL / 2); + m_i8155->out_pc_callback().set(FUNC(sb8085_state::phantom_disable_w)).bit(5); + m_i8155->out_to_callback().set(m_usart, FUNC(i8251_device::write_txc)); + m_i8155->out_to_callback().append(m_usart, FUNC(i8251_device::write_rxc)); + + I8251(config, m_usart, 6.144_MHz_XTAL / 2); + m_usart->rts_handler().set(m_crt, FUNC(rs232_port_device::write_rts)); + m_usart->txd_handler().set(FUNC(sb8085_state::usart_txd_w)); + m_usart->dtr_handler().set(FUNC(sb8085_state::printer_select_w)); + + RS232_PORT(config, m_crt, default_rs232_devices, nullptr); + m_crt->rxd_handler().set(m_usart, FUNC(i8251_device::write_rxd)); + m_crt->cts_handler().set(FUNC(sb8085_state::crt_rts_w)); + m_crt->set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal)); + + RS232_PORT(config, m_printer, default_rs232_devices, nullptr); + m_printer->cts_handler().set(FUNC(sb8085_state::printer_rts_w)); + + S100_BUS(config, m_s100, 6.144_MHz_XTAL / 2); + S100_SLOT(config, "s100:1", sb8085_s100_devices, "vti"); + S100_SLOT(config, "s100:2", sb8085_s100_devices, nullptr); + S100_SLOT(config, "s100:3", sb8085_s100_devices, nullptr); + S100_SLOT(config, "s100:4", sb8085_s100_devices, nullptr); +} + + +ROM_START(sb8085) + ROM_REGION(0xc00, "program", 0) + // From manual listing titled "SPACE BYTE 8085 PROM MONITOR 11-14-77" to be programmed on 3 TMS2708JL + ROM_LOAD("1.u19", 0x000, 0x400, CRC(9e1f11dd) SHA1(4c4482baa133dd6d437aaf749e31b72c9718eb97)) + ROM_LOAD("2.u20", 0x400, 0x400, CRC(2426af98) SHA1(b6e37041f997aeea13be79df10dc410f4b0c51a6)) + ROM_LOAD("3.u21", 0x800, 0x400, CRC(088ad01b) SHA1(6832e63dc1769db09107bc09f4c2cfb158dd8d33)) +ROM_END + +COMP(1977, sb8085, 0, 0, sb8085, sb8085, sb8085_state, empty_init, "Space Byte", "Space Byte 8085", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW) diff --git a/src/mame/drivers/scyclone.cpp b/src/mame/drivers/scyclone.cpp index a2c9aeeb2e6..c85861d269f 100644 --- a/src/mame/drivers/scyclone.cpp +++ b/src/mame/drivers/scyclone.cpp @@ -126,7 +126,7 @@ private: uint8_t m_hascollided; /* video-related */ - const uint16_t get_sprite_pixel(int x, int y); + const uint8_t get_sprite_pixel(int x, int y); const uint8_t get_bitmap_pixel(int x, int y); uint32_t draw_starfield(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t draw_bitmap_and_sprite(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -158,7 +158,7 @@ void scyclone_state::video_start() } } -const uint16_t scyclone_state::get_sprite_pixel(int x, int y) +const uint8_t scyclone_state::get_sprite_pixel(int x, int y) { int minx = 0xe0-m_sprite_xpos; int miny = 0xe0-m_sprite_ypos; @@ -178,9 +178,9 @@ const uint16_t scyclone_state::get_sprite_pixel(int x, int y) int sprx = x-minx; int spry = y-miny; - const uint16_t* srcdata = m_gfxdecode->gfx(0)->get_data(code); + const uint8_t* srcdata = m_gfxdecode->gfx(0)->get_data(code); - uint16_t pix = srcdata[spry*32 + sprx] + col*4; + uint8_t pix = srcdata[spry*32 + sprx] + col*4; return pix; } @@ -275,7 +275,7 @@ uint32_t scyclone_state::draw_bitmap_and_sprite(screen_device &screen, bitmap_rg if (pal) bitmap.pix32(y, (x*8)+i) = paldata[pal]; - uint16_t pal2 = get_sprite_pixel(realx, realy); + uint8_t pal2 = get_sprite_pixel(realx, realy); if (pal2 & 0x3) { diff --git a/src/mame/drivers/slapshot.cpp b/src/mame/drivers/slapshot.cpp index 802f769b726..280c547b272 100644 --- a/src/mame/drivers/slapshot.cpp +++ b/src/mame/drivers/slapshot.cpp @@ -635,14 +635,14 @@ void slapshot_state::driver_init() u8 *dest = srcdata; for (int c = 0; c < gx0->elements(); c++) { - const u16 *c0base = gx0->get_data(c); - const u16 *c1base = gx1->get_data(c); + const u8 *c0base = gx0->get_data(c); + const u8 *c1base = gx1->get_data(c); // loop over height for (int y = 0; y < gx0->height(); y++) { - const u16 *c0 = c0base; - const u16 *c1 = c1base; + const u8 *c0 = c0base; + const u8 *c1 = c1base; for (int x = 0; x < gx0->width(); x++) { diff --git a/src/mame/drivers/supstarf.cpp b/src/mame/drivers/supstarf.cpp index 2cf19fe2b3a..597d940addf 100644 --- a/src/mame/drivers/supstarf.cpp +++ b/src/mame/drivers/supstarf.cpp @@ -19,27 +19,27 @@ class supstarf_state : public driver_device { public: supstarf_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_soundcpu(*this, "soundcpu"), - m_psg(*this, {"psg1", "psg2"}), - m_soundlatch(*this, {"soundlatch1", "soundlatch2"}) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_soundcpu(*this, "soundcpu") + , m_psg(*this, "psg%u", 1U) + , m_soundlatch(*this, "soundlatch%u", 1U) { } void supstarf(machine_config &config); private: - DECLARE_READ8_MEMBER(psg_latch_r); - DECLARE_WRITE8_MEMBER(psg_latch_w); - DECLARE_WRITE8_MEMBER(port1_w); - DECLARE_WRITE8_MEMBER(port2_w); + u8 psg_latch_r(offs_t offset); + void psg_latch_w(offs_t offset, u8 data); + void port1_w(u8 data); + void port2_w(u8 data); DECLARE_READ_LINE_MEMBER(contacts_r); DECLARE_WRITE_LINE_MEMBER(displays_w); - DECLARE_WRITE8_MEMBER(driver_clk_w); + void driver_clk_w(offs_t offset, u8 data); DECLARE_READ_LINE_MEMBER(phase_detect_r); - DECLARE_WRITE8_MEMBER(lights_a_w); - DECLARE_WRITE8_MEMBER(lights_b_w); + void lights_a_w(u8 data); + void lights_b_w(u8 data); void main_io_map(address_map &map); void main_map(address_map &map); @@ -81,7 +81,7 @@ void supstarf_state::sound_io_map(address_map &map) map(0x00, 0xff).rw(FUNC(supstarf_state::psg_latch_r), FUNC(supstarf_state::psg_latch_w)); } -READ8_MEMBER(supstarf_state::psg_latch_r) +u8 supstarf_state::psg_latch_r(offs_t offset) { u8 result = 0xff; // AR3 +5v pullup @@ -95,12 +95,12 @@ READ8_MEMBER(supstarf_state::psg_latch_r) } if (m_latch_select) - result &= m_soundlatch[1]->read(space, 0); + result &= m_soundlatch[1]->read(); return result; } -WRITE8_MEMBER(supstarf_state::psg_latch_w) +void supstarf_state::psg_latch_w(offs_t offset, u8 data) { for (int d = 0; d < 2; d++) { @@ -112,15 +112,15 @@ WRITE8_MEMBER(supstarf_state::psg_latch_w) } if (m_latch_select) - m_soundlatch[0]->strobe(space, 0, data); + m_soundlatch[0]->strobe(data); } -WRITE8_MEMBER(supstarf_state::port1_w) +void supstarf_state::port1_w(u8 data) { m_port1_data = data; } -WRITE8_MEMBER(supstarf_state::port2_w) +void supstarf_state::port2_w(u8 data) { m_maincpu->set_input_line(INPUT_LINE_RESET, BIT(data, 4) ? CLEAR_LINE : ASSERT_LINE); if (!BIT(data, 4)) @@ -145,7 +145,7 @@ WRITE_LINE_MEMBER(supstarf_state::displays_w) { } -WRITE8_MEMBER(supstarf_state::driver_clk_w) +void supstarf_state::driver_clk_w(offs_t offset, u8 data) { } @@ -154,11 +154,11 @@ READ_LINE_MEMBER(supstarf_state::phase_detect_r) return 0; } -WRITE8_MEMBER(supstarf_state::lights_a_w) +void supstarf_state::lights_a_w(u8 data) { } -WRITE8_MEMBER(supstarf_state::lights_b_w) +void supstarf_state::lights_b_w(u8 data) { } @@ -175,36 +175,36 @@ void supstarf_state::machine_start() void supstarf_state::supstarf(machine_config &config) { - I8085A(config, m_maincpu, XTAL(5'068'800)); + I8085A(config, m_maincpu, 5.0688_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &supstarf_state::main_map); m_maincpu->set_addrmap(AS_IO, &supstarf_state::main_io_map); m_maincpu->in_sid_func().set(FUNC(supstarf_state::contacts_r)); m_maincpu->out_sod_func().set(FUNC(supstarf_state::displays_w)); - I8035(config, m_soundcpu, XTAL(5'068'800) / 2); // from 8085 pin 37 (CLK OUT) + I8035(config, m_soundcpu, 5.0688_MHz_XTAL / 2); // from 8085 pin 37 (CLK OUT) m_soundcpu->set_addrmap(AS_PROGRAM, &supstarf_state::sound_map); m_soundcpu->set_addrmap(AS_IO, &supstarf_state::sound_io_map); m_soundcpu->p1_out_cb().set(FUNC(supstarf_state::port1_w)); m_soundcpu->p2_out_cb().set(FUNC(supstarf_state::port2_w)); m_soundcpu->t1_in_cb().set(FUNC(supstarf_state::phase_detect_r)); - I8212(config, m_soundlatch[0], 0); + I8212(config, m_soundlatch[0]); m_soundlatch[0]->md_rd_callback().set_constant(0); m_soundlatch[0]->int_wr_callback().set_inputline("maincpu", I8085_RST55_LINE); - I8212(config, m_soundlatch[1], 0); + I8212(config, m_soundlatch[1]); m_soundlatch[1]->md_rd_callback().set_constant(0); m_soundlatch[1]->int_wr_callback().set_inputline("soundcpu", MCS48_INPUT_IRQ); //MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("maincpu", I8085_READY_LINE)) SPEAKER(config, "mono").front_center(); - AY8910(config, m_psg[0], XTAL(5'068'800) / 6); // from 8035 pin 1 (T0) + AY8910(config, m_psg[0], 5.0688_MHz_XTAL / 6); // from 8035 pin 1 (T0) m_psg[0]->port_a_write_callback().set(FUNC(supstarf_state::lights_a_w)); m_psg[0]->port_b_write_callback().set(FUNC(supstarf_state::lights_b_w)); m_psg[0]->add_route(ALL_OUTPUTS, "mono", 0.50); - AY8910(config, m_psg[1], XTAL(5'068'800) / 6); // from 8035 pin 1 (T0) + AY8910(config, m_psg[1], 5.0688_MHz_XTAL / 6); // from 8035 pin 1 (T0) m_psg[1]->port_a_read_callback().set_ioport("JO"); m_psg[1]->port_b_read_callback().set_ioport("I1"); m_psg[1]->add_route(ALL_OUTPUTS, "mono", 0.50); diff --git a/src/mame/drivers/taito_f2.cpp b/src/mame/drivers/taito_f2.cpp index 4bb9b1ce227..5fdd5257d23 100644 --- a/src/mame/drivers/taito_f2.cpp +++ b/src/mame/drivers/taito_f2.cpp @@ -5298,14 +5298,14 @@ void taitof2_state::init_finalb() u8 *dest = srcdata; for (int c = 0; c < gx0->elements(); c++) { - const u16 *c0base = gx0->get_data(c); - const u16 *c1base = gx1->get_data(c); + const u8 *c0base = gx0->get_data(c); + const u8 *c1base = gx1->get_data(c); // loop over height for (int y = 0; y < gx0->height(); y++) { - const u16 *c0 = c0base; - const u16 *c1 = c1base; + const u8 *c0 = c0base; + const u8 *c1 = c1base; for (int x = 0; x < gx0->width(); x++) { diff --git a/src/mame/drivers/taito_f3.cpp b/src/mame/drivers/taito_f3.cpp index 2615e49bdba..13db66e85d1 100644 --- a/src/mame/drivers/taito_f3.cpp +++ b/src/mame/drivers/taito_f3.cpp @@ -4217,14 +4217,14 @@ void taito_f3_state::tile_decode() dest = srcdata; for (int c = 0; c < spr_gfx->elements(); c++) { - const u16 *c1base = spr_gfx->get_data(c); - const u16 *c3base = spr_gfx_hi->get_data(c); + const u8 *c1base = spr_gfx->get_data(c); + const u8 *c3base = spr_gfx_hi->get_data(c); // loop over height for (int y = 0; y < spr_gfx->height(); y++) { - const u16 *c1 = c1base; - const u16 *c3 = c3base; + const u8 *c1 = c1base; + const u8 *c3 = c3base; /* Expand 2bits into 4bits format */ for (int x = 0; x < spr_gfx->width(); x++) @@ -4251,14 +4251,14 @@ void taito_f3_state::tile_decode() dest = srcdata; for (int c = 0; c < pf_gfx->elements(); c++) { - const u16 *c0base = pf_gfx->get_data(c); - const u16 *c2base = pf_gfx_hi->get_data(c); + const u8 *c0base = pf_gfx->get_data(c); + const u8 *c2base = pf_gfx_hi->get_data(c); // loop over height for (int y = 0; y < pf_gfx->height(); y++) { - const u16 *c0 = c0base; - const u16 *c2 = c2base; + const u8 *c0 = c0base; + const u8 *c2 = c2base; for (int x = 0; x < pf_gfx->width(); x++) *dest++ = (*c0++ & 0xf) | (*c2++ & 0x30); diff --git a/src/mame/drivers/zwackery.cpp b/src/mame/drivers/zwackery.cpp index a361e938d69..d9d7a5f4cc3 100644 --- a/src/mame/drivers/zwackery.cpp +++ b/src/mame/drivers/zwackery.cpp @@ -210,14 +210,14 @@ void zwackery_state::video_start() for (int code = 0; code < gfx0->elements(); code++) { const uint8_t *coldata = colordatabase + code * 32; - const uint16_t *gfxdata0 = gfx0->get_data(code); - const uint16_t *gfxdata2 = gfx2->get_data(code); + const uint8_t *gfxdata0 = gfx0->get_data(code); + const uint8_t *gfxdata2 = gfx2->get_data(code); // assume 16 rows for (int y = 0; y < 16; y++) { - const uint16_t *gd0 = gfxdata0; - const uint16_t *gd2 = gfxdata2; + const uint8_t *gd0 = gfxdata0; + const uint8_t *gd2 = gfxdata2; // 16 columns for (int x = 0; x < 16; x++, gd0++, gd2++) diff --git a/src/mame/includes/bbusters.h b/src/mame/includes/bbusters.h index bfd451853c9..d078fe982d0 100644 --- a/src/mame/includes/bbusters.h +++ b/src/mame/includes/bbusters.h @@ -58,7 +58,7 @@ protected: template<int Layer> DECLARE_WRITE16_MEMBER(pf_w); DECLARE_WRITE8_MEMBER(coin_counter_w); - const uint16_t *get_source_ptr(gfx_element *gfx, uint32_t sprite, int dx, int dy, int block); + const uint8_t *get_source_ptr(gfx_element *gfx, uint32_t sprite, int dx, int dy, int block); void draw_block(screen_device &screen, bitmap_ind16 &dest,int x,int y,int size,int flipx,int flipy,uint32_t sprite,int color,int bank,int block,int priority); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const uint16_t *source, int bank); diff --git a/src/mame/includes/bzone.h b/src/mame/includes/bzone.h index e59b94dd50e..b72ce44ca3a 100644 --- a/src/mame/includes/bzone.h +++ b/src/mame/includes/bzone.h @@ -36,12 +36,12 @@ public: void bzone(machine_config &config); protected: - DECLARE_WRITE8_MEMBER(bzone_coin_counter_w); - DECLARE_READ8_MEMBER(analog_data_r); - DECLARE_WRITE8_MEMBER(analog_select_w); + void bzone_coin_counter_w(offs_t offset, uint8_t data); + uint8_t analog_data_r(); + void analog_select_w(offs_t offset, uint8_t data); virtual void machine_start() override; INTERRUPT_GEN_MEMBER(bzone_interrupt); - DECLARE_WRITE8_MEMBER(bzone_sounds_w); + void bzone_sounds_w(uint8_t data); void bzone_base(machine_config &config); void bzone_audio(machine_config &config); @@ -71,11 +71,11 @@ public: void redbaron(machine_config &config); protected: - DECLARE_READ8_MEMBER(redbaron_joy_r); - DECLARE_WRITE8_MEMBER(redbaron_joysound_w); - DECLARE_READ8_MEMBER(earom_read); - DECLARE_WRITE8_MEMBER(earom_write); - DECLARE_WRITE8_MEMBER(earom_control_w); + uint8_t redbaron_joy_r(); + void redbaron_joysound_w(uint8_t data); + uint8_t earom_read(); + void earom_write(offs_t offset, uint8_t data); + void earom_control_w(uint8_t data); virtual void machine_start() override; virtual void machine_reset() override; diff --git a/src/mame/includes/cps1.h b/src/mame/includes/cps1.h index 83073b7611b..21aa62441d0 100644 --- a/src/mame/includes/cps1.h +++ b/src/mame/includes/cps1.h @@ -376,12 +376,12 @@ protected: int m_palette_align; int m_palette_size; int m_stars_rom_size; - uint16_t m_empty_tile[32*32]; + uint8_t m_empty_tile[32*32]; int m_cps_version; /* fcrash video config */ - uint8_t m_layer_enable_reg; - uint8_t m_layer_mask_reg[4]; + uint8_t m_layer_enable_reg; + uint8_t m_layer_mask_reg[4]; int m_layer_scroll1x_offset; int m_layer_scroll2x_offset; int m_layer_scroll3x_offset; diff --git a/src/mame/includes/decocass.h b/src/mame/includes/decocass.h index 4f503c52bdc..4db894b4a30 100644 --- a/src/mame/includes/decocass.h +++ b/src/mame/includes/decocass.h @@ -98,7 +98,7 @@ private: tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap_l; tilemap_t *m_bg_tilemap_r; - uint16_t m_empty_tile[16*16]; + uint8_t m_empty_tile[16*16]; int32_t m_watchdog_count; int32_t m_watchdog_flip; int32_t m_color_missiles; diff --git a/src/mame/includes/namcos22.h b/src/mame/includes/namcos22.h index c5f79889b25..f61174d4457 100644 --- a/src/mame/includes/namcos22.h +++ b/src/mame/includes/namcos22.h @@ -126,7 +126,7 @@ struct namcos22_object_data const u8 *czram; /* sprites */ - const u16 *source; + const u8 *source; int alpha; int line_modulo; int flipx; @@ -234,7 +234,7 @@ public: int m_poly_translucency; u16 *m_texture_tilemap; std::unique_ptr<u8[]> m_texture_tileattr; - u16 *m_texture_tiledata; + u8 *m_texture_tiledata; std::unique_ptr<u8[]> m_texture_ayx_to_pixel; int m_is_ss22; int m_mixer_flags; diff --git a/src/mame/includes/nemesis.h b/src/mame/includes/nemesis.h index b0a5089d34a..c9a43a26617 100644 --- a/src/mame/includes/nemesis.h +++ b/src/mame/includes/nemesis.h @@ -85,7 +85,7 @@ private: int m_tilemap_flip; int m_flipscreen; uint8_t m_irq_port_last; - uint16_t m_blank_tile[8*8]; + uint8_t m_blank_tile[8*8]; uint8_t m_palette_lookup[32]; /* misc */ diff --git a/src/mame/includes/pk8020.h b/src/mame/includes/pk8020.h index e6f2c2eb6f4..67c6299c292 100644 --- a/src/mame/includes/pk8020.h +++ b/src/mame/includes/pk8020.h @@ -26,22 +26,23 @@ class pk8020_state : public driver_device { public: - pk8020_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_decplm(*this, "decplm"), - m_devbank(*this, "devbank"), - m_ram(*this, RAM_TAG), - m_ios(*this, "ios%u", 1U), - m_fdc(*this, "fdc"), - m_floppy(*this, "fdc:%u", 0U), - m_inr(*this, "inr"), - m_speaker(*this, "speaker"), - m_printer(*this, "printer"), - m_region_maincpu(*this, "maincpu"), - m_region_gfx1(*this, "gfx1"), - m_io_port(*this, "LINE%u", 0U), - m_palette(*this, "palette") + pk8020_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_decplm(*this, "decplm") + , m_devbank(*this, "devbank") + , m_ram(*this, RAM_TAG) + , m_ios(*this, "ios%u", 1U) + , m_fdc(*this, "fdc") + , m_floppy(*this, "fdc:%u", 0U) + , m_cass(*this, "cassette") + , m_inr(*this, "inr") + , m_speaker(*this, "speaker") + , m_printer(*this, "printer") + , m_region_maincpu(*this, "maincpu") + , m_region_gfx1(*this, "gfx1") + , m_io_port(*this, "LINE%u", 0U) + , m_palette(*this, "palette") { } void pk8020(machine_config &config); @@ -101,6 +102,7 @@ private: required_device_array<i8251_device, 2> m_ios; required_device<kr1818vg93_device> m_fdc; required_device_array<floppy_connector, 4> m_floppy; + required_device<cassette_image_device> m_cass; required_device<pic8259_device> m_inr; required_device<speaker_sound_device> m_speaker; required_device<centronics_device> m_printer; diff --git a/src/mame/includes/seta2.h b/src/mame/includes/seta2.h index 4588466f134..61fc336788e 100644 --- a/src/mame/includes/seta2.h +++ b/src/mame/includes/seta2.h @@ -135,7 +135,7 @@ protected: std::unique_ptr<uint16_t[]> m_private_spriteram; private: - void drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int gfx, const uint16_t* const addr, const uint32_t realcolor, int flipx, int flipy, int base_sx, int shadow, int realline, int line, int opaque); + void drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int gfx, const uint8_t* const addr, const uint32_t realcolor, int flipx, int flipy, int base_sx, int shadow, int realline, int line, int opaque); inline void get_tile(uint16_t* spriteram, int is_16x16, int x, int y, int page, int& code, int& attr, int& flipx, int& flipy, int& color); std::unique_ptr<uint32_t[]> m_realtilenumber; diff --git a/src/mame/includes/snk.h b/src/mame/includes/snk.h index 18dd549342d..0f5fd5727e3 100644 --- a/src/mame/includes/snk.h +++ b/src/mame/includes/snk.h @@ -116,7 +116,7 @@ private: int m_is_psychos; uint8_t m_drawmode_table[16]; - uint16_t m_empty_tile[16*16]; + uint8_t m_empty_tile[16*16]; int m_hf_posy; int m_hf_posx; int m_tc16_posy; diff --git a/src/mame/includes/thepit.h b/src/mame/includes/thepit.h index e0cf26f11ad..b3220c936c1 100644 --- a/src/mame/includes/thepit.h +++ b/src/mame/includes/thepit.h @@ -52,7 +52,7 @@ private: uint8_t m_flip_y; tilemap_t *m_solid_tilemap; tilemap_t *m_tilemap; - std::unique_ptr<uint16_t[]> m_dummy_tile; + std::unique_ptr<uint8_t[]> m_dummy_tile; uint8_t m_nmi_mask; int m_question_address; diff --git a/src/mame/layout/fidel_desdis.lay b/src/mame/layout/fidel_desdis.lay index 08d8b42a3cf..3bb04aadcb6 100644 --- a/src/mame/layout/fidel_desdis.lay +++ b/src/mame/layout/fidel_desdis.lay @@ -17,7 +17,7 @@ </element> <element name="ldot" defstate="0"> <rect state="1"><color red="1.0" green="1.0" blue="1.0" /></rect> - <rect state="0"><color red="0.1" green="0.1" blue="0.1" /></rect> + <rect state="0"><color red="0.12157" green="0.12157" blue="0.12157" /></rect> </element> <element name="led" defstate="0"> @@ -606,8 +606,8 @@ <bezel name="3.7" element="ldot"><bounds x="42.5" y="96.5" width="0.6" height="0.6" /></bezel> <bezel name="4.7" element="ldot"><bounds x="48.5" y="96.5" width="0.6" height="0.6" /></bezel> - <bezel name="5.7" element="ldot"><bounds x="42.9" y="92.8" width="0.6" height="0.6" /></bezel> - <bezel name="5.7" element="ldot"><bounds x="42.7" y="94.65" width="0.6" height="0.6" /></bezel> + <bezel name="5.7" element="ldot"><bounds x="42.91" y="92.8" width="0.6" height="0.6" /></bezel> + <bezel name="5.7" element="ldot"><bounds x="42.69" y="94.65" width="0.6" height="0.6" /></bezel> </view> </mamelayout> diff --git a/src/mame/layout/fidel_desdis_68kg.lay b/src/mame/layout/fidel_desdis_68kg.lay index 7dc92d55092..01dd41fd7ab 100644 --- a/src/mame/layout/fidel_desdis_68kg.lay +++ b/src/mame/layout/fidel_desdis_68kg.lay @@ -17,7 +17,7 @@ </element> <element name="ldot" defstate="0"> <rect state="1"><color red="1.0" green="1.0" blue="1.0" /></rect> - <rect state="0"><color red="0.1" green="0.1" blue="0.1" /></rect> + <rect state="0"><color red="0.12157" green="0.12157" blue="0.12157" /></rect> </element> <element name="led" defstate="0"> @@ -609,8 +609,8 @@ <bezel name="3.7" element="ldot"><bounds x="42.5" y="96.5" width="0.6" height="0.6" /></bezel> <bezel name="4.7" element="ldot"><bounds x="48.5" y="96.5" width="0.6" height="0.6" /></bezel> - <bezel name="5.7" element="ldot"><bounds x="42.9" y="92.8" width="0.6" height="0.6" /></bezel> - <bezel name="5.7" element="ldot"><bounds x="42.7" y="94.65" width="0.6" height="0.6" /></bezel> + <bezel name="5.7" element="ldot"><bounds x="42.91" y="92.8" width="0.6" height="0.6" /></bezel> + <bezel name="5.7" element="ldot"><bounds x="42.69" y="94.65" width="0.6" height="0.6" /></bezel> </view> </mamelayout> diff --git a/src/mame/layout/fidel_desdis_68kr.lay b/src/mame/layout/fidel_desdis_68kr.lay index 7d2fd245b38..591b94ebeab 100644 --- a/src/mame/layout/fidel_desdis_68kr.lay +++ b/src/mame/layout/fidel_desdis_68kr.lay @@ -16,7 +16,7 @@ </element> <element name="ldot" defstate="0"> <rect state="1"><color red="1.0" green="1.0" blue="1.0" /></rect> - <rect state="0"><color red="0.1" green="0.1" blue="0.1" /></rect> + <rect state="0"><color red="0.12157" green="0.12157" blue="0.12157" /></rect> </element> <element name="led" defstate="0"> @@ -604,8 +604,8 @@ <bezel name="3.7" element="ldot"><bounds x="42.5" y="96.5" width="0.6" height="0.6" /></bezel> <bezel name="4.7" element="ldot"><bounds x="48.5" y="96.5" width="0.6" height="0.6" /></bezel> - <bezel name="5.7" element="ldot"><bounds x="42.9" y="92.8" width="0.6" height="0.6" /></bezel> - <bezel name="5.7" element="ldot"><bounds x="42.7" y="94.65" width="0.6" height="0.6" /></bezel> + <bezel name="5.7" element="ldot"><bounds x="42.91" y="92.8" width="0.6" height="0.6" /></bezel> + <bezel name="5.7" element="ldot"><bounds x="42.69" y="94.65" width="0.6" height="0.6" /></bezel> </view> </mamelayout> diff --git a/src/mame/layout/saitek_stratos.lay b/src/mame/layout/saitek_stratos.lay index 07c8be4afa6..989b2697a24 100644 --- a/src/mame/layout/saitek_stratos.lay +++ b/src/mame/layout/saitek_stratos.lay @@ -4,8 +4,19 @@ <!-- define elements --> <element name="black"><rect><color red="0.21" green="0.2" blue="0.2" /></rect></element> + <element name="whitew"><rect><color red="1" green="1" blue="1" /></rect></element> <element name="text_mode"><text string="Mode" align="1"><color red="0.36" green="0.35" blue="0.35" /></text></element> + <!-- our digit element is bright-on-dark, this means the lcd panel is the wrong colour here --> + + <element name="digit" defstate="0"> + <led7seg><color red="1.0" green="1.0" blue="1.0" /></led7seg> + </element> + <element name="ldot" defstate="0"> + <rect state="1"><color red="1.0" green="1.0" blue="1.0" /></rect> + <rect state="0"><color red="0.12157" green="0.12157" blue="0.12157" /></rect> + </element> + <element name="ledo"> <rect><color red="0.1" green="0.1" blue="0.1" /></rect> </element> @@ -462,6 +473,30 @@ </group> +<!-- lcd panel --> + + <group name="lcd1"> + <bounds x="15.5" y="0" width="22.5" height="14" /> + + <bezel name="digit0" element="digit"><bounds x="15.5" y="0" width="4" height="6" /></bezel> + <bezel name="digit1" element="digit"><bounds x="20" y="0" width="4" height="6" /></bezel> + <bezel name="digit2" element="digit"><bounds x="24" y="0" width="4" height="6" /></bezel> + <bezel name="digit3" element="digit"><bounds x="30" y="0" width="4" height="6" /></bezel> + <bezel name="digit4" element="digit"><bounds x="34" y="0" width="4" height="6" /></bezel> + + <bezel name="lcd0.0.0" element="ldot"><bounds x="28.91" y="1.8" width="0.6" height="0.6" /></bezel> + <bezel name="lcd0.0.0" element="ldot"><bounds x="28.69" y="3.65" width="0.6" height="0.6" /></bezel> + + <bezel name="digit5" element="digit"><bounds x="20" y="8" width="4" height="6" /></bezel> + <bezel name="digit6" element="digit"><bounds x="24" y="8" width="4" height="6" /></bezel> + <bezel name="digit7" element="digit"><bounds x="30" y="8" width="4" height="6" /></bezel> + <bezel name="digit8" element="digit"><bounds x="34" y="8" width="4" height="6" /></bezel> + + <bezel name="lcd1.0.0" element="ldot"><bounds x="28.91" y="9.8" width="0.6" height="0.6" /></bezel> + <bezel name="lcd1.0.0" element="ldot"><bounds x="28.69" y="11.65" width="0.6" height="0.6" /></bezel> + </group> + + <!-- build screen --> <view name="Internal Layout"> @@ -470,6 +505,9 @@ <group ref="sb_board"><bounds x="10" y="10" width="80" height="80" /></group> <group ref="sb_ui"><bounds x="-3" y="10" width="10" height="80" /></group> + <group ref="lcd1"><bounds x="26.64" y="93" width="12.86" height="8" /></group> + <bezel element="whitew"><bounds x="25.14" y="92.5" width="14.86" height="9" /><color alpha="0.125" /></bezel> + <!-- chessboard leds --> <element ref="ledo"><bounds x="8.6" y="14.2" width="0.6" height="1.6" /></element> <element ref="ledo"><bounds x="8.6" y="24.2" width="0.6" height="1.6" /></element> diff --git a/src/mame/machine/atarigen.cpp b/src/mame/machine/atarigen.cpp index bb01323951f..dd1f5329d87 100644 --- a/src/mame/machine/atarigen.cpp +++ b/src/mame/machine/atarigen.cpp @@ -683,14 +683,14 @@ void atarigen_state::blend_gfx(int gfx0, int gfx1, int mask0, int mask1) u8 *dest = srcdata; for (int c = 0; c < gx0->elements(); c++) { - const u16 *c0base = gx0->get_data(c); - const u16 *c1base = gx1->get_data(c); + const u8 *c0base = gx0->get_data(c); + const u8 *c1base = gx1->get_data(c); // loop over height for (int y = 0; y < gx0->height(); y++) { - const u16 *c0 = c0base; - const u16 *c1 = c1base; + const u8 *c0 = c0base; + const u8 *c1 = c1base; for (int x = 0; x < gx0->width(); x++) *dest++ = (*c0++ & mask0) | (*c1++ & mask1); diff --git a/src/mame/machine/megacd.cpp b/src/mame/machine/megacd.cpp index ef1ece3b4c1..fc20389b30f 100644 --- a/src/mame/machine/megacd.cpp +++ b/src/mame/machine/megacd.cpp @@ -1068,7 +1068,7 @@ TILE_GET_INFO_MEMBER( sega_segacd_device::get_stampmap_32x32_16x16_tile_info ) // non-tilemap functions to get a pixel from a 'tilemap' based on the above, but looking up each pixel, as to avoid the heavy cache bitmap -inline uint16_t sega_segacd_device::get_stampmap_16x16_1x1_tile_info_pixel(int xpos, int ypos) +inline uint8_t sega_segacd_device::get_stampmap_16x16_1x1_tile_info_pixel(int xpos, int ypos) { const int tilesize = 4; // 0xf pixels const int tilemapsize = 0x0f; @@ -1102,11 +1102,11 @@ inline uint16_t sega_segacd_device::get_stampmap_16x16_1x1_tile_info_pixel(int x if (tileno==0) return 0x00; - const uint16_t* srcdata = gfx(tile_region)->get_data(tileno); + const uint8_t* srcdata = gfx(tile_region)->get_data(tileno); return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))]; } -inline uint16_t sega_segacd_device::get_stampmap_32x32_1x1_tile_info_pixel(int xpos, int ypos) +inline uint8_t sega_segacd_device::get_stampmap_32x32_1x1_tile_info_pixel(int xpos, int ypos) { const int tilesize = 5; // 0x1f pixels const int tilemapsize = 0x07; @@ -1140,11 +1140,11 @@ inline uint16_t sega_segacd_device::get_stampmap_32x32_1x1_tile_info_pixel(int x if (tileno==0) return 0x00; // does this apply in this mode? - const uint16_t* srcdata = gfx(tile_region)->get_data(tileno); + const uint8_t* srcdata = gfx(tile_region)->get_data(tileno); return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))]; } -inline uint16_t sega_segacd_device::get_stampmap_16x16_16x16_tile_info_pixel(int xpos, int ypos) +inline uint8_t sega_segacd_device::get_stampmap_16x16_16x16_tile_info_pixel(int xpos, int ypos) { const int tilesize = 4; // 0xf pixels const int tilemapsize = 0xff; @@ -1178,11 +1178,11 @@ inline uint16_t sega_segacd_device::get_stampmap_16x16_16x16_tile_info_pixel(int if (tileno==0) return 0x00; // does this apply in this mode - const uint16_t* srcdata = gfx(tile_region)->get_data(tileno); + const uint8_t* srcdata = gfx(tile_region)->get_data(tileno); return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))]; } -inline uint16_t sega_segacd_device::get_stampmap_32x32_16x16_tile_info_pixel(int xpos, int ypos) +inline uint8_t sega_segacd_device::get_stampmap_32x32_16x16_tile_info_pixel(int xpos, int ypos) { const int tilesize = 5; // 0x1f pixels const int tilemapsize = 0x7f; @@ -1216,7 +1216,7 @@ inline uint16_t sega_segacd_device::get_stampmap_32x32_16x16_tile_info_pixel(int if (tileno==0) return 0x00; - const uint16_t* srcdata = gfx(tile_region)->get_data(tileno); + const uint8_t* srcdata = gfx(tile_region)->get_data(tileno); return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))]; } @@ -1464,7 +1464,7 @@ WRITE16_MEMBER( sega_segacd_device::segacd_stampsize_w ) // the lower 3 bits of segacd_imagebuffer_hdot_size are set // this really needs to be doing it's own lookups rather than depending on the inefficient MAME cache.. -inline uint16_t sega_segacd_device::read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y) +inline uint8_t sega_segacd_device::read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y) { /* if (!srcbitmap) @@ -1547,7 +1547,7 @@ WRITE16_MEMBER( sega_segacd_device::segacd_trace_vector_base_address_w ) for (count=0;count<(segacd_imagebuffer_hdot_size);count++) { //int i; - uint16_t pix = 0x0; + uint8_t pix = 0x0; pix = read_pixel_from_stampmap(srcbitmap, xbase>>(3+8), ybase>>(3+8)); diff --git a/src/mame/machine/megacd.h b/src/mame/machine/megacd.h index 87bdb560dee..aacb18d56a9 100644 --- a/src/mame/machine/megacd.h +++ b/src/mame/machine/megacd.h @@ -177,12 +177,12 @@ protected: void SCD_GET_TILE_INFO_16x16_16x16( int& tile_region, int& tileno, int tile_index ); void SCD_GET_TILE_INFO_32x32_16x16( int& tile_region, int& tileno, int tile_index ); - uint16_t get_stampmap_16x16_1x1_tile_info_pixel(int xpos, int ypos); - uint16_t get_stampmap_32x32_1x1_tile_info_pixel(int xpos, int ypos); - uint16_t get_stampmap_16x16_16x16_tile_info_pixel(int xpos, int ypos); - uint16_t get_stampmap_32x32_16x16_tile_info_pixel(int xpos, int ypos); + uint8_t get_stampmap_16x16_1x1_tile_info_pixel(int xpos, int ypos); + uint8_t get_stampmap_32x32_1x1_tile_info_pixel(int xpos, int ypos); + uint8_t get_stampmap_16x16_16x16_tile_info_pixel(int xpos, int ypos); + uint8_t get_stampmap_32x32_16x16_tile_info_pixel(int xpos, int ypos); - uint16_t read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y); + uint8_t read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y); virtual void device_start() override; virtual void device_reset() override; diff --git a/src/mame/machine/pk8020.cpp b/src/mame/machine/pk8020.cpp index e81857cd095..57bcb5d9f08 100644 --- a/src/mame/machine/pk8020.cpp +++ b/src/mame/machine/pk8020.cpp @@ -95,7 +95,7 @@ void pk8020_state::memory_w(offs_t offset, uint8_t data) uint8_t pk8020_state::ppi_porta_r() { - return 0xf0 | (m_takt <<1) | (m_text_attr)<<3; + return 0xf0 | (m_takt <<1) | (m_text_attr<<3) | ((m_cass->input() > +0.04) ? 1 : 0); } void pk8020_state::floppy_control_w(uint8_t data) @@ -125,6 +125,9 @@ void pk8020_state::floppy_control_w(uint8_t data) void pk8020_state::ppi_2_portc_w(uint8_t data) { + static const double levels[4] = { 0.0, 1.0, -1.0, 0.0 }; + m_cass->output(levels[data & 3]); + m_sound_gate = BIT(data,3); m_speaker->level_w(m_sound_gate ? m_sound_level : 0); diff --git a/src/mame/machine/poly88.cpp b/src/mame/machine/poly88.cpp index d922cdd5a1e..354b26e7954 100644 --- a/src/mame/machine/poly88.cpp +++ b/src/mame/machine/poly88.cpp @@ -195,7 +195,7 @@ WRITE_LINE_MEMBER(poly88_state::usart_ready_w) { if (state) { - m_int_vector = 0xdf; + m_int_vector = 0xe7; m_maincpu->set_input_line(0, HOLD_LINE); } } diff --git a/src/mame/machine/st0016.cpp b/src/mame/machine/st0016.cpp index 9431191ff22..17cf6e660be 100644 --- a/src/mame/machine/st0016.cpp +++ b/src/mame/machine/st0016.cpp @@ -496,7 +496,7 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip int yloop, xloop; int ypos, xpos; int tileno; - const uint16_t *srcgfx; + const uint8_t *srcgfx; int gfxoffs; ypos = sy + y0 * 8 + spr_dy; xpos = sx + x0 * 8 + spr_dx; @@ -641,7 +641,7 @@ void st0016_cpu_device::draw_bgmap(bitmap_ind16 &bitmap, const rectangle &clipre uint16_t *destline; int yloop, xloop; int ypos, xpos; - const uint16_t *srcgfx; + const uint8_t *srcgfx; int gfxoffs; ypos = y * 8 + spr_dy;//+((st0016_vregs[j+2]==0xaf)?0x50:0);//hack for mayjinsen title screen xpos = x * 8 + spr_dx; diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 67a57dd514e..f5244544745 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -18677,6 +18677,12 @@ zephya // 7smash // (c) 1993 Sovic luckgrln // (c) 1991 Wing Co. Ltd +@source:lucky37.cpp +lucky21 // (c) 199? Wing Co. Ltd +lucky21d // (c) 199? Wing Co. Ltd +lucky25 // (c) 199? Wing Co. Ltd +lucky37 // (c) 199? Wing Co. Ltd + @source:lucky74.cpp excitbj // (c) 1992 Wing Co. Ltd lucky74 // (c) 1988 Wing Co. Ltd @@ -34117,11 +34123,12 @@ montreux // @source:saitek_stratos.cpp corona +coronaa stratos -stratosl +stratosa tking -tkingl -tkingp +tkinga +tkingb @source:sam.cpp 24_130 // @@ -34377,6 +34384,9 @@ savia84 // @source:savquest.cpp savquest // +@source:sb8085.cpp +sb8085 // + @source:sbasketb.cpp sbasketb // GX405 (c) 1984 (Version I, Encrypted) sbaskete // GX405 (c) 1984 (Version E, Encrypted) diff --git a/src/mame/mess.flt b/src/mame/mess.flt index 66754ecc246..f486bb025cd 100644 --- a/src/mame/mess.flt +++ b/src/mame/mess.flt @@ -702,6 +702,7 @@ sapi1.cpp sartorius.cpp saturn.cpp savia84.cpp +sb8085.cpp sbc6510.cpp sbrain.cpp sc2.cpp diff --git a/src/mame/video/1943.cpp b/src/mame/video/1943.cpp index c24b9781fba..d7262dec3a8 100644 --- a/src/mame/video/1943.cpp +++ b/src/mame/video/1943.cpp @@ -215,7 +215,7 @@ void _1943_state::_1943_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx bitmap_ind8 &priority_bitmap = m_screen->priority(); /* Start drawing */ const u16 pal = gfx->colorbase() + gfx->granularity() * (color % gfx->colors()); - const u16 *source_base = gfx->get_data(code % gfx->elements()); + const u8 *source_base = gfx->get_data(code % gfx->elements()); const int xinc = flipx ? -1 : 1; const int yinc = flipy ? -1 : 1; @@ -257,7 +257,7 @@ void _1943_state::_1943_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx { // skip if inner loop doesn't draw anything for (int y = sy; y < ey; y++) { - const u16 *source = source_base + y_index * gfx->rowbytes(); + const u8 *source = source_base + y_index * gfx->rowbytes(); u16 *dest = &dest_bmp.pix16(y); u8 *pri = &priority_bitmap.pix8(y); int x_index = x_index_base; @@ -265,7 +265,7 @@ void _1943_state::_1943_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx { if (!(pri[x] & 0x80)) { - const u16 c = source[x_index]; + u8 c = source[x_index]; if (c != transparent_color) { // the priority is actually selected by bit 3 of BMPROM.07 diff --git a/src/mame/video/armedf.cpp b/src/mame/video/armedf.cpp index b6e5681e119..5e15e0ff151 100644 --- a/src/mame/video/armedf.cpp +++ b/src/mame/video/armedf.cpp @@ -263,7 +263,7 @@ void armedf_state::armedf_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,g int transparent_color) { const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); - const uint16_t *source_base = gfx->get_data(code % gfx->elements()); + const uint8_t *source_base = gfx->get_data(code % gfx->elements()); int x_index_base, y_index, sx, sy, ex, ey; int xinc, yinc; @@ -310,7 +310,7 @@ void armedf_state::armedf_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,g { for (y = sy; y < ey; y++) { - const uint16_t *source = source_base + y_index*gfx->rowbytes(); + const uint8_t *source = source_base + y_index*gfx->rowbytes(); uint16_t *dest = &dest_bmp.pix16(y); int x_index = x_index_base; for (x = sx; x < ex; x++) diff --git a/src/mame/video/bbusters.cpp b/src/mame/video/bbusters.cpp index 866a2d56ddd..41ad5fd5337 100644 --- a/src/mame/video/bbusters.cpp +++ b/src/mame/video/bbusters.cpp @@ -94,7 +94,7 @@ void mechatt_state::video_start() else if (dy&0x40) code+=32; \ else if (dx&0x40) code+=16 -inline const uint16_t *bbusters_state_base::get_source_ptr(gfx_element *gfx, uint32_t sprite, int dx, int dy, int block) +inline const uint8_t *bbusters_state_base::get_source_ptr(gfx_element *gfx, uint32_t sprite, int dx, int dy, int block) { int code=0; @@ -147,7 +147,7 @@ void bbusters_state_base::draw_block(screen_device &screen, bitmap_ind16 &dest,i uint16_t *destline = &dest.pix16(dy); uint8_t *priorityline = &screen.priority().pix8(dy); uint8_t srcline=*m_scale_table_ptr; - const uint16_t *srcptr=nullptr; + const uint8_t *srcptr=nullptr; if (!flipy) srcline=size-srcline-1; diff --git a/src/mame/video/buggychl.cpp b/src/mame/video/buggychl.cpp index 758cb12330f..26bf22f4ff4 100644 --- a/src/mame/video/buggychl.cpp +++ b/src/mame/video/buggychl.cpp @@ -196,7 +196,7 @@ void buggychl_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre for (ch = 0; ch < 4; ch++) { int pos, code, realflipy; - const uint16_t *pendata; + const uint8_t *pendata; pos = base_pos + 2 * ch; code = 8 * (lookup[pos] | ((lookup[pos + 1] & 0x07) << 8)); diff --git a/src/mame/video/circus.cpp b/src/mame/video/circus.cpp index 63690f7d9ef..c160672f142 100644 --- a/src/mame/video/circus.cpp +++ b/src/mame/video/circus.cpp @@ -63,7 +63,7 @@ void circus_state::draw_line( bitmap_ind16 &bitmap, const rectangle &cliprect, i void circus_state::draw_sprite_collision( bitmap_ind16 &bitmap, const rectangle &cliprect ) { gfx_element *sprite_gfx = m_gfxdecode->gfx(1); - const uint16_t *sprite_data = sprite_gfx->get_data(m_clown_z); + const uint8_t *sprite_data = sprite_gfx->get_data(m_clown_z); int sx, sy, dx, dy; int pixel, collision = 0; diff --git a/src/mame/video/cps1.cpp b/src/mame/video/cps1.cpp index 6c0fb44f910..0229acb5188 100644 --- a/src/mame/video/cps1.cpp +++ b/src/mame/video/cps1.cpp @@ -442,8 +442,6 @@ The games seem to use them to mark platforms, kill zones and no-go areas. #include "emu.h" #include "includes/cps1.h" -#include <algorithm> - #define VERBOSE 0 /******************************************************************** @@ -2274,7 +2272,7 @@ void cps_state::video_start() m_bg_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(cps_state::get_tile2_info),this), tilemap_mapper_delegate(FUNC(cps_state::tilemap2_scan),this), 32, 32, 64, 64); /* create empty tiles */ - std::fill(std::begin(m_empty_tile), std::end(m_empty_tile), 0x0f); + memset(m_empty_tile, 0x0f, sizeof(m_empty_tile)); /* front masks will change at runtime to handle sprite occluding */ cps1_update_transmasks(); diff --git a/src/mame/video/deco_mlc.cpp b/src/mame/video/deco_mlc.cpp index 18d2b74fc64..6c60a5f6e7b 100644 --- a/src/mame/video/deco_mlc.cpp +++ b/src/mame/video/deco_mlc.cpp @@ -90,10 +90,10 @@ void deco_mlc_state::drawgfxzoomline(uint32_t* dest,const rectangle &clip,gfx_el if( ex>sx ) { /* skip if inner loop doesn't draw anything */ const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); - const uint16_t *code_base1 = gfx->get_data(code1 % gfx->elements()); - const uint16_t *code_base2 = gfx->get_data(code2 % gfx->elements()); - const uint16_t *source1 = code_base1 + (srcline) * gfx->rowbytes(); - const uint16_t *source2 = code_base2 + (srcline) * gfx->rowbytes(); + const uint8_t *code_base1 = gfx->get_data(code1 % gfx->elements()); + const uint8_t *code_base2 = gfx->get_data(code2 % gfx->elements()); + const uint8_t *source1 = code_base1 + (srcline) * gfx->rowbytes(); + const uint8_t *source2 = code_base2 + (srcline) * gfx->rowbytes(); /* no alpha */ if ((alpha == 0xff) && (!shadowMode)) { diff --git a/src/mame/video/deco_zoomspr.cpp b/src/mame/video/deco_zoomspr.cpp index 75fa5f76316..3413231f01d 100644 --- a/src/mame/video/deco_zoomspr.cpp +++ b/src/mame/video/deco_zoomspr.cpp @@ -59,7 +59,7 @@ inline void deco_zoomspr_device::dragngun_drawgfxzoom( if( gfx ) { const pen_t *pal = &m_gfxdecode->palette().pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); - const uint16_t *code_base = gfx->get_data(code % gfx->elements()); + const uint8_t *code_base = gfx->get_data(code % gfx->elements()); if (sprite_screen_width && sprite_screen_height) { @@ -127,7 +127,7 @@ inline void deco_zoomspr_device::dragngun_drawgfxzoom( { for( y=sy; y<ey; y++ ) { - const uint16_t *source = code_base + (y_index>>16) * gfx->rowbytes(); + const uint8_t *source = code_base + (y_index>>16) * gfx->rowbytes(); uint32_t *dest = &temp_bitmap.pix32(y); uint8_t *pri = &pri_bitmap.pix8(y); @@ -163,7 +163,7 @@ inline void deco_zoomspr_device::dragngun_drawgfxzoom( { for( y=sy; y<ey; y++ ) { - const uint16_t *source = code_base + (y_index>>16) * gfx->rowbytes(); + const uint8_t *source = code_base + (y_index>>16) * gfx->rowbytes(); uint32_t *dest = &temp_bitmap.pix32(y); uint8_t *pri = &pri_bitmap.pix8(y); uint32_t *tmapcolor = &dest_bmp.pix32(y); diff --git a/src/mame/video/decocass.cpp b/src/mame/video/decocass.cpp index 74f5d4d9568..bf06d8cd5a9 100644 --- a/src/mame/video/decocass.cpp +++ b/src/mame/video/decocass.cpp @@ -125,7 +125,6 @@ #include "emu.h" #include "includes/decocass.h" -#include <algorithm> static const uint32_t tile_offset[32*32] = { @@ -249,8 +248,8 @@ void decocass_state::draw_special_priority(bitmap_ind16 &bitmap, bitmap_ind8 &pr sy += 256; int sx = m_part_h_shift - 128; - const uint16_t *objdata0 = m_gfxdecode->gfx(3)->get_data(0); - const uint16_t *objdata1 = m_gfxdecode->gfx(3)->get_data(1); + const uint8_t *objdata0 = m_gfxdecode->gfx(3)->get_data(0); + const uint8_t *objdata1 = m_gfxdecode->gfx(3)->get_data(1); assert(m_gfxdecode->gfx(3)->rowbytes() == 64); for (int y = cliprect.top(); y <= cliprect.bottom(); y++) @@ -720,7 +719,7 @@ void decocass_state::video_start() m_gfxdecode->gfx(3)->set_source(m_objectram); /* create an empty tile */ - std::fill(std::begin(m_empty_tile), std::end(m_empty_tile), 0); + memset(m_empty_tile, 0, sizeof(m_empty_tile)); } uint32_t decocass_state::screen_update_decocass(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) diff --git a/src/mame/video/equites.cpp b/src/mame/video/equites.cpp index f8cbb20cb2a..55ef68af119 100644 --- a/src/mame/video/equites.cpp +++ b/src/mame/video/equites.cpp @@ -310,7 +310,7 @@ void splndrbt_state::splndrbt_draw_sprites(bitmap_ind16 &bitmap, const rectangle // const uint8_t * const xromline = xrom + (scalex << 4); const uint8_t * const yromline = yrom + (scaley << 4) + (15 - scaley); - const uint16_t* const srcgfx = gfx->get_data(tile); + const uint8_t* const srcgfx = gfx->get_data(tile); const pen_t *paldata = &m_palette->pen(gfx->colorbase() + gfx->granularity() * color); int x,yy; diff --git a/src/mame/video/gaelco2.cpp b/src/mame/video/gaelco2.cpp index dd4e7c65779..3c6e5403da8 100644 --- a/src/mame/video/gaelco2.cpp +++ b/src/mame/video/gaelco2.cpp @@ -387,7 +387,7 @@ void gaelco2_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co { /* last palette entry is reserved for shadows and highlights */ /* get a pointer to the current sprite's gfx data */ - const uint16_t *gfx_src = gfx->get_data(number % gfx->elements()); + const uint8_t *gfx_src = gfx->get_data(number % gfx->elements()); for (int py = 0; py < gfx->height(); py++) { @@ -409,7 +409,7 @@ void gaelco2_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co const int gfx_px = xflip ? (gfx->width() - 1 - px) : px; /* get asociated pen for the current sprite pixel */ - const u16 gfx_pen = gfx_src[gfx->rowbytes() * gfx_py + gfx_px]; + const u8 gfx_pen = gfx_src[gfx->rowbytes() * gfx_py + gfx_px]; if ((gfx_pen == 0) || (gfx_pen >= 16)) continue; diff --git a/src/mame/video/gaelco_wrally_sprites.cpp b/src/mame/video/gaelco_wrally_sprites.cpp index ce6105e2398..c865e658a66 100644 --- a/src/mame/video/gaelco_wrally_sprites.cpp +++ b/src/mame/video/gaelco_wrally_sprites.cpp @@ -93,7 +93,7 @@ void gaelco_wrally_sprites_device::draw_sprites(const rectangle &cliprect, uint1 } // wrally adjusts sx by 0x0f, blmbycar implementation was 0x10 - const uint16_t *gfx_src = gfx->get_data(number % gfx->elements()); + const uint8_t *gfx_src = gfx->get_data(number % gfx->elements()); for (int py = 0; py < gfx->height(); py++) { diff --git a/src/mame/video/gp9001.cpp b/src/mame/video/gp9001.cpp index 42badbe5db8..8ff056fd14c 100644 --- a/src/mame/video/gp9001.cpp +++ b/src/mame/video/gp9001.cpp @@ -727,7 +727,7 @@ void gp9001vdp_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clip color %= total_colors; const pen_t *paldata = &palette().pen(color * 16); { - const u16* srcdata = gfx(1)->get_data(sprite); + const u8* srcdata = gfx(1)->get_data(sprite); int count = 0; int ystart, yend, yinc; int xstart, xend, xinc; @@ -768,7 +768,7 @@ void gp9001vdp_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clip if (cliprect.contains(drawxx, drawyy)) { - const u16 pix = srcdata[count]; + const u8 pix = srcdata[count]; u16* dstptr = &bitmap.pix16(drawyy, drawxx); u8* dstpri = &this->custom_priority_bitmap->pix8(drawyy, drawxx); diff --git a/src/mame/video/grchamp.cpp b/src/mame/video/grchamp.cpp index fc39267e95a..03eb3b23b6f 100644 --- a/src/mame/video/grchamp.cpp +++ b/src/mame/video/grchamp.cpp @@ -271,7 +271,7 @@ void grchamp_state::draw_objects(int y, uint8_t *objdata) int code = (codeflip & 0x3f) + (change >> 2); int yflip = (codeflip & 0x80) ? 0x0f : 0x00; int xflip = (codeflip & 0x40) ? 0x0f : 0x00; - const uint16_t *src = gfx->get_data(code) + ((dy ^ yflip) & 15) * gfx->rowbytes(); + const uint8_t *src = gfx->get_data(code) + ((dy ^ yflip) & 15) * gfx->rowbytes(); /* the third byte is: color in bits 0-2 */ int color = (m_spriteram[0x42 + (dataoffs & ~0x20)] & 0x07) << 2; @@ -315,7 +315,7 @@ void grchamp_state::draw_objects(int y, uint8_t *objdata) int dy = sy + ~y; int color = (m_spriteram[0x01 + dataoffs] & 0x07) << 2; int code = m_videoram[hprime | ((dy & 0xf8) << 2)] + change; - const uint16_t *src = gfx->get_data(code) + (dy & 7) * gfx->rowbytes(); + const uint8_t *src = gfx->get_data(code) + (dy & 7) * gfx->rowbytes(); int x; /* draw 8 pixels */ diff --git a/src/mame/video/jalblend.cpp b/src/mame/video/jalblend.cpp index e9e843b79af..6dc734c9229 100644 --- a/src/mame/video/jalblend.cpp +++ b/src/mame/video/jalblend.cpp @@ -101,7 +101,7 @@ void jaleco_blend_device::drawgfx_common(palette_device &palette,_BitmapClass &d { /* Start drawing */ const pen_t *pal = &palette.pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); - const u16 *source_base = gfx->get_data(code % gfx->elements()); + const u8 *source_base = gfx->get_data(code % gfx->elements()); const int xinc = flipx ? -1 : 1; const int yinc = flipy ? -1 : 1; @@ -145,12 +145,12 @@ void jaleco_blend_device::drawgfx_common(palette_device &palette,_BitmapClass &d // taken from case : TRANSPARENCY_ALPHARANGE for (int y = sy; y < ey; y++) { - const u16 *source = source_base + y_index*gfx->rowbytes(); + const u8 *source = source_base + y_index*gfx->rowbytes(); typename _BitmapClass::pixel_t *dest = &dest_bmp.pix(y); int x_index = x_index_base; for (int x = sx; x < ex; x++) { - const u16 c = source[x_index]; + const u8 c = source[x_index]; if (c != transparent_color) { dest[x] = jaleco_blend_device::func(dest[x], pal[c]); diff --git a/src/mame/video/jedi.cpp b/src/mame/video/jedi.cpp index c9d9261c7bf..ea68c645413 100644 --- a/src/mame/video/jedi.cpp +++ b/src/mame/video/jedi.cpp @@ -41,12 +41,12 @@ void jedi_state::video_start() u8 *dest = srcdata; for (int c = 0; c < gx0->elements(); c++) { - const u16 *c0base = gx0->get_data(c); + const u8 *c0base = gx0->get_data(c); // loop over height for (int y = 0; y < gx0->height(); y++) { - const u16 *c0 = c0base; + const u8 *c0 = c0base; for (int x = 0; x < gx0->width(); x++) { @@ -59,35 +59,6 @@ void jedi_state::video_start() gx0->set_raw_layout(srcdata, gx0->width(), gx0->height(), gx0->elements(), 8 * gx0->width(), 8 * gx0->width() * gx0->height()); gx0->set_granularity(1); - - /* the text layer pixel determines pen address bits A8 and A9 */ - gfx_element *gx1 = m_gfxdecode->gfx(0); - - // allocate memory for the assembled data - u16 *srcdata16 = auto_alloc_array(machine(), u16, gx1->elements() * gx1->width() * gx1->height()); - - // loop over elements - u16 *dest16 = srcdata16; - for (int c = 0; c < gx1->elements(); c++) - { - const u16 *c1base = gx1->get_data(c); - - // loop over height - for (int y = 0; y < gx1->height(); y++) - { - const u16 *c1 = c1base; - - for (int x = 0; x < gx1->width(); x++) - { - const u16 pix = (*c1++ & 0x3); - *dest16++ = pix << 8; - } - c1base += gx1->rowbytes(); - } - } - - gx1->set_raw_layout(srcdata16, gx1->width(), gx1->height(), gx1->elements(), 16 * gx1->width(), 16 * gx1->width() * gx1->height()); - gx1->set_granularity(1); #endif /* register for saving */ diff --git a/src/mame/video/k053246_k053247_k055673.cpp b/src/mame/video/k053246_k053247_k055673.cpp index 56bbb393fef..7b46b032563 100644 --- a/src/mame/video/k053246_k053247_k055673.cpp +++ b/src/mame/video/k053246_k053247_k055673.cpp @@ -438,7 +438,7 @@ void k053247_device::zdrawgfxzoom32GP( #define FPENT 0 // inner loop - const u16 *src_ptr; + const u8 *src_ptr; int src_x; int eax, ecx; int src_fx, src_fdx; @@ -452,7 +452,7 @@ void k053247_device::zdrawgfxzoom32GP( // outter loop int src_fby, src_fdy, src_fbx; - const u16 *src_base; + const u8 *src_base; int dst_w, dst_h; // one-time diff --git a/src/mame/video/k054156_k054157_k056832.cpp b/src/mame/video/k054156_k054157_k056832.cpp index f7699185dbb..56476fc99ca 100644 --- a/src/mame/video/k054156_k054157_k056832.cpp +++ b/src/mame/video/k054156_k054157_k056832.cpp @@ -1147,7 +1147,7 @@ int k056832_device::update_linemap( screen_device &screen, _BitmapClass &bitmap, uint8_t code_transparent, code_opaque; const pen_t *pal_ptr; - const uint16_t *src_ptr; + const uint8_t *src_ptr; uint8_t *xpr_ptr; uint16_t *dst_ptr; uint16_t pen, basepen; @@ -2078,7 +2078,7 @@ int k056832_device::altK056832_update_linemap(screen_device &screen, bitmap_rgb3 uint8_t code_transparent, code_opaque; const pen_t *pal_ptr; - const uint16_t *src_ptr; + const uint8_t *src_ptr; uint8_t *xpr_ptr; uint16_t *dst_ptr; uint16_t pen, basepen; diff --git a/src/mame/video/kaneko_spr.cpp b/src/mame/video/kaneko_spr.cpp index 36363309529..598c005f9cd 100644 --- a/src/mame/video/kaneko_spr.cpp +++ b/src/mame/video/kaneko_spr.cpp @@ -244,7 +244,7 @@ void kaneko16_sprite_device::draw_sprites_custom(_BitmapClass &dest_bmp,const re bitmap_ind8 &priority_bitmap, int priority) { const pen_t pen_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors()); - const u16 *source_base = gfx->get_data(code % gfx->elements()); + const u8 *source_base = gfx->get_data(code % gfx->elements()); int dx, dy; int ex = sx+gfx->width(); @@ -309,14 +309,14 @@ void kaneko16_sprite_device::draw_sprites_custom(_BitmapClass &dest_bmp,const re const pen_t *pal = gfx->palette().pens(); for (int y = sy; y < ey; y++) { - const u16 *source = source_base + y_index * gfx->rowbytes(); + const u8 *source = source_base + y_index * gfx->rowbytes(); dest = &dest_bmp.pix(y); u8 *pri = &priority_bitmap.pix8(y); int x_index = x_index_base; for (int x = sx; x < ex; x++) { - const u16 c = source[x_index]; + const u8 c = source[x_index]; if (c != 0) { if (pri[x] < priority) diff --git a/src/mame/video/mcr.cpp b/src/mame/video/mcr.cpp index 21e6efd8de0..46dddafaca5 100644 --- a/src/mame/video/mcr.cpp +++ b/src/mame/video/mcr.cpp @@ -272,7 +272,7 @@ void mcr_state::render_sprites_91399(screen_device &screen, bitmap_ind16 &bitmap for (int y = 0; y < 32; y++, sy = (sy + 1) & 0x1ff) if (sy >= cliprect.min_y && sy <= cliprect.max_y) { - const uint16_t *src = gfx->get_data(code) + gfx->rowbytes() * (y ^ vflip); + const uint8_t *src = gfx->get_data(code) + gfx->rowbytes() * (y ^ vflip); uint16_t *dst = &bitmap.pix16(sy); uint8_t *pri = &screen.priority().pix8(sy); @@ -339,7 +339,7 @@ void mcr_state::render_sprites_91464(screen_device &screen, bitmap_ind16 &bitmap for (int y = 0; y < 32; y++, sy = (sy + 1) & 0x1ff) if (sy >= 2 && sy >= cliprect.min_y && sy <= cliprect.max_y) { - const uint16_t *src = gfx->get_data(code) + gfx->rowbytes() * (y ^ vflip); + const uint8_t *src = gfx->get_data(code) + gfx->rowbytes() * (y ^ vflip); uint16_t *dst = &bitmap.pix16(sy); uint8_t *pri = &screen.priority().pix8(sy); diff --git a/src/mame/video/megasys1.cpp b/src/mame/video/megasys1.cpp index fd0e2d2649b..18868e4a545 100644 --- a/src/mame/video/megasys1.cpp +++ b/src/mame/video/megasys1.cpp @@ -387,7 +387,7 @@ inline void megasys1_state::draw_16x16_priority_sprite(screen_device &screen, bi gfx_element *decodegfx = m_gfxdecode->gfx(0); sy = sy + 16; - const u16* gfx = decodegfx->get_data(code); + const u8* gfx = decodegfx->get_data(code); flipy = (flipy) ? 0x0f : 0; flipx = (flipx) ? 0x0f : 0; diff --git a/src/mame/video/namco_c355spr.cpp b/src/mame/video/namco_c355spr.cpp index 2caec9b84df..7a484d86973 100644 --- a/src/mame/video/namco_c355spr.cpp +++ b/src/mame/video/namco_c355spr.cpp @@ -52,7 +52,7 @@ void namco_c355spr_device::zdrawgfxzoom( const int shadow_offset = (palette.shadows_enabled()) ? palette.entries() : 0; const pen_t black = palette.black_pen(); const pen_t *pal = &palette.pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); - const u16 *source_base = gfx->get_data(code % gfx->elements()); + const u8 *source_base = gfx->get_data(code % gfx->elements()); int sprite_screen_height = (scaley * gfx->height() + 0x8000) >> 16; int sprite_screen_width = (scalex * gfx->width() + 0x8000) >> 16; if (sprite_screen_width && sprite_screen_height) @@ -117,7 +117,7 @@ void namco_c355spr_device::zdrawgfxzoom( { for (int y = sy; y < ey; y++) { - const u16 *source = source_base + (y_index>>16) * gfx->rowbytes(); + const u8 *source = source_base + (y_index>>16) * gfx->rowbytes(); u16 *dest = &dest_bmp.pix16(y); u8 *pri = &priority_bitmap.pix8(y); int x_index = x_index_base; @@ -125,7 +125,7 @@ void namco_c355spr_device::zdrawgfxzoom( { for (int x = sx; x < ex; x++) { - const u16 c = source[x_index>>16]; + const u8 c = source[x_index>>16]; if (c != 0xff) { if (pri[x] <= zpos) @@ -153,7 +153,7 @@ void namco_c355spr_device::zdrawgfxzoom( { for (int x = sx; x < ex; x++) { - const u16 c = source[x_index>>16]; + const u8 c = source[x_index>>16]; if (c != 0xff) { if (pri[x] <= zpos) diff --git a/src/mame/video/namcona1.cpp b/src/mame/video/namcona1.cpp index ca000a7762c..228bf817fd9 100644 --- a/src/mame/video/namcona1.cpp +++ b/src/mame/video/namcona1.cpp @@ -233,8 +233,8 @@ void namcona1_state::pdraw_tile( gfx_element *mask = m_gfxdecode->gfx(2); const u16 pal_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors()); - const u16 *source_base = gfx->get_data((code % gfx->elements())); - const u16 *mask_base = mask->get_data((code % mask->elements())); + const u8 *source_base = gfx->get_data((code % gfx->elements())); + const u8 *mask_base = mask->get_data((code % mask->elements())); /* compute sprite increment per screen pixel */ int dx, dy; @@ -295,8 +295,8 @@ void namcona1_state::pdraw_tile( { /* skip if inner loop doesn't draw anything */ for (int y = sy; y < ey; y++) { - const u16 *source = source_base + y_index * gfx->rowbytes(); - const u16 *mask_addr = mask_base + y_index * mask->rowbytes(); + const u8 *source = source_base + y_index * gfx->rowbytes(); + const u8 *mask_addr = mask_base + y_index * mask->rowbytes(); u16 *dest = &dest_bmp.pix16(y); u8 *pri = &screen.priority().pix8(y); @@ -307,7 +307,7 @@ void namcona1_state::pdraw_tile( { if (pri[x] <= priority) { - const u16 c = source[x_index]; + const u8 c = source[x_index]; dest[x] = pal_base + c; } pri[x] = 0xff; @@ -319,7 +319,7 @@ void namcona1_state::pdraw_tile( { if (pri[x] <= priority) { - const u16 c = source[x_index]; + const u8 c = source[x_index]; /* render a shadow only if the sprites color is $F (8bpp) or $FF (4bpp) */ if (bShadow) diff --git a/src/mame/video/namcos22.cpp b/src/mame/video/namcos22.cpp index 57af58accd4..545fc499067 100644 --- a/src/mame/video/namcos22.cpp +++ b/src/mame/video/namcos22.cpp @@ -56,7 +56,7 @@ void namcos22_renderer::renderscanline_uvi_full(int32_t scanline, const extent_t u8 *primap = &extra.primap->pix8(scanline); u16 *ttmap = m_state.m_texture_tilemap; u8 *ttattr = m_state.m_texture_tileattr.get(); - u16 *ttdata = m_state.m_texture_tiledata; + u8 *ttdata = m_state.m_texture_tiledata; u8 *tt_ayx_to_pixel = m_state.m_texture_ayx_to_pixel.get(); if (extra.cmode & 4) @@ -194,7 +194,7 @@ void namcos22_renderer::renderscanline_sprite(int32_t scanline, const extent_t & int fadefactor = 0xff - extra.fadefactor; rgbaint_t fogcolor(extra.fogcolor); rgbaint_t fadecolor(extra.fadecolor); - u16 *source = (u16 *)extra.source + y_index * extra.line_modulo; + u8 *source = (u8 *)extra.source + y_index * extra.line_modulo; u32 *dest = &extra.destbase->pix32(scanline); u8 *primap = &extra.primap->pix8(scanline); @@ -2478,7 +2478,7 @@ void namcos22_state::init_tables() m_gfxdecode->gfx(1)->get_data(i); m_texture_tilemap = (u16 *)memregion("textilemap")->base(); - m_texture_tiledata = (u16 *)m_gfxdecode->gfx(1)->get_data(0); + m_texture_tiledata = (u8 *)m_gfxdecode->gfx(1)->get_data(0); m_texture_tileattr = std::make_unique<u8[]>(0x080000*2); // unpack textures diff --git a/src/mame/video/namcos2_sprite.cpp b/src/mame/video/namcos2_sprite.cpp index 28877eed118..7d2f2f434b7 100644 --- a/src/mame/video/namcos2_sprite.cpp +++ b/src/mame/video/namcos2_sprite.cpp @@ -52,7 +52,7 @@ void namcos2_sprite_device::zdrawgfxzoom( device_palette_interface &palette = gfx->palette(); const int shadow_offset = (palette.shadows_enabled()) ? palette.entries() : 0; const pen_t *pal = &palette.pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); - const u16 *source_base = gfx->get_data(code % gfx->elements()); + const u8 *source_base = gfx->get_data(code % gfx->elements()); const int sprite_screen_height = (scaley * gfx->height() + 0x8000) >> 16; const int sprite_screen_width = (scalex * gfx->width() + 0x8000) >> 16; if (sprite_screen_width && sprite_screen_height) @@ -117,7 +117,7 @@ void namcos2_sprite_device::zdrawgfxzoom( { for (int y = sy; y < ey; y++) { - const u16 *source = source_base + (y_index>>16) * gfx->rowbytes(); + const u8 *source = source_base + (y_index>>16) * gfx->rowbytes(); u16 *dest = &dest_bmp.pix16(y); u8 *pri = &priority_bitmap.pix8(y); int x_index = x_index_base; @@ -126,7 +126,7 @@ void namcos2_sprite_device::zdrawgfxzoom( { for (int x = sx; x < ex; x++) { - const u16 c = source[x_index >> 16]; + const u8 c = source[x_index >> 16]; if (c != 0xff) { if (pri[x] <= zpos) @@ -155,7 +155,7 @@ void namcos2_sprite_device::zdrawgfxzoom( { for (int x = sx; x < ex; x++) { - const u16 c = source[x_index >> 16]; + const u8 c = source[x_index >> 16]; if (c != 0xff) { if (pri[x] <= zpos) diff --git a/src/mame/video/nemesis.cpp b/src/mame/video/nemesis.cpp index 5ae443bd5b5..aebbf5f7078 100644 --- a/src/mame/video/nemesis.cpp +++ b/src/mame/video/nemesis.cpp @@ -9,7 +9,7 @@ #include "emu.h" #include "includes/nemesis.h" #include "video/resnet.h" -#include <algorithm> + static const struct { @@ -262,7 +262,7 @@ void nemesis_state::video_start() m_foreground->set_scroll_rows(256); memset(m_charram, 0, m_charram.bytes()); - std::fill(std::begin(m_blank_tile), std::end(m_blank_tile), 0); + memset(m_blank_tile, 0, ARRAY_LENGTH(m_blank_tile)); /* Set up save state */ machine().save().register_postload(save_prepost_delegate(FUNC(nemesis_state::nemesis_postload), this)); diff --git a/src/mame/video/polepos.cpp b/src/mame/video/polepos.cpp index b73736bb617..e3171c229c3 100644 --- a/src/mame/video/polepos.cpp +++ b/src/mame/video/polepos.cpp @@ -386,7 +386,7 @@ void polepos_state::zoom_sprite(bitmap_ind16 &bitmap,int big, int sizex,int sizey) { gfx_element *gfx = m_gfxdecode->gfx(big ? 3 : 2); - const uint16_t *gfxdata = gfx->get_data(code % gfx->elements()); + const uint8_t *gfxdata = gfx->get_data(code % gfx->elements()); uint8_t *scaling_rom = memregion("gfx6")->base(); uint32_t transmask = m_palette->transpen_mask(*gfx, color, 0x1f); int coloroffs = gfx->colorbase() + color * gfx->granularity(); @@ -404,7 +404,7 @@ void polepos_state::zoom_sprite(bitmap_ind16 &bitmap,int big, int xx = sx & 0x3ff; int siz = 0; int offs = 0; - const uint16_t *src; + const uint8_t *src; if (!big) dy >>= 1; src = gfxdata + dy * gfx->rowbytes(); diff --git a/src/mame/video/popeye.cpp b/src/mame/video/popeye.cpp index 4dc90efe7ea..b5052e8a1b6 100644 --- a/src/mame/video/popeye.cpp +++ b/src/mame/video/popeye.cpp @@ -318,8 +318,8 @@ void tnx1_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(1); const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (a->color % gfx->colors())); - const uint16_t *source_base = gfx->get_data(a->code % gfx->elements()); - const uint16_t *source = source_base + (a->row ^ a->flipy) * gfx->rowbytes(); + const uint8_t *source_base = gfx->get_data(a->code % gfx->elements()); + const uint8_t *source = source_base + (a->row ^ a->flipy) * gfx->rowbytes(); if (bootleg_sprites() && flipx != a->flipx) { diff --git a/src/mame/video/psikyosh.cpp b/src/mame/video/psikyosh.cpp index dc1269c1fb2..4a90af50383 100644 --- a/src/mame/video/psikyosh.cpp +++ b/src/mame/video/psikyosh.cpp @@ -408,7 +408,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl for (int xtile = xstart; xtile != xend; xtile += xinc) { const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); - const u16 *code_base = gfx->get_data((code + code_offset++) % gfx->elements()); + const u8 *code_base = gfx->get_data((code + code_offset++) % gfx->elements()); int x_index_base, y_index; @@ -458,7 +458,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl { if (z > 0) { - const u16 *source = code_base + (y_index) * gfx->rowbytes() + x_index_base; + const u8 *source = code_base + (y_index) * gfx->rowbytes() + x_index_base; u32 *dest = &dest_bmp.pix32(sy, sx); u16 *pri = &m_z_bitmap.pix16(sy, sx); int src_modulo = yinc * gfx->rowbytes() - xinc * (ex - sx); @@ -470,7 +470,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl { if (z >= *pri) { - const u16 c = *source; + const u8 c = *source; if (c != 0) { *dest = pal[c]; @@ -488,7 +488,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl } else { - const u16 *source = code_base + y_index * gfx->rowbytes() + x_index_base; + const u8 *source = code_base + y_index * gfx->rowbytes() + x_index_base; u32 *dest = &dest_bmp.pix32(sy, sx); int src_modulo = yinc * gfx->rowbytes() - xinc * (ex - sx); int dst_modulo = dest_bmp.rowpixels() - (ex - sx); @@ -497,7 +497,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl { for (int x = sx; x < ex; x++) { - const u16 c = *source; + const u8 c = *source; if (c != 0) *dest = pal[c]; @@ -515,7 +515,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl { if (z > 0) { - const u16 *source = code_base + y_index * gfx->rowbytes() + x_index_base; + const u8 *source = code_base + y_index * gfx->rowbytes() + x_index_base; u32 *dest = &dest_bmp.pix32(sy, sx); u16 *pri = &m_z_bitmap.pix16(sy, sx); int src_modulo = yinc * gfx->rowbytes() - xinc * (ex - sx); @@ -527,7 +527,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl { if (z >= *pri) { - const u16 c = *source; + const u8 c = *source; if (c != 0) { *dest = alpha_blend_r32(*dest, pal[c], alpha); @@ -545,7 +545,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl } else { - const u16 *source = code_base + y_index * gfx->rowbytes() + x_index_base; + const u8 *source = code_base + y_index * gfx->rowbytes() + x_index_base; u32 *dest = &dest_bmp.pix32(sy, sx); int src_modulo = yinc * gfx->rowbytes() - xinc * (ex - sx); int dst_modulo = dest_bmp.rowpixels() - (ex - sx); @@ -554,7 +554,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl { for (int x = sx; x < ex; x++) { - const u16 c = *source; + const u8 c = *source; if (c != 0) *dest = alpha_blend_r32(*dest, pal[c], alpha); @@ -573,7 +573,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl { if (z > 0) { - const u16 *source = code_base + y_index * gfx->rowbytes() + x_index_base; + const u8 *source = code_base + y_index * gfx->rowbytes() + x_index_base; u32 *dest = &dest_bmp.pix32(sy, sx); u16 *pri = &m_z_bitmap.pix16(sy, sx); int src_modulo = yinc * gfx->rowbytes() - xinc * (ex - sx); @@ -585,7 +585,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl { if (z >= *pri) { - const u16 c = *source; + const u8 c = *source; if (c != 0) { if (m_alphatable[c] == 0xff) @@ -607,7 +607,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl } else { - const u16 *source = code_base + y_index * gfx->rowbytes() + x_index_base; + const u8 *source = code_base + y_index * gfx->rowbytes() + x_index_base; u32 *dest = &dest_bmp.pix32(sy, sx); int src_modulo = yinc * gfx->rowbytes() - xinc * (ex - sx); int dst_modulo = dest_bmp.rowpixels() - (ex - sx); @@ -616,7 +616,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl { for (int x = sx; x < ex; x++) { - const u16 c = *source; + const u8 c = *source; if (c != 0) { if (m_alphatable[c] == 0xff) @@ -646,10 +646,10 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl { for (int xtile = 0; xtile < wide; xtile++) { - const u16 *code_base = gfx->get_data((code + code_offset++) % gfx->elements()); + const u8 *code_base = gfx->get_data((code + code_offset++) % gfx->elements()); for (int ypixel = 0; ypixel < gfx->height(); ypixel++) { - const u16 *source = code_base + ypixel * gfx->rowbytes(); + const u8 *source = code_base + ypixel * gfx->rowbytes(); u8 *dest = &m_zoom_bitmap.pix8(ypixel + ytile*gfx->height()); for (int xpixel = 0; xpixel < gfx->width(); xpixel++) diff --git a/src/mame/video/seibuspi.cpp b/src/mame/video/seibuspi.cpp index b3c7b4ab65c..881f62946c7 100644 --- a/src/mame/video/seibuspi.cpp +++ b/src/mame/video/seibuspi.cpp @@ -437,7 +437,7 @@ void seibuspi_state::drawgfx_blend(bitmap_rgb32 &bitmap, const rectangle &clipre color = gfx->colorbase() + (color % gfx->colors()) * gfx->granularity(); const pen_t *pens = m_palette->pens(); - const u16 *src = gfx->get_data(code % gfx->elements()); + const u8 *src = gfx->get_data(code % gfx->elements()); const u8 trans_pen = (1 << m_sprite_bpp) - 1; // draw @@ -450,7 +450,7 @@ void seibuspi_state::drawgfx_blend(bitmap_rgb32 &bitmap, const rectangle &clipre for (int x = x1; x <= x2; x++) { - const u16 pen = src[src_i]; + const u8 pen = src[src_i]; if (!(pri[x] & primask) && pen != trans_pen) { pri[x] |= primask; diff --git a/src/mame/video/seta2.cpp b/src/mame/video/seta2.cpp index 3a171ca3d47..d1aaef6758b 100644 --- a/src/mame/video/seta2.cpp +++ b/src/mame/video/seta2.cpp @@ -282,7 +282,7 @@ WRITE16_MEMBER(seta2_state::spriteram_w) ***************************************************************************/ -inline void seta2_state::drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int which_gfx, const uint16_t* const addr, const uint32_t realcolor, int flipx, int flipy, int base_sx, int use_shadow, int realline, int line, int opaque) +inline void seta2_state::drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int which_gfx, const uint8_t* const addr, const uint32_t realcolor, int flipx, int flipy, int base_sx, int use_shadow, int realline, int line, int opaque) { struct drawmodes { @@ -310,7 +310,7 @@ inline void seta2_state::drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cli if (!use_shadow) shadow = 0; - const uint16_t* const source = flipy ? addr + (7 - line) * 8 : addr + line * 8; + const uint8_t* const source = flipy ? addr + (7 - line) * 8 : addr + line * 8; uint16_t* dest = &bitmap.pix16(realline); diff --git a/src/mame/video/snk.cpp b/src/mame/video/snk.cpp index 6704064f69a..60b51cb4f40 100644 --- a/src/mame/video/snk.cpp +++ b/src/mame/video/snk.cpp @@ -3,7 +3,6 @@ // thanks-to:Marco Cassili #include "emu.h" #include "includes/snk.h" -#include <algorithm> /******************************************************************************* Shadow Handling Notes @@ -343,7 +342,7 @@ VIDEO_START_MEMBER(snk_state,gwar) for(i = 0; i <= 14; i++) m_drawmode_table[i] = DRAWMODE_SOURCE; m_drawmode_table[15] = DRAWMODE_NONE; - std::fill(std::begin(m_empty_tile), std::end(m_empty_tile), 0xf); + memset(m_empty_tile, 0xf, sizeof(m_empty_tile)); m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(snk_state::gwar_get_tx_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 50, 32); m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(snk_state::gwar_get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 32, 32); diff --git a/src/mame/video/ssv.cpp b/src/mame/video/ssv.cpp index 763b595ab61..7d280915cc5 100644 --- a/src/mame/video/ssv.cpp +++ b/src/mame/video/ssv.cpp @@ -142,10 +142,10 @@ void ssv_state::drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, in { gfx_element *gfxelement = m_gfxdecode->gfx(0); - const uint16_t *const addr = gfxelement->get_data(code % gfxelement->elements()); + const uint8_t *const addr = gfxelement->get_data(code % gfxelement->elements()); const uint32_t realcolor = gfxelement->granularity() * (color % gfxelement->colors()); - const uint16_t *const source = flipy ? addr + (7 - line) * gfxelement->rowbytes() : addr + line * gfxelement->rowbytes(); + const uint8_t *const source = flipy ? addr + (7 - line) * gfxelement->rowbytes() : addr + line * gfxelement->rowbytes(); if (realline >= cliprect.min_y && realline <= cliprect.max_y) { diff --git a/src/mame/video/taito_f2.cpp b/src/mame/video/taito_f2.cpp index 0e0b2b25bc4..b47500f899d 100644 --- a/src/mame/video/taito_f2.cpp +++ b/src/mame/video/taito_f2.cpp @@ -286,7 +286,7 @@ void taitof2_state::taito_f2_tc360_spritemixdraw(screen_device &screen, bitmap_i u32 code, u32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley) { const u16 pal_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors()); - const u16 *source_base = gfx->get_data(code % gfx->elements()); + const u8 *source_base = gfx->get_data(code % gfx->elements()); bitmap_ind8 &priority_bitmap = screen.priority(); const int sprite_screen_height = (scaley * gfx->height() + 0x8000) >> 16; const int sprite_screen_width = (scalex * gfx->width() + 0x8000) >> 16; @@ -355,14 +355,14 @@ void taitof2_state::taito_f2_tc360_spritemixdraw(screen_device &screen, bitmap_i /* skip if inner loop doesn't draw anything */ for (int y = sy; y < ey; y++) { - const u16 *source = source_base + (y_index >> 16) * gfx->rowbytes(); + const u8 *source = source_base + (y_index >> 16) * gfx->rowbytes(); u16 *dest = &dest_bmp.pix16(y); u8 *pri = &priority_bitmap.pix8(y); int x_index = x_index_base; for (int x = sx; x < ex; x++) { - const u16 c = source[x_index >> 16]; + const u8 c = source[x_index >> 16]; if (c && (pri[x] & 0x80) == 0) { u8 tilemap_priority = 0, sprite_priority = 0; diff --git a/src/mame/video/taito_f3.cpp b/src/mame/video/taito_f3.cpp index eeb1d010428..1280d21d234 100644 --- a/src/mame/video/taito_f3.cpp +++ b/src/mame/video/taito_f3.cpp @@ -591,7 +591,7 @@ void taito_f3_state::video_start() for (int c = 0; c < sprite_gfx->elements(); c++) { int chk_trans_or_opa = 0; - const u16 *dp = sprite_gfx->get_data(c); + const u8 *dp = sprite_gfx->get_data(c); for (int y = 0; y < sprite_gfx->height(); y++) { for (int x = 0; x < sprite_gfx->width(); x++) @@ -616,7 +616,7 @@ void taito_f3_state::video_start() int chk_trans_or_opa = 0; /* 0 = 4bpp, 1=5bpp, 2=?, 3=6bpp */ const u8 extra_mask = ((extra_planes << 4) | 0x0f); - const u16 *dp = pf_gfx->get_data(c); + const u8 *dp = pf_gfx->get_data(c); for (int y = 0; y < pf_gfx->height(); y++) { @@ -2474,7 +2474,7 @@ inline void taito_f3_state::f3_drawgfx(bitmap_rgb32 &dest_bmp, const rectangle & if (gfx) { const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); - const u16 *code_base = gfx->get_data(code % gfx->elements()); + const u8 *code_base = gfx->get_data(code % gfx->elements()); { /* compute sprite increment per screen pixel */ @@ -2537,7 +2537,7 @@ inline void taito_f3_state::f3_drawgfx(bitmap_rgb32 &dest_bmp, const rectangle & { int y = ey - sy; const int x = (ex - sx - 1) | (m_tile_opaque_sp[code % gfx->elements()] << 4); - const u16 *source0 = code_base + y_index * 16 + x_index_base; + const u8 *source0 = code_base + y_index * 16 + x_index_base; u32 *dest0 = &dest_bmp.pix32(sy, sx); u8 *pri0 = &m_pri_alp_bitmap.pix8(sy, sx); const int yadv = dest_bmp.rowpixels(); @@ -2545,7 +2545,7 @@ inline void taito_f3_state::f3_drawgfx(bitmap_rgb32 &dest_bmp, const rectangle & dy = dy * 16; while (1) { - const u16 *source = source0; + const u8 *source = source0; u32 *dest = dest0; u8 *pri = pri0; @@ -2623,7 +2623,7 @@ inline void taito_f3_state::f3_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectang if (gfx) { const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); - const u16 *code_base = gfx->get_data(code % gfx->elements()); + const u8 *code_base = gfx->get_data(code % gfx->elements()); { /* compute sprite increment per screen pixel */ @@ -2686,7 +2686,7 @@ inline void taito_f3_state::f3_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectang { for (int y = sy; y < ey; y++) { - const u16 *source = code_base + (y_index >> 16) * 16; + const u8 *source = code_base + (y_index >> 16) * 16; u32 *dest = &dest_bmp.pix32(y); u8 *pri = &m_pri_alp_bitmap.pix8(y); diff --git a/src/mame/video/tatsumi.cpp b/src/mame/video/tatsumi.cpp index 8f1c6388d82..2472576049c 100644 --- a/src/mame/video/tatsumi.cpp +++ b/src/mame/video/tatsumi.cpp @@ -117,7 +117,7 @@ inline void tatsumi_state::roundupt_drawgfxzoomrotate( _BitmapClass &dest_bmp, c { const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); const uint8_t *shadow_pens = m_shadow_pen_array.get() + (gfx->granularity() * (color % gfx->colors())); - const uint16_t *code_base = gfx->get_data(code % gfx->elements()); + const uint8_t *code_base = gfx->get_data(code % gfx->elements()); int block_size = 8 * scalex; int sprite_screen_height = ((ssy&0xffff)+block_size)>>16; @@ -237,7 +237,7 @@ inline void tatsumi_state::roundupt_drawgfxzoomrotate( _BitmapClass &dest_bmp, c int x, x_index = x_index_base; for( x=sx; x<ex; x++ ) { - const uint16_t *source = code_base + (cy>>16) * gfx->rowbytes(); + const uint8_t *source = code_base + (cy>>16) * gfx->rowbytes(); int c = source[(cx >> 16)]; if( c != transparent_color ) { @@ -260,7 +260,7 @@ inline void tatsumi_state::roundupt_drawgfxzoomrotate( _BitmapClass &dest_bmp, c { for( y=sy; y<ey; y++ ) { - const uint16_t *source = code_base + (y_index>>16) * gfx->rowbytes(); + const uint8_t *source = code_base + (y_index>>16) * gfx->rowbytes(); typename _BitmapClass::pixel_t *dest = &dest_bmp.pix(y); int x, x_index = x_index_base; @@ -1158,12 +1158,12 @@ void cyclwarr_state::tile_expand() dest = srcdata; for (int c = 0; c < gx0->elements(); c++) { - const uint16_t *c0base = gx0->get_data(c); + const uint8_t *c0base = gx0->get_data(c); // loop over height for (int y = 0; y < gx0->height(); y++) { - const uint16_t *c0 = c0base; + const uint8_t *c0 = c0base; for (int x = 0; x < gx0->width(); x++) { diff --git a/src/mame/video/tc0100scn.cpp b/src/mame/video/tc0100scn.cpp index 32ae8a967c5..0238be3d35e 100644 --- a/src/mame/video/tc0100scn.cpp +++ b/src/mame/video/tc0100scn.cpp @@ -355,14 +355,14 @@ void tc0620scc_device::device_start() u8 *dest = srcdata; for (int c = 0; c < gx0->elements(); c++) { - const u16 *c0base = gx0->get_data(c); - const u16 *c1base = gx1->get_data(c); + const u8 *c0base = gx0->get_data(c); + const u8 *c1base = gx1->get_data(c); // loop over height for (int y = 0; y < gx0->height(); y++) { - const u16 *c0 = c0base; - const u16 *c1 = c1base; + const u8 *c0 = c0base; + const u8 *c1 = c1base; for (int x = 0; x < gx0->width(); x++) *dest++ = (*c0++ & 0xf) | (*c1++ & 0x30); diff --git a/src/mame/video/thepit.cpp b/src/mame/video/thepit.cpp index a4f68ea76df..58d401ca2c4 100644 --- a/src/mame/video/thepit.cpp +++ b/src/mame/video/thepit.cpp @@ -133,7 +133,7 @@ void thepit_state::video_start() m_solid_tilemap->set_scroll_cols(32); m_tilemap->set_scroll_cols(32); - m_dummy_tile = make_unique_clear<uint16_t[]>(8*8); + m_dummy_tile = make_unique_clear<uint8_t[]>(8*8); m_graphics_bank = 0; /* only used in intrepid */ diff --git a/src/mame/video/toaplan1.cpp b/src/mame/video/toaplan1.cpp index 9eb8558958d..41a9b6ef407 100644 --- a/src/mame/video/toaplan1.cpp +++ b/src/mame/video/toaplan1.cpp @@ -676,7 +676,7 @@ void toaplan1_state::draw_sprite_custom(screen_device &screen, bitmap_rgb32 &des int priority) { const u32 pal_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors()); - const u16 *source_base = gfx->get_data(code % gfx->elements()); + const u8 *source_base = gfx->get_data(code % gfx->elements()); bitmap_ind8 &priority_bitmap = screen.priority(); const int sprite_screen_height = ((1 << 16) * gfx->height() + 0x8000) >> 16; const int sprite_screen_width = ((1 << 16) * gfx->width() + 0x8000) >> 16; @@ -742,14 +742,14 @@ void toaplan1_state::draw_sprite_custom(screen_device &screen, bitmap_rgb32 &des { /* skip if inner loop doesn't draw anything */ for (int y = sy; y < ey; y++) { - const u16 *source = source_base + (y_index >> 16) * gfx->rowbytes(); + const u8 *source = source_base + (y_index >> 16) * gfx->rowbytes(); u32 *dest = &dest_bmp.pix32(y); u8 *pri = &priority_bitmap.pix8(y); int x_index = x_index_base; for (int x = sx; x < ex; x++) { - const u16 c = source[x_index >> 16]; + const u8 c = source[x_index >> 16]; if (c != 0) { if (pri[x] < priority) diff --git a/src/mame/video/wecleman.cpp b/src/mame/video/wecleman.cpp index 5169aeb8349..4bb6c0c1120 100644 --- a/src/mame/video/wecleman.cpp +++ b/src/mame/video/wecleman.cpp @@ -542,7 +542,7 @@ void wecleman_state::wecleman_draw_road(bitmap_rgb32 &bitmap, const rectangle &c }; - const uint16_t *src_ptr; + const uint8_t *src_ptr; const pen_t *pal_ptr, *rgb_ptr; int scrollx, sy, sx; @@ -643,7 +643,7 @@ void wecleman_state::draw_cloud(bitmap_rgb32 &bitmap, int tmw_l2, int tmh_l2, // tilemap width and height in log(2) int alpha, int pal_offset ) // alpha(0-3f), # of color codes to shift { - const uint16_t *src_ptr; + const uint8_t *src_ptr; uint16_t *tmap_ptr; uint32_t *dst_base, *dst_ptr; const pen_t *pal_base, *pal_ptr; @@ -944,7 +944,7 @@ VIDEO_START_MEMBER(wecleman_state,wecleman) m_txt_tilemap->set_scrolly(0, -BMP_PAD ); // patches out a mysterious pixel floating in the sky (tile decoding bug?) - *const_cast<uint16_t *>(m_gfxdecode->gfx(0)->get_data(0xaca)+7) = 0; + *const_cast<uint8_t *>(m_gfxdecode->gfx(0)->get_data(0xaca)+7) = 0; } // Callbacks for the K051316 |