diff options
Diffstat (limited to 'src')
385 files changed, 5499 insertions, 7670 deletions
diff --git a/src/devices/bus/a1bus/a1bus.cpp b/src/devices/bus/a1bus/a1bus.cpp index c3ebc73c6de..5075233c2bd 100644 --- a/src/devices/bus/a1bus/a1bus.cpp +++ b/src/devices/bus/a1bus/a1bus.cpp @@ -7,7 +7,6 @@ ***************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "a1bus.h" diff --git a/src/devices/bus/a2bus/a2bus.cpp b/src/devices/bus/a2bus/a2bus.cpp index 5fd03495c87..2083a607690 100644 --- a/src/devices/bus/a2bus/a2bus.cpp +++ b/src/devices/bus/a2bus/a2bus.cpp @@ -71,7 +71,6 @@ ***************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "a2bus.h" diff --git a/src/devices/bus/a2bus/a2eauxslot.cpp b/src/devices/bus/a2bus/a2eauxslot.cpp index f1d4836d37b..c362c23abe5 100644 --- a/src/devices/bus/a2bus/a2eauxslot.cpp +++ b/src/devices/bus/a2bus/a2eauxslot.cpp @@ -9,7 +9,6 @@ ***************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "a2eauxslot.h" diff --git a/src/devices/bus/bml3/bml3bus.cpp b/src/devices/bus/bml3/bml3bus.cpp index 0438cc58997..620743dbe68 100644 --- a/src/devices/bus/bml3/bml3bus.cpp +++ b/src/devices/bus/bml3/bml3bus.cpp @@ -43,7 +43,6 @@ ***************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "bml3bus.h" diff --git a/src/devices/bus/coco/cococart.cpp b/src/devices/bus/coco/cococart.cpp index 66cbc1dc121..3e6b2ee2c6f 100644 --- a/src/devices/bus/coco/cococart.cpp +++ b/src/devices/bus/coco/cococart.cpp @@ -10,7 +10,6 @@ #include "emu.h" #include "cococart.h" -#include "emuopts.h" /*************************************************************************** PARAMETERS diff --git a/src/devices/bus/comx35/clm.cpp b/src/devices/bus/comx35/clm.cpp index 15aa7f88295..6929a01d6eb 100644 --- a/src/devices/bus/comx35/clm.cpp +++ b/src/devices/bus/comx35/clm.cpp @@ -175,6 +175,7 @@ machine_config_constructor comx_clm_device::device_mconfig_additions() const comx_clm_device::comx_clm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, COMX_CLM, "COMX 80 Column Card", tag, owner, clock, "comx_clm", __FILE__), device_comx_expansion_card_interface(mconfig, *this), + device_gfx_interface(mconfig, *this, nullptr, "palette"), m_crtc(*this, MC6845_TAG), m_palette(*this, "palette"), m_rom(*this, "c000"), diff --git a/src/devices/bus/comx35/clm.h b/src/devices/bus/comx35/clm.h index 131a57b2cd9..5b2da54d905 100644 --- a/src/devices/bus/comx35/clm.h +++ b/src/devices/bus/comx35/clm.h @@ -24,7 +24,8 @@ // ======================> comx_clm_device class comx_clm_device : public device_t, - public device_comx_expansion_card_interface + public device_comx_expansion_card_interface, + public device_gfx_interface { public: // construction/destruction diff --git a/src/devices/bus/cpc/cpcexp.cpp b/src/devices/bus/cpc/cpcexp.cpp index 69ad0887282..43b35ac57f2 100644 --- a/src/devices/bus/cpc/cpcexp.cpp +++ b/src/devices/bus/cpc/cpcexp.cpp @@ -9,7 +9,6 @@ #include "emu.h" -#include "emuopts.h" #include "cpcexp.h" diff --git a/src/devices/bus/gameboy/gb_slot.cpp b/src/devices/bus/gameboy/gb_slot.cpp index 47236928fb7..18f2ca83c21 100644 --- a/src/devices/bus/gameboy/gb_slot.cpp +++ b/src/devices/bus/gameboy/gb_slot.cpp @@ -783,8 +783,7 @@ void base_gb_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len) {0x5A01, "Bitmap Brothers/Mindscape"}, {0x5301, "American Sammy"}, {0x4701, "Spectrum Holobyte"}, - {0x1801, "Hudson Soft"}, - {0x0000, nullptr} + {0x1801, "Hudson Soft"} }; static const int ramsize[8] = { 0, 2, 8, 32, 128, 64, 0, 0 }; @@ -817,24 +816,23 @@ void base_gb_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len) soft[16] = '\0'; logerror("Cart Information\n"); logerror("\tName: %s\n", soft); - logerror("\tType: %s [0x%2X]\n", (ROM[0x0147] <= 32) ? cart_types[ROM[0x0147]] : "", ROM[0x0147] ); + logerror("\tType: %s [0x%02X]\n", (ROM[0x0147] <= 32) ? cart_types[ROM[0x0147]] : "", ROM[0x0147] ); logerror("\tGame Boy: %s\n", (ROM[0x0143] == 0xc0) ? "No" : "Yes" ); - logerror("\tSuper GB: %s [0x%2X]\n", (ROM[0x0146] == 0x03) ? "Yes" : "No", ROM[0x0146] ); - logerror("\tColor GB: %s [0x%2X]\n", (ROM[0x0143] == 0x80 || ROM[0x0143] == 0xc0) ? "Yes" : "No", ROM[0x0143] ); - logerror("\tROM Size: %d 16kB Banks [0x%2X]\n", rom_banks, ROM[0x0148]); - logerror("\tRAM Size: %d kB [0x%2X]\n", ramsize[ROM[0x0149] & 0x07], ROM[0x0149]); - logerror("\tLicense code: 0x%2X%2X\n", ROM[0x0145], ROM[0x0144] ); + logerror("\tSuper GB: %s [0x%02X]\n", (ROM[0x0146] == 0x03) ? "Yes" : "No", ROM[0x0146] ); + logerror("\tColor GB: %s [0x%02X]\n", (ROM[0x0143] == 0x80 || ROM[0x0143] == 0xc0) ? "Yes" : "No", ROM[0x0143] ); + logerror("\tROM Size: %d 16kB Banks [0x%02X]\n", rom_banks, ROM[0x0148]); + logerror("\tRAM Size: %d kB [0x%02X]\n", ramsize[ROM[0x0149] & 0x07], ROM[0x0149]); + logerror("\tLicense code: 0x%02X%02X\n", ROM[0x0145], ROM[0x0144] ); tmp = (ROM[0x014b] << 8) + ROM[0x014a]; for (i = 0; i < ARRAY_LENGTH(companies); i++) if (tmp == companies[i].code) break; - logerror("\tManufacturer ID: 0x%2X", tmp); - logerror(" [%s]\n", (i < ARRAY_LENGTH(companies)) ? companies[i].name : "?"); - logerror("\tVersion Number: 0x%2X\n", ROM[0x014c]); - logerror("\tComplement Check: 0x%2X\n", ROM[0x014d]); - logerror("\tChecksum: 0x%2X\n", ((ROM[0x014e] << 8) + ROM[0x014f])); + logerror("\tManufacturer ID: 0x%02X [%s]\n", tmp, (i < ARRAY_LENGTH(companies)) ? companies[i].name : "?"); + logerror("\tVersion Number: 0x%02X\n", ROM[0x014c]); + logerror("\tComplement Check: 0x%02X\n", ROM[0x014d]); + logerror("\tChecksum: 0x%04X\n", ((ROM[0x014e] << 8) + ROM[0x014f])); tmp = (ROM[0x0103] << 8) + ROM[0x0102]; - logerror("\tStart Address: 0x%2X\n", tmp); + logerror("\tStart Address: 0x%04X\n", tmp); // Additional checks if (rom_banks == 256) @@ -851,6 +849,6 @@ void base_gb_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len) csum &= 0xffff; if (csum != tmp) - logerror("\nWarning loading cartridge: Checksum is wrong (Actual %X vs Internal %X)\n", csum, tmp); + logerror("\nWarning loading cartridge: Checksum is wrong (Actual 0x%04X vs Internal 0x%04X)\n", csum, tmp); } diff --git a/src/devices/bus/iq151/iq151.cpp b/src/devices/bus/iq151/iq151.cpp index 3d4ef7abe05..16839150b5a 100644 --- a/src/devices/bus/iq151/iq151.cpp +++ b/src/devices/bus/iq151/iq151.cpp @@ -8,7 +8,6 @@ #include "emu.h" #include "iq151.h" -#include "emuopts.h" #define LOG 0 diff --git a/src/devices/bus/iq151/video32.cpp b/src/devices/bus/iq151/video32.cpp index a5ce59a51db..91724700a03 100644 --- a/src/devices/bus/iq151/video32.cpp +++ b/src/devices/bus/iq151/video32.cpp @@ -36,13 +36,6 @@ static const gfx_layout iq151_video32_charlayout = 8*8 /* every char takes 8 bytes */ }; -static GFXDECODE_START( video32 ) -GFXDECODE_END - -static MACHINE_CONFIG_FRAGMENT( video32 ) - MCFG_GFXDECODE_ADD("gfxdecode", "^^palette", video32) -MACHINE_CONFIG_END - //************************************************************************** // GLOBAL VARIABLES //************************************************************************** @@ -59,9 +52,8 @@ const device_type IQ151_VIDEO32 = &device_creator<iq151_video32_device>; iq151_video32_device::iq151_video32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, IQ151_VIDEO32, "IQ151 video32", tag, owner, clock, "iq151_video32", __FILE__), - device_iq151cart_interface( mconfig, *this ), m_videoram(nullptr), m_chargen(nullptr), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "^^palette") + device_gfx_interface(mconfig, *this, nullptr, "^^palette"), + device_iq151cart_interface( mconfig, *this ), m_videoram(nullptr), m_chargen(nullptr) { } @@ -75,7 +67,7 @@ void iq151_video32_device::device_start() m_videoram = (UINT8*)memregion("videoram")->base(); m_chargen = (UINT8*)memregion("chargen")->base(); - m_gfxdecode->set_gfx(0, std::make_unique<gfx_element>(m_palette, iq151_video32_charlayout, m_chargen, 0, 1, 0)); + set_gfx(0, std::make_unique<gfx_element>(palette(), iq151_video32_charlayout, m_chargen, 0, 1, 0)); } //------------------------------------------------- @@ -92,16 +84,6 @@ void iq151_video32_device::device_reset() } //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations -//------------------------------------------------- - -machine_config_constructor iq151_video32_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( video32 ); -} - -//------------------------------------------------- // device_rom_region //------------------------------------------------- diff --git a/src/devices/bus/iq151/video32.h b/src/devices/bus/iq151/video32.h index d8b3a1e93eb..10937728696 100644 --- a/src/devices/bus/iq151/video32.h +++ b/src/devices/bus/iq151/video32.h @@ -16,6 +16,7 @@ class iq151_video32_device : public device_t, + public device_gfx_interface, public device_iq151cart_interface { public: @@ -24,7 +25,6 @@ public: // optional information overrides virtual const rom_entry *device_rom_region() const override; - virtual machine_config_constructor device_mconfig_additions() const override; protected: // device-level overrides @@ -39,8 +39,6 @@ protected: private: UINT8 * m_videoram; UINT8 * m_chargen; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; }; diff --git a/src/devices/bus/iq151/video64.cpp b/src/devices/bus/iq151/video64.cpp index d58cca76aec..afb7462804d 100644 --- a/src/devices/bus/iq151/video64.cpp +++ b/src/devices/bus/iq151/video64.cpp @@ -36,13 +36,6 @@ static const gfx_layout iq151_video64_charlayout = 8*8 /* every char takes 8 bytes */ }; -static GFXDECODE_START( video64 ) -GFXDECODE_END - -static MACHINE_CONFIG_FRAGMENT( video64 ) - MCFG_GFXDECODE_ADD("gfxdecode", "^^palette", video64) -MACHINE_CONFIG_END - //************************************************************************** // GLOBAL VARIABLES //************************************************************************** @@ -59,9 +52,8 @@ const device_type IQ151_VIDEO64 = &device_creator<iq151_video64_device>; iq151_video64_device::iq151_video64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, IQ151_VIDEO64, "IQ151 video64", tag, owner, clock, "iq151_video64", __FILE__), - device_iq151cart_interface( mconfig, *this ), m_videoram(nullptr), m_chargen(nullptr), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "^^palette") + device_gfx_interface(mconfig, *this, nullptr, "^^palette"), + device_iq151cart_interface( mconfig, *this ), m_videoram(nullptr), m_chargen(nullptr) { } @@ -74,7 +66,7 @@ void iq151_video64_device::device_start() m_videoram = (UINT8*)memregion("videoram")->base(); m_chargen = (UINT8*)memregion("chargen")->base(); - m_gfxdecode->set_gfx(0,std::make_unique<gfx_element>(m_palette, iq151_video64_charlayout, m_chargen, 0, 1, 0)); + set_gfx(0,std::make_unique<gfx_element>(palette(), iq151_video64_charlayout, m_chargen, 0, 1, 0)); } //------------------------------------------------- @@ -91,16 +83,6 @@ void iq151_video64_device::device_reset() } //------------------------------------------------- -// machine_config_additions - device-specific -// machine configurations -//------------------------------------------------- - -machine_config_constructor iq151_video64_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( video64 ); -} - -//------------------------------------------------- // device_rom_region //------------------------------------------------- diff --git a/src/devices/bus/iq151/video64.h b/src/devices/bus/iq151/video64.h index 0162e107e31..f8d6d675f45 100644 --- a/src/devices/bus/iq151/video64.h +++ b/src/devices/bus/iq151/video64.h @@ -16,6 +16,7 @@ class iq151_video64_device : public device_t, + public device_gfx_interface, public device_iq151cart_interface { public: @@ -24,7 +25,6 @@ public: // optional information overrides virtual const rom_entry *device_rom_region() const override; - virtual machine_config_constructor device_mconfig_additions() const override; protected: // device-level overrides @@ -40,8 +40,6 @@ protected: private: UINT8 * m_videoram; UINT8 * m_chargen; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; }; diff --git a/src/devices/bus/isa/isa.cpp b/src/devices/bus/isa/isa.cpp index 9b07bdce8e0..defba476704 100644 --- a/src/devices/bus/isa/isa.cpp +++ b/src/devices/bus/isa/isa.cpp @@ -7,7 +7,6 @@ ***************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "isa.h" diff --git a/src/devices/bus/kc/kc.cpp b/src/devices/bus/kc/kc.cpp index a5a46802998..05afba8ed7a 100644 --- a/src/devices/bus/kc/kc.cpp +++ b/src/devices/bus/kc/kc.cpp @@ -106,7 +106,6 @@ #include "emu.h" #include "kc.h" -#include "emuopts.h" #define LOG 0 diff --git a/src/devices/bus/kc/rom.cpp b/src/devices/bus/kc/rom.cpp index 404089110a0..883b36eb739 100644 --- a/src/devices/bus/kc/rom.cpp +++ b/src/devices/bus/kc/rom.cpp @@ -43,7 +43,7 @@ const device_type KC_M033 = &device_creator<kc_m033_device>; //------------------------------------------------- kc_8k_device::kc_8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, KC_STANDARD, "Standard", tag, owner, clock, "kc_8k", __FILE__), + : device_t(mconfig, KC_STANDARD, "Standard 8K ROM module", tag, owner, clock, "kc_8k", __FILE__), device_kcexp_interface( mconfig, *this ), m_slot(nullptr), m_mei(0), m_rom(nullptr), m_enabled(0), m_base(0) { } diff --git a/src/devices/bus/macpds/macpds.cpp b/src/devices/bus/macpds/macpds.cpp index 61fae5f3a17..967655548e8 100644 --- a/src/devices/bus/macpds/macpds.cpp +++ b/src/devices/bus/macpds/macpds.cpp @@ -9,7 +9,6 @@ ***************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "macpds.h" diff --git a/src/devices/bus/nubus/nubus.cpp b/src/devices/bus/nubus/nubus.cpp index 175139f19c2..a5df6ef18a2 100644 --- a/src/devices/bus/nubus/nubus.cpp +++ b/src/devices/bus/nubus/nubus.cpp @@ -9,7 +9,6 @@ ***************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "nubus.h" diff --git a/src/devices/bus/pc_kbd/pc_kbdc.cpp b/src/devices/bus/pc_kbd/pc_kbdc.cpp index 9f920c6d5dd..987c51eda63 100644 --- a/src/devices/bus/pc_kbd/pc_kbdc.cpp +++ b/src/devices/bus/pc_kbd/pc_kbdc.cpp @@ -14,7 +14,6 @@ The following basic program can be useful for identifying scancodes: #include "emu.h" -#include "emuopts.h" #include "pc_kbdc.h" diff --git a/src/devices/bus/ti99x/datamux.cpp b/src/devices/bus/ti99x/datamux.cpp index da971c4ceec..034ecfe114d 100644 --- a/src/devices/bus/ti99x/datamux.cpp +++ b/src/devices/bus/ti99x/datamux.cpp @@ -122,7 +122,10 @@ void ti99_datamux_device::read_all(address_space& space, UINT16 addr, UINT8 *val } // Video - if ((addr & 0xf801)==0x8800) m_video->readz(space, addr, value); + if ((addr & 0xf801)==0x8800) + { + m_video->readz(space, addr, value); + } } // GROMport (ROMs) @@ -147,10 +150,15 @@ void ti99_datamux_device::write_all(address_space& space, UINT16 addr, UINT8 val m_gromport->write(space, addr, value); } - // Other devices + // Cartridge port and sound if ((addr & 0xe000)==0x6000) m_gromport->write(space, addr, value); - if ((addr & 0xfc01)==0x8400) m_sound->write(space, addr, value); - if ((addr & 0xf801)==0x8800) m_video->write(space, addr, value); + if ((addr & 0xfc01)==0x8400) m_sound->write(space, 0, value); + + // Video + if ((addr & 0xf801)==0x8800) + { + m_video->write(space, addr, value); + } // PEB gets all accesses m_peb->write(space, addr, value); @@ -182,12 +190,7 @@ void ti99_datamux_device::setaddress_all(address_space& space, UINT16 addr) // GROMport (GROMs) m_gromport->set_gromlines(space, lines, select); - if (validaccess) - { - // Other devices - if ((addr & 0xfc01)==0x8400) m_sound->setaddress_dbin(space, addr, m_dbin); - if ((addr & 0xf801)==0x8800) m_video->setaddress_dbin(space, addr, m_dbin); - } + // Sound chip and video chip do not require the address to be set before access // GROMport (ROMs) m_gromport->romgq_line(iscartrom? ASSERT_LINE : CLEAR_LINE); @@ -558,7 +561,7 @@ void ti99_datamux_device::device_reset(void) void ti99_datamux_device::device_config_complete() { m_video = downcast<bus8z_device*>(owner()->subdevice(VIDEO_SYSTEM_TAG)); - m_sound = downcast<ti_sound_sn94624_device*>(owner()->subdevice(TISOUND_TAG)); + m_sound = downcast<sn76496_base_device*>(owner()->subdevice(TISOUNDCHIP_TAG)); m_gromport = downcast<gromport_device*>(owner()->subdevice(GROMPORT_TAG)); m_peb = downcast<peribox_device*>(owner()->subdevice(PERIBOX_TAG)); m_grom[0] = downcast<tmc0430_device*>(owner()->subdevice(GROM0_TAG)); diff --git a/src/devices/bus/ti99x/datamux.h b/src/devices/bus/ti99x/datamux.h index eaad45b7238..5b59ea7d134 100644 --- a/src/devices/bus/ti99x/datamux.h +++ b/src/devices/bus/ti99x/datamux.h @@ -15,10 +15,12 @@ #define __DMUX__ #include "ti99defs.h" -#include "videowrp.h" #include "machine/tmc0430.h" #include "gromport.h" #include "bus/ti99_peb/peribox.h" +#include "sound/sn76496.h" +#include "video/tms9928a.h" +#include "bus/ti99x/videowrp.h" extern const device_type DATAMUX; @@ -57,7 +59,7 @@ private: bus8z_device* m_video; // Link to the sound processor - ti_sound_sn94624_device* m_sound; + sn76496_base_device* m_sound; // Link to the peripheral expansion box peribox_device* m_peb; diff --git a/src/devices/bus/ti99x/genboard.cpp b/src/devices/bus/ti99x/genboard.cpp index 1abdd7c6762..10f560ce6bd 100644 --- a/src/devices/bus/ti99x/genboard.cpp +++ b/src/devices/bus/ti99x/genboard.cpp @@ -207,7 +207,10 @@ geneve_mapper_device::geneve_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, GENEVE_MAPPER, "Geneve Gate Array", tag, owner, clock, "geneve_mapper", __FILE__), m_gromwaddr_LSB(false), m_gromraddr_LSB(false), m_grom_address(0), m_video_waitstates(false), m_extra_waitstates(false), m_ready_asserted(false), m_read_mode(false), m_debug_no_ws(false), m_geneve_mode(false), m_direct_mode(false), m_cartridge_size(0), m_cartridge_secondpage(false), m_cartridge6_writable(false), m_cartridge7_writable(false), m_turbo(false), m_genmod(false), m_timode(false), m_pfm_mode(0), m_pfm_bank(0), m_pfm_output_enable(false), m_sram_mask(0), m_sram_val(0), - m_ready(*this), m_waitcount(0), m_ext_waitcount(0), m_clock(nullptr), m_cpu(nullptr), m_pfm512(nullptr), m_pfm512a(nullptr), m_keyboard(nullptr), m_video(nullptr), m_peribox(nullptr), m_sound(nullptr), m_sram(nullptr), m_dram(nullptr) + m_ready(*this), m_waitcount(0), m_ext_waitcount(0), + m_clock(nullptr), m_cpu(nullptr), m_pfm512(nullptr), + m_pfm512a(nullptr), m_sound(nullptr), m_keyboard(nullptr), + m_video(nullptr), m_peribox(nullptr), m_sram(nullptr), m_dram(nullptr) { m_eprom = nullptr; } @@ -466,11 +469,14 @@ READ8_MEMBER( geneve_mapper_device::readm ) switch (dec->function) { case MLGVIDEO: - m_video->readz(space, dec->offset, &value, 0xff); - if (TRACE_READ) logerror("%s: Read video %04x -> %02x\n", tag(), dec->offset, value); - // Video wait states are created *after* the access - // Accordingly, they have no effect when execution is in onchip RAM - if (m_video_waitstates) set_ext_wait(15); + if (!space.debugger_access()) + { + value = m_video->read(space, dec->offset>>1); + if (TRACE_READ) logerror("%s: Read video %04x -> %02x\n", tag(), dec->offset, value); + // Video wait states are created *after* the access + // Accordingly, they have no effect when execution is in onchip RAM + if (m_video_waitstates) set_ext_wait(15); + } break; case MLGMAPPER: @@ -523,10 +529,13 @@ READ8_MEMBER( geneve_mapper_device::readm ) // video // ++++ ++-- ---- ---+ // 1000 1000 0000 00x0 - m_video->readz(space, dec->offset, &value, 0xff); - if (TRACE_READ) logerror("%s: Read video %04x -> %02x\n", tag(), dec->offset, value); - // See above - if (m_video_waitstates) set_ext_wait(15); + if (!space.debugger_access()) + { + value = m_video->read(space, dec->offset>>1); + if (TRACE_READ) logerror("%s: Read video %04x -> %02x\n", tag(), dec->offset, value); + // See above + if (m_video_waitstates) set_ext_wait(15); + } break; case MLTSPEECH: @@ -649,10 +658,14 @@ WRITE8_MEMBER( geneve_mapper_device::writem ) // video // ++++ ++++ ++++ ---+ // 1111 0001 0000 .cc0 - m_video->write(space, dec->offset, data, 0xff); - if (TRACE_WRITE) logerror("%s: Write video %04x <- %02x\n", tag(), offset, data); - // See above - if (m_video_waitstates) set_ext_wait(15); + + if (!space.debugger_access()) + { + m_video->write(space, dec->offset>>1, data); + if (TRACE_WRITE) logerror("%s: Write video %04x <- %02x\n", tag(), offset, data); + // See above + if (m_video_waitstates) set_ext_wait(15); + } break; case MLGMAPPER: @@ -692,10 +705,13 @@ WRITE8_MEMBER( geneve_mapper_device::writem ) // ++++ ++-- ---- ---+ // 1000 1100 0000 00c0 // Initialize waitstate timer - m_video->write(space, dec->offset, data, 0xff); - if (TRACE_WRITE) logerror("%s: Write video %04x <- %02x\n", tag(), offset, data); - // See above - if (m_video_waitstates) set_ext_wait(15); + if (!space.debugger_access()) + { + m_video->write(space, dec->offset>>1, data); + if (TRACE_WRITE) logerror("%s: Write video %04x <- %02x\n", tag(), offset, data); + // See above + if (m_video_waitstates) set_ext_wait(15); + } break; case MLTSPEECH: @@ -1360,8 +1376,8 @@ void geneve_mapper_device::device_start() // Get pointers m_peribox = machine().device<peribox_device>(PERIBOX_TAG); m_keyboard = machine().device<geneve_keyboard_device>(GKEYBOARD_TAG); - m_video = machine().device<bus8z_device>(VIDEO_SYSTEM_TAG); - m_sound = machine().device<bus8z_device>(TISOUND_TAG); + m_video = machine().device<v9938_device>(VDP_TAG); + m_sound = machine().device<sn76496_base_device>(TISOUNDCHIP_TAG); m_clock = machine().device<mm58274c_device>(GCLOCK_TAG); // PFM expansion diff --git a/src/devices/bus/ti99x/genboard.h b/src/devices/bus/ti99x/genboard.h index 8f49cb6906e..4f9c5da7f27 100644 --- a/src/devices/bus/ti99x/genboard.h +++ b/src/devices/bus/ti99x/genboard.h @@ -20,6 +20,7 @@ #include "cpu/tms9900/tms9995.h" #include "machine/at29x.h" #include "bus/ti99_peb/peribox.h" +#include "sound/sn76496.h" extern const device_type GENEVE_MOUSE; extern const device_type GENEVE_KEYBOARD; @@ -205,11 +206,11 @@ private: tms9995_device* m_cpu; at29c040_device* m_pfm512; at29c040a_device* m_pfm512a; + sn76496_base_device* m_sound; geneve_keyboard_device* m_keyboard; - bus8z_device* m_video; + v9938_device* m_video; peribox_device* m_peribox; - bus8z_device* m_sound; UINT8* m_eprom; UINT8* m_sram; UINT8* m_dram; diff --git a/src/devices/bus/ti99x/gromport.cpp b/src/devices/bus/ti99x/gromport.cpp index 9a836f970d1..0109c15708d 100644 --- a/src/devices/bus/ti99x/gromport.cpp +++ b/src/devices/bus/ti99x/gromport.cpp @@ -111,6 +111,7 @@ ***************************************************************************/ #include "gromport.h" +#include "emuopts.h" #include "image.h" #include "softlist.h" diff --git a/src/devices/bus/ti99x/videowrp.cpp b/src/devices/bus/ti99x/videowrp.cpp index 387872bba5d..4aa1935f226 100644 --- a/src/devices/bus/ti99x/videowrp.cpp +++ b/src/devices/bus/ti99x/videowrp.cpp @@ -2,7 +2,7 @@ // copyright-holders:Michael Zapf /**************************************************************************** - TI-99/4(A) and /8 Video subsystem + TI-99/4A Video subsystem This device actually wraps the naked video chip implementation EVPC (Enhanced Video Processor Card) from SNUG @@ -11,18 +11,12 @@ The SGCPU ("TI-99/4P") only runs with EVPC - We also include a class wrapper for the sound chip here. - Michael Zapf - October 2010 - February 2012: Rewritten as class - *****************************************************************************/ #include "emu.h" #include "videowrp.h" -#include "sound/sn76496.h" /* Constructors @@ -40,24 +34,13 @@ ti_std_video_device::ti_std_video_device(const machine_config &mconfig, const ch ti_exp_video_device::ti_exp_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : ti_video_device(mconfig, V9938VIDEO, "TI99 EXP Video subsystem", tag, owner, clock, "v9938_video", __FILE__), - m_v9938(nullptr), - m_out_gromclk_cb(*this) -{ -} - -ti_sound_sn94624_device::ti_sound_sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : ti_sound_system_device(mconfig, TISOUND_94624, "Onboard sound (SN94624)", tag, owner, clock, "ti_sound_sn94624", __FILE__) -{ -} - -ti_sound_sn76496_device::ti_sound_sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : ti_sound_system_device(mconfig, TISOUND_76496, "Onboard sound (SN76496)", tag, owner, clock, "ti_sound_sn76496", __FILE__) + m_v9938(nullptr) { } /*****************************************************************************/ /* - Memory access (TI-99/4A and TI-99/8) + Accessing TMS9928A (TI-99/4A) */ READ8Z_MEMBER( ti_std_video_device::readz ) { @@ -90,112 +73,38 @@ WRITE8_MEMBER( ti_std_video_device::write ) /*****************************************************************************/ /* - Memory access (EVPC) via 16 bit bus + Accessing v9938 via 16 bit bus (SGCPU) */ READ16_MEMBER( ti_exp_video_device::read16 ) { if (space.debugger_access()) return 0; - - if (offset & 1) - { /* read VDP status */ - return ((int) m_v9938->status_r()) << 8; - } - else - { /* read VDP RAM */ - return ((int) m_v9938->vram_r()) << 8; - } + return (int)(m_v9938->read(space, offset)<<8); } WRITE16_MEMBER( ti_exp_video_device::write16 ) { if (space.debugger_access()) return; - - switch (offset & 3) - { - case 0: - /* write VDP data */ - m_v9938->vram_w((data >> 8) & 0xff); - break; - case 1: - /* write VDP address */ - m_v9938->command_w((data >> 8) & 0xff); - break; - case 2: - /* write VDP palette */ - m_v9938->palette_w((data >> 8) & 0xff); - break; - case 3: - /* write VDP register pointer (indirect access) */ - m_v9938->register_w((data >> 8) & 0xff); - break; - } -} - -void ti_exp_video_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) -{ - // Pulse it - m_out_gromclk_cb(ASSERT_LINE); - m_out_gromclk_cb(CLEAR_LINE); + m_v9938->write(space, offset, (data>>8)&0xff); } /******************************************************************************/ /* - Video read (Geneve) via 8 bit bus + Accessing v9938 via 8 bit bus (EVPC) */ READ8Z_MEMBER( ti_exp_video_device::readz ) { if (space.debugger_access()) return; - - if (offset & 2) - { /* read VDP status */ - *value = m_v9938->status_r(); - } - else - { /* read VDP RAM */ - *value = m_v9938->vram_r(); - } + *value = m_v9938->read(space, offset>>1); } -/* - Video write (Geneve) -*/ WRITE8_MEMBER( ti_exp_video_device::write ) { if (space.debugger_access()) return; - - switch (offset & 6) - { - case 0: - /* write VDP data */ - m_v9938->vram_w(data); - break; - case 2: - /* write VDP address */ - m_v9938->command_w(data); - break; - case 4: - /* write VDP palette */ - m_v9938->palette_w(data); - break; - case 6: - /* write VDP register pointer (indirect access) */ - m_v9938->register_w(data); - break; - } -} - -/**************************************************************************/ -// Interfacing to mouse attached to v9938 - -void ti_exp_video_device::video_update_mouse(int delta_x, int delta_y, int buttons) -{ - m_v9938->update_mouse_state(delta_x, delta_y, buttons & 3); + m_v9938->write(space, offset>>1, data); } -/**************************************************************************/ - void ti_video_device::device_start(void) { m_tms9928a = static_cast<tms9928a_device*>(machine().device(VDP_TAG)); @@ -204,69 +113,9 @@ void ti_video_device::device_start(void) void ti_exp_video_device::device_start(void) { m_v9938 = static_cast<v9938_device*>(machine().device(VDP_TAG)); - m_out_gromclk_cb.resolve(); - m_gromclk_timer = timer_alloc(0); -} - -void ti_exp_video_device::device_reset(void) -{ - if (!m_out_gromclk_cb.isnull()) m_gromclk_timer->adjust(attotime::zero, 0, attotime::from_hz(XTAL_10_738635MHz/24)); -} - -/**************************************************************************/ - -/* - Sound subsystem. - TODO: Seriously consider to simplify this by connecting to the datamux - directly. We don't do anything reasonable here. -*/ - -WRITE8_MEMBER( ti_sound_system_device::write ) -{ - if (space.debugger_access()) return; - m_sound_chip->write(space, 0, data); -} - -void ti_sound_system_device::device_start(void) -{ - m_console_ready.resolve(); - m_sound_chip = subdevice<sn76496_base_device>(TISOUNDCHIP_TAG); -} - -WRITE_LINE_MEMBER( ti_sound_system_device::sound_ready ) -{ - m_console_ready(state); -} - -MACHINE_CONFIG_FRAGMENT( sn94624 ) - MCFG_SPEAKER_STANDARD_MONO("sound_out") - - MCFG_SOUND_ADD(TISOUNDCHIP_TAG, SN94624, 3579545/8) /* 3.579545 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "sound_out", 0.75) - MCFG_SN76496_READY_HANDLER(WRITELINE(ti_sound_system_device, sound_ready)) -MACHINE_CONFIG_END - -MACHINE_CONFIG_FRAGMENT( sn76496 ) - MCFG_SPEAKER_STANDARD_MONO("sound_out") - - MCFG_SOUND_ADD(TISOUNDCHIP_TAG, SN76496, 3579545) /* 3.579545 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "sound_out", 0.75) - MCFG_SN76496_READY_HANDLER(WRITELINE(ti_sound_system_device, sound_ready)) -MACHINE_CONFIG_END - -machine_config_constructor ti_sound_sn94624_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( sn94624 ); -} - -machine_config_constructor ti_sound_sn76496_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( sn76496 ); } /**************************************************************************/ const device_type TI99VIDEO = &device_creator<ti_std_video_device>; const device_type V9938VIDEO = &device_creator<ti_exp_video_device>; -const device_type TISOUND_94624 = &device_creator<ti_sound_sn94624_device>; -const device_type TISOUND_76496 = &device_creator<ti_sound_sn76496_device>; diff --git a/src/devices/bus/ti99x/videowrp.h b/src/devices/bus/ti99x/videowrp.h index 49c4ce73f16..787f0e2d44f 100644 --- a/src/devices/bus/ti99x/videowrp.h +++ b/src/devices/bus/ti99x/videowrp.h @@ -2,7 +2,7 @@ // copyright-holders:Michael Zapf /**************************************************************************** - TI-99/4(A) and /8 Video subsystem + TI-99/4A / EVPC Video subsystem See videowrp.c for documentation Michael Zapf @@ -17,7 +17,6 @@ #include "video/tms9928a.h" #include "video/v9938.h" #include "ti99defs.h" -#include "sound/sn76496.h" class ti_video_device : public bus8z_device { @@ -44,20 +43,16 @@ public: ti_std_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; - void reset_vdp(int state) override { m_tms9928a->reset_line(state); } }; /* - Used in the EVPC and Geneve + Used in the EVPC */ class ti_exp_video_device : public ti_video_device { public: ti_exp_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - template<class _Object> static devcb_base &set_out_gromclk_callback(device_t &device, _Object object) { return downcast<ti_exp_video_device &>(device).m_out_gromclk_cb.set_callback(object); } - - void video_update_mouse(int delta_x, int delta_y, int buttons); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; DECLARE_READ16_MEMBER(read16); @@ -65,81 +60,15 @@ public: void reset_vdp(int state) override { m_v9938->reset_line(state); } protected: - virtual void device_start(void) override; - virtual void device_reset(void) override; + virtual void device_start(void) override; private: - void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; v9938_device *m_v9938; - devcb_write_line m_out_gromclk_cb; // GROMCLK line is optional; if present, pulse it by XTAL/24 rate - emu_timer *m_gromclk_timer; }; -#define MCFG_ADD_GROMCLK_CB(_devcb) \ - devcb = &ti_exp_video_device::set_out_gromclk_callback(*device, DEVCB_##_devcb); - - extern const device_type TI99VIDEO; extern const device_type V9938VIDEO; -/****************************************************************************/ -/* - Sound device -*/ - -extern const device_type TISOUND_94624; -extern const device_type TISOUND_76496; - -#define TI_SOUND_CONFIG(name) \ - const ti_sound_config(name) = - -class ti_sound_system_device : public bus8z_device -{ -public: - ti_sound_system_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) - : bus8z_device(mconfig, type, name, tag, owner, clock, shortname, source), m_sound_chip(nullptr), - m_console_ready(*this) { }; - - // Cannot read from sound; just ignore silently - DECLARE_READ8Z_MEMBER(readz) override { }; - DECLARE_WRITE8_MEMBER(write) override; - DECLARE_WRITE_LINE_MEMBER( sound_ready ); // connect to console READY - - template<class _Object> static devcb_base &static_set_int_callback(device_t &device, _Object object) { return downcast<ti_sound_system_device &>(device).m_console_ready.set_callback(object); } - -protected: - virtual void device_start(void) override; - virtual machine_config_constructor device_mconfig_additions() const override =0; - -private: - sn76496_base_device* m_sound_chip; - devcb_write_line m_console_ready; -}; - -/* - The version that sits in the TI-99/4A -*/ -class ti_sound_sn94624_device : public ti_sound_system_device -{ -public: - ti_sound_sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual machine_config_constructor device_mconfig_additions() const override; -}; - -/* - The version that sits in the TI-99/8 and Geneve -*/ -class ti_sound_sn76496_device : public ti_sound_system_device -{ -public: - ti_sound_sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual machine_config_constructor device_mconfig_additions() const override; -}; - /****************************************************************************/ @@ -161,31 +90,4 @@ protected: MCFG_TMS9928A_SCREEN_ADD_PAL( SCREEN_TAG ) \ MCFG_SCREEN_UPDATE_DEVICE( VDP_TAG, tms9928a_device, screen_update ) -#define MCFG_TI998_ADD_NTSC(_tag, _chip, _vsize, _class, _int, _gclk) \ - MCFG_DEVICE_ADD(_tag, TI99VIDEO, 0) \ - MCFG_DEVICE_ADD( VDP_TAG, _chip, XTAL_10_738635MHz / 2 ) \ - MCFG_TMS9928A_VRAM_SIZE(_vsize) \ - MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(_class,_int)) \ - MCFG_TMS9928A_OUT_GROMCLK_CB(WRITELINE(_class,_gclk)) \ - MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG ) \ - MCFG_SCREEN_UPDATE_DEVICE( VDP_TAG, tms9928a_device, screen_update ) - -#define MCFG_TI998_ADD_PAL(_tag, _chip, _vsize, _class, _int, _gclk) \ - MCFG_DEVICE_ADD(_tag, TI99VIDEO, 0) \ - MCFG_DEVICE_ADD( VDP_TAG, _chip, XTAL_10_738635MHz / 2 ) \ - MCFG_TMS9928A_VRAM_SIZE(_vsize) \ - MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(_class,_int)) \ - MCFG_TMS9928A_OUT_GROMCLK_CB(WRITELINE(_class,_gclk)) \ - MCFG_TMS9928A_SCREEN_ADD_PAL( SCREEN_TAG ) \ - MCFG_SCREEN_UPDATE_DEVICE( VDP_TAG, tms9928a_device, screen_update ) - -#define MCFG_TI_SOUND_94624_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, TISOUND_94624, 0) - -#define MCFG_TI_SOUND_76496_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, TISOUND_76496, 0) - -#define MCFG_TI_SOUND_READY_HANDLER( _ready ) \ - devcb = &ti_sound_system_device::static_set_int_callback( *device, DEVCB_##_ready ); - #endif /* __TIVIDEO__ */ diff --git a/src/devices/bus/tvc/tvc.cpp b/src/devices/bus/tvc/tvc.cpp index 2ee28a2f3c0..db2ed411ad2 100644 --- a/src/devices/bus/tvc/tvc.cpp +++ b/src/devices/bus/tvc/tvc.cpp @@ -8,7 +8,6 @@ #include "emu.h" #include "tvc.h" -#include "emuopts.h" /*************************************************************************** diff --git a/src/devices/bus/x68k/x68kexp.cpp b/src/devices/bus/x68k/x68kexp.cpp index 39f1f74eec9..7019498fa23 100644 --- a/src/devices/bus/x68k/x68kexp.cpp +++ b/src/devices/bus/x68k/x68kexp.cpp @@ -5,7 +5,6 @@ */ #include "emu.h" -#include "emuopts.h" #include "x68kexp.h" //************************************************************************** diff --git a/src/devices/bus/z88/z88.cpp b/src/devices/bus/z88/z88.cpp index 62313b76dd3..062fdeade29 100644 --- a/src/devices/bus/z88/z88.cpp +++ b/src/devices/bus/z88/z88.cpp @@ -10,7 +10,6 @@ #include "emu.h" #include "z88.h" -#include "emuopts.h" /*************************************************************************** diff --git a/src/devices/cpu/drcbec.cpp b/src/devices/cpu/drcbec.cpp index 8736a2b6703..ac6da189688 100644 --- a/src/devices/cpu/drcbec.cpp +++ b/src/devices/cpu/drcbec.cpp @@ -1929,6 +1929,14 @@ int drcbe_c::execute(code_handle &entry) FSPARAM0 = 1.0f / sqrtf(FSPARAM1); break; + case MAKE_OPCODE_SHORT(OP_FCOPYI, 4, 0): // FSCOPYI dst,src + FSPARAM0 = u2f(*inst[1].pint32); + break; + + case MAKE_OPCODE_SHORT(OP_ICOPYF, 4, 0): // ICOPYFS dst,src + *inst[0].pint32 = f2u(FSPARAM1); + break; + // ----------------------- 64-Bit Floating Point Operations ----------------------- @@ -2068,6 +2076,14 @@ int drcbe_c::execute(code_handle &entry) FDPARAM0 = 1.0 / sqrt(FDPARAM1); break; + case MAKE_OPCODE_SHORT(OP_FCOPYI, 8, 0): // FDCOPYI dst,src + FDPARAM0 = u2d(*inst[1].pint64); + break; + + case MAKE_OPCODE_SHORT(OP_ICOPYF, 8, 0): // ICOPYFD dst,src + *inst[0].pint64 = d2u(FDPARAM1); + break; + default: fatalerror("Unexpected opcode!\n"); } diff --git a/src/devices/cpu/drcbex64.cpp b/src/devices/cpu/drcbex64.cpp index b9583123af0..096dc2cbf5c 100644 --- a/src/devices/cpu/drcbex64.cpp +++ b/src/devices/cpu/drcbex64.cpp @@ -169,6 +169,7 @@ #include <stddef.h> #include "emu.h" #include "debugger.h" +#include "emuopts.h" #include "drcuml.h" #include "drcbex64.h" @@ -388,7 +389,9 @@ const drcbe_x64::opcode_table_entry drcbe_x64::s_opcode_table_source[] = { uml::OP_FABS, &drcbe_x64::op_fabs }, // FABS dst,src1 { uml::OP_FSQRT, &drcbe_x64::op_fsqrt }, // FSQRT dst,src1 { uml::OP_FRECIP, &drcbe_x64::op_frecip }, // FRECIP dst,src1 - { uml::OP_FRSQRT, &drcbe_x64::op_frsqrt } // FRSQRT dst,src1 + { uml::OP_FRSQRT, &drcbe_x64::op_frsqrt }, // FRSQRT dst,src1 + { uml::OP_FCOPYI, &drcbe_x64::op_fcopyi }, // FCOPYI dst,src + { uml::OP_ICOPYF, &drcbe_x64::op_icopyf } // ICOPYF dst,src }; @@ -6707,3 +6710,131 @@ void drcbe_x64::op_frsqrt(x86code *&dst, const instruction &inst) emit_movsd_p64_r128(dst, dstp, dstreg); // movsd dstp,dstreg } } + + +//------------------------------------------------- +// op_fcopyi - process a FCOPYI opcode +//------------------------------------------------- + +void drcbe_x64::op_fcopyi(x86code *&dst, const instruction &inst) +{ + // validate instruction + assert(inst.size() == 4 || inst.size() == 8); + assert_no_condition(inst); + assert_no_flags(inst); + + // normalize parameters + be_parameter dstp(*this, inst.param(0), PTYPE_MF); + be_parameter srcp(*this, inst.param(1), PTYPE_MR); + + // pick a target register for the general case + int dstreg = dstp.select_register(REG_XMM0); + + // 32-bit form + if (inst.size() == 4) + { + if (srcp.is_memory()) + { + emit_movd_r128_m32(dst, dstreg, MABS(srcp.memory())); // movd dstreg,[srcp] + emit_movss_p32_r128(dst, dstp, dstreg); // movss dstp,dstreg + } + else + { + if (dstp.is_memory()) + { + emit_mov_p32_r32(dst, dstp, srcp.ireg()); // mov dstp,srcp + } + else + { + emit_movd_r128_r32(dst, dstreg, srcp.ireg()); // movd dstreg,srcp + emit_movss_p32_r128(dst, dstp, dstreg); // movss dstp,dstreg + } + } + + } + + // 64-bit form + else if (inst.size() == 8) + { + + if (srcp.is_memory()) + { + emit_movq_r128_m64(dst, dstreg, MABS(srcp.memory())); // movq dstreg,[srcp] + emit_movsd_p64_r128(dst, dstp, dstreg); // movsd dstp,dstreg + } + else + { + if (dstp.is_memory()) + { + emit_mov_p64_r64(dst, dstp, srcp.ireg()); // mov dstp,srcp + } + else + { + emit_movq_r128_r64(dst, dstreg, srcp.ireg()); // movq dstreg,srcp + emit_movsd_p64_r128(dst, dstp, dstreg); // movsd dstp,dstreg + } + } + + } +} + + +//------------------------------------------------- +// op_icopyf - process a ICOPYF opcode +//------------------------------------------------- + +void drcbe_x64::op_icopyf(x86code *&dst, const instruction &inst) +{ + // validate instruction + assert(inst.size() == 4 || inst.size() == 8); + assert_no_condition(inst); + assert_no_flags(inst); + + // normalize parameters + be_parameter dstp(*this, inst.param(0), PTYPE_MR); + be_parameter srcp(*this, inst.param(1), PTYPE_MF); + + // 32-bit form + if (inst.size() == 4) + { + if (srcp.is_memory()) + { + int dstreg = dstp.select_register(REG_EAX); + emit_mov_r32_m32(dst, dstreg, MABS(srcp.memory())); // mov dstreg,[srcp] + emit_mov_p32_r32(dst, dstp, dstreg); // mov dstp,dstreg + } + else + { + if (dstp.is_memory()) + { + emit_movd_m32_r128(dst, MABS(dstp.memory()), srcp.freg()); // movd dstp,srcp + } + else + { + emit_movd_r32_r128(dst, dstp.ireg(), srcp.freg()); // movd dstp,srcp + } + } + } + + // 64-bit form + else if (inst.size() == 8) + { + if (srcp.is_memory()) + { + int dstreg = dstp.select_register(REG_RAX); + emit_mov_r64_m64(dst, dstreg, MABS(srcp.memory())); // mov dstreg,[srcp] + emit_mov_p64_r64(dst, dstp, dstreg); // mov dstp,dstreg + } + else + { + if (dstp.is_memory()) + { + emit_movq_m64_r128(dst, MABS(dstp.memory()), srcp.freg()); // movq dstp,srcp + } + else + { + emit_movq_r64_r128(dst, dstp.ireg(), srcp.freg()); // movq dstp,srcp + } + } + } +}
\ No newline at end of file diff --git a/src/devices/cpu/drcbex64.h b/src/devices/cpu/drcbex64.h index f60b8970aa9..a538f9bf1e7 100644 --- a/src/devices/cpu/drcbex64.h +++ b/src/devices/cpu/drcbex64.h @@ -207,6 +207,8 @@ private: void op_fsqrt(x86code *&dst, const uml::instruction &inst); void op_frecip(x86code *&dst, const uml::instruction &inst); void op_frsqrt(x86code *&dst, const uml::instruction &inst); + void op_fcopyi(x86code *&dst, const uml::instruction &inst); + void op_icopyf(x86code *&dst, const uml::instruction &inst); // 32-bit code emission helpers void emit_mov_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m); diff --git a/src/devices/cpu/drcbex86.cpp b/src/devices/cpu/drcbex86.cpp index be63ac1e869..4ff6a90774b 100644 --- a/src/devices/cpu/drcbex86.cpp +++ b/src/devices/cpu/drcbex86.cpp @@ -85,6 +85,7 @@ #include <stddef.h> #include "emu.h" #include "debugger.h" +#include "emuopts.h" #include "drcuml.h" #include "drcbex86.h" @@ -270,7 +271,9 @@ const drcbe_x86::opcode_table_entry drcbe_x86::s_opcode_table_source[] = { uml::OP_FABS, &drcbe_x86::op_fabs }, // FABS dst,src1 { uml::OP_FSQRT, &drcbe_x86::op_fsqrt }, // FSQRT dst,src1 { uml::OP_FRECIP, &drcbe_x86::op_frecip }, // FRECIP dst,src1 - { uml::OP_FRSQRT, &drcbe_x86::op_frsqrt } // FRSQRT dst,src1 + { uml::OP_FRSQRT, &drcbe_x86::op_frsqrt }, // FRSQRT dst,src1 + { uml::OP_FCOPYI, &drcbe_x86::op_fcopyi }, // FCOPYI dst,src + { uml::OP_ICOPYF, &drcbe_x86::op_icopyf }, // ICOPYF dst,src }; @@ -6448,6 +6451,105 @@ void drcbe_x86::op_frsqrt(x86code *&dst, const instruction &inst) } +//------------------------------------------------- +// op_fcopyi - process a FCOPYI opcode +//------------------------------------------------- + +void drcbe_x86::op_fcopyi(x86code *&dst, const instruction &inst) +{ + // validate instruction + assert(inst.size() == 4 || inst.size() == 8); + assert_no_condition(inst); + assert_no_flags(inst); + + // normalize parameters + be_parameter dstp(*this, inst.param(0), PTYPE_MF); + be_parameter srcp(*this, inst.param(1), PTYPE_MR); + + // 32-bit case + if (inst.size() == 4) + { + if (srcp.is_memory()) + { + emit_mov_r32_m32(dst, REG_EAX, MABS(srcp.memory())); // mov eax,[srcp] + emit_mov_m32_r32(dst, MABS(dstp.memory()), REG_EAX); // mov [dstp],eax + } + else if (srcp.is_int_register()) + { + emit_mov_m32_r32(dst, MABS(dstp.memory()), srcp.ireg()); // mov [dstp],srcp + } + } + + // 64-bit case + else if (inst.size() == 8) + { + if (srcp.is_memory()) + { + emit_mov_r32_m32(dst, REG_EAX, MABS(srcp.memory())); // mov eax,[srcp] + emit_mov_r32_m32(dst, REG_EDX, MABS(srcp.memory(4))); // mov edx,[srcp+4] + } + else if (srcp.is_int_register()) + { + emit_mov_r32_m32(dst, REG_EDX, MABS(m_reghi[srcp.ireg()])); // mov edx,[reghi[srcp]] + emit_mov_r32_r32(dst, REG_EAX, srcp.ireg()); // mov eax,srcp + } + + emit_mov_m32_r32(dst, MABS(dstp.memory()), REG_EAX); // mov [dstp],eax + emit_mov_m32_r32(dst, MABS(dstp.memory(4)), REG_EDX); // mov [dstp+4],edx + } +} + + +//------------------------------------------------- +// op_icopyf - process a ICOPYF opcode +//------------------------------------------------- + +void drcbe_x86::op_icopyf(x86code *&dst, const instruction &inst) +{ + // validate instruction + assert(inst.size() == 4 || inst.size() == 8); + assert_no_condition(inst); + assert_no_flags(inst); + + // normalize parameters + be_parameter dstp(*this, inst.param(0), PTYPE_MR); + be_parameter srcp(*this, inst.param(1), PTYPE_MF); + + // 32-bit case + if (inst.size() == 4) + { + emit_mov_r32_m32(dst, REG_EAX, MABS(srcp.memory())); // mov eax,[srcp] + + if (dstp.is_memory()) + { + emit_mov_m32_r32(dst, MABS(dstp.memory()), REG_EAX); // mov [dstp],eax + } + else if (dstp.is_int_register()) + { + emit_mov_r32_r32(dst, dstp.ireg(), REG_EAX); // mov dstp,eax + } + } + + // 64-bit case + else if (inst.size() == 8) + { + emit_mov_r32_m32(dst, REG_EAX, MABS(srcp.memory())); // mov eax,[srcp] + emit_mov_r32_m32(dst, REG_EDX, MABS(srcp.memory(4))); // mov edx,[srcp+4] + + if (dstp.is_memory()) + { + emit_mov_m32_r32(dst, MABS(dstp.memory()), REG_EAX); // mov [dstp],eax + emit_mov_m32_r32(dst, MABS(dstp.memory(4)), REG_EDX); // mov [dstp+4],edx + } + else + { + emit_mov_m32_r32(dst, MABS(m_reghi[dstp.ireg()]), REG_EDX); // mov [reghi[dstp]],edx + emit_mov_r32_r32(dst, dstp.ireg(), REG_EAX); // mov dstp,eax + } + } +} + + //************************************************************************** // MISCELLAENOUS FUNCTIONS diff --git a/src/devices/cpu/drcbex86.h b/src/devices/cpu/drcbex86.h index df81ee0c7c7..397cbb53215 100644 --- a/src/devices/cpu/drcbex86.h +++ b/src/devices/cpu/drcbex86.h @@ -208,6 +208,8 @@ private: void op_fsqrt(x86code *&dst, const uml::instruction &inst); void op_frecip(x86code *&dst, const uml::instruction &inst); void op_frsqrt(x86code *&dst, const uml::instruction &inst); + void op_fcopyi(x86code *&dst, const uml::instruction &inst); + void op_icopyf(x86code *&dst, const uml::instruction &inst); // 32-bit code emission helpers void emit_mov_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m); diff --git a/src/devices/cpu/drcuml.cpp b/src/devices/cpu/drcuml.cpp index 5c13c76b4c6..736301ff606 100644 --- a/src/devices/cpu/drcuml.cpp +++ b/src/devices/cpu/drcuml.cpp @@ -35,6 +35,7 @@ ***************************************************************************/ #include "emu.h" +#include "emuopts.h" #include "drcuml.h" #include "drcbec.h" #include "drcbex86.h" diff --git a/src/devices/cpu/drcumlsh.h b/src/devices/cpu/drcumlsh.h index d14c1321d9e..12f5abc20eb 100644 --- a/src/devices/cpu/drcumlsh.h +++ b/src/devices/cpu/drcumlsh.h @@ -156,6 +156,8 @@ #define UML_FSSQRT(block, dst, src1) do { block->append().fssqrt(dst, src1); } while (0) #define UML_FSRECIP(block, dst, src1) do { block->append().fsrecip(dst, src1); } while (0) #define UML_FSRSQRT(block, dst, src1) do { block->append().fsrsqrt(dst, src1); } while (0) +#define UML_FSCOPYI(block, dst, src) do { block->append().fscopyi(dst, src); } while (0) +#define UML_ICOPYFS(block, dst, src) do { block->append().icopyfs(dst, src); } while (0) /* ----- 64-bit Floating Point Arithmetic Operations ----- */ @@ -179,6 +181,8 @@ #define UML_FDSQRT(block, dst, src1) do { block->append().fdsqrt(dst, src1); } while (0) #define UML_FDRECIP(block, dst, src1) do { block->append().fdrecip(dst, src1); } while (0) #define UML_FDRSQRT(block, dst, src1) do { block->append().fdrsqrt(dst, src1); } while (0) +#define UML_FDCOPYI(block, dst, src) do { block->append().fdcopyi(dst, src); } while (0) +#define UML_ICOPYFD(block, dst, src) do { block->append().icopyfd(dst, src); } while (0) #endif /* __DRCUMLSH_H__ */ diff --git a/src/devices/cpu/mips/mips3.cpp b/src/devices/cpu/mips/mips3.cpp index 20d82bd3725..b3c19faf6fa 100644 --- a/src/devices/cpu/mips/mips3.cpp +++ b/src/devices/cpu/mips/mips3.cpp @@ -31,19 +31,26 @@ #define RTVAL64 (m_core->r[RTREG]) #define RDVAL64 (m_core->r[RDREG]) -#define FRVALS_FR0 (((float *)&m_core->cpr[1][0])[FRREG]) -#define FTVALS_FR0 (((float *)&m_core->cpr[1][0])[FTREG]) -#define FSVALS_FR0 (((float *)&m_core->cpr[1][0])[FSREG]) -#define FDVALS_FR0 (((float *)&m_core->cpr[1][0])[FDREG]) -#define FSVALW_FR0 (((UINT32 *)&m_core->cpr[1][0])[FSREG]) -#define FDVALW_FR0 (((UINT32 *)&m_core->cpr[1][0])[FDREG]) - -#define FRVALD_FR0 (*(double *)&m_core->cpr[1][FRREG/2]) -#define FTVALD_FR0 (*(double *)&m_core->cpr[1][FTREG/2]) -#define FSVALD_FR0 (*(double *)&m_core->cpr[1][FSREG/2]) -#define FDVALD_FR0 (*(double *)&m_core->cpr[1][FDREG/2]) -#define FSVALL_FR0 (((UINT64 *)&m_core->cpr[1][0])[FSREG/2]) -#define FDVALL_FR0 (((UINT64 *)&m_core->cpr[1][0])[FDREG/2]) +#define FRVALS_FR0 (((float *)&m_core->cpr[1][FRREG])[BYTE_XOR_LE(0)]) +#define FTVALS_FR0 (((float *)&m_core->cpr[1][FTREG])[BYTE_XOR_LE(0)]) +#define FSVALS_FR0 (((float *)&m_core->cpr[1][FSREG])[BYTE_XOR_LE(0)]) +#define FDVALS_FR0 (((float *)&m_core->cpr[1][FDREG])[BYTE_XOR_LE(0)]) +#define FSVALW_FR0 (((UINT32 *)&m_core->cpr[1][FSREG])[BYTE_XOR_LE(0)]) +#define FDVALW_FR0 (((UINT32 *)&m_core->cpr[1][FDREG])[BYTE_XOR_LE(0)]) + +#define LFRVALD_FR0 (u2d(get_cop1_reg64(FRREG))) +#define LFTVALD_FR0 (u2d(get_cop1_reg64(FTREG))) +#define LFSVALD_FR0 (u2d(get_cop1_reg64(FSREG))) +#define LFDVALD_FR0 (u2d(get_cop1_reg64(FDREG))) +#define LFSVALL_FR0 (get_cop1_reg64(FSREG)) +#define LFDVALL_FR0 (get_cop1_reg64(FDREG)) + +#define SFRVALD_FR0(x) (set_cop1_reg64(FRREG,d2u((x)))) +#define SFTVALD_FR0(x) (set_cop1_reg64(FTREG,d2u((x)))) +#define SFSVALD_FR0(x) (set_cop1_reg64(FSREG,d2u((x)))) +#define SFDVALD_FR0(x) (set_cop1_reg64(FDREG,d2u((x)))) +#define SFSVALL_FR0(x) (set_cop1_reg64(FSREG,(x))) +#define SFDVALL_FR0(x) (set_cop1_reg64(FDREG,(x))) #define FRVALS_FR1 (((float *)&m_core->cpr[1][FRREG])[BYTE_XOR_LE(0)]) #define FTVALS_FR1 (((float *)&m_core->cpr[1][FTREG])[BYTE_XOR_LE(0)]) @@ -316,7 +323,7 @@ void mips3_device::check_irqs() void mips3_device::device_start() { - m_isdrc = (mconfig().options().drc() && !mconfig().m_force_no_drc) ? true : false; + m_isdrc = allow_drc(); /* allocate the implementation-specific state from the full cache */ m_core = (internal_mips3_state *)m_cache.alloc_near(sizeof(internal_mips3_state)); @@ -1513,36 +1520,39 @@ void mips3_device::handle_cop0(UINT32 op) inline UINT32 mips3_device::get_cop1_reg32(int idx) { - if (IS_FR0) - return ((UINT32 *)&m_core->cpr[1][0])[idx]; - else + //if (IS_FR0) + // return ((UINT32 *)&m_core->cpr[1][0])[idx]; + //else return m_core->cpr[1][idx]; } inline UINT64 mips3_device::get_cop1_reg64(int idx) { if (IS_FR0) - return ((UINT64 *)&m_core->cpr[1][0])[idx/2]; + return (UINT64(((UINT32 *)&m_core->cpr[1][(idx&0x1E) + 1])[BYTE_XOR_LE(0)])) << 32 + | (UINT64(((UINT32 *)&m_core->cpr[1][idx&0x1E])[BYTE_XOR_LE(0)])); else return m_core->cpr[1][idx]; } inline void mips3_device::set_cop1_reg32(int idx, UINT32 val) { - if (IS_FR0) - ((UINT32 *)&m_core->cpr[1][0])[idx] = val; - else + //if (IS_FR0) + // ((UINT32 *)&m_core->cpr[1][0])[idx] = val; + //else m_core->cpr[1][idx] = val; } inline void mips3_device::set_cop1_reg64(int idx, UINT64 val) { if (IS_FR0) - ((UINT64 *)&m_core->cpr[1][0])[idx/2] = val; + { + ((UINT32 *)&m_core->cpr[1][idx&0x1E])[BYTE_XOR_LE(0)] = val & 0xFFFFFFFF; + ((UINT32 *)&m_core->cpr[1][(idx&0x1E) + 1])[BYTE_XOR_LE(0)] = val >> 32; + } else m_core->cpr[1][idx] = val; } - inline UINT64 mips3_device::get_cop1_creg(int idx) { if (idx == 31) @@ -1606,56 +1616,56 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_SINGLE(op)) /* ADD.S */ FDVALS_FR0 = FSVALS_FR0 + FTVALS_FR0; else /* ADD.D */ - FDVALD_FR0 = FSVALD_FR0 + FTVALD_FR0; + SFDVALD_FR0(LFSVALD_FR0 + LFTVALD_FR0); break; case 0x01: if (IS_SINGLE(op)) /* SUB.S */ FDVALS_FR0 = FSVALS_FR0 - FTVALS_FR0; else /* SUB.D */ - FDVALD_FR0 = FSVALD_FR0 - FTVALD_FR0; + SFDVALD_FR0(LFSVALD_FR0 - LFTVALD_FR0); break; case 0x02: if (IS_SINGLE(op)) /* MUL.S */ FDVALS_FR0 = FSVALS_FR0 * FTVALS_FR0; else /* MUL.D */ - FDVALD_FR0 = FSVALD_FR0 * FTVALD_FR0; + SFDVALD_FR0(LFSVALD_FR0 * LFTVALD_FR0); break; case 0x03: if (IS_SINGLE(op)) /* DIV.S */ FDVALS_FR0 = FSVALS_FR0 / FTVALS_FR0; else /* DIV.D */ - FDVALD_FR0 = FSVALD_FR0 / FTVALD_FR0; + SFDVALD_FR0(LFSVALD_FR0 / LFTVALD_FR0); break; case 0x04: if (IS_SINGLE(op)) /* SQRT.S */ FDVALS_FR0 = sqrt(FSVALS_FR0); else /* SQRT.D */ - FDVALD_FR0 = sqrt(FSVALD_FR0); + SFDVALD_FR0(sqrt(LFSVALD_FR0)); break; case 0x05: if (IS_SINGLE(op)) /* ABS.S */ FDVALS_FR0 = fabs(FSVALS_FR0); else /* ABS.D */ - FDVALD_FR0 = fabs(FSVALD_FR0); + SFDVALD_FR0(fabs(LFSVALD_FR0)); break; case 0x06: if (IS_SINGLE(op)) /* MOV.S */ FDVALS_FR0 = FSVALS_FR0; else /* MOV.D */ - FDVALD_FR0 = FSVALD_FR0; + SFDVALD_FR0(LFSVALD_FR0); break; case 0x07: if (IS_SINGLE(op)) /* NEG.S */ FDVALS_FR0 = -FSVALS_FR0; else /* NEG.D */ - FDVALD_FR0 = -FSVALD_FR0; + SFDVALD_FR0(-LFSVALD_FR0); break; case 0x08: @@ -1666,16 +1676,16 @@ void mips3_device::handle_cop1_fr0(UINT32 op) temp = ceil(temp - 0.5); else temp = floor(temp + 0.5); - FDVALL_FR0 = (INT64)temp; + SFDVALL_FR0((INT64)temp); } else /* ROUND.L.D */ { - double temp = FSVALD_FR0; + double temp = LFSVALD_FR0; if (temp < 0) temp = ceil(temp - 0.5); else temp = floor(temp + 0.5); - FDVALL_FR0 = (INT64)temp; + SFDVALL_FR0((INT64)temp); } break; @@ -1687,16 +1697,16 @@ void mips3_device::handle_cop1_fr0(UINT32 op) temp = ceil(temp); else temp = floor(temp); - FDVALL_FR0 = (INT64)temp; + SFDVALL_FR0((INT64)temp); } else /* TRUNC.L.D */ { - double temp = FSVALD_FR0; + double temp = LFSVALD_FR0; if (temp < 0) temp = ceil(temp); else temp = floor(temp); - FDVALL_FR0 = (INT64)temp; + SFDVALL_FR0((INT64)temp); } break; @@ -1704,16 +1714,16 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_SINGLE(op)) /* CEIL.L.S */ dtemp = ceil(FSVALS_FR0); else /* CEIL.L.D */ - dtemp = ceil(FSVALD_FR0); - FDVALL_FR0 = (INT64)dtemp; + dtemp = ceil(LFSVALD_FR0); + SFDVALL_FR0((INT64)dtemp); break; case 0x0b: if (IS_SINGLE(op)) /* FLOOR.L.S */ dtemp = floor(FSVALS_FR0); else /* FLOOR.L.D */ - dtemp = floor(FSVALD_FR0); - FDVALL_FR0 = (INT64)dtemp; + dtemp = floor(LFSVALD_FR0); + SFDVALL_FR0((INT64)dtemp); break; case 0x0c: @@ -1728,7 +1738,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) } else /* ROUND.W.D */ { - dtemp = FSVALD_FR0; + dtemp = LFSVALD_FR0; if (dtemp < 0) dtemp = ceil(dtemp - 0.5); else @@ -1749,7 +1759,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) } else /* TRUNC.W.D */ { - dtemp = FSVALD_FR0; + dtemp = LFSVALD_FR0; if (dtemp < 0) dtemp = ceil(dtemp); else @@ -1762,7 +1772,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_SINGLE(op)) /* CEIL.W.S */ dtemp = ceil(FSVALS_FR0); else /* CEIL.W.D */ - dtemp = ceil(FSVALD_FR0); + dtemp = ceil(LFSVALD_FR0); FDVALW_FR0 = (INT32)dtemp; break; @@ -1770,7 +1780,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_SINGLE(op)) /* FLOOR.W.S */ dtemp = floor(FSVALS_FR0); else /* FLOOR.W.D */ - dtemp = floor(FSVALD_FR0); + dtemp = floor(LFSVALD_FR0); FDVALW_FR0 = (INT32)dtemp; break; @@ -1780,7 +1790,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_SINGLE(op)) /* MOVT/F.S */ FDVALS_FR0 = FSVALS_FR0; else /* MOVT/F.D */ - FDVALD_FR0 = FSVALD_FR0; + SFDVALD_FR0(LFSVALD_FR0); } break; @@ -1790,7 +1800,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_SINGLE(op)) /* MOVZ.S */ FDVALS_FR0 = FSVALS_FR0; else /* MOVZ.D */ - FDVALD_FR0 = FSVALD_FR0; + SFDVALD_FR0(LFSVALD_FR0); } break; @@ -1800,7 +1810,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_SINGLE(op)) /* MOVN.S */ FDVALS_FR0 = FSVALS_FR0; else /* MOVN.D */ - FDVALD_FR0 = FSVALD_FR0; + SFDVALD_FR0(LFSVALD_FR0); } break; @@ -1808,14 +1818,14 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_SINGLE(op)) /* RECIP.S */ FDVALS_FR0 = 1.0f / FSVALS_FR0; else /* RECIP.D */ - FDVALD_FR0 = 1.0 / FSVALD_FR0; + SFDVALD_FR0(1.0 / LFSVALD_FR0); break; case 0x16: /* R5000 */ if (IS_SINGLE(op)) /* RSQRT.S */ FDVALS_FR0 = 1.0f / sqrt(FSVALS_FR0); else /* RSQRT.D */ - FDVALD_FR0 = 1.0 / sqrt(FSVALD_FR0); + SFDVALD_FR0(1.0 / sqrt(LFSVALD_FR0)); break; case 0x20: @@ -1824,36 +1834,36 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_SINGLE(op)) /* CVT.S.W */ FDVALS_FR0 = (INT32)FSVALW_FR0; else /* CVT.S.L */ - FDVALS_FR0 = (INT64)FSVALL_FR0; + FDVALS_FR0 = (INT64)LFSVALL_FR0; } else /* CVT.S.D */ - FDVALS_FR0 = FSVALD_FR0; + FDVALS_FR0 = LFSVALD_FR0; break; case 0x21: if (IS_INTEGRAL(op)) { if (IS_SINGLE(op)) /* CVT.D.W */ - FDVALD_FR0 = (INT32)FSVALW_FR0; + SFDVALD_FR0((INT32)FSVALW_FR0); else /* CVT.D.L */ - FDVALD_FR0 = (INT64)FSVALL_FR0; + SFDVALD_FR0((INT64)LFSVALL_FR0); } else /* CVT.D.S */ - FDVALD_FR0 = FSVALS_FR0; + SFDVALD_FR0(FSVALS_FR0); break; case 0x24: if (IS_SINGLE(op)) /* CVT.W.S */ FDVALW_FR0 = (INT32)FSVALS_FR0; else - FDVALW_FR0 = (INT32)FSVALD_FR0; + FDVALW_FR0 = (INT32)LFSVALD_FR0; break; case 0x25: if (IS_SINGLE(op)) /* CVT.L.S */ - FDVALL_FR0 = (INT64)FSVALS_FR0; + SFDVALL_FR0((INT64)FSVALS_FR0); else /* CVT.L.D */ - FDVALL_FR0 = (INT64)FSVALD_FR0; + SFDVALL_FR0((INT64)LFSVALD_FR0); break; case 0x30: @@ -1877,7 +1887,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_SINGLE(op)) /* C.EQ.S */ SET_FCC((op >> 8) & 7, (FSVALS_FR0 == FTVALS_FR0)); else /* C.EQ.D */ - SET_FCC((op >> 8) & 7, (FSVALD_FR0 == FTVALD_FR0)); + SET_FCC((op >> 8) & 7, (LFSVALD_FR0 == LFTVALD_FR0)); break; case 0x33: @@ -1885,7 +1895,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_SINGLE(op)) /* C.UEQ.S */ SET_FCC((op >> 8) & 7, (FSVALS_FR0 == FTVALS_FR0)); else /* C.UEQ.D */ - SET_FCC((op >> 8) & 7, (FSVALD_FR0 == FTVALD_FR0)); + SET_FCC((op >> 8) & 7, (LFSVALD_FR0 == LFTVALD_FR0)); break; case 0x34: @@ -1893,7 +1903,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_SINGLE(op)) /* C.OLT.S */ SET_FCC((op >> 8) & 7, (FSVALS_FR0 < FTVALS_FR0)); else /* C.OLT.D */ - SET_FCC((op >> 8) & 7, (FSVALD_FR0 < FTVALD_FR0)); + SET_FCC((op >> 8) & 7, (LFSVALD_FR0 < LFTVALD_FR0)); break; case 0x35: @@ -1901,7 +1911,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_SINGLE(op)) /* C.ULT.S */ SET_FCC((op >> 8) & 7, (FSVALS_FR0 < FTVALS_FR0)); else /* C.ULT.D */ - SET_FCC((op >> 8) & 7, (FSVALD_FR0 < FTVALD_FR0)); + SET_FCC((op >> 8) & 7, (LFSVALD_FR0 < LFTVALD_FR0)); break; case 0x36: @@ -1909,7 +1919,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_SINGLE(op)) /* C.OLE.S */ SET_FCC((op >> 8) & 7, (FSVALS_FR0 <= FTVALS_FR0)); else /* C.OLE.D */ - SET_FCC((op >> 8) & 7, (FSVALD_FR0 <= FTVALD_FR0)); + SET_FCC((op >> 8) & 7, (LFSVALD_FR0 <= LFTVALD_FR0)); break; case 0x37: @@ -1917,7 +1927,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_SINGLE(op)) /* C.ULE.S */ SET_FCC((op >> 8) & 7, (FSVALS_FR0 <= FTVALS_FR0)); else /* C.ULE.D */ - SET_FCC((op >> 8) & 7, (FSVALD_FR0 <= FTVALD_FR0)); + SET_FCC((op >> 8) & 7, (LFSVALD_FR0 <= LFTVALD_FR0)); break; default: @@ -2311,7 +2321,7 @@ void mips3_device::handle_cop1x_fr0(UINT32 op) break; case 0x01: /* LDXC1 */ - if (RDOUBLE(RSVAL32 + RTVAL32, &temp64)) FDVALL_FR0 = temp64; + if (RDOUBLE(RSVAL32 + RTVAL32, &temp64)) SFDVALL_FR0(temp64); break; case 0x08: /* SWXC1 */ @@ -2330,7 +2340,7 @@ void mips3_device::handle_cop1x_fr0(UINT32 op) break; case 0x21: /* MADD.D */ - FDVALD_FR0 = FSVALD_FR0 * FTVALD_FR0 + FRVALD_FR0; + SFDVALD_FR0(LFSVALD_FR0 * LFTVALD_FR0 + LFRVALD_FR0); break; case 0x28: /* MSUB.S */ @@ -2338,7 +2348,7 @@ void mips3_device::handle_cop1x_fr0(UINT32 op) break; case 0x29: /* MSUB.D */ - FDVALD_FR0 = FSVALD_FR0 * FTVALD_FR0 - FRVALD_FR0; + SFDVALD_FR0(LFSVALD_FR0 * LFTVALD_FR0 - LFRVALD_FR0); break; case 0x30: /* NMADD.S */ @@ -2346,7 +2356,7 @@ void mips3_device::handle_cop1x_fr0(UINT32 op) break; case 0x31: /* NMADD.D */ - FDVALD_FR0 = -(FSVALD_FR0 * FTVALD_FR0 + FRVALD_FR0); + SFDVALD_FR0(-(LFSVALD_FR0 * LFTVALD_FR0 + LFRVALD_FR0)); break; case 0x38: /* NMSUB.S */ @@ -2354,7 +2364,7 @@ void mips3_device::handle_cop1x_fr0(UINT32 op) break; case 0x39: /* NMSUB.D */ - FDVALD_FR0 = -(FSVALD_FR0 * FTVALD_FR0 - FRVALD_FR0); + SFDVALD_FR0(-(LFSVALD_FR0 * LFTVALD_FR0 - LFRVALD_FR0)); break; case 0x24: /* MADD.W */ diff --git a/src/devices/cpu/mips/mips3drc.cpp b/src/devices/cpu/mips/mips3drc.cpp index 7b6da3a1626..9995cdb105f 100644 --- a/src/devices/cpu/mips/mips3drc.cpp +++ b/src/devices/cpu/mips/mips3drc.cpp @@ -150,7 +150,7 @@ inline void mips3_device::save_fast_iregs(drcuml_block *block) void mips3_device::mips3drc_set_options(UINT32 options) { - if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return; + if (!allow_drc()) return; m_drcoptions = options; } @@ -196,7 +196,7 @@ void mips3_device::add_fastram(offs_t start, offs_t end, UINT8 readonly, void *b void mips3_device::mips3drc_add_hotspot(offs_t pc, UINT32 opcode, UINT32 cycles) { - if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return; + if (!allow_drc()) return; if (m_hotspot_select < ARRAY_LENGTH(m_hotspot)) { m_hotspot[m_hotspot_select].pc = pc; diff --git a/src/devices/cpu/rsp/rsp.cpp b/src/devices/cpu/rsp/rsp.cpp index 246843fb6af..9fd2525e193 100644 --- a/src/devices/cpu/rsp/rsp.cpp +++ b/src/devices/cpu/rsp/rsp.cpp @@ -361,7 +361,7 @@ void rsp_device::resolve_cb() void rsp_device::device_start() { - m_isdrc = (mconfig().options().drc() && !mconfig().m_force_no_drc) ? true : false; + m_isdrc = allow_drc(); m_rsp_state = (internal_rsp_state *)m_cache.alloc_near(sizeof(internal_rsp_state)); if (LOG_INSTRUCTION_EXECUTION) diff --git a/src/devices/cpu/rsp/rspdrc.cpp b/src/devices/cpu/rsp/rspdrc.cpp index c581cfb3aba..ce334b91cc8 100644 --- a/src/devices/cpu/rsp/rspdrc.cpp +++ b/src/devices/cpu/rsp/rspdrc.cpp @@ -183,7 +183,7 @@ static void cfunc_write32(void *param) void rsp_device::rspdrc_set_options(UINT32 options) { - if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return; + if (!allow_drc()) return; m_drcoptions = options; } @@ -307,7 +307,7 @@ void rsp_device::execute_run_drc() void rsp_device::rspdrc_flush_drc_cache() { - if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return; + if (!allow_drc()) return; m_cache_dirty = TRUE; } diff --git a/src/devices/cpu/sh2/sh2.cpp b/src/devices/cpu/sh2/sh2.cpp index 751349dbd0c..0201e8d8a44 100644 --- a/src/devices/cpu/sh2/sh2.cpp +++ b/src/devices/cpu/sh2/sh2.cpp @@ -193,7 +193,7 @@ sh2_device::sh2_device(const machine_config &mconfig, const char *tag, device_t , m_out_of_cycles(nullptr) , m_debugger_temp(0) { - m_isdrc = (mconfig.options().drc() && !mconfig.m_force_no_drc) ? true : false; + m_isdrc = allow_drc(); } @@ -225,7 +225,7 @@ sh2_device::sh2_device(const machine_config &mconfig, device_type type, const ch , m_nocode(nullptr) , m_out_of_cycles(nullptr) { - m_isdrc = (mconfig.options().drc() && !mconfig.m_force_no_drc) ? true : false; + m_isdrc = allow_drc(); } sh2a_device::sh2a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) diff --git a/src/devices/cpu/sh2/sh2drc.cpp b/src/devices/cpu/sh2/sh2drc.cpp index db732e57b40..e7b2460198a 100644 --- a/src/devices/cpu/sh2/sh2drc.cpp +++ b/src/devices/cpu/sh2/sh2drc.cpp @@ -11,7 +11,6 @@ #include "debugger.h" #include "sh2.h" #include "sh2comn.h" -#include "mconfig.h" extern unsigned DasmSH2(char *buffer, unsigned pc, UINT16 opcode); @@ -2946,7 +2945,7 @@ int sh2_device::generate_group_12(drcuml_block *block, compiler_state *compiler, void sh2_device::sh2drc_set_options(UINT32 options) { - if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return; + if (!allow_drc()) return; m_drcoptions = options; } @@ -2958,7 +2957,7 @@ void sh2_device::sh2drc_set_options(UINT32 options) void sh2_device::sh2drc_add_pcflush(offs_t address) { - if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return; + if (!allow_drc()) return; if (m_pcfsel < ARRAY_LENGTH(m_pcflushes)) m_pcflushes[m_pcfsel++] = address; diff --git a/src/devices/cpu/sm510/kb1013vk1-2core.cpp b/src/devices/cpu/sm510/kb1013vk1-2core.cpp new file mode 100644 index 00000000000..db85ae27023 --- /dev/null +++ b/src/devices/cpu/sm510/kb1013vk1-2core.cpp @@ -0,0 +1,11 @@ +// license:BSD-3-Clause +// copyright-holders:hap, Igor +/* + + KB1013VK1-2 MCU core implementation + +*/ + +#include "sm500.h" +#include "debugger.h" + diff --git a/src/devices/cpu/sm510/sm500.cpp b/src/devices/cpu/sm510/sm500.cpp new file mode 100644 index 00000000000..b24953709fc --- /dev/null +++ b/src/devices/cpu/sm510/sm500.cpp @@ -0,0 +1,8 @@ +// license:BSD-3-Clause +// copyright-holders:hap, Igor +/* + +*/ + +#include "sm500.h" +#include "debugger.h" diff --git a/src/devices/cpu/sm510/sm500.h b/src/devices/cpu/sm510/sm500.h new file mode 100644 index 00000000000..7abe96e0d2a --- /dev/null +++ b/src/devices/cpu/sm510/sm500.h @@ -0,0 +1,60 @@ +// license:BSD-3-Clause +// copyright-holders:hap, Igor +/* + + Sharp SM500 MCU family cores + +*/ + +#ifndef _SM500_H_ +#define _SM500_H_ + +#include "sm510.h" + + +// I/O ports setup + +// .. + + +// pinout reference + +/* + + O33 O43 O12 O22 O32 GND O42 O11 O21 O31 O41 OS1 + 36 35 34 33 32 31 30 29 28 27 26 25 + ________________________________________________ + | | +O23 37 | | 24 OS2 +O13 38 | | 23 OS3 +O44 39 | | 22 OS4 +O34 40 | | 21 H1 +O24 41 | | 20 H2 +O14 42 | SM500 | 19 VM +O45 43 | | 18 OSCin +O35 44 | | 17 OSCout +O25 45 | | 16 VDD +O15 46 | | 15 K4 +O46 47 | | 14 K3 +O36 48 | * | 13 K2 + |________________________________________________/ + + 1 2 3 4 5 6 7 8 9 10 11 12 + O26 O16 R4 R3 R2 R1 GND _T bt al ACL K1 note: bt = beta symbol, al = alpha symbol +*/ + +class sm500_device : public sm510_base_device +{ +public: + sm500_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; +}; + + + +extern const device_type SM500; + + +#endif /* _SM500_H_ */ diff --git a/src/devices/cpu/sm510/sm500core.cpp b/src/devices/cpu/sm510/sm500core.cpp new file mode 100644 index 00000000000..4ea9af383fd --- /dev/null +++ b/src/devices/cpu/sm510/sm500core.cpp @@ -0,0 +1,38 @@ +// license:BSD-3-Clause +// copyright-holders:hap, Igor +/* + + Sharp SM500 MCU core implementation + +*/ + +#include "sm500.h" +#include "debugger.h" + + +// MCU types +const device_type SM500 = &device_creator<sm500_device>; + + +// internal memory maps +static ADDRESS_MAP_START(program_2_7k, AS_PROGRAM, 8, sm510_base_device) + AM_RANGE(0x0000, 0x00ff) AM_ROM +ADDRESS_MAP_END + +static ADDRESS_MAP_START(data_96_32x4, AS_DATA, 8, sm510_base_device) + AM_RANGE(0x00, 0x1f) AM_RAM +ADDRESS_MAP_END + + +// device definitions +sm500_device::sm500_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sm510_base_device(mconfig, SM500, "SM500", tag, owner, clock, 2 /* stack levels */, 12 /* prg width */, ADDRESS_MAP_NAME(program_2_7k), 7 /* data width */, ADDRESS_MAP_NAME(data_96_32x4), "sm500", __FILE__) +{ } + + +// disasm +offs_t sm500_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +{ + extern CPU_DISASSEMBLE(sm510); + return CPU_DISASSEMBLE_NAME(sm510)(this, buffer, pc, oprom, opram, options); +} diff --git a/src/devices/cpu/sm510/sm500op.cpp b/src/devices/cpu/sm510/sm500op.cpp new file mode 100644 index 00000000000..038e0b09c37 --- /dev/null +++ b/src/devices/cpu/sm510/sm500op.cpp @@ -0,0 +1,6 @@ +// license:BSD-3-Clause +// copyright-holders:hap, Igor + +// SM500 opcode handlers + +#include "sm500.h" diff --git a/src/devices/cpu/sm510/sm510.cpp b/src/devices/cpu/sm510/sm510.cpp index 9c6b197f06f..ab8e0fb176c 100644 --- a/src/devices/cpu/sm510/sm510.cpp +++ b/src/devices/cpu/sm510/sm510.cpp @@ -2,17 +2,24 @@ // copyright-holders:hap /* - Sharp SM510 MCU family - known chips: + Known chips: (* means not emulated yet) + + Sharp SM510 MCU family: - SM510: 2.7Kx8 ROM, 128x4 RAM(32x4 for LCD) - SM511: 4Kx8 ROM, 128x4 RAM(32x4 for LCD), melody controller - SM512: 4Kx8 ROM, 128x4 RAM(48x4 for LCD), melody controller - - Other chips that may be in the same family, investigate more when one of - them needs to get emulated: SM500, SM530/31, SM4A, SM3903, .. - + - *KB1013VK4-2: Soviet-era clone of SM510, minor differences + + Sharp SM500 MCU family: + - *SM500: x + - *SM530: x + - *SM531: x + - *KB1013VK1-2: Soviet-era clone of SM500, minor differences + References: - 1990 Sharp Microcomputers Data Book - 1996 Sharp Microcomputer Databook + - KB1013VK1-2/KB1013VK4-2 manual TODO: - proper support for LFSR program counter in debugger @@ -59,35 +66,6 @@ void sm510_base_device::device_start() m_write_segbs.resolve_safe(); m_write_segc.resolve_safe(); - // zerofill - memset(m_stack, 0, sizeof(m_stack)); - m_pc = 0; - m_prev_pc = 0; - m_op = 0; - m_prev_op = 0; - m_param = 0; - m_acc = 0; - m_bl = 0; - m_bm = 0; - m_c = 0; - m_skip = false; - m_w = 0; - m_r = 0; - m_div = 0; - m_1s = false; - m_k_active = false; - m_l = 0; - m_x = 0; - m_y = 0; - m_bp = false; - m_bc = false; - m_halt = false; - m_melody_rd = 0; - m_melody_step_count = 0; - m_melody_duty_count = 0; - m_melody_duty_index = 0; - m_melody_address = 0; - // register for savestates save_item(NAME(m_stack)); save_item(NAME(m_pc)); diff --git a/src/devices/cpu/sm510/sm510op.cpp b/src/devices/cpu/sm510/sm510op.cpp index 2057bf23ecb..0470e2148ca 100644 --- a/src/devices/cpu/sm510/sm510op.cpp +++ b/src/devices/cpu/sm510/sm510op.cpp @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:hap -// SM510 opcode handlers +// shared opcode handlers #include "sm510.h" @@ -290,9 +290,9 @@ void sm510_base_device::op_add11() void sm510_base_device::op_adx() { - // ADX x: add immediate value to ACC, skip next on carry except if x = 10 + // ADX x: add immediate value to ACC, skip next on carry m_acc += (m_op & 0xf); - m_skip = ((m_op & 0xf) != 10 && (m_acc & 0x10) != 0); + m_skip = ((m_acc & 0x10) != 0); m_acc &= 0xf; } diff --git a/src/devices/cpu/uml.cpp b/src/devices/cpu/uml.cpp index 07d5de9b57f..6974b884e1b 100644 --- a/src/devices/cpu/uml.cpp +++ b/src/devices/cpu/uml.cpp @@ -22,9 +22,6 @@ * Support for FPU exceptions * New instructions? - - FCOPYI, ICOPYF - copy raw between float and integer registers - - VALID opcode_desc,handle,param checksum/compare code referenced by opcode_desc; if not matching, generate exception with handle,param @@ -214,6 +211,8 @@ const opcode_info instruction::s_opcode_info_table[OP_MAX] = OPINFO2(FSQRT, "f#sqrt", 4|8, false, NONE, NONE, ALL, PINFO(OUT, OP, FRM), PINFO(IN, OP, FANY)) OPINFO2(FRECIP, "f#recip", 4|8, false, NONE, NONE, ALL, PINFO(OUT, OP, FRM), PINFO(IN, OP, FANY)) OPINFO2(FRSQRT, "f#rsqrt", 4|8, false, NONE, NONE, ALL, PINFO(OUT, OP, FRM), PINFO(IN, OP, FANY)) + OPINFO2(FCOPYI, "f#copyi", 4|8, false, NONE, NONE, NONE, PINFO(OUT, OP, FRM), PINFO(IN, OP, IRM)) + OPINFO2(ICOPYF, "icopyf#", 4|8, false, NONE, NONE, NONE, PINFO(OUT, OP, IRM), PINFO(IN, OP, FRM)) }; diff --git a/src/devices/cpu/uml.h b/src/devices/cpu/uml.h index 2dfd95adbea..5b390700ced 100644 --- a/src/devices/cpu/uml.h +++ b/src/devices/cpu/uml.h @@ -218,6 +218,8 @@ namespace uml OP_FSQRT, // FSQRT dst,src1 OP_FRECIP, // FRECIP dst,src1 OP_FRSQRT, // FRSQRT dst,src1 + OP_FCOPYI, // FCOPYI dst,src + OP_ICOPYF, // ICOPYF dst,src OP_MAX }; @@ -544,6 +546,8 @@ namespace uml void fssqrt(parameter dst, parameter src1) { configure(OP_FSQRT, 4, dst, src1); } void fsrecip(parameter dst, parameter src1) { configure(OP_FRECIP, 4, dst, src1); } void fsrsqrt(parameter dst, parameter src1) { configure(OP_FRSQRT, 4, dst, src1); } + void fscopyi(parameter dst, parameter src) { configure(OP_FCOPYI, 4, dst, src); } + void icopyfs(parameter dst, parameter src) { configure(OP_ICOPYF, 4, dst, src); } // 64-bit floating point operations void fdload(parameter dst, const void *base, parameter index) { configure(OP_FLOAD, 8, dst, parameter::make_memory(base), index); } @@ -566,6 +570,8 @@ namespace uml void fdsqrt(parameter dst, parameter src1) { configure(OP_FSQRT, 8, dst, src1); } void fdrecip(parameter dst, parameter src1) { configure(OP_FRECIP, 8, dst, src1); } void fdrsqrt(parameter dst, parameter src1) { configure(OP_FRSQRT, 8, dst, src1); } + void fdcopyi(parameter dst, parameter src) { configure(OP_FCOPYI, 8, dst, src); } + void icopyfd(parameter dst, parameter src) { configure(OP_ICOPYF, 8, dst, src); } // constants static const int MAX_PARAMS = 4; diff --git a/src/devices/cpu/x86emit.h b/src/devices/cpu/x86emit.h index 45e1c456737..d9ac810c905 100644 --- a/src/devices/cpu/x86emit.h +++ b/src/devices/cpu/x86emit.h @@ -1273,6 +1273,11 @@ inline void emit_op(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg, UINT8 if (opsize == OP_16BIT) emit_byte(emitptr, PREFIX_OPSIZE); + bool has_prefix = (op & 0xff0000) == 0x660000 || (op & 0xff0000) == 0xf20000 || (op & 0xff0000) == 0xf30000; + + if (has_prefix) + emit_byte(emitptr, op >> 16); + #if (X86EMIT_SIZE == 64) { UINT8 rex; @@ -1287,7 +1292,7 @@ inline void emit_op(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg, UINT8 assert(opsize != OP_64BIT); #endif - if ((op & 0xff0000) != 0) + if ((op & 0xff0000) != 0 && !has_prefix) emit_byte(emitptr, op >> 16); if ((op & 0xff00) != 0) emit_byte(emitptr, op >> 8); diff --git a/src/devices/machine/tc009xlvc.cpp b/src/devices/machine/tc009xlvc.cpp index 724bd5edf16..3a10002e8f6 100644 --- a/src/devices/machine/tc009xlvc.cpp +++ b/src/devices/machine/tc009xlvc.cpp @@ -46,7 +46,7 @@ WRITE8_MEMBER(tc0091lvc_device::tc0091lvc_paletteram_w) g |= ((i & 2) >> 1); r |= (i & 1); - m_palette->set_pen_color(offset / 2, pal5bit(r), pal5bit(g), pal5bit(b)); + m_gfxdecode->palette().set_pen_color(offset / 2, pal5bit(r), pal5bit(g), pal5bit(b)); } } @@ -168,8 +168,7 @@ tc0091lvc_device::tc0091lvc_device(const machine_config &mconfig, const char *ta : device_t(mconfig, TC0091LVC, "Taito TC0091LVC", tag, owner, clock, "tc0091lvc", __FILE__), device_memory_interface(mconfig, *this), m_space_config("tc0091lvc", ENDIANNESS_LITTLE, 8,20, 0, nullptr, *ADDRESS_MAP_NAME(tc0091lvc_map8)), - m_gfxdecode(*this), - m_palette(*this) + m_gfxdecode(*this) { } @@ -184,17 +183,6 @@ void tc0091lvc_device::static_set_gfxdecode_tag(device_t &device, const char *ta } -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void tc0091lvc_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<tc0091lvc_device &>(device).m_palette.set_tag(tag); -} - - void tc0091lvc_device::device_config_complete() { // int address_bits = 20; @@ -297,7 +285,8 @@ void tc0091lvc_device::device_start() //printf("m_gfx_index %d\n", m_gfx_index); - m_gfxdecode->set_gfx(m_gfx_index, std::make_unique<gfx_element>(m_palette, char_layout, (UINT8 *)m_pcg_ram, 0, m_palette->entries() / 16, 0)); + palette_device &palette = m_gfxdecode->palette(); + m_gfxdecode->set_gfx(m_gfx_index, std::make_unique<gfx_element>(palette, char_layout, (UINT8 *)m_pcg_ram, 0, palette.entries() / 16, 0)); } void tc0091lvc_device::device_reset() @@ -346,7 +335,7 @@ UINT32 tc0091lvc_device::screen_update(screen_device &screen, bitmap_ind16 &bitm int x,y; UINT8 global_flip; - bitmap.fill(m_palette->black_pen(), cliprect); + bitmap.fill(m_gfxdecode->palette().black_pen(), cliprect); if((m_vregs[4] & 0x20) == 0) return 0; @@ -367,7 +356,7 @@ UINT32 tc0091lvc_device::screen_update(screen_device &screen, bitmap_ind16 &bitm res_y = (global_flip) ? 256-y : y; if(screen.visible_area().contains(res_x, res_y)) - bitmap.pix16(res_y, res_x) = m_palette->pen(m_bitmap_ram[count]); + bitmap.pix16(res_y, res_x) = m_gfxdecode->palette().pen(m_bitmap_ram[count]); count++; } diff --git a/src/devices/machine/tc009xlvc.h b/src/devices/machine/tc009xlvc.h index 66911acd4e5..3f737cbf044 100644 --- a/src/devices/machine/tc009xlvc.h +++ b/src/devices/machine/tc009xlvc.h @@ -21,7 +21,6 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); DECLARE_READ8_MEMBER( vregs_r ); DECLARE_WRITE8_MEMBER( vregs_w ); @@ -80,7 +79,6 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; address_space_config m_space_config; required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; }; extern const device_type TC0091LVC; @@ -88,8 +86,5 @@ extern const device_type TC0091LVC; #define MCFG_TC0091LVC_GFXDECODE(_gfxtag) \ tc0091lvc_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); -#define MCFG_TC0091LVC_PALETTE(_palette_tag) \ - tc0091lvc_device::static_set_palette_tag(*device, "^" _palette_tag); - #endif diff --git a/src/devices/sound/tms5220.cpp b/src/devices/sound/tms5220.cpp index ca743e73d70..8bc51d5683f 100644 --- a/src/devices/sound/tms5220.cpp +++ b/src/devices/sound/tms5220.cpp @@ -1842,7 +1842,7 @@ WRITE_LINE_MEMBER( tms5220_device::rsq_w ) #ifdef DEBUG_RS_WS else /* illegal */ - fprintf(stderr,"tms5220_rs_w: illegal\n"); + fprintf(stderr,"tms5220_rsq_w: illegal\n"); #endif return; } @@ -1889,12 +1889,12 @@ WRITE_LINE_MEMBER( tms5220_device::wsq_w ) m_rs_ws = new_val; if (new_val == 0) { - if (TMS5220_HAS_RATE_CONTROL) // correct for 5220c, ? for cd2501ecd + if (TMS5220_HAS_RATE_CONTROL) // correct for 5220c, probably also correct for cd2501ecd reset(); #ifdef DEBUG_RS_WS else /* illegal */ - fprintf(stderr,"tms5220_ws_w: illegal\n"); + fprintf(stderr,"tms5220_wsq_w: illegal\n"); #endif return; } @@ -1917,7 +1917,7 @@ WRITE_LINE_MEMBER( tms5220_device::wsq_w ) /* upon /WS being activated, /READY goes inactive after 100 nsec from data sheet, through 3 asynchronous gates on patent. This is effectively within one clock, so we immediately set io_ready to 0 and activate the callback. */ m_io_ready = 0; update_ready_state(); - /* Now comes the complicated part: long does /READY stay inactive, when /WS is pulled low? This depends ENTIRELY on the command written, or whether the chip is in speak external mode or not... + /* Now comes the complicated part: how long does /READY stay inactive, when /WS is pulled low? This depends ENTIRELY on the command written, or whether the chip is in speak external mode or not... Speak external mode: ~16 cycles Command Mode: SPK: ? cycles @@ -1933,6 +1933,80 @@ WRITE_LINE_MEMBER( tms5220_device::wsq_w ) } } +/* + * combined /RS and /WS line write handler; + * /RS is bit 1, /WS is bit 0 + * Note this is a hack and probably can be removed later, once the 'real' line handlers above defer by at least 4 clock cycles before taking effect + */ +WRITE8_MEMBER( tms5220_device::combined_rsq_wsq_w ) +{ + UINT8 new_val; + UINT8 falling_edges; + m_true_timing = 1; +#ifdef DEBUG_RS_WS + fprintf(stderr,"/RS and /WS written with %d and %d respectively\n", (data&2)>>1), data&1; +#endif + new_val = data&0x03; + if (new_val != m_rs_ws) + { + falling_edges = ((m_rs_ws^new_val)&(~new_val)); + m_rs_ws = new_val; + switch(new_val) + { + case 0: + if (TMS5220_HAS_RATE_CONTROL) // correct for 5220c, probably also correct for cd2501ecd + reset(); +#ifdef DEBUG_RS_WS + else + /* illegal */ + fprintf(stderr,"tms5220_combined_rsq_wsq_w: illegal\n"); +#endif + return; + case 3: + /* high impedance */ + m_read_latch = 0xff; + return; + case 2: // /WS active, /RS not + /* check for falling or rising edge */ + if (!(falling_edges&0x02)) return; /* low to high, do nothing */ + /* high to low - schedule ready cycle */ +#ifdef DEBUG_RS_WS + fprintf(stderr,"Scheduling ready cycle for /WS...\n"); +#endif + /* upon /WS being activated, /READY goes inactive after 100 nsec from data sheet, through 3 asynchronous gates on patent. This is effectively within one clock, so we immediately set io_ready to 0 and activate the callback. */ + m_io_ready = 0; + update_ready_state(); + /* Now comes the complicated part: how long does /READY stay inactive, when /WS is pulled low? This depends ENTIRELY on the command written, or whether the chip is in speak external mode or not... + Speak external mode: ~16 cycles + Command Mode: + SPK: ? cycles + SPKEXT: ? cycles + RDBY: between 60 and 140 cycles + RB: ? cycles (80?) + RST: between 60 and 140 cycles + SET RATE (5220C and CD2501ECD only): ? cycles (probably ~16) + */ + // TODO: actually HANDLE the timing differences! currently just assuming always 16 cycles + m_timer_io_ready->adjust(attotime::from_hz(clock()/16), 1); // this should take around 10-16 (closer to ~15) cycles to complete for fifo writes, TODO: but actually depends on what command is written if in command mode + return; + case 1: // /RS active, /WS not + /* check for falling or rising edge */ + if (!(falling_edges&0x01)) return; /* low to high, do nothing */ + /* high to low - schedule ready cycle */ +#ifdef DEBUG_RS_WS + fprintf(stderr,"Scheduling ready cycle for /RS...\n"); +#endif + /* upon /RS being activated, /READY goes inactive after 100 nsec from data sheet, through 3 asynchronous gates on patent. This is effectively within one clock, so we immediately set io_ready to 0 and activate the callback. */ + m_io_ready = 0; + update_ready_state(); + /* How long does /READY stay inactive, when /RS is pulled low? I believe its almost always ~16 clocks (25 usec at 800khz as shown on the datasheet) */ + m_timer_io_ready->adjust(attotime::from_hz(clock()/16), 1); // this should take around 10-16 (closer to ~11?) cycles to complete + return; + } + } +} + + /********************************************************************************************** tms5220_data_w -- write data to the sound chip diff --git a/src/devices/sound/tms5220.h b/src/devices/sound/tms5220.h index 38a0ea20dc7..706a728b28a 100644 --- a/src/devices/sound/tms5220.h +++ b/src/devices/sound/tms5220.h @@ -72,6 +72,8 @@ public: WRITE_LINE_MEMBER( rsq_w ); WRITE_LINE_MEMBER( wsq_w ); + DECLARE_WRITE8_MEMBER( combined_rsq_wsq_w ); // this hack is necessary for specific systems such as the TI 99/8 since the 5220c and cd2501ecd do specific things if both lines go active or inactive at slightly different times by separate write_line writes, which causes the chip to incorrectly reset itself on the 99/8, where the writes are supposed to happen simultaneously; /RS is bit 1, /WS is bit 0 + // Note this is a hack and probably can be removed later, once the 'real' line handlers above defer by at least 4 clock cycles before taking effect DECLARE_WRITE8_MEMBER( data_w ); DECLARE_READ8_MEMBER( status_r ); diff --git a/src/emu/devcpu.cpp b/src/emu/devcpu.cpp index 00bac6ed1b0..43460235b19 100644 --- a/src/emu/devcpu.cpp +++ b/src/emu/devcpu.cpp @@ -9,6 +9,7 @@ ***************************************************************************/ #include "emu.h" +#include "emuopts.h" #include <ctype.h> @@ -25,7 +26,8 @@ cpu_device::cpu_device(const machine_config &mconfig, device_type type, const ch device_execute_interface(mconfig, *this), device_memory_interface(mconfig, *this), device_state_interface(mconfig, *this), - device_disasm_interface(mconfig, *this) + device_disasm_interface(mconfig, *this), + m_force_no_drc(false) { } @@ -37,3 +39,24 @@ cpu_device::cpu_device(const machine_config &mconfig, device_type type, const ch cpu_device::~cpu_device() { } + + +//------------------------------------------------- +// static_set_force_no_drc - configuration helper +// to disable DRC +//------------------------------------------------- + +void cpu_device::static_set_force_no_drc(device_t &device, bool value) +{ + downcast<cpu_device &>(device).m_force_no_drc = value; +} + + +//------------------------------------------------- +// allow_drc - return true if DRC is allowed +//------------------------------------------------- + +bool cpu_device::allow_drc() const +{ + return mconfig().options().drc() && !m_force_no_drc; +} diff --git a/src/emu/devcpu.h b/src/emu/devcpu.h index 0a298a4ddf8..f34d5645b78 100644 --- a/src/emu/devcpu.h +++ b/src/emu/devcpu.h @@ -42,6 +42,11 @@ #define MCFG_CPU_PERIODIC_INT_REMOVE MCFG_DEVICE_PERIODIC_INT_REMOVE #define MCFG_CPU_IRQ_ACKNOWLEDGE_REMOVE MCFG_DEVICE_IRQ_ACKNOWLEDGE_REMOVE +// recompilation parameters +#define MCFG_CPU_FORCE_NO_DRC() \ + cpu_device::static_set_force_no_drc(*device, true); + + //************************************************************************** // MACROS @@ -66,10 +71,19 @@ class cpu_device : public device_t, { friend resource_pool_object<cpu_device>::~resource_pool_object(); +public: + // configuration helpers + static void static_set_force_no_drc(device_t &device, bool value); + bool allow_drc() const; + protected: // construction/destruction cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); virtual ~cpu_device(); + +private: + // configured state + bool m_force_no_drc; // whether or not to force DRC off }; diff --git a/src/emu/diimage.cpp b/src/emu/diimage.cpp index f20c9b7733d..6f0cbeede3a 100644 --- a/src/emu/diimage.cpp +++ b/src/emu/diimage.cpp @@ -161,16 +161,16 @@ image_error_t device_image_interface::set_image_filename(const char *filename) util::zippath_parent(m_working_directory, filename); m_basename.assign(m_image_name); - size_t loc1 = m_image_name.find_last_of('\\'); - size_t loc2 = m_image_name.find_last_of('/'); - size_t loc3 = m_image_name.find_last_of(':'); - size_t loc = MAX(loc1,MAX(loc2, loc3)); + int loc1 = m_image_name.find_last_of('\\'); + int loc2 = m_image_name.find_last_of('/'); + int loc3 = m_image_name.find_last_of(':'); + int loc = MAX(loc1, MAX(loc2, loc3)); if (loc != -1) { if (loc == loc3) { // temp workaround for softlists now that m_image_name contains the part name too (e.g. list:gamename:cart) m_basename = m_basename.substr(0, loc); - size_t tmploc = m_basename.find_last_of(':'); + int tmploc = m_basename.find_last_of(':'); m_basename = m_basename.substr(tmploc + 1, loc - tmploc); } else diff --git a/src/emu/drivers/empty.cpp b/src/emu/drivers/empty.cpp index f012e376813..9b075c10308 100644 --- a/src/emu/drivers/empty.cpp +++ b/src/emu/drivers/empty.cpp @@ -9,6 +9,7 @@ **************************************************************************/ #include "emu.h" +#include "emuopts.h" #include "render.h" #include "ui/selgame.h" #include "ui/simpleselgame.h" diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp index e05a16a5dd5..33f277cdf85 100644 --- a/src/emu/emuopts.cpp +++ b/src/emu/emuopts.cpp @@ -93,6 +93,7 @@ const options_entry emu_options::s_option_entries[] = { OPTION_KEEPASPECT ";ka", "1", OPTION_BOOLEAN, "constrain to the proper aspect ratio" }, { OPTION_UNEVENSTRETCH ";ues", "1", OPTION_BOOLEAN, "allow non-integer stretch factors" }, { OPTION_UNEVENSTRETCHX ";uesx", "0", OPTION_BOOLEAN, "allow non-integer stretch factors only on horizontal axis"}, + { OPTION_INTOVERSCAN ";ios", "0", OPTION_BOOLEAN, "allow overscan on integer scaled targets"}, { OPTION_INTSCALEX ";sx", "0", OPTION_INTEGER, "set horizontal integer scale factor."}, { OPTION_INTSCALEY ";sy", "0", OPTION_INTEGER, "set vertical integer scale."}, @@ -150,8 +151,8 @@ const options_entry emu_options::s_option_entries[] = { OPTION_UI_ACTIVE, "0", OPTION_BOOLEAN, "enable user interface on top of emulated keyboard (if present)" }, { OPTION_OFFSCREEN_RELOAD ";reload", "0", OPTION_BOOLEAN, "convert lightgun button 2 into offscreen reload" }, { OPTION_JOYSTICK_MAP ";joymap", "auto", OPTION_STRING, "explicit joystick map, or auto to auto-select" }, - { OPTION_JOYSTICK_DEADZONE ";joy_deadzone;jdz", "0.3", OPTION_FLOAT, "center deadzone range for joystick where change is ignored (0.0 center, 1.0 end)" }, - { OPTION_JOYSTICK_SATURATION ";joy_saturation;jsat", "0.85", OPTION_FLOAT, "end of axis saturation range for joystick where change is ignored (0.0 center, 1.0 end)" }, + { OPTION_JOYSTICK_DEADZONE ";joy_deadzone;jdz(0.00-1)", "0.3", OPTION_FLOAT, "center deadzone range for joystick where change is ignored (0.0 center, 1.0 end)" }, + { OPTION_JOYSTICK_SATURATION ";joy_saturation;jsat(0.00-1)", "0.85", OPTION_FLOAT, "end of axis saturation range for joystick where change is ignored (0.0 center, 1.0 end)" }, { OPTION_NATURAL_KEYBOARD ";nat", "0", OPTION_BOOLEAN, "specifies whether to use a natural keyboard or not" }, { OPTION_JOYSTICK_CONTRADICTORY ";joy_contradictory","0", OPTION_BOOLEAN, "enable contradictory direction digital joystick input at the same time" }, { OPTION_COIN_IMPULSE, "0", OPTION_INTEGER, "set coin impulse time (n<0 disable impulse, n==0 obey driver, 0<n set time n)" }, @@ -255,24 +256,16 @@ bool emu_options::add_slot_options(const software_part *swpart) if (slot->fixed()) continue; - // first device? add the header as to be pretty - if (m_slot_options++ == 0) - add_entry(nullptr, "SLOT DEVICES", OPTION_HEADER | OPTION_FLAG_DEVICE); - // retrieve info about the device instance const char *name = slot->device().tag() + 1; if (!exists(name)) { + // first device? add the header as to be pretty + if (m_slot_options++ == 0) + add_entry(nullptr, "SLOT DEVICES", OPTION_HEADER | OPTION_FLAG_DEVICE); + // add the option - UINT32 flags = OPTION_STRING | OPTION_FLAG_DEVICE; - const char *defvalue = slot->default_option(); - if (defvalue != nullptr) - { - const device_slot_option *option = slot->option(defvalue); - if (option != nullptr && !option->selectable()) - flags |= OPTION_FLAG_INTERNAL; - } - add_entry(name, nullptr, flags, defvalue, true); + add_entry(name, nullptr, OPTION_STRING | OPTION_FLAG_DEVICE, slot->default_option(), true); } // allow software lists to supply their own defaults @@ -314,12 +307,21 @@ void emu_options::update_slot_options(const software_part *swpart) if (exists(name) && !slot->option_list().empty()) { std::string defvalue = slot->get_default_card_software(); - if (defvalue.length() > 0) + if (defvalue.empty()) { - set_default_value(name, defvalue.c_str()); - const device_slot_option *option = slot->option(defvalue.c_str()); - set_flag(name, ~OPTION_FLAG_INTERNAL, (option != nullptr && !option->selectable()) ? OPTION_FLAG_INTERNAL : 0); + // keep any non-default setting + if (priority(name) > OPTION_PRIORITY_DEFAULT) + continue; + + // reinstate the actual default value as configured + if (slot->default_option() != nullptr) + defvalue.assign(slot->default_option()); } + + // set the value and hide the option if not selectable + set_default_value(name, defvalue.c_str()); + const device_slot_option *option = slot->option(defvalue.c_str()); + set_flag(name, ~OPTION_FLAG_INTERNAL, (option != nullptr && !option->selectable()) ? OPTION_FLAG_INTERNAL : 0); } } while (add_slot_options(swpart)) { } @@ -344,10 +346,6 @@ void emu_options::add_device_options() image_interface_iterator iter(config.root_device()); for (const device_image_interface *image = iter.first(); image != nullptr; image = iter.next()) { - // first device? add the header as to be pretty - if (m_device_options++ == 0) - add_entry(nullptr, "IMAGE DEVICES", OPTION_HEADER | OPTION_FLAG_DEVICE); - // retrieve info about the device instance std::ostringstream option_name; util::stream_format(option_name, "%s;%s", image->instance_name(), image->brief_instance_name()); @@ -356,7 +354,14 @@ void emu_options::add_device_options() // add the option if (!exists(image->instance_name())) + { + // first device? add the header as to be pretty + if (m_device_options++ == 0) + add_entry(nullptr, "IMAGE DEVICES", OPTION_HEADER | OPTION_FLAG_DEVICE); + + // add the option add_entry(option_name.str().c_str(), nullptr, OPTION_STRING | OPTION_FLAG_DEVICE, nullptr, true); + } } } @@ -401,12 +406,10 @@ bool emu_options::parse_slot_devices(int argc, char *argv[], std::string &error_ core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); // keep adding slot options until we stop seeing new stuff - m_slot_options = 0; while (add_slot_options(swpart)) core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); // add device options and reparse - m_device_options = 0; add_device_options(); if (name != nullptr && exists(name)) set_value(name, value, OPTION_PRIORITY_SUBCMD, error_string); @@ -560,6 +563,11 @@ void emu_options::set_system_name(const char *name) // remove any existing device options remove_device_options(); } + else + { + // revert device options set for the old software + revert(OPTION_PRIORITY_SUBCMD, OPTION_PRIORITY_SUBCMD); + } // get the new system const game_driver *cursystem = system(); diff --git a/src/emu/emuopts.h b/src/emu/emuopts.h index e87eb1012a7..522f128961e 100644 --- a/src/emu/emuopts.h +++ b/src/emu/emuopts.h @@ -102,6 +102,7 @@ enum #define OPTION_KEEPASPECT "keepaspect" #define OPTION_UNEVENSTRETCH "unevenstretch" #define OPTION_UNEVENSTRETCHX "unevenstretchx" +#define OPTION_INTOVERSCAN "intoverscan" #define OPTION_INTSCALEX "intscalex" #define OPTION_INTSCALEY "intscaley" @@ -296,6 +297,7 @@ public: bool keep_aspect() const { return bool_value(OPTION_KEEPASPECT); } bool uneven_stretch() const { return bool_value(OPTION_UNEVENSTRETCH); } bool uneven_stretch_x() const { return bool_value(OPTION_UNEVENSTRETCHX); } + bool int_overscan() const { return bool_value(OPTION_INTOVERSCAN); } int int_scale_x() const { return int_value(OPTION_INTSCALEX); } int int_scale_y() const { return int_value(OPTION_INTSCALEY); } diff --git a/src/emu/language.cpp b/src/emu/language.cpp index 8d4618c7be3..5c9686a646e 100644 --- a/src/emu/language.cpp +++ b/src/emu/language.cpp @@ -9,6 +9,7 @@ ***************************************************************************/ #include "emu.h" +#include "emuopts.h" static std::unordered_map<std::string, std::string> g_translation; diff --git a/src/emu/layout/svg.lay b/src/emu/layout/svg.lay new file mode 100644 index 00000000000..96a25360a19 --- /dev/null +++ b/src/emu/layout/svg.lay @@ -0,0 +1,8 @@ +<?xml version="1.0"?> +<mamelayout version="2"> + <view name="SVG"> + <screen index="0"> + <bounds left="0" top="0" right="~scr0width~" bottom="~scr0height~" /> + </screen> + </view> +</mamelayout> diff --git a/src/emu/luaengine.cpp b/src/emu/luaengine.cpp index 62667ee0eef..262bf5c925e 100644 --- a/src/emu/luaengine.cpp +++ b/src/emu/luaengine.cpp @@ -16,6 +16,7 @@ #include "emu.h" #include "cheat.h" #include "drivenum.h" +#include "emuopts.h" #include "ui/ui.h" #include "luaengine.h" #include <mutex> @@ -968,6 +969,7 @@ int lua_engine::lua_screen::l_type(lua_State *L) case SCREEN_TYPE_RASTER: lua_pushliteral(L, "raster"); break; case SCREEN_TYPE_VECTOR: lua_pushliteral(L, "vector"); break; case SCREEN_TYPE_LCD: lua_pushliteral(L, "lcd"); break; + case SCREEN_TYPE_SVG: lua_pushliteral(L, "svg"); break; default: lua_pushliteral(L, "unknown"); break; } @@ -1273,6 +1275,82 @@ lua_engine::~lua_engine() close(); } +std::vector<lua_engine::menu_item> &lua_engine::menu_populate(std::string &menu) +{ + std::vector<menu_item> &menu_list = *global_alloc(std::vector<menu_item>); + std::string field = "menu_pop_" + menu; + lua_settop(m_lua_state, 0); + lua_getfield(m_lua_state, LUA_REGISTRYINDEX, field.c_str()); + + if(!lua_isfunction(m_lua_state, -1)) + { + lua_pop(m_lua_state, 1); + return menu_list; + } + lua_pcall(m_lua_state, 0, 1, 0); + if(!lua_istable(m_lua_state, -1)) + { + lua_pop(m_lua_state, 1); + return menu_list; + } + + lua_pushnil(m_lua_state); + while(lua_next(m_lua_state, -2)) + { + if(lua_istable(m_lua_state, -1)) + { + menu_item item; + lua_rawgeti(m_lua_state, -1, 1); + item.text = lua_tostring(m_lua_state, -1); + lua_pop(m_lua_state, 1); + lua_rawgeti(m_lua_state, -1, 2); + item.subtext = lua_tostring(m_lua_state, -1); + lua_pop(m_lua_state, 1); + lua_rawgeti(m_lua_state, -1, 3); + item.flags = lua_tointeger(m_lua_state, -1); + lua_pop(m_lua_state, 1); + menu_list.push_back(item); + } + lua_pop(m_lua_state, 1); + } + lua_pop(m_lua_state, 1); + return menu_list; +} + +bool lua_engine::menu_callback(std::string &menu, int index, std::string event) +{ + std::string field = "menu_cb_" + menu; + bool ret = false; + lua_settop(m_lua_state, 0); + lua_getfield(m_lua_state, LUA_REGISTRYINDEX, field.c_str()); + + if(lua_isfunction(m_lua_state, -1)) + { + lua_pushinteger(m_lua_state, index); + lua_pushstring(m_lua_state, event.c_str()); + lua_pcall(m_lua_state, 2, 1, 0); + ret = lua_toboolean(m_lua_state, -1); + lua_pop(m_lua_state, 1); + } + return ret; +} + +int lua_engine::l_emu_register_menu(lua_State *L) +{ + luaL_argcheck(L, lua_isfunction(L, 1), 1, "callback function expected"); + luaL_argcheck(L, lua_isfunction(L, 2), 2, "callback function expected"); + luaL_argcheck(L, lua_isstring(L, 3), 3, "message (string) expected"); + std::string name = luaL_checkstring(L, 3); + std::string cbfield = "menu_cb_" + name; + std::string popfield = "menu_pop_" + name; + luaThis->m_menu.push_back(std::string(name)); + lua_pushvalue(L, 1); + lua_setfield(L, LUA_REGISTRYINDEX, cbfield.c_str()); + lua_pushvalue(L, 2); + lua_setfield(L, LUA_REGISTRYINDEX, popfield.c_str()); + return 1; +} + void lua_engine::execute_function(const char *id) { lua_settop(m_lua_state, 0); @@ -1285,7 +1363,12 @@ void lua_engine::execute_function(const char *id) { if (lua_isfunction(m_lua_state, -1)) { - lua_pcall(m_lua_state, 0, 0, 0); + if(int error = lua_pcall(m_lua_state, 0, 0, 0)) + { + if(error == 2) + printf("%s\n", lua_tostring(m_lua_state, -1)); + lua_pop(m_lua_state, 1); + } } else { @@ -1452,7 +1535,8 @@ void lua_engine::initialize() .addCFunction ("register_pause", l_emu_register_pause ) .addCFunction ("register_resume",l_emu_register_resume ) .addCFunction ("register_frame", l_emu_register_frame ) - .beginClass <machine_manager> ("manager") + .addCFunction ("register_menu", l_emu_register_menu ) + .beginClass <machine_manager> ("manager") .addFunction ("machine", &machine_manager::machine) .addFunction ("options", &machine_manager::options) .addFunction ("plugins", &machine_manager::plugins) diff --git a/src/emu/luaengine.h b/src/emu/luaengine.h index b98b9597b56..1ed1c82df36 100644 --- a/src/emu/luaengine.h +++ b/src/emu/luaengine.h @@ -49,9 +49,19 @@ public: bool frame_hook(); void execute_function(const char *id); + struct menu_item { + std::string text; + std::string subtext; + int flags; + }; + std::vector<menu_item> &menu_populate(std::string &menu); + bool menu_callback(std::string &menu, int index, std::string event); + void resume(lua_State *L, int nparam = 0, lua_State *root = nullptr); void set_machine(running_machine *machine) { m_machine = machine; update_machine(); } + std::vector<std::string> &get_menu() { return m_menu; } void attach_notifiers(); + private: struct hook { lua_State *L; @@ -70,6 +80,8 @@ private: lua_State *m_lua_state; running_machine * m_machine; + std::vector<std::string> m_menu; + hook hook_output_cb; bool output_notifier_set; @@ -121,6 +133,7 @@ private: static int l_emu_register_pause(lua_State *L); static int l_emu_register_resume(lua_State *L); static int l_emu_register_frame(lua_State *L); + static int l_emu_register_menu(lua_State *L); static int register_function(lua_State *L, const char *id); // "emu.machine" namespace diff --git a/src/emu/mconfig.cpp b/src/emu/mconfig.cpp index 793da15c1a0..2bf2eaab3d6 100644 --- a/src/emu/mconfig.cpp +++ b/src/emu/mconfig.cpp @@ -25,7 +25,6 @@ machine_config::machine_config(const game_driver &gamedrv, emu_options &options) : m_minimum_quantum(attotime::zero), m_watchdog_vblank_count(0), m_watchdog_time(attotime::zero), - m_force_no_drc(false), m_default_layout(nullptr), m_gamedrv(gamedrv), m_options(options) diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h index 412c2c12e82..582ea14d035 100644 --- a/src/emu/mconfig.h +++ b/src/emu/mconfig.h @@ -18,8 +18,6 @@ #ifndef __MCONFIG_H__ #define __MCONFIG_H__ -#include "emuopts.h" - //************************************************************************** // CONSTANTS //************************************************************************** @@ -72,7 +70,6 @@ public: std::string m_perfect_cpu_quantum; // tag of CPU to use for "perfect" scheduling INT32 m_watchdog_vblank_count; // number of VBLANKs until the watchdog kills us attotime m_watchdog_time; // length of time until the watchdog kills us - bool m_force_no_drc; // whether or not to force DRC off // other parameters const internal_layout * m_default_layout; // default layout for this machine @@ -202,10 +199,6 @@ References an external machine config. #define MCFG_QUANTUM_PERFECT_CPU(_cputag) \ config.m_perfect_cpu_quantum = owner->subtag(_cputag); -// recompilation parameters -#define MCFG_FORCE_NO_DRC() \ - config.m_force_no_drc = true; - // watchdog configuration #define MCFG_WATCHDOG_VBLANK_INIT(_count) \ config.m_watchdog_vblank_count = _count; diff --git a/src/emu/memory.cpp b/src/emu/memory.cpp index 331345ea63d..92ee2676342 100644 --- a/src/emu/memory.cpp +++ b/src/emu/memory.cpp @@ -174,6 +174,7 @@ #include <map> #include "emu.h" +#include "emuopts.h" #include "debug/debugcpu.h" diff --git a/src/emu/render.cpp b/src/emu/render.cpp index a340e226c50..0af06e665b2 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -934,6 +934,7 @@ render_target::render_target(render_manager &manager, const internal_layout *lay // aspect and scale options m_keepaspect = (manager.machine().options().keep_aspect() && !(flags & RENDER_CREATE_HIDDEN)); + m_int_overscan = manager.machine().options().int_overscan(); m_int_scale_x = manager.machine().options().int_scale_x(); m_int_scale_y = manager.machine().options().int_scale_y(); if (manager.machine().options().uneven_stretch() && !manager.machine().options().uneven_stretch_x()) @@ -1204,22 +1205,24 @@ void render_target::compute_visible_area(INT32 target_width, INT32 target_height if (target_orientation & ORIENTATION_SWAP_XY) src_aspect = 1.0 / src_aspect; - // get destination size and aspect - float dest_width = (float)target_width; - float dest_height = (float)target_height; - float dest_aspect = dest_width / dest_height * target_pixel_aspect; + // get target aspect + float target_aspect = (float)target_width / (float)target_height * target_pixel_aspect; - // apply aspect correction to destination rectangle - if (dest_aspect > src_aspect) - dest_width *= m_keepaspect? src_aspect / dest_aspect : 1.0f; - else - dest_height *= m_keepaspect? dest_aspect / src_aspect : 1.0f; + // determine the scale mode for each axis + bool x_is_integer = !(target_aspect >= 1.0f && m_scale_mode == SCALE_FRACTIONAL_X); + bool y_is_integer = !(target_aspect < 1.0f && m_scale_mode == SCALE_FRACTIONAL_X); + + // first compute scale factors to fit the screen + float xscale = (float)target_width / src_width; + float yscale = (float)target_height / src_height; + float maxxscale = MAX(1, m_int_overscan? render_round_nearest(xscale) : floor(xscale)); + float maxyscale = MAX(1, m_int_overscan? render_round_nearest(yscale) : floor(yscale)); - // compute scale factors - float xscale = dest_width / src_width; - float yscale = dest_height / src_height; - xscale = dest_aspect >= 1.0f && m_scale_mode == SCALE_FRACTIONAL_X? xscale : MAX(1, render_round_nearest(xscale)); - yscale = dest_aspect < 1.0f && m_scale_mode == SCALE_FRACTIONAL_X? yscale : MAX(1, render_round_nearest(yscale)); + // now apply desired scale mode and aspect correction + if (m_keepaspect && target_aspect > src_aspect) xscale *= src_aspect / target_aspect * (maxyscale / yscale); + if (m_keepaspect && target_aspect < src_aspect) yscale *= target_aspect / src_aspect * (maxxscale / xscale); + if (x_is_integer) xscale = MIN(maxxscale, MAX(1, render_round_nearest(xscale))); + if (y_is_integer) yscale = MIN(maxyscale, MAX(1, render_round_nearest(yscale))); // check if we have user defined scale factors, if so use them instead xscale = m_int_scale_x? m_int_scale_x : xscale; diff --git a/src/emu/render.h b/src/emu/render.h index 623e65a56f6..c0c8faed689 100644 --- a/src/emu/render.h +++ b/src/emu/render.h @@ -1008,6 +1008,7 @@ private: INT32 m_height; // height in pixels render_bounds m_bounds; // bounds of the target bool m_keepaspect; // constrain aspect ratio + bool m_int_overscan; // allow overscan on integer scaled targets float m_pixel_aspect; // aspect ratio of individual pixels int m_scale_mode; // type of scale to apply int m_int_scale_x; // horizontal integer scale factor diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp index 5995c16eed2..fee6cbdaaa2 100644 --- a/src/emu/rendlay.cpp +++ b/src/emu/rendlay.cpp @@ -82,6 +82,8 @@ #include "lcd.lh" #include "lcd_rot.lh" +// SVG screen layouts +#include "svg.lh" //************************************************************************** diff --git a/src/emu/rendlay.h b/src/emu/rendlay.h index ab9390de564..1267be32773 100644 --- a/src/emu/rendlay.h +++ b/src/emu/rendlay.h @@ -37,5 +37,8 @@ extern const internal_layout layout_quadhsxs; // quad 4:3 screens side-by-sid extern const internal_layout layout_lcd; // generic 1:1 lcd screen layout extern const internal_layout layout_lcd_rot; // same, for use with ROT90 or ROT270 +// SVG screen layouts +extern const internal_layout layout_svg; // generic 1:1 lcd screen layout + #endif // __RENDLAY_H__ diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp index 952c84ca30a..9a22d215a0f 100644 --- a/src/emu/screen.cpp +++ b/src/emu/screen.cpp @@ -13,6 +13,8 @@ #include "png.h" #include "rendutil.h" +#include <nanosvg/src/nanosvg.h> +#include <nanosvg/src/nanosvgrast.h> //************************************************************************** @@ -35,6 +37,101 @@ const attotime screen_device::DEFAULT_FRAME_PERIOD(attotime::from_hz(DEFAULT_FRA UINT32 screen_device::m_id_counter = 0; +class screen_device_svg_renderer { +public: + screen_device_svg_renderer(memory_region *region); + ~screen_device_svg_renderer(); + + int width() const; + int height() const; + + int render(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + static void output_notifier(const char *outname, INT32 value, void *param); + +private: + NSVGimage *m_image; + NSVGrasterizer *m_rasterizer; + + std::unordered_map<std::string, std::list<NSVGshape *>> m_keyed_shapes; + + void output_change(const char *outname, INT32 value); +}; + +screen_device_svg_renderer::screen_device_svg_renderer(memory_region *region) +{ + char *s = new char[region->bytes()+1]; + memcpy(s, region->base(), region->bytes()); + s[region->bytes()] = 0; + m_image = nsvgParse(s, "px", 72); + delete[] s; + m_rasterizer = nsvgCreateRasterizer(); + + for (NSVGshape *shape = m_image->shapes; shape != NULL; shape = shape->next) + if(shape->title[0]) { + shape->flags &= ~NSVG_FLAGS_VISIBLE; + m_keyed_shapes[shape->title].push_back(shape); + } +} + +screen_device_svg_renderer::~screen_device_svg_renderer() +{ + nsvgDeleteRasterizer(m_rasterizer); + nsvgDelete(m_image); +} + +int screen_device_svg_renderer::width() const +{ + return int(m_image->width + 0.5); +} + +int screen_device_svg_renderer::height() const +{ + return int(m_image->height + 0.5); +} + +int screen_device_svg_renderer::render(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + double sx = double(bitmap.width())/m_image->width; + double sy = double(bitmap.height())/m_image->height; + double sz = sx > sy ? sy : sx; + nsvgRasterize(m_rasterizer, m_image, 0, 0, sz, (unsigned char *)bitmap.raw_pixptr(0, 0), bitmap.width(), bitmap.height(), bitmap.rowbytes()); + + // Annoyingly, nanosvg doesn't use the same byte order than our bitmaps + + for(unsigned int y=0; y<bitmap.height(); y++) { + UINT8 *image = (UINT8 *)bitmap.raw_pixptr(y, 0); + for(unsigned int x=0; x<bitmap.width(); x++) { + UINT8 r = image[0]; + UINT8 g = image[1]; + UINT8 b = image[2]; + UINT32 color = 0xff000000 | (r << 16) | (g << 8) | (b << 0); + *(UINT32 *)image = color; + image += 4; + } + } + + return 0; +} + +void screen_device_svg_renderer::output_notifier(const char *outname, INT32 value, void *param) +{ + static_cast<screen_device_svg_renderer *>(param)->output_change(outname, value); +} + +void screen_device_svg_renderer::output_change(const char *outname, INT32 value) +{ + auto l = m_keyed_shapes.find(outname); + if (l == m_keyed_shapes.end()) + return; + if (value) + for(auto s : l->second) + s->flags |= NSVG_FLAGS_VISIBLE; + else + for(auto s : l->second) + s->flags &= ~NSVG_FLAGS_VISIBLE; +} + //************************************************************************** // SCREEN DEVICE //************************************************************************** @@ -55,6 +152,7 @@ screen_device::screen_device(const machine_config &mconfig, const char *tag, dev m_yscale(1.0f), m_palette(*this), m_video_attributes(0), + m_svg_region(nullptr), m_container(nullptr), m_width(100), m_height(100), @@ -106,6 +204,12 @@ void screen_device::static_set_type(device_t &device, screen_type_enum type) } +void screen_device::static_set_svg_region(device_t &device, const char *region) +{ + downcast<screen_device &>(device).m_svg_region = region; +} + + //------------------------------------------------- // static_set_raw - configuration helper // to set the raw screen parameters @@ -265,7 +369,7 @@ void screen_device::device_validity_check(validity_checker &valid) const osd_printf_error("Invalid display dimensions\n"); // sanity check display area - if (m_type != SCREEN_TYPE_VECTOR) + if (m_type != SCREEN_TYPE_VECTOR && m_type != SCREEN_TYPE_SVG) { if (m_visarea.empty() || m_visarea.max_x >= m_width || m_visarea.max_y >= m_height) osd_printf_error("Invalid display area\n"); @@ -275,6 +379,10 @@ void screen_device::device_validity_check(validity_checker &valid) const osd_printf_error("Missing SCREEN_UPDATE function\n"); } + // check for svg region + if (m_type == SCREEN_TYPE_SVG && !m_svg_region) + osd_printf_error("Missing SVG region information\n"); + // check for zero frame rate if (m_refresh == 0) osd_printf_error("Invalid (zero) refresh rate\n"); @@ -293,6 +401,23 @@ void screen_device::device_validity_check(validity_checker &valid) const void screen_device::device_start() { + if (m_type == SCREEN_TYPE_SVG) + { + memory_region *reg = owner()->memregion(m_svg_region); + if (!reg) + fatalerror("SVG region \"%s\" does not exist\n", m_svg_region); + m_svg = std::make_unique<screen_device_svg_renderer>(reg); + machine().output().set_notifier(nullptr, screen_device_svg_renderer::output_notifier, m_svg.get()); + + if (0) + { + // The osd picks up the size before start is called, so that's useless + m_width = m_svg->width(); + m_height = m_svg->height(); + m_visarea.set(0, m_width-1, 0, m_height-1); + } + } + // bind our handlers m_screen_update_ind16.bind_relative_to(*owner()); m_screen_update_rgb32.bind_relative_to(*owner()); @@ -303,6 +428,7 @@ void screen_device::device_start() throw device_missing_dependencies(); // configure bitmap formats and allocate screen bitmaps + // svg is RGB32 too, and doesn't have any update method texture_format texformat = !m_screen_update_ind16.isnull() ? TEXFORMAT_PALETTE16 : TEXFORMAT_RGB32; for (auto & elem : m_bitmap) @@ -472,8 +598,8 @@ void screen_device::configure(int width, int height, const rectangle &visarea, a assert(visarea.min_y >= 0); // assert(visarea.max_x < width); // assert(visarea.max_y < height); - assert(m_type == SCREEN_TYPE_VECTOR || visarea.min_x < width); - assert(m_type == SCREEN_TYPE_VECTOR || visarea.min_y < height); + assert(m_type == SCREEN_TYPE_VECTOR || m_type == SCREEN_TYPE_SVG || visarea.min_x < width); + assert(m_type == SCREEN_TYPE_VECTOR || m_type == SCREEN_TYPE_SVG || visarea.min_y < height); assert(frame_period > 0); // fill in the new parameters @@ -649,12 +775,19 @@ bool screen_device::update_partial(int scanline) g_profiler.start(PROFILER_VIDEO); UINT32 flags; - screen_bitmap &curbitmap = m_bitmap[m_curbitmap]; - switch (curbitmap.format()) + if (m_type != SCREEN_TYPE_SVG) { - default: - case BITMAP_FORMAT_IND16: flags = m_screen_update_ind16(*this, curbitmap.as_ind16(), clip); break; - case BITMAP_FORMAT_RGB32: flags = m_screen_update_rgb32(*this, curbitmap.as_rgb32(), clip); break; + screen_bitmap &curbitmap = m_bitmap[m_curbitmap]; + switch (curbitmap.format()) + { + default: + case BITMAP_FORMAT_IND16: flags = m_screen_update_ind16(*this, curbitmap.as_ind16(), clip); break; + case BITMAP_FORMAT_RGB32: flags = m_screen_update_rgb32(*this, curbitmap.as_rgb32(), clip); break; + } + } + else + { + flags = m_svg->render(*this, m_bitmap[m_curbitmap].as_rgb32(), clip); } m_partial_updates_this_frame++; diff --git a/src/emu/screen.h b/src/emu/screen.h index 711602b0395..182a1505b16 100644 --- a/src/emu/screen.h +++ b/src/emu/screen.h @@ -30,7 +30,8 @@ enum screen_type_enum SCREEN_TYPE_INVALID = 0, SCREEN_TYPE_RASTER, SCREEN_TYPE_VECTOR, - SCREEN_TYPE_LCD + SCREEN_TYPE_LCD, + SCREEN_TYPE_SVG }; // texture formats @@ -155,6 +156,8 @@ typedef device_delegate<void (screen_device &, bool)> screen_vblank_delegate; // ======================> screen_device +class screen_device_svg_renderer; + class screen_device : public device_t { friend class render_manager; @@ -194,6 +197,7 @@ public: static void static_set_palette(device_t &device, const char *tag); static void static_set_video_attributes(device_t &device, UINT32 flags); static void static_set_color(device_t &device, rgb_t color); + static void static_set_svg_region(device_t &device, const char *region); // information getters render_container &container() const { assert(m_container != nullptr); return *m_container; } @@ -279,10 +283,11 @@ private: screen_vblank_delegate m_screen_vblank; // screen vblank callback optional_device<palette_device> m_palette; // our palette UINT32 m_video_attributes; // flags describing the video system + const char * m_svg_region; // the region in which the svg data is in // internal state render_container * m_container; // pointer to our container - + std::unique_ptr<screen_device_svg_renderer> m_svg; // the svg renderer // dimensions int m_width; // current width (HTOTAL) int m_height; // current height (VTOTAL) @@ -378,6 +383,11 @@ typedef device_type_iterator<&device_creator<screen_device>, screen_device> scre #define MCFG_SCREEN_TYPE(_type) \ screen_device::static_set_type(*device, SCREEN_TYPE_##_type); +#define MCFG_SCREEN_SVG_ADD(_tag, _region) \ + MCFG_DEVICE_ADD(_tag, SCREEN, 0) \ + MCFG_SCREEN_TYPE(SVG) \ + screen_device::static_set_svg_region(*device, _region); + /*! @brief Configures screen parameters for the given screen. diff --git a/src/emu/ui/ctrlmenu.cpp b/src/emu/ui/ctrlmenu.cpp index 0fc7304a550..3a82a9f5e9f 100644 --- a/src/emu/ui/ctrlmenu.cpp +++ b/src/emu/ui/ctrlmenu.cpp @@ -9,6 +9,7 @@ *********************************************************************/ #include "emu.h" +#include "emuopts.h" #include "ui/ui.h" #include "ui/menu.h" #include "ui/ctrlmenu.h" diff --git a/src/emu/ui/dsplmenu.cpp b/src/emu/ui/dsplmenu.cpp index e47164de356..02e5e75611b 100644 --- a/src/emu/ui/dsplmenu.cpp +++ b/src/emu/ui/dsplmenu.cpp @@ -64,7 +64,6 @@ ui_menu_display_options::ui_menu_display_options(running_machine &machine, rende // create video list m_list.push_back("auto"); - m_list.push_back("opengl"); // TODO: check USE_OPENGL std::string descr = options.description(OSDOPTION_VIDEO); descr.erase(0, descr.find(":") + 2); @@ -80,7 +79,7 @@ ui_menu_display_options::ui_menu_display_options(running_machine &machine, rende { std::string txt(descr.substr(p1, p2 - p1)); if (txt != "or" && txt != "none") - m_list.push_back(descr.substr(p1, p2 - p1)); + m_list.push_back(txt); } else { diff --git a/src/emu/ui/imgcntrl.cpp b/src/emu/ui/imgcntrl.cpp index 0b44f1f8e8c..883541786af 100644 --- a/src/emu/ui/imgcntrl.cpp +++ b/src/emu/ui/imgcntrl.cpp @@ -9,6 +9,7 @@ ***************************************************************************/ #include "emu.h" +#include "emuopts.h" #include "ui/ui.h" #include "ui/menu.h" #include "ui/imgcntrl.h" diff --git a/src/emu/ui/mainmenu.cpp b/src/emu/ui/mainmenu.cpp index 7fe16d771b0..33156e21ec2 100644 --- a/src/emu/ui/mainmenu.cpp +++ b/src/emu/ui/mainmenu.cpp @@ -33,6 +33,7 @@ #include "ui/datfile.h" #include "ui/inifile.h" #include "ui/datmenu.h" +#include "ui/pluginopt.h" /*************************************************************************** @@ -131,6 +132,9 @@ void ui_menu_main::populate() if (machine().options().cheat()) item_append(_("Cheat"), nullptr, 0, (void *)CHEAT); + if (machine().options().plugins()) + item_append(_("Plugin Options"), nullptr, 0, (void *)PLUGINS); + // add dats menu if (machine().ui().options().enabled_dats() && machine().datfile().has_data()) item_append(_("External DAT View"), nullptr, 0, (void *)EXTERNAL_DATS); @@ -241,6 +245,10 @@ void ui_menu_main::handle() ui_menu::stack_push(global_alloc_clear<ui_menu_cheat>(machine(), container)); break; + case PLUGINS: + ui_menu::stack_push(global_alloc_clear<ui_menu_plugin>(machine(), container)); + break; + case SELECT_GAME: if (strcmp(machine().options().ui(),"simple")==0) { ui_menu::stack_push(global_alloc_clear<ui_simple_menu_select_game>(machine(), container, nullptr)); diff --git a/src/emu/ui/mainmenu.h b/src/emu/ui/mainmenu.h index 0684e230ad8..cb12e6e1d1a 100644 --- a/src/emu/ui/mainmenu.h +++ b/src/emu/ui/mainmenu.h @@ -42,6 +42,7 @@ private: VIDEO_OPTIONS, CROSSHAIR, CHEAT, + PLUGINS, SELECT_GAME, BIOS_SELECTION, BARCODE_READ, diff --git a/src/emu/ui/menu.cpp b/src/emu/ui/menu.cpp index 2af806fa586..bcf231724d4 100644 --- a/src/emu/ui/menu.cpp +++ b/src/emu/ui/menu.cpp @@ -544,14 +544,25 @@ void ui_menu::draw(bool customonly, bool noimage, bool noinput) if (!customonly) machine().ui().draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR); - // determine the first visible line based on the current selection - if (selected > top_line + visible_lines || selected < top_line - visible_lines) - top_line = selected - (visible_lines / 2); if (top_line < 0 || selected == 0) top_line = 0; - if (top_line + visible_lines >= item.size()) + if (top_line > item.size() - visible_lines || selected == (item.size() - 1)) top_line = item.size() - visible_lines; + bool show_top_arrow = false; + bool show_bottom_arrow = false; + + // if scrolling, show arrows + if (item.size() > visible_lines) { + if (top_line > 0) + show_top_arrow = true; + if (top_line != item.size() - visible_lines) + show_bottom_arrow = true; + } + + // set the number of visible lines, minus 1 for top arrow and 1 for bottom arrow + visitems = visible_lines - show_top_arrow - show_bottom_arrow; + // determine effective positions taking into account the hilighting arrows float effective_width = visible_width - 2.0f * gutter_width; float effective_left = visible_left + gutter_width; @@ -573,6 +584,7 @@ void ui_menu::draw(bool customonly, bool noimage, bool noinput) float line_x0 = x1 + 0.5f * UI_LINE_WIDTH; float line_x1 = x2 - 0.5f * UI_LINE_WIDTH; if (!customonly) + { for (linenum = 0; linenum < visible_lines; linenum++) { float line_y = visible_top + (float)linenum * line_height; @@ -613,7 +625,7 @@ void ui_menu::draw(bool customonly, bool noimage, bool noinput) highlight(container, line_x0, line_y0, line_x1, line_y1, bgcolor); // if we're on the top line, display the up arrow - if (linenum == 0 && top_line != 0) + if (linenum == 0 && show_top_arrow) { draw_arrow(container, 0.5f * (x1 + x2) - 0.5f * ud_arrow_width, @@ -627,7 +639,7 @@ void ui_menu::draw(bool customonly, bool noimage, bool noinput) } // if we're on the bottom line, display the down arrow - else if (linenum == visible_lines - 1 && itemnum != item.size() - 1) + else if (linenum == visible_lines - 1 && show_bottom_arrow) { draw_arrow(container, 0.5f * (x1 + x2) - 0.5f * ud_arrow_width, @@ -646,8 +658,16 @@ void ui_menu::draw(bool customonly, bool noimage, bool noinput) // if we don't have a subitem, just draw the string centered else if (pitem.subtext == nullptr) + { + if (pitem.flags & MENU_FLAG_UI_HEADING) + { + float heading_width = machine().ui().get_string_width(itemtext); + container->add_line(visible_left, line_y + 0.5f * line_height, visible_left + ((visible_width - heading_width) / 2) - UI_BOX_LR_BORDER, line_y + 0.5f * line_height, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); + container->add_line(visible_left + visible_width - ((visible_width - heading_width) / 2) + UI_BOX_LR_BORDER, line_y + 0.5f * line_height, visible_left + visible_width, line_y + 0.5f * line_height, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); + } machine().ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr); + } // otherwise, draw the item on the left and the subitem text on the right else @@ -708,6 +728,7 @@ void ui_menu::draw(bool customonly, bool noimage, bool noinput) } } } + } // if the selected subitem is too big, display it in a separate offset box if (selected_subitem_too_big) @@ -741,9 +762,6 @@ void ui_menu::draw(bool customonly, bool noimage, bool noinput) // if there is something special to add, do it by calling the virtual method custom_render((selected >= 0 && selected < item.size()) ? item[selected].ref : nullptr, customtop, custombottom, x1, y1, x2, y2); - - // return the number of visible lines, minus 1 for top arrow and 1 for bottom arrow - visitems = visible_lines - (top_line != 0) - (top_line + visible_lines != item.size()); } void ui_menu::custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) @@ -989,7 +1007,9 @@ void ui_menu::handle_keys(UINT32 flags) } (selected == 0) ? selected = top_line = item.size() - 1 : --selected; validate_selection(-1); - top_line -= (selected == top_line && top_line != 0); + top_line -= (selected <= top_line && top_line != 0); + if (selected <= top_line && visitems != visible_lines) + top_line--; } // down advances by one item @@ -1001,7 +1021,10 @@ void ui_menu::handle_keys(UINT32 flags) return; } (selected == item.size() - 1) ? selected = top_line = 0 : ++selected; - top_line += (selected == top_line + visitems + (top_line != 0)); + validate_selection(1); + top_line += (selected >= top_line + visitems + (top_line != 0)); + if (selected >= (top_line + visitems + (top_line != 0))) + top_line++; } // page up backs up by visitems diff --git a/src/emu/ui/menu.h b/src/emu/ui/menu.h index 4a788c612c7..fee8305f05b 100644 --- a/src/emu/ui/menu.h +++ b/src/emu/ui/menu.h @@ -32,6 +32,7 @@ #define MENU_FLAG_UI_SWLIST (1 << 8) #define MENU_FLAG_UI_FAVORITE (1 << 9) #define MENU_FLAG_UI_PALETTE (1 << 10) +#define MENU_FLAG_UI_HEADING (1 << 11) // special menu item for separators #define MENU_SEPARATOR_ITEM "---" diff --git a/src/emu/ui/miscmenu.cpp b/src/emu/ui/miscmenu.cpp index edca54ebd20..69f36b6cfda 100644 --- a/src/emu/ui/miscmenu.cpp +++ b/src/emu/ui/miscmenu.cpp @@ -552,127 +552,6 @@ void ui_menu_quit_game::handle() ui_menu::stack_reset(machine()); } -ui_menu_misc_options::misc_option ui_menu_misc_options::m_options[] = { - { 0, nullptr, nullptr }, - { 0, __("Re-select last machine played"), OPTION_REMEMBER_LAST }, - { 0, __("Enlarge images in the right panel"), OPTION_ENLARGE_SNAPS }, - { 0, __("DATs info"), OPTION_DATS_ENABLED }, - { 0, __("Cheats"), OPTION_CHEAT }, - { 0, __("Show mouse pointer"), OPTION_UI_MOUSE }, - { 0, __("Confirm quit from machines"), OPTION_CONFIRM_QUIT }, - { 0, __("Skip displaying information's screen at startup"), OPTION_SKIP_GAMEINFO }, - { 0, __("Force 4:3 appearance for software snapshot"), OPTION_FORCED4X3 }, - { 0, __("Use image as background"), OPTION_USE_BACKGROUND }, - { 0, __("Skip bios selection menu"), OPTION_SKIP_BIOS_MENU }, - { 0, __("Skip software parts selection menu"), OPTION_SKIP_PARTS_MENU } -}; - -//------------------------------------------------- -// ctor / dtor -//------------------------------------------------- - -ui_menu_misc_options::ui_menu_misc_options(running_machine &machine, render_container *container) : ui_menu(machine, container) -{ - for (int d = 1; d < ARRAY_LENGTH(m_options); ++d) - if (machine.ui().options().exists(m_options[d].option)) - m_options[d].status = machine.ui().options().bool_value(m_options[d].option); - else - m_options[d].status = machine.options().bool_value(m_options[d].option); -} - -ui_menu_misc_options::~ui_menu_misc_options() -{ - std::string error_string; - for (int d = 1; d < ARRAY_LENGTH(m_options); ++d) { - if (machine().ui().options().exists(m_options[d].option)) - { - machine().ui().options().set_value(m_options[d].option, m_options[d].status, OPTION_PRIORITY_CMDLINE, error_string); - } - else - { - if (machine().options().bool_value(m_options[d].option) != m_options[d].status) - { - machine().options().set_value(m_options[d].option, m_options[d].status, OPTION_PRIORITY_CMDLINE, error_string); - machine().options().mark_changed(m_options[d].option); - } - } - } - ui_globals::reset = true; -} - -//------------------------------------------------- -// handlethe options menu -//------------------------------------------------- - -void ui_menu_misc_options::handle() -{ - bool changed = false; - - // process the menu - const ui_menu_event *m_event = process(0); - if (m_event != nullptr && m_event->itemref != nullptr) - { - if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT || m_event->iptkey == IPT_UI_SELECT) - { - changed = true; - int value = (FPTR)m_event->itemref; - if (!strcmp(m_options[value].option, OPTION_ENLARGE_SNAPS)) - ui_globals::switch_image = true; - m_options[value].status = !m_options[value].status; - } - } - - if (changed) - reset(UI_MENU_RESET_REMEMBER_REF); -} - -//------------------------------------------------- -// populate -//------------------------------------------------- - -void ui_menu_misc_options::populate() -{ - // add options items - for (int opt = 1; opt < ARRAY_LENGTH(m_options); ++opt) - item_append(_(m_options[opt].description), m_options[opt].status ? _("On") : _("Off"), m_options[opt].status ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)opt); - - item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); - customtop = machine().ui().get_line_height() + (3.0f * UI_BOX_TB_BORDER); -} - -//------------------------------------------------- -// perform our special rendering -//------------------------------------------------- - -void ui_menu_misc_options::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) -{ - float width; - ui_manager &mui = machine().ui(); - - mui.draw_text_full(container, _("Miscellaneous Options"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); - width += 2 * UI_BOX_LR_BORDER; - float maxwidth = MAX(origx2 - origx1, width); - - // compute our bounds - float x1 = 0.5f - 0.5f * maxwidth; - float x2 = x1 + maxwidth; - float y1 = origy1 - top; - float y2 = origy1 - UI_BOX_TB_BORDER; - - // draw a box - mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR); - - // take off the borders - x1 += UI_BOX_LR_BORDER; - x2 -= UI_BOX_LR_BORDER; - y1 += UI_BOX_TB_BORDER; - - // draw the text within it - mui.draw_text_full(container, _("Miscellaneous Options"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); -} - //------------------------------------------------- // ctor / dtor //------------------------------------------------- diff --git a/src/emu/ui/optsmenu.cpp b/src/emu/ui/optsmenu.cpp index fef44b8e542..05232636d2e 100644 --- a/src/emu/ui/optsmenu.cpp +++ b/src/emu/ui/optsmenu.cpp @@ -11,6 +11,7 @@ #include "emu.h" #include "ui/ui.h" #include "ui/menu.h" +#include "ui/submenu.h" #include "ui/datfile.h" #include "ui/inifile.h" #include "ui/selector.h" @@ -162,7 +163,7 @@ void ui_menu_game_options::handle() break; case MISC_MENU: if (m_event->iptkey == IPT_UI_SELECT) - ui_menu::stack_push(global_alloc_clear<ui_menu_misc_options>(machine(), container)); + ui_menu::stack_push(global_alloc_clear<ui_submenu>(machine(), container, misc_submenu_options)); break; case SOUND_MENU: if (m_event->iptkey == IPT_UI_SELECT) @@ -188,6 +189,10 @@ void ui_menu_game_options::handle() if (m_event->iptkey == IPT_UI_SELECT) ui_menu::stack_push(global_alloc_clear<ui_menu_custom_filter>(machine(), container)); break; + case ADVANCED_MENU: + if (m_event->iptkey == IPT_UI_SELECT) + ui_menu::stack_push(global_alloc_clear<ui_submenu>(machine(), container, advanced_submenu_options)); + break; case SAVE_CONFIG: if (m_event->iptkey == IPT_UI_SELECT) save_main_option(machine()); @@ -260,9 +265,10 @@ void ui_menu_game_options::populate() } item_append(_("Display Options"), nullptr, 0, (void *)(FPTR)DISPLAY_MENU); item_append(_("Sound Options"), nullptr, 0, (void *)(FPTR)SOUND_MENU); - item_append(_("Miscellaneous Options"), nullptr, 0, (void *)(FPTR)MISC_MENU); + item_append(_(misc_submenu_options[0].description), nullptr, 0, (void *)(FPTR)MISC_MENU); item_append(_("Device Mapping"), nullptr, 0, (void *)(FPTR)CONTROLLER_MENU); item_append(_("General Inputs"), nullptr, 0, (void *)(FPTR)CGI_MENU); + item_append(_(advanced_submenu_options[0].description), nullptr, 0, (void *)(FPTR)ADVANCED_MENU); item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); item_append(_("Save Configuration"), nullptr, 0, (void *)(FPTR)SAVE_CONFIG); diff --git a/src/emu/ui/optsmenu.h b/src/emu/ui/optsmenu.h index 4dd2d0f53be..f6b4243afa0 100644 --- a/src/emu/ui/optsmenu.h +++ b/src/emu/ui/optsmenu.h @@ -33,11 +33,12 @@ private: YEAR_CAT_FILTER, CATEGORY_FILTER, CONF_DIR, - MISC_MENU, DISPLAY_MENU, CUSTOM_MENU, SOUND_MENU, CONTROLLER_MENU, + MISC_MENU, + ADVANCED_MENU, SAVE_OPTIONS, CGI_MENU, CUSTOM_FILTER, diff --git a/src/emu/ui/pluginopt.cpp b/src/emu/ui/pluginopt.cpp new file mode 100644 index 00000000000..625d60600f1 --- /dev/null +++ b/src/emu/ui/pluginopt.cpp @@ -0,0 +1,100 @@ +// license:BSD-3-Clause +// copyright-holders:Nicola Salmoria, Aaron Giles, Nathan Woods +/********************************************************************* + + ui/pluginopt.cpp + + Internal menu for the plugin interface. + +*********************************************************************/ + +#include "emu.h" +#include "luaengine.h" + +#include "ui/pluginopt.h" + +void ui_menu_plugin::handle() +{ + const ui_menu_event *menu_event = process(0); + + if (menu_event != nullptr && menu_event->itemref != nullptr) + { + if (menu_event->iptkey == IPT_UI_SELECT) + ui_menu::stack_push(global_alloc_clear<ui_menu_plugin_opt>(machine(), container, (char *)menu_event->itemref)); + } +} + +ui_menu_plugin::ui_menu_plugin(running_machine &machine, render_container *container) : + ui_menu(machine, container), + m_plugins(machine.manager().lua()->get_menu()) +{ +} + +void ui_menu_plugin::populate() +{ + for (auto &curplugin : m_plugins) + item_append(curplugin.c_str(), 0, 0, (void *)curplugin.c_str()); + item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); +} + +ui_menu_plugin::~ui_menu_plugin() +{ +} + +ui_menu_plugin_opt::ui_menu_plugin_opt(running_machine &machine, render_container *container, char *menu) : + ui_menu(machine, container), + m_menu(menu) +{ +} + +void ui_menu_plugin_opt::handle() +{ + const ui_menu_event *menu_event = process(0); + + if (menu_event != nullptr && (FPTR)menu_event->itemref) + { + std::string key; + switch(menu_event->iptkey) + { + case IPT_UI_UP: + key = "up"; + break; + case IPT_UI_DOWN: + key = "down"; + break; + case IPT_UI_LEFT: + key = "left"; + break; + case IPT_UI_RIGHT: + key = "right"; + break; + case IPT_UI_SELECT: + key = "select"; + break; + case IPT_UI_DISPLAY_COMMENT: + key = "comment"; + break; + case IPT_UI_CLEAR: + key = "clear"; + break; + default: + return; + } + if(machine().manager().lua()->menu_callback(m_menu, (FPTR)menu_event->itemref, key)) + reset(UI_MENU_RESET_REMEMBER_REF); + } +} + +void ui_menu_plugin_opt::populate() +{ + std::vector<lua_engine::menu_item> &menu_list = machine().manager().lua()->menu_populate(m_menu); + FPTR i = 1; + for(auto &item : menu_list) + item_append(item.text.c_str(), item.subtext.c_str(), item.flags, (void *)i++); + item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); + global_free(&menu_list); +} + +ui_menu_plugin_opt::~ui_menu_plugin_opt() +{ +} diff --git a/src/emu/ui/pluginopt.h b/src/emu/ui/pluginopt.h new file mode 100644 index 00000000000..9d529e93749 --- /dev/null +++ b/src/emu/ui/pluginopt.h @@ -0,0 +1,38 @@ +// license:BSD-3-Clause +// copyright-holders:Nicola Salmoria, Aaron Giles, Nathan Woods, Carl +/*************************************************************************** + + ui/pluginopt.h + + Internal menu for the plugin interface. + +***************************************************************************/ + +#pragma once + +#ifndef __UI_PLUGINOPT_H__ +#define __UI_PLUGINOPT_H__ + +#include "ui/ui.h" +#include "ui/menu.h" + +class ui_menu_plugin : public ui_menu { +public: + ui_menu_plugin(running_machine &machine, render_container *container); + virtual ~ui_menu_plugin(); + virtual void populate() override; + virtual void handle() override; +private: + std::vector<std::string> &m_plugins; +}; + +class ui_menu_plugin_opt : public ui_menu { +public: + ui_menu_plugin_opt(running_machine &machine, render_container *container, char *menu); + virtual ~ui_menu_plugin_opt(); + virtual void populate() override; + virtual void handle() override; +private: + std::string m_menu; +}; +#endif /* __UI_PLUGINOPT_H__ */ diff --git a/src/emu/ui/slotopt.cpp b/src/emu/ui/slotopt.cpp index 693c28a9ba8..35c9cab14a7 100644 --- a/src/emu/ui/slotopt.cpp +++ b/src/emu/ui/slotopt.cpp @@ -9,7 +9,7 @@ *********************************************************************/ #include "emu.h" - +#include "emuopts.h" #include "ui/ui.h" #include "ui/menu.h" #include "ui/slotopt.h" diff --git a/src/emu/ui/submenu.cpp b/src/emu/ui/submenu.cpp new file mode 100644 index 00000000000..acda370cd53 --- /dev/null +++ b/src/emu/ui/submenu.cpp @@ -0,0 +1,304 @@ +// license:BSD-3-Clause +// copyright-holders:Maurizio Petrarota,Jeffrey Clark +/*************************************************************************** + + ui/submenu.cpp + + UI options menu + +***************************************************************************/ + +#include "emu.h" +#include "ui/ui.h" +#include "ui/submenu.h" +#include "ui/utils.h" +#include <limits> + +//------------------------------------------------- +// ctor / dtor +//------------------------------------------------- + +ui_submenu::ui_submenu(running_machine &machine, render_container *container, std::vector<ui_submenu::option> &suboptions) + : ui_menu(machine, container), + m_options(suboptions) +{ + for (auto & sm_option : m_options) + { + if (sm_option.type < ui_submenu::EMU) + continue; + + // fixme use switch + sm_option.entry = machine.options().get_entry(sm_option.name); + if (sm_option.entry == nullptr) + { + sm_option.entry = machine.ui().options().get_entry(sm_option.name); + sm_option.options = dynamic_cast<core_options*>(&machine.ui().options()); + } + else + { + sm_option.options = dynamic_cast<core_options*>(&machine.options()); + } + } +} + +ui_submenu::~ui_submenu() +{ +} + +//------------------------------------------------- +// handlethe options menu +//------------------------------------------------- + +void ui_submenu::handle() +{ + bool changed = false; + std::string error_string, tmptxt; + int i_cur; + float f_cur, f_step; + + // process the menu + const ui_menu_event *m_event = process(UI_MENU_PROCESS_LR_REPEAT); + + if (m_event != nullptr && m_event->itemref != nullptr && + (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT || m_event->iptkey == IPT_UI_SELECT)) + { + ui_submenu::option *sm_option = (ui_submenu::option *)m_event->itemref; + + switch (sm_option->type) + { + case ui_submenu::EMU: + case ui_submenu::UI: + case ui_submenu::OSD: + switch (sm_option->entry->type()) + { + case OPTION_BOOLEAN: + changed = true; + sm_option->options->set_value(sm_option->name, !strcmp(sm_option->entry->value(),"1") ? "0" : "1", OPTION_PRIORITY_CMDLINE, error_string); + sm_option->entry->mark_changed(); + break; + case OPTION_INTEGER: + if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT) + { + changed = true; + i_cur = atof(sm_option->entry->value()); + (m_event->iptkey == IPT_UI_LEFT) ? i_cur-- : i_cur++; + sm_option->options->set_value(sm_option->name, i_cur, OPTION_PRIORITY_CMDLINE, error_string); + sm_option->entry->mark_changed(); + } + break; + case OPTION_FLOAT: + if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT) + { + changed = true; + f_cur = atof(sm_option->entry->value()); + if (sm_option->entry->has_range()) + { + f_step = atof(sm_option->entry->minimum()); + if (f_step <= 0.0f) { + int pmin = getprecisionchr(sm_option->entry->minimum()); + int pmax = getprecisionchr(sm_option->entry->maximum()); + tmptxt = '1' + std::string((pmin > pmax) ? pmin : pmax, '0'); + f_step = 1 / atof(tmptxt.c_str()); + } + } + else + { + int precision = getprecisionchr(sm_option->entry->default_value()); + tmptxt = '1' + std::string(precision, '0'); + f_step = 1 / atof(tmptxt.c_str()); + } + if (m_event->iptkey == IPT_UI_LEFT) + f_cur -= f_step; + else + f_cur += f_step; + tmptxt = string_format("%g", f_cur); + sm_option->options->set_value(sm_option->name, tmptxt.c_str(), OPTION_PRIORITY_CMDLINE, error_string); + sm_option->entry->mark_changed(); + } + break; + } + break; + default: + osd_printf_error("Unhandled option: %s", _(sm_option->description)); + break; + } + } + + if (changed) + reset(UI_MENU_RESET_REMEMBER_REF); +} + +//------------------------------------------------- +// populate +//------------------------------------------------- + +void ui_submenu::populate() +{ + UINT32 arrow_flags; + std::string tmptxt; + float f_min, f_max, f_cur; + int i_min, i_max, i_cur; + + // add options + for (auto sm_option = m_options.begin(); sm_option < m_options.end(); sm_option++) + { + // skip first heading (is menu title) + if (sm_option == m_options.begin() && sm_option->type == ui_submenu::HEAD) continue; + + switch (sm_option->type) + { + case ui_submenu::HEAD: + item_append(_(sm_option->description), nullptr, MENU_FLAG_DISABLE | MENU_FLAG_UI_HEADING, nullptr); + break; + case ui_submenu::SEP: + item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); + break; + case ui_submenu::CMD: + item_append(_(sm_option->description), nullptr, 0, static_cast<void*>(&(*sm_option))); + break; + case ui_submenu::EMU: + case ui_submenu::UI: + case ui_submenu::OSD: + switch (sm_option->entry->type()) + { + case OPTION_BOOLEAN: + arrow_flags = sm_option->options->bool_value(sm_option->name) ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW; + item_append(_(sm_option->description), + (arrow_flags == MENU_FLAG_RIGHT_ARROW) ? "On" : "Off", + arrow_flags, + static_cast<void*>(&(*sm_option))); + break; + case OPTION_INTEGER: + i_cur = atof(sm_option->entry->value()); + if (sm_option->entry->has_range()) + { + i_min = atof(sm_option->entry->minimum()); + i_max = atof(sm_option->entry->maximum()); + } + else + { + i_min = std::numeric_limits<int>::min(); + i_max = std::numeric_limits<int>::max(); + } + arrow_flags = get_arrow_flags(i_min, i_max, i_cur); + item_append(_(sm_option->description), + sm_option->entry->value(), + arrow_flags, + static_cast<void*>(&(*sm_option))); + break; + case OPTION_FLOAT: + f_cur = atof(sm_option->entry->value()); + if (sm_option->entry->has_range()) + { + f_min = atof(sm_option->entry->minimum()); + f_max = atof(sm_option->entry->maximum()); + } + else + { + f_min = 0.0f; + f_max = std::numeric_limits<float>::max(); + } + arrow_flags = get_arrow_flags(f_min, f_max, f_cur); + tmptxt = string_format("%g", f_cur); + item_append(_(sm_option->description), + tmptxt.c_str(), + arrow_flags, + static_cast<void*>(&(*sm_option))); + break; + default: + arrow_flags = MENU_FLAG_RIGHT_ARROW; + item_append(_(sm_option->description), + sm_option->options->value(sm_option->name), + arrow_flags, static_cast<void*>(&(*sm_option))); + break; + } + break; + default: + osd_printf_error("Unknown option type: %s", _(sm_option->description)); + break; + } + } + + item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); + custombottom = customtop = machine().ui().get_line_height() + (3.0f * UI_BOX_TB_BORDER); +} + +//------------------------------------------------- +// perform our special rendering +//------------------------------------------------- + +void ui_submenu::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) +{ + static int interval = 0; + static ui_submenu::option *last_sm_option = nullptr; + + float width; + ui_manager &mui = machine().ui(); + + mui.draw_text_full(container, _(m_options[0].description), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + width += 2 * UI_BOX_LR_BORDER; + float maxwidth = MAX(origx2 - origx1, width); + + // compute our bounds + float x1 = 0.5f - 0.5f * maxwidth; + float x2 = x1 + maxwidth; + float y1 = origy1 - top; + float y2 = origy1 - UI_BOX_TB_BORDER; + + // draw a box + mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR); + + // take off the borders + x1 += UI_BOX_LR_BORDER; + x2 -= UI_BOX_LR_BORDER; + y1 += UI_BOX_TB_BORDER; + + // draw the text within it + mui.draw_text_full(container, _(m_options[0].description), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + + if (selectedref != nullptr) + { + ui_submenu::option *selected_sm_option = (ui_submenu::option *)selectedref; + + if (last_sm_option == selected_sm_option) { + if (interval <= 30) interval++; + } else { + last_sm_option = selected_sm_option; + interval = 0; + } + + if (interval > 30 && last_sm_option->entry != nullptr) + { + mui.draw_text_full(container, last_sm_option->entry->description(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + + width += 2 * UI_BOX_LR_BORDER; + maxwidth = MAX(origx2 - origx1, width); + + // compute our bounds + x1 = 0.5f - 0.5f * maxwidth; + x2 = x1 + maxwidth; + y1 = origy2 + UI_BOX_TB_BORDER; + y2 = origy2 + bottom; + + // draw a box + mui.draw_outlined_box(container, x1, y1, x2, y2, UI_RED_COLOR); + + // take off the borders + x1 += UI_BOX_LR_BORDER; + x2 -= UI_BOX_LR_BORDER; + y1 += UI_BOX_TB_BORDER; + + // draw the text within it + mui.draw_text_full(container, last_sm_option->entry->description(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + } + } + else + { + last_sm_option = nullptr; + interval = 0; + } +} diff --git a/src/emu/ui/submenu.h b/src/emu/ui/submenu.h new file mode 100644 index 00000000000..a47a84f4d5b --- /dev/null +++ b/src/emu/ui/submenu.h @@ -0,0 +1,130 @@ +// license:BSD-3-Clause +// copyright-holders:Maurizio Petrarota,Jeffrey Clark +/*************************************************************************** + + ui/submenu.h + + UI options menu. + +***************************************************************************/ +#pragma once + +#ifndef __UI_SUBMENU_H__ +#define __UI_SUBMENU_H__ + +#include "emuopts.h" +#include "ui/menu.h" + +//------------------------------------------------- +// class ui menu +//------------------------------------------------- +class ui_submenu : public ui_menu +{ +public: + enum option_type { + HEAD, + SEP, + MENU, + CMD, + EMU, + UI, + OSD, + }; + + struct option { + option_type type; + const char *description; + const char *name; + core_options::entry *entry; + core_options (*options); + }; + + ui_submenu(running_machine &machine, render_container *container, std::vector<ui_submenu::option> &suboptions); + virtual ~ui_submenu(); + virtual void populate() override; + virtual void handle() override; + virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + +private: + std::vector<option> &m_options; +}; + +static std::vector<ui_submenu::option> misc_submenu_options = { + { ui_submenu::HEAD, __("Miscellaneous Options") }, + { ui_submenu::UI, __("Re-select last machine played"), OPTION_REMEMBER_LAST }, + { ui_submenu::UI, __("Enlarge images in the right panel"), OPTION_ENLARGE_SNAPS }, + { ui_submenu::UI, __("DATs info"), OPTION_DATS_ENABLED }, + { ui_submenu::EMU, __("Cheats"), OPTION_CHEAT }, + { ui_submenu::EMU, __("Show mouse pointer"), OPTION_UI_MOUSE }, + { ui_submenu::EMU, __("Confirm quit from machines"), OPTION_CONFIRM_QUIT }, + { ui_submenu::EMU, __("Skip information screen at startup"), OPTION_SKIP_GAMEINFO }, + { ui_submenu::UI, __("Force 4:3 aspect for snapshot display"), OPTION_FORCED4X3 }, + { ui_submenu::UI, __("Use image as background"), OPTION_USE_BACKGROUND }, + { ui_submenu::UI, __("Skip bios selection menu"), OPTION_SKIP_BIOS_MENU }, + { ui_submenu::UI, __("Skip software parts selection menu"), OPTION_SKIP_PARTS_MENU }, + { ui_submenu::UI, __("Info auto audit"), OPTION_INFO_AUTO_AUDIT }, +}; + +static std::vector<ui_submenu::option> advanced_submenu_options = { + { ui_submenu::HEAD, __("Advanced Options") }, + { ui_submenu::HEAD, __("Performance Options") }, + { ui_submenu::EMU, __("Auto frame skip"), OPTION_AUTOFRAMESKIP }, + { ui_submenu::EMU, __("Frame skip"), OPTION_FRAMESKIP }, + { ui_submenu::EMU, __("Throttle"), OPTION_THROTTLE }, + { ui_submenu::EMU, __("Sleep"), OPTION_SLEEP }, + { ui_submenu::EMU, __("Speed"), OPTION_SPEED }, + { ui_submenu::EMU, __("Refresh speed"), OPTION_REFRESHSPEED }, +//}; + +//static std::vector<ui_submenu::option> rotate_submenu_options = { + { ui_submenu::HEAD, __("Rotation Options") }, + { ui_submenu::EMU, __("Rotate"), OPTION_ROTATE }, + { ui_submenu::EMU, __("Rotate right"), OPTION_ROR }, + { ui_submenu::EMU, __("Rotate left"), OPTION_ROL }, + { ui_submenu::EMU, __("Auto rotate right"), OPTION_AUTOROR }, + { ui_submenu::EMU, __("Auto rotate left"), OPTION_AUTOROL }, + { ui_submenu::EMU, __("Flip X"), OPTION_FLIPX }, + { ui_submenu::EMU, __("Flip Y"), OPTION_FLIPY }, +//}; + +//static std::vector<ui_submenu::option> artwork_submenu_options = { + { ui_submenu::HEAD, __("Artwork Options") }, + { ui_submenu::EMU, __("Artwork Crop"), OPTION_ARTWORK_CROP }, + { ui_submenu::EMU, __("Use Backdrops"), OPTION_USE_BACKDROPS }, + { ui_submenu::EMU, __("Use Overlays"), OPTION_USE_OVERLAYS }, + { ui_submenu::EMU, __("Use Bezels"), OPTION_USE_BEZELS }, + { ui_submenu::EMU, __("Use Control Panels"), OPTION_USE_CPANELS }, + { ui_submenu::EMU, __("Use Marquees"), OPTION_USE_MARQUEES }, +//}; + +//static std::vector<ui_submenu::option> state_submenu_options = { + { ui_submenu::HEAD, __("State/Playback Options") }, + { ui_submenu::EMU, __("Automatic save/restore"), OPTION_AUTOSAVE }, + { ui_submenu::EMU, __("Bilinear snapshot"), OPTION_SNAPBILINEAR }, + { ui_submenu::EMU, __("Burn-in"), OPTION_BURNIN }, +//}; + +//static std::vector<ui_submenu::option> input_submenu_options = { + { ui_submenu::HEAD, __("Input Options") }, + { ui_submenu::EMU, __("Coin lockout"), OPTION_COIN_LOCKOUT }, + { ui_submenu::EMU, __("Mouse"), OPTION_MOUSE }, + { ui_submenu::EMU, __("Joystick"), OPTION_JOYSTICK }, + { ui_submenu::EMU, __("Lightgun"), OPTION_LIGHTGUN }, + { ui_submenu::EMU, __("Multi-keyboard"), OPTION_MULTIKEYBOARD }, + { ui_submenu::EMU, __("Multi-mouse"), OPTION_MULTIMOUSE }, + { ui_submenu::EMU, __("Steadykey"), OPTION_STEADYKEY }, + { ui_submenu::EMU, __("UI active"), OPTION_UI_ACTIVE }, + { ui_submenu::EMU, __("Offscreen reload"), OPTION_OFFSCREEN_RELOAD }, + { ui_submenu::EMU, __("Joystick deadzone"), OPTION_JOYSTICK_DEADZONE }, + { ui_submenu::EMU, __("Joystick saturation"), OPTION_JOYSTICK_SATURATION }, + { ui_submenu::EMU, __("Natural keyboard"), OPTION_NATURAL_KEYBOARD }, + { ui_submenu::EMU, __("Simultaneous contradictory"), OPTION_JOYSTICK_CONTRADICTORY }, + { ui_submenu::EMU, __("Coin impulse"), OPTION_COIN_IMPULSE }, +}; + +//static std::vector<ui_submenu::option> export_submenu_options = { +// { ui_submenu::COMMAND, __("Export XML format (like -listxml)"), "exportxml" }, +// { ui_submenu::COMMAND, __("Export TXT format (like -listfull)"), "exporttxt" }, +//}; + +#endif /* __UI_SUBMENU_H__ */ diff --git a/src/emu/ui/ui.cpp b/src/emu/ui/ui.cpp index 9bb27762c3b..ab295c8d5fe 100644 --- a/src/emu/ui/ui.cpp +++ b/src/emu/ui/ui.cpp @@ -1633,17 +1633,9 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co // toggle pause if (machine.ui_input().pressed(IPT_UI_PAUSE)) - { - // with a shift key, it is single step -// if (is_paused && (machine.input().code_pressed(KEYCODE_LSHIFT) || machine.input().code_pressed(KEYCODE_RSHIFT))) -// { -// machine.ui().set_single_step(true); -// machine.resume(); -// } -// else - machine.toggle_pause(); - } + machine.toggle_pause(); + // pause single step if (machine.ui_input().pressed(IPT_UI_PAUSE_SINGLE)) { machine.ui().set_single_step(true); diff --git a/src/emu/ui/utils.cpp b/src/emu/ui/utils.cpp index 1e998d04c9d..6a59208cd30 100644 --- a/src/emu/ui/utils.cpp +++ b/src/emu/ui/utils.cpp @@ -84,6 +84,15 @@ const char* strensure(const char* s) return s == nullptr ? "" : s; } +int getprecisionchr(const char* s) +{ + int precision = 1; + char *dp = const_cast<char *>(strchr(s, '.')); + if (dp != nullptr) + precision = strlen(s) - (dp - s) - 1; + return precision; +} + //------------------------------------------------- // search a substring with even partial matching //------------------------------------------------- diff --git a/src/emu/ui/utils.h b/src/emu/ui/utils.h index 81107c0911c..519f74e667b 100644 --- a/src/emu/ui/utils.h +++ b/src/emu/ui/utils.h @@ -254,5 +254,6 @@ char* chartrimcarriage(char str[]); const char* strensure(const char* s); +int getprecisionchr(const char* s); #endif /* __UI_UTILS_H__ */ diff --git a/src/lib/util/nanosvg.cpp b/src/lib/util/nanosvg.cpp new file mode 100644 index 00000000000..09973865675 --- /dev/null +++ b/src/lib/util/nanosvg.cpp @@ -0,0 +1,6 @@ +#define NANOSVG_IMPLEMENTATION +#define NANOSVGRAST_IMPLEMENTATION +#define NANOSVG_ALL_COLOR_KEYWORDS + +#include <nanosvg/src/nanosvg.h> +#include <nanosvg/src/nanosvgrast.h> diff --git a/src/lib/util/options.cpp b/src/lib/util/options.cpp index 7e8b993c0b2..f8ef33b0d39 100644 --- a/src/lib/util/options.cpp +++ b/src/lib/util/options.cpp @@ -146,13 +146,13 @@ void core_options::entry::set_flag(UINT32 mask, UINT32 flag) //------------------------------------------------- // revert - revert back to our default if we are -// at or below the given priority +// within the given priority range //------------------------------------------------- -void core_options::entry::revert(int priority) +void core_options::entry::revert(int priority_hi, int priority_lo) { - // if our priority is low enough, revert to the default - if (m_priority <= priority) + // if our priority is within the range, revert to the default + if (m_priority <= priority_hi && m_priority >= priority_lo) { m_data = m_defdata; m_priority = OPTION_PRIORITY_DEFAULT; @@ -465,11 +465,11 @@ bool core_options::parse_ini_file(util::core_file &inifile, int priority, int ig // priority back to their defaults //------------------------------------------------- -void core_options::revert(int priority) +void core_options::revert(int priority_hi, int priority_lo) { // iterate over options and revert to defaults if below the given priority for (entry &curentry : m_entrylist) - curentry.revert(priority); + curentry.revert(priority_hi, priority_lo); } @@ -836,3 +836,9 @@ bool core_options::validate_and_set_data(core_options::entry &curentry, const ch curentry.set_value(data.c_str(), priority); return true; } + +core_options::entry *core_options::get_entry(const char *name) const +{ + auto curentry = m_entrymap.find(name); + return (curentry != m_entrymap.end()) ? curentry->second : nullptr; +}
\ No newline at end of file diff --git a/src/lib/util/options.h b/src/lib/util/options.h index 9af9c61233e..ff1cad115de 100644 --- a/src/lib/util/options.h +++ b/src/lib/util/options.h @@ -97,7 +97,7 @@ public: void set_description(const char *description); void set_flag(UINT32 mask, UINT32 flag); void mark_changed() { m_changed = true; } - void revert(int priority); + void revert(int priority_hi, int priority_lo); private: // internal state @@ -131,6 +131,7 @@ public: // getters entry *first() const { return m_entrylist.first(); } const char *command() const { return m_command.c_str(); } + entry *get_entry(const char *name) const; // range iterators using auto_iterator = simple_list<entry>::auto_iterator; @@ -150,7 +151,7 @@ public: bool parse_ini_file(util::core_file &inifile, int priority, int ignore_priority, std::string &error_string); // reverting - void revert(int priority = OPTION_PRIORITY_MAXIMUM); + void revert(int priority_hi = OPTION_PRIORITY_MAXIMUM, int priority_lo = OPTION_PRIORITY_DEFAULT); // output std::string output_ini(const core_options *diff = nullptr) const; diff --git a/src/mame/drivers/actfancr.cpp b/src/mame/drivers/actfancr.cpp index c9acefba01c..6ce12f09413 100644 --- a/src/mame/drivers/actfancr.cpp +++ b/src/mame/drivers/actfancr.cpp @@ -312,16 +312,15 @@ static MACHINE_CONFIG_START( actfancr, actfancr_state ) MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,2,2,2); + MCFG_DECO_BAC06_GFX_REGION_WIDE(2, 2, 2) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,0,0,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 0, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) - deco_mxc06_device::set_gfx_region(*device, 1); + MCFG_DECO_MXC06_GFX_REGION(1) MCFG_DECO_MXC06_GFXDECODE("gfxdecode") - MCFG_DECO_MXC06_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -368,16 +367,15 @@ static MACHINE_CONFIG_START( triothep, actfancr_state ) MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,2,2,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(2, 2, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,0,0,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 0, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) - deco_mxc06_device::set_gfx_region(*device, 1); + MCFG_DECO_MXC06_GFX_REGION(1) MCFG_DECO_MXC06_GFXDECODE("gfxdecode") - MCFG_DECO_MXC06_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/aerofgt.cpp b/src/mame/drivers/aerofgt.cpp index 2ad00982f1a..15ae41e4221 100644 --- a/src/mame/drivers/aerofgt.cpp +++ b/src/mame/drivers/aerofgt.cpp @@ -1341,7 +1341,6 @@ static MACHINE_CONFIG_START( pspikes, aerofgt_state ) MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_old_tile_callback ) MCFG_VSYSTEM_SPR2_SET_GFXREGION(1) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(aerofgt_state,pspikes) @@ -1451,7 +1450,6 @@ static MACHINE_CONFIG_START( pspikesc, aerofgt_state ) MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_old_tile_callback ) MCFG_VSYSTEM_SPR2_SET_GFXREGION(1) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(aerofgt_state,pspikes) @@ -1494,13 +1492,11 @@ static MACHINE_CONFIG_START( karatblz, aerofgt_state ) MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_old_tile_callback ) MCFG_VSYSTEM_SPR2_SET_GFXREGION(2) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") MCFG_DEVICE_ADD("vsystem_spr_ol2", VSYSTEM_SPR2, 0) MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_ol2_tile_callback ) MCFG_VSYSTEM_SPR2_SET_GFXREGION(3) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(aerofgt_state,karatblz) @@ -1545,13 +1541,11 @@ static MACHINE_CONFIG_START( karatblzbl, aerofgt_state ) MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_old_tile_callback ) MCFG_VSYSTEM_SPR2_SET_GFXREGION(2) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") MCFG_DEVICE_ADD("vsystem_spr_ol2", VSYSTEM_SPR2, 0) MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_ol2_tile_callback ) MCFG_VSYSTEM_SPR2_SET_GFXREGION(3) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(aerofgt_state,karatblz) @@ -1593,14 +1587,12 @@ static MACHINE_CONFIG_START( spinlbrk, aerofgt_state ) MCFG_VSYSTEM_SPR2_SET_PRITYPE(1) MCFG_VSYSTEM_SPR2_SET_GFXREGION(2) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") MCFG_DEVICE_ADD("vsystem_spr_ol2", VSYSTEM_SPR2, 0) MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_ol2_tile_callback ) // rom lookup MCFG_VSYSTEM_SPR2_SET_PRITYPE(1) MCFG_VSYSTEM_SPR2_SET_GFXREGION(3) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(aerofgt_state,spinlbrk) @@ -1647,13 +1639,11 @@ static MACHINE_CONFIG_START( turbofrc, aerofgt_state ) MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_old_tile_callback ) MCFG_VSYSTEM_SPR2_SET_GFXREGION(2) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") MCFG_DEVICE_ADD("vsystem_spr_ol2", VSYSTEM_SPR2, 0) MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_ol2_tile_callback ) MCFG_VSYSTEM_SPR2_SET_GFXREGION(3) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(aerofgt_state,turbofrc) @@ -1701,13 +1691,11 @@ static MACHINE_CONFIG_START( aerofgtb, aerofgt_state ) MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_old_tile_callback ) MCFG_VSYSTEM_SPR2_SET_GFXREGION(2) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") MCFG_DEVICE_ADD("vsystem_spr_ol2", VSYSTEM_SPR2, 0) MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_ol2_tile_callback ) MCFG_VSYSTEM_SPR2_SET_GFXREGION(3) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(aerofgt_state,turbofrc) @@ -1755,7 +1743,6 @@ static MACHINE_CONFIG_START( aerofgt, aerofgt_state ) MCFG_VSYSTEM_SPR_SET_TILE_INDIRECT( aerofgt_state, aerofgt_tile_callback ) MCFG_VSYSTEM_SPR_SET_GFXREGION(2) MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(aerofgt_state,turbofrc) @@ -1869,7 +1856,6 @@ static MACHINE_CONFIG_START( wbbc97, aerofgt_state ) MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_old_tile_callback ) MCFG_VSYSTEM_SPR2_SET_GFXREGION(1) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(aerofgt_state,wbbc97) diff --git a/src/mame/drivers/airbustr.cpp b/src/mame/drivers/airbustr.cpp index 3a000c60c30..8c6b6473bb3 100644 --- a/src/mame/drivers/airbustr.cpp +++ b/src/mame/drivers/airbustr.cpp @@ -619,7 +619,6 @@ static MACHINE_CONFIG_START( airbustr, airbustr_state ) MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0) MCFG_KANEKO_PANDORA_GFX_REGION(1) MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode") - MCFG_KANEKO_PANDORA_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/aleck64.cpp b/src/mame/drivers/aleck64.cpp index c86157b6e6a..1463151de96 100644 --- a/src/mame/drivers/aleck64.cpp +++ b/src/mame/drivers/aleck64.cpp @@ -845,6 +845,7 @@ static MACHINE_CONFIG_START( aleck64, aleck64_state ) MCFG_MIPS3_DCACHE_SIZE(8192) MCFG_MIPS3_SYSTEM_CLOCK(62500000) MCFG_CPU_PROGRAM_MAP(n64_map) + MCFG_CPU_FORCE_NO_DRC() MCFG_CPU_ADD("rsp", RSP, 62500000) MCFG_RSP_DP_REG_R_CB(DEVREAD32("rcp",n64_periphs, dp_reg_r)) @@ -853,6 +854,7 @@ static MACHINE_CONFIG_START( aleck64, aleck64_state ) MCFG_RSP_SP_REG_W_CB(DEVWRITE32("rcp",n64_periphs, sp_reg_w)) MCFG_RSP_SP_SET_STATUS_CB(DEVWRITE32("rcp",n64_periphs, sp_set_status)) MCFG_CPU_PROGRAM_MAP(rsp_map) + MCFG_CPU_FORCE_NO_DRC() MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -872,8 +874,6 @@ static MACHINE_CONFIG_START( aleck64, aleck64_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) MCFG_N64_PERIPHS_ADD("rcp"); - - MCFG_FORCE_NO_DRC() MACHINE_CONFIG_END UINT32 aleck64_state::screen_update_e90(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) diff --git a/src/mame/drivers/apple2e.cpp b/src/mame/drivers/apple2e.cpp index 27b3dd0fc59..d5ef8f11de4 100644 --- a/src/mame/drivers/apple2e.cpp +++ b/src/mame/drivers/apple2e.cpp @@ -107,6 +107,7 @@ Address bus A0-A11 is Y0-Y11 #include "cpu/m6502/m6502.h" #include "cpu/m6502/m65c02.h" #include "cpu/z80/z80.h" +#include "cpu/mcs48/mcs48.h" #include "formats/ap_dsk35.h" #include "machine/sonydriv.h" #include "machine/appldriv.h" @@ -2437,6 +2438,11 @@ static ADDRESS_MAP_START( lcbank_map, AS_PROGRAM, 8, apple2e_state ) AM_RANGE(0x6000, 0x8fff) AM_ROM AM_REGION("maincpu", 0x5000) AM_WRITE(lc_w) ADDRESS_MAP_END +static ADDRESS_MAP_START( spectred_keyb_map, AS_PROGRAM, 8, apple2e_state ) + AM_RANGE(0x0000, 0x07ff) AM_ROM + AM_RANGE(0x0800, 0x0fff) AM_RAM +ADDRESS_MAP_END + /*************************************************************************** KEYBOARD ***************************************************************************/ @@ -3365,6 +3371,14 @@ static MACHINE_CONFIG_DERIVED( apple2ee, apple2e ) MCFG_CPU_PROGRAM_MAP(apple2e_map) MACHINE_CONFIG_END +static MACHINE_CONFIG_DERIVED( spectred, apple2e ) + MCFG_CPU_ADD("keyb_mcu", I8035, XTAL_4MHz) /* guessed frequency */ + MCFG_CPU_PROGRAM_MAP(spectred_keyb_map) + + //TODO: implement the actual interfacing to this 8035 MCU and + // and then remove the keyb CPU inherited from apple2e +MACHINE_CONFIG_END + static MACHINE_CONFIG_DERIVED( tk3000, apple2e ) MCFG_CPU_REPLACE("maincpu", M65C02, 1021800) /* close to actual CPU frequency of 1.020484 MHz */ MCFG_CPU_PROGRAM_MAP(apple2e_map) @@ -3632,6 +3646,22 @@ ROM_START(apple2c) ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // 1983 US-Dvorak ROM_END + +ROM_START(spectred) + ROM_REGION(0x8000,"gfx1",0) + ROM_LOAD ( "spm-c_ed_06-08-85.u6", 0x0000, 0x8000, CRC(a1b9ffe4) SHA1(3cb281f19f91372e24685792b7bff778944f99ed) ) + + ROM_REGION(0x8000,"maincpu",0) + ROM_LOAD ( "spm-c_ed_50-09-86.u50.H", 0x0000, 0x4000, CRC(1fccaf24) SHA1(1de1438ee8789f83cbc97f75c0485d1fd0f58a38)) + ROM_LOAD ( "spm-c_ed_51-09-86.u51.H", 0x4000, 0x4000, CRC(fae8d36c) SHA1(69bed61513482ccb578b89c2fb8e7ba2258e82a5)) + + ROM_REGION( 0x800, "keyboard", ROMREGION_ERASE00 ) + ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, BAD_DUMP CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // copied from apple2e + + ROM_REGION(0x1000, "keyb_mcu", 0) + ROM_LOAD( "167_8980.u5", 0x0000, 0x1000, CRC(a501f197) SHA1(136c2b562999a6e340fe0e9a3776cea8c2e3647e) ) +ROM_END + // unlike the very unique TK2000, the TK3000 is a mostly stock enhanced IIe clone ROM_START(tk3000) ROM_REGION(0x2000,"gfx1",0) @@ -3755,6 +3785,7 @@ COMP( 1985, apple2ee, apple2e, 0, apple2ee, apple2e, driver_device, COMP( 1985, apple2eeuk,apple2e, 0, apple2ee, apple2euk, driver_device,0, "Apple Computer", "Apple //e (enhanced, UK)", MACHINE_SUPPORTS_SAVE ) COMP( 1987, apple2ep, apple2e, 0, apple2ep, apple2ep, driver_device, 0, "Apple Computer", "Apple //e (Platinum)", MACHINE_SUPPORTS_SAVE ) COMP( 1984, apple2c, 0, apple2, apple2c, apple2c, driver_device, 0, "Apple Computer", "Apple //c" , MACHINE_SUPPORTS_SAVE ) +COMP( 1985?,spectred, apple2e, 0, spectred, apple2e, driver_device, 0, "Scopus/Spectrum", "Spectrum ED" , MACHINE_SUPPORTS_SAVE ) COMP( 1986, tk3000, apple2c, 0, tk3000, apple2e, driver_device, 0, "Microdigital", "TK3000//e" , MACHINE_SUPPORTS_SAVE ) COMP( 1989, prav8c, apple2e, 0, apple2e, apple2e, driver_device, 0, "Pravetz", "Pravetz 8C", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) COMP( 1987, laser128, apple2c, 0, laser128, apple2e, driver_device, 0, "Video Technology", "Laser 128 (version 4.2)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/asterix.cpp b/src/mame/drivers/asterix.cpp index a0dd353246b..e43476e8474 100644 --- a/src/mame/drivers/asterix.cpp +++ b/src/mame/drivers/asterix.cpp @@ -270,12 +270,9 @@ static MACHINE_CONFIG_START( asterix, asterix_state ) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(asterix_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_4, 1, 1, "none") - MCFG_K056832_GFXDECODE("gfxdecode") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 1, "none") MCFG_K056832_PALETTE("palette") MCFG_DEVICE_ADD("k053244", K053244, 0) diff --git a/src/mame/drivers/backfire.cpp b/src/mame/drivers/backfire.cpp index 9ca90c212e8..83f0f64f151 100644 --- a/src/mame/drivers/backfire.cpp +++ b/src/mame/drivers/backfire.cpp @@ -513,7 +513,6 @@ static MACHINE_CONFIG_START( backfire, backfire_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SET_SCREEN("lscreen") @@ -530,21 +529,18 @@ static MACHINE_CONFIG_START( backfire, backfire_state ) MCFG_DECO16IC_PF12_8X8_BANK(2) MCFG_DECO16IC_PF12_16X16_BANK(3) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_VIDEO_SET_SCREEN("lscreen") MCFG_DECO_SPRITE_GFX_REGION(4) MCFG_DECO_SPRITE_PRIORITY_CB(backfire_state, pri_callback) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) MCFG_VIDEO_SET_SCREEN("rscreen") MCFG_DECO_SPRITE_GFX_REGION(5) MCFG_DECO_SPRITE_PRIORITY_CB(backfire_state, pri_callback) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") /* sound hardware */ diff --git a/src/mame/drivers/bbusters.cpp b/src/mame/drivers/bbusters.cpp index e515416b646..2a04e850028 100644 --- a/src/mame/drivers/bbusters.cpp +++ b/src/mame/drivers/bbusters.cpp @@ -191,11 +191,6 @@ Beast Busters notes (from Brian Hargrove) 1. Stage 2 for example, has background sprites and enemies that float on the foreground and not behind the moving elevator layer. -2. Oddly enough, the emulation completely misses the huge zombie that jumps -out during the attract demo right before the text story text comes in. -When you hear the high pitch "zing" sound, there should be a zombie nearly -the entire size of the screen. - ***************************************************************************/ @@ -834,6 +829,55 @@ ROM_START( bbustersu ) ROM_LOAD( "bbusters-eeprom.bin", 0x00, 0x100, CRC(a52ebd66) SHA1(de04db6f1510700c61bf152799452a80220ae87c) ) ROM_END + +ROM_START( bbustersj ) + ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "bb3_ver2_j2.k10", 0x000000, 0x20000, CRC(605eb62f) SHA1(b13afd561731ad9115c5b997b8a7a79a57557612) ) + ROM_LOAD16_BYTE( "bb5_ver2_j2.k12", 0x000001, 0x20000, CRC(9deea26f) SHA1(c5436db0c55da9b0c5e0e053f59a1e17ee4690a6) ) + ROM_LOAD16_BYTE( "bb-2.k8", 0x040000, 0x20000, CRC(20141805) SHA1(0958579681bda81bcf48d020a14bc147c1e575f1) ) + ROM_LOAD16_BYTE( "bb-4.k11", 0x040001, 0x20000, CRC(d482e0e9) SHA1(e56ca92965e8954b613ba4b0e3975e3a12840c30) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "bb-1.e6", 0x000000, 0x10000, CRC(4360f2ee) SHA1(4c6b212f59389bdf4388893d2030493b110ac087) ) + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "bb-10.l9", 0x000000, 0x20000, CRC(490c0d9b) SHA1(567c25a6d96407259c64061d674305e4117d9fa4) ) + + ROM_REGION( 0x200000, "gfx2", 0 ) + ROM_LOAD( "bb-f11.m16", 0x000000, 0x80000, CRC(39fdf9c0) SHA1(80392947e3a1831c3ee80139f6f3bdc3bafa4f0d) ) + ROM_LOAD( "bb-f12.m13", 0x080000, 0x80000, CRC(69ee046b) SHA1(5c0435f1ce76b584fa8d154d7617d73c7ab5f62f) ) + ROM_LOAD( "bb-f13.m12", 0x100000, 0x80000, CRC(f5ef840e) SHA1(dd0f630c52076e0d330f47931e68a3ae9a401078) ) + ROM_LOAD( "bb-f14.m11", 0x180000, 0x80000, CRC(1a7df3bb) SHA1(1f27a528e6f89fe56a7342c4f1ff733da0a09327) ) + + ROM_REGION( 0x200000, "gfx3", 0 ) + ROM_LOAD( "bb-f21.l10", 0x000000, 0x80000, CRC(530f595b) SHA1(820898693b878c4423de9c244f943d39ea69515e) ) + ROM_LOAD( "bb-f22.l12", 0x080000, 0x80000, CRC(889c562e) SHA1(d19172d6515ab9793c98de75d6e41687e61a408d) ) + ROM_LOAD( "bb-f23.l13", 0x100000, 0x80000, CRC(c89fe0da) SHA1(92be860a7191e7473c42aa2da981eda873219d3d) ) + ROM_LOAD( "bb-f24.l15", 0x180000, 0x80000, CRC(e0d81359) SHA1(2213c17651b6c023a456447f352b0739439f913a) ) + + ROM_REGION( 0x80000, "gfx4", 0 ) + ROM_LOAD( "bb-back1.m4", 0x000000, 0x80000, CRC(b5445313) SHA1(3c99b557b2af30ff0fbc8a7dc6c40448c4f327db) ) + + ROM_REGION( 0x80000, "gfx5", 0 ) + ROM_LOAD( "bb-back2.m6", 0x000000, 0x80000, CRC(8be996f6) SHA1(1e2c56f4c24793f806d7b366b92edc03145ae94c) ) + + ROM_REGION( 0x10000, "user1", 0 ) /* Zoom table */ + /* same rom exists in 4 different locations on the board */ + ROM_LOAD( "bb-6.e7", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) + ROM_LOAD( "bb-7.h7", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) + ROM_LOAD( "bb-8.a14", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) + ROM_LOAD( "bb-9.c14", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) + + ROM_REGION( 0x80000, "ymsnd", 0 ) + ROM_LOAD( "bb-pcma.l5", 0x000000, 0x80000, CRC(44cd5bfe) SHA1(26a612191a0aa614c090203485aba17c99c763ee) ) + + ROM_REGION( 0x80000, "ymsnd.deltat", 0 ) + ROM_LOAD( "bb-pcmb.l3", 0x000000, 0x80000, CRC(c8d5dd53) SHA1(0f7e94532cc14852ca12c1b792e5479667af899e) ) + + ROM_REGION( 0x100, "eeprom", 0 ) + ROM_LOAD( "bbusters-eeprom.bin", 0x00, 0x100, CRC(a52ebd66) SHA1(de04db6f1510700c61bf152799452a80220ae87c) ) +ROM_END + ROM_START( bbustersua ) ROM_REGION( 0x80000, "maincpu", 0 ) ROM_LOAD16_BYTE( "bb-ver2-u3.k10", 0x000000, 0x20000, CRC(6930088b) SHA1(265f0b584d81b6fdcda5c3a2e0bd15d56443bb35) ) @@ -1071,6 +1115,7 @@ ROM_END GAME( 1989, bbusters, 0, bbusters, bbusters, driver_device, 0, ROT0, "SNK", "Beast Busters (World)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1989, bbustersu, bbusters, bbusters, bbusters, driver_device, 0, ROT0, "SNK", "Beast Busters (US, Version 3)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1989, bbustersua, bbusters, bbusters, bbusters, driver_device, 0, ROT0, "SNK", "Beast Busters (US, Version 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1989, bbustersj, bbusters, bbusters, bbusters, driver_device, 0, ROT0, "SNK", "Beast Busters (Japan, Version 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1989, mechatt, 0, mechatt, mechatt, driver_device, 0, ROT0, "SNK", "Mechanized Attack (World)", MACHINE_SUPPORTS_SAVE ) GAME( 1989, mechattj, mechatt, mechatt, mechattj, driver_device, 0, ROT0, "SNK", "Mechanized Attack (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/bishi.cpp b/src/mame/drivers/bishi.cpp index f46f2b3e8e6..a9de3729ea9 100644 --- a/src/mame/drivers/bishi.cpp +++ b/src/mame/drivers/bishi.cpp @@ -392,12 +392,9 @@ static MACHINE_CONFIG_START( bishi, bishi_state ) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_ENABLE_HILIGHTS() - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(bishi_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 1, 0, "none") - MCFG_K056832_GFXDECODE("gfxdecode") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 1, 0, "none") MCFG_K056832_PALETTE("palette") MCFG_DEVICE_ADD("k054338", K054338, 0) diff --git a/src/mame/drivers/blackt96.cpp b/src/mame/drivers/blackt96.cpp index 2039e7afe03..4f5801ecb3a 100644 --- a/src/mame/drivers/blackt96.cpp +++ b/src/mame/drivers/blackt96.cpp @@ -373,7 +373,6 @@ static MACHINE_CONFIG_START( blackt96, blackt96_state ) MCFG_DEVICE_ADD("sprites", SNK68_SPR, 0) MCFG_SNK68_SPR_GFXDECODE("gfxdecode") - MCFG_SNK68_SPR_PALETTE("palette") MCFG_SNK68_SPR_SET_TILE_INDIRECT( blackt96_state, tile_callback ) MCFG_SNK68_SPR_NO_PARTIAL diff --git a/src/mame/drivers/boogwing.cpp b/src/mame/drivers/boogwing.cpp index 098397785c3..ef1fa53fb22 100644 --- a/src/mame/drivers/boogwing.cpp +++ b/src/mame/drivers/boogwing.cpp @@ -358,7 +358,6 @@ static MACHINE_CONFIG_START( boogwing, boogwing_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -374,17 +373,14 @@ static MACHINE_CONFIG_START( boogwing, boogwing_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(4) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO104_ADD("ioprot104") MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE diff --git a/src/mame/drivers/cbuster.cpp b/src/mame/drivers/cbuster.cpp index b68b1ce2c94..16bc2ca7eac 100644 --- a/src/mame/drivers/cbuster.cpp +++ b/src/mame/drivers/cbuster.cpp @@ -331,7 +331,6 @@ static MACHINE_CONFIG_START( twocrude, cbuster_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -347,12 +346,10 @@ static MACHINE_CONFIG_START( twocrude, cbuster_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/cchance.cpp b/src/mame/drivers/cchance.cpp index 0283cf99df9..184ef938fb4 100644 --- a/src/mame/drivers/cchance.cpp +++ b/src/mame/drivers/cchance.cpp @@ -218,7 +218,6 @@ static MACHINE_CONFIG_START( cchance, cchance_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/champbwl.cpp b/src/mame/drivers/champbwl.cpp index 745870f02bc..8be942af8e2 100644 --- a/src/mame/drivers/champbwl.cpp +++ b/src/mame/drivers/champbwl.cpp @@ -503,7 +503,6 @@ static MACHINE_CONFIG_START( champbwl, champbwl_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -565,7 +564,6 @@ static MACHINE_CONFIG_START( doraemon, champbwl_state ) MCFG_NVRAM_ADD_0FILL("nvram") MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(2000), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ) MCFG_MACHINE_START_OVERRIDE(champbwl_state,doraemon) diff --git a/src/mame/drivers/cninja.cpp b/src/mame/drivers/cninja.cpp index 5e0e6c64183..d027733d85f 100644 --- a/src/mame/drivers/cninja.cpp +++ b/src/mame/drivers/cninja.cpp @@ -878,7 +878,6 @@ static MACHINE_CONFIG_START( cninja, cninja_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -894,13 +893,11 @@ static MACHINE_CONFIG_START( cninja, cninja_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO104_ADD("ioprot104") MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR @@ -968,7 +965,6 @@ static MACHINE_CONFIG_START( stoneage, cninja_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -984,13 +980,11 @@ static MACHINE_CONFIG_START( stoneage, cninja_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO104_ADD("ioprot104") MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR @@ -1053,7 +1047,6 @@ static MACHINE_CONFIG_START( cninjabl, cninja_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -1069,7 +1062,6 @@ static MACHINE_CONFIG_START( cninjabl, cninja_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -1125,7 +1117,6 @@ static MACHINE_CONFIG_START( edrandy, cninja_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -1141,13 +1132,11 @@ static MACHINE_CONFIG_START( edrandy, cninja_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO146_ADD("ioprot") @@ -1213,7 +1202,6 @@ static MACHINE_CONFIG_START( robocop2, cninja_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -1229,13 +1217,11 @@ static MACHINE_CONFIG_START( robocop2, cninja_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO146_ADD("ioprot") MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR @@ -1307,7 +1293,6 @@ static MACHINE_CONFIG_START( mutantf, cninja_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -1323,17 +1308,14 @@ static MACHINE_CONFIG_START( mutantf, cninja_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(4) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO146_ADD("ioprot") diff --git a/src/mame/drivers/cobra.cpp b/src/mame/drivers/cobra.cpp index 30fc021028b..113498dd03f 100644 --- a/src/mame/drivers/cobra.cpp +++ b/src/mame/drivers/cobra.cpp @@ -3302,15 +3302,11 @@ static MACHINE_CONFIG_START( cobra, cobra_state ) MCFG_M48T58_ADD("m48t58") - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) MCFG_DEVICE_ADD("k001604", K001604, 0) // on the LAN board in Racing Jam DX - MCFG_K001604_GFX_INDEX1(0) - MCFG_K001604_GFX_INDEX2(1) MCFG_K001604_LAYER_SIZE(0) MCFG_K001604_ROZ_SIZE(1) MCFG_K001604_TXT_OFFSET(0) // correct? MCFG_K001604_ROZ_OFFSET(0) // correct? - MCFG_K001604_GFXDECODE("gfxdecode") MCFG_K001604_PALETTE("palette") MCFG_DEVICE_ADD("cobra_jvs_host", COBRA_JVS_HOST, 4000000) diff --git a/src/mame/drivers/crospang.cpp b/src/mame/drivers/crospang.cpp index 1cdd1ff9f83..19a999466f7 100644 --- a/src/mame/drivers/crospang.cpp +++ b/src/mame/drivers/crospang.cpp @@ -360,7 +360,6 @@ static MACHINE_CONFIG_START( crospang, crospang_state ) MCFG_DECO_SPRITE_ISBOOTLEG(true) MCFG_DECO_SPRITE_OFFSETS(5, 7) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") /* sound hardware */ diff --git a/src/mame/drivers/crshrace.cpp b/src/mame/drivers/crshrace.cpp index 7cc33cf93a2..49a7ba67639 100644 --- a/src/mame/drivers/crshrace.cpp +++ b/src/mame/drivers/crshrace.cpp @@ -455,7 +455,6 @@ static MACHINE_CONFIG_START( crshrace, crshrace_state ) MCFG_VSYSTEM_SPR_SET_TILE_INDIRECT( crshrace_state, crshrace_tile_callback ) MCFG_VSYSTEM_SPR_SET_GFXREGION(2) MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR_PALETTE("palette") MCFG_BUFFERED_SPRITERAM16_ADD("spriteram") MCFG_BUFFERED_SPRITERAM16_ADD("spriteram2") diff --git a/src/mame/drivers/darius.cpp b/src/mame/drivers/darius.cpp index aa8734d4c01..4026a85fde3 100644 --- a/src/mame/drivers/darius.cpp +++ b/src/mame/drivers/darius.cpp @@ -801,7 +801,6 @@ static MACHINE_CONFIG_START( darius, darius_state ) MCFG_PC080SN_YINVERT(0) MCFG_PC080SN_DBLWIDTH(1) MCFG_PC080SN_GFXDECODE("gfxdecode") - MCFG_PC080SN_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") diff --git a/src/mame/drivers/darkseal.cpp b/src/mame/drivers/darkseal.cpp index c652fee62a2..7c48821b591 100644 --- a/src/mame/drivers/darkseal.cpp +++ b/src/mame/drivers/darkseal.cpp @@ -260,7 +260,6 @@ static MACHINE_CONFIG_START( darkseal, darkseal_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -274,12 +273,10 @@ static MACHINE_CONFIG_START( darkseal, darkseal_state ) MCFG_DECO16IC_PF12_8X8_BANK(2) MCFG_DECO16IC_PF12_16X16_BANK(3) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(4) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") /* sound hardware */ diff --git a/src/mame/drivers/dassault.cpp b/src/mame/drivers/dassault.cpp index 5df8e0e002c..41d26bed464 100644 --- a/src/mame/drivers/dassault.cpp +++ b/src/mame/drivers/dassault.cpp @@ -584,7 +584,6 @@ static MACHINE_CONFIG_START( dassault, dassault_state ) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -601,17 +600,14 @@ static MACHINE_CONFIG_START( dassault, dassault_state ) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(4) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") /* sound hardware */ diff --git a/src/mame/drivers/dblewing.cpp b/src/mame/drivers/dblewing.cpp index 9076254e457..161dcd7d4fe 100644 --- a/src/mame/drivers/dblewing.cpp +++ b/src/mame/drivers/dblewing.cpp @@ -403,13 +403,11 @@ static MACHINE_CONFIG_START( dblewing, dblewing_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(2) MCFG_DECO_SPRITE_PRIORITY_CB(dblewing_state, pri_callback) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO104_ADD("ioprot104") MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE diff --git a/src/mame/drivers/dbz.cpp b/src/mame/drivers/dbz.cpp index 6372c089fb1..c23e895dc27 100644 --- a/src/mame/drivers/dbz.cpp +++ b/src/mame/drivers/dbz.cpp @@ -346,14 +346,12 @@ static MACHINE_CONFIG_START( dbz, dbz_state ) MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(dbz_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", 2, K056832_BPP_4, 1, 1, "none") - MCFG_K056832_GFXDECODE("gfxdecode") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 1, "none") MCFG_K056832_PALETTE("palette") MCFG_DEVICE_ADD("k053246", K053246, 0) MCFG_K053246_CB(dbz_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", 3, NORMAL_PLANE_ORDER, -87, 32) // or -52, 16? - MCFG_K053246_GFXDECODE("gfxdecode") + MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -87, 32) // or -52, 16? MCFG_K053246_PALETTE("palette") MCFG_K053251_ADD("k053251") diff --git a/src/mame/drivers/dec0.cpp b/src/mame/drivers/dec0.cpp index 0c8bba5ffb1..8f30e7b5b98 100644 --- a/src/mame/drivers/dec0.cpp +++ b/src/mame/drivers/dec0.cpp @@ -1291,19 +1291,18 @@ static MACHINE_CONFIG_START( dec0_base, dec0_state ) MCFG_PALETTE_ADD("palette", 1024) MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,0,0,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 0, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,0,1,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 1, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("tilegen3", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,0,2,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 2, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) - deco_mxc06_device::set_gfx_region(*device, 3); + MCFG_DECO_MXC06_GFX_REGION(3) MCFG_DECO_MXC06_GFXDECODE("gfxdecode") - MCFG_DECO_MXC06_PALETTE("palette") MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( dec0, dec0_base ) @@ -1405,19 +1404,18 @@ static MACHINE_CONFIG_START( automat, dec0_automat_state ) MCFG_SCREEN_PALETTE("palette") MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,0,0,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 0, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,0,1,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 1, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("tilegen3", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,0,2,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 2, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) - deco_mxc06_device::set_gfx_region(*device, 3); + MCFG_DECO_MXC06_GFX_REGION(3) MCFG_DECO_MXC06_GFXDECODE("gfxdecode") - MCFG_DECO_MXC06_PALETTE("palette") MCFG_PALETTE_ADD("palette", 1024) MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) @@ -1467,19 +1465,18 @@ static MACHINE_CONFIG_START( secretab, dec0_automat_state ) MCFG_SCREEN_PALETTE("palette") MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,0,0,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 0, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,0,1,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 1, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("tilegen3", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,0,2,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 2, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) - deco_mxc06_device::set_gfx_region(*device, 3); + MCFG_DECO_MXC06_GFX_REGION(3) MCFG_DECO_MXC06_GFXDECODE("gfxdecode") - MCFG_DECO_MXC06_PALETTE("palette") MCFG_PALETTE_ADD("palette", 1024) MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) diff --git a/src/mame/drivers/dec8.cpp b/src/mame/drivers/dec8.cpp index f9fe92ef5c9..26abe657ca1 100644 --- a/src/mame/drivers/dec8.cpp +++ b/src/mame/drivers/dec8.cpp @@ -2002,9 +2002,8 @@ static MACHINE_CONFIG_START( lastmisn, dec8_state ) MCFG_BUFFERED_SPRITERAM8_ADD("spriteram") MCFG_DEVICE_ADD("spritegen_krn", DECO_KARNOVSPRITES, 0) - deco_karnovsprites_device::set_gfx_region(*device, 1); + MCFG_DECO_KARNOVSPRITES_GFX_REGION(1) MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode") - MCFG_DECO_KARNOVSPRITES_PALETTE("palette") MCFG_SCREEN_ADD("screen", RASTER) // MCFG_SCREEN_REFRESH_RATE(58) @@ -2055,9 +2054,8 @@ static MACHINE_CONFIG_START( shackled, dec8_state ) MCFG_BUFFERED_SPRITERAM8_ADD("spriteram") MCFG_DEVICE_ADD("spritegen_krn", DECO_KARNOVSPRITES, 0) - deco_karnovsprites_device::set_gfx_region(*device, 1); + MCFG_DECO_KARNOVSPRITES_GFX_REGION(1) MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode") - MCFG_DECO_KARNOVSPRITES_PALETTE("palette") MCFG_SCREEN_ADD("screen", RASTER) // MCFG_SCREEN_REFRESH_RATE(58) @@ -2107,9 +2105,8 @@ static MACHINE_CONFIG_START( gondo, dec8_state ) MCFG_BUFFERED_SPRITERAM8_ADD("spriteram") MCFG_DEVICE_ADD("spritegen_krn", DECO_KARNOVSPRITES, 0) - deco_karnovsprites_device::set_gfx_region(*device, 1); + MCFG_DECO_KARNOVSPRITES_GFX_REGION(1) MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode") - MCFG_DECO_KARNOVSPRITES_PALETTE("palette") MCFG_SCREEN_ADD("screen", RASTER) // MCFG_SCREEN_REFRESH_RATE(58) @@ -2160,9 +2157,8 @@ static MACHINE_CONFIG_START( garyoret, dec8_state ) MCFG_BUFFERED_SPRITERAM8_ADD("spriteram") MCFG_DEVICE_ADD("spritegen_krn", DECO_KARNOVSPRITES, 0) - deco_karnovsprites_device::set_gfx_region(*device, 1); + MCFG_DECO_KARNOVSPRITES_GFX_REGION(1) MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode") - MCFG_DECO_KARNOVSPRITES_PALETTE("palette") MCFG_SCREEN_ADD("screen", RASTER) // MCFG_SCREEN_REFRESH_RATE(58) @@ -2213,13 +2209,12 @@ static MACHINE_CONFIG_START( ghostb, dec8_state ) MCFG_BUFFERED_SPRITERAM8_ADD("spriteram") MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,2,2,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(2, 2, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("spritegen_krn", DECO_KARNOVSPRITES, 0) - deco_karnovsprites_device::set_gfx_region(*device, 1); + MCFG_DECO_KARNOVSPRITES_GFX_REGION(1) MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode") - MCFG_DECO_KARNOVSPRITES_PALETTE("palette") MCFG_SCREEN_ADD("screen", RASTER) // MCFG_SCREEN_REFRESH_RATE(58) @@ -2277,9 +2272,8 @@ static MACHINE_CONFIG_START( csilver, dec8_state ) MCFG_BUFFERED_SPRITERAM8_ADD("spriteram") MCFG_DEVICE_ADD("spritegen_krn", DECO_KARNOVSPRITES, 0) - deco_karnovsprites_device::set_gfx_region(*device, 1); + MCFG_DECO_KARNOVSPRITES_GFX_REGION(1) MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode") - MCFG_DECO_KARNOVSPRITES_PALETTE("palette") MCFG_SCREEN_ADD("screen", RASTER) // MCFG_SCREEN_REFRESH_RATE(58) @@ -2335,13 +2329,12 @@ static MACHINE_CONFIG_START( oscar, dec8_state ) MCFG_BUFFERED_SPRITERAM8_ADD("spriteram") MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,2,2,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(2, 2, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("spritegen_mxc", DECO_MXC06, 0) - deco_mxc06_device::set_gfx_region(*device, 1); + MCFG_DECO_MXC06_GFX_REGION(1) MCFG_DECO_MXC06_GFXDECODE("gfxdecode") - MCFG_DECO_MXC06_PALETTE("palette") MCFG_SCREEN_ADD("screen", RASTER) // MCFG_SCREEN_REFRESH_RATE(58) @@ -2432,16 +2425,15 @@ static MACHINE_CONFIG_START( cobracom, dec8_state ) MCFG_BUFFERED_SPRITERAM8_ADD("spriteram") MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,2,2,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(2, 2, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,3,3,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(3, 3, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("spritegen_mxc", DECO_MXC06, 0) - deco_mxc06_device::set_gfx_region(*device, 1); + MCFG_DECO_MXC06_GFX_REGION(1) MCFG_DECO_MXC06_GFXDECODE("gfxdecode") - MCFG_DECO_MXC06_PALETTE("palette") MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/deco156.cpp b/src/mame/drivers/deco156.cpp index b8ab102bee1..410f79504ee 100644 --- a/src/mame/drivers/deco156.cpp +++ b/src/mame/drivers/deco156.cpp @@ -369,13 +369,11 @@ static MACHINE_CONFIG_START( hvysmsh, deco156_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(2) MCFG_DECO_SPRITE_PRIORITY_CB(deco156_state, pri_callback) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -422,13 +420,11 @@ static MACHINE_CONFIG_START( wcvol95, deco156_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(2) MCFG_DECO_SPRITE_PRIORITY_CB(deco156_state, pri_callback) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") diff --git a/src/mame/drivers/deco32.cpp b/src/mame/drivers/deco32.cpp index d8f77543f26..f4788a4b954 100644 --- a/src/mame/drivers/deco32.cpp +++ b/src/mame/drivers/deco32.cpp @@ -1840,7 +1840,6 @@ static MACHINE_CONFIG_START( captaven, deco32_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) // pf3 is in 8bpp mode, pf4 is not used MCFG_DECO16IC_SPLIT(0) @@ -1856,13 +1855,11 @@ static MACHINE_CONFIG_START( captaven, deco32_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_PRIORITY_CB(deco32_state, captaven_pri_callback) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO146_ADD("ioprot") MCFG_DECO146_SET_SOUNDLATCH_CALLBACK(deco32_state, deco32_sound_cb) @@ -1946,7 +1943,6 @@ static MACHINE_CONFIG_START( fghthist, deco32_state ) /* DE-0380-2 PCB */ MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -1962,12 +1958,10 @@ static MACHINE_CONFIG_START( fghthist, deco32_state ) /* DE-0380-2 PCB */ MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO146_ADD("ioprot") MCFG_DECO146_SET_PORTA_CALLBACK( deco32_state, port_a_fghthist ) @@ -2032,7 +2026,6 @@ static MACHINE_CONFIG_START( fghthsta, deco32_state ) /* DE-0395-1 PCB */ MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -2048,12 +2041,10 @@ static MACHINE_CONFIG_START( fghthsta, deco32_state ) /* DE-0395-1 PCB */ MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO146_ADD("ioprot") MCFG_DECO146_SET_PORTA_CALLBACK( deco32_state, port_a_fghthist ) @@ -2160,7 +2151,6 @@ static MACHINE_CONFIG_START( dragngun, dragngun_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -2176,11 +2166,9 @@ static MACHINE_CONFIG_START( dragngun, dragngun_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen_zoom", DECO_ZOOMSPR, 0) MCFG_DECO_ZOOMSPR_GFXDECODE("gfxdecode") - MCFG_DECO_ZOOMSPR_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", dragngun) MCFG_PALETTE_ADD("palette", 2048) @@ -2278,7 +2266,6 @@ static MACHINE_CONFIG_START( lockload, dragngun_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -2294,11 +2281,9 @@ static MACHINE_CONFIG_START( lockload, dragngun_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen_zoom", DECO_ZOOMSPR, 0) MCFG_DECO_ZOOMSPR_GFXDECODE("gfxdecode") - MCFG_DECO_ZOOMSPR_PALETTE("palette") MCFG_DECO146_ADD("ioprot") MCFG_DECO146_SET_SOUNDLATCH_CALLBACK(deco32_state, deco32_sound_cb) @@ -2367,7 +2352,6 @@ static MACHINE_CONFIG_START( tattass, deco32_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -2383,17 +2367,14 @@ static MACHINE_CONFIG_START( tattass, deco32_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(4) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", tattass) MCFG_PALETTE_ADD("palette", 2048) @@ -2444,7 +2425,6 @@ static MACHINE_CONFIG_START( nslasher, deco32_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -2460,17 +2440,14 @@ static MACHINE_CONFIG_START( nslasher, deco32_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(4) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", nslasher) MCFG_PALETTE_ADD("palette", 2048) diff --git a/src/mame/drivers/dfruit.cpp b/src/mame/drivers/dfruit.cpp index 20e459a2b3d..c2097280503 100644 --- a/src/mame/drivers/dfruit.cpp +++ b/src/mame/drivers/dfruit.cpp @@ -387,7 +387,6 @@ static MACHINE_CONFIG_START( dfruit, dfruit_state ) MCFG_DEVICE_ADD("tc0091lvc", TC0091LVC, 0) MCFG_TC0091LVC_GFXDECODE("gfxdecode") - MCFG_TC0091LVC_PALETTE("palette") MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0) MCFG_I8255_IN_PORTA_CB(IOPORT("IN0")) diff --git a/src/mame/drivers/dietgo.cpp b/src/mame/drivers/dietgo.cpp index e2c8df4e31b..5e8954d705b 100644 --- a/src/mame/drivers/dietgo.cpp +++ b/src/mame/drivers/dietgo.cpp @@ -245,12 +245,10 @@ static MACHINE_CONFIG_START( dietgo, dietgo_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(2) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO104_ADD("ioprot104") MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE diff --git a/src/mame/drivers/djboy.cpp b/src/mame/drivers/djboy.cpp index ae0efeed0ee..bbd3eb25706 100644 --- a/src/mame/drivers/djboy.cpp +++ b/src/mame/drivers/djboy.cpp @@ -581,7 +581,6 @@ static MACHINE_CONFIG_START( djboy, djboy_state ) MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0) MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode") - MCFG_KANEKO_PANDORA_PALETTE("palette") MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/djmain.cpp b/src/mame/drivers/djmain.cpp index 3037b06723c..efa5c7ed4d8 100644 --- a/src/mame/drivers/djmain.cpp +++ b/src/mame/drivers/djmain.cpp @@ -1403,8 +1403,7 @@ static MACHINE_CONFIG_START( djmainj, djmain_state ) MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(djmain_state, tile_callback) - MCFG_K056832_CONFIG("gfx2", 1, K056832_BPP_4dj, 1, 1, "none") - MCFG_K056832_GFXDECODE("gfxdecode") + MCFG_K056832_CONFIG("gfx2", K056832_BPP_4dj, 1, 1, "none") MCFG_K056832_PALETTE("palette") MCFG_K055555_ADD("k055555") diff --git a/src/mame/drivers/dreambal.cpp b/src/mame/drivers/dreambal.cpp index 19516ea4123..727e82ac03c 100644 --- a/src/mame/drivers/dreambal.cpp +++ b/src/mame/drivers/dreambal.cpp @@ -340,7 +340,6 @@ static MACHINE_CONFIG_START( dreambal, dreambal_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/esd16.cpp b/src/mame/drivers/esd16.cpp index 01f12b0de2b..912e811ac4e 100644 --- a/src/mame/drivers/esd16.cpp +++ b/src/mame/drivers/esd16.cpp @@ -632,7 +632,6 @@ static MACHINE_CONFIG_START( esd16, esd16_state ) MCFG_DECO_SPRITE_PRIORITY_CB(esd16_state, hedpanic_pri_callback) MCFG_DECO_SPRITE_FLIPALLX(1) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", esd16) MCFG_PALETTE_ADD("palette", 0x1000/2) diff --git a/src/mame/drivers/f1gp.cpp b/src/mame/drivers/f1gp.cpp index d6bf1eee619..f60b0ca1633 100644 --- a/src/mame/drivers/f1gp.cpp +++ b/src/mame/drivers/f1gp.cpp @@ -432,14 +432,12 @@ static MACHINE_CONFIG_START( f1gp, f1gp_state ) MCFG_VSYSTEM_SPR2_SET_GFXREGION(1) MCFG_VSYSTEM_SPR2_SET_PRITYPE(2) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") MCFG_DEVICE_ADD("vsystem_spr_ol2", VSYSTEM_SPR2, 0) MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( f1gp_state, f1gp_ol2_tile_callback ) MCFG_VSYSTEM_SPR2_SET_GFXREGION(2) MCFG_VSYSTEM_SPR2_SET_PRITYPE(2) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(f1gp_state,f1gp) @@ -516,7 +514,6 @@ static MACHINE_CONFIG_DERIVED( f1gp2, f1gp ) MCFG_VSYSTEM_SPR_SET_TILE_INDIRECT( f1gp_state, f1gp2_tile_callback ) MCFG_VSYSTEM_SPR_SET_GFXREGION(1) MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR_PALETTE("palette") MCFG_DEVICE_MODIFY("k053936") MCFG_K053936_OFFSETS(-48, -21) diff --git a/src/mame/drivers/fb01.cpp b/src/mame/drivers/fb01.cpp index b45fbe6f036..99fc222d7ca 100644 --- a/src/mame/drivers/fb01.cpp +++ b/src/mame/drivers/fb01.cpp @@ -219,7 +219,7 @@ MACHINE_CONFIG_END /* ROM definition */ ROM_START( fb01 ) ROM_REGION( 0x8000, "maincpu", 0 ) - ROM_LOAD("fb01.ic11", 0, 0x8000, CRC(7357e9a4) SHA1(049c482d6c91b7e2846757dd0f5138e0d8b687f0)) + ROM_LOAD("nec__-011_xb712c0__8709ex700__d27c256c-15.ic11", 0, 0x8000, CRC(7357e9a4) SHA1(049c482d6c91b7e2846757dd0f5138e0d8b687f0)) // OTP 27c256 windowless eprom? ROM_END diff --git a/src/mame/drivers/funkyjet.cpp b/src/mame/drivers/funkyjet.cpp index a9cacb720c6..a3c2a47599a 100644 --- a/src/mame/drivers/funkyjet.cpp +++ b/src/mame/drivers/funkyjet.cpp @@ -346,12 +346,10 @@ static MACHINE_CONFIG_START( funkyjet, funkyjet_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(2) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") diff --git a/src/mame/drivers/galastrm.cpp b/src/mame/drivers/galastrm.cpp index 796b3130948..4ca8366e984 100644 --- a/src/mame/drivers/galastrm.cpp +++ b/src/mame/drivers/galastrm.cpp @@ -311,7 +311,6 @@ static MACHINE_CONFIG_START( galastrm, galastrm_state ) MCFG_TC0480SCP_TX_REGION(3) MCFG_TC0480SCP_OFFSETS(-40, -3) MCFG_TC0480SCP_GFXDECODE("gfxdecode") - MCFG_TC0480SCP_PALETTE("palette") /* sound hardware */ MCFG_DEVICE_ADD("taito_en", TAITO_EN, 0) diff --git a/src/mame/drivers/galaxian.cpp b/src/mame/drivers/galaxian.cpp index 0ec73f982b8..996b508bd19 100644 --- a/src/mame/drivers/galaxian.cpp +++ b/src/mame/drivers/galaxian.cpp @@ -2210,6 +2210,36 @@ static INPUT_PORTS_START( swarm ) PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) /* more aliens */ INPUT_PORTS_END +static INPUT_PORTS_START( kamikazp ) + PORT_INCLUDE(galaxian) + + PORT_MODIFY("IN1") + PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Bonus_Life ) ) // turning both of these on still seems to enable Free Play but actual coinage controlled by later dips? + PORT_DIPSETTING( 0x00, DEF_STR( None ) ) + PORT_DIPSETTING( 0x40, "4000" ) + PORT_DIPSETTING( 0x80, "5000" ) + PORT_DIPSETTING( 0xc0, "7000 (buggy FREE PLAY message)" ) // also still causes the game to show 'FREE PLAY' which is the function of the old dips (doesn't operate in FREE PLAY tho) + + PORT_MODIFY("IN2") // actual coinage appers to have been moved here (need to check code, wouldn't surprise me if some of these had other side-effects too) these are also some of the most ridiculous coinage setttings I've seen! + PORT_DIPNAME( 0x0f, 0x08, DEF_STR( Coinage ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x07, "6C / 2C" ) // first 4 coins give 1 credit, next 2 coins give 1 credit + PORT_DIPSETTING( 0x0c, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x03, "6C / 3C" ) // first 3 coins give 1 credit, 2nd 3 coins give 2 credits + PORT_DIPSETTING( 0x0b, "7C / 3C" ) + PORT_DIPSETTING( 0x0d, DEF_STR( 4C_2C ) ) // first 3 coins give 1 credit, next coin gives 1 credit + PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) ) // 2 + PORT_DIPSETTING( 0x09, DEF_STR( 3C_2C ) ) // first 2 coins give 1 credit, next coin gives 1 credit + PORT_DIPSETTING( 0x05, DEF_STR( 4C_3C ) ) // first 2 coins give 1 credit, 2nd 2 coins give 2 credits + PORT_DIPSETTING( 0x08, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x06, "1C / 1C (duplicate 1)" ) + PORT_DIPSETTING( 0x0a, "1C / 1C (duplicate 2)" ) + PORT_DIPSETTING( 0x0e, "1C / 1C (duplicate 3)" ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 2C_3C ) ) // .66 + PORT_DIPSETTING( 0x0f, DEF_STR( Free_Play ) ) // always shows 9 credits +INPUT_PORTS_END + static INPUT_PORTS_START( zerotime ) PORT_INCLUDE(galaxian) @@ -7316,6 +7346,23 @@ ROM_START( moonaln ) ROM_LOAD( "6l.bpr", 0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) ) ROM_END +ROM_START( kamikazp ) + ROM_REGION( 0x4000, "maincpu", 0 ) + ROM_LOAD( "KK1PMC.bin", 0x0000, 0x0800, CRC(4a29bbe4) SHA1(731e77d76420ab946fb3963681770c81f79c705d) ) + ROM_LOAD( "KK2PMC.bin", 0x0800, 0x0800, CRC(65c57131) SHA1(6884421b1ee74e6913ceb519b29979cf764ee3f7) ) + ROM_LOAD( "KK3PMC.bin", 0x1000, 0x0800, CRC(24cf6da0) SHA1(1d6c6d3e8af4f3da449b363eb710c3a42f1dfb64) ) + ROM_LOAD( "KK4PMC.bin", 0x1800, 0x0800, CRC(5e5ebca8) SHA1(f4f1c4f180a46fed67bb05d9b61c98a556645e7a) ) + ROM_LOAD( "KK5PMC.bin", 0x2000, 0x0800, CRC(6d325b14) SHA1(2f67db374976cfa1dee3d6136a4b0404db7870f6) ) + ROM_LOAD( "KK6PMC.bin", 0x2800, 0x0800, CRC(05883c29) SHA1(22a4e6ce5e35d4ddea4d1b583a36b4a64a899159) ) + + ROM_REGION( 0x1000, "gfx1", 0 ) + ROM_LOAD( "KK8PMC.bin", 0x0000, 0x0800, CRC(96b268b1) SHA1(3ad1fa972f8f841e26acd7e3363f42df898d01c6) ) + ROM_LOAD( "KK7PMC.bin", 0x0800, 0x0800, CRC(58673a07) SHA1(4e51f803718f39436e43d3bceda836215a98cc37) ) + + ROM_REGION( 0x0020, "proms", 0 ) + ROM_LOAD( "prom.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) // not dumped, taken from Astrians, colours match screenshots +ROM_END + ROM_START( superg ) ROM_REGION( 0x4000, "maincpu", 0 ) ROM_LOAD( "7f.bin", 0x0000, 0x1000, CRC(4335b1de) SHA1(e41e3d90dac738cf71377f3b476ec67b14dee27a) ) @@ -11331,6 +11378,8 @@ GAME( 1980, galaxrfgg, galaxian, galaxian, galaxrf, galaxian_state, galax // these have the extra 'linescroll effect' title screens, like Moon Alien 2 but made out of a random tile, they lack an energy bar. GAME( 1979, moonaln, galaxian, galaxian, superg, galaxian_state, galaxian, ROT90, "Namco / Nichibutsu (Karateco license?)", "Moon Alien", MACHINE_SUPPORTS_SAVE ) // or bootleg? GAME( 1979, galapx, galaxian, galaxian, superg, galaxian_state, galaxian, ROT90, "hack", "Galaxian Part X (moonaln hack)", MACHINE_SUPPORTS_SAVE ) +// like above but does have the energy bar, also GFX changed to planes. +GAME( 1979, kamikazp, galaxian, galaxian, kamikazp, galaxian_state, galaxian, ROT90, "bootleg (Potomac Games)", "Kamikaze (Potomac Games)", MACHINE_SUPPORTS_SAVE ) // this has the tiles to display the energy bar, but use the flag gfx for the 'linescroll effect' title screen, also doesn't work due to bad rom. GAME( 1980, supergx, galaxian, galaxian, superg, galaxian_state, galaxian, ROT90, "Namco / Nichibutsu", "Super GX", MACHINE_NOT_WORKING | MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // these have the energy bar, and the tiles needed to display a less corrupt 'linescroll effect' title, but don't display one diff --git a/src/mame/drivers/galpanic.cpp b/src/mame/drivers/galpanic.cpp index 1f9c349de33..9c355309e77 100644 --- a/src/mame/drivers/galpanic.cpp +++ b/src/mame/drivers/galpanic.cpp @@ -248,7 +248,6 @@ static MACHINE_CONFIG_START( galpanic, galpanic_state ) MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0) MCFG_KANEKO_PANDORA_OFFSETS(0, -16) MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode") - MCFG_KANEKO_PANDORA_PALETTE("palette") MCFG_DEVICE_ADD("calc1_mcu", KANEKO_HIT, 0) kaneko_hit_device::set_type(*device, 0); diff --git a/src/mame/drivers/gba.cpp b/src/mame/drivers/gba.cpp index f2c05930332..9b39f18f1b2 100644 --- a/src/mame/drivers/gba.cpp +++ b/src/mame/drivers/gba.cpp @@ -1926,7 +1926,7 @@ ADDRESS_MAP_END static INPUT_PORTS_START( gbadv ) PORT_START("INPUTS") - PORT_BIT( 0xfc00, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_UNUSED + PORT_BIT( 0xfc00, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 L") PORT_PLAYER(1) // L PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 R") PORT_PLAYER(1) // R PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) diff --git a/src/mame/drivers/geneve.cpp b/src/mame/drivers/geneve.cpp index 8d413333bbd..bcf8acee880 100644 --- a/src/mame/drivers/geneve.cpp +++ b/src/mame/drivers/geneve.cpp @@ -210,7 +210,6 @@ #include "sound/sn76496.h" #include "bus/ti99x/genboard.h" -#include "bus/ti99x/videowrp.h" #include "bus/ti99x/joyport.h" #include "bus/ti99_peb/peribox.h" @@ -690,8 +689,7 @@ static MACHINE_CONFIG_START( geneve_60hz, geneve_state ) MCFG_TMS9995_CLKOUT_HANDLER( WRITELINE(geneve_state, clock_out) ) MCFG_TMS9995_DBIN_HANDLER( WRITELINE(geneve_state, dbin_line) ) - // video hardware - MCFG_DEVICE_ADD(VIDEO_SYSTEM_TAG, V9938VIDEO, 0) + // Video hardware MCFG_V9938_ADD(VDP_TAG, SCREEN_TAG, 0x20000, XTAL_21_4772MHz) /* typical 9938 clock, not verified */ MCFG_V99X8_INTERRUPT_CALLBACK(WRITELINE(geneve_state, set_tms9901_INT2_from_v9938)) MCFG_V99X8_SCREEN_ADD_NTSC(SCREEN_TAG, VDP_TAG, XTAL_21_4772MHz) @@ -726,9 +724,11 @@ static MACHINE_CONFIG_START( geneve_60hz, geneve_state ) MCFG_PERIBOX_INTB_HANDLER( WRITELINE(geneve_state, intb) ) MCFG_PERIBOX_READY_HANDLER( WRITELINE(geneve_state, ext_ready) ) - // sound hardware - MCFG_TI_SOUND_76496_ADD( TISOUND_TAG ) - MCFG_TI_SOUND_READY_HANDLER( WRITELINE(geneve_state, ext_ready) ) + // Sound hardware + MCFG_SPEAKER_STANDARD_MONO("sound_out") + MCFG_SOUND_ADD(TISOUNDCHIP_TAG, SN76496, 3579545) /* 3.579545 MHz */ + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "sound_out", 0.75) + MCFG_SN76496_READY_HANDLER( WRITELINE(geneve_state, ext_ready) ) // User interface devices MCFG_DEVICE_ADD( GKEYBOARD_TAG, GENEVE_KEYBOARD, 0 ) diff --git a/src/mame/drivers/gijoe.cpp b/src/mame/drivers/gijoe.cpp index 8556742921f..80a0d830c87 100644 --- a/src/mame/drivers/gijoe.cpp +++ b/src/mame/drivers/gijoe.cpp @@ -329,18 +329,14 @@ static MACHINE_CONFIG_START( gijoe, gijoe_state ) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(gijoe_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_4, 1, 0, "none") - MCFG_K056832_GFXDECODE("gfxdecode") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0, "none") MCFG_K056832_PALETTE("palette") MCFG_DEVICE_ADD("k053246", K053246, 0) MCFG_K053246_CB(gijoe_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, -37, 20) - MCFG_K053246_GFXDECODE("gfxdecode") + MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -37, 20) MCFG_K053246_PALETTE("palette") MCFG_K053251_ADD("k053251") diff --git a/src/mame/drivers/gotcha.cpp b/src/mame/drivers/gotcha.cpp index 11c96bcdb0b..afb5540c576 100644 --- a/src/mame/drivers/gotcha.cpp +++ b/src/mame/drivers/gotcha.cpp @@ -287,7 +287,6 @@ static MACHINE_CONFIG_START( gotcha, gotcha_state ) MCFG_DECO_SPRITE_ISBOOTLEG(true) MCFG_DECO_SPRITE_OFFSETS(5, -1) // aligned to 2nd instruction screen in attract MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/groundfx.cpp b/src/mame/drivers/groundfx.cpp index ff6d31a6870..e3e0c652ef7 100644 --- a/src/mame/drivers/groundfx.cpp +++ b/src/mame/drivers/groundfx.cpp @@ -344,7 +344,6 @@ static MACHINE_CONFIG_START( groundfx, groundfx_state ) MCFG_TC0480SCP_OFFSETS(0x24, 0) MCFG_TC0480SCP_OFFSETS_TX(-1, 0) MCFG_TC0480SCP_GFXDECODE("gfxdecode") - MCFG_TC0480SCP_PALETTE("palette") /* sound hardware */ MCFG_DEVICE_ADD("taito_en", TAITO_EN, 0) diff --git a/src/mame/drivers/gstriker.cpp b/src/mame/drivers/gstriker.cpp index 200cac43623..ca2ad772f7f 100644 --- a/src/mame/drivers/gstriker.cpp +++ b/src/mame/drivers/gstriker.cpp @@ -546,7 +546,6 @@ static MACHINE_CONFIG_START( gstriker, gstriker_state ) MCFG_VSYSTEM_SPR_SET_PALMASK(0x1f) MCFG_VSYSTEM_SPR_SET_TRANSPEN(0) MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR_PALETTE("palette") MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") diff --git a/src/mame/drivers/gticlub.cpp b/src/mame/drivers/gticlub.cpp index e9cbb5e37a5..91eedfcdf83 100644 --- a/src/mame/drivers/gticlub.cpp +++ b/src/mame/drivers/gticlub.cpp @@ -973,15 +973,11 @@ static MACHINE_CONFIG_START( gticlub, gticlub_state ) MCFG_VIDEO_START_OVERRIDE(gticlub_state,gticlub) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) MCFG_DEVICE_ADD("k001604_1", K001604, 0) - MCFG_K001604_GFX_INDEX1(1) - MCFG_K001604_GFX_INDEX2(2) MCFG_K001604_LAYER_SIZE(1) MCFG_K001604_ROZ_SIZE(1) MCFG_K001604_TXT_OFFSET(0) MCFG_K001604_ROZ_OFFSET(0) - MCFG_K001604_GFXDECODE("gfxdecode") MCFG_K001604_PALETTE("palette") MCFG_DEVICE_ADD("k001005", K001005, 0) @@ -1031,13 +1027,10 @@ static MACHINE_CONFIG_DERIVED( slrasslt, gticlub ) MCFG_DEVICE_REMOVE("k001604_1") MCFG_DEVICE_ADD("k001604_1", K001604, 0) - MCFG_K001604_GFX_INDEX1(1) - MCFG_K001604_GFX_INDEX2(2) MCFG_K001604_LAYER_SIZE(0) MCFG_K001604_ROZ_SIZE(0) MCFG_K001604_TXT_OFFSET(16384) MCFG_K001604_ROZ_OFFSET(0) - MCFG_K001604_GFXDECODE("gfxdecode") MCFG_K001604_PALETTE("palette") MACHINE_CONFIG_END @@ -1113,26 +1106,18 @@ static MACHINE_CONFIG_START( hangplt, gticlub_state ) MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 383) MCFG_SCREEN_UPDATE_DRIVER(gticlub_state, screen_update_hangplt) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k001604_1", K001604, 0) - MCFG_K001604_GFX_INDEX1(1) - MCFG_K001604_GFX_INDEX2(2) MCFG_K001604_LAYER_SIZE(0) MCFG_K001604_ROZ_SIZE(1) MCFG_K001604_TXT_OFFSET(0) MCFG_K001604_ROZ_OFFSET(16384) - MCFG_K001604_GFXDECODE("gfxdecode") MCFG_K001604_PALETTE("palette") MCFG_DEVICE_ADD("k001604_2", K001604, 0) - MCFG_K001604_GFX_INDEX1(3) - MCFG_K001604_GFX_INDEX2(4) MCFG_K001604_LAYER_SIZE(0) MCFG_K001604_ROZ_SIZE(1) MCFG_K001604_TXT_OFFSET(0) MCFG_K001604_ROZ_OFFSET(16384) - MCFG_K001604_GFXDECODE("gfxdecode") MCFG_K001604_PALETTE("palette") MCFG_K056800_ADD("k056800", XTAL_33_8688MHz/2) diff --git a/src/mame/drivers/gunbustr.cpp b/src/mame/drivers/gunbustr.cpp index b4ffdf0ba70..5b1df1707db 100644 --- a/src/mame/drivers/gunbustr.cpp +++ b/src/mame/drivers/gunbustr.cpp @@ -303,7 +303,6 @@ static MACHINE_CONFIG_START( gunbustr, gunbustr_state ) MCFG_TC0480SCP_OFFSETS_TX(-1, -1) MCFG_TC0480SCP_OFFSETS_FLIP(-1, 0) MCFG_TC0480SCP_GFXDECODE("gfxdecode") - MCFG_TC0480SCP_PALETTE("palette") /* sound hardware */ MCFG_DEVICE_ADD("taito_en", TAITO_EN, 0) diff --git a/src/mame/drivers/hh_hmcs40.cpp b/src/mame/drivers/hh_hmcs40.cpp index 3bc28b5a538..6687e7f8994 100644 --- a/src/mame/drivers/hh_hmcs40.cpp +++ b/src/mame/drivers/hh_hmcs40.cpp @@ -36,7 +36,7 @@ *29 HD38800B 1984, Tomy Portable 6000 Bombman *35 HD38800B 1983, Bandai Gundam vs Gelgoog Zaku @43 HD38800B 1983, Bandai Dokodemo Dorayaki Doraemon (PT-412) - @52 HD38800B 1983, Bandai Ultra Man (PT-424) + @52 HD38800B 1983, Bandai Ultraman Monster Battle (PT-424) @09 HD38820A 1980, Mattel World Championship Baseball @13 HD38820A 1981, Entex Galaxian 2 @@ -87,6 +87,7 @@ #include "sound/speaker.h" // internal artwork +#include "rendlay.h" #include "pairmtch.lh" #include "hh_hmcs40_test.lh" // common test-layout - use external artwork @@ -1519,7 +1520,7 @@ MACHINE_CONFIG_END /*************************************************************************** - Bandai Ultra Man (FL LSI Game Push Up) (manufactured in Japan) + Bandai Ultraman Monster Battle (FL LSI Game Push Up) (manufactured in Japan) * PCB label Kaken Corp. PT-424 FL Ultra Man * Hitachi HD38800B52 MCU * cyan/red/blue VFD display NEC FIP8BM25T no. 21-8 2 @@ -1549,7 +1550,7 @@ WRITE8_MEMBER(bultrman_state::plate_w) // update display UINT8 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,18,17,16,15,14,13,12,11,2,10,9,8,7,6,5,4,3,0,1); + UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,0,18,17,16,15,14,13,12,3,11,10,9,8,7,6,5,4,1,2); display_matrix(18, 8, plate, grid); } @@ -1584,7 +1585,7 @@ INPUT_PORTS_END static MACHINE_CONFIG_START( bultrman, bultrman_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", HD38800, 400000) // approximation + MCFG_CPU_ADD("maincpu", HD38800, 350000) // approximation MCFG_HMCS40_WRITE_R_CB(0, WRITE8(bultrman_state, plate_w)) MCFG_HMCS40_WRITE_R_CB(1, WRITE8(bultrman_state, plate_w)) MCFG_HMCS40_WRITE_R_CB(2, WRITE8(bultrman_state, plate_w)) @@ -2070,7 +2071,12 @@ static MACHINE_CONFIG_START( cdkong, cdkong_state ) MCFG_TIMER_DRIVER_ADD_PERIODIC("speaker_decay", cdkong_state, speaker_decay_sim, attotime::from_msec(CDKONG_SPEAKER_DECAY)) MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) - MCFG_DEFAULT_LAYOUT(layout_hh_hmcs40_test) + + MCFG_SCREEN_SVG_ADD("screen", "svg") + MCFG_SCREEN_REFRESH_RATE(10) + MCFG_SCREEN_SIZE(538, 1001) + MCFG_SCREEN_VISIBLE_AREA(0, 537, 0, 1000) + MCFG_DEFAULT_LAYOUT(layout_svg) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -3960,6 +3966,9 @@ ROM_START( cdkong ) ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "hd38820a45", 0x0000, 0x1000, CRC(196b8070) SHA1(da85d1eb4b048b77f3168630662ab94ec9baa262) ) ROM_CONTINUE( 0x1e80, 0x0100 ) + + ROM_REGION( 714102, "svg", 0) + ROM_LOAD( "cdkong.svg", 0, 714102, CRC(184bbe69) SHA1(98554341054246e5d76e0779620498e6cb723958) ) ROM_END @@ -4093,12 +4102,12 @@ CONS( 1983, zackman, 0, 0, zackman, zackman, driver_device, 0, "Banda CONS( 1983, bpengo, 0, 0, bpengo, bpengo, driver_device, 0, "Bandai", "Pengo (Bandai)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK ) CONS( 1983, bbtime, 0, 0, bbtime, bbtime, driver_device, 0, "Bandai", "Burger Time (Bandai)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK ) CONS( 1983, bdoramon, 0, 0, bdoramon, bdoramon, driver_device, 0, "Bandai", "Dokodemo Dorayaki Doraemon", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK ) -CONS( 1983, bultrman, 0, 0, bultrman, bultrman, driver_device, 0, "Bandai", "Ultra Man (Bandai)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK | MACHINE_NOT_WORKING ) +CONS( 1983, bultrman, 0, 0, bultrman, bultrman, driver_device, 0, "Bandai", "Ultraman Monster Battle", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK ) CONS( 1984, machiman, 0, 0, machiman, machiman, driver_device, 0, "Bandai", "Machine Man", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK ) CONS( 1984, pairmtch, 0, 0, pairmtch, pairmtch, driver_device, 0, "Bandai", "Pair Match", MACHINE_SUPPORTS_SAVE ) CONS( 1981, alnattck, 0, 0, alnattck, alnattck, driver_device, 0, "Coleco", "Alien Attack", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK ) -CONS( 1982, cdkong, 0, 0, cdkong, cdkong, driver_device, 0, "Coleco", "Donkey Kong (Coleco)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK | MACHINE_IMPERFECT_SOUND ) +CONS( 1982, cdkong, 0, 0, cdkong, cdkong, driver_device, 0, "Coleco", "Donkey Kong (Coleco)", MACHINE_SUPPORTS_SAVE ) CONS( 1982, cgalaxn, 0, 0, cgalaxn, cgalaxn, driver_device, 0, "Coleco", "Galaxian (Coleco)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK | MACHINE_IMPERFECT_SOUND ) CONS( 1981, cpacman, 0, 0, cpacman, cpacman, driver_device, 0, "Coleco", "Pac-Man (Coleco, Rev. 29)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK ) CONS( 1981, cpacmanr1, cpacman, 0, cpacman, cpacman, driver_device, 0, "Coleco", "Pac-Man (Coleco, Rev. 28)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK ) diff --git a/src/mame/drivers/hh_sm510.cpp b/src/mame/drivers/hh_sm510.cpp index f7b69e23137..cf6be1c0fa9 100644 --- a/src/mame/drivers/hh_sm510.cpp +++ b/src/mame/drivers/hh_sm510.cpp @@ -295,6 +295,62 @@ MACHINE_CONFIG_END /*************************************************************************** + Konami Gradius + * Sharp SM511 under epoxy (die label KMS 73B, KMS 774) + +***************************************************************************/ + +class kgradius_state : public hh_sm510_state +{ +public: + kgradius_state(const machine_config &mconfig, device_type type, const char *tag) + : hh_sm510_state(mconfig, type, tag) + { + m_inp_lines = 2; + } +}; + +// config + +static INPUT_PORTS_START( kgradius ) + PORT_START("IN.0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_POWER_ON ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_POWER_OFF ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VOLUME_DOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) PORT_NAME("Sound") + + PORT_START("IN.1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + +static MACHINE_CONFIG_START( kgradius, kgradius_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", SM511, XTAL_32_768kHz) + MCFG_SM510_WRITE_SEGA_CB(WRITE16(hh_sm510_state, lcd_segment_w)) + MCFG_SM510_WRITE_SEGB_CB(WRITE16(hh_sm510_state, lcd_segment_w)) + MCFG_SM510_WRITE_SEGBS_CB(WRITE16(hh_sm510_state, lcd_segment_w)) + MCFG_SM510_READ_K_CB(READ8(hh_sm510_state, input_r)) + MCFG_SM510_WRITE_S_CB(WRITE8(hh_sm510_state, input_w)) + MCFG_SM510_WRITE_R_CB(WRITE8(hh_sm510_state, sm511_melody_w)) + + MCFG_DEFAULT_LAYOUT(layout_hh_sm510_test) + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) +MACHINE_CONFIG_END + + + + + +/*************************************************************************** + Nintendo Game & Watch: Mickey & Donald (model DM-53) * PCB label DM-53 * Sharp SM510 label DM-53 (die label CMS54C, CMS565) @@ -374,19 +430,28 @@ ROM_END ROM_START( ktmnt ) // except for filler/unused bytes, ROM listing in patent US5150899 "BH005 TMNT" prog/music is same ROM_REGION( 0x1000, "maincpu", 0 ) - ROM_LOAD( "kms73b_774.prog", 0x0000, 0x1000, CRC(a1064f87) SHA1(92156c35fbbb414007ee6804fe635128a741d5f1) ) + ROM_LOAD( "kms73b_kms774.prog", 0x0000, 0x1000, CRC(a1064f87) SHA1(92156c35fbbb414007ee6804fe635128a741d5f1) ) ROM_REGION( 0x100, "maincpu:music", 0 ) - ROM_LOAD( "kms73b_774.music", 0x000, 0x100, CRC(8270d626) SHA1(bd91ca1d5cd7e2a62eef05c0033b19dcdbe441ca) ) + ROM_LOAD( "kms73b_kms774.music", 0x000, 0x100, CRC(8270d626) SHA1(bd91ca1d5cd7e2a62eef05c0033b19dcdbe441ca) ) ROM_END ROM_START( kcontra ) // except for filler/unused bytes, ROM listing in patent US5120057 "BH002 C (Contra)" prog/music is same ROM_REGION( 0x1000, "maincpu", 0 ) - ROM_LOAD( "kms73b_774.prog", 0x0000, 0x1000, CRC(bf834877) SHA1(055dd56ec16d63afba61ab866481fd9c029fb54d) ) + ROM_LOAD( "kms73b_kms773.prog", 0x0000, 0x1000, CRC(bf834877) SHA1(055dd56ec16d63afba61ab866481fd9c029fb54d) ) + + ROM_REGION( 0x100, "maincpu:music", 0 ) + ROM_LOAD( "kms73b_kms773.music", 0x000, 0x100, CRC(23d02b99) SHA1(703938e496db0eeacd14fe7605d4b5c39e0a5bc8) ) +ROM_END + + +ROM_START( kgradius ) + ROM_REGION( 0x1000, "maincpu", 0 ) + ROM_LOAD( "kms73b_kms771.prog", 0x0000, 0x1000, CRC(830c2afc) SHA1(bb9ebd4e52831cc02cd92dd4b37675f34cf37b8c) ) ROM_REGION( 0x100, "maincpu:music", 0 ) - ROM_LOAD( "kms73b_774.music", 0x000, 0x100, CRC(23d02b99) SHA1(703938e496db0eeacd14fe7605d4b5c39e0a5bc8) ) + ROM_LOAD( "kms73b_kms771.music", 0x000, 0x100, CRC(4c586b73) SHA1(14c5ab2898013a577f678970a648c374749cc66d) ) ROM_END @@ -401,5 +466,6 @@ ROM_END CONS( 1989, kcontra, 0, 0, ktmnt, ktopgun, driver_device, 0, "Konami", "Contra (handheld)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK | MACHINE_NOT_WORKING ) CONS( 1989, ktopgun, 0, 0, ktopgun, ktopgun, driver_device, 0, "Konami", "Top Gun (handheld)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK | MACHINE_NOT_WORKING ) CONS( 1989, ktmnt, 0, 0, ktmnt, ktmnt, driver_device, 0, "Konami", "Teenage Mutant Ninja Turtles (handheld)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK | MACHINE_NOT_WORKING ) +CONS( 1989, kgradius, 0, 0, kgradius, kgradius, driver_device, 0, "Konami", "Gradius (handheld)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK | MACHINE_NOT_WORKING ) CONS( 1982, gnwmndon, 0, 0, gnwmndon, gnwmndon, driver_device, 0, "Nintendo", "Game & Watch: Mickey & Donald", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK | MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/hh_ucom4.cpp b/src/mame/drivers/hh_ucom4.cpp index d3411390e2b..2ea7f8a51ff 100644 --- a/src/mame/drivers/hh_ucom4.cpp +++ b/src/mame/drivers/hh_ucom4.cpp @@ -46,6 +46,7 @@ @206 uPD553C 1982, Epoch Dracula @209 uPD553C 1982, Tomy Caveman (TN-12) @258 uPD553C 1984, Tomy Alien Chase (TN-16) + *296 uPD553C 1984, Epoch Computer Beam Gun Professional *511 uPD557LC?1980, Gakken Game Robot 9/Mego Fabulous Fred @512 uPD557LC 1980, Castle Toy Tactix diff --git a/src/mame/drivers/himesiki.cpp b/src/mame/drivers/himesiki.cpp index f21891f4500..1ebc2696426 100644 --- a/src/mame/drivers/himesiki.cpp +++ b/src/mame/drivers/himesiki.cpp @@ -9,9 +9,10 @@ Android (C) 198? Nasco *****************************************************************************/ -// Note, another VERY different version of Android also exists, see https://www.youtube.com/watch?v=5rtqZqMBACI (uploaded by Chris Hardy) -// it is unclear if that version is on the same hardware as this // Android uses PCBS MK-P102 and MK-P101 ONLY, there is no MK-P103 (extra sprites used on Himeshikibu) +// Real hardware video of parent set can be seen at https://www.youtube.com/watch?v=5rtqZqMBACI (uploaded by Chris Hardy) +// for some reason music fails to play the 2nd attract loop in MAME? + /* @@ -235,7 +236,7 @@ static INPUT_PORTS_START( himesiki ) PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END -static INPUT_PORTS_START( androidp ) +static INPUT_PORTS_START( androidpo ) PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) @@ -320,6 +321,38 @@ static INPUT_PORTS_START( androidp ) INPUT_PORTS_END +static INPUT_PORTS_START( androidp ) + PORT_INCLUDE(androidpo) + + PORT_MODIFY("DSW1") + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) + PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) + + PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) ) + PORT_DIPSETTING( 0x08, "1" ) + PORT_DIPSETTING( 0x0c, "2" ) + PORT_DIPSETTING( 0x04, "3" ) + PORT_DIPSETTING( 0x00, "4" ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) ) + PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_MODIFY("DSW2") + PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) + +INPUT_PORTS_END /****************************************************************************/ @@ -417,13 +450,13 @@ static MACHINE_CONFIG_START( himesiki, himesiki_state ) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", himesiki) - MCFG_PALETTE_ADD("palette", 1024) + MCFG_PALETTE_ADD_INIT_BLACK("palette", 1024) MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("ym2203", YM2203, MCLK/4) + MCFG_SOUND_ADD("ym2203", YM2203, CLK2/4) // ?? MCFG_YM2203_IRQ_HANDLER(INPUTLINE("sub", 0)) MCFG_SOUND_ROUTE(0, "mono", 0.10) MCFG_SOUND_ROUTE(1, "mono", 0.10) @@ -469,7 +502,7 @@ ROM_END -ROM_START( androidp ) +ROM_START( androidpo ) ROM_REGION( 0x08000, "maincpu", 0 ) ROM_LOAD( "MITSUBISHI_A01.toppcb.m5l27256k.k1.BIN", 0x00000, 0x08000, CRC(25ab85eb) SHA1(e1fab149c83ff880b119258206d5818f3db641c5) ) @@ -496,7 +529,34 @@ ROM_START( androidp ) // + 2 undumped PLDs ROM_END +ROM_START( androidp ) + ROM_REGION( 0x08000, "maincpu", 0 ) + ROM_LOAD( "ANDR1.BIN", 0x00000, 0x08000, CRC(fff04130) SHA1(9bdafa8b311cc5d0851b04df3c6dd16eb087a5dd) ) + + ROM_REGION( 0x10000, "banks", 0 ) + ROM_LOAD( "ANDR3.BIN", 0x00000, 0x04000, CRC(112d5123) SHA1(653109eae7b58d9dcb8892ea9aca17427f14c145) ) + ROM_CONTINUE( 0x08000, 0x04000) + + ROM_REGION( 0x18000, "sub", 0 ) + ROM_LOAD( "ANDR4.BIN", 0x00000, 0x08000, CRC(65f5e98b) SHA1(69f979d653695413a1c503c402d4bf5ffcfb6e5d) ) + + ROM_REGION( 0x10000, "bgtiles", 0 ) + ROM_LOAD( "ANDR5.BIN", 0x00000, 0x10000, CRC(0a0b44c0) SHA1(8d359b802c7dee5faea9464f06b672fd401799cf) ) + + ROM_REGION( 0x20000, "sprites", 0 ) + ROM_LOAD16_BYTE( "ANDR6.BIN", 0x00000, 0x10000, CRC(122b7dd1) SHA1(5dffd2b97c8222afc98552513b84a91d6127f41b) ) + ROM_LOAD16_BYTE( "ANDR7.BIN", 0x00001, 0x10000, CRC(fc0f9234) SHA1(496a918cc1f4d0e7191a49cc43c51fbd71e0bdf5) ) + + ROM_REGION( 0x20000, "spr_p103a", ROMREGION_ERASEFF ) + // there's no P103A PCB for this on Android + + + // + 2 undumped PLDs (?) +ROM_END + -GAME( 1989, himesiki, 0, himesiki, himesiki, driver_device, 0, ROT90, "Hi-Soft", "Himeshikibu (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1989, himesiki, 0, himesiki, himesiki, driver_device, 0, ROT90, "Hi-Soft", "Himeshikibu (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 198?, androidp, 0, himesiki, androidp, driver_device, 0, ROT90, "Nasco", "Android (early build?)", MACHINE_SUPPORTS_SAVE ) +// the game changed significantly between these 2 versions +GAME( 198?, androidp, 0, himesiki, androidp, driver_device, 0, ROT90, "Nasco", "Android (prototype, later build)", MACHINE_SUPPORTS_SAVE ) +GAME( 198?, androidpo, androidp, himesiki, androidpo, driver_device, 0, ROT90, "Nasco", "Android (prototype, early build)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/hornet.cpp b/src/mame/drivers/hornet.cpp index b1df15c8419..bd99a6356fe 100644 --- a/src/mame/drivers/hornet.cpp +++ b/src/mame/drivers/hornet.cpp @@ -1014,10 +1014,7 @@ static MACHINE_CONFIG_START( hornet, hornet_state ) MCFG_PALETTE_ADD("palette", 65536) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - - MCFG_K037122_ADD("k037122_1", "screen", 0) - MCFG_K037122_GFXDECODE("gfxdecode") + MCFG_K037122_ADD("k037122_1", "screen") MCFG_K037122_PALETTE("palette") MCFG_K056800_ADD("k056800", XTAL_16_9344MHz) @@ -1067,12 +1064,10 @@ static MACHINE_CONFIG_DERIVED( hornet_2board, hornet ) MCFG_DEVICE_REMOVE("k037122_1") - MCFG_K037122_ADD("k037122_1", "lscreen", 0) - MCFG_K037122_GFXDECODE("gfxdecode") + MCFG_K037122_ADD("k037122_1", "lscreen") MCFG_K037122_PALETTE("palette") - MCFG_K037122_ADD("k037122_2", "rscreen", 1) - MCFG_K037122_GFXDECODE("gfxdecode") + MCFG_K037122_ADD("k037122_2", "rscreen") MCFG_K037122_PALETTE("palette") MCFG_DEVICE_REMOVE("voodoo0") diff --git a/src/mame/drivers/hvyunit.cpp b/src/mame/drivers/hvyunit.cpp index 21ec09dfe4b..a8446a8537c 100644 --- a/src/mame/drivers/hvyunit.cpp +++ b/src/mame/drivers/hvyunit.cpp @@ -676,7 +676,6 @@ static MACHINE_CONFIG_START( hvyunit, hvyunit_state ) MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0) MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode") - MCFG_KANEKO_PANDORA_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/igs009.cpp b/src/mame/drivers/igs009.cpp index 78e1308068f..638a3260df2 100644 --- a/src/mame/drivers/igs009.cpp +++ b/src/mame/drivers/igs009.cpp @@ -18,11 +18,11 @@ NVRAM : Battery for main RAM --------------------------------------------------------------------------- Year Game Manufacturer Notes --------------------------------------------------------------------------- -1997 Jingle Bell (US, V157) IGS NMI issues... -1997 Jingle Bell (EU, V155) IGS NMI issues... -1997 Jingle Bell (EU, V153) IGS NMI issues... -1995 Jingle Bell (EU, V141) IGS Working -1995? Jingle Bell (Italy, V133I) IGS Working +1997 Jingle Bell (US, V157US) IGS patched protection +1997 Jingle Bell (EU, V155UE) IGS patched protection +1997 Jingle Bell (EU, V153UE) IGS patched protection +1995 Jingle Bell (EU, V141UE) IGS patched protection +1995? Jingle Bell (Italy, V133I) IGS patched protection 1998 Grand Prix '98 Romtec 1 reel gfx rom is bad --------------------------------------------------------------------------- @@ -35,7 +35,6 @@ Year Game Manufacturer Notes #include "sound/okim6295.h" #include "machine/nvram.h" - class igs009_state : public driver_device { public: @@ -106,7 +105,10 @@ public: TILE_GET_INFO_MEMBER(get_gp98_reel4_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); + void decrypt_jingbell(); DECLARE_DRIVER_INIT(jingbell); + DECLARE_DRIVER_INIT(jingbelli); + virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; @@ -314,7 +316,6 @@ UINT32 igs009_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, int startclipmin = 0; const rectangle &visarea = screen.visible_area(); - for (i= 0;i < 0x80;i++) { m_reel1_tilemap->set_scrolly(i, m_bg_scroll[i]*2); @@ -323,9 +324,6 @@ UINT32 igs009_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, m_reel4_tilemap->set_scrolly(i, m_bg_scroll[i+0x180]*2); } - - - for (zz=0;zz<0x80-8;zz++) // -8 because of visible area (2*8 = 16) { rectangle clip; @@ -395,9 +393,9 @@ WRITE8_MEMBER(igs009_state::nmi_and_coins_w) machine().bookkeeping().coin_counter_w(0, data & 0x01); // coin_a machine().bookkeeping().coin_counter_w(1, data & 0x04); // coin_c machine().bookkeeping().coin_counter_w(2, data & 0x08); // key in - machine().bookkeeping().coin_counter_w(3, data & 0x10); // coin m_out mech + machine().bookkeeping().coin_counter_w(3, data & 0x10); // coin out mech - output().set_led_value(6, data & 0x40); // led for coin m_out / m_hopper active + output().set_led_value(6, data & 0x40); // led for coin out / m_hopper active m_nmi_enable = data; // data & 0x80 // nmi enable? @@ -525,7 +523,7 @@ static ADDRESS_MAP_START( gp98_portmap, AS_IO, 8, igs009_state ) AM_RANGE( 0x5000, 0x5fff ) AM_RAM_WRITE(fg_tile_w ) AM_SHARE("fg_tile_ram") - // seems to lacks of PPI devices... + // seems to lack PPI devices... AM_RANGE( 0x6480, 0x6480 ) AM_WRITE(nmi_and_coins_w ) AM_RANGE( 0x6481, 0x6481 ) AM_READ_PORT( "SERVICE" ) AM_RANGE( 0x6482, 0x6482 ) AM_READ_PORT( "COINS" ) @@ -727,7 +725,7 @@ static const gfx_layout layout_8x8x6 = 8, 8, RGN_FRAC(1, 3), 6, - { RGN_FRAC(0,3)+8,RGN_FRAC(0,3)+0, + { RGN_FRAC(0,3)+8,RGN_FRAC(0,3)+0, RGN_FRAC(1,3)+8,RGN_FRAC(1,3)+0, RGN_FRAC(2,3)+8,RGN_FRAC(2,3)+0 }, { STEP8(0,1) }, @@ -740,7 +738,7 @@ static const gfx_layout layout_8x32x6 = 8, 32, RGN_FRAC(1, 3), 6, - { RGN_FRAC(0,3)+8,RGN_FRAC(0,3)+0, + { RGN_FRAC(0,3)+8,RGN_FRAC(0,3)+0, RGN_FRAC(1,3)+8,RGN_FRAC(1,3)+0, RGN_FRAC(2,3)+8,RGN_FRAC(2,3)+0 }, { STEP8(0,1) }, @@ -796,14 +794,14 @@ void igs009_state::machine_start() void igs009_state::machine_reset() { - m_nmi_enable = 0; - m_hopper = 0; - m_video_enable = 1; + m_nmi_enable = 0; + m_hopper = 0; + m_video_enable = 1; } INTERRUPT_GEN_MEMBER(igs009_state::interrupt) { - if (m_nmi_enable & 0x80) + if (m_nmi_enable & 0x80) device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); } @@ -1028,6 +1026,7 @@ Notes: 12/02/2008 f205v ***************************************************************************/ + ROM_START( jingbelli ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "jinglev133i.u44", 0x00000, 0x10000, CRC(df60dc39) SHA1(ff57afd50c045b621395353fdc50ffd1e1b65e9e) ) @@ -1055,14 +1054,12 @@ ROM_START( jingbelli ) ROM_LOAD( "palce22v10h-ch-jin-u27.u27", 0x000, 0x2dd, BAD_DUMP CRC(5c4e9024) SHA1(e9d1e4df3d79c21f4ce053a84bb7b7a43d650f91) ) ROM_END - -DRIVER_INIT_MEMBER(igs009_state,jingbell) +void igs009_state::decrypt_jingbell() { - int i; UINT8 *rom = (UINT8 *)memregion("maincpu")->base(); size_t size = memregion("maincpu")->bytes(); - for (i=0; i<size; i++) + for (int i=0; i<size; i++) { UINT8 x = rom[i]; if (i & 0x0080) @@ -1080,11 +1077,26 @@ DRIVER_INIT_MEMBER(igs009_state,jingbell) rom[i] = x; } +} + +DRIVER_INIT_MEMBER(igs009_state,jingbelli) +{ + decrypt_jingbell(); // protection patch + UINT8 *rom = (UINT8 *)memregion("maincpu")->base(); rom[0x01f19] = 0x18; } +DRIVER_INIT_MEMBER(igs009_state,jingbell) +{ + decrypt_jingbell(); + + // protection patch + UINT8 *rom = (UINT8 *)memregion("maincpu")->base(); + rom[0x0e753] = 0x18; +} + /*************************************************************************** Grand Prix '98 @@ -1145,10 +1157,10 @@ ROM_START( gp98 ) ROM_END -/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ -GAME( 1997, jingbell, 0, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (US, V157)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1997, jingbella, jingbell, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (EU, V155)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1997, jingbellb, jingbell, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (EU, V153)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1995, jingbellc, jingbell, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (EU, V141)", MACHINE_SUPPORTS_SAVE ) -GAME( 1995?, jingbelli, jingbell, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (Italy, V133I)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, gp98, 0, gp98, jingbell, driver_device, 0, ROT0, "Romtec Co. Ltd", "Grand Prix '98 (V100K)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ +GAME( 1997, jingbell, 0, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (US, V157US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1997, jingbella, jingbell, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (EU, V155UE)", MACHINE_SUPPORTS_SAVE ) // Shows V154UE in test mode! +GAME( 1997, jingbellb, jingbell, jingbell, jingbell, igs009_state, jingbell, ROT0, "IGS", "Jingle Bell (EU, V153UE)", MACHINE_SUPPORTS_SAVE ) +GAME( 1995, jingbellc, jingbell, jingbell, jingbell, igs009_state, jingbelli, ROT0, "IGS", "Jingle Bell (EU, V141UE)", MACHINE_SUPPORTS_SAVE ) +GAME( 1995?, jingbelli, jingbell, jingbell, jingbell, igs009_state, jingbelli, ROT0, "IGS", "Jingle Bell (Italy, V133I)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, gp98, 0, gp98, jingbell, driver_device, 0, ROT0, "Romtec Co. Ltd", "Grand Prix '98 (V100K)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/inufuku.cpp b/src/mame/drivers/inufuku.cpp index dcbb74bd400..78621252fae 100644 --- a/src/mame/drivers/inufuku.cpp +++ b/src/mame/drivers/inufuku.cpp @@ -395,7 +395,6 @@ static MACHINE_CONFIG_START( inufuku, inufuku_state ) MCFG_VSYSTEM_SPR_SET_TILE_INDIRECT( inufuku_state, inufuku_tile_callback ) MCFG_VSYSTEM_SPR_SET_GFXREGION(2) MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", inufuku) MCFG_PALETTE_ADD("palette", 4096) diff --git a/src/mame/drivers/jaguar.cpp b/src/mame/drivers/jaguar.cpp index ee33848dd11..c26edd9b298 100644 --- a/src/mame/drivers/jaguar.cpp +++ b/src/mame/drivers/jaguar.cpp @@ -339,7 +339,6 @@ Notes: #include "machine/vt83c461.h" #include "sound/dac.h" #include "includes/jaguar.h" -#include "emuopts.h" #include "imagedev/snapquik.h" #include "sound/dac.h" #include "machine/eepromser.h" diff --git a/src/mame/drivers/jclub2.cpp b/src/mame/drivers/jclub2.cpp index e3135dcbc6e..fe83f2ad7a5 100644 --- a/src/mame/drivers/jclub2.cpp +++ b/src/mame/drivers/jclub2.cpp @@ -156,7 +156,7 @@ public: UINT32 screen_update_jclub2o(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(darkhors_irq); void draw_sprites_darkhors(bitmap_ind16 &bitmap, const rectangle &cliprect); - required_device<gfxdecode_device> m_gfxdecode; + optional_device<gfxdecode_device> m_gfxdecode; WRITE8_MEMBER(st0016_rom_bank_w); // temp? }; @@ -1021,13 +1021,10 @@ static MACHINE_CONFIG_START( jclub2, darkhors_state ) MCFG_SCREEN_UPDATE_DRIVER(darkhors_state, screen_update_jclub2) MCFG_SCREEN_PALETTE("palette") - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - // NOT an ST0020 but instead ST0032, ram format isn't compatible at least MCFG_DEVICE_ADD("st0020_spr", ST0020_SPRITES, 0) st0020_device::set_is_st0032(*device, 1); st0020_device::set_is_jclub2o(*device, 1); // offsets - MCFG_ST0020_SPRITES_GFXDECODE("gfxdecode") MCFG_ST0020_SPRITES_PALETTE("palette") MCFG_PALETTE_ADD("palette", 0x10000) @@ -1101,11 +1098,8 @@ static MACHINE_CONFIG_START( jclub2o, darkhors_state ) MCFG_PALETTE_ADD("palette", 0x10000) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("st0020_spr", ST0020_SPRITES, 0) st0020_device::set_is_jclub2o(*device, 1); - MCFG_ST0020_SPRITES_GFXDECODE("gfxdecode") MCFG_ST0020_SPRITES_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(darkhors_state,jclub2o) diff --git a/src/mame/drivers/kaneko16.cpp b/src/mame/drivers/kaneko16.cpp index b9c25759145..019f95e4492 100644 --- a/src/mame/drivers/kaneko16.cpp +++ b/src/mame/drivers/kaneko16.cpp @@ -2229,7 +2229,7 @@ MACHINE_CONFIG_END static MACHINE_CONFIG_START( mgcrystl, kaneko16_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* verified on pcb */ + MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* verified on pcb, TMP68HC000N-12 @U31 and X2 is 12MHz */ MCFG_CPU_PROGRAM_MAP(mgcrystl) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kaneko16_state, kaneko16_interrupt, "screen", 0, 1) @@ -3832,28 +3832,29 @@ ROM_START( mgcrystlo ) /* Master Up: 91/12/10 01:56:06 */ ROM_LOAD( "mc030.u32", 0x000000, 0x040000, CRC(c165962e) SHA1(f7e130db387ae9dcb7223f7ad6e51270d3033bc9) ) ROM_END +// Note: there is a known undumped older Japan set from http://gamesdbase.com/Media/SYSTEM/Arcade/PCB/big/Magical_Crystals_-_1991_-_Kaneko.jpg with code roms ending in -00 instead of -02 ROM_START( mgcrystlj ) /* Master Up: 92/01/13 14:44:20 */ ROM_REGION( 0x040000*2, "maincpu", ROMREGION_ERASE ) /* 68000 Code */ - ROM_LOAD16_BYTE( "mc100j02.u18", 0x000000, 0x020000, CRC(afe5882d) SHA1(176e6e12e3df63c08d7aff781f5e5a9bd83ec293) ) /* Labeled as MC100J/U18-02 */ - ROM_LOAD16_BYTE( "mc101j02.u19", 0x000001, 0x040000, CRC(60da5492) SHA1(82b90a617d355825624ce9fb30bddf4714bd0d18) ) /* Labeled as MC101J/U19-02 */ + ROM_LOAD16_BYTE( "kaneko__mc100-u18j-02.u18", 0x000000, 0x020000, CRC(afe5882d) SHA1(176e6e12e3df63c08d7aff781f5e5a9bd83ec293) ) /* Labeled as MC100J/U18-02 */ + ROM_LOAD16_BYTE( "kaneko__mc101-u19j-02.u19", 0x000001, 0x040000, CRC(60da5492) SHA1(82b90a617d355825624ce9fb30bddf4714bd0d18) ) /* Labeled as MC101J/U19-02 */ ROM_REGION( 0x280000, "gfx1", 0 ) /* Sprites */ - ROM_LOAD( "mc000.u38", 0x000000, 0x100000, CRC(28acf6f4) SHA1(6647ad90ea580b65ed28772f9d65352b06833d0c) ) - ROM_LOAD( "mc001.u37", 0x100000, 0x080000, CRC(005bc43d) SHA1(6f6cd99e8e60562fa86581008455a6d9d646fa95) ) + ROM_LOAD( "kaneko__mc-000_0001.u38", 0x000000, 0x100000, CRC(28acf6f4) SHA1(6647ad90ea580b65ed28772f9d65352b06833d0c) ) // Mask rom + ROM_LOAD( "kaneko__mc-001_0002_r44.u37", 0x100000, 0x080000, CRC(005bc43d) SHA1(6f6cd99e8e60562fa86581008455a6d9d646fa95) ) // Mask rom ROM_RELOAD( 0x180000, 0x080000 ) - ROM_LOAD( "mc002e02.u36", 0x200000, 0x020000, CRC(27ac1056) SHA1(34b07c1a0d403ca45c9849d3d8d311012f787df6) ) /* Labeled as MC002J/U36-02, but same as MC002E/U36-02 */ + ROM_LOAD( "kaneko__mc002j-u36-02.u36", 0x200000, 0x020000, CRC(27ac1056) SHA1(34b07c1a0d403ca45c9849d3d8d311012f787df6) ) /* Labeled as MC002J/U36-02, but same as MC002E/U36-02 */ ROM_RELOAD( 0x220000, 0x020000 ) ROM_RELOAD( 0x240000, 0x020000 ) ROM_RELOAD( 0x260000, 0x020000 ) ROM_REGION( 0x100000, "gfx2", 0 ) /* Tiles (Scrambled) */ - ROM_LOAD( "mc010.u04", 0x000000, 0x100000, CRC(85072772) SHA1(25e903cc2c893d61db791d1fe60a1205a4395667) ) + ROM_LOAD( "kaneko__mc-010_0003.u04", 0x000000, 0x100000, CRC(85072772) SHA1(25e903cc2c893d61db791d1fe60a1205a4395667) ) // Mask rom ROM_REGION( 0x100000, "gfx3", 0 ) /* Tiles (Scrambled) */ - ROM_LOAD( "mc020.u34", 0x000000, 0x100000, CRC(1ea92ff1) SHA1(66ec53e664b2a5a751a280a538aaeceafc187ceb) ) + ROM_LOAD( "kaneko__mc-020_0004.u34", 0x000000, 0x100000, CRC(1ea92ff1) SHA1(66ec53e664b2a5a751a280a538aaeceafc187ceb) ) // Mask rom ROM_REGION( 0x040000, "oki", 0 ) /* Samples */ - ROM_LOAD( "mc030.u32", 0x000000, 0x040000, CRC(c165962e) SHA1(f7e130db387ae9dcb7223f7ad6e51270d3033bc9) ) + ROM_LOAD( "kaneko__mc-030_0005_t99.u32", 0x000000, 0x040000, CRC(c165962e) SHA1(f7e130db387ae9dcb7223f7ad6e51270d3033bc9) ) ROM_END diff --git a/src/mame/drivers/karnov.cpp b/src/mame/drivers/karnov.cpp index 9737c94c80d..3f602083f66 100644 --- a/src/mame/drivers/karnov.cpp +++ b/src/mame/drivers/karnov.cpp @@ -816,9 +816,8 @@ static MACHINE_CONFIG_START( karnov, karnov_state ) MCFG_PALETTE_INIT_OWNER(karnov_state, karnov) MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0) - deco_karnovsprites_device::set_gfx_region(*device, 2); + MCFG_DECO_KARNOVSPRITES_GFX_REGION(2) MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode") - MCFG_DECO_KARNOVSPRITES_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(karnov_state,karnov) @@ -880,9 +879,8 @@ static MACHINE_CONFIG_START( wndrplnt, karnov_state ) MCFG_PALETTE_INIT_OWNER(karnov_state, karnov) MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0) - deco_karnovsprites_device::set_gfx_region(*device, 2); + MCFG_DECO_KARNOVSPRITES_GFX_REGION(2) MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode") - MCFG_DECO_KARNOVSPRITES_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(karnov_state,wndrplnt) diff --git a/src/mame/drivers/konamigx.cpp b/src/mame/drivers/konamigx.cpp index f134febe790..6aeee176b81 100644 --- a/src/mame/drivers/konamigx.cpp +++ b/src/mame/drivers/konamigx.cpp @@ -1583,7 +1583,7 @@ static GFXDECODE_START( racinfrc ) GFXDECODE_END /* type 3 & 4 games use a simple 8bpp decode for the 53936 */ -static GFXDECODE_START( type34 ) +static GFXDECODE_START( type3 ) GFXDECODE_ENTRY( "gfx3", 0, bglayout_8bpp, 0x1000, 8 ) GFXDECODE_END @@ -1646,12 +1646,9 @@ static MACHINE_CONFIG_START( konamigx, konamigx_state ) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_ENABLE_HILIGHTS() - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(konamigx_state, type2_tile_callback) - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_5, 0, 0, "none") - MCFG_K056832_GFXDECODE("gfxdecode") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0, "none") MCFG_K056832_PALETTE("palette") MCFG_K055555_ADD("k055555") @@ -1663,9 +1660,8 @@ static MACHINE_CONFIG_START( konamigx, konamigx_state ) MCFG_DEVICE_ADD("k055673", K055673, 0) MCFG_K055673_CB(konamigx_state, type2_sprite_callback) - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -26, -23) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -26, -23) MCFG_K055673_SET_SCREEN("screen") - MCFG_K055673_GFXDECODE("gfxdecode") MCFG_K055673_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_5bpp) @@ -1698,12 +1694,12 @@ MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( konamigx_bios, konamigx ) MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_4, 0, 0, "k055555") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 0, 0, "k055555") MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( gokuparo, konamigx ) MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -46, -23) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -46, -23) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( sexyparo, konamigx ) @@ -1711,12 +1707,12 @@ static MACHINE_CONFIG_DERIVED( sexyparo, konamigx ) MCFG_K056832_CB(konamigx_state, alpha_tile_callback) MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -42, -23) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -42, -23) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( tbyahhoo, konamigx ) MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_5, 0, 0, "k055555") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0, "k055555") MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( dragoonj, konamigx ) @@ -1727,11 +1723,11 @@ static MACHINE_CONFIG_DERIVED( dragoonj, konamigx ) MCFG_K053252_OFFSETS(24+16, 16) MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_5, 1, 0, "none") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 1, 0, "none") MCFG_DEVICE_MODIFY("k055673") MCFG_K055673_CB(konamigx_state, dragoonj_sprite_callback) - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_RNG, -53, -23) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_RNG, -53, -23) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( le2, konamigx ) @@ -1739,41 +1735,42 @@ static MACHINE_CONFIG_DERIVED( le2, konamigx ) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", konamigx_state, konamigx_type2_scanline, "screen", 0, 1) MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 1, 0, "none") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 1, 0, "none") MCFG_DEVICE_MODIFY("k055673") MCFG_K055673_CB(konamigx_state, le2_sprite_callback) - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_LE2, -46, -23) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_LE2, -46, -23) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( konamigx_6bpp, konamigx ) MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_6bpp) MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 0, 0, "none") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 0, "none") MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -46, -23) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -46, -23) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( salmndr2, konamigx ) MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 1, 0, "none") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 1, 0, "none") MCFG_DEVICE_MODIFY("k055673") MCFG_K055673_CB(konamigx_state, salmndr2_sprite_callback) - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -48, -23) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -48, -23) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( opengolf, konamigx ) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_RAW_PARAMS(8000000, 384+24+64+40, 0, 383, 224+16+8+16, 0, 223) MCFG_SCREEN_VISIBLE_AREA(40, 40+384-1, 16, 16+224-1) - MCFG_GFXDECODE_MODIFY("gfxdecode", opengolf) + + MCFG_GFXDECODE_ADD("gfxdecode", "palette", opengolf) MCFG_VIDEO_START_OVERRIDE(konamigx_state, opengolf) MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -53, -23) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -53, -23) MCFG_CPU_MODIFY("maincpu") MCFG_CPU_PROGRAM_MAP(gx_type1_map) @@ -1786,17 +1783,18 @@ static MACHINE_CONFIG_DERIVED( racinfrc, konamigx ) MCFG_SCREEN_MODIFY("screen") //MCFG_SCREEN_RAW_PARAMS(6000000, 384+24+64+40, 0, 383, 224+16+8+16, 0, 223) //MCFG_SCREEN_VISIBLE_AREA(32, 32+384-1, 16, 16+224-1) - MCFG_GFXDECODE_MODIFY("gfxdecode", racinfrc) + + MCFG_GFXDECODE_ADD("gfxdecode", "palette", racinfrc) MCFG_VIDEO_START_OVERRIDE(konamigx_state, racinfrc) MCFG_DEVICE_MODIFY("k053252") MCFG_K053252_OFFSETS(24-8+16, 0) MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 0, 0, "none") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 0, "none") MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -53, -23) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -53, -23) MCFG_CPU_MODIFY("maincpu") MCFG_CPU_PROGRAM_MAP(gx_type1_map) @@ -1813,6 +1811,7 @@ static MACHINE_CONFIG_DERIVED( gxtype3, konamigx ) MCFG_DEFAULT_LAYOUT(layout_dualhsxs) + MCFG_GFXDECODE_ADD("gfxdecode", "palette", type3) MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type3) MCFG_DEVICE_MODIFY("k053252") @@ -1820,10 +1819,10 @@ static MACHINE_CONFIG_DERIVED( gxtype3, konamigx ) MCFG_K053252_SET_SLAVE_SCREEN("screen2") MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 0, 2, "none") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 2, "none") MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -132, -23) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -132, -23) MCFG_DEVICE_REMOVE("palette") MCFG_PALETTE_ADD("palette", 16384) @@ -1842,8 +1841,6 @@ static MACHINE_CONFIG_DERIVED( gxtype3, konamigx ) MCFG_SCREEN_SIZE(1024, 1024) MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 16, 32*8-1-16) MCFG_SCREEN_UPDATE_DRIVER(konamigx_state, screen_update_konamigx_right) - - MCFG_GFXDECODE_MODIFY("gfxdecode", type34) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( gxtype4, konamigx ) @@ -1872,7 +1869,7 @@ static MACHINE_CONFIG_DERIVED( gxtype4, konamigx ) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_ENABLE_HILIGHTS() - MCFG_GFXDECODE_MODIFY("gfxdecode", type4) + MCFG_GFXDECODE_ADD("gfxdecode", "palette", type4) MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4) MCFG_DEVICE_MODIFY("k053252") @@ -1881,10 +1878,10 @@ static MACHINE_CONFIG_DERIVED( gxtype4, konamigx ) MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 0, 0, "none") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 0, "none") MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -79, -24) // -23 looks better in intro + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -79, -24) // -23 looks better in intro MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( gxtype4_vsn, gxtype4 ) @@ -1905,17 +1902,17 @@ static MACHINE_CONFIG_DERIVED( gxtype4_vsn, gxtype4 ) MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4_vsn) MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 0, 2, "none") // set djmain_hack to 2 to kill layer association or half the tilemaps vanish on screen 0 + MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 2, "none") // set djmain_hack to 2 to kill layer association or half the tilemaps vanish on screen 0 MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -132, -23) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -132, -23) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( gxtype4sd2, gxtype4 ) MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4_sd2) MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -81, -23) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -81, -23) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( winspike, konamigx ) @@ -1927,10 +1924,10 @@ static MACHINE_CONFIG_DERIVED( winspike, konamigx ) MCFG_DEVICE_MODIFY("k056832") MCFG_K056832_CB(konamigx_state, alpha_tile_callback) - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 0, 2, "none") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 2, "none") MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_LE2, -53, -23) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_LE2, -53, -23) MACHINE_CONFIG_END diff --git a/src/mame/drivers/lastbank.cpp b/src/mame/drivers/lastbank.cpp index 75bafbb6d6c..14c2cb772a6 100644 --- a/src/mame/drivers/lastbank.cpp +++ b/src/mame/drivers/lastbank.cpp @@ -483,7 +483,6 @@ static MACHINE_CONFIG_START( lastbank, lastbank_state ) MCFG_DEVICE_ADD("tc0091lvc", TC0091LVC, 0) MCFG_TC0091LVC_GFXDECODE("gfxdecode") - MCFG_TC0091LVC_PALETTE("palette") // MCFG_VIDEO_START_OVERRIDE(lastbank_state,lastbank) diff --git a/src/mame/drivers/lemmings.cpp b/src/mame/drivers/lemmings.cpp index 5af69bba418..0c427a4c14f 100644 --- a/src/mame/drivers/lemmings.cpp +++ b/src/mame/drivers/lemmings.cpp @@ -260,12 +260,10 @@ static MACHINE_CONFIG_START( lemmings, lemmings_state ) MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(1) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(0) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO146_ADD("ioprot") MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR diff --git a/src/mame/drivers/lethal.cpp b/src/mame/drivers/lethal.cpp index fb6ce38d331..bd834f9fd94 100644 --- a/src/mame/drivers/lethal.cpp +++ b/src/mame/drivers/lethal.cpp @@ -509,8 +509,6 @@ static MACHINE_CONFIG_START( lethalen, lethal_state ) MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom") - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(59.62) /* verified on pcb */ @@ -526,8 +524,7 @@ static MACHINE_CONFIG_START( lethalen, lethal_state ) MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(lethal_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8LE, 1, 0, "none") - MCFG_K056832_GFXDECODE("gfxdecode") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_8LE, 1, 0, "none") MCFG_K056832_PALETTE("palette") MCFG_DEVICE_ADD("k053244", K053244, 0) diff --git a/src/mame/drivers/m92.cpp b/src/mame/drivers/m92.cpp index 2ff72f43b87..f4934be8fe6 100644 --- a/src/mame/drivers/m92.cpp +++ b/src/mame/drivers/m92.cpp @@ -1180,23 +1180,23 @@ ROM_START( skingame ) ROM_LOAD16_BYTE( "is-l1.5j", 0x80000, 0x40000, CRC(e4e00626) SHA1(e8c6c7ad6a367da4036915a155c8695ad90ae47b) ) ROM_REGION( 0x20000, "soundcpu", 0 ) - ROM_LOAD16_BYTE( "mt2sh0", 0x00001, 0x10000, CRC(1ecbea43) SHA1(8d66ef419f75569f2c83a89c3985742b8a47914f) ) - ROM_LOAD16_BYTE( "mt2sl0", 0x00000, 0x10000, CRC(8fd5b531) SHA1(92cae3f6dac7f89b559063de3be2f38587536b65) ) + ROM_LOAD16_BYTE( "mt2-sh0-.ic14", 0x00001, 0x10000, CRC(1ecbea43) SHA1(8d66ef419f75569f2c83a89c3985742b8a47914f) ) + ROM_LOAD16_BYTE( "mt2-sl0-.ic17", 0x00000, 0x10000, CRC(8fd5b531) SHA1(92cae3f6dac7f89b559063de3be2f38587536b65) ) ROM_REGION( 0x100000, "gfx1", 0 ) /* Tiles */ - ROM_LOAD( "c0", 0x000000, 0x40000, CRC(7e61e4b5) SHA1(d0164862937bd506e701777c51dea1ddb3e2eda4) ) - ROM_LOAD( "c1", 0x040000, 0x40000, CRC(0a667564) SHA1(d122e0619ae5cc0202f30270933784c954eb1e5d) ) - ROM_LOAD( "c2", 0x080000, 0x40000, CRC(5eb44312) SHA1(75b584b63d4f4f2236a679235461f11004aa317f) ) - ROM_LOAD( "c3", 0x0c0000, 0x40000, CRC(f2866294) SHA1(75e0071bf6282c93034dc7e73466af0f51046d01) ) + ROM_LOAD( "hr0.ic9", 0x000000, 0x40000, CRC(7e61e4b5) SHA1(d0164862937bd506e701777c51dea1ddb3e2eda4) ) + ROM_LOAD( "hr1.ic10", 0x040000, 0x40000, CRC(0a667564) SHA1(d122e0619ae5cc0202f30270933784c954eb1e5d) ) + ROM_LOAD( "hr2.ic11", 0x080000, 0x40000, CRC(5eb44312) SHA1(75b584b63d4f4f2236a679235461f11004aa317f) ) + ROM_LOAD( "hr3.ic12", 0x0c0000, 0x40000, CRC(f2866294) SHA1(75e0071bf6282c93034dc7e73466af0f51046d01) ) ROM_REGION( 0x400000, "gfx2", 0 ) /* Sprites */ - ROM_LOAD( "k30", 0x000000, 0x100000, CRC(8c9a2678) SHA1(e8ed119c16ddd59af9e83d243e7be25974f7cbf8) ) - ROM_LOAD( "k31", 0x100000, 0x100000, CRC(5455df78) SHA1(9e49bde1d5a310ff611932c3429601fbddf3a7b1) ) - ROM_LOAD( "k32", 0x200000, 0x100000, CRC(3a258c41) SHA1(1d93fcd01728929848b782870f80a8cd0af44796) ) - ROM_LOAD( "k33", 0x300000, 0x100000, CRC(c1e91a14) SHA1(1f0dbd99d8c5067dc3f8795fc3f1bd4466f64156) ) + ROM_LOAD( "k30.ic42", 0x000000, 0x100000, CRC(8c9a2678) SHA1(e8ed119c16ddd59af9e83d243e7be25974f7cbf8) ) + ROM_LOAD( "k31.ic43", 0x100000, 0x100000, CRC(5455df78) SHA1(9e49bde1d5a310ff611932c3429601fbddf3a7b1) ) + ROM_LOAD( "k32.ic44", 0x200000, 0x100000, CRC(3a258c41) SHA1(1d93fcd01728929848b782870f80a8cd0af44796) ) + ROM_LOAD( "k33.ic45", 0x300000, 0x100000, CRC(c1e91a14) SHA1(1f0dbd99d8c5067dc3f8795fc3f1bd4466f64156) ) ROM_REGION( 0x80000, "irem", 0 ) - ROM_LOAD( "da", 0x000000, 0x80000, CRC(713b9e9f) SHA1(91384d67d4ba9c7d926fbecb077293c661b8ec83) ) + ROM_LOAD( "k0d.ic8", 0x000000, 0x80000, CRC(713b9e9f) SHA1(91384d67d4ba9c7d926fbecb077293c661b8ec83) ) ROM_REGION( 0x4000, "eeprom", 0 ) /* D28C64C-20 EEPROM */ ROM_LOAD( "mt2eep", 0x000000, 0x800, CRC(208af971) SHA1(69384cac24b7af35a031f9b60e035131a8b10cb2) ) @@ -1217,23 +1217,23 @@ ROM_START( majtitl2 ) ROM_LOAD16_BYTE( "is-l1.5j", 0x80000, 0x40000, CRC(e4e00626) SHA1(e8c6c7ad6a367da4036915a155c8695ad90ae47b) ) ROM_REGION( 0x20000, "soundcpu", 0 ) - ROM_LOAD16_BYTE( "mt2sh0", 0x00001, 0x10000, CRC(1ecbea43) SHA1(8d66ef419f75569f2c83a89c3985742b8a47914f) ) - ROM_LOAD16_BYTE( "mt2sl0", 0x00000, 0x10000, CRC(8fd5b531) SHA1(92cae3f6dac7f89b559063de3be2f38587536b65) ) + ROM_LOAD16_BYTE( "mt2-sh0-.ic14", 0x00001, 0x10000, CRC(1ecbea43) SHA1(8d66ef419f75569f2c83a89c3985742b8a47914f) ) + ROM_LOAD16_BYTE( "mt2-sl0-.ic17", 0x00000, 0x10000, CRC(8fd5b531) SHA1(92cae3f6dac7f89b559063de3be2f38587536b65) ) ROM_REGION( 0x100000, "gfx1", 0 ) /* Tiles */ - ROM_LOAD( "c0", 0x000000, 0x40000, CRC(7e61e4b5) SHA1(d0164862937bd506e701777c51dea1ddb3e2eda4) ) - ROM_LOAD( "c1", 0x040000, 0x40000, CRC(0a667564) SHA1(d122e0619ae5cc0202f30270933784c954eb1e5d) ) - ROM_LOAD( "c2", 0x080000, 0x40000, CRC(5eb44312) SHA1(75b584b63d4f4f2236a679235461f11004aa317f) ) - ROM_LOAD( "c3", 0x0c0000, 0x40000, CRC(f2866294) SHA1(75e0071bf6282c93034dc7e73466af0f51046d01) ) + ROM_LOAD( "hr0.ic9", 0x000000, 0x40000, CRC(7e61e4b5) SHA1(d0164862937bd506e701777c51dea1ddb3e2eda4) ) + ROM_LOAD( "hr1.ic10", 0x040000, 0x40000, CRC(0a667564) SHA1(d122e0619ae5cc0202f30270933784c954eb1e5d) ) + ROM_LOAD( "hr2.ic11", 0x080000, 0x40000, CRC(5eb44312) SHA1(75b584b63d4f4f2236a679235461f11004aa317f) ) + ROM_LOAD( "hr3.ic12", 0x0c0000, 0x40000, CRC(f2866294) SHA1(75e0071bf6282c93034dc7e73466af0f51046d01) ) ROM_REGION( 0x400000, "gfx2", 0 ) /* Sprites */ - ROM_LOAD( "k30", 0x000000, 0x100000, CRC(8c9a2678) SHA1(e8ed119c16ddd59af9e83d243e7be25974f7cbf8) ) - ROM_LOAD( "k31", 0x100000, 0x100000, CRC(5455df78) SHA1(9e49bde1d5a310ff611932c3429601fbddf3a7b1) ) - ROM_LOAD( "k32", 0x200000, 0x100000, CRC(3a258c41) SHA1(1d93fcd01728929848b782870f80a8cd0af44796) ) - ROM_LOAD( "k33", 0x300000, 0x100000, CRC(c1e91a14) SHA1(1f0dbd99d8c5067dc3f8795fc3f1bd4466f64156) ) + ROM_LOAD( "k30.ic42", 0x000000, 0x100000, CRC(8c9a2678) SHA1(e8ed119c16ddd59af9e83d243e7be25974f7cbf8) ) + ROM_LOAD( "k31.ic43", 0x100000, 0x100000, CRC(5455df78) SHA1(9e49bde1d5a310ff611932c3429601fbddf3a7b1) ) + ROM_LOAD( "k32.ic44", 0x200000, 0x100000, CRC(3a258c41) SHA1(1d93fcd01728929848b782870f80a8cd0af44796) ) + ROM_LOAD( "k33.ic45", 0x300000, 0x100000, CRC(c1e91a14) SHA1(1f0dbd99d8c5067dc3f8795fc3f1bd4466f64156) ) ROM_REGION( 0x80000, "irem", 0 ) - ROM_LOAD( "da", 0x000000, 0x80000, CRC(713b9e9f) SHA1(91384d67d4ba9c7d926fbecb077293c661b8ec83) ) + ROM_LOAD( "k0d.ic8", 0x000000, 0x80000, CRC(713b9e9f) SHA1(91384d67d4ba9c7d926fbecb077293c661b8ec83) ) ROM_REGION( 0x4000, "eeprom", 0 ) /* D28C64C-20 EEPROM */ ROM_LOAD( "mt2eep", 0x000000, 0x800, CRC(208af971) SHA1(69384cac24b7af35a031f9b60e035131a8b10cb2) ) @@ -1246,6 +1246,45 @@ ROM_START( majtitl2 ) ROM_LOAD( "pal16l8-m92-b-7h.ic47", 0x0800, 0x0104, NO_DUMP ) /* PAL is read protected */ ROM_END + +ROM_START( majtitl2b ) + ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "mt2-h0-e.ic34", 0x00001, 0x40000, CRC(f6c3a28c) SHA1(27ef76c120d27119830e6b17353d2a6412cbcbbe) ) + ROM_LOAD16_BYTE( "mt2-l0-e.ic31", 0x00000, 0x40000, CRC(0a061384) SHA1(b033215bb99e645a00e7a364cebb895432917fd4) ) + ROM_LOAD16_BYTE( "mt2-h1-.ic33", 0x80001, 0x40000, CRC(9ba8e1f2) SHA1(ae86697a97223d236e2e6dd33ddb8105b9f926cb) ) + ROM_LOAD16_BYTE( "mt2-l1-.ic32", 0x80000, 0x40000, CRC(e4e00626) SHA1(e8c6c7ad6a367da4036915a155c8695ad90ae47b) ) + + ROM_REGION( 0x20000, "soundcpu", 0 ) + ROM_LOAD16_BYTE( "mt2-sh0-.ic14", 0x00001, 0x10000, CRC(1ecbea43) SHA1(8d66ef419f75569f2c83a89c3985742b8a47914f) ) + ROM_LOAD16_BYTE( "mt2-sl0-.ic17", 0x00000, 0x10000, CRC(8fd5b531) SHA1(92cae3f6dac7f89b559063de3be2f38587536b65) ) + + ROM_REGION( 0x100000, "gfx1", 0 ) /* Tiles */ + ROM_LOAD( "hr0.ic9", 0x000000, 0x40000, CRC(7e61e4b5) SHA1(d0164862937bd506e701777c51dea1ddb3e2eda4) ) + ROM_LOAD( "hr1.ic10", 0x040000, 0x40000, CRC(0a667564) SHA1(d122e0619ae5cc0202f30270933784c954eb1e5d) ) + ROM_LOAD( "hr2.ic11", 0x080000, 0x40000, CRC(5eb44312) SHA1(75b584b63d4f4f2236a679235461f11004aa317f) ) + ROM_LOAD( "hr3.ic12", 0x0c0000, 0x40000, CRC(f2866294) SHA1(75e0071bf6282c93034dc7e73466af0f51046d01) ) + + ROM_REGION( 0x400000, "gfx2", 0 ) /* Sprites */ + ROM_LOAD( "k30.ic42", 0x000000, 0x100000, CRC(8c9a2678) SHA1(e8ed119c16ddd59af9e83d243e7be25974f7cbf8) ) + ROM_LOAD( "k31.ic43", 0x100000, 0x100000, CRC(5455df78) SHA1(9e49bde1d5a310ff611932c3429601fbddf3a7b1) ) + ROM_LOAD( "k32.ic44", 0x200000, 0x100000, CRC(3a258c41) SHA1(1d93fcd01728929848b782870f80a8cd0af44796) ) + ROM_LOAD( "k33.ic45", 0x300000, 0x100000, CRC(c1e91a14) SHA1(1f0dbd99d8c5067dc3f8795fc3f1bd4466f64156) ) + + ROM_REGION( 0x80000, "irem", 0 ) + ROM_LOAD( "k0d.ic8", 0x000000, 0x80000, CRC(713b9e9f) SHA1(91384d67d4ba9c7d926fbecb077293c661b8ec83) ) + + ROM_REGION( 0x4000, "eeprom", 0 ) /* D28C64C-20 EEPROM */ + ROM_LOAD( "mt2eep", 0x000000, 0x800, CRC(208af971) SHA1(69384cac24b7af35a031f9b60e035131a8b10cb2) ) + + ROM_REGION( 0x0c00, "plds", 0 ) + ROM_LOAD( "pal16l8-m92-a-3m.ic11", 0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */ + ROM_LOAD( "pal16l8-m92-a-7j.ic41", 0x0200, 0x0104, NO_DUMP ) /* PAL is read protected */ + ROM_LOAD( "pal16l8-m92-a-9j.ic51", 0x0400, 0x0104, NO_DUMP ) /* PAL is read protected */ + ROM_LOAD( "pal16l8-m92-b-2l.ic7", 0x0600, 0x0104, NO_DUMP ) /* PAL is read protected */ + ROM_LOAD( "pal16l8-m92-b-7h.ic47", 0x0800, 0x0104, NO_DUMP ) /* PAL is read protected */ +ROM_END + + // this set matches the 'majtitl2' except for the soundcpu roms, which are for a different CPU ROM_START( majtitl2a ) ROM_REGION( 0x100000, "maincpu", 0 ) // labels differ from 'majtitl2' (maybe the 'B' has faded, or was never there?) @@ -1259,20 +1298,20 @@ ROM_START( majtitl2a ) ROM_LOAD16_BYTE( "mt2sl0-a", 0x00000, 0x10000, CRC(f4ecd7b5) SHA1(250afed334d37b0309f4733b41ba03319b51360f)) ROM_REGION( 0x100000, "gfx1", 0 ) /* Tiles */ - ROM_LOAD( "c0", 0x000000, 0x40000, CRC(7e61e4b5) SHA1(d0164862937bd506e701777c51dea1ddb3e2eda4) ) - ROM_LOAD( "c1", 0x040000, 0x40000, CRC(0a667564) SHA1(d122e0619ae5cc0202f30270933784c954eb1e5d) ) - ROM_LOAD( "c2", 0x080000, 0x40000, CRC(5eb44312) SHA1(75b584b63d4f4f2236a679235461f11004aa317f) ) - ROM_LOAD( "c3", 0x0c0000, 0x40000, CRC(f2866294) SHA1(75e0071bf6282c93034dc7e73466af0f51046d01) ) + ROM_LOAD( "hr0.ic9", 0x000000, 0x40000, CRC(7e61e4b5) SHA1(d0164862937bd506e701777c51dea1ddb3e2eda4) ) + ROM_LOAD( "hr1.ic10", 0x040000, 0x40000, CRC(0a667564) SHA1(d122e0619ae5cc0202f30270933784c954eb1e5d) ) + ROM_LOAD( "hr2.ic11", 0x080000, 0x40000, CRC(5eb44312) SHA1(75b584b63d4f4f2236a679235461f11004aa317f) ) + ROM_LOAD( "hr3.ic12", 0x0c0000, 0x40000, CRC(f2866294) SHA1(75e0071bf6282c93034dc7e73466af0f51046d01) ) ROM_REGION( 0x400000, "gfx2", 0 ) /* Sprites */ - ROM_LOAD( "k30", 0x000000, 0x100000, CRC(8c9a2678) SHA1(e8ed119c16ddd59af9e83d243e7be25974f7cbf8) ) - ROM_LOAD( "k31", 0x100000, 0x100000, CRC(5455df78) SHA1(9e49bde1d5a310ff611932c3429601fbddf3a7b1) ) - ROM_LOAD( "k32", 0x200000, 0x100000, CRC(3a258c41) SHA1(1d93fcd01728929848b782870f80a8cd0af44796) ) - ROM_LOAD( "k33", 0x300000, 0x100000, CRC(c1e91a14) SHA1(1f0dbd99d8c5067dc3f8795fc3f1bd4466f64156) ) + ROM_LOAD( "k30.ic42", 0x000000, 0x100000, CRC(8c9a2678) SHA1(e8ed119c16ddd59af9e83d243e7be25974f7cbf8) ) + ROM_LOAD( "k31.ic43", 0x100000, 0x100000, CRC(5455df78) SHA1(9e49bde1d5a310ff611932c3429601fbddf3a7b1) ) + ROM_LOAD( "k32.ic44", 0x200000, 0x100000, CRC(3a258c41) SHA1(1d93fcd01728929848b782870f80a8cd0af44796) ) + ROM_LOAD( "k33.ic45", 0x300000, 0x100000, CRC(c1e91a14) SHA1(1f0dbd99d8c5067dc3f8795fc3f1bd4466f64156) ) ROM_REGION( 0x80000, "irem", 0 ) - ROM_LOAD( "da", 0x000000, 0x80000, CRC(713b9e9f) SHA1(91384d67d4ba9c7d926fbecb077293c661b8ec83) ) - + ROM_LOAD( "k0d.ic8", 0x000000, 0x80000, CRC(713b9e9f) SHA1(91384d67d4ba9c7d926fbecb077293c661b8ec83) ) + ROM_REGION( 0x4000, "eeprom", 0 ) /* D28C64C-20 EEPROM */ ROM_LOAD( "mt2eep", 0x000000, 0x800, CRC(208af971) SHA1(69384cac24b7af35a031f9b60e035131a8b10cb2) ) @@ -1292,23 +1331,23 @@ ROM_START( majtitl2j ) ROM_LOAD16_BYTE( "is-l1.5j", 0x80000, 0x40000, CRC(e4e00626) SHA1(e8c6c7ad6a367da4036915a155c8695ad90ae47b) ) ROM_REGION( 0x20000, "soundcpu", 0 ) - ROM_LOAD16_BYTE( "mt2sh0", 0x00001, 0x10000, CRC(1ecbea43) SHA1(8d66ef419f75569f2c83a89c3985742b8a47914f) ) - ROM_LOAD16_BYTE( "mt2sl0", 0x00000, 0x10000, CRC(8fd5b531) SHA1(92cae3f6dac7f89b559063de3be2f38587536b65) ) + ROM_LOAD16_BYTE( "mt2-sh0-.ic14", 0x00001, 0x10000, CRC(1ecbea43) SHA1(8d66ef419f75569f2c83a89c3985742b8a47914f) ) + ROM_LOAD16_BYTE( "mt2-sl0-.ic17", 0x00000, 0x10000, CRC(8fd5b531) SHA1(92cae3f6dac7f89b559063de3be2f38587536b65) ) ROM_REGION( 0x100000, "gfx1", 0 ) /* Tiles */ - ROM_LOAD( "c0", 0x000000, 0x40000, CRC(7e61e4b5) SHA1(d0164862937bd506e701777c51dea1ddb3e2eda4) ) - ROM_LOAD( "c1", 0x040000, 0x40000, CRC(0a667564) SHA1(d122e0619ae5cc0202f30270933784c954eb1e5d) ) - ROM_LOAD( "c2", 0x080000, 0x40000, CRC(5eb44312) SHA1(75b584b63d4f4f2236a679235461f11004aa317f) ) - ROM_LOAD( "c3", 0x0c0000, 0x40000, CRC(f2866294) SHA1(75e0071bf6282c93034dc7e73466af0f51046d01) ) + ROM_LOAD( "hr0.ic9", 0x000000, 0x40000, CRC(7e61e4b5) SHA1(d0164862937bd506e701777c51dea1ddb3e2eda4) ) + ROM_LOAD( "hr1.ic10", 0x040000, 0x40000, CRC(0a667564) SHA1(d122e0619ae5cc0202f30270933784c954eb1e5d) ) + ROM_LOAD( "hr2.ic11", 0x080000, 0x40000, CRC(5eb44312) SHA1(75b584b63d4f4f2236a679235461f11004aa317f) ) + ROM_LOAD( "hr3.ic12", 0x0c0000, 0x40000, CRC(f2866294) SHA1(75e0071bf6282c93034dc7e73466af0f51046d01) ) ROM_REGION( 0x400000, "gfx2", 0 ) /* Sprites */ - ROM_LOAD( "k30", 0x000000, 0x100000, CRC(8c9a2678) SHA1(e8ed119c16ddd59af9e83d243e7be25974f7cbf8) ) - ROM_LOAD( "k31", 0x100000, 0x100000, CRC(5455df78) SHA1(9e49bde1d5a310ff611932c3429601fbddf3a7b1) ) - ROM_LOAD( "k32", 0x200000, 0x100000, CRC(3a258c41) SHA1(1d93fcd01728929848b782870f80a8cd0af44796) ) - ROM_LOAD( "k33", 0x300000, 0x100000, CRC(c1e91a14) SHA1(1f0dbd99d8c5067dc3f8795fc3f1bd4466f64156) ) + ROM_LOAD( "k30.ic42", 0x000000, 0x100000, CRC(8c9a2678) SHA1(e8ed119c16ddd59af9e83d243e7be25974f7cbf8) ) + ROM_LOAD( "k31.ic43", 0x100000, 0x100000, CRC(5455df78) SHA1(9e49bde1d5a310ff611932c3429601fbddf3a7b1) ) + ROM_LOAD( "k32.ic44", 0x200000, 0x100000, CRC(3a258c41) SHA1(1d93fcd01728929848b782870f80a8cd0af44796) ) + ROM_LOAD( "k33.ic45", 0x300000, 0x100000, CRC(c1e91a14) SHA1(1f0dbd99d8c5067dc3f8795fc3f1bd4466f64156) ) ROM_REGION( 0x80000, "irem", 0 ) - ROM_LOAD( "da", 0x000000, 0x80000, CRC(713b9e9f) SHA1(91384d67d4ba9c7d926fbecb077293c661b8ec83) ) + ROM_LOAD( "k0d.ic8", 0x000000, 0x80000, CRC(713b9e9f) SHA1(91384d67d4ba9c7d926fbecb077293c661b8ec83) ) ROM_REGION( 0x4000, "eeprom", 0 ) /* D28C64C-20 EEPROM */ ROM_LOAD( "mt2eep", 0x000000, 0x800, CRC(208af971) SHA1(69384cac24b7af35a031f9b60e035131a8b10cb2) ) @@ -1329,23 +1368,23 @@ ROM_START( skingame2 ) ROM_LOAD16_BYTE( "is-l1.5j", 0x80000, 0x40000, CRC(e4e00626) SHA1(e8c6c7ad6a367da4036915a155c8695ad90ae47b) ) ROM_REGION( 0x20000, "soundcpu", 0 ) - ROM_LOAD16_BYTE( "mt2sh0", 0x00001, 0x10000, CRC(1ecbea43) SHA1(8d66ef419f75569f2c83a89c3985742b8a47914f) ) - ROM_LOAD16_BYTE( "mt2sl0", 0x00000, 0x10000, CRC(8fd5b531) SHA1(92cae3f6dac7f89b559063de3be2f38587536b65) ) + ROM_LOAD16_BYTE( "mt2-sh0-.ic14", 0x00001, 0x10000, CRC(1ecbea43) SHA1(8d66ef419f75569f2c83a89c3985742b8a47914f) ) + ROM_LOAD16_BYTE( "mt2-sl0-.ic17", 0x00000, 0x10000, CRC(8fd5b531) SHA1(92cae3f6dac7f89b559063de3be2f38587536b65) ) ROM_REGION( 0x100000, "gfx1", 0 ) /* Tiles */ - ROM_LOAD( "c0", 0x000000, 0x40000, CRC(7e61e4b5) SHA1(d0164862937bd506e701777c51dea1ddb3e2eda4) ) - ROM_LOAD( "c1", 0x040000, 0x40000, CRC(0a667564) SHA1(d122e0619ae5cc0202f30270933784c954eb1e5d) ) - ROM_LOAD( "c2", 0x080000, 0x40000, CRC(5eb44312) SHA1(75b584b63d4f4f2236a679235461f11004aa317f) ) - ROM_LOAD( "c3", 0x0c0000, 0x40000, CRC(f2866294) SHA1(75e0071bf6282c93034dc7e73466af0f51046d01) ) + ROM_LOAD( "hr0.ic9", 0x000000, 0x40000, CRC(7e61e4b5) SHA1(d0164862937bd506e701777c51dea1ddb3e2eda4) ) + ROM_LOAD( "hr1.ic10", 0x040000, 0x40000, CRC(0a667564) SHA1(d122e0619ae5cc0202f30270933784c954eb1e5d) ) + ROM_LOAD( "hr2.ic11", 0x080000, 0x40000, CRC(5eb44312) SHA1(75b584b63d4f4f2236a679235461f11004aa317f) ) + ROM_LOAD( "hr3.ic12", 0x0c0000, 0x40000, CRC(f2866294) SHA1(75e0071bf6282c93034dc7e73466af0f51046d01) ) ROM_REGION( 0x400000, "gfx2", 0 ) /* Sprites */ - ROM_LOAD( "k30", 0x000000, 0x100000, CRC(8c9a2678) SHA1(e8ed119c16ddd59af9e83d243e7be25974f7cbf8) ) - ROM_LOAD( "k31", 0x100000, 0x100000, CRC(5455df78) SHA1(9e49bde1d5a310ff611932c3429601fbddf3a7b1) ) - ROM_LOAD( "k32", 0x200000, 0x100000, CRC(3a258c41) SHA1(1d93fcd01728929848b782870f80a8cd0af44796) ) - ROM_LOAD( "k33", 0x300000, 0x100000, CRC(c1e91a14) SHA1(1f0dbd99d8c5067dc3f8795fc3f1bd4466f64156) ) + ROM_LOAD( "k30.ic42", 0x000000, 0x100000, CRC(8c9a2678) SHA1(e8ed119c16ddd59af9e83d243e7be25974f7cbf8) ) + ROM_LOAD( "k31.ic43", 0x100000, 0x100000, CRC(5455df78) SHA1(9e49bde1d5a310ff611932c3429601fbddf3a7b1) ) + ROM_LOAD( "k32.ic44", 0x200000, 0x100000, CRC(3a258c41) SHA1(1d93fcd01728929848b782870f80a8cd0af44796) ) + ROM_LOAD( "k33.ic45", 0x300000, 0x100000, CRC(c1e91a14) SHA1(1f0dbd99d8c5067dc3f8795fc3f1bd4466f64156) ) ROM_REGION( 0x80000, "irem", 0 ) - ROM_LOAD( "da", 0x000000, 0x80000, CRC(713b9e9f) SHA1(91384d67d4ba9c7d926fbecb077293c661b8ec83) ) + ROM_LOAD( "k0d.ic8", 0x000000, 0x80000, CRC(713b9e9f) SHA1(91384d67d4ba9c7d926fbecb077293c661b8ec83) ) ROM_REGION( 0x4000, "eeprom", 0 ) /* D28C64C-20 EEPROM */ ROM_LOAD( "mt2eep", 0x000000, 0x800, CRC(208af971) SHA1(69384cac24b7af35a031f9b60e035131a8b10cb2) ) @@ -2269,8 +2308,9 @@ GAME( 1992, gunhohki, mysticri, mysticri, mysticri, m92_state, m92, RO // main code is also significantly different to the supported original set, so it might just be a legitimate early revision on a cheap board GAME( 1992, mysticrib,mysticri, mysticri, mysticri, m92_state, m92, ROT0, "Irem", "Mystic Riders (bootleg?)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) -GAME( 1992, majtitl2, 0, majtitl2, majtitl2, m92_state, majtitl2, ROT0, "Irem", "Major Title 2 (World)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL) // Nanao 08J27291A7 017 9227NK700 sound CPU -GAME( 1992, majtitl2a,majtitl2, mysticri, majtitl2, m92_state, majtitl2, ROT0, "Irem", "Major Title 2 (World, alt sound CPU)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL) // Nanao 08J27291A6 016 9217NK700 sound CPU +GAME( 1992, majtitl2, 0, majtitl2, majtitl2, m92_state, majtitl2, ROT0, "Irem", "Major Title 2 (World, set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL) // Nanao 08J27291A7 017 9227NK700 sound CPU +GAME( 1992, majtitl2a,majtitl2, mysticri, majtitl2, m92_state, majtitl2, ROT0, "Irem", "Major Title 2 (World, set 1, alt sound CPU)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL) // same as set 1 but for the Nanao 08J27291A6 016 9217NK700 sound CPU +GAME( 1992, majtitl2b,majtitl2, majtitl2, majtitl2, m92_state, majtitl2, ROT0, "Irem", "Major Title 2 (World, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL) GAME( 1992, majtitl2j,majtitl2, majtitl2, majtitl2, m92_state, majtitl2, ROT0, "Irem", "Major Title 2 (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL) GAME( 1992, skingame, majtitl2, majtitl2, majtitl2, m92_state, majtitl2, ROT0, "Irem America", "The Irem Skins Game (US set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) GAME( 1992, skingame2,majtitl2, majtitl2, majtitl2, m92_state, majtitl2, ROT0, "Irem America", "The Irem Skins Game (US set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) diff --git a/src/mame/drivers/madmotor.cpp b/src/mame/drivers/madmotor.cpp index 34d50a6e22f..dd3e60bafff 100644 --- a/src/mame/drivers/madmotor.cpp +++ b/src/mame/drivers/madmotor.cpp @@ -255,19 +255,18 @@ static MACHINE_CONFIG_START( madmotor, madmotor_state ) MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,0,0,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 0, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,0,1,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 1, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("tilegen3", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,0,2,1); + MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 2, 1) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) - deco_mxc06_device::set_gfx_region(*device, 3); + MCFG_DECO_MXC06_GFX_REGION(3) MCFG_DECO_MXC06_GFXDECODE("gfxdecode") - MCFG_DECO_MXC06_PALETTE("palette") diff --git a/src/mame/drivers/magic10.cpp b/src/mame/drivers/magic10.cpp index 6005f807aac..82a1e8f1757 100644 --- a/src/mame/drivers/magic10.cpp +++ b/src/mame/drivers/magic10.cpp @@ -2,82 +2,82 @@ // copyright-holders:Pierpaolo Prazzoli, Roberto Fresca /**************************************************************************** - MAGIC'S 10 - ---------- + MAGIC'S 10 + ---------- - Driver by Pierpaolo Prazzoli. - Additional work by Roberto Fresca. + Driver by Pierpaolo Prazzoli. + Additional work by Roberto Fresca. - Supported games: - - Magic's 10 (ver. 16.15), 1995, AWP Games. - Magic's 10 (ver. 16.45), 1995, AWP Games. - Magic's 10 (ver. 16.54), 1995, AWP Games. - Magic's 10 (ver. 16.55), 1995, AWP Games. - Magic's 10 2, 1997, ABM Games. - Music Sort (ver 2.02, English), 1995, ABM Games. - Super Pool (9743 rev.01), 1997, ABM Games. - Hot Slot (ver. 05.01), 1996, ABM Electronics. - Magic Colors (ver. 1.7a), 1999, Unknown. - Super Gran Safari (ver 3.11), 1996, New Impeuropex Corp. + Supported games: + Magic's 10 (ver. 16.15), 1995, AWP Games. + Magic's 10 (ver. 16.45), 1995, AWP Games. + Magic's 10 (ver. 16.54), 1995, AWP Games. + Magic's 10 (ver. 16.55), 1995, AWP Games. + Magic's 10 2, 1997, ABM Games. + Music Sort (ver 2.02, English), 1995, ABM Games. + Super Pool (9743 rev.01), 1997, ABM Games. + Hot Slot (ver. 05.01), 1996, ABM Electronics. + Magic Colors (ver. 1.7a), 1999, Unknown. + Super Gran Safari (ver 3.11), 1996, New Impeuropex Corp. + Luna Park (ver. 1.2), 1998, ABM Games. ***************************************************************************** + Game Notes + ========== - Game Notes - ========== - - - * Magic's 10 - - First time boot instructions: + * Magic's 10 - - Switch "Disable Free Play" to ON - - Enter a coin - - Press Collect to get the 1st game over + First time boot instructions: + - Switch "Disable Free Play" to ON + - Enter a coin + - Press Collect to get the 1st game over - * Super Gran Safari + * Super Gran Safari - There is a input sequence to initialize the game. + There is a input sequence to initialize the game. - The code expects a mask of 0x4c00 in the DIP switches port to allow - enter the sequence, so DIP switches must be on default position. + The code expects a mask of 0x4c00 in the DIP switches port to allow + enter the sequence, so DIP switches must be on default position. - When you see the black screen, enter the following sequence: - HOLD 4 (key V), HOLD 2 (key X), HOLD 5 (key B), START (key 1). + When you see the black screen, enter the following sequence: + HOLD 4 (key V), HOLD 2 (key X), HOLD 5 (key B), START (key 1). - The code is checking for a 5th entry. In fact expects HOLD 3 as the first - entry, then the rest listed above. I don't know why bypass the first one. - Input port bits are checked in the following order: 2, 3, 1, 4, 5. - - The player can play the "Super Game" to grab the points. - In this subgame, you must to hit the lion to get the prize. - For now, you must miss the shot till hopper & ticket dispenser are properly emulated. + The code is checking for a 5th entry. In fact expects HOLD 3 as the first + entry, then the rest listed above. I don't know why bypass the first one. + Input port bits are checked in the following order: 2, 3, 1, 4, 5. + The player can play the "Super Game" to grab the points. + In this subgame, you must to hit the lion to get the prize. + For now, you must miss the shot till hopper & ticket dispenser are properly emulated. ***************************************************************************** + TODO: - TODO: + - Ticket / Hopper support. + - Some unknown writes + - Finish magic10_2 (association coin - credits handling its inputs + and some reads that drive the note displayed?) + - Dump/decap/trojan the MCU in the later games (magic102, suprpool, hotslot, mcolors). + The MCU shares memory addresses at $500000-$50001f (in magic102) + It can't be simulated with a high level of confidence because all the game logic is + in there, including rngs for the cards and combinations for the points. + - Priorities,likely to be hardwired with the color writes (0=tile has the + highest priority). + - Define parent/clone relationship between Magic's 10 and Music Sort. - - Ticket / Hopper support. - - Some unknown writes - - Finish magic10_2 (association coin - credits handling its inputs - and some reads that drive the note displayed?) - - Dump/decap/trojan the MCU in the later games (magic102, suprpool, hotslot, mcolors). - The MCU shares memory addresses at $500000-$50001f (in magic102) - It can't be simulated with a high level of confidence because all the game logic is - in there, including rngs for the cards and combinations for the points. - - Priorities,likely to be hardwired with the color writes (0=tile has the - highest priority). - - Define parent/clone relationship between Magic's 10 and Music Sort. +****************************************************************************/ -****************************************************************************/ +#define MAIN_CLOCK XTAL_20MHz +#define AUX_CLOCK XTAL_30MHz + +#define CPU_CLOCK MAIN_CLOCK/2 #include "emu.h" @@ -249,22 +249,22 @@ WRITE16_MEMBER(magic10_state::magic10_out_w) 0x0400 - Coin counter. - - Lbits - - 7654 3210 - ========= - ---- ---x Hold1 lamp. - ---- --x- Hold2 lamp. - ---- -x-- Hold3 lamp. - ---- x--- Hold4 lamp. - ---x ---- Hold5 lamp. - --x- ---- Start lamp. - -x-- ---- Play (Bet/Take/Cancel) lamp. + - Lbits - + 7654 3210 + ========= + ---- ---x Hold1 lamp. + ---- --x- Hold2 lamp. + ---- -x-- Hold3 lamp. + ---- x--- Hold4 lamp. + ---x ---- Hold5 lamp. + --x- ---- Start lamp. + -x-- ---- Play (Bet/Take/Cancel) lamp. - - Hbits - - 7654 3210 - ========= - ---- ---x Payout lamp. - ---- -x-- Coin counter. + - Hbits - + 7654 3210 + ========= + ---- ---x Payout lamp. + ---- -x-- Coin counter. */ @@ -719,9 +719,9 @@ GFXDECODE_END static MACHINE_CONFIG_START( magic10, magic10_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, 10000000) // ? + MCFG_CPU_ADD("maincpu", M68000, CPU_CLOCK) // 10 MHz. MCFG_CPU_PROGRAM_MAP(magic10_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", magic10_state, irq1_line_hold) + MCFG_CPU_VBLANK_INT_DRIVER("screen", magic10_state, irq1_line_hold) MCFG_NVRAM_ADD_0FILL("nvram") @@ -780,7 +780,7 @@ static MACHINE_CONFIG_DERIVED( sgsafari, magic10 ) /* basic machine hardware */ MCFG_CPU_MODIFY("maincpu") MCFG_CPU_PROGRAM_MAP(sgsafari_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", magic10_state, irq2_line_hold) /* L1 interrupts */ + MCFG_CPU_VBLANK_INT_DRIVER("screen", magic10_state, irq2_line_hold) /* L1 interrupts */ MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_VISIBLE_AREA(0*8, 44*8-1, 0*8, 30*8-1) @@ -792,16 +792,15 @@ MACHINE_CONFIG_END ****************************/ /* + Magic 10 (videopoker) -Magic 10 (videopoker) - -1x 68k -1x 20mhz OSC near 68k -1x Oki M6295 -1x 30mhz OSC near oki chip -2x fpga -1x bank of Dipswitch -1x Dallas Ds1220y-200 Nonvolatile ram + 1x 68000 + 1x 20mhz OSC near 68k + 1x Oki M6295 + 1x 30mhz OSC near oki chip + 2x fpga + 1x bank of Dipswitch + 1x Dallas Ds1220y-200 Nonvolatile ram */ ROM_START( magic10 ) @@ -850,36 +849,35 @@ ROM_START( magic10b ) ROM_END /* + Magic's 10 (ver. 16.15) -Magic's 10 (ver. 16.15) + 1995, A.W.P. Games + Version: 16.15 -1995, A.W.P. Games -Version: 16.15 + CPU: + 1x TS68000P12 (main)(u1) + 2x TPC1020AFN-084C (PLD)(not dumped)(u41,u60) -CPU: -1x TS68000P12 (main)(u1) -2x TPC1020AFN-084C (PLD)(not dumped)(u41,u60) + Sound: + 1x OKI M6295 (u21) + 1x TDA2003 (u24) + 1x LM358N -Sound: -1x OKI M6295 (u21) -1x TDA2003 (u24) -1x LM358N + 1x oscillator 20.000000MHz (close to main)(osc1) + 1x oscillator 30.000MHz (close to sound)(osc2) + 1x orange resonator 1000J (close to sound)(xtal1) -1x oscillator 20.000000MHz (close to main)(osc1) -1x oscillator 30.000MHz (close to sound)(osc2) -1x orange resonator 1000J (close to sound)(xtal1) + ROMs: + 1x M27C2001 (1) + 6x M27C1001 (2,3,5,6,7) + 1x TMS27C010A (4) + 1x PALCE16V8H (read protected) -ROMs: -1x M27C2001 (1) -6x M27C1001 (2,3,5,6,7) -1x TMS27C010A (4) -1x PALCE16V8H (read protected) - -Note: -1x 28x2 edge connector -1x trimmer (volume) -1x 8x2 switches dip -1x battery + Note: + 1x 28x2 edge connector + 1x trimmer (volume) + 1x 8x2 switches dip + 1x battery */ ROM_START( magic10c ) @@ -898,17 +896,16 @@ ROM_START( magic10c ) ROM_END /* + PCB is marked: Copyright ABM - 9605 Rev.02 -pcb is marked: Copyright ABM - 9605 Rev.02 - -1x 68000 -1x osc 30mhz -1x osc 20mhz (near the 68k) -1x h8/330 HD6473308cp10 -1x dipswitch -1x battery -1x fpga by Actel -1x oki6295 + 1x 68000 + 1x osc 30mhz + 1x osc 20mhz (near the 68k) + 1x h8/330 HD6473308cp10 + 1x dipswitch + 1x battery + 1x fpga by Actel + 1x oki6295 */ ROM_START( magic102 ) @@ -930,33 +927,32 @@ ROM_START( magic102 ) ROM_END /* - -Super Pool - -ABM (Nazionale Elettronica Giochi S.A.S.), 1998. -9743 Rev.01 - -1x MC68HC000P10 -1x ACTEL A1020B-PL84C -1x HD6473308CP10 (label says: do not remove version 1.2) -1x U6295 (sound) -1x LM358N (sound) -1x TDA2003 (sound) -1x oscillator 20.000MHz -1x oscillator 30.0000MHz -1x blu resonator 1000J (close to sound) - -1x M27C2001 (1) (Sound) -2x TMS27C010A (2,3) (main) -4x TMS27C010A (4,5,6,7) (gfx) -1x PALCE22V10H (not dumped) -1x PALCE16V8H (not dumped) - -1x 28x2 JAMMA edge connector -1x 12 legs connector (J1) -1x trimmer (volume) -1x 8x2 switches dip -1x lithium battery + Super Pool + + ABM (Nazionale Elettronica Giochi S.A.S.), 1998. + PCB: 9743 Rev.01 + + 1x MC68HC000P10 + 1x ACTEL A1020B-PL84C + 1x HD6473308CP10 (label says: do not remove version 1.2) + 1x U6295 (sound) + 1x LM358N (sound) + 1x TDA2003 (sound) + 1x oscillator 20.000MHz + 1x oscillator 30.0000MHz + 1x blu resonator 1000J (close to sound) + + 1x M27C2001 (1) (Sound) + 2x TMS27C010A (2,3) (main) + 4x TMS27C010A (4,5,6,7) (gfx) + 1x PALCE22V10H (not dumped) + 1x PALCE16V8H (not dumped) + + 1x 28x2 JAMMA edge connector + 1x 12 legs connector (J1) + 1x trimmer (volume) + 1x 8x2 switches dip + 1x lithium battery STATUS: @@ -989,47 +985,45 @@ ROM_START( suprpool ) ROM_END /* + Hot Slot -Hot Slot + CPU: + 1x missing CPU (QFP68 socket, u1) + 1x HD6473308CP10 (u24)(MCU) + 1x A40MX04-PL84-9828 (u50) -CPU: -1x HD6473308CP10 (u24)(main) -1x A40MX04-PL84-9828 (u50)(main) -1x missing PLD (u1) + 1x 6295 (u31)(sound) + 1x KA358 (u33)(sound) + 1x TDA2003 (u34)(sound) -1x 6295 (u31)(sound) -1x KA358 (u33)(sound) -1x TDA2003 (u34)(sound) + 1x oscillator 20.0000MHz (OSC1) + 1x 1000J blue resonator (XTAL1) -1x oscillator 20.0000MHz (OSC1) -1x 1000J blu resonator (XTAL1) + ROMs: + 3x 27C2001 (1,4,6) + 2x 27C020 (5,7) + 2x 27C010 (2,3) + 1x GAL16V8D (as PAL16R4)(read protected) + 1x missing PAL22V10 -ROMs: -3x 27C2001 (1,4,6) -2x 27C020 (5,7) -2x 27C010 (2,3) -1x GAL16V8D (as PAL16R4)(read protected) -1x missing PAL22V10 + Note: + 1x 28x2 edge connector + 1x trimmer (volume) + 1n trimmer (unknown) + 3x 12 legs connector (J1,J2,J3) + 1x 8x2 switches DIP -Note: -1x 28x2 edge connector -1x trimmer (volume) -1n trimmer (unknown) -3x 12 legs connector (J1,J2,J3) -1x 8x2 switches DIP + - The system RAM test need the bit 7 of offset 0x500005 activated to be successful. + This offset seems to be a kind of port connected to the MCU. -- Co-processor is unknown, but fits in a QFP68 socket. -- The system RAM test need the bit 7 of offset 0x500005 activated to be successful. - This offset seems to be a kind of port. + code: - code: + 0x00f550 move.b #$b, $500005 + 0x00f558 btst #$7, $500005 + 0x00f560 beq $f558 + .... - 0x00f550 move.b #$b, $500005 - 0x00f558 btst #$7, $500005 - 0x00f560 beq $f558 - .... - - seems to copy some bytes (maybe commands) and wait for the status on bit 7 + seems to copy some bytes (maybe commands) and wait for the status on bit 7 STATUS: @@ -1062,31 +1056,30 @@ ROM_START( hotslot ) ROM_END /* + Magic Colors -Magic Colors - -CPU: -1x HD6473308CP10 (u24)(main) -1x A40MX04-PL84-9828 (u50)(main) -1x missing PLD (u1) + CPU: + 1x missing CPU (QFP68 socket, u1) + 1x HD6473308CP10 (u24)(MCU) + 1x A40MX04-PL84-9828 (u50) -1x M6295 (u31)(sound) -1x KA358 (u33)(sound) -1x TDA2003 (u34)(sound) + 1x M6295 (u31)(sound) + 1x KA358 (u33)(sound) + 1x TDA2003 (u34)(sound) -1x oscillator 20.0000MHz (OSC1) -1x 1000J blu resonator (XTAL1) + 1x oscillator 20.0000MHz (OSC1) + 1x 1000J blu resonator (XTAL1) -ROMs: -6x 27C010 (2,3,4,5,6,7) -1x 27C020 (1) -1x GAL16V8D (as PAL16R4)(read protected) -1x missing PAL22V10 + ROMs: + 6x 27C010 (2,3,4,5,6,7) + 1x 27C020 (1) + 1x GAL16V8D (as PAL16R4)(read protected) + 1x missing PAL22V10 -Note: -1x 28x2 edge connector -1x trimmer (volume) -1x 12 legs connector (J1,J2,J3) + Note: + 1x 28x2 edge connector + 1x trimmer (volume) + 1x 12 legs connector (J1,J2,J3) STATUS: @@ -1119,32 +1112,31 @@ ROM_START( mcolors ) ROM_END /* + Super Gran Safari + 1996 - New Impeuropex Corp. -Super Gran Safari -1996 - New Impeuropex Corp. + CPU: + 1x MC68000P12 (main) + 2x A1020B-PL84C (not dumped) -CPU: -1x MC68000P12 (main) -2x A1020B-PL84C (not dumped) + 1x M6295 (sound) + 1x TDA2002 (sound) + 1x GL324 (sound) -1x M6295 (sound) -1x TDA2002 (sound) -1x GL324 (sound) + 1x oscillator 30.000MHz -1x oscillator 30.000MHz + ROMs: + 2x M27C512 (1,2) + 1x M27C2001 (3) + 4x M27C1001 (4,5,6,7) -ROMs: -2x M27C512 (1,2) -1x M27C2001 (3) -4x M27C1001 (4,5,6,7) - -Note: -1x JAMMA edge connector -1x 12 legs connector (j2) -1x 8x2 switches dip -1x 4 legs jumper (j3) -1x 2 legs jumper (j4) -1x trimmer (volume) + Note: + 1x JAMMA edge connector + 1x 12 legs connector (j2) + 1x 8x2 switches dip + 1x 4 legs jumper (j3) + 1x 2 legs jumper (j4) + 1x trimmer (volume) STATUS: @@ -1174,28 +1166,27 @@ ROM_START( sgsafari ) ROM_END /* + Music Sort (Ver. 2.02). + Same PCB than Magic's 10 (ver. 16.15) -Music Sort (Ver. 2.02). -Same PCB than Magic's 10 (ver. 16.15) - -CPU: -1x TS68000P12 (main) -2x TPC1020AFN-084C (PLD)(not dumped) + CPU: + 1x TS68000P12 (main) + 2x TPC1020AFN-084C (PLD)(not dumped) -Sound: -1x OKI M6295 -1x TDA2003 -1x LM358N + Sound: + 1x OKI M6295 + 1x TDA2003 + 1x LM358N -1x oscillator 20.000000MHz (close to main) -1x oscillator 30.000MHz (close to sound) -1x orange resonator 1000J (close to sound) + 1x oscillator 20.000000MHz (close to main) + 1x oscillator 30.000MHz (close to sound) + 1x orange resonator 1000J (close to sound) -Note: -1x 28x2 edge connector -1x trimmer (volume) -1x 8x2 switches dip -1x battery + Note: + 1x 28x2 edge connector + 1x trimmer (volume) + 1x 8x2 switches dip + 1x battery */ ROM_START( musicsrt ) @@ -1216,30 +1207,95 @@ ROM_START( musicsrt ) ROM_LOAD( "musicsrt_nv.bin", 0x0000, 0x0800, CRC(f4e063cf) SHA1(a60bbd960bb7dcf023417e8c7164303b6ce71014) ) ROM_END +/* + Luna Park (ver. 1.2) + 1998.25.11 + ABM games. + + PCB: ABM 9743 Rev.02 + + 1x MC68HC000FN10 (u1) 16/32-bit Microprocessor. + 1x HD6473308CP10 (u24) label: version 1.2 - 16-bit Single-Chip Microcomputer. NOT DUMPED. + + 1x M6295 (u31) 4-Channel Mixing ADCPM Voice Synthesis LSI. + 1x LM358N (u33) Dual Operational Amplifier. + 1x TDA2003 (u34) Audio Amplifier. + + 1x 20.000000MHz oscillator (osc1). + 1x 30.000MHz oscillator (osc2). + 1x blu resonator 1000J (xtal1). + + 6x AM27C010 ROMs(2-7). + 1x AM27C020 ROM (1). + + 1x LH5116-10 RAM (u6). + 4x HY6264ALP-10 RAM (u4, u5, u43, u44). + 2x HM3-65728H-8 RAM (u61, u62). + + 1x TPC1020AFN-084C (u50), read protected. + 1x PALCE16V8H-25PC/4 (u54), read protected. + 1x PALC22V10H-25PC/4 (u22), read protected. + + 1x 28x2 JAMMA edge connector. + 1x 12-pins male connector (JP1). + 1x trimmer (volume)(P1). + 1x 8x2 DIP switches (DIP1). + 1x Renata 3V. CR2032 lithium battery. + + + STATUS: + + Memory map = done. + Inputs = done. + Machine = done. + + OKI 6295 = ok. + Screen size = ok. + Fixed layers = yes. + +*/ +ROM_START( lunaprk ) + ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD16_BYTE( "2_2.00a.u3", 0x00000, 0x20000, CRC(5ec3d238) SHA1(a9e257275cd81b74309d20bc64b10f788ca1b22a) ) + ROM_LOAD16_BYTE( "3_2.00a.u2", 0x00001, 0x20000, CRC(6fceb57b) SHA1(f9cf566c60f9c1c604dbfeb9c3ad4831bb3922d4) ) + + ROM_REGION( 0x10000, "mcu", 0 ) /* h8/330 HD6473308cp10 with internal ROM */ + ROM_LOAD( "mcu", 0x00000, 0x10000, NO_DUMP ) + + ROM_REGION( 0x80000, "gfx1", 0 ) /* graphics */ + ROM_LOAD( "7_l.p..u35", 0x00000, 0x20000, CRC(dfd6795d) SHA1(01929c31b5cc9468674830d9f687b2d3607d8052) ) + ROM_LOAD( "6_l.p..u36", 0x20000, 0x20000, CRC(fe323a28) SHA1(1cfba6c8359efed48506e8ae231926fb77469aaa) ) + ROM_LOAD( "5_l.p..u37", 0x40000, 0x20000, CRC(445b6564) SHA1(3568bcbcbdafa8503b50de960c370c85f2fbf62a) ) + ROM_LOAD( "4_l.p..u38", 0x60000, 0x20000, CRC(81567520) SHA1(4a1990ee19b2346824bb5b9f2880db12a414fdf7) ) + + ROM_REGION( 0x080000, "oki", 0 ) /* ADPCM samples */ + ROM_LOAD( "1.u32", 0x00000, 0x40000, CRC(47804af7) SHA1(602dc0361869b52532e2adcb0de3cbdd042761b3) ) +ROM_END + /**************************** * Driver Init * ****************************/ -DRIVER_INIT_MEMBER(magic10_state,magic10) +DRIVER_INIT_MEMBER(magic10_state, magic10) { m_layer2_offset[0] = 32; m_layer2_offset[1] = 2; } -DRIVER_INIT_MEMBER(magic10_state,magic102) +DRIVER_INIT_MEMBER(magic10_state, magic102) { m_layer2_offset[0] = 8; m_layer2_offset[1] = 20; } -DRIVER_INIT_MEMBER(magic10_state,suprpool) +DRIVER_INIT_MEMBER(magic10_state, suprpool) { m_layer2_offset[0] = 8; m_layer2_offset[1] = 16; } -DRIVER_INIT_MEMBER(magic10_state,hotslot) +DRIVER_INIT_MEMBER(magic10_state, hotslot) { /* a value of -56 center the playfield, but displace the intro and initial screen. a value of -64 center the intro and initial screen, but displace the playfield. @@ -1248,7 +1304,7 @@ DRIVER_INIT_MEMBER(magic10_state,hotslot) m_layer2_offset[1] = 0; // Y offset. } -DRIVER_INIT_MEMBER(magic10_state,sgsafari) +DRIVER_INIT_MEMBER(magic10_state, sgsafari) { m_layer2_offset[0] = 16; m_layer2_offset[1] = 20; @@ -1265,8 +1321,9 @@ GAMEL( 1995, magic10a, magic10, magic10, magic10, magic10_state, magic10, RO GAMEL( 1995, magic10b, magic10, magic10a, magic10, magic10_state, magic10, ROT0, "A.W.P. Games", "Magic's 10 (ver. 16.45)", 0, layout_sgsafari ) GAMEL( 1995, magic10c, magic10, magic10a, magic10, magic10_state, magic10, ROT0, "A.W.P. Games", "Magic's 10 (ver. 16.15)", 0, layout_sgsafari ) GAME( 1997, magic102, 0, magic102, magic102, magic10_state, magic102, ROT0, "ABM Games", "Magic's 10 2 (ver 1.1)", MACHINE_NOT_WORKING ) -GAME( 1997, suprpool, 0, magic102, magic102, magic10_state, suprpool, ROT0, "ABM Games", "Super Pool (9743 rev.01)", MACHINE_NOT_WORKING ) +GAME( 1998, suprpool, 0, magic102, magic102, magic10_state, suprpool, ROT0, "ABM Games", "Super Pool (ver. 1.2)", MACHINE_NOT_WORKING ) GAME( 1996, hotslot, 0, hotslot, hotslot, magic10_state, hotslot, ROT0, "ABM Electronics", "Hot Slot (ver. 05.01)", MACHINE_NOT_WORKING ) GAME( 1999, mcolors, 0, magic102, magic102, magic10_state, magic102, ROT0, "<unknown>", "Magic Colors (ver. 1.7a)", MACHINE_NOT_WORKING ) GAMEL( 1996, sgsafari, 0, sgsafari, sgsafari, magic10_state, sgsafari, ROT0, "New Impeuropex Corp.", "Super Gran Safari (ver 3.11)", 0, layout_sgsafari ) GAMEL( 1995, musicsrt, 0, magic10a, musicsrt, magic10_state, magic10, ROT0, "ABM Games", "Music Sort (ver 2.02, English)", 0, layout_musicsrt ) +GAME( 1998, lunaprk, 0, magic102, magic102, magic10_state, suprpool, ROT0, "ABM Games", "Luna Park (ver. 1.2)", MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/mhavoc.cpp b/src/mame/drivers/mhavoc.cpp index 82ce05f008a..231742afebd 100644 --- a/src/mame/drivers/mhavoc.cpp +++ b/src/mame/drivers/mhavoc.cpp @@ -195,13 +195,21 @@ #include "machine/nvram.h" #include "includes/mhavoc.h" - +/* Quad pokey hookup (based on schematics): +Address: 543210 + |||||\- pokey A0 + ||||\-- pokey A1 + |||\--- pokey A2 + ||\---- pokey chip number LSB + |\----- pokey chip number MSB + \------ pokey A3 +*/ READ8_MEMBER(mhavoc_state::quad_pokeyn_r) { static const char *const devname[4] = { "pokey1", "pokey2", "pokey3", "pokey4" }; int pokey_num = (offset >> 3) & ~0x04; int control = (offset & 0x20) >> 2; - int pokey_reg = (offset % 8) | control; + int pokey_reg = (offset & 0x7) | control; pokey_device *pokey = machine().device<pokey_device>(devname[pokey_num]); return pokey->read(pokey_reg); @@ -212,7 +220,7 @@ WRITE8_MEMBER(mhavoc_state::quad_pokeyn_w) static const char *const devname[4] = { "pokey1", "pokey2", "pokey3", "pokey4" }; int pokey_num = (offset >> 3) & ~0x04; int control = (offset & 0x20) >> 2; - int pokey_reg = (offset % 8) | control; + int pokey_reg = (offset & 0x7) | control; pokey_device *pokey = machine().device<pokey_device>(devname[pokey_num]); pokey->write(pokey_reg, data); @@ -224,12 +232,19 @@ WRITE8_MEMBER(mhavoc_state::quad_pokeyn_w) * Alpha One: dual POKEY? * *************************************/ - +/* dual pokey hookup (presumably, based on the prototype code): +Address: 43210 + ||||\- pokey A0 + |||\-- pokey A1 + ||\--- pokey A2 + |\---- pokey chip number + \----- pokey A3 +*/ READ8_MEMBER(mhavoc_state::dual_pokey_r) { int pokey_num = (offset >> 3) & 0x01; int control = (offset & 0x10) >> 1; - int pokey_reg = (offset % 8) | control; + int pokey_reg = (offset & 0x7) | control; if (pokey_num == 0) return machine().device<pokey_device>("pokey1")->read(pokey_reg); @@ -242,7 +257,7 @@ WRITE8_MEMBER(mhavoc_state::dual_pokey_w) { int pokey_num = (offset >> 3) & 0x01; int control = (offset & 0x10) >> 1; - int pokey_reg = (offset % 8) | control; + int pokey_reg = (offset & 0x7) | control; if (pokey_num == 0) machine().device<pokey_device>("pokey1")->write(pokey_reg, data); @@ -287,19 +302,41 @@ ADDRESS_MAP_END * Gamma CPU memory handlers * *************************************/ + +/* +a15 a14 a13 a12 a11 a10 a09 a08 a07 a06 a05 a04 a03 a02 a01 a00 +0 0 0 x x * * * * * * * * * * * RW ZRAM (6116 SRAM@9PQ) +0 0 1 0 0 x x x x x * * * * * * RW INPUTS: QCI/O (Quad Pokey) +0 0 1 0 1 x x x x x x x x x x x R INPUTS: SWITCHES +0 0 1 1 0 x x x x x x x x x x x R INPUTS: PORTRD_gamma +0 0 1 1 1 x x x x x x x x x * * R INPUTS: ROLLER (CCI(LETA?), with A2 grounded so only 4 ports are readable) +0 1 0 x x x x x x x x x x x x x R OUTPUTS: read of dipswitches @8S encompasses the entire OUTPUTS area +0 1 0 0 0 x x x x x x x x x x x W OUTPUTS: IRQACK +0 1 0 0 1 x x x x x x x x x x x W OUTPUTS: STROBES +0 1 0 1 0 x x x x x x x x x x x W OUTPUTS: PORTWR_gamma +0 1 0 1 1 ? ? ? ? ? ? ? ? ? ? ? W OUTPUTS: TISND, unused tms5220 write + ( supposedly, but the /WS hookup is not traced on pcb yet: +0 1 0 1 1 x? x? 0 x? x? x? x? x? x? x? x? W? OUTPUTS: TISND: Gamma CPU write to octal latch?? +0 1 0 1 1 x? x? 1 x? x? x? x? x? x? x? x? W? OUTPUTS: TISND: octal latch output enable to tms5220 and pulse /WS on 5220?? + Is there a way to activate /RS on the TMS5220 to read the status register? is the TMS5220 /INT line connected to the 6502 somehow? + ) +0 1 1 x x x x * * * * * * * * * RW EEROM: (2804 EEPROM@9QR, pins 22(A9) and 19(A10) are N/C inside the chip) +1 x * * * * * * * * * * * * * * R ROM 27128 @9S +*/ static ADDRESS_MAP_START( gamma_map, AS_PROGRAM, 8, mhavoc_state ) - AM_RANGE(0x0000, 0x07ff) AM_RAM /* Program RAM (2K) */ - AM_RANGE(0x0800, 0x0fff) AM_RAM AM_MIRROR (0x1800) - AM_RANGE(0x2000, 0x203f) AM_READWRITE(quad_pokeyn_r, quad_pokeyn_w) /* Quad Pokey read */ - AM_RANGE(0x2800, 0x2800) AM_READ_PORT("IN1") /* Gamma Input Port */ - AM_RANGE(0x3000, 0x3000) AM_READ(mhavoc_alpha_r) /* Alpha Comm. Read Port*/ - AM_RANGE(0x3800, 0x3803) AM_READ_PORT("DIAL") /* Roller Controller Input*/ - AM_RANGE(0x4000, 0x4000) AM_READ_PORT("DSW2") AM_WRITE(mhavoc_gamma_irq_ack_w) /* DSW at 8S, IRQ Acknowledge*/ - AM_RANGE(0x4800, 0x4800) AM_WRITE(mhavoc_out_1_w) /* Coin Counters */ - AM_RANGE(0x5000, 0x5000) AM_WRITE(mhavoc_alpha_w) /* Alpha Comm. Write Port */ - AM_RANGE(0x6000, 0x61ff) AM_RAM AM_SHARE("nvram") /* EEROM */ - AM_RANGE(0x8000, 0xffff) AM_ROM /* Program ROM (16K) */ + AM_RANGE(0x0000, 0x07ff) AM_RAM AM_MIRROR(0x1800) /* Program RAM (2K) */ + AM_RANGE(0x2000, 0x203f) AM_READWRITE(quad_pokeyn_r, quad_pokeyn_w) AM_MIRROR(0x07C0) /* Quad Pokey read/write */ + AM_RANGE(0x2800, 0x2800) AM_READ_PORT("IN1") AM_MIRROR(0x07ff) /* Gamma Input Port */ + AM_RANGE(0x3000, 0x3000) AM_READ(mhavoc_alpha_r) AM_MIRROR(0x07ff) /* Alpha Comm. Read Port */ + AM_RANGE(0x3800, 0x3803) AM_READ_PORT("DIAL") AM_MIRROR(0x07fc) /* Roller Controller Input */ + AM_RANGE(0x4000, 0x4000) AM_READ_PORT("DSW2") AM_WRITE(mhavoc_gamma_irq_ack_w) AM_MIRROR(0x07ff) /* DSW at 8S, IRQ Acknowledge */ + AM_RANGE(0x4800, 0x4800) AM_WRITE(mhavoc_out_1_w) AM_MIRROR(0x07ff) /* Coin Counters */ + AM_RANGE(0x5000, 0x5000) AM_WRITE(mhavoc_alpha_w) AM_MIRROR(0x07ff) /* Alpha Comm. Write Port */ + //AM_RANGE(0x5800, 0x5800) AM_WRITE(mhavocrv_speech_data_w) AM_MIRROR(0x06ff) /* TMS5220 data write */ + //AM_RANGE(0x5900, 0x5900) AM_WRITE(mhavocrv_speech_strobe_w) AM_MIRROR(0x06ff) /* TMS5220 /WS strobe write */ + AM_RANGE(0x6000, 0x61ff) AM_RAM AM_SHARE("nvram") AM_MIRROR(0x1e00) /* EEROM */ + AM_RANGE(0x8000, 0xbfff) AM_ROM AM_MIRROR(0x4000) /* Program ROM (16K) */ ADDRESS_MAP_END @@ -602,8 +639,7 @@ ROM_START( mhavoc ) /* Gamma Processor ROM */ ROM_REGION( 0x10000, "gamma", 0 ) - ROM_LOAD( "136025.108", 0x08000, 0x4000, CRC(93faf210) SHA1(7744368a1d520f986d1c4246113a7e24fcdd6d04) ) - ROM_RELOAD( 0x0c000, 0x4000 ) /* reset+interrupt vectors */ + ROM_LOAD( "136025.108", 0x08000, 0x4000, CRC(93faf210) SHA1(7744368a1d520f986d1c4246113a7e24fcdd6d04) ) /* mirrored to c000-ffff for reset+interrupt vectors */ /* AVG PROM */ ROM_REGION( 0x100, "user1", 0 ) @@ -633,8 +669,7 @@ ROM_START( mhavoc2 ) /* Gamma Processor ROM */ ROM_REGION( 0x10000, "gamma", 0 ) - ROM_LOAD( "136025.108", 0x08000, 0x4000, CRC(93faf210) SHA1(7744368a1d520f986d1c4246113a7e24fcdd6d04) ) - ROM_RELOAD( 0x0c000, 0x4000 ) /* reset+interrupt vectors */ + ROM_LOAD( "136025.108", 0x08000, 0x4000, CRC(93faf210) SHA1(7744368a1d520f986d1c4246113a7e24fcdd6d04) ) /* mirrored to c000-ffff for reset+interrupt vectors */ /* AVG PROM */ ROM_REGION( 0x100, "user1", 0 ) @@ -662,8 +697,7 @@ ROM_START( mhavocrv ) /* Gamma Processor ROM */ ROM_REGION( 0x10000, "gamma", 0 ) - ROM_LOAD( "136025.908", 0x08000, 0x4000, CRC(c52ec664) SHA1(08120a385f71b17ec02a3c2ef856ff835a91773e) ) - ROM_RELOAD( 0x0c000, 0x4000 ) /* reset+interrupt vectors */ + ROM_LOAD( "136025.908", 0x08000, 0x4000, CRC(c52ec664) SHA1(08120a385f71b17ec02a3c2ef856ff835a91773e) ) /* mirrored to c000-ffff for reset+interrupt vectors */ /* AVG PROM */ ROM_REGION( 0x100, "user1", 0 ) @@ -693,8 +727,7 @@ ROM_START( mhavocp ) /* Gamma Processor ROM */ ROM_REGION( 0x10000, "gamma", 0 ) - ROM_LOAD( "136025.008", 0x8000, 0x4000, CRC(22ea7399) SHA1(eeda8cc40089506063835a62c3273e7dd3918fd5) ) - ROM_RELOAD( 0xc000, 0x4000 )/* reset+interrupt vectors */ + ROM_LOAD( "136025.008", 0x8000, 0x4000, CRC(22ea7399) SHA1(eeda8cc40089506063835a62c3273e7dd3918fd5) ) /* mirrored to c000-ffff for reset+interrupt vectors */ /* AVG PROM */ ROM_REGION( 0x100, "user1", 0 ) diff --git a/src/mame/drivers/mirage.cpp b/src/mame/drivers/mirage.cpp index 29b275a7965..88a2ae21c37 100644 --- a/src/mame/drivers/mirage.cpp +++ b/src/mame/drivers/mirage.cpp @@ -342,12 +342,10 @@ static MACHINE_CONFIG_START( mirage, miragemi_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(2) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/model1.cpp b/src/mame/drivers/model1.cpp index 9fd1950cc0d..4e20dbfeb11 100644 --- a/src/mame/drivers/model1.cpp +++ b/src/mame/drivers/model1.cpp @@ -1534,10 +1534,7 @@ static MACHINE_CONFIG_START( model1, model1_state ) MCFG_MACHINE_RESET_OVERRIDE(model1_state,model1) MCFG_NVRAM_ADD_0FILL("nvram") - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff) - MCFG_S24TILE_DEVICE_GFXDECODE("gfxdecode") MCFG_S24TILE_DEVICE_PALETTE("palette") MCFG_SCREEN_ADD("screen", RASTER) @@ -1581,10 +1578,7 @@ static MACHINE_CONFIG_START( model1_vr, model1_state ) MCFG_MACHINE_RESET_OVERRIDE(model1_state,model1_vr) MCFG_NVRAM_ADD_0FILL("nvram") - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff) - MCFG_S24TILE_DEVICE_GFXDECODE("gfxdecode") MCFG_S24TILE_DEVICE_PALETTE("palette") MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/model2.cpp b/src/mame/drivers/model2.cpp index ac2cdaa2b94..0a12518fe0f 100644 --- a/src/mame/drivers/model2.cpp +++ b/src/mame/drivers/model2.cpp @@ -2405,10 +2405,7 @@ static MACHINE_CONFIG_START( model2o, model2_state ) MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb) MCFG_TIMER_PTR((FPTR)3) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff) - MCFG_S24TILE_DEVICE_GFXDECODE("gfxdecode") MCFG_S24TILE_DEVICE_PALETTE("palette") MCFG_SCREEN_ADD("screen", RASTER) @@ -2454,9 +2451,7 @@ static MACHINE_CONFIG_START( model2a, model2_state ) MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb) MCFG_TIMER_PTR((FPTR)3) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff) - MCFG_S24TILE_DEVICE_GFXDECODE("gfxdecode") MCFG_S24TILE_DEVICE_PALETTE("palette") MCFG_SCREEN_ADD("screen", RASTER) @@ -2571,9 +2566,7 @@ static MACHINE_CONFIG_START( model2b, model2_state ) MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb) MCFG_TIMER_PTR((FPTR)3) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff) - MCFG_S24TILE_DEVICE_GFXDECODE("gfxdecode") MCFG_S24TILE_DEVICE_PALETTE("palette") MCFG_SCREEN_ADD("screen", RASTER) @@ -2636,9 +2629,7 @@ static MACHINE_CONFIG_START( model2c, model2_state ) MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb) MCFG_TIMER_PTR((FPTR)3) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff) - MCFG_S24TILE_DEVICE_GFXDECODE("gfxdecode") MCFG_S24TILE_DEVICE_PALETTE("palette") MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/moo.cpp b/src/mame/drivers/moo.cpp index 73bcdaab223..da3d3960e43 100644 --- a/src/mame/drivers/moo.cpp +++ b/src/mame/drivers/moo.cpp @@ -550,18 +550,14 @@ static MACHINE_CONFIG_START( moo, moo_state ) MCFG_VIDEO_START_OVERRIDE(moo_state,moo) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k053246", K053246, 0) MCFG_K053246_CB(moo_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, -48+1, 23) - MCFG_K053246_GFXDECODE("gfxdecode") + MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -48+1, 23) MCFG_K053246_PALETTE("palette") MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(moo_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_4, 1, 0, "none") - MCFG_K056832_GFXDECODE("gfxdecode") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0, "none") MCFG_K056832_PALETTE("palette") MCFG_K053251_ADD("k053251") @@ -608,18 +604,14 @@ static MACHINE_CONFIG_START( moobl, moo_state ) MCFG_VIDEO_START_OVERRIDE(moo_state,moo) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k053246", K053246, 0) MCFG_K053246_CB(moo_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, -48+1, 23) - MCFG_K053246_GFXDECODE("gfxdecode") + MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -48+1, 23) MCFG_K053246_PALETTE("palette") MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(moo_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_4, 1, 0, "none") - MCFG_K056832_GFXDECODE("gfxdecode") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0, "none") MCFG_K056832_PALETTE("palette") MCFG_K053251_ADD("k053251") @@ -642,7 +634,7 @@ static MACHINE_CONFIG_DERIVED( bucky, moo ) MCFG_K054000_ADD("k054000") MCFG_DEVICE_MODIFY("k053246") - MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, -48, 23) + MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -48, 23) /* video hardware */ MCFG_PALETTE_MODIFY("palette") diff --git a/src/mame/drivers/mystwarr.cpp b/src/mame/drivers/mystwarr.cpp index 8e8632c9e1b..1a198e42e23 100644 --- a/src/mame/drivers/mystwarr.cpp +++ b/src/mame/drivers/mystwarr.cpp @@ -953,20 +953,16 @@ static MACHINE_CONFIG_START( mystwarr, mystwarr_state ) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_ENABLE_HILIGHTS() - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(mystwarr_state, mystwarr_tile_callback) - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_5, 0, 0, "none") - MCFG_K056832_GFXDECODE("gfxdecode") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0, "none") MCFG_K056832_PALETTE("palette") MCFG_K055555_ADD("k055555") MCFG_DEVICE_ADD("k055673", K055673, 0) MCFG_K055673_CB(mystwarr_state, mystwarr_sprite_callback) - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -48, -24) - MCFG_K055673_GFXDECODE("gfxdecode") + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -48, -24) MCFG_K055673_PALETTE("palette") MCFG_DEVICE_ADD("k054338", K054338, 0) @@ -1018,7 +1014,7 @@ static MACHINE_CONFIG_DERIVED( viostorm, mystwarr ) MCFG_DEVICE_MODIFY("k055673") MCFG_K055673_CB(mystwarr_state, metamrph_sprite_callback) - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_RNG, -62, -23) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_RNG, -62, -23) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( metamrph, mystwarr ) @@ -1051,7 +1047,7 @@ static MACHINE_CONFIG_DERIVED( metamrph, mystwarr ) MCFG_DEVICE_MODIFY("k055673") MCFG_K055673_CB(mystwarr_state, metamrph_sprite_callback) - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_RNG, -51, -24) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_RNG, -51, -24) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( dadandrn, mystwarr ) @@ -1067,7 +1063,7 @@ static MACHINE_CONFIG_DERIVED( dadandrn, mystwarr ) MCFG_DEVICE_MODIFY("k053252") MCFG_K053252_OFFSETS(24, 16+1) - MCFG_GFXDECODE_MODIFY("gfxdecode", dadandrn) + MCFG_GFXDECODE_ADD("gfxdecode", "palette", dadandrn) /* video hardware */ MCFG_VIDEO_START_OVERRIDE(mystwarr_state, dadandrn) @@ -1084,7 +1080,7 @@ static MACHINE_CONFIG_DERIVED( dadandrn, mystwarr ) MCFG_DEVICE_MODIFY("k055673") MCFG_K055673_CB(mystwarr_state, gaiapols_sprite_callback) - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -42, -22) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -42, -22) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( gaiapols, mystwarr ) @@ -1102,7 +1098,7 @@ static MACHINE_CONFIG_DERIVED( gaiapols, mystwarr ) MCFG_K054000_ADD("k054000") - MCFG_GFXDECODE_MODIFY("gfxdecode", gaiapols) + MCFG_GFXDECODE_ADD("gfxdecode", "palette", gaiapols) /* video hardware */ MCFG_VIDEO_START_OVERRIDE(mystwarr_state, gaiapols) @@ -1120,7 +1116,7 @@ static MACHINE_CONFIG_DERIVED( gaiapols, mystwarr ) MCFG_DEVICE_MODIFY("k055673") MCFG_K055673_CB(mystwarr_state, gaiapols_sprite_callback) - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_RNG, -61, -22) // stage2 brick walls + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_RNG, -61, -22) // stage2 brick walls MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( martchmp, mystwarr ) @@ -1155,7 +1151,7 @@ static MACHINE_CONFIG_DERIVED( martchmp, mystwarr ) MCFG_DEVICE_MODIFY("k055673") MCFG_K055673_CB(mystwarr_state, martchmp_sprite_callback) - MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -58, -23) + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -58, -23) MACHINE_CONFIG_END /**********************************************************************************/ diff --git a/src/mame/drivers/n64.cpp b/src/mame/drivers/n64.cpp index 9c4e7d146ee..e3cefcdf6d6 100644 --- a/src/mame/drivers/n64.cpp +++ b/src/mame/drivers/n64.cpp @@ -418,12 +418,13 @@ static MACHINE_CONFIG_START( n64, n64_mess_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", VR4300BE, 93750000) - MCFG_FORCE_NO_DRC() + MCFG_CPU_FORCE_NO_DRC() MCFG_CPU_CONFIG(config) MCFG_CPU_PROGRAM_MAP(n64_map) MCFG_CPU_VBLANK_INT_DRIVER("screen", n64_mess_state, n64_reset_poll) MCFG_CPU_ADD("rsp", RSP, 62500000) + MCFG_CPU_FORCE_NO_DRC() MCFG_RSP_DP_REG_R_CB(DEVREAD32("rcp",n64_periphs, dp_reg_r)) MCFG_RSP_DP_REG_W_CB(DEVWRITE32("rcp",n64_periphs, dp_reg_w)) MCFG_RSP_SP_REG_R_CB(DEVREAD32("rcp",n64_periphs, sp_reg_r)) @@ -464,8 +465,6 @@ static MACHINE_CONFIG_START( n64, n64_mess_state ) /* software lists */ MCFG_SOFTWARE_LIST_ADD("cart_list", "n64") - - MCFG_FORCE_NO_DRC() MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( n64dd, n64 ) diff --git a/src/mame/drivers/namcond1.cpp b/src/mame/drivers/namcond1.cpp index 5e740e11d4a..c2de731e5bb 100644 --- a/src/mame/drivers/namcond1.cpp +++ b/src/mame/drivers/namcond1.cpp @@ -124,104 +124,6 @@ static INPUT_PORTS_START( namcond1 ) INPUT_PORTS_END -/* text-layer characters */ - -static const UINT32 pts_4bits_layout_xoffset[64] = -{ - STEP8( 0*256, 4 ), STEP8( 1*256, 4 ), STEP8( 4*256, 4 ), STEP8( 5*256, 4 ), - STEP8( 16*256, 4 ), STEP8( 17*256, 4 ), STEP8( 20*256, 4 ), STEP8( 21*256, 4 ) -}; - -static const UINT32 pts_4bits_layout_yoffset[64] = -{ - STEP8( 0*256, 8*4 ), STEP8( 2*256, 8*4 ), STEP8( 8*256, 8*4 ), STEP8( 10*256, 8*4 ), - STEP8( 32*256, 8*4 ), STEP8( 34*256, 8*4 ), STEP8( 40*256, 8*4 ), STEP8( 42*256, 8*4 ) -}; - -static const gfx_layout pts_8x8_4bits_layout = -{ - 8,8, /* 8*8 pixels */ - RGN_FRAC(1,1), /* 65536 patterns */ - 4, /* 4 bits per pixel */ - { 0, 1, 2, 3 }, - EXTENDED_XOFFS, - EXTENDED_YOFFS, - 8*8*4, - pts_4bits_layout_xoffset, - pts_4bits_layout_yoffset -}; - -static const gfx_layout pts_16x16_4bits_layout = -{ - 16,16, /* 16*16 pixels */ - RGN_FRAC(1,1), /* 16384 patterns */ - 4, /* 4 bits per pixel */ - { 0, 1, 2, 3 }, - EXTENDED_XOFFS, - EXTENDED_YOFFS, - 16*16*4, - pts_4bits_layout_xoffset, - pts_4bits_layout_yoffset -}; - -static const gfx_layout pts_32x32_4bits_layout = -{ - 32,32, /* 32*32 pixels */ - RGN_FRAC(1,1), /* 4096 patterns */ - 4, /* 4 bits per pixel */ - { 0, 1, 2, 3 }, - EXTENDED_XOFFS, - EXTENDED_YOFFS, - 32*32*4, - pts_4bits_layout_xoffset, - pts_4bits_layout_yoffset -}; - -static const gfx_layout pts_64x64_4bits_layout = -{ - 64,64, /* 32*32 pixels */ - RGN_FRAC(1,1), /* 1024 patterns */ - 4, /* 4 bits per pixel */ - { 0, 1, 2, 3 }, - EXTENDED_XOFFS, - EXTENDED_YOFFS, - 64*64*4, - pts_4bits_layout_xoffset, - pts_4bits_layout_yoffset -}; - - -static const gfx_layout pts_8x8_8bits_layout = -{ - 8,8, /* 8*8 pixels */ - RGN_FRAC(1,1), /* 32768 patterns */ - 8, /* 8 bits per pixel */ - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { STEP8( 0*512, 8 ) }, - { STEP8( 0*512, 8*8 ) }, - 8*8*8 -}; - -static const gfx_layout pts_16x16_8bits_layout = -{ - 16,16, /* 16*16 pixels */ - RGN_FRAC(1,1), /* 8192 patterns */ - 8, /* 8 bits per pixel */ - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { STEP8( 0*512, 8 ), STEP8( 1*512, 8 ) }, - { STEP8( 0*512, 8*8 ), STEP8( 2*512, 8*8 ) }, - 16*16*8 -}; - -static GFXDECODE_START( namcond1 ) - GFXDECODE_ENTRY( "gfx1", 0x00000000, pts_8x8_4bits_layout, 0, 16 ) - GFXDECODE_ENTRY( "gfx1", 0x00000000, pts_16x16_4bits_layout, 0, 16 ) - GFXDECODE_ENTRY( "gfx1", 0x00000000, pts_32x32_4bits_layout, 0, 16 ) - GFXDECODE_ENTRY( "gfx1", 0x00000000, pts_64x64_4bits_layout, 0, 16 ) - GFXDECODE_ENTRY( "gfx1", 0x00000000, pts_8x8_8bits_layout, 0, 256 ) - GFXDECODE_ENTRY( "gfx1", 0x00000000, pts_16x16_8bits_layout, 0, 256 ) -GFXDECODE_END - READ16_MEMBER(namcond1_state::mcu_p7_read) { return 0xff; @@ -301,7 +203,6 @@ static MACHINE_CONFIG_START( namcond1, namcond1_state ) MCFG_SCREEN_UPDATE_DEVICE("ygv608", ygv608_device, update_screen) MCFG_SCREEN_PALETTE("palette") - MCFG_GFXDECODE_ADD("gfxdecode", "palette", namcond1) MCFG_PALETTE_ADD("palette", 256) /* sound hardware */ @@ -316,7 +217,6 @@ static MACHINE_CONFIG_START( namcond1, namcond1_state ) MCFG_AT28C16_ADD( "at28c16", NULL ) MCFG_YGV608_ADD("ygv608") - MCFG_YGV608_GFXDECODE("gfxdecode") MCFG_YGV608_PALETTE("palette") MACHINE_CONFIG_END @@ -328,7 +228,7 @@ ROM_START( ncv1 ) ROM_REGION( 0x80000,"mcu", 0 ) /* sub CPU */ ROM_LOAD( "nc1sub.1c", 0x00000, 0x80000, CRC(48ea0de2) SHA1(33e57c8d084a960ccbda462d18e355de44ec7ad9) ) - ROM_REGION( 0x200000,"gfx1", 0 ) /* 2MB character generator */ + ROM_REGION( 0x200000,"ygv608", 0 ) /* 2MB character generator */ ROM_LOAD( "nc1cg0.10c", 0x000000, 0x200000, CRC(355e7f29) SHA1(47d92c4e28c3610a620d3c9b3be558199477f6d8) ) ROM_REGION( 0x1000000, "c352", 0 ) // Samples @@ -343,7 +243,7 @@ ROM_START( ncv1j ) ROM_REGION( 0x80000,"mcu", 0 ) /* sub CPU */ ROM_LOAD( "nc1sub.1c", 0x00000, 0x80000, CRC(48ea0de2) SHA1(33e57c8d084a960ccbda462d18e355de44ec7ad9) ) - ROM_REGION( 0x200000,"gfx1", 0 ) /* 2MB character generator */ + ROM_REGION( 0x200000,"ygv608", 0 ) /* 2MB character generator */ ROM_LOAD( "nc1cg0.10c", 0x000000, 0x200000, CRC(355e7f29) SHA1(47d92c4e28c3610a620d3c9b3be558199477f6d8) ) ROM_REGION( 0x1000000, "c352", 0 ) // Samples @@ -358,7 +258,7 @@ ROM_START( ncv1j2 ) ROM_REGION( 0x80000,"mcu", 0 ) /* sub CPU */ ROM_LOAD( "nc1sub.1c", 0x00000, 0x80000, CRC(48ea0de2) SHA1(33e57c8d084a960ccbda462d18e355de44ec7ad9) ) - ROM_REGION( 0x200000,"gfx1", 0 ) /* 2MB character generator */ + ROM_REGION( 0x200000,"ygv608", 0 ) /* 2MB character generator */ ROM_LOAD( "nc1cg0.10c", 0x000000, 0x200000, CRC(355e7f29) SHA1(47d92c4e28c3610a620d3c9b3be558199477f6d8) ) ROM_REGION( 0x1000000, "c352", 0 ) // Samples @@ -373,7 +273,7 @@ ROM_START( ncv2 ) ROM_REGION( 0x80000,"mcu", 0 ) /* sub CPU */ ROM_LOAD( "ncs1sub.1d", 0x00000, 0x80000, CRC(365cadbf) SHA1(7263220e1630239e3e88b828c00389d02628bd7d) ) - ROM_REGION( 0x400000,"gfx1", 0 ) /* 4MB character generator */ + ROM_REGION( 0x400000,"ygv608", 0 ) /* 4MB character generator */ ROM_LOAD( "ncs1cg0.10e", 0x000000, 0x200000, CRC(fdd24dbe) SHA1(4dceaae3d853075f58a7408be879afc91d80292e) ) ROM_LOAD( "ncs1cg1.10e", 0x200000, 0x200000, CRC(007b19de) SHA1(d3c093543511ec1dd2f8be6db45f33820123cabc) ) @@ -389,7 +289,7 @@ ROM_START( ncv2j ) ROM_REGION( 0x80000,"mcu", 0 ) /* sub CPU */ ROM_LOAD("ncs1sub.1d", 0x00000, 0x80000, CRC(365cadbf) SHA1(7263220e1630239e3e88b828c00389d02628bd7d) ) - ROM_REGION( 0x400000,"gfx1", 0 ) /* 4MB character generator */ + ROM_REGION( 0x400000,"ygv608", 0 ) /* 4MB character generator */ ROM_LOAD( "ncs1cg0.10e", 0x000000, 0x200000, CRC(fdd24dbe) SHA1(4dceaae3d853075f58a7408be879afc91d80292e) ) ROM_LOAD( "ncs1cg1.10e", 0x200000, 0x200000, CRC(007b19de) SHA1(d3c093543511ec1dd2f8be6db45f33820123cabc) ) diff --git a/src/mame/drivers/naomi.cpp b/src/mame/drivers/naomi.cpp index 7468d09168e..4bd679f4dfe 100644 --- a/src/mame/drivers/naomi.cpp +++ b/src/mame/drivers/naomi.cpp @@ -1693,6 +1693,7 @@ static ADDRESS_MAP_START( naomi_map, AS_PROGRAM, 64, naomi_state ) AM_RANGE(0x00200000, 0x00207fff) AM_MIRROR(0x02000000) AM_RAM // bios uses it (battery backed ram ?) AM_RANGE(0x005f6800, 0x005f69ff) AM_MIRROR(0x02000000) AM_READWRITE(dc_sysctrl_r, dc_sysctrl_w ) AM_RANGE(0x005f6c00, 0x005f6cff) AM_MIRROR(0x02000000) AM_DEVICE32( "maple_dc", maple_dc_device, amap, U64(0xffffffffffffffff) ) + AM_RANGE(0x005f7018, 0x005f702f) AM_MIRROR(0x02000000) AM_DEVREADWRITE16( "comm_board", m3comm_device, naomi_r, naomi_w, U64(0x0000ffff0000ffff) ) AM_RANGE(0x005f7000, 0x005f70ff) AM_MIRROR(0x02000000) AM_DEVICE16( "rom_board", naomi_board, submap, U64(0x0000ffff0000ffff) ) AM_RANGE(0x005f7400, 0x005f74ff) AM_MIRROR(0x02000000) AM_DEVICE32( "rom_board", naomi_g1_device, amap, U64(0xffffffffffffffff) ) AM_RANGE(0x005f7800, 0x005f78ff) AM_MIRROR(0x02000000) AM_READWRITE(dc_g2_ctrl_r, dc_g2_ctrl_w ) @@ -2703,6 +2704,7 @@ static MACHINE_CONFIG_DERIVED( naomi_base, naomi_aw_base ) MCFG_EEPROM_SERIAL_93C46_8BIT_ADD("mie_eeprom") MCFG_X76F100_ADD("naomibd_eeprom") + MCFG_M3COMM_ADD("comm_board") MACHINE_CONFIG_END /* diff --git a/src/mame/drivers/nc.cpp b/src/mame/drivers/nc.cpp index 576464351ed..0f76cf72df1 100644 --- a/src/mame/drivers/nc.cpp +++ b/src/mame/drivers/nc.cpp @@ -96,7 +96,6 @@ ******************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "cpu/z80/z80.h" #include "includes/nc.h" #include "machine/mc146818.h" /* for NC200 real time clock */ diff --git a/src/mame/drivers/ninjakd2.cpp b/src/mame/drivers/ninjakd2.cpp index a69e8ff2181..af71f1f08dd 100644 --- a/src/mame/drivers/ninjakd2.cpp +++ b/src/mame/drivers/ninjakd2.cpp @@ -1352,6 +1352,61 @@ ROM_START( robokid ) ROM_LOAD( "robokid.18a", 0x50000, 0x10000, CRC(fdff7441) SHA1(843b2c92bbc6f7319568677d50cbd9b03475b34a) ) ROM_END + + +ROM_START( robokidj3 ) + ROM_REGION( 0x50000, "maincpu", 0 ) + ROM_LOAD( "robokid1.18j", 0x00000, 0x08000, CRC(77a9332a) SHA1(60464ff8bdea5ee2256f24210dc7246fcffb0fca) ) + ROM_IGNORE( 0x08000 ) + ROM_RELOAD( 0x10000, 0x10000 ) // banked at 8000-bfff + ROM_LOAD( "robokid2.18k", 0x20000, 0x10000, CRC(715ecee4) SHA1(1c00b9233b24ca70b0d097c2f62b85db280a9c9b) ) + ROM_LOAD( "robokid3.15k", 0x30000, 0x10000, CRC(ce12fa86) SHA1(73beaeea5b50ec90d612813845f8345a465750f7) ) + ROM_LOAD( "robokid4.12k", 0x40000, 0x10000, CRC(97e86600) SHA1(e140a2e323e9a91ae415fd5539b3e0226dff3a69) ) + + ROM_REGION( 0x100, "maincpu_prom", 0 ) + ROM_LOAD( "prom82s129.cpu", 0x000, 0x100, BAD_DUMP CRC(4dd96f67) SHA1(01b415d9e86ff0c5aad7cfe81e903f2c202bb541)) + + ROM_REGION( 0x10000, "soundcpu", 0 ) + ROM_LOAD( "robokid.k7", 0x00000, 0x10000, CRC(f490a2e9) SHA1(861d1256c090ce3d1f45f95cc894affbbc3f1466) ) + + ROM_REGION( 0x08000, "gfx1", 0 ) // fg tiles + ROM_LOAD( "robokid.b9", 0x00000, 0x08000, CRC(fac59c3f) SHA1(1b202ad5c12982512129d9e097267dd31b984ae8) ) + + ROM_REGION( 0x40000, "gfx2", 0 ) // sprite tiles + ROM_LOAD( "robokid.15f", 0x00000, 0x10000, CRC(ba61f5ab) SHA1(8433ddd55f0184cd5e8bb4a94a1c2336b2f8ff05) ) + ROM_LOAD( "robokid.16f", 0x10000, 0x10000, CRC(d9b399ce) SHA1(70755c9cae27187f183ae6d61bedb95c420756f4) ) + ROM_LOAD( "robokid.17f", 0x20000, 0x10000, CRC(afe432b9) SHA1(1ec7954ccf112eddf0ffcb8b5aec6cbc5cba7a7a) ) + ROM_LOAD( "robokid.18f", 0x30000, 0x10000, CRC(a0aa2a84) SHA1(4d46c169429cd285644336c7d47e393b33bd8770) ) + + ROM_REGION( 0x80000, "gfx3", 0 ) // bg0 tiles + ROM_LOAD( "robokid.19c", 0x00000, 0x10000, CRC(02220421) SHA1(f533e9c6cea1dccbb60e0528c470f3cb5e8fc44e) ) + ROM_LOAD( "robokid.20c", 0x10000, 0x10000, CRC(02d59bc2) SHA1(031acbb14145f9f4623de8868c6207fb9f8e8207) ) + ROM_LOAD( "robokid.17d", 0x20000, 0x10000, CRC(2fa29b99) SHA1(13dce7932e2e9c03a139a4293584838aa3d9f1c3) ) + ROM_LOAD( "robokid.18d", 0x30000, 0x10000, CRC(ae15ce02) SHA1(175e4eebdf12f1f373e01a4b1c933053ddd09abf) ) + ROM_LOAD( "robokid.19d", 0x40000, 0x10000, CRC(784b089e) SHA1(1ae3346b4afa3da9484ebc59c8a530cb95f7d277) ) + ROM_LOAD( "robokid.20d", 0x50000, 0x10000, CRC(b0b395ed) SHA1(31ec07634053793a701bbfd601b029f7da66e9d7) ) + ROM_LOAD( "robokid.19f", 0x60000, 0x10000, CRC(0f9071c6) SHA1(8bf0c35189eda98a9bc150788890e136870cb5b2) ) + + ROM_REGION( 0x80000, "gfx4", 0 ) // bg1 tiles + ROM_LOAD( "robokid.12c", 0x00000, 0x10000, CRC(0ab45f94) SHA1(d8274263068d998c89a1b247dde7f814037cc15b) ) + ROM_LOAD( "robokid.14c", 0x10000, 0x10000, CRC(029bbd4a) SHA1(8e078cdafe608fc6cde827be85c5267ade4ecca6) ) + ROM_LOAD( "robokid.15c", 0x20000, 0x10000, CRC(7de67ebb) SHA1(2fe92e50e2894dd363e69b053db96bdb66a273eb) ) + ROM_LOAD( "robokid.16c", 0x30000, 0x10000, CRC(53c0e582) SHA1(763e6127532d022a707bf9ddf1a832413745f248) ) + ROM_LOAD( "robokid.17c", 0x40000, 0x10000, CRC(0cae5a1e) SHA1(a183a33516c81ea2c029b72ee6261c4519e095ab) ) + ROM_LOAD( "robokid.18c", 0x50000, 0x10000, CRC(56ac7c8a) SHA1(66ed5646a2e8563caeb4ff96fa7d34fde27e9899) ) + ROM_LOAD( "robokid.15d", 0x60000, 0x10000, CRC(cd632a4d) SHA1(a537d9ced45fdac490097e9162ac4d09a470be79) ) + ROM_LOAD( "robokid.16d", 0x70000, 0x10000, CRC(18d92b2b) SHA1(e6d20ea8f0fac8bd4824a3b279a0fd8a1d6c26f5) ) + + ROM_REGION( 0x80000, "gfx5", 0 ) // bg2 tiles + ROM_LOAD( "robokid.12a", 0x00000, 0x10000, CRC(e64d1c10) SHA1(d1073c80c9788aba65410f88691747a37b2a9d4a) ) + ROM_LOAD( "robokid.14a", 0x10000, 0x10000, CRC(8f9371e4) SHA1(0ea06d62bf4673ebda49a849cead832a24e5b886) ) + ROM_LOAD( "robokid.15a", 0x20000, 0x10000, CRC(469204e7) SHA1(8c2e94635b2b304e7dfa2e6ad58ba526dcf02453) ) + ROM_LOAD( "robokid.16a", 0x30000, 0x10000, CRC(4e340815) SHA1(d204b830c5809f25f7dfa451bbcbeda8b81ced54) ) + ROM_LOAD( "robokid.17a", 0x40000, 0x10000, CRC(f0863106) SHA1(ff7e44d0aa5a07ec9a7eddef1a55181bd2e867b1) ) + ROM_LOAD( "robokid.18a", 0x50000, 0x10000, CRC(fdff7441) SHA1(843b2c92bbc6f7319568677d50cbd9b03475b34a) ) +ROM_END + + ROM_START( robokidj ) ROM_REGION( 0x50000, "maincpu", 0 ) ROM_LOAD( "1.29", 0x00000, 0x08000, CRC(59a1e2ec) SHA1(71f9d28dd8d2cf77a27fab163ce9562e3e75a540) ) @@ -1620,10 +1675,15 @@ GAME( 1987, ninjakd2b, ninjakd2, ninjakd2, rdaction, ninjakd2_state, bootleg, R GAME( 1987, ninjakd2c, ninjakd2, ninjakd2, rdaction, ninjakd2_state, ninjakd2, ROT0, "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 4)", MACHINE_SUPPORTS_SAVE ) // close to set 3 GAME( 1987, rdaction, ninjakd2, ninjakd2, rdaction, ninjakd2_state, ninjakd2, ROT0, "UPL (World Games license)", "Rad Action / NinjaKun Ashura no Shou", MACHINE_SUPPORTS_SAVE ) GAME( 1987, jt104, ninjakd2, ninjakd2, rdaction, ninjakd2_state, bootleg, ROT0, "UPL (United Amusements license)", "JT-104 (title screen modification of Rad Action)", MACHINE_SUPPORTS_SAVE ) + GAME( 1987, mnight, 0, mnight, mnight, ninjakd2_state, mnight, ROT0, "UPL (Kawakus license)", "Mutant Night", MACHINE_SUPPORTS_SAVE ) + GAME( 1988, arkarea, 0, arkarea, arkarea, ninjakd2_state, mnight, ROT0, "UPL", "Ark Area", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, robokid, 0, robokid, robokid, ninjakd2_state, robokid, ROT0, "UPL", "Atomic Robo-kid", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, robokidj, robokid, robokid, robokidj, ninjakd2_state, robokidj, ROT0, "UPL", "Atomic Robo-kid (Japan, set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, robokidj2, robokid, robokid, robokidj, ninjakd2_state, robokidj, ROT0, "UPL", "Atomic Robo-kid (Japan, set 2)", MACHINE_SUPPORTS_SAVE ) + +GAME( 1988, robokid, 0, robokid, robokid, ninjakd2_state, robokid, ROT0, "UPL", "Atomic Robo-kid (World, Type-2)", MACHINE_SUPPORTS_SAVE ) // 3-digit highscore names +GAME( 1988, robokidj, robokid, robokid, robokidj, ninjakd2_state, robokidj, ROT0, "UPL", "Atomic Robo-kid (Japan, Type-2, set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, robokidj2, robokid, robokid, robokidj, ninjakd2_state, robokidj, ROT0, "UPL", "Atomic Robo-kid (Japan, Type-2, set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, robokidj3, robokid, robokid, robokidj, driver_device, 0, ROT0, "UPL", "Atomic Robo-kid (Japan)", MACHINE_SUPPORTS_SAVE ) + GAME( 1989, omegaf, 0, omegaf, omegaf, driver_device, 0, ROT270, "UPL", "Omega Fighter", MACHINE_SUPPORTS_SAVE ) GAME( 1989, omegafs, omegaf, omegaf, omegaf, driver_device, 0, ROT270, "UPL", "Omega Fighter Special", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/nmg5.cpp b/src/mame/drivers/nmg5.cpp index 53b65663cf0..6a808ce11d4 100644 --- a/src/mame/drivers/nmg5.cpp +++ b/src/mame/drivers/nmg5.cpp @@ -999,7 +999,6 @@ static MACHINE_CONFIG_START( nmg5, nmg5_state ) MCFG_DECO_SPRITE_FLIPALLX(1) MCFG_DECO_SPRITE_OFFSETS(0, 8) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") /* sound hardware */ diff --git a/src/mame/drivers/nwk-tr.cpp b/src/mame/drivers/nwk-tr.cpp index a64c10fd96a..1b216b62468 100644 --- a/src/mame/drivers/nwk-tr.cpp +++ b/src/mame/drivers/nwk-tr.cpp @@ -802,16 +802,11 @@ static MACHINE_CONFIG_START( nwktr, nwktr_state ) MCFG_PALETTE_ADD("palette", 65536) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k001604", K001604, 0) - MCFG_K001604_GFX_INDEX1(0) - MCFG_K001604_GFX_INDEX2(1) MCFG_K001604_LAYER_SIZE(0) MCFG_K001604_ROZ_SIZE(1) MCFG_K001604_TXT_OFFSET(0) // correct? MCFG_K001604_ROZ_OFFSET(0) // correct? - MCFG_K001604_GFXDECODE("gfxdecode") MCFG_K001604_PALETTE("palette") MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -832,13 +827,10 @@ static MACHINE_CONFIG_DERIVED( thrilld, nwktr ) MCFG_DEVICE_REMOVE("k001604") MCFG_DEVICE_ADD("k001604", K001604, 0) - MCFG_K001604_GFX_INDEX1(0) - MCFG_K001604_GFX_INDEX2(1) MCFG_K001604_LAYER_SIZE(1) MCFG_K001604_ROZ_SIZE(1) MCFG_K001604_TXT_OFFSET(0) // correct? MCFG_K001604_ROZ_OFFSET(0) // correct? - MCFG_K001604_GFXDECODE("gfxdecode") MCFG_K001604_PALETTE("palette") MACHINE_CONFIG_END diff --git a/src/mame/drivers/opwolf.cpp b/src/mame/drivers/opwolf.cpp index 77ce283f789..826402fbb1e 100644 --- a/src/mame/drivers/opwolf.cpp +++ b/src/mame/drivers/opwolf.cpp @@ -796,7 +796,6 @@ static MACHINE_CONFIG_START( opwolf, opwolf_state ) MCFG_DEVICE_ADD("pc080sn", PC080SN, 0) MCFG_PC080SN_GFX_REGION(1) MCFG_PC080SN_GFXDECODE("gfxdecode") - MCFG_PC080SN_PALETTE("palette") MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0) MCFG_PC090OJ_GFXDECODE("gfxdecode") @@ -871,7 +870,6 @@ static MACHINE_CONFIG_START( opwolfb, opwolf_state ) /* OSC clocks unknown for t MCFG_DEVICE_ADD("pc080sn", PC080SN, 0) MCFG_PC080SN_GFX_REGION(1) MCFG_PC080SN_GFXDECODE("gfxdecode") - MCFG_PC080SN_PALETTE("palette") MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0) MCFG_PC090OJ_GFXDECODE("gfxdecode") diff --git a/src/mame/drivers/overdriv.cpp b/src/mame/drivers/overdriv.cpp index 5dd5191318b..c5b1f19898d 100644 --- a/src/mame/drivers/overdriv.cpp +++ b/src/mame/drivers/overdriv.cpp @@ -340,17 +340,13 @@ static MACHINE_CONFIG_START( overdriv, overdriv_state ) MCFG_SCREEN_UPDATE_DRIVER(overdriv_state, screen_update_overdriv) MCFG_SCREEN_PALETTE("palette") -// MCFG_GFXDECODE_ADD("gfxdecode", "palette", overdriv) MCFG_PALETTE_ADD("palette", 2048) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k053246", K053246, 0) MCFG_K053246_CB(overdriv_state, sprite_callback) - MCFG_K053246_CONFIG("gfx1", 0, NORMAL_PLANE_ORDER, 77, 22) - MCFG_K053246_GFXDECODE("gfxdecode") + MCFG_K053246_CONFIG("gfx1", NORMAL_PLANE_ORDER, 77, 22) MCFG_K053246_PALETTE("palette") MCFG_DEVICE_ADD("k051316_1", K051316, 0) diff --git a/src/mame/drivers/pc.cpp b/src/mame/drivers/pc.cpp index 0ab59558865..7452b907f44 100644 --- a/src/mame/drivers/pc.cpp +++ b/src/mame/drivers/pc.cpp @@ -340,6 +340,11 @@ ROM_START( sicpc1605 ) ROM_LOAD("multitech pc-700 3.1.bin", 0xe000, 0x2000, CRC(0ac7a2e1) SHA1(b9c8504e21213d81a068dde9f51f9c973d726e7b)) ROM_END +ROM_START( ncrpc4i ) + ROM_REGION(0x10000,"bios", 0) + ROM_LOAD( "ncr_pc4i_biosrom_1985.bin",0xc000, 0x4000, CRC(b9732648) SHA1(0d5d96fbc36089ca4d893b0db84faffa8043a5e4)) +ROM_END + ROM_START( zdsupers ) ROM_REGION(0x10000,"bios", 0) ROM_SYSTEM_BIOS( 0, "v31d", "v3.1d" ) @@ -434,17 +439,18 @@ ROM_END ROM_START( compc1 ) ROM_REGION(0x10000, "bios", 0) - ROM_LOAD("380270-01.bin", 0xc000, 0x4000, BAD_DUMP CRC(75135d37) SHA1(177283642240fee191ba2d87e1d0c2a377c78ccb)) + ROM_LOAD("pc1_bios.bin", 0xc000, 0x4000, CRC(e37367c8) SHA1(9aac9c38b4ebdb9a740e393199c2eff75a0bde03)) ROM_REGION(0x8000, "gfx1", 0) - ROM_LOAD("pc1_char.bin", 0x0000, 0x8000, CRC(4773a945) SHA1(bcc38abecc75d3f641d42987cb0d2ed71d71bc4c)) + ROM_LOAD("pc1_char.bin", 0x0000, 0x4000, CRC(ee6c27f0) SHA1(e769cc3a49a1d708bd74eb4ac85bb6ea67220d38)) ROM_END + // Note: Commodore PC20-III, PC10-III and COLT share the same BIOS ROM_START( pc10iii ) ROM_REGION(0x10000, "bios", 0) ROM_DEFAULT_BIOS("v441") ROM_SYSTEM_BIOS(0, "v435", "v4.35") - ROMX_LOAD("318085-01.u201", 0x8000, 0x8000, NO_DUMP, ROM_BIOS(1)) + ROMX_LOAD("318085-01.u201", 0x8000, 0x8000, CRC(be752d1e) SHA1(5e5e63cd6d6269816cd691602e4c4d209fe3df67), ROM_BIOS(1)) ROM_SYSTEM_BIOS(1, "v436", "v4.36") ROMX_LOAD("318085-02.u201", 0x8000, 0x8000, NO_DUMP, ROM_BIOS(2)) ROM_SYSTEM_BIOS(2, "v436c", "v4.36c") @@ -509,7 +515,8 @@ COMP( 1991, poisk2, ibm5150, 0, poisk2, pccga, driver_device COMP( 1990, mc1702, ibm5150, 0, pccga, pccga, driver_device, 0, "<unknown>", "Elektronika MC-1702", MACHINE_NOT_WORKING) COMP( 1987, zdsupers, ibm5150, 0, zenith, pccga, driver_device, 0, "Zenith Data Systems", "SuperSport", 0) -COMP( 1985, sicpc1605, ibm5150, 0, siemens, pccga, driver_device, 0, "Siemens", "Sicomp PC16-05", 0) +COMP( 1985, sicpc1605, ibm5150, 0, siemens, pccga, driver_device, 0, "Siemens", "Sicomp PC16-05", MACHINE_NOT_WORKING) +COMP( 1985, ncrpc4i, ibm5150, 0, pccga, pccga, driver_device, 0, "NCR","PC4i", MACHINE_NOT_WORKING) COMP( 198?, olivm15, ibm5150, 0, m15, pccga, driver_device, 0, "Olivetti", "M15", 0) diff --git a/src/mame/drivers/pcktgal.cpp b/src/mame/drivers/pcktgal.cpp index 3a34210d516..f2745cb74a4 100644 --- a/src/mame/drivers/pcktgal.cpp +++ b/src/mame/drivers/pcktgal.cpp @@ -244,7 +244,7 @@ static MACHINE_CONFIG_START( pcktgal, pcktgal_state ) MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,0,0,0); + MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 0, 0) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") /* sound hardware */ diff --git a/src/mame/drivers/pipedrm.cpp b/src/mame/drivers/pipedrm.cpp index 0151f62c79c..d73d18bd93c 100644 --- a/src/mame/drivers/pipedrm.cpp +++ b/src/mame/drivers/pipedrm.cpp @@ -662,7 +662,6 @@ static MACHINE_CONFIG_START( pipedrm, pipedrm_state ) MCFG_VSYSTEM_SPR2_SET_OFFSETS(-13, -6) MCFG_VSYSTEM_SPR2_SET_PRITYPE(3) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(pipedrm_state,pipedrm) diff --git a/src/mame/drivers/pktgaldx.cpp b/src/mame/drivers/pktgaldx.cpp index f1f55c249af..98355880a4b 100644 --- a/src/mame/drivers/pktgaldx.cpp +++ b/src/mame/drivers/pktgaldx.cpp @@ -359,12 +359,10 @@ static MACHINE_CONFIG_START( pktgaldx, pktgaldx_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(2) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO104_ADD("ioprot104") MCFG_DECO146_SET_INTERFACE_SCRAMBLE(8,9, 4,5,6,7 ,1,0,3,2) // hopefully this is correct, nothing else uses this arrangement! diff --git a/src/mame/drivers/qdrmfgp.cpp b/src/mame/drivers/qdrmfgp.cpp index 6e8a59867eb..28e8593117d 100644 --- a/src/mame/drivers/qdrmfgp.cpp +++ b/src/mame/drivers/qdrmfgp.cpp @@ -598,12 +598,9 @@ static MACHINE_CONFIG_START( qdrmfgp, qdrmfgp_state ) MCFG_VIDEO_START_OVERRIDE(qdrmfgp_state,qdrmfgp) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(qdrmfgp_state, qdrmfgp_tile_callback) - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_4dj, 1, 0, "none") - MCFG_K056832_GFXDECODE("gfxdecode") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_4dj, 1, 0, "none") MCFG_K056832_PALETTE("palette") MCFG_DEVICE_ADD("k053252", K053252, XTAL_32MHz/4) @@ -645,12 +642,9 @@ static MACHINE_CONFIG_START( qdrmfgp2, qdrmfgp_state ) MCFG_VIDEO_START_OVERRIDE(qdrmfgp_state,qdrmfgp2) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(qdrmfgp_state, qdrmfgp2_tile_callback) - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_4dj, 1, 0, "none") - MCFG_K056832_GFXDECODE("gfxdecode") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_4dj, 1, 0, "none") MCFG_K056832_PALETTE("palette") MCFG_DEVICE_ADD("k053252", K053252, XTAL_32MHz/4) diff --git a/src/mame/drivers/rastan.cpp b/src/mame/drivers/rastan.cpp index fe3c3dfa6b1..8ee49dd6992 100644 --- a/src/mame/drivers/rastan.cpp +++ b/src/mame/drivers/rastan.cpp @@ -383,7 +383,6 @@ static MACHINE_CONFIG_START( rastan, rastan_state ) MCFG_DEVICE_ADD("pc080sn", PC080SN, 0) MCFG_PC080SN_GFXDECODE("gfxdecode") - MCFG_PC080SN_PALETTE("palette") MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0) MCFG_PC090OJ_GFX_REGION(1) diff --git a/src/mame/drivers/rbisland.cpp b/src/mame/drivers/rbisland.cpp index 922e7f48dad..c71c201750d 100644 --- a/src/mame/drivers/rbisland.cpp +++ b/src/mame/drivers/rbisland.cpp @@ -654,7 +654,6 @@ static MACHINE_CONFIG_START( rbisland, rbisland_state ) MCFG_DEVICE_ADD("pc080sn", PC080SN, 0) MCFG_PC080SN_GFX_REGION(1) MCFG_PC080SN_GFXDECODE("gfxdecode") - MCFG_PC080SN_PALETTE("palette") MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0) MCFG_PC090OJ_GFXDECODE("gfxdecode") @@ -708,7 +707,6 @@ static MACHINE_CONFIG_START( jumping, rbisland_state ) MCFG_PC080SN_GFX_REGION(1) MCFG_PC080SN_YINVERT(1) MCFG_PC080SN_GFXDECODE("gfxdecode") - MCFG_PC080SN_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/rohga.cpp b/src/mame/drivers/rohga.cpp index 4114bf30579..0379125810b 100644 --- a/src/mame/drivers/rohga.cpp +++ b/src/mame/drivers/rohga.cpp @@ -834,7 +834,6 @@ static MACHINE_CONFIG_START( rohga, rohga_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -850,14 +849,12 @@ static MACHINE_CONFIG_START( rohga, rohga_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) MCFG_DECO_SPRITE_PRIORITY_CB(rohga_state, rohga_pri_callback) MCFG_DECO_SPRITE_COLOUR_CB(rohga_state, rohga_col_callback) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO104_ADD("ioprot104") @@ -920,7 +917,6 @@ static MACHINE_CONFIG_START( wizdfire, rohga_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -936,17 +932,14 @@ static MACHINE_CONFIG_START( wizdfire, rohga_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(4) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO104_ADD("ioprot104") MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE @@ -1012,7 +1005,6 @@ static MACHINE_CONFIG_START( nitrobal, rohga_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -1028,17 +1020,14 @@ static MACHINE_CONFIG_START( nitrobal, rohga_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(4) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(rohga_state, wizdfire) @@ -1106,7 +1095,6 @@ static MACHINE_CONFIG_START( schmeisr, rohga_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -1122,14 +1110,12 @@ static MACHINE_CONFIG_START( schmeisr, rohga_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) MCFG_DECO_SPRITE_PRIORITY_CB(rohga_state, rohga_pri_callback) MCFG_DECO_SPRITE_COLOUR_CB(rohga_state, schmeisr_col_callback) // wire mods on pcb... MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO104_ADD("ioprot104") diff --git a/src/mame/drivers/rungun.cpp b/src/mame/drivers/rungun.cpp index 38d526632e0..662cf5f8237 100644 --- a/src/mame/drivers/rungun.cpp +++ b/src/mame/drivers/rungun.cpp @@ -447,8 +447,7 @@ static MACHINE_CONFIG_START( rng, rungun_state ) MCFG_DEVICE_ADD("k055673", K055673, 0) MCFG_K055673_CB(rungun_state, sprite_callback) - MCFG_K055673_CONFIG("gfx2", 1, K055673_LAYOUT_RNG, -8, 15) - MCFG_K055673_GFXDECODE("gfxdecode") + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_RNG, -8, 15) MCFG_K055673_PALETTE("palette") MCFG_K055673_SET_SCREEN("screen") diff --git a/src/mame/drivers/sandscrp.cpp b/src/mame/drivers/sandscrp.cpp index 50937085c9b..f42ccc583b9 100644 --- a/src/mame/drivers/sandscrp.cpp +++ b/src/mame/drivers/sandscrp.cpp @@ -499,7 +499,6 @@ static MACHINE_CONFIG_START( sandscrp, sandscrp_state ) MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0) MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode") - MCFG_KANEKO_PANDORA_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/segas24.cpp b/src/mame/drivers/segas24.cpp index 0d97e55ffb3..795df5cfdfd 100644 --- a/src/mame/drivers/segas24.cpp +++ b/src/mame/drivers/segas24.cpp @@ -1934,9 +1934,7 @@ static MACHINE_CONFIG_START( system24, segas24_state ) MCFG_TIMER_ADD_NONE("frc_timer") MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_frc", segas24_state, irq_frc_cb, attotime::from_hz(FRC_CLOCK_MODE1)) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) MCFG_S24TILE_DEVICE_ADD("tile", 0xfff) - MCFG_S24TILE_DEVICE_GFXDECODE("gfxdecode") MCFG_S24TILE_DEVICE_PALETTE("palette") MCFG_S24SPRITE_DEVICE_ADD("sprite") MCFG_S24MIXER_DEVICE_ADD("mixer") diff --git a/src/mame/drivers/seta.cpp b/src/mame/drivers/seta.cpp index 962c048cc94..5374875f519 100644 --- a/src/mame/drivers/seta.cpp +++ b/src/mame/drivers/seta.cpp @@ -7701,7 +7701,6 @@ static MACHINE_CONFIG_START( tndrcade, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -7756,7 +7755,6 @@ static MACHINE_CONFIG_START( twineagl, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -7800,7 +7798,6 @@ static MACHINE_CONFIG_START( downtown, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -7861,7 +7858,6 @@ static MACHINE_CONFIG_START( usclssic, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -7915,7 +7911,6 @@ static MACHINE_CONFIG_START( calibr50, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -7959,7 +7954,6 @@ static MACHINE_CONFIG_START( metafox, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -7997,7 +7991,6 @@ static MACHINE_CONFIG_START( atehate, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8041,7 +8034,6 @@ static MACHINE_CONFIG_START( blandia, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8079,7 +8071,6 @@ static MACHINE_CONFIG_START( blandiap, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8122,7 +8113,6 @@ static MACHINE_CONFIG_START( blockcar, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8194,7 +8184,6 @@ static MACHINE_CONFIG_START( daioh, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8232,7 +8221,6 @@ static MACHINE_CONFIG_START( daiohp, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8275,7 +8263,6 @@ static MACHINE_CONFIG_START( drgnunit, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8312,7 +8299,6 @@ static MACHINE_CONFIG_START( qzkklgy2, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8363,7 +8349,6 @@ static MACHINE_CONFIG_START( setaroul, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) MCFG_NVRAM_ADD_RANDOM_FILL("nvram") @@ -8407,7 +8392,6 @@ static MACHINE_CONFIG_START( eightfrc, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8450,7 +8434,6 @@ static MACHINE_CONFIG_START( extdwnhl, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8516,7 +8499,6 @@ static MACHINE_CONFIG_START( gundhara, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8561,7 +8543,6 @@ static MACHINE_CONFIG_START( jjsquawk, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8597,7 +8578,6 @@ static MACHINE_CONFIG_START( jjsquawb, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8642,7 +8622,6 @@ static MACHINE_CONFIG_START( kamenrid, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8681,7 +8660,6 @@ static MACHINE_CONFIG_START( orbs, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8724,7 +8702,6 @@ static MACHINE_CONFIG_START( keroppij, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8766,7 +8743,6 @@ static MACHINE_CONFIG_START( krzybowl, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8809,7 +8785,6 @@ static MACHINE_CONFIG_START( madshark, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8854,7 +8829,6 @@ static MACHINE_CONFIG_START( magspeed, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8902,7 +8876,6 @@ static MACHINE_CONFIG_START( msgundam, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8942,7 +8915,6 @@ static MACHINE_CONFIG_START( oisipuzl, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -8982,7 +8954,6 @@ static MACHINE_CONFIG_START( triplfun, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -9021,7 +8992,6 @@ static MACHINE_CONFIG_START( kiwame, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -9063,7 +9033,6 @@ static MACHINE_CONFIG_START( rezon, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -9104,7 +9073,6 @@ static MACHINE_CONFIG_START( thunderl, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -9176,7 +9144,6 @@ static MACHINE_CONFIG_START( wiggie, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -9214,7 +9181,6 @@ static MACHINE_CONFIG_START( wits, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -9252,7 +9218,6 @@ static MACHINE_CONFIG_START( umanclub, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -9294,7 +9259,6 @@ static MACHINE_CONFIG_START( utoukond, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -9346,7 +9310,6 @@ static MACHINE_CONFIG_START( wrofaero, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -9391,7 +9354,6 @@ static MACHINE_CONFIG_START( zingzip, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -9447,7 +9409,6 @@ static MACHINE_CONFIG_START( pairlove, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -9496,7 +9457,6 @@ static MACHINE_CONFIG_START( crazyfgt, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ @@ -9562,7 +9522,6 @@ static MACHINE_CONFIG_START( inttoote, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ diff --git a/src/mame/drivers/silvmil.cpp b/src/mame/drivers/silvmil.cpp index bff90fc7b16..fed4f7976be 100644 --- a/src/mame/drivers/silvmil.cpp +++ b/src/mame/drivers/silvmil.cpp @@ -420,7 +420,6 @@ static MACHINE_CONFIG_START( silvmil, silvmil_state ) MCFG_DECO_SPRITE_ISBOOTLEG(true) MCFG_DECO_SPRITE_OFFSETS(5, 7) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/simpl156.cpp b/src/mame/drivers/simpl156.cpp index 8bda58693b0..9187475a280 100644 --- a/src/mame/drivers/simpl156.cpp +++ b/src/mame/drivers/simpl156.cpp @@ -413,13 +413,11 @@ static MACHINE_CONFIG_START( chainrec, simpl156_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(2) MCFG_DECO_SPRITE_PRIORITY_CB(simpl156_state, pri_callback) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") diff --git a/src/mame/drivers/simpsons.cpp b/src/mame/drivers/simpsons.cpp index 5641f189a33..20e01f6306c 100644 --- a/src/mame/drivers/simpsons.cpp +++ b/src/mame/drivers/simpsons.cpp @@ -356,16 +356,13 @@ static MACHINE_CONFIG_START( simpsons, simpsons_state ) MCFG_PALETTE_ENABLE_HILIGHTS() MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k052109", K052109, 0) MCFG_GFX_PALETTE("palette") MCFG_K052109_CB(simpsons_state, tile_callback) MCFG_DEVICE_ADD("k053246", K053246, 0) MCFG_K053246_CB(simpsons_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, 53, 23) - MCFG_K053246_GFXDECODE("gfxdecode") + MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, 53, 23) MCFG_K053246_PALETTE("palette") MCFG_K053251_ADD("k053251") diff --git a/src/mame/drivers/slapshot.cpp b/src/mame/drivers/slapshot.cpp index 9348a9dbb9c..417b4d4b335 100644 --- a/src/mame/drivers/slapshot.cpp +++ b/src/mame/drivers/slapshot.cpp @@ -498,7 +498,6 @@ static MACHINE_CONFIG_START( slapshot, slapshot_state ) MCFG_TC0480SCP_OFFSETS_FLIP(0, 2) MCFG_TC0480SCP_COL_BASE(4096) MCFG_TC0480SCP_GFXDECODE("gfxdecode") - MCFG_TC0480SCP_PALETTE("palette") MCFG_TC0360PRI_ADD("tc0360pri") @@ -559,7 +558,6 @@ static MACHINE_CONFIG_START( opwolf3, slapshot_state ) MCFG_TC0480SCP_OFFSETS_FLIP(0, 2) MCFG_TC0480SCP_COL_BASE(4096) MCFG_TC0480SCP_GFXDECODE("gfxdecode") - MCFG_TC0480SCP_PALETTE("palette") MCFG_TC0360PRI_ADD("tc0360pri") diff --git a/src/mame/drivers/snk68.cpp b/src/mame/drivers/snk68.cpp index 72ef817e615..d173946a5ab 100644 --- a/src/mame/drivers/snk68.cpp +++ b/src/mame/drivers/snk68.cpp @@ -617,7 +617,6 @@ static MACHINE_CONFIG_START( pow, snk68_state ) MCFG_DEVICE_ADD("sprites", SNK68_SPR, 0) MCFG_SNK68_SPR_GFXDECODE("gfxdecode") - MCFG_SNK68_SPR_PALETTE("palette") MCFG_SNK68_SPR_SET_TILE_INDIRECT( snk68_state, tile_callback_pow ) MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_8MHz/2) /* verified on pcb */ diff --git a/src/mame/drivers/snowbros.cpp b/src/mame/drivers/snowbros.cpp index e038d66471b..095946efcdc 100644 --- a/src/mame/drivers/snowbros.cpp +++ b/src/mame/drivers/snowbros.cpp @@ -1678,7 +1678,6 @@ static MACHINE_CONFIG_START( snowbros, snowbros_state ) MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0) MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode") - MCFG_KANEKO_PANDORA_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/speglsht.cpp b/src/mame/drivers/speglsht.cpp index 74aee52aee1..6d683980e30 100644 --- a/src/mame/drivers/speglsht.cpp +++ b/src/mame/drivers/speglsht.cpp @@ -140,8 +140,8 @@ public: DECLARE_VIDEO_START(speglsht); UINT32 screen_update_speglsht(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device<palette_device> m_palette; - optional_device<st0016_cpu_device> m_maincpu; - optional_device<cpu_device> m_subcpu; + required_device<st0016_cpu_device> m_maincpu; + required_device<cpu_device> m_subcpu; DECLARE_WRITE8_MEMBER(st0016_rom_bank_w); }; @@ -387,7 +387,7 @@ UINT32 speglsht_state::screen_update_speglsht(screen_device &screen, bitmap_rgb3 { if(srcline[x]) { - rgb_t color=m_maincpu->m_palette->pen_color(srcline[x]); + rgb_t color = m_maincpu->palette().pen_color(srcline[x]); PLOT_PIXEL_RGB(x,y,color.r(),color.g(),color.b()); } } diff --git a/src/mame/drivers/spy.cpp b/src/mame/drivers/spy.cpp index 0806c904736..07bc4ed9c23 100644 --- a/src/mame/drivers/spy.cpp +++ b/src/mame/drivers/spy.cpp @@ -511,8 +511,6 @@ static MACHINE_CONFIG_START( spy, spy_state ) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k052109", K052109, 0) MCFG_GFX_PALETTE("palette") MCFG_K052109_CB(spy_state, tile_callback) diff --git a/src/mame/drivers/srmp2.cpp b/src/mame/drivers/srmp2.cpp index ca80decc53a..9b0c5bf1e62 100644 --- a/src/mame/drivers/srmp2.cpp +++ b/src/mame/drivers/srmp2.cpp @@ -1168,7 +1168,6 @@ static MACHINE_CONFIG_START( srmp2, srmp2_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1215,7 +1214,6 @@ static MACHINE_CONFIG_START( srmp3, srmp2_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(srmp2_state, srmp3_gfxbank_callback) /* video hardware */ @@ -1270,7 +1268,6 @@ static MACHINE_CONFIG_START( mjyuugi, srmp2_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(srmp2_state, srmp3_gfxbank_callback) /* video hardware */ diff --git a/src/mame/drivers/sshangha.cpp b/src/mame/drivers/sshangha.cpp index 13df09a5fd8..041b629e7a2 100644 --- a/src/mame/drivers/sshangha.cpp +++ b/src/mame/drivers/sshangha.cpp @@ -416,17 +416,14 @@ static MACHINE_CONFIG_START( sshangha, sshangha_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(2) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(2) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_DECO146_ADD("ioprot") diff --git a/src/mame/drivers/ssv.cpp b/src/mame/drivers/ssv.cpp index a698d6bcc9d..3b2419b8a3d 100644 --- a/src/mame/drivers/ssv.cpp +++ b/src/mame/drivers/ssv.cpp @@ -2637,7 +2637,6 @@ static MACHINE_CONFIG_DERIVED( gdfs, ssv ) MCFG_SCREEN_UPDATE_DRIVER(ssv_state, screen_update_gdfs) MCFG_DEVICE_ADD("st0020_spr", ST0020_SPRITES, 0) - MCFG_ST0020_SPRITES_GFXDECODE("gfxdecode") MCFG_ST0020_SPRITES_PALETTE("palette") MCFG_GFXDECODE_MODIFY("gfxdecode", gdfs) diff --git a/src/mame/drivers/stadhero.cpp b/src/mame/drivers/stadhero.cpp index e8fc5e9a4e1..3aea0de91c7 100644 --- a/src/mame/drivers/stadhero.cpp +++ b/src/mame/drivers/stadhero.cpp @@ -221,13 +221,12 @@ static MACHINE_CONFIG_START( stadhero, stadhero_state ) MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - deco_bac06_device::set_gfx_region_wide(*device,1,1,2); + MCFG_DECO_BAC06_GFX_REGION_WIDE(1, 1, 2) MCFG_DECO_BAC06_GFXDECODE("gfxdecode") MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) - deco_mxc06_device::set_gfx_region(*device, 2); + MCFG_DECO_MXC06_GFX_REGION(2) MCFG_DECO_MXC06_GFXDECODE("gfxdecode") - MCFG_DECO_MXC06_PALETTE("palette") /* sound hardware */ diff --git a/src/mame/drivers/subsino2.cpp b/src/mame/drivers/subsino2.cpp index 0ced7cfd5d7..8490bcb0d31 100644 --- a/src/mame/drivers/subsino2.cpp +++ b/src/mame/drivers/subsino2.cpp @@ -990,21 +990,21 @@ WRITE16_MEMBER(subsino2_state::new2001_outputs_w) output().set_led_value(0, data & 0x4000); // record? output().set_led_value(1, data & 0x2000); // shoot now output().set_led_value(2, data & 0x1000); // double - output().set_led_value(0, data & 0x0800); // black/red + output().set_led_value(3, data & 0x0800); // black/red } if (ACCESSING_BITS_0_7) { - output().set_led_value(0, data & 0x0080); // start - output().set_led_value(0, data & 0x0040); // take - output().set_led_value(0, data & 0x0020); // black/red + output().set_led_value(4, data & 0x0080); // start + output().set_led_value(5, data & 0x0040); // take + output().set_led_value(6, data & 0x0020); // black/red machine().bookkeeping().coin_counter_w(0, data & 0x0010); // coin in / key in - output().set_led_value(0, data & 0x0004); // ? - output().set_led_value(0, data & 0x0002); // ? + output().set_led_value(7, data & 0x0004); // ? + output().set_led_value(8, data & 0x0002); // ? } break; } - popmessage("0: %04x", m_outputs16[0]); +// popmessage("0: %04x", m_outputs16[0]); } // Same as bishjan (except for i/o and lo2 usage like xplan) @@ -2258,7 +2258,7 @@ INPUT_PORTS_END static MACHINE_CONFIG_START( bishjan, subsino2_state ) MCFG_CPU_ADD("maincpu", H83044, XTAL_44_1MHz / 3) MCFG_CPU_PROGRAM_MAP( bishjan_map ) - MCFG_CPU_VBLANK_INT_DRIVER("screen", subsino2_state, irq0_line_hold) + MCFG_CPU_VBLANK_INT_DRIVER("screen", subsino2_state, irq0_line_hold) MCFG_NVRAM_ADD_0FILL("nvram") MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) @@ -2364,7 +2364,7 @@ static MACHINE_CONFIG_START( xplan, subsino2_state ) MCFG_CPU_ADD("maincpu", I80188, XTAL_20MHz*2 ) // !! AMD AM188-EM !! MCFG_CPU_PROGRAM_MAP( xplan_map ) MCFG_CPU_IO_MAP( xplan_io ) - MCFG_CPU_VBLANK_INT_DRIVER("screen", subsino2_state, am188em_int0_irq) + MCFG_CPU_VBLANK_INT_DRIVER("screen", subsino2_state, am188em_int0_irq) MCFG_NVRAM_ADD_0FILL("nvram") diff --git a/src/mame/drivers/supbtime.cpp b/src/mame/drivers/supbtime.cpp index c2cc30185b2..7b4f6aaa542 100644 --- a/src/mame/drivers/supbtime.cpp +++ b/src/mame/drivers/supbtime.cpp @@ -349,12 +349,10 @@ static MACHINE_CONFIG_START( supbtime, supbtime_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(2) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -405,12 +403,10 @@ static MACHINE_CONFIG_START( chinatwn, supbtime_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(2) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/superchs.cpp b/src/mame/drivers/superchs.cpp index 035b0ccafc5..9aacce21f5e 100644 --- a/src/mame/drivers/superchs.cpp +++ b/src/mame/drivers/superchs.cpp @@ -336,7 +336,6 @@ static MACHINE_CONFIG_START( superchs, superchs_state ) MCFG_TC0480SCP_OFFSETS(0x20, 0x08) MCFG_TC0480SCP_OFFSETS_TX(-1, 0) MCFG_TC0480SCP_GFXDECODE("gfxdecode") - MCFG_TC0480SCP_PALETTE("palette") /* sound hardware */ MCFG_DEVICE_ADD("taito_en", TAITO_EN, 0) diff --git a/src/mame/drivers/suprslam.cpp b/src/mame/drivers/suprslam.cpp index 92d63b4de0d..20fd606a1f9 100644 --- a/src/mame/drivers/suprslam.cpp +++ b/src/mame/drivers/suprslam.cpp @@ -326,7 +326,6 @@ static MACHINE_CONFIG_START( suprslam, suprslam_state ) MCFG_VSYSTEM_SPR_SET_TILE_INDIRECT( suprslam_state, suprslam_tile_callback ) MCFG_VSYSTEM_SPR_SET_GFXREGION(1) MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR_PALETTE("palette") MCFG_DEVICE_ADD("k053936", K053936, 0) MCFG_K053936_WRAP(1) diff --git a/src/mame/drivers/taito_f2.cpp b/src/mame/drivers/taito_f2.cpp index 1f22ab4db16..d323e47ac41 100644 --- a/src/mame/drivers/taito_f2.cpp +++ b/src/mame/drivers/taito_f2.cpp @@ -3239,7 +3239,6 @@ static MACHINE_CONFIG_DERIVED( footchmp, taito_f2 ) MCFG_TC0480SCP_OFFSETS_TX(-1, 0) MCFG_TC0480SCP_OFFSETS_FLIP(-1, 0) MCFG_TC0480SCP_GFXDECODE("gfxdecode") - MCFG_TC0480SCP_PALETTE("palette") MCFG_TC0360PRI_ADD("tc0360pri") MACHINE_CONFIG_END @@ -3273,7 +3272,6 @@ static MACHINE_CONFIG_DERIVED( hthero, taito_f2 ) MCFG_TC0480SCP_OFFSETS_TX(-1, 0) MCFG_TC0480SCP_OFFSETS_FLIP(-1, 0) MCFG_TC0480SCP_GFXDECODE("gfxdecode") - MCFG_TC0480SCP_PALETTE("palette") MACHINE_CONFIG_END @@ -3440,7 +3438,6 @@ static MACHINE_CONFIG_DERIVED( metalb, taito_f2_tc0510nio ) MCFG_TC0480SCP_OFFSETS_FLIP(-1, 0) MCFG_TC0480SCP_COL_BASE(4096) MCFG_TC0480SCP_GFXDECODE("gfxdecode") - MCFG_TC0480SCP_PALETTE("palette") MCFG_TC0360PRI_ADD("tc0360pri") MACHINE_CONFIG_END @@ -3508,7 +3505,6 @@ static MACHINE_CONFIG_DERIVED( deadconx, taito_f2 ) MCFG_TC0480SCP_OFFSETS_TX(-1, 0) MCFG_TC0480SCP_OFFSETS_FLIP(-1, 0) MCFG_TC0480SCP_GFXDECODE("gfxdecode") - MCFG_TC0480SCP_PALETTE("palette") MCFG_TC0360PRI_ADD("tc0360pri") MACHINE_CONFIG_END @@ -3533,7 +3529,6 @@ static MACHINE_CONFIG_DERIVED( deadconxj, taito_f2 ) MCFG_TC0480SCP_OFFSETS_TX(-1, 0) MCFG_TC0480SCP_OFFSETS_FLIP(-1, 0) MCFG_TC0480SCP_GFXDECODE("gfxdecode") - MCFG_TC0480SCP_PALETTE("palette") MCFG_TC0360PRI_ADD("tc0360pri") MACHINE_CONFIG_END diff --git a/src/mame/drivers/taito_h.cpp b/src/mame/drivers/taito_h.cpp index c2714413025..900940597a2 100644 --- a/src/mame/drivers/taito_h.cpp +++ b/src/mame/drivers/taito_h.cpp @@ -676,7 +676,6 @@ static MACHINE_CONFIG_START( syvalion, taitoh_state ) MCFG_TC0080VCO_OFFSETS(1, 1) MCFG_TC0080VCO_BGFLIP_OFFS(-2) MCFG_TC0080VCO_GFXDECODE("gfxdecode") - MCFG_TC0080VCO_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -732,7 +731,6 @@ static MACHINE_CONFIG_START( recordbr, taitoh_state ) MCFG_TC0080VCO_OFFSETS(1, 1) MCFG_TC0080VCO_BGFLIP_OFFS(-2) MCFG_TC0080VCO_GFXDECODE("gfxdecode") - MCFG_TC0080VCO_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -796,7 +794,6 @@ static MACHINE_CONFIG_START( dleague, taitoh_state ) MCFG_TC0080VCO_OFFSETS(1, 1) MCFG_TC0080VCO_BGFLIP_OFFS(-2) MCFG_TC0080VCO_GFXDECODE("gfxdecode") - MCFG_TC0080VCO_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/taito_o.cpp b/src/mame/drivers/taito_o.cpp index 263ff71afcd..2b9761750a4 100644 --- a/src/mame/drivers/taito_o.cpp +++ b/src/mame/drivers/taito_o.cpp @@ -253,7 +253,6 @@ static MACHINE_CONFIG_START( parentj, taitoo_state ) MCFG_TC0080VCO_OFFSETS(1, 1) MCFG_TC0080VCO_BGFLIP_OFFS(-2) MCFG_TC0080VCO_GFXDECODE("gfxdecode") - MCFG_TC0080VCO_PALETTE("palette") MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/taito_x.cpp b/src/mame/drivers/taito_x.cpp index 9d068780e0b..ed18529079e 100644 --- a/src/mame/drivers/taito_x.cpp +++ b/src/mame/drivers/taito_x.cpp @@ -809,7 +809,6 @@ static MACHINE_CONFIG_START( superman, taitox_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -857,7 +856,6 @@ static MACHINE_CONFIG_START( daisenpu, taitox_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -903,7 +901,6 @@ static MACHINE_CONFIG_START( gigandes, taitox_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -951,7 +948,6 @@ static MACHINE_CONFIG_START( ballbros, taitox_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/taito_z.cpp b/src/mame/drivers/taito_z.cpp index 16fbc1beb8c..45d69582597 100644 --- a/src/mame/drivers/taito_z.cpp +++ b/src/mame/drivers/taito_z.cpp @@ -3641,7 +3641,6 @@ static MACHINE_CONFIG_START( dblaxle, taitoz_state ) MCFG_TC0480SCP_TX_REGION(2) MCFG_TC0480SCP_OFFSETS(0x1f, 0x08) MCFG_TC0480SCP_GFXDECODE("gfxdecode") - MCFG_TC0480SCP_PALETTE("palette") MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0) @@ -3717,7 +3716,6 @@ static MACHINE_CONFIG_START( racingb, taitoz_state ) MCFG_TC0480SCP_TX_REGION(2) MCFG_TC0480SCP_OFFSETS(0x1f, 0x08) MCFG_TC0480SCP_GFXDECODE("gfxdecode") - MCFG_TC0480SCP_PALETTE("palette") MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0) diff --git a/src/mame/drivers/taitoair.cpp b/src/mame/drivers/taitoair.cpp index 95e1fcdcec9..3315310901b 100644 --- a/src/mame/drivers/taitoair.cpp +++ b/src/mame/drivers/taitoair.cpp @@ -767,7 +767,6 @@ static MACHINE_CONFIG_START( airsys, taitoair_state ) MCFG_TC0080VCO_OFFSETS(1, 1) MCFG_TC0080VCO_BGFLIP_OFFS(-2) MCFG_TC0080VCO_GFXDECODE("gfxdecode") - MCFG_TC0080VCO_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/taotaido.cpp b/src/mame/drivers/taotaido.cpp index 5f4585f3048..f977e8beb69 100644 --- a/src/mame/drivers/taotaido.cpp +++ b/src/mame/drivers/taotaido.cpp @@ -387,7 +387,6 @@ static MACHINE_CONFIG_START( taotaido, taotaido_state ) MCFG_VSYSTEM_SPR_SET_TILE_INDIRECT( taotaido_state, tile_callback ) MCFG_VSYSTEM_SPR_SET_GFXREGION(0) MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") diff --git a/src/mame/drivers/tasman.cpp b/src/mame/drivers/tasman.cpp index a9c65694c9b..91159716ee7 100644 --- a/src/mame/drivers/tasman.cpp +++ b/src/mame/drivers/tasman.cpp @@ -22,20 +22,44 @@ #include "emu.h" #include "video/konami_helper.h" -#include "includes/konamigx.h" #include "cpu/m68000/m68000.h" +#include "machine/k053252.h" +#include "video/k053246_k053247_k055673.h" +#include "video/k054156_k054157_k056832.h" +#include "video/k055555.h" #include "machine/eepromser.h" #define CUSTOM_DRAW 1 -class kongambl_state : public konamigx_state // with everything devicified there's probably not much point in inheriting the GX state. +class kongambl_state : public driver_device { public: kongambl_state(const machine_config &mconfig, device_type type, const char *tag) - : konamigx_state(mconfig, type, tag), + : driver_device(mconfig, type, tag), + m_maincpu(*this,"maincpu"), + m_k053252(*this, "k053252"), + m_k055673(*this, "k055673"), + m_k055555(*this, "k055555"), + m_k056832(*this, "k056832"), +#if CUSTOM_DRAW + m_gfxdecode(*this, "gfxdecode"), +#endif + m_screen(*this, "screen"), + m_palette(*this, "palette"), m_vram(*this, "vram") { } + required_device<cpu_device> m_maincpu; + required_device<k053252_device> m_k053252; + required_device<k055673_device> m_k055673; + required_device<k055555_device> m_k055555; + required_device<k056832_device> m_k056832; +#if CUSTOM_DRAW + required_device<gfxdecode_device> m_gfxdecode; +#endif + required_device<screen_device> m_screen; + required_device<palette_device> m_palette; + optional_shared_ptr<UINT32> m_vram; DECLARE_READ32_MEMBER(eeprom_r); DECLARE_WRITE8_MEMBER(eeprom_w); @@ -48,6 +72,8 @@ public: virtual void machine_reset() override { m_irq_mask = 0; }; UINT32 screen_update_kongambl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + WRITE_LINE_MEMBER(vblank_irq_ack_w); + WRITE_LINE_MEMBER(hblank_irq_ack_w); TIMER_DEVICE_CALLBACK_MEMBER(kongambl_vblank); K056832_CB_MEMBER(tile_callback); K053246_CB_MEMBER(sprite_callback); @@ -576,6 +602,16 @@ static GFXDECODE_START( tasman ) GFXDECODE_END +WRITE_LINE_MEMBER(kongambl_state::vblank_irq_ack_w) +{ + m_maincpu->set_input_line(1, CLEAR_LINE); +} + +WRITE_LINE_MEMBER(kongambl_state::hblank_irq_ack_w) +{ + m_maincpu->set_input_line(2, CLEAR_LINE); +} + TIMER_DEVICE_CALLBACK_MEMBER(kongambl_state::kongambl_vblank) { int scanline = param; @@ -606,8 +642,8 @@ static MACHINE_CONFIG_START( kongambl, kongambl_state ) MCFG_DEVICE_ADD("k053252", K053252, 25000000) MCFG_K053252_OFFSETS(0, 16) // TBD - MCFG_K053252_INT1_ACK_CB(WRITELINE(konamigx_state, vblank_irq_ack_w)) - MCFG_K053252_INT2_ACK_CB(WRITELINE(konamigx_state, hblank_irq_ack_w)) + MCFG_K053252_INT1_ACK_CB(WRITELINE(kongambl_state, vblank_irq_ack_w)) + MCFG_K053252_INT2_ACK_CB(WRITELINE(kongambl_state, hblank_irq_ack_w)) MCFG_VIDEO_SET_SCREEN("screen") MCFG_EEPROM_SERIAL_93C46_ADD("eeprom") @@ -626,16 +662,16 @@ static MACHINE_CONFIG_START( kongambl, kongambl_state ) MCFG_DEVICE_ADD("k055673", K055673, 0) MCFG_K055673_CB(kongambl_state, sprite_callback) - MCFG_K055673_CONFIG("gfx2", 1, K055673_LAYOUT_LE2, -48+1, -23) - MCFG_K055673_GFXDECODE("gfxdecode") + MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_LE2, -48+1, -23) MCFG_K055673_PALETTE("palette") +#if CUSTOM_DRAW MCFG_GFXDECODE_ADD("gfxdecode", "palette", tasman) +#endif MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(kongambl_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8TASMAN, 0, 0, "none") - MCFG_K056832_GFXDECODE("gfxdecode") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_8TASMAN, 0, 0, "none") MCFG_K056832_PALETTE("palette") MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") diff --git a/src/mame/drivers/thedealr.cpp b/src/mame/drivers/thedealr.cpp index d6e9698474a..96a765dfda1 100644 --- a/src/mame/drivers/thedealr.cpp +++ b/src/mame/drivers/thedealr.cpp @@ -534,7 +534,6 @@ static MACHINE_CONFIG_START( thedealr, thedealr_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_MACHINE_RESET_OVERRIDE(thedealr_state,thedealr) MCFG_MACHINE_START_OVERRIDE(thedealr_state,thedealr) diff --git a/src/mame/drivers/thedeep.cpp b/src/mame/drivers/thedeep.cpp index e999027842b..12e4926c632 100644 --- a/src/mame/drivers/thedeep.cpp +++ b/src/mame/drivers/thedeep.cpp @@ -439,9 +439,8 @@ static MACHINE_CONFIG_START( thedeep, thedeep_state ) MCFG_PALETTE_INIT_OWNER(thedeep_state, thedeep) MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) - deco_mxc06_device::set_gfx_region(*device, 0); + MCFG_DECO_MXC06_GFX_REGION(0) MCFG_DECO_MXC06_GFXDECODE("gfxdecode") - MCFG_DECO_MXC06_PALETTE("palette") MCFG_DECO_MXC06_RAMSIZE(0x400) /* sound hardware */ diff --git a/src/mame/drivers/ti99_4p.cpp b/src/mame/drivers/ti99_4p.cpp index 7da4302262b..4650d391c08 100644 --- a/src/mame/drivers/ti99_4p.cpp +++ b/src/mame/drivers/ti99_4p.cpp @@ -41,6 +41,7 @@ #include "cpu/tms9900/tms9900.h" #include "sound/wave.h" #include "sound/dac.h" +#include "sound/sn76496.h" #include "machine/tms9901.h" #include "imagedev/cassette.h" @@ -53,8 +54,9 @@ #define TMS9901_TAG "tms9901" #define SGCPU_TAG "sgcpu" -#define VERBOSE 1 -#define LOG logerror +#define TRACE_ILLWRITE 0 +#define TRACE_READY 0 +#define TRACE_INT 0 class ti99_4p_state : public driver_device { @@ -63,7 +65,7 @@ public: : driver_device(mconfig, type, tag), m_cpu(*this, "maincpu"), m_tms9901(*this, TMS9901_TAG), - m_sound(*this, TISOUND_TAG), + m_sound(*this, TISOUNDCHIP_TAG), m_video(*this, VIDEO_SYSTEM_TAG), m_cassette(*this, "cassette"), m_peribox(*this, PERIBOX_TAG), @@ -103,13 +105,13 @@ public: DECLARE_WRITE_LINE_MEMBER(set_tms9901_INT2_from_v9938); - required_device<tms9900_device> m_cpu; - required_device<tms9901_device> m_tms9901; - required_device<ti_sound_system_device> m_sound; - required_device<ti_exp_video_device> m_video; - required_device<cassette_image_device> m_cassette; - required_device<peribox_device> m_peribox; - required_device<joyport_device> m_joyport; + required_device<tms9900_device> m_cpu; + required_device<tms9901_device> m_tms9901; + required_device<sn76496_base_device> m_sound; + required_device<ti_exp_video_device> m_video; + required_device<cassette_image_device> m_cassette; + required_device<peribox_device> m_peribox; + required_device<joyport_device> m_joyport; // Pointer to ROM0 UINT16 *m_rom0; @@ -354,7 +356,7 @@ WRITE16_MEMBER( ti99_4p_state::memwrite ) if (zone==0x0000) { // ROM0 - if (VERBOSE>4) LOG("sgcpu: ignoring ROM write access at %04x\n", addroff); + if (TRACE_ILLWRITE) logerror("Ignoring ROM write access at %04x\n", addroff); return; } @@ -368,7 +370,7 @@ WRITE16_MEMBER( ti99_4p_state::memwrite ) { if (m_internal_dsr) { - if (VERBOSE>4) LOG("sgcpu: ignoring DSR write access at %04x\n", addroff); + if (TRACE_ILLWRITE) logerror("Ignoring DSR write access at %04x\n", addroff); return; } else @@ -692,39 +694,6 @@ WRITE_LINE_MEMBER( ti99_4p_state::cassette_output ) m_cassette->output((state!=0)? +1 : -1); } -/* -// TMS9901 setup. The callback functions pass a reference to the TMS9901 as device. -const tms9901_interface tms9901_wiring_sgcpu = -{ - TMS9901_INT1 | TMS9901_INT2 | TMS9901_INTC, // only input pins whose state is always known - - // read handler - DEVCB_DRIVER_MEMBER(ti99_4p_state, read_by_9901), - - { // write handlers - DEVCB_NULL, - DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(ti99_4p_state, keyC0), - DEVCB_DRIVER_LINE_MEMBER(ti99_4p_state, keyC1), - DEVCB_DRIVER_LINE_MEMBER(ti99_4p_state, keyC2), - DEVCB_DRIVER_LINE_MEMBER(ti99_4p_state, alphaW), - DEVCB_DRIVER_LINE_MEMBER(ti99_4p_state, cs_motor), - DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(ti99_4p_state, audio_gate), - DEVCB_DRIVER_LINE_MEMBER(ti99_4p_state, cassette_output), - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL - }, - - // interrupt handler - DEVCB_DRIVER_MEMBER(ti99_4p_state, tms9901_interrupt) -}; - -*/ /*************************************************************************** Control lines @@ -741,9 +710,9 @@ WRITE_LINE_MEMBER( ti99_4p_state::console_ready ) m_ready_line = state; int combined = (m_ready_line == ASSERT_LINE && m_ready_line_dmux == ASSERT_LINE)? ASSERT_LINE : CLEAR_LINE; - if (VERBOSE>6) + if (TRACE_READY) { - if (m_ready_prev != combined) LOG("ti99_4p: READY level = %d\n", combined); + if (m_ready_prev != combined) logerror("READY level = %d\n", combined); } m_ready_prev = combined; m_cpu->set_ready(combined); @@ -759,9 +728,9 @@ WRITE_LINE_MEMBER( ti99_4p_state::console_ready_dmux ) m_ready_line_dmux = state; int combined = (m_ready_line == ASSERT_LINE && m_ready_line_dmux == ASSERT_LINE)? ASSERT_LINE : CLEAR_LINE; - if (VERBOSE>7) + if (TRACE_READY) { - if (m_ready_prev != combined) LOG("ti99_4p: READY dmux level = %d\n", state); + if (m_ready_prev != combined) logerror("READY dmux level = %d\n", state); } m_ready_prev = combined; m_cpu->set_ready(combined); @@ -777,13 +746,13 @@ void ti99_4p_state::set_9901_int( int line, line_state state) WRITE_LINE_MEMBER( ti99_4p_state::extint ) { - if (VERBOSE>6) LOG("ti99_4p: EXTINT level = %02x\n", state); + if (TRACE_INT) logerror("EXTINT level = %02x\n", state); set_9901_int(1, (line_state)state); } WRITE_LINE_MEMBER( ti99_4p_state::notconnected ) { - if (VERBOSE>6) LOG("ti99_4p: Setting a not connected line ... ignored\n"); + if (TRACE_INT) logerror("Setting a not connected line ... ignored\n"); } /* @@ -812,7 +781,7 @@ READ8_MEMBER( ti99_4p_state::interrupt_level ) WRITE8_MEMBER( ti99_4p_state::external_operation ) { static const char* extop[8] = { "inv1", "inv2", "IDLE", "RSET", "inv3", "CKON", "CKOF", "LREX" }; - if (VERBOSE>1) LOG("External operation %s not implemented on the SGCPU board\n", extop[offset]); + logerror("External operation %s not implemented on the SGCPU board\n", extop[offset]); } /*****************************************************************************/ @@ -891,9 +860,11 @@ static MACHINE_CONFIG_START( ti99_4p_60hz, ti99_4p_state ) MCFG_PERIBOX_INTB_HANDLER( WRITELINE(ti99_4p_state, notconnected) ) MCFG_PERIBOX_READY_HANDLER( WRITELINE(ti99_4p_state, console_ready) ) - // sound hardware - MCFG_TI_SOUND_94624_ADD( TISOUND_TAG ) - MCFG_TI_SOUND_READY_HANDLER( WRITELINE(ti99_4p_state, console_ready) ) + // Sound hardware + MCFG_SPEAKER_STANDARD_MONO("sound_out") + MCFG_SOUND_ADD(TISOUNDCHIP_TAG, SN94624, 3579545/8) /* 3.579545 MHz */ + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "sound_out", 0.75) + MCFG_SN76496_READY_HANDLER( WRITELINE(ti99_4p_state, console_ready) ) // Cassette drives MCFG_SPEAKER_STANDARD_MONO("cass_out") diff --git a/src/mame/drivers/ti99_4x.cpp b/src/mame/drivers/ti99_4x.cpp index 107f3a466e8..898327f92a7 100644 --- a/src/mame/drivers/ti99_4x.cpp +++ b/src/mame/drivers/ti99_4x.cpp @@ -82,8 +82,11 @@ public: DECLARE_MACHINE_START(ti99_4); DECLARE_MACHINE_START(ti99_4a); DECLARE_MACHINE_START(ti99_4qi); + DECLARE_MACHINE_START(ti99_4ev); + DECLARE_MACHINE_RESET(ti99_4); DECLARE_MACHINE_RESET(ti99_4a); + DECLARE_MACHINE_RESET(ti99_4ev); // Processor connections with the main board DECLARE_READ8_MEMBER( cruread ); @@ -126,6 +129,9 @@ public: // Interrupt triggers DECLARE_INPUT_CHANGED_MEMBER( load_interrupt ); + // Used by EVPC + void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + private: void set_keyboard_column(int number, int data); int m_keyboard_column; @@ -154,6 +160,9 @@ private: required_device<ti_video_device> m_video; required_device<cassette_image_device> m_cassette1; required_device<cassette_image_device> m_cassette2; + + // Timer for EVPC (provided by the TMS9929A, but EVPC replaces that VDP) + emu_timer *m_gromclk_timer; }; /* @@ -631,6 +640,18 @@ WRITE_LINE_MEMBER( ti99_4x_state::gromclk_in ) m_datamux->gromclk_in(state); } +/* + Used by the EVPC +*/ +void ti99_4x_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + // Pulse it + if (m_datamux != nullptr) + { + gromclk_in(ASSERT_LINE); + gromclk_in(CLEAR_LINE); + } +} /*****************************************************************************/ @@ -814,9 +835,11 @@ static MACHINE_CONFIG_START( ti99_4, ti99_4x_state ) MCFG_PERIBOX_INTB_HANDLER( WRITELINE(ti99_4x_state, notconnected) ) MCFG_PERIBOX_READY_HANDLER( DEVWRITELINE(DATAMUX_TAG, ti99_datamux_device, ready_line) ) - /* sound hardware */ - MCFG_TI_SOUND_94624_ADD( TISOUND_TAG ) - MCFG_TI_SOUND_READY_HANDLER( WRITELINE(ti99_4x_state, console_ready_sound) ) + // Sound hardware + MCFG_SPEAKER_STANDARD_MONO("sound_out") + MCFG_SOUND_ADD(TISOUNDCHIP_TAG, SN94624, 3579545/8) /* 3.579545 MHz */ + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "sound_out", 0.75) + MCFG_SN76496_READY_HANDLER( WRITELINE(ti99_4x_state, console_ready_sound) ) /* Cassette drives */ MCFG_SPEAKER_STANDARD_MONO("cass_out") @@ -911,9 +934,11 @@ static MACHINE_CONFIG_START( ti99_4a, ti99_4x_state ) MCFG_PERIBOX_INTB_HANDLER( WRITELINE(ti99_4x_state, notconnected) ) MCFG_PERIBOX_READY_HANDLER( DEVWRITELINE(DATAMUX_TAG, ti99_datamux_device, ready_line) ) - /* sound hardware */ - MCFG_TI_SOUND_94624_ADD( TISOUND_TAG ) - MCFG_TI_SOUND_READY_HANDLER( WRITELINE(ti99_4x_state, console_ready_sound) ) + // Sound hardware + MCFG_SPEAKER_STANDARD_MONO("sound_out") + MCFG_SOUND_ADD(TISOUNDCHIP_TAG, SN94624, 3579545/8) /* 3.579545 MHz */ + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "sound_out", 0.75) + MCFG_SN76496_READY_HANDLER( WRITELINE(ti99_4x_state, console_ready_sound) ) /* Cassette drives */ MCFG_SPEAKER_STANDARD_MONO("cass_out") @@ -986,6 +1011,27 @@ MACHINE_CONFIG_END replacing the console video processor. *************************************************************************/ +MACHINE_START_MEMBER(ti99_4x_state, ti99_4ev) +{ + m_peribox->senila(CLEAR_LINE); + m_peribox->senilb(CLEAR_LINE); + m_nready_combined = 0; + m_model = MODEL_4A; + // Removing the TMS9928a requires to add a replacement for the GROMCLK. + // In the real hardware this is a circuit (REPL99x) that fits into the VDP socket + m_gromclk_timer = timer_alloc(0); +} + +MACHINE_RESET_MEMBER(ti99_4x_state, ti99_4ev) +{ + m_cpu->set_ready(ASSERT_LINE); + m_cpu->set_hold(CLEAR_LINE); + m_int1 = CLEAR_LINE; + m_int2 = CLEAR_LINE; + m_int12 = CLEAR_LINE; + m_gromclk_timer->adjust(attotime::zero, 0, attotime::from_hz(XTAL_10_738635MHz/24)); +} + static MACHINE_CONFIG_START( ti99_4ev_60hz, ti99_4x_state ) /* CPU */ MCFG_TMS99xx_ADD("maincpu", TMS9900, 3000000, memmap, cru_map) @@ -994,14 +1040,11 @@ static MACHINE_CONFIG_START( ti99_4ev_60hz, ti99_4x_state ) MCFG_TMS99xx_CLKOUT_HANDLER( WRITELINE(ti99_4x_state, clock_out) ) MCFG_TMS99xx_DBIN_HANDLER( WRITELINE(ti99_4x_state, dbin_line) ) - MCFG_MACHINE_START_OVERRIDE(ti99_4x_state, ti99_4a ) + MCFG_MACHINE_START_OVERRIDE(ti99_4x_state, ti99_4ev ) + MCFG_MACHINE_RESET_OVERRIDE(ti99_4x_state, ti99_4ev ) /* video hardware */ MCFG_DEVICE_ADD(VIDEO_SYSTEM_TAG, V9938VIDEO, 0) - // Removing the TMS9928a requires to add a replacement for the GROMCLK. - // In the real hardware this is a circuit (REPL99x) that fits into the VDP socket - MCFG_ADD_GROMCLK_CB( WRITELINE(ti99_4x_state, gromclk_in) ) - MCFG_V9938_ADD(VDP_TAG, SCREEN_TAG, 0x20000, XTAL_21_4772MHz) /* typical 9938 clock, not verified */ MCFG_V99X8_INTERRUPT_CALLBACK(WRITELINE(ti99_4x_state, video_interrupt_in)) MCFG_V99X8_SCREEN_ADD_NTSC(SCREEN_TAG, VDP_TAG, XTAL_21_4772MHz) @@ -1034,9 +1077,11 @@ static MACHINE_CONFIG_START( ti99_4ev_60hz, ti99_4x_state ) MCFG_PERIBOX_INTB_HANDLER( WRITELINE(ti99_4x_state, notconnected) ) MCFG_PERIBOX_READY_HANDLER( DEVWRITELINE(DATAMUX_TAG, ti99_datamux_device, ready_line) ) - /* sound hardware */ - MCFG_TI_SOUND_94624_ADD( TISOUND_TAG ) - MCFG_TI_SOUND_READY_HANDLER( WRITELINE(ti99_4x_state, console_ready_sound) ) + // Sound hardware + MCFG_SPEAKER_STANDARD_MONO("sound_out") + MCFG_SOUND_ADD(TISOUNDCHIP_TAG, SN94624, 3579545/8) /* 3.579545 MHz */ + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "sound_out", 0.75) + MCFG_SN76496_READY_HANDLER( WRITELINE(ti99_4x_state, console_ready_sound) ) /* Cassette drives */ MCFG_SPEAKER_STANDARD_MONO("cass_out") @@ -1100,7 +1145,6 @@ ROM_START(ti99_4qi) ROM_LOAD("994qigr2.bin", 0x4000, 0x1800, CRC(e0bb5341) SHA1(e255f0d65d69b927cecb8fcfac7a4c17d585ea96)) /* system GROM 2 */ ROM_END - ROM_START(ti99_4ev) /*CPU memory space*/ ROM_REGION16_BE(0x2000, CONSOLEROM, 0) @@ -1111,11 +1155,11 @@ ROM_START(ti99_4ev) ROM_LOAD("994agr38.bin", 0x0000, 0x6000, CRC(bdd9f09b) SHA1(9b058a55d2528d2a6a69d7081aa296911ed7c0de)) /* system GROMs */ ROM_END -/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ -COMP( 1979, ti99_4, 0, 0, ti99_4_60hz, ti99_4, driver_device, 0, "Texas Instruments", "TI-99/4 Home Computer (US)" , 0) -COMP( 1980, ti99_4e, ti99_4, 0, ti99_4_50hz, ti99_4, driver_device, 0, "Texas Instruments", "TI-99/4 Home Computer (Europe)" , 0) -COMP( 1981, ti99_4a, 0, 0, ti99_4a_60hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4A Home Computer (US)" , 0) -COMP( 1981, ti99_4ae, ti99_4a, 0, ti99_4a_50hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4A Home Computer (Europe)" , 0) -COMP( 1983, ti99_4qe, ti99_4qi, 0, ti99_4qi_50hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4QI Home Computer (Europe)" , 0) -COMP( 1983, ti99_4qi, 0, 0, ti99_4qi_60hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4QI Home Computer" , 0) -COMP( 1994, ti99_4ev, ti99_4a, 0, ti99_4ev_60hz,ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4A Home Computer with EVPC" , 0) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 1979, ti99_4, 0, 0, ti99_4_60hz, ti99_4, driver_device, 0, "Texas Instruments", "TI-99/4 Home Computer (US)", 0) +COMP( 1980, ti99_4e, ti99_4, 0, ti99_4_50hz, ti99_4, driver_device, 0, "Texas Instruments", "TI-99/4 Home Computer (Europe)", 0) +COMP( 1981, ti99_4a, 0, 0, ti99_4a_60hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4A Home Computer (US)", 0) +COMP( 1981, ti99_4ae, ti99_4a, 0, ti99_4a_50hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4A Home Computer (Europe)", 0) +COMP( 1983, ti99_4qe, ti99_4qi, 0, ti99_4qi_50hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4QI Home Computer (Europe)", 0) +COMP( 1983, ti99_4qi, 0, 0, ti99_4qi_60hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4QI Home Computer (US)", 0) +COMP( 1994, ti99_4ev, ti99_4a, 0, ti99_4ev_60hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4A Home Computer with EVPC", 0) diff --git a/src/mame/drivers/tnzs.cpp b/src/mame/drivers/tnzs.cpp index 828ff045e2a..0a3d72a8e05 100644 --- a/src/mame/drivers/tnzs.cpp +++ b/src/mame/drivers/tnzs.cpp @@ -1565,7 +1565,6 @@ static MACHINE_CONFIG_START( arknoid2, tnzs_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1613,7 +1612,6 @@ static MACHINE_CONFIG_START( drtoppel, tnzs_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1663,7 +1661,6 @@ static MACHINE_CONFIG_START( tnzs, tnzs_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1709,7 +1706,6 @@ static MACHINE_CONFIG_START( insectx, tnzs_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1755,7 +1751,6 @@ static MACHINE_CONFIG_START( kageki, tnzs_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1813,7 +1808,6 @@ static MACHINE_CONFIG_START( tnzsb, tnzs_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1879,7 +1873,6 @@ static MACHINE_CONFIG_START( jpopnics, tnzs_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") - MCFG_SETA001_SPRITE_PALETTE("palette") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/topspeed.cpp b/src/mame/drivers/topspeed.cpp index e265b3130f4..512bb5b6b91 100644 --- a/src/mame/drivers/topspeed.cpp +++ b/src/mame/drivers/topspeed.cpp @@ -580,13 +580,11 @@ static MACHINE_CONFIG_START( topspeed, topspeed_state ) MCFG_PC080SN_GFX_REGION(1) MCFG_PC080SN_OFFSETS(0, 8) MCFG_PC080SN_GFXDECODE("gfxdecode") - MCFG_PC080SN_PALETTE("palette") MCFG_DEVICE_ADD("pc080sn_2", PC080SN, 0) MCFG_PC080SN_GFX_REGION(1) MCFG_PC080SN_OFFSETS(0, 8) MCFG_PC080SN_GFXDECODE("gfxdecode") - MCFG_PC080SN_PALETTE("palette") MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0) MCFG_TC0140SYT_MASTER_CPU("maincpu") diff --git a/src/mame/drivers/tumbleb.cpp b/src/mame/drivers/tumbleb.cpp index 291dcab7e68..9c00b3289e1 100644 --- a/src/mame/drivers/tumbleb.cpp +++ b/src/mame/drivers/tumbleb.cpp @@ -2063,7 +2063,6 @@ static MACHINE_CONFIG_START( tumblepb, tumbleb_state ) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_ISBOOTLEG(true) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", tumbleb) MCFG_PALETTE_ADD("palette", 1024) @@ -2102,7 +2101,6 @@ static MACHINE_CONFIG_START( tumbleb2, tumbleb_state ) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_ISBOOTLEG(true) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", tumbleb) MCFG_PALETTE_ADD("palette", 1024) @@ -2144,7 +2142,6 @@ static MACHINE_CONFIG_START( jumpkids, tumbleb_state ) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_ISBOOTLEG(true) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", tumbleb) MCFG_PALETTE_ADD("palette", 1024) @@ -2183,7 +2180,6 @@ static MACHINE_CONFIG_START( fncywld, tumbleb_state ) MCFG_DECO_SPRITE_ISBOOTLEG(true) MCFG_DECO_SPRITE_TRANSPEN(15) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", fncywld) MCFG_PALETTE_ADD("palette", 0x800) @@ -2246,7 +2242,6 @@ static MACHINE_CONFIG_START( htchctch, tumbleb_state ) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_ISBOOTLEG(true) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", tumbleb) MCFG_PALETTE_ADD("palette", 1024) @@ -2357,7 +2352,6 @@ static MACHINE_CONFIG_START( suprtrio, tumbleb_state ) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_ISBOOTLEG(true) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", suprtrio) MCFG_PALETTE_ADD("palette", 1024) @@ -2396,7 +2390,6 @@ static MACHINE_CONFIG_START( pangpang, tumbleb_state ) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_ISBOOTLEG(true) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", tumbleb) MCFG_PALETTE_ADD("palette", 1024) diff --git a/src/mame/drivers/tumblep.cpp b/src/mame/drivers/tumblep.cpp index ed7a0bbd561..6e68462322c 100644 --- a/src/mame/drivers/tumblep.cpp +++ b/src/mame/drivers/tumblep.cpp @@ -313,12 +313,10 @@ static MACHINE_CONFIG_START( tumblep, tumblep_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(2) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - MCFG_DECO_SPRITE_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") diff --git a/src/mame/drivers/undrfire.cpp b/src/mame/drivers/undrfire.cpp index 65e79c5acee..b820a7a8565 100644 --- a/src/mame/drivers/undrfire.cpp +++ b/src/mame/drivers/undrfire.cpp @@ -708,7 +708,6 @@ static MACHINE_CONFIG_START( undrfire, undrfire_state ) MCFG_TC0480SCP_OFFSETS(0x24, 0) MCFG_TC0480SCP_OFFSETS_TX(-1, 0) MCFG_TC0480SCP_GFXDECODE("gfxdecode") - MCFG_TC0480SCP_PALETTE("palette") /* sound hardware */ MCFG_DEVICE_ADD("taito_en", TAITO_EN, 0) @@ -757,7 +756,6 @@ static MACHINE_CONFIG_START( cbombers, undrfire_state ) MCFG_TC0480SCP_OFFSETS_TX(-1, 0) MCFG_TC0480SCP_COL_BASE(4096) MCFG_TC0480SCP_GFXDECODE("gfxdecode") - MCFG_TC0480SCP_PALETTE("palette") /* sound hardware */ MCFG_DEVICE_ADD("taito_en", TAITO_EN, 0) diff --git a/src/mame/drivers/vaportra.cpp b/src/mame/drivers/vaportra.cpp index 4f30b993a32..0eaa9a755b7 100644 --- a/src/mame/drivers/vaportra.cpp +++ b/src/mame/drivers/vaportra.cpp @@ -254,7 +254,6 @@ static MACHINE_CONFIG_START( vaportra, vaportra_state ) MCFG_DECO16IC_PF12_8X8_BANK(0) MCFG_DECO16IC_PF12_16X16_BANK(1) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -270,12 +269,10 @@ static MACHINE_CONFIG_START( vaportra, vaportra_state ) MCFG_DECO16IC_PF12_8X8_BANK(2) MCFG_DECO16IC_PF12_16X16_BANK(3) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DECO16IC_PALETTE("palette") MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) - deco_mxc06_device::set_gfx_region(*device, 4); + MCFG_DECO_MXC06_GFX_REGION(4) MCFG_DECO_MXC06_GFXDECODE("gfxdecode") - MCFG_DECO_MXC06_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/vendetta.cpp b/src/mame/drivers/vendetta.cpp index 04795e83708..8bd74706d79 100644 --- a/src/mame/drivers/vendetta.cpp +++ b/src/mame/drivers/vendetta.cpp @@ -460,16 +460,13 @@ static MACHINE_CONFIG_START( vendetta, vendetta_state ) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k052109", K052109, 0) MCFG_GFX_PALETTE("palette") MCFG_K052109_CB(vendetta_state, vendetta_tile_callback) MCFG_DEVICE_ADD("k053246", K053246, 0) MCFG_K053246_CB(vendetta_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, 53, 6) - MCFG_K053246_GFXDECODE("gfxdecode") + MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, 53, 6) MCFG_K053246_PALETTE("palette") MCFG_K053251_ADD("k053251") @@ -507,7 +504,7 @@ static MACHINE_CONFIG_DERIVED( esckids, vendetta ) MCFG_K052109_CB(vendetta_state, esckids_tile_callback) MCFG_DEVICE_MODIFY("k053246") - MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, 101, 6) + MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, 101, 6) MCFG_DEVICE_ADD("k053252", K053252, 6000000) MCFG_K053252_OFFSETS(12*8, 1*8) diff --git a/src/mame/drivers/welltris.cpp b/src/mame/drivers/welltris.cpp index 05b29b06cfc..5d547ef911e 100644 --- a/src/mame/drivers/welltris.cpp +++ b/src/mame/drivers/welltris.cpp @@ -723,7 +723,6 @@ static MACHINE_CONFIG_START( welltris, welltris_state ) MCFG_VSYSTEM_SPR2_SET_GFXREGION(1) MCFG_VSYSTEM_SPR2_SET_PRITYPE(-1) MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode") - MCFG_VSYSTEM_SPR2_PALETTE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/xexex.cpp b/src/mame/drivers/xexex.cpp index 24098d42aca..c9d3ebf32a8 100644 --- a/src/mame/drivers/xexex.cpp +++ b/src/mame/drivers/xexex.cpp @@ -521,18 +521,14 @@ static MACHINE_CONFIG_START( xexex, xexex_state ) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_ENABLE_HILIGHTS() - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(xexex_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_4, 1, 0, "none") - MCFG_K056832_GFXDECODE("gfxdecode") + MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0, "none") MCFG_K056832_PALETTE("palette") MCFG_DEVICE_ADD("k053246", K053246, 0) MCFG_K053246_CB(xexex_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, -48, 32) - MCFG_K053246_GFXDECODE("gfxdecode") + MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -48, 32) MCFG_K053246_PALETTE("palette") MCFG_K053250_ADD("k053250", "palette", "screen", -5, -16) diff --git a/src/mame/drivers/xmen.cpp b/src/mame/drivers/xmen.cpp index fb5e3a62705..c924ce91528 100644 --- a/src/mame/drivers/xmen.cpp +++ b/src/mame/drivers/xmen.cpp @@ -336,16 +336,13 @@ static MACHINE_CONFIG_START( xmen, xmen_state ) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k052109", K052109, 0) MCFG_GFX_PALETTE("palette") MCFG_K052109_CB(xmen_state, tile_callback) MCFG_DEVICE_ADD("k053246", K053246, 0) MCFG_K053246_CB(xmen_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, 53, -2) - MCFG_K053246_GFXDECODE("gfxdecode") + MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, 53, -2) MCFG_K053246_PALETTE("palette") MCFG_K053251_ADD("k053251") @@ -399,17 +396,14 @@ static MACHINE_CONFIG_START( xmen6p, xmen_state ) MCFG_VIDEO_START_OVERRIDE(xmen_state,xmen6p) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k052109", K052109, 0) MCFG_GFX_PALETTE("palette") MCFG_K052109_CB(xmen_state, tile_callback) MCFG_DEVICE_ADD("k053246", K053246, 0) MCFG_K053246_CB(xmen_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", 1, NORMAL_PLANE_ORDER, 53, -2) + MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, 53, -2) MCFG_K053246_SET_SCREEN("screen") - MCFG_K053246_GFXDECODE("gfxdecode") MCFG_K053246_PALETTE("palette") MCFG_K053251_ADD("k053251") diff --git a/src/mame/drivers/zr107.cpp b/src/mame/drivers/zr107.cpp index f838f3e21e2..202c0f102f9 100644 --- a/src/mame/drivers/zr107.cpp +++ b/src/mame/drivers/zr107.cpp @@ -784,12 +784,9 @@ static MACHINE_CONFIG_START( zr107, zr107_state ) MCFG_VIDEO_START_OVERRIDE(zr107_state,zr107) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(zr107_state, tile_callback) - MCFG_K056832_CONFIG("gfx2", 1, K056832_BPP_8, 1, 0, "none") - MCFG_K056832_GFXDECODE("gfxdecode") + MCFG_K056832_CONFIG("gfx2", K056832_BPP_8, 1, 0, "none") MCFG_K056832_PALETTE("palette") MCFG_DEVICE_ADD("k001005", K001005, 0) @@ -856,16 +853,11 @@ static MACHINE_CONFIG_START( jetwave, zr107_state ) MCFG_VIDEO_START_OVERRIDE(zr107_state,jetwave) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) - MCFG_DEVICE_ADD("k001604", K001604, 0) - MCFG_K001604_GFX_INDEX1(0) - MCFG_K001604_GFX_INDEX2(1) MCFG_K001604_LAYER_SIZE(0) MCFG_K001604_ROZ_SIZE(0) MCFG_K001604_TXT_OFFSET(0) MCFG_K001604_ROZ_OFFSET(16384) - MCFG_K001604_GFXDECODE("gfxdecode") MCFG_K001604_PALETTE("palette") MCFG_DEVICE_ADD("k001005", K001005, 0) diff --git a/src/mame/includes/cybiko.h b/src/mame/includes/cybiko.h index 0c6ad30b5aa..5ccbc687a90 100644 --- a/src/mame/includes/cybiko.h +++ b/src/mame/includes/cybiko.h @@ -19,7 +19,6 @@ /* Core includes */ #include "emu.h" -#include "emuopts.h" #include "sound/speaker.h" /* Components */ diff --git a/src/mame/includes/konamigx.h b/src/mame/includes/konamigx.h index f5ee6f795d5..fb5f54f28d5 100644 --- a/src/mame/includes/konamigx.h +++ b/src/mame/includes/konamigx.h @@ -52,7 +52,7 @@ public: required_device<cpu_device> m_maincpu; optional_device<cpu_device> m_soundcpu; optional_device<tms57002_device> m_dasp; - required_device<k053252_device> m_k053252; // not hooked up in tasman.cpp yet (does it even have it?) + required_device<k053252_device> m_k053252; required_device<k055673_device> m_k055673; required_device<k055555_device> m_k055555; required_device<k056832_device> m_k056832; @@ -60,7 +60,7 @@ public: optional_device<k056800_device> m_k056800; optional_device<k054539_device> m_k054539_1; optional_device<k054539_device> m_k054539_2; - required_device<gfxdecode_device> m_gfxdecode; + optional_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; required_device<palette_device> m_palette; diff --git a/src/mame/includes/model1.h b/src/mame/includes/model1.h index 824766648e5..1881dc54428 100644 --- a/src/mame/includes/model1.h +++ b/src/mame/includes/model1.h @@ -180,12 +180,12 @@ public: DECLARE_TGP_FUNCTION( clear_stack ); DECLARE_TGP_FUNCTION( matrix_mul ); DECLARE_TGP_FUNCTION( anglev ); - DECLARE_TGP_FUNCTION( f11 ); + DECLARE_TGP_FUNCTION( triangle_normal ); DECLARE_TGP_FUNCTION( normalize ); DECLARE_TGP_FUNCTION( acc_seti ); DECLARE_TGP_FUNCTION( track_select ); - DECLARE_TGP_FUNCTION( f14 ); - DECLARE_TGP_FUNCTION( f15_swa ); + DECLARE_TGP_FUNCTION( load_base ); + DECLARE_TGP_FUNCTION( transpose ); DECLARE_TGP_FUNCTION( anglep ); DECLARE_TGP_FUNCTION( matrix_ident ); DECLARE_TGP_FUNCTION( matrix_read ); @@ -214,9 +214,9 @@ public: DECLARE_TGP_FUNCTION( xyz2rqf ); DECLARE_TGP_FUNCTION( f43 ); DECLARE_TGP_FUNCTION( f43_swa ); - DECLARE_TGP_FUNCTION( f44 ); + DECLARE_TGP_FUNCTION( track_read_tri ); DECLARE_TGP_FUNCTION( matrix_sdir ); - DECLARE_TGP_FUNCTION( f45 ); + DECLARE_TGP_FUNCTION( fsqrt ); DECLARE_TGP_FUNCTION( vlength ); DECLARE_TGP_FUNCTION( f47 ); DECLARE_TGP_FUNCTION( track_read_info ); diff --git a/src/mame/includes/naomi.h b/src/mame/includes/naomi.h index 3e1e6c80eb0..74b981da5de 100644 --- a/src/mame/includes/naomi.h +++ b/src/mame/includes/naomi.h @@ -25,6 +25,7 @@ naomi.h -> NAOMI includes #include "machine/aicartc.h" #include "machine/jvsdev.h" #include "machine/jvs13551.h" +#include "machine/m3comm.h" #include "dc.h" enum { diff --git a/src/mame/machine/m1comm.cpp b/src/mame/machine/m1comm.cpp index ceec0fc893b..acde86cc451 100644 --- a/src/mame/machine/m1comm.cpp +++ b/src/mame/machine/m1comm.cpp @@ -51,6 +51,8 @@ Notes: JP8 - Jumper, set to 1-2 (selects CLOCK SOURCE) */ +#include "emu.h" +#include "emuopts.h" #include "machine/m1comm.h" #define Z80_TAG "m1commcpu" diff --git a/src/mame/machine/m1comm.h b/src/mame/machine/m1comm.h index 56106dbe28f..366ad62a455 100644 --- a/src/mame/machine/m1comm.h +++ b/src/mame/machine/m1comm.h @@ -7,7 +7,6 @@ #define __M1COMM_SIMULATION__ -#include "emu.h" #include "cpu/z80/z80.h" #define MCFG_M1COMM_ADD(_tag ) \ diff --git a/src/mame/machine/m3comm.cpp b/src/mame/machine/m3comm.cpp new file mode 100644 index 00000000000..47b81f77433 --- /dev/null +++ b/src/mame/machine/m3comm.cpp @@ -0,0 +1,256 @@ +// license:BSD-3-Clause +// copyright-holders:MetalliC + +/* + +MODEL3 COMMUNICATION BOARD +837-11861 171-7053B +SEGA 1995 +|---------------------------------------------------------------------------------------------------| +| | +| LATTICE NKK N341256SJ-20 NKK N341256SJ-20 NKK N341256SJ-20 40MHz | +| PLSI 2032 JP3 JP1 | +| (315-5958) JP4 NKK N341256SJ-20 NKK N341256SJ-20 NKK N341256SJ-20 | +| JP2 | +| | +| PALCE16V8 | +| 315-6075 68000FN12 315-5804 315-5917 315-5917 | +| (QFP144) (QFP80) (QFP80) | +| PALCE16V8 | +| 315-6074 | +| LEDx7 | +|---------------------------------------------------------------------------------------------------| +JP1: 1-2 +JP2: 2-3 +JP3: not shorted +JP4: shorted + + +HIKARU COMMUNICATION BOARD +837-13404 171-7641B +|-----------------------------------| +| 40MHz LATTICE 315-5917 | +| PLSI2032 | +| (315-5958A) 315-5917| +| PAL | +| 62256 | +| 315-5804 62256 | +| 62256 | +| 62256 | +| 68000 PAL | +| 62256 | +| 62256 PAL | +|-----------------------------------| +Notes: + 62256 - 32k x8 SRAM + + +NAOMI COMMUNICATION BOARD +840-0001E +837-13489 171-7704B +SEGA 1998 +|--------------------------------------------------------------------| +| CN1 CN3 | +| 40MHz 256KbSRAM 315-5917 256KbSRAM 315-5917 256KbSRAM | +| 256KbSRAM (QFP80) 256KbSRAM (QFP80) 256KbSRAM | +| | +| | +| 315-5804 68000FN12 LATTICE | +| (QFP144) M5-128/104 | +| 12YC/1-15YI/1 | +| (315-6194A) | +| CN2 | +|--------------------------------------------------------------------| + +*/ + + +#include "emu.h" +#include "emuopts.h" +#include "machine/m3comm.h" + +#define M68K_TAG "m3commcpu" + +/************************************* + * M3COMM Memory Map + *************************************/ +static ADDRESS_MAP_START( m3comm_mem, AS_PROGRAM, 16, m3comm_device ) + AM_RANGE(0x0000000, 0x000ffff) AM_RAM AM_SHARE("m68k_ram") + AM_RANGE(0x0080000, 0x008ffff) AM_RAMBANK("comm_ram") + AM_RANGE(0x0040000, 0x0040001) AM_READWRITE(commbank_r, commbank_w) + AM_RANGE(0x00C0088, 0x00C0089) AM_READWRITE(status0_r, status0_w) + AM_RANGE(0x00C008A, 0x00C008B) AM_READWRITE(status1_r, status1_w) +ADDRESS_MAP_END + + +MACHINE_CONFIG_FRAGMENT( m3comm ) + MCFG_CPU_ADD(M68K_TAG, M68000, 10000000) // random + MCFG_CPU_PROGRAM_MAP(m3comm_mem) + + MCFG_RAM_ADD(RAM_TAG) + MCFG_RAM_DEFAULT_SIZE("128K") +MACHINE_CONFIG_END + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +const device_type M3COMM = &device_creator<m3comm_device>; + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor m3comm_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( m3comm ); +} + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// m3comm_device - constructor +//------------------------------------------------- + +m3comm_device::m3comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, M3COMM, "MODEL-3 COMMUNICATION BD", tag, owner, clock, "m3comm", __FILE__), + m68k_ram(*this, "m68k_ram"), + m_commcpu(*this, M68K_TAG), + m_ram(*this, RAM_TAG), + m_line_rx(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE ), + m_line_tx(OPEN_FLAG_READ) +{ + // prepare localhost "filename" + m_localhost[0] = 0; + strcat(m_localhost, "socket."); + strcat(m_localhost, mconfig.options().comm_localhost()); + strcat(m_localhost, ":"); + strcat(m_localhost, mconfig.options().comm_localport()); + + // prepare remotehost "filename" + m_remotehost[0] = 0; + strcat(m_remotehost, "socket."); + strcat(m_remotehost, mconfig.options().comm_remotehost()); + strcat(m_remotehost, ":"); + strcat(m_remotehost, mconfig.options().comm_remoteport()); +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void m3comm_device::device_start() +{ +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void m3comm_device::device_reset() +{ + m_control = 0xC000; + m_offset = 0; + m_status0 = 0; + m_status1 = 0; + m_commbank = 0; + membank("comm_ram")->set_base(m_ram->pointer()); +} + +void m3comm_device::device_reset_after_children() +{ + m_commcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); +} + + +READ16_MEMBER(m3comm_device::commbank_r) +{ + return m_commbank; +} +WRITE16_MEMBER(m3comm_device::commbank_w) +{ + m_commbank = data; + membank("comm_ram")->set_base(m_ram->pointer() + (m_commbank ? 0x10000 : 0)); +} +READ16_MEMBER(m3comm_device::status0_r) +{ + return m_status0; +} +WRITE16_MEMBER(m3comm_device::status0_w) +{ + m_status0 = data; +} +READ16_MEMBER(m3comm_device::status1_r) +{ + return m_status1; +} +WRITE16_MEMBER(m3comm_device::status1_w) +{ + m_status1 = data; +} + +READ16_MEMBER(m3comm_device::naomi_r) +{ + switch (offset) + { + case 0: // 5F7018 + return m_control; + case 1: // 5F701C + return m_offset; + case 2: // 5F7020 + { + logerror("M3COMM read @ %08x\n", (m_control << 16) | m_offset); + UINT16 value; + if (m_control & 1) + value = m68k_ram[m_offset / 2]; + else { + UINT16 *commram = (UINT16*)membank("comm_ram")->base(); + + value = commram[m_offset / 2]; + } + m_offset+= 2; + return value; + } + case 3: // 5F7024 + return m_status0; + case 4: // 5F7028 + return m_status1; + default: + return 0; + } +} + +WRITE16_MEMBER(m3comm_device::naomi_w) +{ + switch (offset) + { + case 0: // 5F7018 + logerror("M3COMM control write %04x\n", data); + m_control = data; + m_commcpu->set_input_line(INPUT_LINE_RESET, (m_control & 0x20) ? CLEAR_LINE : ASSERT_LINE); + break; + case 1: // 5F701C + m_offset = data; + break; + case 2: // 5F7020 + logerror("M3COMM write @ %08x %04x\n", (m_control << 16) | m_offset, data); + if (m_control & 1) + m68k_ram[m_offset / 2] = data; + else { + UINT16 *commram = (UINT16*)membank("comm_ram")->base(); + commram[m_offset / 2] = data; + } + m_offset += 2; + break; + case 3: // 5F7024 + m_status0 = data; + break; + case 4: // 5F7028 + m_status1 = data; + break; + } +} diff --git a/src/mame/machine/m3comm.h b/src/mame/machine/m3comm.h new file mode 100644 index 00000000000..231fbc3a27c --- /dev/null +++ b/src/mame/machine/m3comm.h @@ -0,0 +1,64 @@ +// license:BSD-3-Clause +// copyright-holders:MetalliC +#pragma once + +#ifndef __M3COMM_H__ +#define __M3COMM_H__ + +#include "machine/ram.h" +#include "cpu/m68000/m68000.h" + +#define MCFG_M3COMM_ADD(_tag ) \ + MCFG_DEVICE_ADD(_tag, M3COMM, 0) + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +class m3comm_device : public device_t +{ +public: + // construction/destruction + m3comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const override; + + required_shared_ptr<UINT16> m68k_ram; + required_device<m68000_device> m_commcpu; + + DECLARE_READ16_MEMBER(naomi_r); + DECLARE_WRITE16_MEMBER(naomi_w); + DECLARE_READ16_MEMBER(status0_r); + DECLARE_WRITE16_MEMBER(status0_w); + DECLARE_READ16_MEMBER(status1_r); + DECLARE_WRITE16_MEMBER(status1_w); + DECLARE_READ16_MEMBER(commbank_r); + DECLARE_WRITE16_MEMBER(commbank_w); + +protected: + required_device<ram_device> m_ram; + + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_reset_after_children() override; + +private: + UINT16 m_control; + UINT16 m_offset; + UINT16 m_status0; + UINT16 m_status1; + UINT16 m_commbank; + + + emu_file m_line_rx; // rx line - can be either differential, simple serial or toslink + emu_file m_line_tx; // tx line - is differential, simple serial and toslink + char m_localhost[256]; + char m_remotehost[256]; +}; + +// device type definition +extern const device_type M3COMM; + +#endif /* __M3COMM_H__ */ diff --git a/src/mame/machine/mhavoc.cpp b/src/mame/machine/mhavoc.cpp index 375517022ee..1596717c658 100644 --- a/src/mame/machine/mhavoc.cpp +++ b/src/mame/machine/mhavoc.cpp @@ -265,6 +265,9 @@ WRITE8_MEMBER(mhavoc_state::mhavoc_out_0_w) m_gamma_xmtd = 0; } + /* Bit 2 = Beta reset */ + /* this is the unpopulated processor in the corner of the pcb farthest from the quad pokey, not used on shipping boards */ + /* Bit 0 = Roller light (Blinks on fatal errors) */ output().set_led_value(0, data & 0x01); } diff --git a/src/mame/machine/model1.cpp b/src/mame/machine/model1.cpp index 2f974d00a97..f6136cde723 100644 --- a/src/mame/machine/model1.cpp +++ b/src/mame/machine/model1.cpp @@ -247,30 +247,36 @@ TGP_FUNCTION( model1_state::anglev ) next_fn(); } -TGP_FUNCTION( model1_state::f11 ) -{ - float a = fifoin_pop_f(); - float b = fifoin_pop_f(); - float c = fifoin_pop_f(); - float d = fifoin_pop_f(); - float e = fifoin_pop_f(); - float f = fifoin_pop_f(); - float g = fifoin_pop_f(); - float h = fifoin_pop_f(); - float i = fifoin_pop_f(); - (void)a; - (void)b; - (void)c; - (void)d; - (void)e; - (void)f; - (void)g; - (void)h; - (void)i; - logerror("TGP f11 %f, %f, %f, %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, g, h, i, m_pushpc); - fifoout_push_f(0); - fifoout_push_f(0); - fifoout_push_f(0); +TGP_FUNCTION( model1_state::triangle_normal ) +{ + float p1x = fifoin_pop_f(); + float p1y = fifoin_pop_f(); + float p1z = fifoin_pop_f(); + float p2x = fifoin_pop_f(); + float p2y = fifoin_pop_f(); + float p2z = fifoin_pop_f(); + float p3x = fifoin_pop_f(); + float p3y = fifoin_pop_f(); + float p3z = fifoin_pop_f(); + + float nx = (p1y-p2y)*(p3z-p2z) - (p3y-p2y)*(p1z-p2z); + float ny = (p1z-p2z)*(p3x-p2x) - (p3z-p2z)*(p1x-p2x); + float nz = (p1x-p2x)*(p3y-p2y) - (p3x-p2x)*(p1y-p2y); + + float nn = sqrtf(nx*nx + ny*ny + nz*nz); + if(nn < 1e-3) + nn = 0; + else + nn = 1/nn; + + nx *= nn; + ny *= nn; + nz *= nn; + + logerror("TGP triangle_normal %f, %f, %f, %f, %f, %f, %f, %f, %f (%x)\n", p1x, p1y, p1z, p2x, p2y,p2z, p3x, p3y, p3z, m_pushpc); + fifoout_push_f(nx); + fifoout_push_f(ny); + fifoout_push_f(nz); next_fn(); } @@ -304,19 +310,25 @@ TGP_FUNCTION( model1_state::track_select ) next_fn(); } -TGP_FUNCTION( model1_state::f14 ) +TGP_FUNCTION( model1_state::load_base ) { m_tgp_vr_base[0] = fifoin_pop_f(); m_tgp_vr_base[1] = fifoin_pop_f(); m_tgp_vr_base[2] = fifoin_pop_f(); m_tgp_vr_base[3] = fifoin_pop_f(); + logerror("TGP load_base %f, %f, %f, %f (%x)\n", m_tgp_vr_base[0], m_tgp_vr_base[1], m_tgp_vr_base[2], m_tgp_vr_base[3], m_pushpc); next_fn(); } -TGP_FUNCTION( model1_state::f15_swa ) +TGP_FUNCTION( model1_state::transpose ) { - logerror("TGP f15_swa (%x)\n", m_pushpc); + logerror("TGP transpose (%x)\n", m_pushpc); + + float t; + t = m_cmat[1]; m_cmat[1] = m_cmat[3]; m_cmat[3] = t; + t = m_cmat[2]; m_cmat[2] = m_cmat[6]; m_cmat[6] = t; + t = m_cmat[5]; m_cmat[5] = m_cmat[7]; m_cmat[7] = t; next_fn(); } @@ -371,6 +383,8 @@ TGP_FUNCTION( model1_state::matrix_trans ) float b = fifoin_pop_f(); float c = fifoin_pop_f(); + logerror("TCP matrix_trans %f %f %f (%x)\n", a, b, c, m_pushpc); + m_cmat[ 9] += m_cmat[0]*a+m_cmat[3]*b+m_cmat[6]*c; m_cmat[10] += m_cmat[1]*a+m_cmat[4]*b+m_cmat[7]*c; m_cmat[11] += m_cmat[2]*a+m_cmat[5]*b+m_cmat[8]*c; @@ -504,7 +518,7 @@ TGP_FUNCTION( model1_state::f24_swa ) (void)f; (void)g; logerror("TGP f24_swa %f, %f, %f, %f, %f, %f, %x (%x)\n", a, b, c, d, e, f, g, m_pushpc); - fifoout_push_f(0); + fifoout_push(1); next_fn(); } @@ -514,7 +528,6 @@ TGP_FUNCTION( model1_state::transform_point ) float y = fifoin_pop_f(); float z = fifoin_pop_f(); logerror("TGP transform_point %f, %f, %f (%x)\n", x, y, z, m_pushpc); - fifoout_push_f(m_cmat[0]*x+m_cmat[3]*y+m_cmat[6]*z+m_cmat[9]); fifoout_push_f(m_cmat[1]*x+m_cmat[4]*y+m_cmat[7]*z+m_cmat[10]); fifoout_push_f(m_cmat[2]*x+m_cmat[5]*y+m_cmat[8]*z+m_cmat[11]); @@ -568,7 +581,7 @@ TGP_FUNCTION( model1_state::distance3 ) a -= d; b -= e; c -= f; - fifoout_push_f((a*a+b*b+c*c)/sqrtf(a*a+b*b+c*c)); + fifoout_push_f(sqrtf(a*a+b*b+c*c)); next_fn(); } @@ -663,12 +676,9 @@ TGP_FUNCTION( model1_state::xyz2rqf ) float b = fifoin_pop_f(); float c = fifoin_pop_f(); float norm; - (void)a; - (void)b; - (void)c; logerror("TGP xyz2rqf %f, %f, %f (%x)\n", a, b, c, m_pushpc); - fifoout_push_f((a*a+b*b+c*c)/sqrtf(a*a+b*b+c*c)); - norm = sqrt(a*a+c*c); + fifoout_push_f(sqrtf(a*a+b*b+c*c)); + norm = sqrtf(a*a+c*c); if(!c) { if(a>=0) fifoout_push(0); @@ -732,14 +742,18 @@ TGP_FUNCTION( model1_state::f43_swa ) next_fn(); } -TGP_FUNCTION( model1_state::f44 ) +TGP_FUNCTION( model1_state::track_read_tri ) { - float a = fifoin_pop_f(); - (void)a; - logerror("TGP f44 %f (%x)\n", a, m_pushpc); - fifoout_push_f(0); - fifoout_push_f(0); - fifoout_push_f(0); + const UINT32 *tgp_data = (const UINT32 *)memregion("user2")->base(); + UINT32 a = fifoin_pop(); + int offd; + + logerror("TGP track_read_tri %d (%x)\n", a, m_pushpc); + + offd = tgp_data[0x20+m_tgp_vr_select] + 16*a; + fifoout_push(tgp_data[offd+12]); + fifoout_push(tgp_data[offd+13]); + fifoout_push(tgp_data[offd+14]); next_fn(); } @@ -748,7 +762,7 @@ TGP_FUNCTION( model1_state::matrix_sdir ) float a = fifoin_pop_f(); float b = fifoin_pop_f(); float c = fifoin_pop_f(); - float norm = sqrt(a*a+b*b+c*c); + float norm = sqrtf(a*a+b*b+c*c); float t[9], m[9]; logerror("TGP matrix_sdir %f, %f, %f (%x)\n", a, b, c, m_pushpc); @@ -764,7 +778,7 @@ TGP_FUNCTION( model1_state::matrix_sdir ) t[1] = b / norm; t[2] = a / norm; - norm = sqrt(a*a+c*c); + norm = sqrtf(a*a+c*c); t[6] = a/norm; t[7] = 0; t[8] = c/norm; @@ -772,7 +786,7 @@ TGP_FUNCTION( model1_state::matrix_sdir ) t[3] = -b*c; t[4] = a*a+c*c; t[5] = -b*a; - norm = sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]); + norm = sqrtf(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]); t[3] /= norm; t[4] /= norm; t[5] /= norm; @@ -793,27 +807,25 @@ TGP_FUNCTION( model1_state::matrix_sdir ) next_fn(); } -TGP_FUNCTION( model1_state::f45 ) +TGP_FUNCTION( model1_state::fsqrt ) { float a = fifoin_pop_f(); - (void)a; - logerror("TGP f45 %f (%x)\n", a, m_pushpc); - fifoout_push_f(0); + logerror("TGP fsqrt %f (%x)\n", a, m_pushpc); + fifoout_push_f(sqrtf(a)); next_fn(); } TGP_FUNCTION( model1_state::vlength ) { - float a = fifoin_pop_f() - m_tgp_vr_base[0]; - float b = fifoin_pop_f() - m_tgp_vr_base[1]; - float c = fifoin_pop_f() - m_tgp_vr_base[2]; - logerror("TGP vlength %f, %f, %f (%x)\n", a, b, c, m_pushpc); + float x = fifoin_pop_f(); + float y = fifoin_pop_f(); + float z = fifoin_pop_f(); + logerror("TGP vlength %f, %f, %f (%x)\n", x, y, z, m_pushpc); - a = (a*a+b*b+c*c); - b = 1/sqrt(a); - c = a * b; - c -= m_tgp_vr_base[3]; - fifoout_push_f(c); + x -= m_tgp_vr_base[0]; + y -= m_tgp_vr_base[1]; + z -= m_tgp_vr_base[2]; + fifoout_push_f(sqrtf(x*x + y*y + z*z) - m_tgp_vr_base[3]); next_fn(); } @@ -931,7 +943,7 @@ TGP_FUNCTION( model1_state::matrix_rdir ) float a = fifoin_pop_f(); float b = fifoin_pop_f(); float c = fifoin_pop_f(); - float norm = sqrt(a*a+c*c); + float norm = sqrtf(a*a+c*c); float t1, t2; (void)b; @@ -1109,7 +1121,7 @@ TGP_FUNCTION( model1_state::col_testpt ) logerror("TGP col_testpt %f, %f (%x)\n", a, b, m_pushpc); x = a - m_tgp_vr_circx; y = b - m_tgp_vr_circy; - fifoout_push_f(((x*x+y*y)/sqrtf(x*x+y*y)) - m_tgp_vr_circrad); + fifoout_push_f(sqrtf(x*x+y*y) - m_tgp_vr_circrad); next_fn(); } @@ -1170,7 +1182,7 @@ TGP_FUNCTION( model1_state::distance ) logerror("TGP distance (%f, %f), (%f, %f) (%x)\n", a, b, c, d, m_pushpc); c -= a; d -= b; - fifoout_push_f((c*c+d*d)/sqrtf(c*c+d*d)); + fifoout_push_f(sqrtf(c*c+d*d)); next_fn(); } @@ -1233,7 +1245,7 @@ TGP_FUNCTION( model1_state::cpa ) dv_z = (i-k)*(1-dt) + (j-l)*dt; dv2 = dv_x*dv_x + dv_y*dv_y + dv_z*dv_z; - fifoout_push_f(sqrt(dv2)); + fifoout_push_f(sqrtf(dv2)); next_fn(); } @@ -1581,110 +1593,111 @@ TGP_FUNCTION( model1_state::f103 ) next_fn(); } +// Addresses in daytona's TGP program const struct model1_state::function model1_state::ftab_vf[] = { - { &model1_state::fadd, 2 }, /* 0x00 */ - { &model1_state::fsub, 2 }, - { &model1_state::fmul, 2 }, - { &model1_state::fdiv, 2 }, - { nullptr, 0 }, - { &model1_state::matrix_push, 0 }, - { &model1_state::matrix_pop, 0 }, - { &model1_state::matrix_write, 12 }, - { &model1_state::clear_stack, 0 }, - { nullptr, 0 }, - { &model1_state::anglev, 2 }, - { nullptr, 0 }, - { nullptr, 0 }, - { &model1_state::track_select, 1 }, - { &model1_state::f14, 4 }, - { &model1_state::anglep, 4 }, - - { &model1_state::matrix_ident, 0 }, /* 0x10 */ - { &model1_state::matrix_read, 0 }, - { &model1_state::matrix_trans, 3 }, - { &model1_state::matrix_scale, 3 }, - { &model1_state::matrix_rotx, 1 }, - { &model1_state::matrix_roty, 1 }, - { &model1_state::matrix_rotz, 1 }, - { nullptr, 0 }, - { &model1_state::track_read_quad, 1 }, - { nullptr, 0 }, - { &model1_state::transform_point, 3 }, - { &model1_state::fsin_m1, 1 }, - { &model1_state::fcos_m1, 1 }, - { &model1_state::fsinm_m1, 2 }, - { &model1_state::fcosm_m1, 2 }, - { &model1_state::distance3, 6 }, - - { nullptr, 0 }, /* 0x20 */ - { nullptr, 0 }, - { nullptr, 0 }, - { nullptr, 0 }, - { &model1_state::acc_set, 1 }, - { &model1_state::acc_get, 0 }, - { &model1_state::acc_add, 1 }, - { &model1_state::acc_sub, 1 }, - { &model1_state::acc_mul, 1 }, - { &model1_state::acc_div, 1 }, // not used ? - { &model1_state::f42, 3 }, - { &model1_state::f43, 6 }, - { &model1_state::f44, 1 }, - { &model1_state::f45, 1 }, - { &model1_state::vlength, 3 }, - { nullptr, 0 }, - - { &model1_state::track_read_info, 1 }, /* 0x30 */ - { &model1_state::colbox_set, 12 }, - { &model1_state::colbox_test, 3 }, - { nullptr, 0 }, - { nullptr, 0 }, - { nullptr, 0 }, - { &model1_state::track_lookup, 4 }, - { nullptr, 0 }, - { nullptr, 0 }, - { nullptr, 0 }, - { nullptr, 0 }, - { nullptr, 0 }, - { nullptr, 0 }, - { nullptr, 0 }, - { nullptr, 0 }, - { nullptr, 0 }, - - { &model1_state::col_setcirc, 3 }, /* 0x40 */ - { &model1_state::col_testpt, 2 }, - { nullptr, 0 }, - { &model1_state::distance, 4 }, - { nullptr, 0 }, - { nullptr, 0 }, - { nullptr, 0 }, - { &model1_state::car_move, 4 }, - { &model1_state::cpa, 12 }, - { nullptr, 0 }, + { &model1_state::fadd, 2 }, /* 0x00 */ // 0b5 + { &model1_state::fsub, 2 }, // 0ba + { &model1_state::fmul, 2 }, // 0bf + { &model1_state::fdiv, 2 }, // 0c4 + { nullptr, 0 }, // 0d2 + { &model1_state::matrix_push, 0 }, // 0e3 + { &model1_state::matrix_pop, 0 }, // 0f7 + { &model1_state::matrix_write, 12 }, // 106 + { &model1_state::clear_stack, 0 }, // 10a + { &model1_state::matrix_mul, 12 }, // 10e + { &model1_state::anglev, 2 }, // 154 + { nullptr, 0 }, // 15d + { nullptr, 0 }, // 19f + { &model1_state::track_select, 1 }, // 1b8 + { &model1_state::load_base, 4 }, // 1bb + { &model1_state::anglep, 4 }, // 1c1 + + { &model1_state::matrix_ident, 0 }, /* 0x10 */ // 1d2 + { &model1_state::matrix_read, 0 }, // 1d9 + { &model1_state::matrix_trans, 3 }, // 1dd + { &model1_state::matrix_scale, 3 }, // 1f3 + { &model1_state::matrix_rotx, 1 }, // 20a + { &model1_state::matrix_roty, 1 }, // 223 + { &model1_state::matrix_rotz, 1 }, // 23b + { nullptr, 0 }, // 253 + { &model1_state::track_read_quad, 1 }, // 2aa + { nullptr, 0 }, // 2b0 + { &model1_state::transform_point, 3 }, // 2b2 + { &model1_state::fsin_m1, 1 }, // 2cb + { &model1_state::fcos_m1, 1 }, // 2ce + { &model1_state::fsinm_m1, 2 }, // 2d1 + { &model1_state::fcosm_m1, 2 }, // 2d7 + { &model1_state::distance3, 6 }, // 2dd + + { nullptr, 0 }, /* 0x20 */ // 2ff + { nullptr, 0 }, // 2ff + { nullptr, 0 }, // 300 + { nullptr, 0 }, // 304 + { &model1_state::acc_set, 1 }, // 308 + { &model1_state::acc_get, 0 }, // 30a + { &model1_state::acc_add, 1 }, // 30c + { &model1_state::acc_sub, 1 }, // 311 + { &model1_state::acc_mul, 1 }, // 316 + { &model1_state::acc_div, 1 }, // 31b + { &model1_state::f42, 3 }, // 329 + { &model1_state::f43, 6 }, // 36c + { &model1_state::track_read_tri, 1 }, // 3c2 + { &model1_state::fsqrt, 1 }, // 3c7 + { &model1_state::vlength, 3 }, // 3cf + { nullptr, 0 }, // 3ef + + { &model1_state::track_read_info, 1 }, /* 0x30 */ // 410 + { &model1_state::colbox_set, 12 }, // 413 + { &model1_state::colbox_test, 3 }, // 417 + { nullptr, 0 }, // 43b + { nullptr, 0 }, // 44d + { nullptr, 0 }, // 452 + { &model1_state::track_lookup, 4 }, // 457 + { nullptr, 0 }, // 51a + { nullptr, 0 }, // 521 + { nullptr, 0 }, // 52f + { nullptr, 0 }, // 53d + { nullptr, 0 }, // 545 + { nullptr, 0 }, // 558 + { nullptr, 0 }, // 559 + { nullptr, 0 }, // 5c6 + { nullptr, 0 }, // 5e9 + + { &model1_state::col_setcirc, 3 }, /* 0x40 */ // 5f3 + { &model1_state::col_testpt, 2 }, // 5fa + { nullptr, 0 }, // 615 + { &model1_state::distance, 4 }, // 631 + { nullptr, 0 }, // 63f + { nullptr, 0 }, // 643 + { nullptr, 0 }, // 64b + { &model1_state::car_move, 4 }, // 661 + { &model1_state::cpa, 12 }, // 7d9 + { nullptr, 0 }, { &model1_state::vmat_store, 1 }, { &model1_state::vmat_restore, 1 }, - { nullptr, 0 }, + { nullptr, 0 }, { &model1_state::vmat_mul, 2 }, { &model1_state::vmat_read, 1 }, { &model1_state::matrix_unrot, 0 }, - { &model1_state::f80, 0 }, /* 0x50 */ - { nullptr, 0 }, + { &model1_state::f80, 0 }, /* 0x50 */ + { nullptr, 0 }, { &model1_state::matrix_rtrans, 0 }, - { nullptr, 0 }, + { nullptr, 0 }, { &model1_state::vmat_save, 1 }, { &model1_state::vmat_load, 1 }, { &model1_state::ram_setadr, 1 }, { &model1_state::groundbox_test, 3 }, - { nullptr, 0 }, + { nullptr, 0 }, { &model1_state::f89, 4 }, - { nullptr, 0 }, - { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, { &model1_state::f92, 4 }, { &model1_state::f93, 1 }, { &model1_state::f94, 1 }, { &model1_state::vmat_flatten, 0 }, - { &model1_state::vmat_load1, 1 }, /* 0x60 */ + { &model1_state::vmat_load1, 1 }, /* 0x60 */ { &model1_state::ram_trans, 0 }, { &model1_state::f98, 1 }, { &model1_state::f99, 0 }, @@ -1695,27 +1708,25 @@ const struct model1_state::function model1_state::ftab_vf[] = { }; // Used in swa scene 1 and unemulated: -// f14 // f49_swa -// f15_swa const struct model1_state::function model1_state::ftab_swa[] = { { &model1_state::fadd, 2 }, /* 0x00 */ { &model1_state::fsub, 2 }, { &model1_state::fmul, 2 }, { &model1_state::fdiv, 2 }, - { nullptr, 0 }, + { nullptr, 0 }, { &model1_state::matrix_push, 0 }, { &model1_state::matrix_pop, 0 }, { &model1_state::matrix_write, 12 }, { &model1_state::clear_stack, 0 }, { &model1_state::matrix_mul, 12 }, { &model1_state::anglev, 2 }, - { &model1_state::f11, 9 }, + { &model1_state::triangle_normal, 9 }, { &model1_state::normalize, 3 }, { &model1_state::acc_seti, 1 }, - { &model1_state::f14, 4 }, - { &model1_state::f15_swa, 0 }, + { &model1_state::load_base, 4 }, + { &model1_state::transpose, 0 }, { &model1_state::matrix_ident, 0 }, /* 0x10 */ { &model1_state::matrix_read, 0 }, @@ -1724,9 +1735,9 @@ const struct model1_state::function model1_state::ftab_swa[] = { { &model1_state::matrix_rotx, 1 }, { &model1_state::matrix_roty, 1 }, { &model1_state::matrix_rotz, 1 }, - { nullptr, 0 }, + { nullptr, 0 }, { &model1_state::f24_swa, 7 }, - { nullptr, 0 }, + { nullptr, 0 }, { &model1_state::transform_point, 3 }, { &model1_state::fsin_m1, 1 }, { &model1_state::fcos_m1, 1 }, @@ -1734,8 +1745,8 @@ const struct model1_state::function model1_state::ftab_swa[] = { { &model1_state::fcosm_m1, 2 }, { &model1_state::distance3, 6 }, - { nullptr, 0 }, /* 0x20 */ - { nullptr, 0 }, + { nullptr, 0 }, /* 0x20 */ + { nullptr, 0 }, { &model1_state::ftoi, 1 }, { &model1_state::itof, 1 }, { &model1_state::acc_set, 1 }, @@ -1747,30 +1758,30 @@ const struct model1_state::function model1_state::ftab_swa[] = { { &model1_state::xyz2rqf, 3 }, { &model1_state::f43_swa, 3 }, { &model1_state::matrix_sdir, 3 }, - { &model1_state::f45, 1 }, + { &model1_state::fsqrt, 1 }, { &model1_state::vlength, 3 }, { &model1_state::f47, 3 }, - { nullptr, 0 }, /* 0x30 */ + { nullptr, 0 }, /* 0x30 */ { &model1_state::f49_swa, 6 }, { &model1_state::f50_swa, 4 }, - { nullptr, 0 }, + { nullptr, 0 }, { &model1_state::f52, 0 }, { &model1_state::matrix_rdir, 3 }, - { nullptr, 0 }, - { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, { &model1_state::f56, 7 }, { &model1_state::f57, 0 }, { &model1_state::matrix_readt, 0 }, { &model1_state::acc_geti, 0 }, { &model1_state::f60, 0 }, - { nullptr, 0 }, - { nullptr, 0 }, - { nullptr, 0 }, - { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, { &model1_state::push_and_ident, 0 }, /* 0x40 */ - { nullptr, 0 }, + { nullptr, 0 }, { &model1_state::catmull_rom, 13 } }; diff --git a/src/mame/machine/s32comm.cpp b/src/mame/machine/s32comm.cpp index dad9c291527..8d5abf8e299 100644 --- a/src/mame/machine/s32comm.cpp +++ b/src/mame/machine/s32comm.cpp @@ -66,6 +66,8 @@ Sega System Multi32 Comm PCB 837-8792-91 15033.17 OutRunners, Stadium Cross */ +#include "emu.h" +#include "emuopts.h" #include "machine/s32comm.h" //#define __S32COMM_VERBOSE__ diff --git a/src/mame/machine/s32comm.h b/src/mame/machine/s32comm.h index 19b01110361..9c0ef0eae88 100644 --- a/src/mame/machine/s32comm.h +++ b/src/mame/machine/s32comm.h @@ -7,8 +7,6 @@ #define __S32COMM_SIMULATION__ -#include "emu.h" - #define MCFG_S32COMM_ADD(_tag ) \ MCFG_DEVICE_ADD(_tag, S32COMM, 0) diff --git a/src/mame/machine/st0016.cpp b/src/mame/machine/st0016.cpp index 598a94ebddc..c663acae492 100644 --- a/src/mame/machine/st0016.cpp +++ b/src/mame/machine/st0016.cpp @@ -31,6 +31,7 @@ ADDRESS_MAP_END st0016_cpu_device::st0016_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : z80_device(mconfig, ST0016_CPU, "ST0016", tag, owner, clock, "st0016_cpu", __FILE__), + device_gfx_interface(mconfig, *this, nullptr, "palette"), st0016_game(-1), st0016_spr_bank(0), st0016_spr2_bank(0), @@ -43,11 +44,7 @@ st0016_cpu_device::st0016_cpu_device(const machine_config &mconfig, const char * m_io_space_config("io", ENDIANNESS_LITTLE, 8, 16, 0, ADDRESS_MAP_NAME(st0016_cpu_internal_io_map)), m_space_config("regs", ENDIANNESS_LITTLE, 8, 16, 0, ADDRESS_MAP_NAME(st0016_cpu_internal_map)), - - m_screen(*this, ":screen"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") - + m_screen(*this, ":screen") { for (auto & elem : st0016_vregs) elem = 0; @@ -109,14 +106,10 @@ READ8_MEMBER(st0016_cpu_device::soundram_read) return m_charram[offset]; } -static GFXDECODE_START( st0016 ) -GFXDECODE_END - /* CPU interface */ static MACHINE_CONFIG_FRAGMENT( st0016_cpu ) MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - MCFG_GFXDECODE_ADD("gfxdecode", "palette", st0016) MCFG_PALETTE_ADD("palette", 16*16*4+1) MCFG_DEVICE_ADD("stsnd", ST0016, 0) @@ -218,8 +211,8 @@ WRITE8_MEMBER(st0016_cpu_device::st0016_palette_ram_w) st0016_paletteram[ST0016_PAL_BANK_SIZE*st0016_pal_bank+offset]=data; val=st0016_paletteram[color*2]+(st0016_paletteram[color*2+1]<<8); if(!color) - m_palette->set_pen_color(UNUSED_PEN,pal5bit(val >> 0),pal5bit(val >> 5),pal5bit(val >> 10)); /* same as color 0 - bg ? */ - m_palette->set_pen_color(color,pal5bit(val >> 0),pal5bit(val >> 5),pal5bit(val >> 10)); + palette().set_pen_color(UNUSED_PEN,pal5bit(val >> 0),pal5bit(val >> 5),pal5bit(val >> 10)); /* same as color 0 - bg ? */ + palette().set_pen_color(color,pal5bit(val >> 0),pal5bit(val >> 5),pal5bit(val >> 10)); } READ8_MEMBER(st0016_cpu_device::st0016_character_ram_r) @@ -230,7 +223,7 @@ READ8_MEMBER(st0016_cpu_device::st0016_character_ram_r) WRITE8_MEMBER(st0016_cpu_device::st0016_character_ram_w) { m_charram[ST0016_CHAR_BANK_SIZE*st0016_char_bank+offset]=data; - m_gfxdecode->gfx(st0016_ramgfx)->mark_dirty(st0016_char_bank); + gfx(st0016_ramgfx)->mark_dirty(st0016_char_bank); } READ8_MEMBER(st0016_cpu_device::st0016_vregs_r) @@ -383,7 +376,7 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip */ - gfx_element *gfx = m_gfxdecode->gfx(st0016_ramgfx); + gfx_element *gfx = this->gfx(st0016_ramgfx); int i, j, lx, ly, x, y, code, offset, length, sx, sy, color, flipx, flipy, scrollx, scrolly/*,plx,ply*/; @@ -587,13 +580,13 @@ void st0016_cpu_device::startup() /* find first empty slot to decode gfx */ for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++) - if (m_gfxdecode->gfx(gfx_index) == nullptr) + if (gfx(gfx_index) == nullptr) break; assert(gfx_index != MAX_GFX_ELEMENTS); /* create the char set (gfx will then be updated dynamically from RAM) */ - m_gfxdecode->set_gfx(gfx_index, std::make_unique<gfx_element>(m_palette, charlayout, m_charram.get(), 0, 0x40, 0)); + set_gfx(gfx_index, std::make_unique<gfx_element>(palette(), charlayout, m_charram.get(), 0, 0x40, 0)); st0016_ramgfx = gfx_index; spr_dx=0; @@ -607,7 +600,7 @@ void st0016_cpu_device::startup() void st0016_cpu_device::draw_bgmap(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority) { - gfx_element *gfx = m_gfxdecode->gfx(st0016_ramgfx); + gfx_element *gfx = this->gfx(st0016_ramgfx); int j; //for(j=0x40-8;j>=0;j-=8) for (j = 0; j < 0x40; j += 8) diff --git a/src/mame/machine/st0016.h b/src/mame/machine/st0016.h index 6401ddc5c19..447ce7e4d3c 100644 --- a/src/mame/machine/st0016.h +++ b/src/mame/machine/st0016.h @@ -34,7 +34,7 @@ extern UINT8 macs_cart_slot; -class st0016_cpu_device : public z80_device +class st0016_cpu_device : public z80_device, public device_gfx_interface { public: st0016_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); @@ -97,13 +97,6 @@ protected: } }; required_device<screen_device> m_screen; - required_device<gfxdecode_device> m_gfxdecode; - -public: // speglsht needs to access this for mixing - required_device<palette_device> m_palette; - -private: - }; diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 35895a15fa7..2f93999951f 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -1209,6 +1209,7 @@ laser128 // ??? 1987 Laser 128 mprof3 // Microprofessor III prav8c // Pravetz 8C tk3000 // Microdigital TK3000 +spectred @source:apple2gs.cpp apple2gs // Aug 1989 Apple IIgs ROM03 @@ -2265,6 +2266,7 @@ bbcbc // 1985 BBC Bridge Companion bbusters // A9003 'BB' (c) 1989 bbustersu // A9003 'BB' (c) 1989 bbustersua // A9003 'BB' (c) 1989 +bbustersj // mechatt // A8002 'MA' (c) 1989 mechattj // A8002 'MA' (c) 1989 mechattu // A8002 'MA' (c) 1989 @@ -12290,6 +12292,7 @@ monsterz // (c) 1982 Nihon (Arcade TV Game List - P.102, moonal2 // [1980] Nichibutsu moonal2b // [1980] Nichibutsu moonaln // [Nichibutsu] (Karateco license) or hack +kamikazp // bootleg (Potomac Games) mooncmw // bootleg mooncptc // bootleg (Petaco S.A.) mooncreg // bootleg @@ -13688,6 +13691,7 @@ maniac // Ideal @source:hh_sm510.cpp gnwmndon // Nintendo kcontra // Konami +kgradius // Konami ktmnt // Konami ktopgun // Konami @@ -13790,6 +13794,7 @@ sgnascar // 2000.09 Nascar Arcade @source:himesiki.cpp himesiki // (c) 1989 Hi-Soft androidp // (c) 198? Nasco +androidpo // (c) 198? Nasco @source:hitme.cpp barricad // (c) 1976 Ramtek @@ -16858,6 +16863,7 @@ leaguemn // (c) 1993 Irem (Japan) lethalth // (c) 1991 Irem (World) majtitl2 // (c) 1992 Irem (World) majtitl2a // +majtitl2b // majtitl2j // (c) 1992 Irem (Japan) mysticri // (c) 1992 Irem (World) mysticrib // bootleg? @@ -16951,6 +16957,7 @@ mcolors // 1999 unknown musicsrt // (c) 1995 ABM Games sgsafari // (c) 1996 New Impeuropex Corp. suprpool // (c) 1997 ABM Games +lunaprk // (c) 1998 ABM Games @source:magicard.cpp hotslots // (c) 2002 Impera @@ -28303,6 +28310,7 @@ rdaction // UPL-87003?(c) 1987 + World Games license robokid // UPL-88013 (c) 1988 robokidj // UPL-88013 (c) 1988 robokidj2 // UPL-88013 (c) 1988 +robokidj3 // @source:ninjaw.cpp darius2 // C07 (c) 1989 Taito Corporation (Japan) @@ -28872,6 +28880,7 @@ sicpc1605 // ssam88s // sx16 // Sanyo SX-16 zdsupers // +ncrpc4i // NCR PC4i @source:pc100.cpp pc100 // diff --git a/src/mame/osd/windows/mame/mame.ico b/src/mame/osd/windows/mame/mame.ico Binary files differdeleted file mode 100644 index 62761447fc2..00000000000 --- a/src/mame/osd/windows/mame/mame.ico +++ /dev/null diff --git a/src/mame/osd/windows/mame/mame.man b/src/mame/osd/windows/mame/mame.man deleted file mode 100644 index e08eba181cb..00000000000 --- a/src/mame/osd/windows/mame/mame.man +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> - <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"> - <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="MAME" type="win32" /> - <description>Multiple Arcade Machine Emulator</description> - <dependency> - <dependentAssembly> - <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*"/> - </dependentAssembly> - </dependency> - <asmv3:application> - <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"> - <dpiAware>true</dpiAware> - </asmv3:windowsSettings> - </asmv3:application> -</assembly> diff --git a/src/mame/osd/windows/mame/mame.rc b/src/mame/osd/windows/mame/mame.rc deleted file mode 100644 index 8156b424c64..00000000000 --- a/src/mame/osd/windows/mame/mame.rc +++ /dev/null @@ -1,14 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -//============================================================ -// -// mame.rc - Minimal resource file for Win32 MAME -// -//============================================================ - -#include <windows.h> -#include "mamevers.rc" - -1 24 MOVEABLE PURE "mame.man" - -2 ICON DISCARDABLE "mame.ico" diff --git a/src/mame/osd/windows/mess/mess.ico b/src/mame/osd/windows/mess/mess.ico Binary files differdeleted file mode 100644 index bab67dd6195..00000000000 --- a/src/mame/osd/windows/mess/mess.ico +++ /dev/null diff --git a/src/mame/osd/windows/mess/mess.man b/src/mame/osd/windows/mess/mess.man deleted file mode 100644 index 67ba3aced37..00000000000 --- a/src/mame/osd/windows/mess/mess.man +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> - <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"> - <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="MESS" type="win32" /> - <description>Multi Emulator Super System</description> - <dependency> - <dependentAssembly> - <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*"/> - </dependentAssembly> - </dependency> - <asmv3:application> - <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"> - <dpiAware>true</dpiAware> - </asmv3:windowsSettings> - </asmv3:application> -</assembly> diff --git a/src/mame/osd/windows/mess/mess.rc b/src/mame/osd/windows/mess/mess.rc deleted file mode 100644 index 1329bcd6fb8..00000000000 --- a/src/mame/osd/windows/mess/mess.rc +++ /dev/null @@ -1,14 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -//============================================================ -// -// mess.rc - Minimal resource file for Win32 MAME -// -//============================================================ - -#include <windows.h> -#include "messvers.rc" - -1 24 MOVEABLE PURE "mess.man" - -2 ICON DISCARDABLE "mess.ico" diff --git a/src/mame/video/733_asr.cpp b/src/mame/video/733_asr.cpp index e9c446301a2..0194a1316fc 100644 --- a/src/mame/video/733_asr.cpp +++ b/src/mame/video/733_asr.cpp @@ -82,24 +82,13 @@ const device_type ASR733 = &device_creator<asr733_device>; asr733_device::asr733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, ASR733, "733 ASR", tag, owner, clock, "asr733", __FILE__), - m_palette(*this, "palette"), - m_gfxdecode(*this, "gfxdecode"), + device_gfx_interface(mconfig, *this, GFXDECODE_NAME(asr733), "palette"), m_keyint_line(*this), m_lineint_line(*this) { } //------------------------------------------------- -// device_config_complete - perform any -// operations now that the configuration is -// complete -//------------------------------------------------- - -void asr733_device::device_config_complete() -{ -} - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -211,7 +200,7 @@ void asr733_device::set_interrupt_line() /* write a single char on screen */ void asr733_device::draw_char(int character, int x, int y, int color) { - m_gfxdecode->gfx(0)->opaque(*m_bitmap, m_bitmap->cliprect(), character-32, color, 0, 0, x+1, y); + gfx(0)->opaque(*m_bitmap, m_bitmap->cliprect(), character-32, color, 0, 0, x+1, y); } void asr733_device::linefeed() @@ -221,7 +210,7 @@ void asr733_device::linefeed() for (int y=asr_window_offset_y; y<asr_window_offset_y+asr_window_height-asr_scroll_step; y++) { extract_scanline8(*m_bitmap, asr_window_offset_x, y+asr_scroll_step, asr_window_width, buf); - draw_scanline8(*m_bitmap, asr_window_offset_x, y, asr_window_width, buf, m_palette->pens()); + draw_scanline8(*m_bitmap, asr_window_offset_x, y, asr_window_width, buf, palette().pens()); } const rectangle asr_scroll_clear_window( @@ -721,8 +710,6 @@ UINT32 asr733_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, } static MACHINE_CONFIG_FRAGMENT( asr733 ) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", asr733) - MCFG_PALETTE_ADD("palette", 2) MCFG_PALETTE_INIT_OWNER(asr733_device, asr733) diff --git a/src/mame/video/733_asr.h b/src/mame/video/733_asr.h index 9c45c69c6ed..d5b48eebc9e 100644 --- a/src/mame/video/733_asr.h +++ b/src/mame/video/733_asr.h @@ -10,7 +10,7 @@ enum asr733_chr_region_len = 128*asr733_single_char_len }; -class asr733_device : public device_t +class asr733_device : public device_t, public device_gfx_interface { public: asr733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -33,7 +33,6 @@ public: protected: // device-level overrides - void device_config_complete() override; void device_start() override; void device_reset() override; machine_config_constructor device_mconfig_additions() const override; @@ -73,8 +72,6 @@ private: std::unique_ptr<bitmap_ind16> m_bitmap; - required_device<palette_device> m_palette; - required_device<gfxdecode_device> m_gfxdecode; devcb_write_line m_keyint_line; devcb_write_line m_lineint_line; }; diff --git a/src/mame/video/911_vdt.cpp b/src/mame/video/911_vdt.cpp index ff7b2b6a03c..6b00207b919 100644 --- a/src/mame/video/911_vdt.cpp +++ b/src/mame/video/911_vdt.cpp @@ -145,24 +145,13 @@ const device_type VDT911 = &device_creator<vdt911_device>; vdt911_device::vdt911_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, VDT911, "911 VDT", tag, owner, clock, "vdt911", __FILE__), + device_gfx_interface(mconfig, *this, GFXDECODE_NAME(vdt911), "palette"), m_beeper(*this, "beeper"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), m_keyint_line(*this), m_lineint_line(*this) { } -//------------------------------------------------- -// device_config_complete - perform any -// operations now that the configuration is -// complete -//------------------------------------------------- - -void vdt911_device::device_config_complete() -{ -} - enum { BLINK_TIMER, @@ -467,7 +456,7 @@ WRITE8_MEMBER( vdt911_device::cru_w ) */ void vdt911_device::refresh(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y) { - gfx_element *gfx = m_gfxdecode->gfx(m_model); + gfx_element *gfx = this->gfx(m_model); int height = (m_screen_size == char_960) ? 12 : /*25*/24; int use_8bit_charcodes = USES_8BIT_CHARCODES(); @@ -822,8 +811,6 @@ static MACHINE_CONFIG_FRAGMENT( vdt911 ) MCFG_PALETTE_ADD("palette", 8) MCFG_PALETTE_INDIRECT_ENTRIES(3) MCFG_PALETTE_INIT_OWNER(vdt911_device, vdt911) - - MCFG_GFXDECODE_ADD("gfxdecode", "palette", vdt911) MACHINE_CONFIG_END //------------------------------------------------- diff --git a/src/mame/video/911_vdt.h b/src/mame/video/911_vdt.h index e0ced6bbede..7d90d549d50 100644 --- a/src/mame/video/911_vdt.h +++ b/src/mame/video/911_vdt.h @@ -34,7 +34,7 @@ enum vdt911_model_t vdt911_model_FrenchWP // French word processing }; -class vdt911_device : public device_t +class vdt911_device : public device_t, public device_gfx_interface { public: vdt911_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -58,7 +58,6 @@ public: protected: // device-level overrides - void device_config_complete() override; void device_start() override; void device_reset() override; @@ -103,8 +102,6 @@ private: char m_foreign_mode; required_device<beep_device> m_beeper; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; devcb_write_line m_keyint_line; devcb_write_line m_lineint_line; }; diff --git a/src/mame/video/bbusters.cpp b/src/mame/video/bbusters.cpp index 1a090935c17..0e7362fd085 100644 --- a/src/mame/video/bbusters.cpp +++ b/src/mame/video/bbusters.cpp @@ -200,18 +200,20 @@ void bbusters_state::draw_sprites(bitmap_ind16 &bitmap, const UINT16 *source, in int offs; for (offs = 0;offs <0x800 ;offs += 4) { - int x,y,sprite,colour,fx,fy,scale; + int x,sprite,colour,fx,fy,scale; + INT16 y; int block; sprite=source[offs+1]; colour=source[offs+0]; - if (colour==0xf7 && (sprite==0x3fff || sprite==0xffff)) - continue; + if ((colour==0xf7 || colour==0xffff || colour == 0x43f9) && (sprite==0x3fff || sprite==0xffff || sprite==0x0001)) + continue; // sprite 1, color 0x43f9 is the dead sprite in the top-right of the screen in Mechanized Attack's High Score table. y=source[offs+3]; x=source[offs+2]; if (x&0x200) x=-(0x100-(x&0xff)); + if (y > 320 || y < -256) y &= 0x1ff; // fix for bbusters ending & "Zing!" attract-mode fullscreen zombie & Helicopter on the 3rd rotation of the attractmode sequence /* Source[0]: diff --git a/src/mame/video/bfm_adr2.cpp b/src/mame/video/bfm_adr2.cpp index bca9061ffc2..1bc4615fd69 100644 --- a/src/mame/video/bfm_adr2.cpp +++ b/src/mame/video/bfm_adr2.cpp @@ -115,13 +115,32 @@ E000-FFFF | R | D D D D D D D D | 8K ROM +static const gfx_layout charlayout = +{ + 8,8, // 8 * 8 characters + 8192, // 8192 characters + 4, // 4 bits per pixel + { 0,1,2,3 }, + { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, + { 0*8*4, 1*8*4, 2*8*4, 3*8*4, 4*8*4, 5*8*4, 6*8*4, 7*8*4 }, + 8*8*4 +}; + +// this is a strange beast !!!! +// +// characters are grouped by 64 (512 pixels) +// there are max 128 of these groups + +static GFXDECODE_START( adder2 ) + GFXDECODE_ENTRY( ":gfx1", 0, charlayout, 0, 16 ) +GFXDECODE_END + const device_type BFM_ADDER2 = &device_creator<bfm_adder2_device>; bfm_adder2_device::bfm_adder2_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) : device_t(mconfig, BFM_ADDER2, "BFM ADDER2", tag, owner, clock, "bfm_adder2", __FILE__), - m_cpu(*this, "adder2"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") + device_gfx_interface(mconfig, *this, GFXDECODE_NAME(adder2), "palette"), + m_cpu(*this, "adder2") { } @@ -194,7 +213,7 @@ void bfm_adder2_device::device_reset() void bfm_adder2_device::device_start() { - if (!m_palette->started()) + if (!palette().started()) throw device_missing_dependencies(); adder2_decode_char_roms(); @@ -211,26 +230,26 @@ void bfm_adder2_device::device_start() save_item(NAME(m_adder_ram)); save_item(NAME(m_adder_screen_ram)); - m_tilemap0 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(bfm_adder2_device::get_tile0_info),this), TILEMAP_SCAN_ROWS, 8, 8, 50, 35); - - m_tilemap1 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(bfm_adder2_device::get_tile1_info),this), TILEMAP_SCAN_ROWS, 8, 8, 50, 35); - - m_palette->set_pen_color(0,rgb_t(0x00,0x00,0x00)); - m_palette->set_pen_color(1,rgb_t(0x00,0x00,0xFF)); - m_palette->set_pen_color(2,rgb_t(0x00,0xFF,0x00)); - m_palette->set_pen_color(3,rgb_t(0x00,0xFF,0xFF)); - m_palette->set_pen_color(4,rgb_t(0xFF,0x00,0x00)); - m_palette->set_pen_color(5,rgb_t(0xFF,0x00,0xFF)); - m_palette->set_pen_color(6,rgb_t(0xFF,0xFF,0x00)); - m_palette->set_pen_color(7,rgb_t(0xFF,0xFF,0xFF)); - m_palette->set_pen_color(8,rgb_t(0x80,0x80,0x80)); - m_palette->set_pen_color(9,rgb_t(0x00,0x00,0x80)); - m_palette->set_pen_color(10,rgb_t(0x00,0x80,0x00)); - m_palette->set_pen_color(11,rgb_t(0x00,0x80,0x80)); - m_palette->set_pen_color(12,rgb_t(0x80,0x00,0x00)); - m_palette->set_pen_color(13,rgb_t(0x80,0x00,0x80)); - m_palette->set_pen_color(14,rgb_t(0x80,0x80,0x00)); - m_palette->set_pen_color(15,rgb_t(0x80,0x80,0x80)); + m_tilemap0 = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(bfm_adder2_device::get_tile0_info),this), TILEMAP_SCAN_ROWS, 8, 8, 50, 35); + + m_tilemap1 = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(bfm_adder2_device::get_tile1_info),this), TILEMAP_SCAN_ROWS, 8, 8, 50, 35); + + palette().set_pen_color(0,rgb_t(0x00,0x00,0x00)); + palette().set_pen_color(1,rgb_t(0x00,0x00,0xFF)); + palette().set_pen_color(2,rgb_t(0x00,0xFF,0x00)); + palette().set_pen_color(3,rgb_t(0x00,0xFF,0xFF)); + palette().set_pen_color(4,rgb_t(0xFF,0x00,0x00)); + palette().set_pen_color(5,rgb_t(0xFF,0x00,0xFF)); + palette().set_pen_color(6,rgb_t(0xFF,0xFF,0x00)); + palette().set_pen_color(7,rgb_t(0xFF,0xFF,0xFF)); + palette().set_pen_color(8,rgb_t(0x80,0x80,0x80)); + palette().set_pen_color(9,rgb_t(0x00,0x00,0x80)); + palette().set_pen_color(10,rgb_t(0x00,0x80,0x00)); + palette().set_pen_color(11,rgb_t(0x00,0x80,0x80)); + palette().set_pen_color(12,rgb_t(0x80,0x00,0x00)); + palette().set_pen_color(13,rgb_t(0x80,0x00,0x80)); + palette().set_pen_color(14,rgb_t(0x80,0x80,0x00)); + palette().set_pen_color(15,rgb_t(0x80,0x80,0x80)); } // video update /////////////////////////////////////////////////////////// @@ -278,7 +297,7 @@ WRITE8_MEMBER( bfm_adder2_device::screen_ram_w ) r = ((data & 0x18)>>3) * 85; // 00011000b = 0x18 g = ((data & 0x06)>>1) * 85; // 00000110b = 0x06 b = ((data & 0x01) ) * 255; - m_palette->set_pen_color(pal, rgb_t(r,g,b)); + palette().set_pen_color(pal, rgb_t(r,g,b)); } if ( m_adder2_screen_page_reg & SL_ACCESS ) @@ -519,26 +538,6 @@ static ADDRESS_MAP_START( adder2_memmap, AS_PROGRAM, 8, bfm_adder2_device ) AM_RANGE(0xE000, 0xFFFF) AM_ROM AM_REGION(":adder2", 0xE000) // 8k ROM ADDRESS_MAP_END -static const gfx_layout charlayout = -{ - 8,8, // 8 * 8 characters - 8192, // 8192 characters - 4, // 4 bits per pixel - { 0,1,2,3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*8*4, 1*8*4, 2*8*4, 3*8*4, 4*8*4, 5*8*4, 6*8*4, 7*8*4 }, - 8*8*4 -}; - -// this is a strange beast !!!! -// -// characters are grouped by 64 (512 pixels) -// there are max 128 of these groups - -static GFXDECODE_START( adder2 ) - GFXDECODE_ENTRY( ":gfx1", 0, charlayout, 0, 16 ) -GFXDECODE_END - /////////////////////////////////////////////////////////////////////////// static MACHINE_CONFIG_FRAGMENT( adder2 ) @@ -550,7 +549,6 @@ static MACHINE_CONFIG_FRAGMENT( adder2 ) MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, bfm_adder2_device, update_screen) MCFG_PALETTE_ADD("palette", 16) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", adder2) MCFG_CPU_ADD("adder2", M6809, ADDER_CLOCK/4 ) // adder2 board 6809 CPU at 2 Mhz MCFG_CPU_PROGRAM_MAP(adder2_memmap) // setup adder2 board memorymap diff --git a/src/mame/video/bfm_adr2.h b/src/mame/video/bfm_adr2.h index 301ee7acf0d..8f278dfb65c 100644 --- a/src/mame/video/bfm_adr2.h +++ b/src/mame/video/bfm_adr2.h @@ -3,7 +3,7 @@ #ifndef INC_BFMADDER2 #define INC_BFMADDER2 -class bfm_adder2_device : public device_t +class bfm_adder2_device : public device_t, public device_gfx_interface { public: // construction/destruction @@ -61,8 +61,6 @@ private: UINT8 m_adder2_sc2data; optional_device<cpu_device> m_cpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; }; // device type definition @@ -76,7 +74,4 @@ extern const device_type BFM_ADDER2; #define MCFG_BFM_ADDER2_ADD(_tag) \ MCFG_DEVICE_ADD(_tag, BFM_ADDER2, 0) -#define MCFG_BFM_ADDER2_PALETTE(_palette_tag) \ - bfm_adder2_device::static_set_palette_tag(*device, "^" _palette_tag); - #endif diff --git a/src/mame/video/decbac06.h b/src/mame/video/decbac06.h index 51a991636fa..0f9c24ccdd3 100644 --- a/src/mame/video/decbac06.h +++ b/src/mame/video/decbac06.h @@ -152,3 +152,6 @@ extern const device_type DECO_BAC06; #define MCFG_DECO_BAC06_GFXDECODE(_gfxtag) \ deco_bac06_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); + +#define MCFG_DECO_BAC06_GFX_REGION_WIDE(_8x8, _16x16, _wide) \ + deco_bac06_device::set_gfx_region_wide(*device, _8x8, _16x16, _wide); diff --git a/src/mame/video/deckarn.cpp b/src/mame/video/deckarn.cpp index 795bf5894d6..bde0dba82ab 100644 --- a/src/mame/video/deckarn.cpp +++ b/src/mame/video/deckarn.cpp @@ -17,8 +17,7 @@ const device_type DECO_KARNOVSPRITES = &device_creator<deco_karnovsprites_device deco_karnovsprites_device::deco_karnovsprites_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, DECO_KARNOVSPRITES, "DECO Karnov Sprites", tag, owner, clock, "deco_karnovsprites", __FILE__), m_gfxregion(0), - m_gfxdecode(*this), - m_palette(*this) + m_gfxdecode(*this) { } @@ -112,13 +111,3 @@ void deco_karnovsprites_device::draw_sprites( bitmap_ind16 &bitmap, const rectan colour,fx,fy,x,y+16,0); } } - -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void deco_karnovsprites_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<deco_karnovsprites_device &>(device).m_palette.set_tag(tag); -} diff --git a/src/mame/video/deckarn.h b/src/mame/video/deckarn.h index 560e0f87ba0..7da58cdc789 100644 --- a/src/mame/video/deckarn.h +++ b/src/mame/video/deckarn.h @@ -11,7 +11,6 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); static void set_gfx_region(device_t &device, int region); protected: @@ -21,7 +20,6 @@ protected: UINT8 m_gfxregion; private: required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; }; extern const device_type DECO_KARNOVSPRITES; @@ -29,5 +27,5 @@ extern const device_type DECO_KARNOVSPRITES; #define MCFG_DECO_KARNOVSPRITES_GFXDECODE(_gfxtag) \ deco_karnovsprites_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); -#define MCFG_DECO_KARNOVSPRITES_PALETTE(_palette_tag) \ - deco_karnovsprites_device::static_set_palette_tag(*device, "^" _palette_tag); +#define MCFG_DECO_KARNOVSPRITES_GFX_REGION(_region) \ + deco_karnovsprites_device::set_gfx_region(*device, _region); diff --git a/src/mame/video/decmxc06.cpp b/src/mame/video/decmxc06.cpp index 888d5ae6ada..87bb3aa922e 100644 --- a/src/mame/video/decmxc06.cpp +++ b/src/mame/video/decmxc06.cpp @@ -54,8 +54,7 @@ deco_mxc06_device::deco_mxc06_device(const machine_config &mconfig, const char * device_video_interface(mconfig, *this), m_gfxregion(0), m_ramsize(0x800), - m_gfxdecode(*this), - m_palette(*this) + m_gfxdecode(*this) { } @@ -223,13 +222,3 @@ void deco_mxc06_device::device_start() void deco_mxc06_device::device_reset() { } - -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void deco_mxc06_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<deco_mxc06_device &>(device).m_palette.set_tag(tag); -} diff --git a/src/mame/video/decmxc06.h b/src/mame/video/decmxc06.h index a4b58a73195..b00a7d851b5 100644 --- a/src/mame/video/decmxc06.h +++ b/src/mame/video/decmxc06.h @@ -11,7 +11,6 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); static void set_gfx_region(device_t &device, int region); static void set_ram_size(device_t &device, int size) { @@ -35,7 +34,6 @@ protected: private: required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; }; extern const device_type DECO_MXC06; @@ -43,8 +41,8 @@ extern const device_type DECO_MXC06; #define MCFG_DECO_MXC06_GFXDECODE(_gfxtag) \ deco_mxc06_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); -#define MCFG_DECO_MXC06_PALETTE(_palette_tag) \ - deco_mxc06_device::static_set_palette_tag(*device, "^" _palette_tag); +#define MCFG_DECO_MXC06_GFX_REGION(_region) \ + deco_mxc06_device::set_gfx_region(*device, _region); #define MCFG_DECO_MXC06_RAMSIZE(_size) \ deco_mxc06_device::set_ram_size(*device, _size); diff --git a/src/mame/video/deco16ic.cpp b/src/mame/video/deco16ic.cpp index fa5b1caba0a..df16e96bfc0 100644 --- a/src/mame/video/deco16ic.cpp +++ b/src/mame/video/deco16ic.cpp @@ -202,8 +202,7 @@ deco16ic_device::deco16ic_device(const machine_config &mconfig, const char *tag, m_pf2_colourmask(0xf), m_pf12_8x8_gfx_bank(0), m_pf12_16x16_gfx_bank(0), - m_gfxdecode(*this), - m_palette(*this) + m_gfxdecode(*this) { } @@ -511,7 +510,7 @@ void deco16ic_device::custom_tilemap_draw( if ((flags & TILEMAP_DRAW_OPAQUE) || (p & trans_mask)) { - bitmap.pix(y, x) = m_palette->pen(p); + bitmap.pix(y, x) = m_gfxdecode->palette().pen(p); if (screen.priority().valid()) { UINT8 *pri = &screen.priority().pix8(y); @@ -943,13 +942,3 @@ void deco16ic_device::tilemap_12_combine_draw(screen_device &screen, bitmap_rgb3 { custom_tilemap_draw(screen, bitmap, cliprect, nullptr, m_pf1_tilemap_16x16, nullptr, m_pf2_tilemap_16x16, m_pf1_rowscroll_ptr, m_pf12_control[1], m_pf12_control[2], m_pf12_control[5] & 0xff, m_pf12_control[6] & 0xff, 0xf, 4, 0xff, flags, priority, is_tattoo); } - -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void deco16ic_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<deco16ic_device &>(device).m_palette.set_tag(tag); -} diff --git a/src/mame/video/deco16ic.h b/src/mame/video/deco16ic.h index 5e45336c093..a15be609dbc 100644 --- a/src/mame/video/deco16ic.h +++ b/src/mame/video/deco16ic.h @@ -154,7 +154,6 @@ private: TILE_GET_INFO_MEMBER(get_pf2_tile_info_b); TILE_GET_INFO_MEMBER(get_pf1_tile_info_b); required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; }; extern const device_type DECO16IC; @@ -206,9 +205,6 @@ extern const device_type DECO16IC; #define MCFG_DECO16IC_GFXDECODE(_gfxtag) \ deco16ic_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); -#define MCFG_DECO16IC_PALETTE(_palette_tag) \ - deco16ic_device::static_set_palette_tag(*device, "^" _palette_tag); - // function definition for a callback #define DECO16IC_BANK_CB_MEMBER(_name) int _name(int bank) diff --git a/src/mame/video/deco_zoomspr.cpp b/src/mame/video/deco_zoomspr.cpp index e1b5cfdb949..aafefabc2a7 100644 --- a/src/mame/video/deco_zoomspr.cpp +++ b/src/mame/video/deco_zoomspr.cpp @@ -17,22 +17,11 @@ const device_type DECO_ZOOMSPR = &device_creator<deco_zoomspr_device>; deco_zoomspr_device::deco_zoomspr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, DECO_ZOOMSPR, "DECO Zooming Sprites", tag, owner, clock, "deco_zoomspr", __FILE__), - m_palette(*this), m_gfxdecode(*this) { } //------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void deco_zoomspr_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<deco_zoomspr_device &>(device).m_palette.set_tag(tag); -} - -//------------------------------------------------- // static_set_gfxdecode_tag: Set the tag of the // gfx decoder //------------------------------------------------- @@ -80,7 +69,7 @@ inline void deco_zoomspr_device::dragngun_drawgfxzoom( { if( gfx ) { - const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); + const pen_t *pal = &m_gfxdecode->palette().pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); const UINT8 *code_base = gfx->get_data(code % gfx->elements()); if (sprite_screen_width && sprite_screen_height) diff --git a/src/mame/video/deco_zoomspr.h b/src/mame/video/deco_zoomspr.h index 4283f3aa62e..aed9b6b519a 100644 --- a/src/mame/video/deco_zoomspr.h +++ b/src/mame/video/deco_zoomspr.h @@ -7,7 +7,6 @@ class deco_zoomspr_device : public device_t public: deco_zoomspr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - static void static_set_palette_tag(device_t &device, const char *tag); static void static_set_gfxdecode_tag(device_t &device, const char *tag); void dragngun_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, const UINT32 *spritedata, UINT32* dragngun_sprite_layout_0_ram, UINT32* dragngun_sprite_layout_1_ram, UINT32* dragngun_sprite_lookup_0_ram, UINT32* dragngun_sprite_lookup_1_ram, UINT32 dragngun_sprite_ctrl, bitmap_ind8 &pri_bitmap, bitmap_rgb32 &temp_bitmap); @@ -18,7 +17,6 @@ protected: virtual void device_reset() override; private: - required_device<palette_device> m_palette; required_device<gfxdecode_device> m_gfxdecode; void dragngun_drawgfxzoom( @@ -33,8 +31,5 @@ private: extern const device_type DECO_ZOOMSPR; -#define MCFG_DECO_ZOOMSPR_PALETTE(_palette_tag) \ - deco_zoomspr_device::static_set_palette_tag(*device, "^" _palette_tag); - #define MCFG_DECO_ZOOMSPR_GFXDECODE(_gfxtag) \ deco_zoomspr_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); diff --git a/src/mame/video/decospr.cpp b/src/mame/video/decospr.cpp index 304fba4a87b..1ad69cff68a 100644 --- a/src/mame/video/decospr.cpp +++ b/src/mame/video/decospr.cpp @@ -157,8 +157,7 @@ decospr_device::decospr_device(const machine_config &mconfig, const char *tag, d m_y_offset(0), m_flipallx(0), m_transpen(0), - m_gfxdecode(*this), - m_palette(*this) + m_gfxdecode(*this) { // default color callback m_col_cb = decospr_col_cb_delegate(FUNC(decospr_device::default_col_cb), this); @@ -579,7 +578,7 @@ void decospr_device::inefficient_copy_sprite_bitmap(bitmap_rgb32 &bitmap, const fatalerror("decospr_device::inefficient_copy_sprite_bitmap with no m_sprite_bitmap\n"); int y, x; - const pen_t *paldata = m_palette->pens(); + const pen_t *paldata = m_gfxdecode->palette().pens(); UINT16* srcline; UINT32* dstline; @@ -623,13 +622,3 @@ void decospr_device::inefficient_copy_sprite_bitmap(bitmap_rgb32 &bitmap, const } } } - -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void decospr_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<decospr_device &>(device).m_palette.set_tag(tag); -} diff --git a/src/mame/video/decospr.h b/src/mame/video/decospr.h index 9679a22acc5..c9b2ee68a77 100644 --- a/src/mame/video/decospr.h +++ b/src/mame/video/decospr.h @@ -18,7 +18,6 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); static void set_gfx_region(device_t &device, int gfxregion); static void set_pri_callback(device_t &device, decospr_pri_cb_delegate callback) { downcast<decospr_device &>(device).m_pri_cb = callback; } static void set_col_callback(device_t &device, decospr_col_cb_delegate callback) { downcast<decospr_device &>(device).m_col_cb = callback; } @@ -67,7 +66,6 @@ private: template<class _BitmapClass> void draw_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, UINT16* spriteram, int sizewords, bool invert_flip); required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; }; extern const device_type DECO_SPRITE; @@ -98,6 +96,3 @@ extern const device_type DECO_SPRITE; #define MCFG_DECO_SPRITE_GFXDECODE(_gfxtag) \ decospr_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); - -#define MCFG_DECO_SPRITE_PALETTE(_palette_tag) \ - decospr_device::static_set_palette_tag(*device, "^" _palette_tag); diff --git a/src/mame/video/k001604.cpp b/src/mame/video/k001604.cpp index 6308e9f2736..efc658e44c4 100644 --- a/src/mame/video/k001604.cpp +++ b/src/mame/video/k001604.cpp @@ -19,8 +19,7 @@ const device_type K001604 = &device_creator<k001604_device>; k001604_device::k001604_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, K001604, "K001604 2D tilemaps + 2x ROZ", tag, owner, clock, "k001604", __FILE__), - m_gfx_index_1(0), - m_gfx_index_2(0), + device_gfx_interface(mconfig, *this, nullptr), m_layer_size(0), m_roz_size(0), m_txt_mem_offset(0), @@ -28,22 +27,8 @@ k001604_device::k001604_device(const machine_config &mconfig, const char *tag, d m_layer_roz(nullptr), m_tile_ram(nullptr), m_char_ram(nullptr), - m_reg(nullptr), - m_gfxdecode(*this), - m_palette(*this) + m_reg(nullptr) { - m_gfx_index[0] = 0; - m_gfx_index[1] = 0; -} - -//------------------------------------------------- -// static_set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void k001604_device::static_set_gfxdecode_tag(device_t &device, const char *tag) -{ - downcast<k001604_device &>(device).m_gfxdecode.set_tag(tag); } //------------------------------------------------- @@ -74,14 +59,8 @@ void k001604_device::device_start() 16*256 }; - if(!m_gfxdecode->started()) - throw device_missing_dependencies(); - int roz_tile_size; - m_gfx_index[0] = m_gfx_index_1; - m_gfx_index[1] = m_gfx_index_2; - m_char_ram = make_unique_clear<UINT32[]>(0x200000 / 4); m_tile_ram = make_unique_clear<UINT32[]>(0x20000 / 4); m_reg = make_unique_clear<UINT32[]>(0x400 / 4); @@ -91,24 +70,24 @@ void k001604_device::device_start() if (m_layer_size) { - m_layer_8x8[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k001604_device::tile_info_layer_8x8),this), tilemap_mapper_delegate(FUNC(k001604_device::scan_layer_8x8_0_size1),this), 8, 8, 64, 64); - m_layer_8x8[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k001604_device::tile_info_layer_8x8),this), tilemap_mapper_delegate(FUNC(k001604_device::scan_layer_8x8_1_size1),this), 8, 8, 64, 64); + m_layer_8x8[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k001604_device::tile_info_layer_8x8),this), tilemap_mapper_delegate(FUNC(k001604_device::scan_layer_8x8_0_size1),this), 8, 8, 64, 64); + m_layer_8x8[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k001604_device::tile_info_layer_8x8),this), tilemap_mapper_delegate(FUNC(k001604_device::scan_layer_8x8_1_size1),this), 8, 8, 64, 64); - m_layer_roz = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k001604_device::tile_info_layer_roz),this), tilemap_mapper_delegate(FUNC(k001604_device::scan_layer_roz_256),this), roz_tile_size, roz_tile_size, 128, 64); + m_layer_roz = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k001604_device::tile_info_layer_roz),this), tilemap_mapper_delegate(FUNC(k001604_device::scan_layer_roz_256),this), roz_tile_size, roz_tile_size, 128, 64); } else { - m_layer_8x8[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k001604_device::tile_info_layer_8x8),this), tilemap_mapper_delegate(FUNC(k001604_device::scan_layer_8x8_0_size0),this), 8, 8, 64, 64); - m_layer_8x8[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k001604_device::tile_info_layer_8x8),this), tilemap_mapper_delegate(FUNC(k001604_device::scan_layer_8x8_1_size0),this), 8, 8, 64, 64); + m_layer_8x8[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k001604_device::tile_info_layer_8x8),this), tilemap_mapper_delegate(FUNC(k001604_device::scan_layer_8x8_0_size0),this), 8, 8, 64, 64); + m_layer_8x8[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k001604_device::tile_info_layer_8x8),this), tilemap_mapper_delegate(FUNC(k001604_device::scan_layer_8x8_1_size0),this), 8, 8, 64, 64); - m_layer_roz = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k001604_device::tile_info_layer_roz),this), tilemap_mapper_delegate(FUNC(k001604_device::scan_layer_roz_128),this), roz_tile_size, roz_tile_size, 128, 64); + m_layer_roz = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k001604_device::tile_info_layer_roz),this), tilemap_mapper_delegate(FUNC(k001604_device::scan_layer_roz_128),this), roz_tile_size, roz_tile_size, 128, 64); } m_layer_8x8[0]->set_transparent_pen(0); m_layer_8x8[1]->set_transparent_pen(0); - m_gfxdecode->set_gfx(m_gfx_index[0], std::make_unique<gfx_element>(m_palette, k001604_char_layout_layer_8x8, (UINT8*)&m_char_ram[0], 0, m_palette->entries() / 16, 0)); - m_gfxdecode->set_gfx(m_gfx_index[1], std::make_unique<gfx_element>(m_palette, k001604_char_layout_layer_16x16, (UINT8*)&m_char_ram[0], 0, m_palette->entries() / 16, 0)); + set_gfx(0, std::make_unique<gfx_element>(palette(), k001604_char_layout_layer_8x8, (UINT8*)&m_char_ram[0], 0, palette().entries() / 16, 0)); + set_gfx(1, std::make_unique<gfx_element>(palette(), k001604_char_layout_layer_16x16, (UINT8*)&m_char_ram[0], 0, palette().entries() / 16, 0)); save_pointer(NAME(m_reg.get()), 0x400 / 4); save_pointer(NAME(m_char_ram.get()), 0x200000 / 4); @@ -182,7 +161,7 @@ TILE_GET_INFO_MEMBER(k001604_device::tile_info_layer_8x8) if (val & 0x800000) flags |= TILE_FLIPY; - SET_TILE_INFO_MEMBER(m_gfx_index[0], tile, color, flags); + SET_TILE_INFO_MEMBER(0, tile, color, flags); } TILE_GET_INFO_MEMBER(k001604_device::tile_info_layer_roz) @@ -199,7 +178,7 @@ TILE_GET_INFO_MEMBER(k001604_device::tile_info_layer_roz) tile += m_roz_size ? 0x800 : 0x2000; - SET_TILE_INFO_MEMBER(m_gfx_index[m_roz_size], tile, color, flags); + SET_TILE_INFO_MEMBER(m_roz_size, tile, color, flags); } @@ -237,7 +216,7 @@ void k001604_device::draw_back_layer( bitmap_rgb32 &bitmap, const rectangle &cli int ex = cliprect.max_x; int ey = cliprect.max_y; - const rgb_t *clut = m_palette->palette()->entry_list_raw(); + const rgb_t *clut = palette().palette()->entry_list_raw(); int window_x, window_y, window_xmask, window_ymask; @@ -397,8 +376,8 @@ WRITE32_MEMBER( k001604_device::char_w ) COMBINE_DATA(m_char_ram.get() + addr); - m_gfxdecode->gfx(m_gfx_index[0])->mark_dirty(addr / 32); - m_gfxdecode->gfx(m_gfx_index[1])->mark_dirty(addr / 128); + gfx(0)->mark_dirty(addr / 32); + gfx(1)->mark_dirty(addr / 128); } WRITE32_MEMBER( k001604_device::reg_w ) @@ -419,13 +398,3 @@ WRITE32_MEMBER( k001604_device::reg_w ) //printf("K001604_reg_w (%d), %02X, %08X, %08X at %08X\n", chip, offset, data, mem_mask, space.device().safe_pc()); } } - -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void k001604_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<k001604_device &>(device).m_palette.set_tag(tag); -} diff --git a/src/mame/video/k001604.h b/src/mame/video/k001604.h index d0719936029..d4264007856 100644 --- a/src/mame/video/k001604.h +++ b/src/mame/video/k001604.h @@ -5,17 +5,13 @@ #define __K001604_H__ -class k001604_device : public device_t +class k001604_device : public device_t, public device_gfx_interface { public: k001604_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); ~k001604_device() {} // static configuration - static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); - static void set_gfx_index_1(device_t &device, int idx) { downcast<k001604_device &>(device).m_gfx_index_1 = idx; } - static void set_gfx_index_2(device_t &device, int idx) { downcast<k001604_device &>(device).m_gfx_index_2 = idx; } static void set_layer_size(device_t &device, int size) { downcast<k001604_device &>(device).m_layer_size = size; } static void set_roz_size(device_t &device, int size) { downcast<k001604_device &>(device).m_roz_size = size; } static void set_txt_mem_offset(device_t &device, int offs) { downcast<k001604_device &>(device).m_txt_mem_offset = offs; } @@ -36,8 +32,6 @@ protected: virtual void device_reset() override; private: // internal state - int m_gfx_index_1; - int m_gfx_index_2; int m_layer_size; // 0 -> width = 128 tiles, 1 -> width = 256 tiles int m_roz_size; // 0 -> 8x8, 1 -> 16x16 int m_txt_mem_offset; @@ -45,13 +39,10 @@ private: tilemap_t *m_layer_8x8[2]; tilemap_t *m_layer_roz; - int m_gfx_index[2]; std::unique_ptr<UINT32[]> m_tile_ram; std::unique_ptr<UINT32[]> m_char_ram; std::unique_ptr<UINT32[]> m_reg; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; TILEMAP_MAPPER_MEMBER(scan_layer_8x8_0_size0); TILEMAP_MAPPER_MEMBER(scan_layer_8x8_0_size1); @@ -66,12 +57,6 @@ private: extern const device_type K001604; -#define MCFG_K001604_GFX_INDEX1(_idx) \ - k001604_device::set_gfx_index_1(*device, _idx); - -#define MCFG_K001604_GFX_INDEX2(_idx) \ - k001604_device::set_gfx_index_2(*device, _idx); - #define MCFG_K001604_LAYER_SIZE(_size) \ k001604_device::set_layer_size(*device, _size); @@ -84,10 +69,7 @@ extern const device_type K001604; #define MCFG_K001604_ROZ_OFFSET(_offs) \ k001604_device::set_roz_mem_offset(*device, _offs); -#define MCFG_K001604_GFXDECODE(_gfxtag) \ - k001604_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); - #define MCFG_K001604_PALETTE(_palette_tag) \ - k001604_device::static_set_palette_tag(*device, "^" _palette_tag); + MCFG_GFX_PALETTE(_palette_tag) #endif diff --git a/src/mame/video/k037122.cpp b/src/mame/video/k037122.cpp index e7f57786174..dd572916e9a 100644 --- a/src/mame/video/k037122.cpp +++ b/src/mame/video/k037122.cpp @@ -18,36 +18,15 @@ const device_type K037122 = &device_creator<k037122_device>; k037122_device::k037122_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, K037122, "K037122 2D Tilemap", tag, owner, clock, "k037122", __FILE__), device_video_interface(mconfig, *this), + device_gfx_interface(mconfig, *this, nullptr), m_tile_ram(nullptr), m_char_ram(nullptr), m_reg(nullptr), - m_gfx_index(0), - m_gfxdecode(*this), - m_palette(*this) + m_gfx_index(0) { } //------------------------------------------------- -// static_set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void k037122_device::static_set_gfxdecode_tag(device_t &device, const char *tag) -{ - downcast<k037122_device &>(device).m_gfxdecode.set_tag(tag); -} - -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void k037122_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<k037122_device &>(device).m_palette.set_tag(tag); -} - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -64,20 +43,17 @@ void k037122_device::device_start() 8*128 }; - if(!m_gfxdecode->started()) - throw device_missing_dependencies(); - m_char_ram = make_unique_clear<UINT32[]>(0x200000 / 4); m_tile_ram = make_unique_clear<UINT32[]>(0x20000 / 4); m_reg = make_unique_clear<UINT32[]>(0x400 / 4); - m_layer[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k037122_device::tile_info_layer0),this), TILEMAP_SCAN_ROWS, 8, 8, 256, 64); - m_layer[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k037122_device::tile_info_layer1),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64); + m_layer[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k037122_device::tile_info_layer0),this), TILEMAP_SCAN_ROWS, 8, 8, 256, 64); + m_layer[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k037122_device::tile_info_layer1),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64); m_layer[0]->set_transparent_pen(0); m_layer[1]->set_transparent_pen(0); - m_gfxdecode->set_gfx(m_gfx_index,std::make_unique<gfx_element>(m_palette, k037122_char_layout, (UINT8*)m_char_ram.get(), 0, m_palette->entries() / 16, 0)); + set_gfx(m_gfx_index,std::make_unique<gfx_element>(palette(), k037122_char_layout, (UINT8*)m_char_ram.get(), 0, palette().entries() / 16, 0)); save_pointer(NAME(m_reg.get()), 0x400 / 4); save_pointer(NAME(m_char_ram.get()), 0x200000 / 4); @@ -153,7 +129,7 @@ void k037122_device::update_palette_color( UINT32 palette_base, int color ) { UINT32 data = m_tile_ram[(palette_base / 4) + color]; - m_palette->set_pen_color(color, pal5bit(data >> 6), pal6bit(data >> 0), pal5bit(data >> 11)); + palette().set_pen_color(color, pal5bit(data >> 6), pal6bit(data >> 0), pal5bit(data >> 11)); } READ32_MEMBER( k037122_device::sram_r ) @@ -211,7 +187,7 @@ WRITE32_MEMBER( k037122_device::char_w ) UINT32 addr = offset + (bank * (0x40000/4)); COMBINE_DATA(m_char_ram.get() + addr); - m_gfxdecode->gfx(m_gfx_index)->mark_dirty(addr / 32); + gfx(m_gfx_index)->mark_dirty(addr / 32); } READ32_MEMBER( k037122_device::reg_r ) diff --git a/src/mame/video/k037122.h b/src/mame/video/k037122.h index 181f28e355d..99276695a36 100644 --- a/src/mame/video/k037122.h +++ b/src/mame/video/k037122.h @@ -5,15 +5,14 @@ #define __K037122_H__ class k037122_device : public device_t, - public device_video_interface + public device_video_interface, + public device_gfx_interface { public: k037122_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); ~k037122_device() {} // static configuration - static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); static void static_set_gfx_index(device_t &device, int index) { downcast<k037122_device &>(device).m_gfx_index = index; } void tile_draw( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ); @@ -38,8 +37,6 @@ private: std::unique_ptr<UINT32[]> m_reg; int m_gfx_index; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; TILE_GET_INFO_MEMBER(tile_info_layer0); TILE_GET_INFO_MEMBER(tile_info_layer1); @@ -48,15 +45,11 @@ private: extern const device_type K037122; -#define MCFG_K037122_ADD(_tag, _screen, _gfxindex) \ +#define MCFG_K037122_ADD(_tag, _screen) \ MCFG_DEVICE_ADD(_tag, K037122, 0) \ - MCFG_VIDEO_SET_SCREEN(_screen) \ - k037122_device::static_set_gfx_index(*device, _gfxindex); - -#define MCFG_K037122_GFXDECODE(_gfxtag) \ - k037122_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); + MCFG_VIDEO_SET_SCREEN(_screen) #define MCFG_K037122_PALETTE(_palette_tag) \ - k037122_device::static_set_palette_tag(*device, "^" _palette_tag); + MCFG_GFX_PALETTE(_palette_tag) #endif diff --git a/src/mame/video/k053246_k053247_k055673.cpp b/src/mame/video/k053246_k053247_k055673.cpp index fc9bc1581eb..1469014fbfc 100644 --- a/src/mame/video/k053246_k053247_k055673.cpp +++ b/src/mame/video/k053246_k053247_k055673.cpp @@ -292,9 +292,9 @@ void k053247_device::k053247_sprites_draw_common( _BitmapClass &bitmap, const re VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS */ - if (m_palette->shadows_enabled()) + if (palette().shadows_enabled()) { - if (sizeof(typename _BitmapClass::pixel_t) == 4 && (m_palette->hilights_enabled())) + if (sizeof(typename _BitmapClass::pixel_t) == 4 && (palette().hilights_enabled())) shdmask = 3; // enable all shadows and highlights else shdmask = 0; // enable default shadows @@ -505,8 +505,8 @@ void k053247_device::zdrawgfxzoom32GP( src_fh = 16; src_base = m_gfx->get_data(code % m_gfx->elements()); - pal_base = m_palette->pens() + m_gfx->colorbase() + (color % m_gfx->colors()) * granularity; - shd_base = m_palette->shadow_table(); + pal_base = palette().pens() + m_gfx->colorbase() + (color % m_gfx->colors()) * granularity; + shd_base = palette().shadow_table(); dst_ptr = &bitmap.pix32(0); dst_pitch = bitmap.rowpixels(); @@ -914,7 +914,7 @@ k055673_device::k055673_device(const machine_config &mconfig, const char *tag, d void k055673_device::device_start() { - int gfx_index; + int gfx_index = 0; UINT32 total; static const gfx_layout spritelayout = /* System GX sprite layout */ @@ -965,12 +965,6 @@ void k055673_device::device_start() UINT16 *alt_k055673_rom; int size4; - /* find first empty slot to decode gfx */ - for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++) - if (m_gfxdecode->gfx(gfx_index) == nullptr) - break; - assert(gfx_index != MAX_GFX_ELEMENTS); - alt_k055673_rom = (UINT16 *)machine().root_device().memregion(m_memory_region)->base(); /* decode the graphics */ @@ -995,33 +989,33 @@ void k055673_device::device_start() } total = size4 / 128; - konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout, 5); + konami_decode_gfx(*this, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout, 5); break; case K055673_LAYOUT_RNG: total = machine().root_device().memregion(m_memory_region)->bytes() / (16*16/2); - konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout2, 4); + konami_decode_gfx(*this, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout2, 4); break; case K055673_LAYOUT_LE2: total = machine().root_device().memregion(m_memory_region)->bytes() / (16*16); - konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout3, 8); + konami_decode_gfx(*this, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout3, 8); break; case K055673_LAYOUT_GX6: total = machine().root_device().memregion(m_memory_region)->bytes() / (16*16*6/8); - konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout4, 6); + konami_decode_gfx(*this, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout4, 6); break; default: fatalerror("Unsupported layout\n"); } - if (VERBOSE && !(m_palette->shadows_enabled())) + if (VERBOSE && !(palette().shadows_enabled())) popmessage("driver should use VIDEO_HAS_SHADOWS"); m_z_rejection = -1; - m_gfx = m_gfxdecode->gfx(gfx_index); + m_gfx = gfx(gfx_index); m_objcha_line = CLEAR_LINE; m_ram = std::make_unique<UINT16[]>(0x1000/2); @@ -1046,8 +1040,8 @@ const device_type K053246 = &device_creator<k053247_device>; k053247_device::k053247_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, K053246, "K053246 & K053247 Sprite Generator", tag, owner, clock, "k053247", __FILE__), device_video_interface(mconfig, *this), - m_gfxdecode(*this), - m_palette(*this) + device_gfx_interface(mconfig, *this), + m_gfx_num(0) { clear_all(); } @@ -1055,33 +1049,13 @@ k053247_device::k053247_device(const machine_config &mconfig, const char *tag, d k053247_device::k053247_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_video_interface(mconfig, *this), - m_gfxdecode(*this), - m_palette(*this) + device_gfx_interface(mconfig, *this, nullptr), + m_gfx_num(0) { clear_all(); } //------------------------------------------------- -// static_set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void k053247_device::static_set_gfxdecode_tag(device_t &device, const char *tag) -{ - downcast<k053247_device &>(device).m_gfxdecode.set_tag(tag); -} - -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void k053247_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<k053247_device &>(device).m_palette.set_tag(tag); -} - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -1106,7 +1080,7 @@ void k053247_device::device_start() { case NORMAL_PLANE_ORDER: total = machine().root_device().memregion(m_memory_region)->bytes() / 128; - konami_decode_gfx(machine(), m_gfxdecode, m_palette, m_gfx_num, machine().root_device().memregion(m_memory_region)->base(), total, &spritelayout, 4); + konami_decode_gfx(*this, m_gfx_num, machine().root_device().memregion(m_memory_region)->base(), total, &spritelayout, 4); break; default: @@ -1117,17 +1091,17 @@ void k053247_device::device_start() { if (m_screen->format() == BITMAP_FORMAT_RGB32) { - if (!m_palette->shadows_enabled() || !m_palette->hilights_enabled()) + if (!palette().shadows_enabled() || !palette().hilights_enabled()) popmessage("driver missing SHADOWS or HIGHLIGHTS flag"); } else { - if (!(m_palette->shadows_enabled())) + if (!(palette().shadows_enabled())) popmessage("driver should use VIDEO_HAS_SHADOWS"); } } - m_gfx = m_gfxdecode->gfx(m_gfx_num); + m_gfx = gfx(m_gfx_num); m_ram = make_unique_clear<UINT16[]>(0x1000 / 2); diff --git a/src/mame/video/k053246_k053247_k055673.h b/src/mame/video/k053246_k053247_k055673.h index 96e41f00893..7fe1adc37f6 100644 --- a/src/mame/video/k053246_k053247_k055673.h +++ b/src/mame/video/k053246_k053247_k055673.h @@ -17,14 +17,14 @@ typedef device_delegate<void (int *code, int *color, int *priority_mask)> k05324 #define MCFG_K053246_CB(_class, _method) \ k053247_device::set_k053247_callback(*device, k053247_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); -#define MCFG_K053246_CONFIG(_gfx_reg, _gfx_num, _order, _dx, _dy) \ - k053247_device::set_config(*device, _gfx_reg, _gfx_num, _order, _dx, _dy); +#define MCFG_K053246_CONFIG(_gfx_reg, _order, _dx, _dy) \ + k053247_device::set_config(*device, _gfx_reg, _order, _dx, _dy); #define MCFG_K055673_CB(_class, _method) \ k053247_device::set_k053247_callback(*device, k053247_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); -#define MCFG_K055673_CONFIG(_gfx_reg, _gfx_num, _order, _dx, _dy) \ - k053247_device::set_config(*device, _gfx_reg, _gfx_num, _order, _dx, _dy); +#define MCFG_K055673_CONFIG(_gfx_reg, _order, _dx, _dy) \ + k053247_device::set_config(*device, _gfx_reg, _order, _dx, _dy); /** Konami 053246 / 053247 / 055673 **/ @@ -58,7 +58,8 @@ Callback procedures for non-standard shadows: class k053247_device : public device_t, - public device_video_interface + public device_video_interface, + public device_gfx_interface { public: k053247_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -67,14 +68,11 @@ public: ~k053247_device() { } // static configuration - static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); static void set_k053247_callback(device_t &device, k053247_cb_delegate callback) { downcast<k053247_device &>(device).m_k053247_cb = callback; } - static void set_config(device_t &device, const char *gfx_reg, int gfx_num, int bpp, int dx, int dy) + static void set_config(device_t &device, const char *gfx_reg, int bpp, int dx, int dy) { k053247_device &dev = downcast<k053247_device &>(device); dev.m_memory_region = gfx_reg; - dev.m_gfx_num = gfx_num; dev.m_bpp = bpp; dev.m_dx = dx; dev.m_dy = dy; @@ -122,12 +120,9 @@ public: k053247_cb_delegate m_k053247_cb; - //FIXME: device should be updated to use device_gfx_interface to get rid of most of these! const char *m_memory_region; int m_gfx_num; int m_bpp; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; /* alt implementation - to be collapsed */ void zdrawgfxzoom32GP( @@ -280,14 +275,14 @@ public: color = 0; shadow = -1; whichtable = shadowmode_table; - m_palette->set_shadow_mode(0); + palette().set_shadow_mode(0); } else { if (shdmask >= 0) { shadow = (color & K053247_CUSTOMSHADOW) ? (color >> K053247_SHDSHIFT) : (shadow >> 10); - if (shadow &= 3) m_palette->set_shadow_mode((shadow - 1) & shdmask); + if (shadow &= 3) palette().set_shadow_mode((shadow - 1) & shdmask); } else shadow = 0; @@ -502,20 +497,12 @@ extern const device_type K055673; #define MCFG_K053246_SET_SCREEN MCFG_VIDEO_SET_SCREEN -#define MCFG_K053246_GFXDECODE(_gfxtag) \ - k053247_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); - -#define MCFG_K053246_PALETTE(_palette_tag) \ - k053247_device::static_set_palette_tag(*device, "^" _palette_tag); +#define MCFG_K053246_PALETTE MCFG_GFX_PALETTE #define MCFG_K055673_SET_SCREEN MCFG_VIDEO_SET_SCREEN -#define MCFG_K055673_GFXDECODE(_gfxtag) \ - k055673_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); - -#define MCFG_K055673_PALETTE(_palette_tag) \ - k055673_device::static_set_palette_tag(*device, "^" _palette_tag); +#define MCFG_K055673_PALETTE MCFG_GFX_PALETTE #endif diff --git a/src/mame/video/k054156_k054157_k056832.cpp b/src/mame/video/k054156_k054157_k056832.cpp index 9167a3e571a..b5dc7fd67fa 100644 --- a/src/mame/video/k054156_k054157_k056832.cpp +++ b/src/mame/video/k054156_k054157_k056832.cpp @@ -183,6 +183,7 @@ const device_type K056832 = &device_creator<k056832_device>; k056832_device::k056832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, K056832, "K056832 Tilemap Generator", tag, owner, clock, "k056832", __FILE__), + device_gfx_interface(mconfig, *this), //m_tilemap[K056832_PAGE_COUNT], //*m_pixmap[K056832_PAGE_COUNT], //m_regs[0x20], @@ -219,33 +220,10 @@ k056832_device::k056832_device(const machine_config &mconfig, const char *tag, d m_use_ext_linescroll(0), m_uses_tile_banks(0), m_cur_tile_bank(0), - m_k055555(nullptr), - m_gfxdecode(*this), - m_palette(*this) + m_k055555(nullptr) { } -//------------------------------------------------- -// static_set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void k056832_device::static_set_gfxdecode_tag(device_t &device, const char *tag) -{ - downcast<k056832_device &>(device).m_gfxdecode.set_tag(tag); -} - - -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void k056832_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<k056832_device &>(device).m_palette.set_tag(tag); -} - void k056832_device::create_tilemaps() { tilemap_t *tmap; @@ -284,22 +262,22 @@ void k056832_device::create_tilemaps() m_videoram.resize(0x2000 * (K056832_PAGE_COUNT + 1) / 2); memset(&m_videoram[0], 0, 2*m_videoram.size()); - m_tilemap[0x0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x2] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info2),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x3] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info3),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x4] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info4),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x5] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info5),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x6] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info6),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x7] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info7),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x8] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info8),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x9] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info9),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0xa] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infoa),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0xb] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infob),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0xc] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infoc),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0xd] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infod),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0xe] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infoe),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0xf] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infof),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x2] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info2),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x3] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info3),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x4] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info4),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x5] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info5),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x6] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info6),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x7] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info7),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x8] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info8),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x9] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info9),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0xa] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infoa),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0xb] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infob),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0xc] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infoc),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0xd] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infod),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0xe] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infoe),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0xf] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infof),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); for (i = 0; i < K056832_PAGE_COUNT; i++) { @@ -362,9 +340,6 @@ void k056832_device::finalize_init() void k056832_device::device_start() { - if(!m_gfxdecode->started()) - throw device_missing_dependencies(); - memset(m_regs, 0x00, sizeof(m_regs) ); memset(m_regsb, 0x00, sizeof(m_regsb) ); @@ -1296,7 +1271,7 @@ int k056832_device::update_linemap( screen_device &screen, _BitmapClass &bitmap, pixmap = m_pixmap[page]; pal_ptr = machine().pens; - src_gfx = m_gfxdecode->gfx(m_gfx_num]; + src_gfx = gfx(m_gfx_num); src_pitch = src_gfx->rowbytes(); src_modulo = src_gfx->char_modulo; dst_pitch = pixmap->rowpixels; @@ -2024,7 +1999,7 @@ READ16_MEMBER( k056832_device::b_word_r ) void k056832_device::create_gfx(const char *gfx_memory_region, int bpp, int big) { - int gfx_index; + int gfx_index = 0; int i; UINT32 total; @@ -2092,13 +2067,6 @@ void k056832_device::create_gfx(const char *gfx_memory_region, int bpp, int big) m_bpp = bpp; - /* find first empty slot to decode gfx */ - for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++) - { - if (m_gfxdecode->gfx(gfx_index) == nullptr) break; - } - assert(gfx_index != MAX_GFX_ELEMENTS); - /* handle the various graphics formats */ i = (big) ? 8 : 16; @@ -2107,45 +2075,45 @@ void k056832_device::create_gfx(const char *gfx_memory_region, int bpp, int big) { case K056832_BPP_4: total = machine().root_device().memregion(gfx_memory_region)->bytes() / (i*4); - konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout4, 4); + konami_decode_gfx(*this, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout4, 4); break; case K056832_BPP_5: total = machine().root_device().memregion(gfx_memory_region)->bytes() / (i*5); - konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout5, 5); + konami_decode_gfx(*this, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout5, 5); break; case K056832_BPP_6: total = machine().root_device().memregion(gfx_memory_region)->bytes() / (i*6); - konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout6, 6); + konami_decode_gfx(*this, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout6, 6); break; case K056832_BPP_8: total = machine().root_device().memregion(gfx_memory_region)->bytes() / (i*8); - konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout8, 8); + konami_decode_gfx(*this, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout8, 8); break; case K056832_BPP_8LE: total = machine().root_device().memregion(gfx_memory_region)->bytes() / (i*8); - konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout8le, 8); + konami_decode_gfx(*this, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout8le, 8); break; case K056832_BPP_8TASMAN: total = machine().root_device().memregion(gfx_memory_region)->bytes() / (i*8); - konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout8, 8); + konami_decode_gfx(*this, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout8, 8); break; case K056832_BPP_4dj: total = machine().root_device().memregion(gfx_memory_region)->bytes() / (i*4); - konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout4dj, 4); + konami_decode_gfx(*this, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout4dj, 4); break; default: fatalerror("Unsupported bpp\n"); } - m_gfxdecode->gfx(gfx_index)->set_granularity(16); /* override */ - m_gfxdecode->gfx(gfx_index)->set_colors(m_palette->entries() / 16); + gfx(gfx_index)->set_granularity(16); /* override */ + gfx(gfx_index)->set_colors(palette().entries() / 16); m_gfx_memory_region = gfx_memory_region; m_gfx_num = gfx_index; @@ -2225,7 +2193,7 @@ int k056832_device::altK056832_update_linemap(screen_device &screen, bitmap_rgb3 pixmap = m_pixmap[page]; pal_ptr = machine().pens; - src_gfx = m_gfxdecode->gfx(m_gfx_num]; + src_gfx = gfx(m_gfx_num); src_pitch = src_gfx->rowbytes(); src_modulo = src_gfx->char_modulo; dst_pitch = pixmap->rowpixels; diff --git a/src/mame/video/k054156_k054157_k056832.h b/src/mame/video/k054156_k054157_k056832.h index d043a4f9525..e0c6e87b3f4 100644 --- a/src/mame/video/k054156_k054157_k056832.h +++ b/src/mame/video/k054156_k054157_k056832.h @@ -16,8 +16,8 @@ typedef device_delegate<void (int layer, int *code, int *color, int *flags)> k05 #define MCFG_K056832_CB(_class, _method) \ k056832_device::set_k056832_callback(*device, k056832_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); -#define MCFG_K056832_CONFIG(_gfx_reg, _gfx_num, _bpp, _big, _djmain_hack, _k055555) \ - k056832_device::set_config(*device, _gfx_reg, _gfx_num, _bpp, _big, _djmain_hack, _k055555); +#define MCFG_K056832_CONFIG(_gfx_reg, _bpp, _big, _djmain_hack, _k055555) \ + k056832_device::set_config(*device, _gfx_reg, _bpp, _big, _djmain_hack, _k055555); #define K056832_PAGE_COUNT 16 @@ -35,7 +35,7 @@ typedef device_delegate<void (int layer, int *code, int *color, int *flags)> k05 #define K056382_DRAW_FLAG_FORCE_XYSCROLL 0x00800000 -class k056832_device : public device_t +class k056832_device : public device_t, public device_gfx_interface { public: k056832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -45,21 +45,16 @@ public: } static void set_k056832_callback(device_t &device, k056832_cb_delegate callback) { downcast<k056832_device &>(device).m_k056832_cb = callback; } - static void set_config(device_t &device, const char *gfx_reg, int gfx_num, int bpp, int big, int djmain_hack, const char *k055555) + static void set_config(device_t &device, const char *gfx_reg, int bpp, int big, int djmain_hack, const char *k055555) { k056832_device &dev = downcast<k056832_device &>(device); dev.m_gfx_memory_region = gfx_reg; - dev.m_gfx_num = gfx_num; dev.m_bpp = bpp; dev.m_big = big; dev.m_djmain_hack = djmain_hack; dev.m_k055555_tag = k055555; } - // static configuration - static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); - void SetExtLinescroll(); /* Lethal Enforcers */ DECLARE_READ16_MEMBER( ram_word_r ); @@ -219,9 +214,6 @@ private: void create_tilemaps(); void finalize_init(); - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; - public: void m_tilemap_draw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int num, UINT32 flags, UINT32 priority); @@ -234,11 +226,8 @@ extern const device_type K056832; -#define MCFG_K056832_GFXDECODE(_gfxtag) \ - k056832_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); - #define MCFG_K056832_PALETTE(_palette_tag) \ - k056832_device::static_set_palette_tag(*device, "^" _palette_tag); + MCFG_GFX_PALETTE(_palette_tag) #endif diff --git a/src/mame/video/kan_pand.cpp b/src/mame/video/kan_pand.cpp index 181de04020d..a1f43a21a7f 100644 --- a/src/mame/video/kan_pand.cpp +++ b/src/mame/video/kan_pand.cpp @@ -60,8 +60,7 @@ kaneko_pandora_device::kaneko_pandora_device(const machine_config &mconfig, cons m_gfx_region(0), m_xoffset(0), m_yoffset(0), - m_gfxdecode(*this), - m_palette(*this) + m_gfxdecode(*this) { } @@ -76,16 +75,6 @@ void kaneko_pandora_device::static_set_gfxdecode_tag(device_t &device, const cha } //------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void kaneko_pandora_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<kaneko_pandora_device &>(device).m_palette.set_tag(tag); -} - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/kan_pand.h b/src/mame/video/kan_pand.h index f29c5ef3605..a9cb3d3e7f2 100644 --- a/src/mame/video/kan_pand.h +++ b/src/mame/video/kan_pand.h @@ -24,7 +24,6 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); static void set_gfx_region(device_t &device, int gfxregion) { downcast<kaneko_pandora_device &>(device).m_gfx_region = gfxregion; } static void set_offsets(device_t &device, int x_offset, int y_offset) { @@ -59,7 +58,6 @@ private: int m_xoffset; int m_yoffset; required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; }; extern const device_type KANEKO_PANDORA; @@ -78,7 +76,4 @@ extern const device_type KANEKO_PANDORA; #define MCFG_KANEKO_PANDORA_GFXDECODE(_gfxtag) \ kaneko_pandora_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); -#define MCFG_KANEKO_PANDORA_PALETTE(_palette_tag) \ - kaneko_pandora_device::static_set_palette_tag(*device, "^" _palette_tag); - #endif /* __KAN_PAND_H__ */ diff --git a/src/mame/video/konami_helper.cpp b/src/mame/video/konami_helper.cpp index e26864a814b..236371fb4d6 100644 --- a/src/mame/video/konami_helper.cpp +++ b/src/mame/video/konami_helper.cpp @@ -5,13 +5,14 @@ #include "emu.h" #include "konami_helper.h" -void konami_decode_gfx(running_machine &machine, gfxdecode_device * gfxdecode, palette_device &palette, int gfx_index, UINT8 *data, UINT32 total, const gfx_layout *layout, int bpp) +void konami_decode_gfx(device_gfx_interface &gfxdecode, int gfx_index, UINT8 *data, UINT32 total, const gfx_layout *layout, int bpp) { gfx_layout gl; + palette_device &palette = gfxdecode.palette(); memcpy(&gl, layout, sizeof(gl)); gl.total = total; - gfxdecode->set_gfx(gfx_index, std::make_unique<gfx_element>(palette, gl, data, 0, palette.entries() >> bpp, 0)); + gfxdecode.set_gfx(gfx_index, std::make_unique<gfx_element>(palette, gl, data, 0, palette.entries() >> bpp, 0)); } diff --git a/src/mame/video/konami_helper.h b/src/mame/video/konami_helper.h index 0938217e778..e1afd95aada 100644 --- a/src/mame/video/konami_helper.h +++ b/src/mame/video/konami_helper.h @@ -6,7 +6,7 @@ #ifndef __KONAMI_HELPER_H__ #define __KONAMI_HELPER_H__ -void konami_decode_gfx(running_machine &machine, gfxdecode_device * gfxdecode, palette_device &palette, int gfx_index, UINT8 *data, UINT32 total, const gfx_layout *layout, int bpp); +void konami_decode_gfx(device_gfx_interface &gfxdecode, int gfx_index, UINT8 *data, UINT32 total, const gfx_layout *layout, int bpp); /* helper function to sort three tile layers by priority order */ void konami_sortlayers3(int *layer, int *pri); diff --git a/src/mame/video/mystwarr.cpp b/src/mame/video/mystwarr.cpp index 537cd1e8157..8fc30620790 100644 --- a/src/mame/video/mystwarr.cpp +++ b/src/mame/video/mystwarr.cpp @@ -52,7 +52,7 @@ void mystwarr_state::decode_tiles() d += 5; } - m_gfxdecode->gfx(gfxnum)->set_source(m_decoded.get()); + m_k056832->gfx(gfxnum)->set_source(m_decoded.get()); } diff --git a/src/mame/video/pc080sn.cpp b/src/mame/video/pc080sn.cpp index 62736eecae8..54101789fa9 100644 --- a/src/mame/video/pc080sn.cpp +++ b/src/mame/video/pc080sn.cpp @@ -58,8 +58,7 @@ pc080sn_device::pc080sn_device(const machine_config &mconfig, const char *tag, d m_y_offset(0), m_y_invert(0), m_dblwidth(0), - m_gfxdecode(*this), - m_palette(*this) + m_gfxdecode(*this) { for (auto & elem : m_ctrl) elem = 0; @@ -84,16 +83,6 @@ void pc080sn_device::static_set_gfxdecode_tag(device_t &device, const char *tag) } //------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void pc080sn_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<pc080sn_device &>(device).m_palette.set_tag(tag); -} - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/mame/video/pc080sn.h b/src/mame/video/pc080sn.h index b181fbd134e..a63cdfd6915 100644 --- a/src/mame/video/pc080sn.h +++ b/src/mame/video/pc080sn.h @@ -11,7 +11,6 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); static void set_gfx_region(device_t &device, int gfxregion) { downcast<pc080sn_device &>(device).m_gfxnum = gfxregion; } static void set_yinvert(device_t &device, int y_inv) { downcast<pc080sn_device &>(device).m_y_invert = y_inv; } static void set_dblwidth(device_t &device, int dblwidth) { downcast<pc080sn_device &>(device).m_dblwidth = dblwidth; } @@ -68,7 +67,6 @@ public: int m_dblwidth; required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; }; extern const device_type PC080SN; @@ -89,7 +87,4 @@ extern const device_type PC080SN; #define MCFG_PC080SN_GFXDECODE(_gfxtag) \ pc080sn_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); -#define MCFG_PC080SN_PALETTE(_palette_tag) \ - pc080sn_device::static_set_palette_tag(*device, "^" _palette_tag); - #endif diff --git a/src/mame/video/pcd.cpp b/src/mame/video/pcd.cpp index 66d4b288347..cd453cffa14 100644 --- a/src/mame/video/pcd.cpp +++ b/src/mame/video/pcd.cpp @@ -10,11 +10,10 @@ const device_type PCX_VIDEO = &device_creator<pcx_video_device>; pcdx_video_device::pcdx_video_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_gfx_interface(mconfig, *this, nullptr, "palette"), m_maincpu(*this, ":maincpu"), m_mcu(*this, "graphics"), m_crtc(*this, "crtc"), - m_palette(*this, "palette"), - m_gfxdecode(*this, "gfxdecode"), m_pic2(*this, ":pic2") { } @@ -76,7 +75,7 @@ static const gfx_layout pcd_charlayout = }; static GFXDECODE_START( pcx ) - GFXDECODE_ENTRY( "char", 0x0000, pcd_charlayout, 0, 1 ) + GFXDECODE_DEVICE( "char", 0x0000, pcd_charlayout, 0, 1 ) GFXDECODE_END static INPUT_PORTS_START( pcd_mouse ) @@ -113,7 +112,6 @@ static MACHINE_CONFIG_FRAGMENT( pcd_video ) MCFG_SCREEN_REFRESH_RATE(50) MCFG_SCREEN_UPDATE_DEVICE("crtc", scn2674_device, screen_update) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) MCFG_PALETTE_ADD("palette", 3) MCFG_PALETTE_INIT_OWNER(pcdx_video_device, pcdx) @@ -159,7 +157,6 @@ static MACHINE_CONFIG_FRAGMENT( pcx_video ) MCFG_SCREEN_REFRESH_RATE(50) MCFG_SCREEN_UPDATE_DEVICE("crtc", scn2674_device, screen_update) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", pcx) MCFG_PALETTE_ADD_MONOCHROME("palette") MCFG_SCN2674_VIDEO_ADD("crtc", 0, INPUTLINE("graphics", MCS51_INT0_LINE)); @@ -184,7 +181,7 @@ SCN2674_DRAW_CHARACTER_MEMBER(pcd_video_device::display_pixels) if(m_p2 & 8) data = ~data; for(int i = 0; i < 16; i++) - bitmap.pix32(y, x + i) = m_palette->pen((data & (1 << (15 - i))) ? 1 : 0); + bitmap.pix32(y, x + i) = palette().pen((data & (1 << (15 - i))) ? 1 : 0); } else { @@ -207,7 +204,7 @@ SCN2674_DRAW_CHARACTER_MEMBER(pcd_video_device::display_pixels) else if(attr & 8) bgnd = 2; for(int i = 0; i < 8; i++) - bitmap.pix32(y, x + i) = m_palette->pen((data & (1 << (7 - i))) ? fgnd : bgnd); + bitmap.pix32(y, x + i) = palette().pen((data & (1 << (7 - i))) ? fgnd : bgnd); } } @@ -221,7 +218,7 @@ SCN2674_DRAW_CHARACTER_MEMBER(pcx_video_device::display_pixels) if(m_p1 & 0x20) data = ~data; for(int i = 0; i < 8; i++) - bitmap.pix32(y, x + i) = m_palette->pen((data & (1 << (7 - i))) ? 1 : 0); + bitmap.pix32(y, x + i) = palette().pen((data & (1 << (7 - i))) ? 1 : 0); } PALETTE_INIT_MEMBER(pcdx_video_device, pcdx) @@ -276,7 +273,7 @@ WRITE8_MEMBER(pcd_video_device::vram_w) { offset >>= 1; m_charram[offset & 0x1fff] = data; - m_gfxdecode->gfx(0)->mark_dirty(offset/16); + gfx(0)->mark_dirty(offset/16); } } @@ -410,7 +407,7 @@ void pcd_video_device::device_start() { m_maincpu->space(AS_IO).install_readwrite_handler(0xfb00, 0xfb01, 0, 0, read8_delegate(FUNC(pcdx_video_device::detect_r), this), write8_delegate(FUNC(pcdx_video_device::detect_w), this), 0xff00); m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xf0000, 0xf7fff, 0, 0, read8_delegate(FUNC(pcd_video_device::vram_r), this), write8_delegate(FUNC(pcd_video_device::vram_w), this), 0xffff); - m_gfxdecode->set_gfx(0, std::make_unique<gfx_element>(m_palette, pcd_charlayout, &m_charram[0], 0, 1, 0)); + set_gfx(0, std::make_unique<gfx_element>(palette(), pcd_charlayout, &m_charram[0], 0, 1, 0)); } void pcd_video_device::device_reset() @@ -442,6 +439,8 @@ void pcx_video_device::device_start() mcu->i8051_set_serial_rx_callback(READ8_DELEGATE(pcx_video_device, rx_callback)); set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1); set_rate(600*2); // FIXME: fix the keyboard when the mc2661 baud rate calc is fixed + + decode_gfx(GFXDECODE_NAME(pcx)); } void pcx_video_device::device_reset() diff --git a/src/mame/video/pcd.h b/src/mame/video/pcd.h index f22c2707569..32637fac992 100644 --- a/src/mame/video/pcd.h +++ b/src/mame/video/pcd.h @@ -11,7 +11,7 @@ #define MCFG_PCX_VIDEO_TXD_HANDLER(_devcb) \ devcb = &pcx_video_device::set_txd_handler(*device, DEVCB_##_devcb); -class pcdx_video_device : public device_t +class pcdx_video_device : public device_t, public device_gfx_interface { public: pcdx_video_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); @@ -25,8 +25,6 @@ protected: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_mcu; required_device<scn2674_device> m_crtc; - required_device<palette_device> m_palette; - required_device<gfxdecode_device> m_gfxdecode; required_device<pic8259_device> m_pic2; }; diff --git a/src/mame/video/segaic24.cpp b/src/mame/video/segaic24.cpp index 57c848287dc..f1e1f87aae9 100644 --- a/src/mame/video/segaic24.cpp +++ b/src/mame/video/segaic24.cpp @@ -25,31 +25,11 @@ const device_type S24MIXER = &device_creator<segas24_mixer>; segas24_tile::segas24_tile(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, S24TILE, "Sega System 24 Tilemap", tag, owner, clock, "segas24_tile", __FILE__), - m_gfxdecode(*this), - m_palette(*this) + device_gfx_interface(mconfig, *this), + char_gfx_index(0) { } -//------------------------------------------------- -// static_set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void segas24_tile::static_set_gfxdecode_tag(device_t &device, const char *tag) -{ - downcast<segas24_tile &>(device).m_gfxdecode.set_tag(tag); -} - -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void segas24_tile::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<segas24_tile &>(device).m_palette.set_tag(tag); -} - void segas24_tile::static_set_tile_mask(device_t &device, UINT16 _tile_mask) { @@ -96,21 +76,13 @@ TILE_GET_INFO_MEMBER(segas24_tile::tile_info_1w) void segas24_tile::device_start() { - if(!m_gfxdecode->started()) - throw device_missing_dependencies(); - - for(char_gfx_index = 0; char_gfx_index < MAX_GFX_ELEMENTS; char_gfx_index++) - if (m_gfxdecode->gfx(char_gfx_index) == nullptr) - break; - assert(char_gfx_index != MAX_GFX_ELEMENTS); - char_ram = std::make_unique<UINT16[]>(0x80000/2); tile_ram = std::make_unique<UINT16[]>(0x10000/2); - tile_layer[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_0s),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); - tile_layer[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_0w),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); - tile_layer[2] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_1s),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); - tile_layer[3] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_1w),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); + tile_layer[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_0s),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); + tile_layer[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_0w),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); + tile_layer[2] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_1s),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); + tile_layer[3] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_1w),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); tile_layer[0]->set_transparent_pen(0); tile_layer[1]->set_transparent_pen(0); @@ -120,7 +92,7 @@ void segas24_tile::device_start() memset(char_ram.get(), 0, 0x80000); memset(tile_ram.get(), 0, 0x10000); - m_gfxdecode->set_gfx(char_gfx_index, std::make_unique<gfx_element>(m_palette, char_layout, (UINT8 *)char_ram.get(), NATIVE_ENDIAN_VALUE_LE_BE(8,0), m_palette->entries() / 16, 0)); + set_gfx(char_gfx_index, std::make_unique<gfx_element>(palette(), char_layout, (UINT8 *)char_ram.get(), NATIVE_ENDIAN_VALUE_LE_BE(8,0), palette().entries() / 16, 0)); save_pointer(NAME(tile_ram.get()), 0x10000/2); save_pointer(NAME(char_ram.get()), 0x80000/2); @@ -267,7 +239,7 @@ void segas24_tile::draw_rect(screen_device &screen, bitmap_ind16 &bm, bitmap_ind const UINT16 *source = &bm.pix16(sy, sx); const UINT8 *trans = &tm.pix8(sy, sx); UINT32 *dest = &dm.pix32(0); - const pen_t *pens = m_palette->pens(); + const pen_t *pens = palette().pens(); tpri |= TILEMAP_PIXEL_LAYER0; @@ -576,7 +548,7 @@ WRITE16_MEMBER(segas24_tile::char_w) UINT16 old = char_ram[offset]; COMBINE_DATA(char_ram.get() + offset); if(old != char_ram[offset]) - m_gfxdecode->gfx(char_gfx_index)->mark_dirty(offset / 16); + gfx(char_gfx_index)->mark_dirty(offset / 16); } READ32_MEMBER(segas24_tile::tile32_r) diff --git a/src/mame/video/segaic24.h b/src/mame/video/segaic24.h index 51165e32ac1..baa9b018afa 100644 --- a/src/mame/video/segaic24.h +++ b/src/mame/video/segaic24.h @@ -19,13 +19,10 @@ MCFG_DEVICE_ADD(_tag, S24MIXER, 0) -#define MCFG_S24TILE_DEVICE_GFXDECODE(_gfxtag) \ - segas24_tile::static_set_gfxdecode_tag(*device, "^" _gfxtag); - #define MCFG_S24TILE_DEVICE_PALETTE(_palette_tag) \ - segas24_tile::static_set_palette_tag(*device, "^" _palette_tag); + MCFG_GFX_PALETTE(_palette_tag) -class segas24_tile : public device_t +class segas24_tile : public device_t, public device_gfx_interface { friend class segas24_tile_config; @@ -33,8 +30,6 @@ public: segas24_tile(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // static configuration - static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); static void static_set_tile_mask(device_t &device, UINT16 tile_mask); DECLARE_READ16_MEMBER(tile_r); @@ -65,8 +60,6 @@ private: UINT16 tile_mask; static const gfx_layout char_layout; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; void tile_info(int offset, tile_data &tileinfo, tilemap_memory_index tile_index); TILE_GET_INFO_MEMBER(tile_info_0s); diff --git a/src/mame/video/seta001.cpp b/src/mame/video/seta001.cpp index d0ff7874fb3..3c81cd94a0e 100644 --- a/src/mame/video/seta001.cpp +++ b/src/mame/video/seta001.cpp @@ -33,8 +33,7 @@ const device_type SETA001_SPRITE = &device_creator<seta001_device>; seta001_device::seta001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, SETA001_SPRITE, "Seta SETA001 Sprite", tag, owner, clock, "seta001", __FILE__), - m_gfxdecode(*this), - m_palette(*this) + m_gfxdecode(*this) { } @@ -48,16 +47,6 @@ void seta001_device::static_set_gfxdecode_tag(device_t &device, const char *tag) downcast<seta001_device &>(device).m_gfxdecode.set_tag(tag); } -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void seta001_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<seta001_device &>(device).m_palette.set_tag(tag); -} - void seta001_device::device_start() { // chukatai draws a column on the left from uninitialized RAM which causes garbage in a debug build diff --git a/src/mame/video/seta001.h b/src/mame/video/seta001.h index b7fea3ce96e..936a9183859 100644 --- a/src/mame/video/seta001.h +++ b/src/mame/video/seta001.h @@ -15,7 +15,6 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); static void set_gfxbank_callback(device_t &device, gfxbank_cb_delegate callback) { downcast<seta001_device &>(device).m_gfxbank_cb = callback; } DECLARE_WRITE8_MEMBER( spritebgflag_w8 ); @@ -63,7 +62,6 @@ private: void draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_size, int setac_type); void draw_foreground( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_size); required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; gfxbank_cb_delegate m_gfxbank_cb; @@ -88,6 +86,3 @@ extern const device_type SETA001_SPRITE; #define MCFG_SETA001_SPRITE_GFXDECODE(_gfxtag) \ seta001_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); - -#define MCFG_SETA001_SPRITE_PALETTE(_palette_tag) \ - seta001_device::static_set_palette_tag(*device, "^" _palette_tag); diff --git a/src/mame/video/snk68_spr.cpp b/src/mame/video/snk68_spr.cpp index fa2382d76ef..0aa9315788a 100644 --- a/src/mame/video/snk68_spr.cpp +++ b/src/mame/video/snk68_spr.cpp @@ -10,7 +10,6 @@ const device_type SNK68_SPR = &device_creator<snk68_spr_device>; snk68_spr_device::snk68_spr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, SNK68_SPR, "SNK68 Sprites", tag, owner, clock, "snk68_spr", __FILE__), m_gfxdecode(*this), - m_palette(*this), m_spriteram(*this, "^spriteram"), m_screen(*this, "^screen"), m_flipscreen(0), @@ -34,16 +33,6 @@ void snk68_spr_device::static_set_gfxdecode_tag(device_t &device, const char *ta downcast<snk68_spr_device &>(device).m_gfxdecode.set_tag(tag); } -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void snk68_spr_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<snk68_spr_device &>(device).m_palette.set_tag(tag); -} - // static void snk68_spr_device::set_tile_indirect_cb(device_t &device,snk68_tile_indirection_delegate newtilecb) { diff --git a/src/mame/video/snk68_spr.h b/src/mame/video/snk68_spr.h index 5604f74714a..1f985727e5a 100644 --- a/src/mame/video/snk68_spr.h +++ b/src/mame/video/snk68_spr.h @@ -4,8 +4,6 @@ typedef device_delegate<void (int&, int&, int&, int&)> snk68_tile_indirection_de #define MCFG_SNK68_SPR_GFXDECODE(_gfxtag) \ snk68_spr_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); -#define MCFG_SNK68_SPR_PALETTE(_palette_tag) \ - snk68_spr_device::static_set_palette_tag(*device, "^" _palette_tag); #define MCFG_SNK68_SPR_SET_TILE_INDIRECT( _class, _method) \ snk68_spr_device::set_tile_indirect_cb(*device, snk68_tile_indirection_delegate(&_class::_method, #_class "::" #_method, NULL, (_class *)0)); #define MCFG_SNK68_SPR_NO_PARTIAL \ @@ -19,7 +17,6 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); static void set_tile_indirect_cb(device_t &device,snk68_tile_indirection_delegate newtilecb); static void static_set_no_partial(device_t &device); @@ -38,8 +35,7 @@ protected: virtual void device_reset() override; private: - optional_device<gfxdecode_device> m_gfxdecode; - optional_device<palette_device> m_palette; + required_device<gfxdecode_device> m_gfxdecode; required_shared_ptr<UINT16> m_spriteram; required_device<screen_device> m_screen; int m_flipscreen; diff --git a/src/mame/video/st0020.cpp b/src/mame/video/st0020.cpp index bb0bb01da1b..084d8be208f 100644 --- a/src/mame/video/st0020.cpp +++ b/src/mame/video/st0020.cpp @@ -17,33 +17,12 @@ const device_type ST0020_SPRITES = &device_creator<st0020_device>; st0020_device::st0020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, ST0020_SPRITES, "Seta ST0020 Sprites", tag, owner, clock, "st0020", __FILE__) - , m_gfxdecode(*this) - , m_palette(*this) + , device_gfx_interface(mconfig, *this) { m_is_st0032 = 0; m_is_jclub2 = 0; } -//------------------------------------------------- -// static_set_gfxdecode_tag: Set the tag of the -// gfx decoder -//------------------------------------------------- - -void st0020_device::static_set_gfxdecode_tag(device_t &device, const char *tag) -{ - downcast<st0020_device &>(device).m_gfxdecode.set_tag(tag); -} - -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void st0020_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<st0020_device &>(device).m_palette.set_tag(tag); -} - void st0020_device::set_is_st0032(device_t &device, int is_st0032) { st0020_device &dev = downcast<st0020_device &>(device); @@ -90,13 +69,9 @@ void st0020_device::device_start() m_st0020_spriteram = make_unique_clear<UINT16[]>(0x80000 / 2); m_st0020_blitram = make_unique_clear<UINT16[]>(0x100 / 2); - for (m_gfx_index = 0; m_gfx_index < MAX_GFX_ELEMENTS; m_gfx_index++) - if (m_gfxdecode->gfx(m_gfx_index) == nullptr) - break; - - m_gfxdecode->set_gfx(m_gfx_index, std::make_unique<gfx_element>(m_palette, layout_16x8x8_2, (UINT8 *)m_st0020_gfxram.get(), 0, m_palette->entries() / 64, 0)); + set_gfx(0, std::make_unique<gfx_element>(palette(), layout_16x8x8_2, (UINT8 *)m_st0020_gfxram.get(), 0, palette().entries() / 64, 0)); - m_gfxdecode->gfx(m_gfx_index)->set_granularity(64); /* 256 colour sprites with palette selectable on 64 colour boundaries */ + gfx(0)->set_granularity(64); /* 256 colour sprites with palette selectable on 64 colour boundaries */ save_pointer(NAME(m_st0020_gfxram.get()), 4 * 0x100000/2); save_pointer(NAME(m_st0020_spriteram.get()), 0x80000/2); @@ -128,7 +103,7 @@ WRITE16_MEMBER(st0020_device::st0020_gfxram_w) offset += m_st0020_gfxram_bank * 0x100000/2; COMBINE_DATA(&m_st0020_gfxram[offset]); - m_gfxdecode->gfx(m_gfx_index)->mark_dirty(offset / (16*8/2)); + gfx(0)->mark_dirty(offset / (16*8/2)); } READ16_MEMBER(st0020_device::st0020_sprram_r) @@ -214,7 +189,7 @@ WRITE16_MEMBER(st0020_device::st0020_blit_w) dst /= 16*8; while (len--) { - m_gfxdecode->gfx(m_gfx_index)->mark_dirty(dst); + gfx(0)->mark_dirty(dst); dst++; } } @@ -407,7 +382,7 @@ void st0020_device::st0020_draw_zooming_sprites(bitmap_ind16 &bitmap, const rect { for (y = ystart; y != yend; y += yinc) { - m_gfxdecode->gfx(m_gfx_index)->zoom_transpen(bitmap,cliprect, + gfx(0)->zoom_transpen(bitmap,cliprect, code++, color, flipx, flipy, diff --git a/src/mame/video/st0020.h b/src/mame/video/st0020.h index 33390a8bddc..23049c2b8fb 100644 --- a/src/mame/video/st0020.h +++ b/src/mame/video/st0020.h @@ -3,19 +3,15 @@ -class st0020_device : public device_t +class st0020_device : public device_t, public device_gfx_interface { public: st0020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // static configuration - static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); static void set_is_st0032(device_t &device, int is_st0032); static void set_is_jclub2o(device_t &device, int is_jclub2o); - int m_gfx_index; - // see if we can handle the difference between this and the st0032 in here, or if we need another // device int m_is_st0032; @@ -45,8 +41,6 @@ private: void st0020_draw_zooming_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority); DECLARE_READ16_MEMBER(st0020_blit_r); DECLARE_WRITE16_MEMBER(st0020_blit_w); - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; UINT8* m_rom_ptr; size_t m_rom_size; }; @@ -57,8 +51,5 @@ private: if (m_is_st0032) mem_mask = ((mem_mask & 0x00ff)<<8) | ((mem_mask & 0xff00)>>8); extern const device_type ST0020_SPRITES; -#define MCFG_ST0020_SPRITES_GFXDECODE(_gfxtag) \ - st0020_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); - #define MCFG_ST0020_SPRITES_PALETTE(_palette_tag) \ - st0020_device::static_set_palette_tag(*device, "^" _palette_tag); + MCFG_GFX_PALETTE(_palette_tag) diff --git a/src/mame/video/tc0080vco.cpp b/src/mame/video/tc0080vco.cpp index 0bf5aec9b62..4e0604b9514 100644 --- a/src/mame/video/tc0080vco.cpp +++ b/src/mame/video/tc0080vco.cpp @@ -103,8 +103,7 @@ tc0080vco_device::tc0080vco_device(const machine_config &mconfig, const char *ta m_bg_yoffs(0), m_bg_flip_yoffs(0), m_has_fg0(1), - m_gfxdecode(*this), - m_palette(*this) + m_gfxdecode(*this) { } @@ -119,16 +118,6 @@ void tc0080vco_device::static_set_gfxdecode_tag(device_t &device, const char *ta } //------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void tc0080vco_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<tc0080vco_device &>(device).m_palette.set_tag(tag); -} - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -193,7 +182,7 @@ void tc0080vco_device::device_start() m_scroll_ram = m_ram.get() + 0x20800 / 2; /* create the char set (gfx will then be updated dynamically from RAM) */ - m_gfxdecode->set_gfx(m_txnum, std::make_unique<gfx_element>(m_palette, charlayout, (UINT8 *)m_char_ram, 0, 1, 512)); + m_gfxdecode->set_gfx(m_txnum, std::make_unique<gfx_element>(m_gfxdecode->palette(), charlayout, (UINT8 *)m_char_ram, 0, 1, 512)); save_pointer(NAME(m_ram.get()), TC0080VCO_RAM_SIZE / 2); machine().save().register_postload(save_prepost_delegate(FUNC(tc0080vco_device::postload), this)); diff --git a/src/mame/video/tc0080vco.h b/src/mame/video/tc0080vco.h index c842e3a57b5..65652b011ec 100644 --- a/src/mame/video/tc0080vco.h +++ b/src/mame/video/tc0080vco.h @@ -11,7 +11,6 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); static void set_gfx_region(device_t &device, int gfxnum) { downcast<tc0080vco_device &>(device).m_gfxnum = gfxnum; } static void set_tx_region(device_t &device, int txnum) { downcast<tc0080vco_device &>(device).m_txnum = txnum; } static void set_offsets(device_t &device, int x_offset, int y_offset) @@ -75,7 +74,6 @@ private: int m_has_fg0; // for debug, it can be enabled with set_fg0_debug(true) required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; TILE_GET_INFO_MEMBER(get_bg0_tile_info); TILE_GET_INFO_MEMBER(get_bg1_tile_info); @@ -101,7 +99,4 @@ extern const device_type TC0080VCO; #define MCFG_TC0080VCO_GFXDECODE(_gfxtag) \ tc0080vco_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); -#define MCFG_TC0080VCO_PALETTE(_palette_tag) \ - tc0080vco_device::static_set_palette_tag(*device, "^" _palette_tag); - #endif diff --git a/src/mame/video/tc0480scp.cpp b/src/mame/video/tc0480scp.cpp index 83b0ede8c18..bfd14613a53 100644 --- a/src/mame/video/tc0480scp.cpp +++ b/src/mame/video/tc0480scp.cpp @@ -166,8 +166,7 @@ tc0480scp_device::tc0480scp_device(const machine_config &mconfig, const char *ta m_flip_xoffs(0), m_flip_yoffs(0), m_col_base(0), - m_gfxdecode(*this), - m_palette(*this) + m_gfxdecode(*this) { memset(m_ctrl, 0, sizeof(m_ctrl)); @@ -193,16 +192,6 @@ void tc0480scp_device::static_set_gfxdecode_tag(device_t &device, const char *ta } //------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void tc0480scp_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<tc0480scp_device &>(device).m_palette.set_tag(tag); -} - -//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -297,7 +286,7 @@ void tc0480scp_device::device_start() set_layer_ptrs(); /* create the char set (gfx will then be updated dynamically from RAM) */ - m_gfxdecode->set_gfx(m_txnum, std::make_unique<gfx_element>(m_palette, tc0480scp_charlayout, (UINT8 *)m_char_ram, NATIVE_ENDIAN_VALUE_LE_BE(8,0), 64, m_col_base)); + m_gfxdecode->set_gfx(m_txnum, std::make_unique<gfx_element>(m_gfxdecode->palette(), tc0480scp_charlayout, (UINT8 *)m_char_ram, NATIVE_ENDIAN_VALUE_LE_BE(8,0), 64, m_col_base)); m_gfxdecode->gfx(m_gfxnum)->set_colorbase(m_col_base); save_item(NAME(m_ram)); diff --git a/src/mame/video/tc0480scp.h b/src/mame/video/tc0480scp.h index 12c83523234..1f77d368b45 100644 --- a/src/mame/video/tc0480scp.h +++ b/src/mame/video/tc0480scp.h @@ -11,7 +11,6 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); static void set_gfx_region(device_t &device, int gfxregion) { downcast<tc0480scp_device &>(device).m_gfxnum = gfxregion; } static void set_tx_region(device_t &device, int txregion) { downcast<tc0480scp_device &>(device).m_txnum = txregion; } static void set_col_base(device_t &device, int col) { downcast<tc0480scp_device &>(device).m_col_base = col; } @@ -95,7 +94,6 @@ private: int m_col_base; required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; void common_get_tc0480bg_tile_info( tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum ); void common_get_tc0480tx_tile_info( tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum ); @@ -136,7 +134,4 @@ extern const device_type TC0480SCP; #define MCFG_TC0480SCP_GFXDECODE(_gfxtag) \ tc0480scp_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); -#define MCFG_TC0480SCP_PALETTE(_palette_tag) \ - tc0480scp_device::static_set_palette_tag(*device, "^" _palette_tag); - #endif diff --git a/src/mame/video/vsystem_spr.cpp b/src/mame/video/vsystem_spr.cpp index 7b74e66851c..981dc32cb40 100644 --- a/src/mame/video/vsystem_spr.cpp +++ b/src/mame/video/vsystem_spr.cpp @@ -73,8 +73,7 @@ const device_type VSYSTEM_SPR = &device_creator<vsystem_spr_device>; vsystem_spr_device::vsystem_spr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, VSYSTEM_SPR, "Video System Sprites", tag, owner, clock, "vsystem_spr", __FILE__), - m_gfxdecode(*this), - m_palette(*this) + m_gfxdecode(*this) { m_transpen = 15; m_pal_base = 0; @@ -99,16 +98,6 @@ void vsystem_spr_device::static_set_gfxdecode_tag(device_t &device, const char * downcast<vsystem_spr_device &>(device).m_gfxdecode.set_tag(tag); } -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void vsystem_spr_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<vsystem_spr_device &>(device).m_palette.set_tag(tag); -} - UINT32 vsystem_spr_device::tile_callback_noindirect(UINT32 tile) { return tile; diff --git a/src/mame/video/vsystem_spr.h b/src/mame/video/vsystem_spr.h index 3e8574c9350..1a84e074208 100644 --- a/src/mame/video/vsystem_spr.h +++ b/src/mame/video/vsystem_spr.h @@ -17,8 +17,6 @@ typedef device_delegate<UINT32 (UINT32)> vsystem_tile_indirection_delegate; vsystem_spr_device::CG10103_set_transpen(*device, _transpen); #define MCFG_VSYSTEM_SPR_GFXDECODE(_gfxtag) \ vsystem_spr_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); -#define MCFG_VSYSTEM_SPR_PALETTE(_palette_tag) \ - vsystem_spr_device::static_set_palette_tag(*device, "^" _palette_tag); /*** CG10103 **********************************************/ @@ -29,7 +27,6 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); static void set_offsets(device_t &device, int xoffs, int yoffs); static void set_pdraw(device_t &device, bool pdraw); static void set_tile_indirect_cb(device_t &device,vsystem_tile_indirection_delegate newtilecb); @@ -78,7 +75,6 @@ protected: private: required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; }; diff --git a/src/mame/video/vsystem_spr2.cpp b/src/mame/video/vsystem_spr2.cpp index 68d1b8ff323..b934d27be56 100644 --- a/src/mame/video/vsystem_spr2.cpp +++ b/src/mame/video/vsystem_spr2.cpp @@ -31,8 +31,7 @@ const device_type VSYSTEM_SPR2 = &device_creator<vsystem_spr2_device>; vsystem_spr2_device::vsystem_spr2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, VSYSTEM_SPR2, "Video System Sprites Type 2", tag, owner, clock, "vsystem_spr2", __FILE__), - m_gfxdecode(*this), - m_palette(*this) + m_gfxdecode(*this) { m_newtilecb = vsystem_tile2_indirection_delegate(FUNC(vsystem_spr2_device::tile_callback_noindirect), this); m_pritype = 0; // hack until we have better handling @@ -51,16 +50,6 @@ void vsystem_spr2_device::static_set_gfxdecode_tag(device_t &device, const char downcast<vsystem_spr2_device &>(device).m_gfxdecode.set_tag(tag); } -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- - -void vsystem_spr2_device::static_set_palette_tag(device_t &device, const char *tag) -{ - downcast<vsystem_spr2_device &>(device).m_palette.set_tag(tag); -} - void vsystem_spr2_device::set_tile_indirect_cb(device_t &device,vsystem_tile2_indirection_delegate newtilecb) { diff --git a/src/mame/video/vsystem_spr2.h b/src/mame/video/vsystem_spr2.h index 967d6dc69bb..1ffdb41a537 100644 --- a/src/mame/video/vsystem_spr2.h +++ b/src/mame/video/vsystem_spr2.h @@ -14,8 +14,6 @@ typedef device_delegate<UINT32 (UINT32)> vsystem_tile2_indirection_delegate; vsystem_spr2_device::set_offsets(*device, _xoffs,_yoffs); #define MCFG_VSYSTEM_SPR2_GFXDECODE(_gfxtag) \ vsystem_spr2_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); -#define MCFG_VSYSTEM_SPR2_PALETTE(_palette_tag) \ - vsystem_spr2_device::static_set_palette_tag(*device, "^" _palette_tag); class vsystem_spr2_device : public device_t { @@ -24,7 +22,6 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); static void set_tile_indirect_cb(device_t &device,vsystem_tile2_indirection_delegate newtilecb); static void set_pritype(device_t &device, int pritype); static void set_gfx_region(device_t &device, int gfx_region); @@ -68,7 +65,6 @@ protected: private: required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; }; diff --git a/src/mame/video/ygv608.cpp b/src/mame/video/ygv608.cpp index 1b70da162ee..bbdf3212220 100644 --- a/src/mame/video/ygv608.cpp +++ b/src/mame/video/ygv608.cpp @@ -49,28 +49,111 @@ #define GFX_16X16_8BIT 5 -const device_type YGV608 = &device_creator<ygv608_device>; +/* text-layer characters */ -ygv608_device::ygv608_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) - : device_t(mconfig, YGV608, "YGV608 VDP", tag, owner, clock, "ygv608", __FILE__), - m_gfxdecode(*this), - m_palette(*this) +static const UINT32 pts_4bits_layout_xoffset[64] = { -} + STEP8( 0*256, 4 ), STEP8( 1*256, 4 ), STEP8( 4*256, 4 ), STEP8( 5*256, 4 ), + STEP8( 16*256, 4 ), STEP8( 17*256, 4 ), STEP8( 20*256, 4 ), STEP8( 21*256, 4 ) +}; -void ygv608_device::static_set_gfxdecode_tag(device_t &device, const char *tag) +static const UINT32 pts_4bits_layout_yoffset[64] = { - downcast<ygv608_device &>(device).m_gfxdecode.set_tag(tag); -} + STEP8( 0*256, 8*4 ), STEP8( 2*256, 8*4 ), STEP8( 8*256, 8*4 ), STEP8( 10*256, 8*4 ), + STEP8( 32*256, 8*4 ), STEP8( 34*256, 8*4 ), STEP8( 40*256, 8*4 ), STEP8( 42*256, 8*4 ) +}; + +static const gfx_layout pts_8x8_4bits_layout = +{ + 8,8, /* 8*8 pixels */ + RGN_FRAC(1,1), /* 65536 patterns */ + 4, /* 4 bits per pixel */ + { 0, 1, 2, 3 }, + EXTENDED_XOFFS, + EXTENDED_YOFFS, + 8*8*4, + pts_4bits_layout_xoffset, + pts_4bits_layout_yoffset +}; + +static const gfx_layout pts_16x16_4bits_layout = +{ + 16,16, /* 16*16 pixels */ + RGN_FRAC(1,1), /* 16384 patterns */ + 4, /* 4 bits per pixel */ + { 0, 1, 2, 3 }, + EXTENDED_XOFFS, + EXTENDED_YOFFS, + 16*16*4, + pts_4bits_layout_xoffset, + pts_4bits_layout_yoffset +}; + +static const gfx_layout pts_32x32_4bits_layout = +{ + 32,32, /* 32*32 pixels */ + RGN_FRAC(1,1), /* 4096 patterns */ + 4, /* 4 bits per pixel */ + { 0, 1, 2, 3 }, + EXTENDED_XOFFS, + EXTENDED_YOFFS, + 32*32*4, + pts_4bits_layout_xoffset, + pts_4bits_layout_yoffset +}; -//------------------------------------------------- -// static_set_palette_tag: Set the tag of the -// palette device -//------------------------------------------------- +static const gfx_layout pts_64x64_4bits_layout = +{ + 64,64, /* 32*32 pixels */ + RGN_FRAC(1,1), /* 1024 patterns */ + 4, /* 4 bits per pixel */ + { 0, 1, 2, 3 }, + EXTENDED_XOFFS, + EXTENDED_YOFFS, + 64*64*4, + pts_4bits_layout_xoffset, + pts_4bits_layout_yoffset +}; + + +static const gfx_layout pts_8x8_8bits_layout = +{ + 8,8, /* 8*8 pixels */ + RGN_FRAC(1,1), /* 32768 patterns */ + 8, /* 8 bits per pixel */ + { 0, 1, 2, 3, 4, 5, 6, 7 }, + { STEP8( 0*512, 8 ) }, + { STEP8( 0*512, 8*8 ) }, + 8*8*8 +}; + +static const gfx_layout pts_16x16_8bits_layout = +{ + 16,16, /* 16*16 pixels */ + RGN_FRAC(1,1), /* 8192 patterns */ + 8, /* 8 bits per pixel */ + { 0, 1, 2, 3, 4, 5, 6, 7 }, + { STEP8( 0*512, 8 ), STEP8( 1*512, 8 ) }, + { STEP8( 0*512, 8*8 ), STEP8( 2*512, 8*8 ) }, + 16*16*8 +}; + +static GFXDECODE_START( ygv608 ) + GFXDECODE_DEVICE( DEVICE_SELF, 0x00000000, pts_8x8_4bits_layout, 0, 16 ) + GFXDECODE_DEVICE( DEVICE_SELF, 0x00000000, pts_16x16_4bits_layout, 0, 16 ) + GFXDECODE_DEVICE( DEVICE_SELF, 0x00000000, pts_32x32_4bits_layout, 0, 16 ) + GFXDECODE_DEVICE( DEVICE_SELF, 0x00000000, pts_64x64_4bits_layout, 0, 16 ) + GFXDECODE_DEVICE( DEVICE_SELF, 0x00000000, pts_8x8_8bits_layout, 0, 256 ) + GFXDECODE_DEVICE( DEVICE_SELF, 0x00000000, pts_16x16_8bits_layout, 0, 256 ) +GFXDECODE_END + + +const device_type YGV608 = &device_creator<ygv608_device>; -void ygv608_device::static_set_palette_tag(device_t &device, const char *tag) +ygv608_device::ygv608_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) + : device_t(mconfig, YGV608, "YGV608 VDP", tag, owner, clock, "ygv608", __FILE__), + device_gfx_interface(mconfig, *this, GFXDECODE_NAME(ygv608)) { - downcast<ygv608_device &>(device).m_palette.set_tag(tag); } void ygv608_device::set_gfxbank(UINT8 gfxbank) @@ -120,7 +203,7 @@ TILEMAP_MAPPER_MEMBER( ygv608_device::get_tile_offset ) } #define layout_total(x) \ -(m_gfxdecode->gfx(x)->elements()) +(gfx(x)->elements()) TILE_GET_INFO_MEMBER( ygv608_device::get_tile_info_A_8 ) { @@ -516,9 +599,6 @@ void ygv608_device::register_state_save() void ygv608_device::device_start() { - if(!m_gfxdecode->started()) - throw device_missing_dependencies(); - memset(&m_ports, 0, sizeof(m_ports)); memset(&m_regs, 0, sizeof(m_regs)); memset(&m_pattern_name_table, 0, sizeof(m_pattern_name_table)); @@ -546,21 +626,21 @@ void ygv608_device::device_start() save_item(NAME(m_namcond1_gfxbank)); /* create tilemaps of all sizes and combinations */ - m_tilemap_A_cache_8[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_A_8),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 8,8, 32,32); - m_tilemap_A_cache_8[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_A_8),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 8,8, 64,32); - m_tilemap_A_cache_8[2] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_A_8),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 8,8, 32,64); + m_tilemap_A_cache_8[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_A_8),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 8,8, 32,32); + m_tilemap_A_cache_8[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_A_8),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 8,8, 64,32); + m_tilemap_A_cache_8[2] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_A_8),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 8,8, 32,64); - m_tilemap_A_cache_16[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_A_16),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 16,16, 32,32); - m_tilemap_A_cache_16[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_A_16),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 16,16, 64,32); - m_tilemap_A_cache_16[2] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_A_16),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 16,16, 32,64); + m_tilemap_A_cache_16[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_A_16),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 16,16, 32,32); + m_tilemap_A_cache_16[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_A_16),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 16,16, 64,32); + m_tilemap_A_cache_16[2] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_A_16),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 16,16, 32,64); - m_tilemap_B_cache_8[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_B_8),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 8,8, 32,32); - m_tilemap_B_cache_8[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_B_8),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 8,8, 64,32); - m_tilemap_B_cache_8[2] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_B_8),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 8,8, 32,64); + m_tilemap_B_cache_8[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_B_8),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 8,8, 32,32); + m_tilemap_B_cache_8[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_B_8),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 8,8, 64,32); + m_tilemap_B_cache_8[2] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_B_8),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 8,8, 32,64); - m_tilemap_B_cache_16[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_B_16),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 16,16, 32,32); - m_tilemap_B_cache_16[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_B_16),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 16,16, 64,32); - m_tilemap_B_cache_16[2] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_B_16),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 16,16, 32,64); + m_tilemap_B_cache_16[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_B_16),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 16,16, 32,32); + m_tilemap_B_cache_16[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_B_16),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 16,16, 64,32); + m_tilemap_B_cache_16[2] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(ygv608_device::get_tile_info_B_16),this), tilemap_mapper_delegate(FUNC(ygv608_device::get_tile_offset),this), 16,16, 32,64); m_tilemap_A = nullptr; m_tilemap_B = nullptr; @@ -620,20 +700,20 @@ void ygv608_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect logerror( "SZ_8X8: sprite=%d\n", code ); code = 0; } - m_gfxdecode->gfx(GFX_8X8_4BIT)->transpen(bitmap,spriteClip, + gfx(GFX_8X8_4BIT)->transpen(bitmap,spriteClip, code+m_namcond1_gfxbank*0x10000, color, flipx,flipy, sx,sy,0x00); // redraw with wrap-around if( sx > 512-8 ) - m_gfxdecode->gfx(GFX_8X8_4BIT)->transpen(bitmap,spriteClip, + gfx(GFX_8X8_4BIT)->transpen(bitmap,spriteClip, code+m_namcond1_gfxbank*0x10000, color, flipx,flipy, sx-512,sy,0x00); if( sy > 512-8 ) - m_gfxdecode->gfx(GFX_8X8_4BIT)->transpen(bitmap,spriteClip, + gfx(GFX_8X8_4BIT)->transpen(bitmap,spriteClip, code+m_namcond1_gfxbank*0x10000, color, flipx,flipy, @@ -650,20 +730,20 @@ void ygv608_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect logerror( "SZ_8X8: sprite=%d\n", code ); code = 0; } - m_gfxdecode->gfx(GFX_16X16_4BIT)->transpen(bitmap,spriteClip, + gfx(GFX_16X16_4BIT)->transpen(bitmap,spriteClip, code+m_namcond1_gfxbank*0x4000, color, flipx,flipy, sx,sy,0x00); // redraw with wrap-around if( sx > 512-16 ) - m_gfxdecode->gfx(GFX_16X16_4BIT)->transpen(bitmap,spriteClip, + gfx(GFX_16X16_4BIT)->transpen(bitmap,spriteClip, code+m_namcond1_gfxbank*0x4000, color, flipx,flipy, sx-512,sy,0x00); if( sy > 512-16 ) - m_gfxdecode->gfx(GFX_16X16_4BIT)->transpen(bitmap,spriteClip, + gfx(GFX_16X16_4BIT)->transpen(bitmap,spriteClip, code+m_namcond1_gfxbank*0x4000, color, flipx,flipy, @@ -680,20 +760,20 @@ void ygv608_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect logerror( "SZ_32X32: sprite=%d\n", code ); code = 0; } - m_gfxdecode->gfx(GFX_32X32_4BIT)->transpen(bitmap,spriteClip, + gfx(GFX_32X32_4BIT)->transpen(bitmap,spriteClip, code+m_namcond1_gfxbank*0x1000, color, flipx,flipy, sx,sy,0x00); // redraw with wrap-around if( sx > 512-32 ) - m_gfxdecode->gfx(GFX_32X32_4BIT)->transpen(bitmap,spriteClip, + gfx(GFX_32X32_4BIT)->transpen(bitmap,spriteClip, code+m_namcond1_gfxbank*0x1000, color, flipx,flipy, sx-512,sy,0x00); if( sy > 512-32 ) - m_gfxdecode->gfx(GFX_32X32_4BIT)->transpen(bitmap,spriteClip, + gfx(GFX_32X32_4BIT)->transpen(bitmap,spriteClip, code+m_namcond1_gfxbank*0x1000, color, flipx,flipy, @@ -710,20 +790,20 @@ void ygv608_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect logerror( "SZ_64X64: sprite=%d\n", code ); code = 0; } - m_gfxdecode->gfx(GFX_64X64_4BIT)->transpen(bitmap,spriteClip, + gfx(GFX_64X64_4BIT)->transpen(bitmap,spriteClip, code+m_namcond1_gfxbank*0x400, color, flipx,flipy, sx,sy,0x00); // redraw with wrap-around if( sx > 512-64 ) - m_gfxdecode->gfx(GFX_64X64_4BIT)->transpen(bitmap,spriteClip, + gfx(GFX_64X64_4BIT)->transpen(bitmap,spriteClip, code+m_namcond1_gfxbank*0x400, color, flipx,flipy, sx-512,sy,0x00); if( sy > 512-64 ) - m_gfxdecode->gfx(GFX_64X64_4BIT)->transpen(bitmap,spriteClip, + gfx(GFX_64X64_4BIT)->transpen(bitmap,spriteClip, code+m_namcond1_gfxbank*0x400, color, flipx,flipy, @@ -1228,7 +1308,7 @@ WRITE16_MEMBER( ygv608_device::write ) if (++p3_state == 3) { p3_state = 0; - m_palette->set_pen_color(m_regs.s.cc, + palette().set_pen_color(m_regs.s.cc, pal6bit(m_colour_palette[m_regs.s.cc][0]), pal6bit(m_colour_palette[m_regs.s.cc][1]), pal6bit(m_colour_palette[m_regs.s.cc][2]) ); diff --git a/src/mame/video/ygv608.h b/src/mame/video/ygv608.h index b4360a4e5e4..3e6f5c54f09 100644 --- a/src/mame/video/ygv608.h +++ b/src/mame/video/ygv608.h @@ -282,16 +282,12 @@ struct SPRITE_ATTR { UINT8 sn; // pattern name (0-255) }; -class ygv608_device : public device_t +class ygv608_device : public device_t, public device_gfx_interface { public: // construction/destruction ygv608_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - // static configuration - static void static_set_gfxdecode_tag(device_t &device, const char *tag); - static void static_set_palette_tag(device_t &device, const char *tag); - DECLARE_WRITE16_MEMBER( write ); DECLARE_READ16_MEMBER( read ); @@ -376,8 +372,6 @@ private: UINT8 m_screen_resize; // screen requires resize UINT8 m_tilemap_resize; // tilemap requires resize - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; }; // device type definition @@ -391,10 +385,7 @@ extern const device_type YGV608; #define MCFG_YGV608_ADD(_tag) \ MCFG_DEVICE_ADD(_tag, YGV608, 0) -#define MCFG_YGV608_GFXDECODE(_gfxtag) \ - ygv608_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); - #define MCFG_YGV608_PALETTE(_palette_tag) \ - ygv608_device::static_set_palette_tag(*device, "^" _palette_tag); + MCFG_GFX_PALETTE(_palette_tag) #endif diff --git a/src/osd/modules/font/font_dwrite.cpp b/src/osd/modules/font/font_dwrite.cpp index ea8e9446e27..e3dfbfdbd85 100644 --- a/src/osd/modules/font/font_dwrite.cpp +++ b/src/osd/modules/font/font_dwrite.cpp @@ -31,7 +31,7 @@ DEFINE_GUID(CLSID_WICImagingFactory, 0xcacaf262, 0x9370, 0x4615, 0xa1, 0x3b, 0x9f, 0x55, 0x39, 0xda, 0x4c, 0xa); DEFINE_GUID(GUID_WICPixelFormat8bppAlpha, 0xe6cd0116, 0xeeba, 0x4161, 0xaa, 0x85, 0x27, 0xdd, 0x9f, 0xb3, 0xa8, 0x95); -#include <wrl\client.h> +#include <wrl/client.h> #undef interface #include "strconv.h" diff --git a/src/osd/modules/input/input_common.h b/src/osd/modules/input/input_common.h index 7ea001dad4f..41a9d762838 100644 --- a/src/osd/modules/input/input_common.h +++ b/src/osd/modules/input/input_common.h @@ -352,19 +352,35 @@ public: // allocate the device object auto devinfo = std::make_unique<TActual>(machine, name, module); - // Add the device to the machine - devinfo->m_device = machine.input().device_class(devinfo->deviceclass()).add_device(devinfo->name(), devinfo.get()); + return add_device_internal(machine, name, module, std::move(devinfo)); + } - // append us to the list - m_list.push_back(std::move(devinfo)); + template <typename TActual, typename TArg> + TActual* create_device1(running_machine &machine, const char *name, input_module &module, TArg arg1) + { + // allocate the device object + auto devinfo = std::make_unique<TActual>(machine, name, module, arg1); - return (TActual*)m_list.back().get(); + return add_device_internal(machine, name, module, std::move(devinfo)); } template <class TActual> TActual* at(int index) { - return (TActual*)m_list.at(index).get(); + return static_cast<TActual*>(m_list.at(index).get()); + } + +private: + template <typename TActual> + TActual* add_device_internal(running_machine &machine, const char *name, input_module &module, std::unique_ptr<TActual> allocated) + { + // Add the device to the machine + allocated->m_device = machine.input().device_class(allocated->deviceclass()).add_device(allocated->name(), allocated.get()); + + // append us to the list + m_list.push_back(std::move(allocated)); + + return static_cast<TActual*>(m_list.back().get()); } }; diff --git a/src/osd/modules/input/input_dinput.cpp b/src/osd/modules/input/input_dinput.cpp index 1e4272e6317..ca3bad08026 100644 --- a/src/osd/modules/input/input_dinput.cpp +++ b/src/osd/modules/input/input_dinput.cpp @@ -14,6 +14,7 @@ // standard windows headers #define WIN32_LEAN_AND_MEAN #include <windows.h> +#include <initguid.h> #include <tchar.h> #include <wrl/client.h> @@ -31,17 +32,15 @@ #include "strconv.h" // MAMEOS headers -#include "winmain.h" #include "window.h" #include "winutil.h" #include "input_common.h" #include "input_windows.h" +#include "input_dinput.h" using namespace Microsoft::WRL; -#define STRUCTSIZE(x) (m_dinput_version == 0x0300) ? sizeof(x##_DX3) : sizeof(x) - static INT32 dinput_joystick_pov_get_state(void *device_internal, void *item_internal); //============================================================ @@ -58,255 +57,184 @@ static HRESULT dinput_set_dword_property(ComPtr<IDirectInputDevice> device, REFG dipdw.diph.dwHow = how; dipdw.dwData = value; - return IDirectInputDevice_SetProperty(device.Get(), property_guid, &dipdw.diph); + return device->SetProperty(property_guid, &dipdw.diph); } //============================================================ // dinput_device - base directinput device //============================================================ -// DirectInput-specific information about a device -struct dinput_api_state +dinput_device::dinput_device(running_machine &machine, const char *name, input_device_class deviceclass, input_module &module) + : device_info(machine, name, deviceclass, module), + dinput({nullptr}) { - ComPtr<IDirectInputDevice> device; - ComPtr<IDirectInputDevice2> device2; - DIDEVCAPS caps; - LPCDIDATAFORMAT format; -}; +} -class dinput_device : public device_info +dinput_device::~dinput_device() { -public: - dinput_api_state dinput; + if (dinput.device != nullptr) + dinput.device.Reset(); +} - dinput_device(running_machine &machine, const char *name, input_device_class deviceclass, input_module &module) - : device_info(machine, name, deviceclass, module), - dinput({nullptr}) - { - } +HRESULT dinput_device::poll_dinput(LPVOID pState) const +{ + HRESULT result; - virtual ~dinput_device() - { - if (dinput.device2 != nullptr) - dinput.device2.Reset(); + // first poll the device, then get the state + if (dinput.device2 != nullptr) + dinput.device2->Poll(); - if (dinput.device != nullptr) - dinput.device.Reset(); - } + // GetDeviceState returns the immediate state + result = dinput.device->GetDeviceState(dinput.format->dwDataSize, pState); -protected: - HRESULT poll_dinput(LPVOID pState) const + // handle lost inputs here + if (result == DIERR_INPUTLOST || result == DIERR_NOTACQUIRED) { - HRESULT result; - - // first poll the device, then get the state - if (dinput.device2 != nullptr) - IDirectInputDevice2_Poll(dinput.device2.Get()); - - // GetDeviceState returns the immediate state - result = IDirectInputDevice_GetDeviceState(dinput.device.Get(), dinput.format->dwDataSize, pState); - - // handle lost inputs here - if (result == DIERR_INPUTLOST || result == DIERR_NOTACQUIRED) - { - result = IDirectInputDevice_Acquire(dinput.device.Get()); - if (result == DI_OK) - result = IDirectInputDevice_GetDeviceState(dinput.device.Get(), dinput.format->dwDataSize, pState); - } - - return result; + result = dinput.device->Acquire(); + if (result == DI_OK) + result = dinput.device->GetDeviceState(dinput.format->dwDataSize, pState); } -}; + + return result; +} //============================================================ // dinput_keyboard_device - directinput keyboard device //============================================================ -class dinput_keyboard_device : public dinput_device +dinput_keyboard_device::dinput_keyboard_device(running_machine &machine, const char *name, input_module &module) + : dinput_device(machine, name, DEVICE_CLASS_KEYBOARD, module), + keyboard({{0}}) { -private: - std::mutex m_device_lock; - -public: - keyboard_state keyboard; - - dinput_keyboard_device(running_machine &machine, const char *name, input_module &module) - : dinput_device(machine, name, DEVICE_CLASS_KEYBOARD, module), - keyboard({{0}}) - { - } +} - // Polls the direct input immediate state - void poll() override - { - std::lock_guard<std::mutex> scope_lock(m_device_lock); +// Polls the direct input immediate state +void dinput_keyboard_device::poll() +{ + std::lock_guard<std::mutex> scope_lock(m_device_lock); - // Poll the state - dinput_device::poll_dinput(&keyboard.state); - } + // Poll the state + dinput_device::poll_dinput(&keyboard.state); +} - void reset() override - { - memset(&keyboard.state, 0, sizeof(keyboard.state)); - } -}; +void dinput_keyboard_device::reset() +{ + memset(&keyboard.state, 0, sizeof(keyboard.state)); +} //============================================================ -// dinput_module - base directinput module +// dinput_api_helper - DirectInput API helper //============================================================ -class dinput_module : public wininput_module +dinput_api_helper::dinput_api_helper(int version) + : m_dinput(nullptr), + m_dinput_version(version), + m_pfn_DirectInputCreate("DirectInputCreateW", L"dinput.dll") { -private: - ComPtr<IDirectInput> m_dinput; - int m_dinput_version; +} -public: - dinput_module(const char* type, const char* name) - : wininput_module(type, name), - m_dinput(nullptr), - m_dinput_version(0) - { - } +dinput_api_helper::~dinput_api_helper() +{ + m_dinput.Reset(); +} - int init_internal() override - { - HRESULT result; +int dinput_api_helper::initialize() +{ + HRESULT result; -#if DIRECTINPUT_VERSION >= 0x800 - m_dinput_version = DIRECTINPUT_VERSION; + if (m_dinput_version >= 0x0800) + { result = DirectInput8Create(GetModuleHandleUni(), m_dinput_version, IID_IDirectInput8, reinterpret_cast<void **>(m_dinput.GetAddressOf()), nullptr); if (result != DI_OK) { m_dinput_version = 0; return result; } -#else - // first attempt to initialize DirectInput at the current version - m_dinput_version = DIRECTINPUT_VERSION; - result = DirectInputCreate(GetModuleHandleUni(), m_dinput_version, m_dinput.GetAddressOf(), nullptr); + } + else + { + result = m_pfn_DirectInputCreate.initialize(); + if (result != DI_OK) + return result; + + // first attempt to initialize DirectInput at v7 + m_dinput_version = 0x0700; + result = m_pfn_DirectInputCreate(GetModuleHandleUni(), m_dinput_version, m_dinput.GetAddressOf(), nullptr); if (result != DI_OK) { // if that fails, try version 5 m_dinput_version = 0x0500; - result = DirectInputCreate(GetModuleHandleUni(), m_dinput_version, m_dinput.GetAddressOf(), nullptr); + result = m_pfn_DirectInputCreate(GetModuleHandleUni(), m_dinput_version, m_dinput.GetAddressOf(), nullptr); if (result != DI_OK) { - // if that fails, try version 3 - m_dinput_version = 0x0300; - result = DirectInputCreate(GetModuleHandleUni(), m_dinput_version, m_dinput.GetAddressOf(), nullptr); - if (result != DI_OK) - { - m_dinput_version = 0; - return result; - } + m_dinput_version = 0; + return result; } } -#endif - - osd_printf_verbose("DirectInput: Using DirectInput %d\n", m_dinput_version >> 8); - return 0; } - void exit() override - { - m_dinput.Reset(); - wininput_module::exit(); - } + osd_printf_verbose("DirectInput: Using DirectInput %d\n", m_dinput_version >> 8); + return 0; +} - virtual BOOL device_enum_callback(LPCDIDEVICEINSTANCE instance, LPVOID ref) = 0; - struct dinput_callback_context - { - dinput_module * self; - running_machine * machine; - }; +HRESULT dinput_api_helper::enum_attached_devices(int devclass, device_enum_interface *enumerate_interface, void *state) const +{ + device_enum_interface::dinput_callback_context ctx; + ctx.self = enumerate_interface; + ctx.state = state; - static BOOL CALLBACK enum_callback(LPCDIDEVICEINSTANCE instance, LPVOID ref) - { - auto context = static_cast<dinput_callback_context*>(ref); - return context->self->device_enum_callback(instance, context->machine); - } + return m_dinput->EnumDevices(devclass, device_enum_interface::enum_callback, &ctx, DIEDFL_ATTACHEDONLY); +} - void input_init(running_machine &machine) override - { - dinput_callback_context context = { this, &machine }; - HRESULT result = IDirectInput_EnumDevices(m_dinput.Get(), dinput_devclass(), enum_callback, &context, DIEDFL_ATTACHEDONLY); - if (result != DI_OK) - fatalerror("DirectInput: Unable to enumerate keyboards (result=%08X)\n", static_cast<UINT32>(result)); - } +//============================================================ +// dinput_module - base directinput module +//============================================================ +class dinput_module : public wininput_module, public device_enum_interface +{ protected: - virtual int dinput_devclass() = 0; + std::unique_ptr<dinput_api_helper> m_dinput_helper; - template <class TDevice> - TDevice* create_dinput_device( - running_machine &machine, - LPCDIDEVICEINSTANCE instance, - LPCDIDATAFORMAT format1, - LPCDIDATAFORMAT format2, - DWORD cooperative_level) +public: + dinput_module(const char* type, const char* name) + : wininput_module(type, name), + m_dinput_helper(nullptr) { - HRESULT result; - - // convert instance name to utf8 - auto osd_deleter = [](void *ptr) { osd_free(ptr); }; - auto utf8_instance_name = std::unique_ptr<char, decltype(osd_deleter)>(utf8_from_tstring(instance->tszInstanceName), osd_deleter); - - // allocate memory for the device object - TDevice* devinfo = devicelist()->create_device<TDevice>(machine, utf8_instance_name.get(), *this); - - // attempt to create a device - result = IDirectInput_CreateDevice(m_dinput.Get(), WRAP_REFIID(instance->guidInstance), devinfo->dinput.device.GetAddressOf(), NULL); - if (result != DI_OK) - goto error; + } - // try to get a version 2 device for it - result = IDirectInputDevice_QueryInterface(devinfo->dinput.device.Get(), WRAP_REFIID(IID_IDirectInputDevice2), reinterpret_cast<void **>(devinfo->dinput.device2.GetAddressOf())); - if (result != DI_OK) - devinfo->dinput.device2 = nullptr; + int init_internal() override + { + m_dinput_helper = std::make_unique<dinput_api_helper>(DIRECTINPUT_VERSION); + int result = m_dinput_helper->initialize(); + if (result != 0) + return result; - // get the caps - devinfo->dinput.caps.dwSize = STRUCTSIZE(DIDEVCAPS); - result = IDirectInputDevice_GetCapabilities(devinfo->dinput.device.Get(), &devinfo->dinput.caps); - if (result != DI_OK) - goto error; + return 0; + } - // attempt to set the data format - devinfo->dinput.format = format1; - result = IDirectInputDevice_SetDataFormat(devinfo->dinput.device.Get(), devinfo->dinput.format); - if (result != DI_OK) - { - // use the secondary format if available - if (format2 != nullptr) - { - devinfo->dinput.format = format2; - result = IDirectInputDevice_SetDataFormat(devinfo->dinput.device.Get(), devinfo->dinput.format); - } - if (result != DI_OK) - goto error; - } + void exit() override + { + wininput_module::exit(); + m_dinput_helper.reset(); + } - // set the cooperative level - result = IDirectInputDevice_SetCooperativeLevel(devinfo->dinput.device.Get(), win_window_list->m_hwnd, cooperative_level); + void input_init(running_machine &machine) override + { + HRESULT result = m_dinput_helper->enum_attached_devices(dinput_devclass(), this, &machine); if (result != DI_OK) - goto error; - return devinfo; - - error: - devicelist()->free_device(devinfo); - return nullptr; + fatalerror("DirectInput: Unable to enumerate keyboards (result=%08X)\n", static_cast<UINT32>(result)); } - std::string device_item_name(dinput_device * devinfo, int offset, const char * defstring, const TCHAR * suffix) const + static std::string device_item_name(dinput_device * devinfo, int offset, const char * defstring, const TCHAR * suffix) { DIDEVICEOBJECTINSTANCE instance = { 0 }; HRESULT result; // query the key name - instance.dwSize = STRUCTSIZE(DIDEVICEOBJECTINSTANCE); - result = IDirectInputDevice_GetObjectInfo(devinfo->dinput.device.Get(), &instance, offset, DIPH_BYOFFSET); + instance.dwSize = sizeof(instance); + result = devinfo->dinput.device->GetObjectInfo(&instance, offset, DIPH_BYOFFSET); // if we got an error and have no default string, just return NULL if (result != DI_OK) @@ -342,6 +270,9 @@ protected: return std::string(combined.get()); } + +protected: + virtual int dinput_devclass() = 0; }; class keyboard_input_dinput : public dinput_module @@ -368,7 +299,7 @@ public: int keynum; // allocate and link in a new device - devinfo = create_dinput_device<dinput_keyboard_device>(machine, instance, &c_dfDIKeyboard, nullptr, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE); + devinfo = m_dinput_helper->create_device<dinput_keyboard_device>(machine, *this, instance, &c_dfDIKeyboard, nullptr, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE); if (devinfo == nullptr) goto exit; @@ -392,33 +323,28 @@ public: } }; -class dinput_mouse_device : public dinput_device -{ -public: - mouse_state mouse; - dinput_mouse_device(running_machine &machine, const char *name, input_module &module) - : dinput_device(machine, name, DEVICE_CLASS_MOUSE, module), - mouse({0}) - { - } +dinput_mouse_device::dinput_mouse_device(running_machine &machine, const char *name, input_module &module) + : dinput_device(machine, name, DEVICE_CLASS_MOUSE, module), + mouse({0}) +{ +} - void poll() override - { - // poll - dinput_device::poll_dinput(&mouse); +void dinput_mouse_device::poll() +{ + // poll + dinput_device::poll_dinput(&mouse); - // scale the axis data - mouse.lX *= INPUT_RELATIVE_PER_PIXEL; - mouse.lY *= INPUT_RELATIVE_PER_PIXEL; - mouse.lZ *= INPUT_RELATIVE_PER_PIXEL; - } + // scale the axis data + mouse.lX *= INPUT_RELATIVE_PER_PIXEL; + mouse.lY *= INPUT_RELATIVE_PER_PIXEL; + mouse.lZ *= INPUT_RELATIVE_PER_PIXEL; +} - void reset() override - { - memset(&mouse, 0, sizeof(mouse)); - } -}; +void dinput_mouse_device::reset() +{ + memset(&mouse, 0, sizeof(mouse)); +} class mouse_input_dinput : public dinput_module { @@ -445,7 +371,7 @@ public: HRESULT result; // allocate and link in a new device - devinfo = create_dinput_device<dinput_mouse_device>(machine, instance, &c_dfDIMouse2, &c_dfDIMouse, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE); + devinfo = m_dinput_helper->create_device<dinput_mouse_device>(machine, *this, instance, &c_dfDIMouse2, &c_dfDIMouse, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE); if (devinfo == nullptr) goto exit; @@ -489,46 +415,130 @@ public: } }; -// state information for a joystick; DirectInput state must be first element -struct dinput_joystick_state +dinput_joystick_device::dinput_joystick_device(running_machine &machine, const char *name, input_module &module) + : dinput_device(machine, name, DEVICE_CLASS_JOYSTICK, module), + joystick({{0}}) { - DIJOYSTATE state; - LONG rangemin[8]; - LONG rangemax[8]; -}; +} -class dinput_joystick_device : public dinput_device +void dinput_joystick_device::reset() { -public: - dinput_joystick_state joystick; + memset(&joystick.state, 0, sizeof(joystick.state)); +} + +void dinput_joystick_device::poll() +{ + int axisnum; + + // poll the device first + if (dinput_device::poll_dinput(&joystick.state) != ERROR_SUCCESS) + return; + + // normalize axis values + for (axisnum = 0; axisnum < 8; axisnum++) + { + LONG *axis = (&joystick.state.lX) + axisnum; + *axis = normalize_absolute_axis(*axis, joystick.rangemin[axisnum], joystick.rangemax[axisnum]); + } +} + +int dinput_joystick_device::configure() +{ + HRESULT result; + UINT32 axisnum, axiscount; + + auto devicelist = static_cast<input_module_base&>(module()).devicelist(); + + // temporary approximation of index + int devindex = devicelist->size(); + + // set absolute mode + result = dinput_set_dword_property(dinput.device, DIPROP_AXISMODE, 0, DIPH_DEVICE, DIPROPAXISMODE_ABS); + if (result != DI_OK && result != DI_PROPNOEFFECT) + osd_printf_warning("DirectInput: Unable to set absolute mode for joystick %d (%s)\n", devindex, name()); + + // turn off deadzone; we do our own calculations + result = dinput_set_dword_property(dinput.device, DIPROP_DEADZONE, 0, DIPH_DEVICE, 0); + if (result != DI_OK && result != DI_PROPNOEFFECT) + osd_printf_warning("DirectInput: Unable to reset deadzone for joystick %d (%s)\n", devindex, name()); - dinput_joystick_device(running_machine &machine, const char *name, input_module &module) - : dinput_device(machine, name, DEVICE_CLASS_JOYSTICK, module), - joystick({{0}}) + // turn off saturation; we do our own calculations + result = dinput_set_dword_property(dinput.device, DIPROP_SATURATION, 0, DIPH_DEVICE, 10000); + if (result != DI_OK && result != DI_PROPNOEFFECT) + osd_printf_warning("DirectInput: Unable to reset saturation for joystick %d (%s)\n", devindex, name()); + + // cap the number of axes, POVs, and buttons based on the format + dinput.caps.dwAxes = MIN(dinput.caps.dwAxes, 8); + dinput.caps.dwPOVs = MIN(dinput.caps.dwPOVs, 4); + dinput.caps.dwButtons = MIN(dinput.caps.dwButtons, 128); + + // populate the axes + for (axisnum = axiscount = 0; axiscount < dinput.caps.dwAxes && axisnum < 8; axisnum++) { + DIPROPRANGE dipr; + std::string name; + + // fetch the range of this axis + dipr.diph.dwSize = sizeof(dipr); + dipr.diph.dwHeaderSize = sizeof(dipr.diph); + dipr.diph.dwObj = offsetof(DIJOYSTATE2, lX) + axisnum * sizeof(LONG); + dipr.diph.dwHow = DIPH_BYOFFSET; + result = dinput.device->GetProperty(DIPROP_RANGE, &dipr.diph); + if (result != DI_OK) + continue; + + joystick.rangemin[axisnum] = dipr.lMin; + joystick.rangemax[axisnum] = dipr.lMax; + + // populate the item description as well + name = dinput_module::device_item_name(this, offsetof(DIJOYSTATE2, lX) + axisnum * sizeof(LONG), default_axis_name[axisnum], nullptr); + device()->add_item(name.c_str(), static_cast<input_item_id>(ITEM_ID_XAXIS + axisnum), generic_axis_get_state, &joystick.state.lX + axisnum); + + axiscount++; } - void reset() override + // populate the POVs + for (UINT32 povnum = 0; povnum < dinput.caps.dwPOVs; povnum++) { - memset(&joystick.state, 0, sizeof(joystick.state)); + std::string name; + + // left + name = dinput_module::device_item_name(this, offsetof(DIJOYSTATE2, rgdwPOV) + povnum * sizeof(DWORD), default_pov_name(povnum), TEXT("L")); + device()->add_item(name.c_str(), ITEM_ID_OTHER_SWITCH, dinput_joystick_pov_get_state, reinterpret_cast<void *>(static_cast<FPTR>(povnum * 4 + POVDIR_LEFT))); + + // right + name = dinput_module::device_item_name(this, offsetof(DIJOYSTATE2, rgdwPOV) + povnum * sizeof(DWORD), default_pov_name(povnum), TEXT("R")); + device()->add_item(name.c_str(), ITEM_ID_OTHER_SWITCH, dinput_joystick_pov_get_state, reinterpret_cast<void *>(static_cast<FPTR>(povnum * 4 + POVDIR_RIGHT))); + + // up + name = dinput_module::device_item_name(this, offsetof(DIJOYSTATE2, rgdwPOV) + povnum * sizeof(DWORD), default_pov_name(povnum), TEXT("U")); + device()->add_item(name.c_str(), ITEM_ID_OTHER_SWITCH, dinput_joystick_pov_get_state, reinterpret_cast<void *>(static_cast<FPTR>(povnum * 4 + POVDIR_UP))); + + // down + name = dinput_module::device_item_name(this, offsetof(DIJOYSTATE2, rgdwPOV) + povnum * sizeof(DWORD), default_pov_name(povnum), TEXT("D")); + device()->add_item(name.c_str(), ITEM_ID_OTHER_SWITCH, dinput_joystick_pov_get_state, reinterpret_cast<void *>(static_cast<FPTR>(povnum * 4 + POVDIR_DOWN))); } - void poll() override + // populate the buttons + for (UINT32 butnum = 0; butnum < dinput.caps.dwButtons; butnum++) { - int axisnum; + FPTR offset = reinterpret_cast<FPTR>(&static_cast<DIJOYSTATE2 *>(nullptr)->rgbButtons[butnum]); + std::string name = dinput_module::device_item_name(this, offset, default_button_name(butnum), nullptr); - // poll the device first - if (dinput_device::poll_dinput(&joystick.state) != ERROR_SUCCESS) - return; + input_item_id itemid; - // normalize axis values - for (axisnum = 0; axisnum < 8; axisnum++) - { - LONG *axis = (&joystick.state.lX) + axisnum; - *axis = normalize_absolute_axis(*axis, joystick.rangemin[axisnum], joystick.rangemax[axisnum]); - } + if (butnum < INPUT_MAX_BUTTONS) + itemid = static_cast<input_item_id>(ITEM_ID_BUTTON1 + butnum); + else if (butnum < INPUT_MAX_BUTTONS + INPUT_MAX_ADD_SWITCH) + itemid = static_cast<input_item_id>(ITEM_ID_ADD_SWITCH1 - INPUT_MAX_BUTTONS + butnum); + else + itemid = ITEM_ID_OTHER_SWITCH; + + device()->add_item(name.c_str(), itemid, generic_button_get_state, &joystick.state.rgbButtons[butnum]); } -}; + + return 0; +} class joystick_input_dinput : public dinput_module { @@ -550,102 +560,22 @@ public: BOOL device_enum_callback(LPCDIDEVICEINSTANCE instance, LPVOID ref) override { DWORD cooperative_level = DISCL_FOREGROUND | DISCL_NONEXCLUSIVE; - int axisnum, axiscount, povnum, butnum; running_machine &machine = *static_cast<running_machine *>(ref); dinput_joystick_device *devinfo; - HRESULT result; + int result = 0; - if (win_window_list != nullptr && win_window_list->win_has_menu()) { + if (win_window_list != nullptr && win_window_list->win_has_menu()) cooperative_level = DISCL_BACKGROUND | DISCL_NONEXCLUSIVE; - } + // allocate and link in a new device - devinfo = create_dinput_device<dinput_joystick_device>(machine, instance, &c_dfDIJoystick, nullptr, cooperative_level); + devinfo = m_dinput_helper->create_device<dinput_joystick_device>(machine, *this, instance, &c_dfDIJoystick, nullptr, cooperative_level); if (devinfo == nullptr) goto exit; - // set absolute mode - result = dinput_set_dword_property(devinfo->dinput.device, DIPROP_AXISMODE, 0, DIPH_DEVICE, DIPROPAXISMODE_ABS); - if (result != DI_OK && result != DI_PROPNOEFFECT) - osd_printf_warning("DirectInput: Unable to set absolute mode for joystick %d (%s)\n", devicelist()->size(), devinfo->name()); - - // turn off deadzone; we do our own calculations - result = dinput_set_dword_property(devinfo->dinput.device, DIPROP_DEADZONE, 0, DIPH_DEVICE, 0); - if (result != DI_OK && result != DI_PROPNOEFFECT) - osd_printf_warning("DirectInput: Unable to reset deadzone for joystick %d (%s)\n", devicelist()->size(), devinfo->name()); - - // turn off saturation; we do our own calculations - result = dinput_set_dword_property(devinfo->dinput.device, DIPROP_SATURATION, 0, DIPH_DEVICE, 10000); - if (result != DI_OK && result != DI_PROPNOEFFECT) - osd_printf_warning("DirectInput: Unable to reset saturation for joystick %d (%s)\n", devicelist()->size(), devinfo->name()); - - // cap the number of axes, POVs, and buttons based on the format - devinfo->dinput.caps.dwAxes = MIN(devinfo->dinput.caps.dwAxes, 8); - devinfo->dinput.caps.dwPOVs = MIN(devinfo->dinput.caps.dwPOVs, 4); - devinfo->dinput.caps.dwButtons = MIN(devinfo->dinput.caps.dwButtons, 128); - - // populate the axes - for (axisnum = axiscount = 0; axiscount < devinfo->dinput.caps.dwAxes && axisnum < 8; axisnum++) + result = devinfo->configure(); + if (result != 0) { - DIPROPRANGE dipr; - std::string name; - - // fetch the range of this axis - dipr.diph.dwSize = sizeof(dipr); - dipr.diph.dwHeaderSize = sizeof(dipr.diph); - dipr.diph.dwObj = offsetof(DIJOYSTATE2, lX) + axisnum * sizeof(LONG); - dipr.diph.dwHow = DIPH_BYOFFSET; - result = IDirectInputDevice_GetProperty(devinfo->dinput.device.Get(), DIPROP_RANGE, &dipr.diph); - if (result != DI_OK) - continue; - - devinfo->joystick.rangemin[axisnum] = dipr.lMin; - devinfo->joystick.rangemax[axisnum] = dipr.lMax; - - // populate the item description as well - name = device_item_name(devinfo, offsetof(DIJOYSTATE2, lX) + axisnum * sizeof(LONG), default_axis_name[axisnum], nullptr); - devinfo->device()->add_item(name.c_str(), static_cast<input_item_id>(ITEM_ID_XAXIS + axisnum), generic_axis_get_state, &devinfo->joystick.state.lX + axisnum); - - axiscount++; - } - - // populate the POVs - for (povnum = 0; povnum < devinfo->dinput.caps.dwPOVs; povnum++) - { - std::string name; - - // left - name = device_item_name(devinfo, offsetof(DIJOYSTATE2, rgdwPOV) + povnum * sizeof(DWORD), default_pov_name(povnum), TEXT("L")); - devinfo->device()->add_item(name.c_str(), ITEM_ID_OTHER_SWITCH, dinput_joystick_pov_get_state, reinterpret_cast<void *>(static_cast<FPTR>(povnum * 4 + POVDIR_LEFT))); - - // right - name = device_item_name(devinfo, offsetof(DIJOYSTATE2, rgdwPOV) + povnum * sizeof(DWORD), default_pov_name(povnum), TEXT("R")); - devinfo->device()->add_item(name.c_str(), ITEM_ID_OTHER_SWITCH, dinput_joystick_pov_get_state, reinterpret_cast<void *>(static_cast<FPTR>(povnum * 4 + POVDIR_RIGHT))); - - // up - name = device_item_name(devinfo, offsetof(DIJOYSTATE2, rgdwPOV) + povnum * sizeof(DWORD), default_pov_name(povnum), TEXT("U")); - devinfo->device()->add_item(name.c_str(), ITEM_ID_OTHER_SWITCH, dinput_joystick_pov_get_state, reinterpret_cast<void *>(static_cast<FPTR>(povnum * 4 + POVDIR_UP))); - - // down - name = device_item_name(devinfo, offsetof(DIJOYSTATE2, rgdwPOV) + povnum * sizeof(DWORD), default_pov_name(povnum), TEXT("D")); - devinfo->device()->add_item(name.c_str(), ITEM_ID_OTHER_SWITCH, dinput_joystick_pov_get_state, reinterpret_cast<void *>(static_cast<FPTR>(povnum * 4 + POVDIR_DOWN))); - } - - // populate the buttons - for (butnum = 0; butnum < devinfo->dinput.caps.dwButtons; butnum++) - { - FPTR offset = reinterpret_cast<FPTR>(&static_cast<DIJOYSTATE2 *>(nullptr)->rgbButtons[butnum]); - std::string name = device_item_name(devinfo, offset, default_button_name(butnum), nullptr); - - input_item_id itemid; - - if (butnum < INPUT_MAX_BUTTONS) - itemid = static_cast<input_item_id>(ITEM_ID_BUTTON1 + butnum); - else if (butnum < INPUT_MAX_BUTTONS + INPUT_MAX_ADD_SWITCH) - itemid = static_cast<input_item_id>(ITEM_ID_ADD_SWITCH1 - INPUT_MAX_BUTTONS + butnum); - else - itemid = ITEM_ID_OTHER_SWITCH; - - devinfo->device()->add_item(name.c_str(), itemid, generic_button_get_state, &devinfo->joystick.state.rgbButtons[butnum]); + osd_printf_error("Failed to configure DI Joystick device. Error 0x%x\n", static_cast<unsigned int>(result)); } exit: diff --git a/src/osd/modules/input/input_dinput.h b/src/osd/modules/input/input_dinput.h new file mode 100644 index 00000000000..6dacf8ebd77 --- /dev/null +++ b/src/osd/modules/input/input_dinput.h @@ -0,0 +1,177 @@ +#ifndef INPUT_DINPUT_H_ +#define INPUT_DINPUT_H_ + +#include "input_common.h" +#include "winutil.h" + +//============================================================ +// dinput_device - base directinput device +//============================================================ + +// DirectInput-specific information about a device +struct dinput_api_state +{ + Microsoft::WRL::ComPtr<IDirectInputDevice> device; + Microsoft::WRL::ComPtr<IDirectInputDevice2> device2; + DIDEVCAPS caps; + LPCDIDATAFORMAT format; +}; + +class device_enum_interface +{ +public: + struct dinput_callback_context + { + device_enum_interface * self; + void * state; + }; + + virtual ~device_enum_interface() + { + } + + static BOOL CALLBACK enum_callback(LPCDIDEVICEINSTANCE instance, LPVOID ref) + { + auto context = static_cast<dinput_callback_context*>(ref); + return context->self->device_enum_callback(instance, context->state); + } + + virtual BOOL device_enum_callback(LPCDIDEVICEINSTANCE instance, LPVOID ref) = 0; +}; + +typedef lazy_loaded_function_p4<HRESULT, HMODULE, int, IDirectInput **, LPUNKNOWN> pfn_dinput_create; + +class dinput_api_helper +{ +private: + Microsoft::WRL::ComPtr<IDirectInput> m_dinput; + int m_dinput_version; + pfn_dinput_create m_pfn_DirectInputCreate; + +public: + dinput_api_helper(int version); + virtual ~dinput_api_helper(); + int initialize(); + + template<class TDevice> + TDevice* create_device( + running_machine &machine, + input_module_base &module, + LPCDIDEVICEINSTANCE instance, + LPCDIDATAFORMAT format1, + LPCDIDATAFORMAT format2, + DWORD cooperative_level) + { + HRESULT result; + + // convert instance name to utf8 + auto osd_deleter = [](void *ptr) { osd_free(ptr); }; + auto utf8_instance_name = std::unique_ptr<char, decltype(osd_deleter)>(utf8_from_tstring(instance->tszInstanceName), osd_deleter); + + // allocate memory for the device object + TDevice* devinfo = module.devicelist()->create_device<TDevice>(machine, utf8_instance_name.get(), module); + + // attempt to create a device + result = m_dinput->CreateDevice(instance->guidInstance, devinfo->dinput.device.GetAddressOf(), nullptr); + if (result != DI_OK) + goto error; + + // try to get a version 2 device for it + result = devinfo->dinput.device.CopyTo(IID_IDirectInputDevice2, reinterpret_cast<void**>(devinfo->dinput.device2.GetAddressOf())); + if (result != DI_OK) + devinfo->dinput.device2 = nullptr; + + // get the caps + devinfo->dinput.caps.dwSize = sizeof(devinfo->dinput.caps); + result = devinfo->dinput.device->GetCapabilities(&devinfo->dinput.caps); + if (result != DI_OK) + goto error; + + // attempt to set the data format + devinfo->dinput.format = format1; + result = devinfo->dinput.device->SetDataFormat(devinfo->dinput.format); + if (result != DI_OK) + { + // use the secondary format if available + if (format2 != nullptr) + { + devinfo->dinput.format = format2; + result = devinfo->dinput.device->SetDataFormat(devinfo->dinput.format); + } + if (result != DI_OK) + goto error; + } + + // set the cooperative level + result = devinfo->dinput.device->SetCooperativeLevel(win_window_list->m_hwnd, cooperative_level); + if (result != DI_OK) + goto error; + + return devinfo; + + error: + module.devicelist()->free_device(devinfo); + return nullptr; + } + + HRESULT enum_attached_devices(int devclass, device_enum_interface *enumerate_interface, void *state) const; +}; + +class dinput_device : public device_info +{ +public: + dinput_api_state dinput; + + dinput_device(running_machine &machine, const char *name, input_device_class deviceclass, input_module &module); + virtual ~dinput_device(); + +protected: + HRESULT poll_dinput(LPVOID pState) const; +}; + +class dinput_keyboard_device : public dinput_device +{ +private: + std::mutex m_device_lock; + +public: + keyboard_state keyboard; + + dinput_keyboard_device(running_machine &machine, const char *name, input_module &module); + + void poll() override; + void reset() override; +}; + +class dinput_mouse_device : public dinput_device +{ +public: + mouse_state mouse; + +public: + dinput_mouse_device(running_machine &machine, const char *name, input_module &module); + void poll() override; + void reset() override; +}; + +// state information for a joystick; DirectInput state must be first element +struct dinput_joystick_state +{ + DIJOYSTATE state; + LONG rangemin[8]; + LONG rangemax[8]; +}; + +class dinput_joystick_device : public dinput_device +{ +public: + dinput_joystick_state joystick; +public: + dinput_joystick_device(running_machine &machine, const char *name, input_module &module); + void reset() override; + void poll() override; + int configure(); +}; + + +#endif diff --git a/src/osd/modules/input/input_winhybrid.cpp b/src/osd/modules/input/input_winhybrid.cpp new file mode 100644 index 00000000000..538abe38da4 --- /dev/null +++ b/src/osd/modules/input/input_winhybrid.cpp @@ -0,0 +1,413 @@ +// license:BSD-3-Clause +// copyright-holders:Brad Hughes +//============================================================ +// +// input_winhybrid.cpp - Windows hybrid DirectInput/Xinput +// +//============================================================ + +#include "input_module.h" +#include "modules/osdmodule.h" + +#if defined(OSD_WINDOWS) + +#include <wbemcli.h> +#include <list> +#include <vector> + +// standard windows headers +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <wrl/client.h> + +// XInput/DirectInput +#include <xinput.h> +#include <dinput.h> + +#undef interface + +// MAME headers +#include "emu.h" +#include "osdepend.h" + +// MAMEOS headers +#include "strconv.h" +#include "winutil.h" +#include "winmain.h" + +#include "input_common.h" +#include "input_windows.h" +#include "input_xinput.h" +#include "input_dinput.h" + +using namespace Microsoft::WRL; + +template<class TCom> +class ComArray +{ +private: + std::vector<TCom*> m_entries; + +public: + ComArray(size_t capacity) + : m_entries(capacity, nullptr) + { + } + + ~ComArray() + { + Release(); + } + + TCom** ReleaseAndGetAddressOf() + { + Release(); + + // This works b/c vector elements are guaranteed to be contiguous. + return &m_entries[0]; + } + + TCom* operator [] (int i) + { + return m_entries[i]; + } + + size_t Size() + { + return m_entries.size(); + } + + void Release() + { + for (int i = 0; i < m_entries.size(); i++) + { + if (m_entries[i] != nullptr) + { + m_entries[i]->Release(); + m_entries[i] = nullptr; + } + } + } +}; + +struct bstr_deleter +{ + void operator () (BSTR bstr) const + { + if (bstr != nullptr) + SysFreeString(bstr); + } +}; + +typedef std::unique_ptr<OLECHAR, bstr_deleter> bstr_ptr; + +//============================================================ +// winhybrid_joystick_module +//============================================================ + +class winhybrid_joystick_module : public wininput_module, public device_enum_interface +{ +private: + std::shared_ptr<xinput_api_helper> m_xinput_helper; + std::unique_ptr<dinput_api_helper> m_dinput_helper; + std::list<DWORD> m_xinput_deviceids; + bool m_xinput_detect_failed; + +public: + winhybrid_joystick_module() + : wininput_module(OSD_JOYSTICKINPUT_PROVIDER, "winhybrid"), + m_xinput_helper(nullptr), + m_dinput_helper(nullptr), + m_xinput_detect_failed(false) + { + } + + bool probe() override + { + int status = init_helpers(); + if (status != 0) + { + osd_printf_verbose("Hybrid joystick module isn't supported, falling back.\n"); + return false; + } + + return true; + } + + int init(const osd_options &options) override + { + // Call the base + int status = wininput_module::init(options); + if (status != 0) + return status; + + // Create and initialize our helpers + status = init_helpers(); + if (status != 0) + return status; + + return 0; + } + + BOOL device_enum_callback(LPCDIDEVICEINSTANCE instance, LPVOID ref) override + { + DWORD cooperative_level = DISCL_FOREGROUND | DISCL_NONEXCLUSIVE; + running_machine &machine = *static_cast<running_machine *>(ref); + dinput_joystick_device *devinfo; + int result = 0; + + // First check if this device is XInput Compatible. If so, don't add it here + // as it'll be picked up by Xinput + if (!m_xinput_detect_failed && is_xinput_device(&instance->guidProduct)) + { + osd_printf_verbose("Skipping DirectInput for XInput compatible joystick %S.\n", instance->tszInstanceName); + goto exit; + } + + if (win_window_list != nullptr && win_window_list->win_has_menu()) + cooperative_level = DISCL_BACKGROUND | DISCL_NONEXCLUSIVE; + + // allocate and link in a new device + devinfo = m_dinput_helper->create_device<dinput_joystick_device>(machine, *this, instance, &c_dfDIJoystick, nullptr, cooperative_level); + if (devinfo == nullptr) + goto exit; + + result = devinfo->configure(); + if (result != 0) + { + osd_printf_error("Failed to configure DI Joystick device. Error 0x%x\n", static_cast<unsigned int>(result)); + } + + exit: + return DIENUM_CONTINUE; + } + + void exit() override + { + m_xinput_helper.reset(); + m_dinput_helper.reset(); + + wininput_module::exit(); + } + +protected: + virtual void input_init(running_machine &machine) override + { + HRESULT result = get_xinput_devices(m_xinput_deviceids); + if (result != 0) + { + m_xinput_detect_failed = true; + osd_printf_warning("XInput device detection failed. XInput won't be used. Error: 0x%X\n", static_cast<unsigned int>(result)); + } + + // Enumerate all the directinput joysticks and add them if they aren't xinput compatible + result = m_dinput_helper->enum_attached_devices(DI8DEVCLASS_GAMECTRL, this, &machine); + if (result != DI_OK) + fatalerror("DirectInput: Unable to enumerate keyboards (result=%08X)\n", static_cast<UINT32>(result)); + + xinput_joystick_device *devinfo; + + // now add all xinput devices + if (!m_xinput_detect_failed) + { + // Loop through each gamepad to determine if they are connected + for (UINT i = 0; i < XUSER_MAX_COUNT; i++) + { + XINPUT_STATE state = { 0 }; + + if (m_xinput_helper->XInputGetState(i, &state) == ERROR_SUCCESS) + { + // allocate and link in a new device + devinfo = m_xinput_helper->create_xinput_device(machine, i, *this); + if (devinfo == nullptr) + continue; + + // Configure each gamepad to add buttons and Axes, etc. + devinfo->configure(); + } + } + } + } + +private: + int init_helpers() + { + int status = 0; + + if (m_xinput_helper == nullptr) + { + m_xinput_helper = std::make_shared<xinput_api_helper>(); + status = m_xinput_helper->initialize(); + if (status != 0) + { + osd_printf_error("xinput_api_helper failed to initialize! Error: %u\n", static_cast<unsigned int>(status)); + return -1; + } + } + + if (m_dinput_helper == nullptr) + { + m_dinput_helper = std::make_unique<dinput_api_helper>(DIRECTINPUT_VERSION); + status = m_dinput_helper->initialize(); + if (status != DI_OK) + { + osd_printf_error("dinput_api_helper failed to initialize! Error: %u\n", static_cast<unsigned int>(status)); + return -1; + } + } + + return status; + } + + //----------------------------------------------------------------------------- + // Returns true if the DirectInput device is also an XInput device. + //----------------------------------------------------------------------------- + bool is_xinput_device(const GUID* pGuidProductFromDirectInput) + { + // Check each xinput device to see if this device's vid/pid matches + for (auto devid = m_xinput_deviceids.begin(); devid != m_xinput_deviceids.end(); ++devid) + { + if (*devid == pGuidProductFromDirectInput->Data1) + return true; + } + + return false; + } + + //----------------------------------------------------------------------------- + // Enum each PNP device using WMI and check each device ID to see if it contains + // "IG_" (ex. "VID_045E&PID_028E&IG_00"). If it does, then it’s an XInput device + // Unfortunately this information can not be found by just using DirectInput. + // Checking against a VID/PID of 0x028E/0x045E won't find 3rd party or future + // XInput devices. + //----------------------------------------------------------------------------- + HRESULT get_xinput_devices(std::list<DWORD> &xinput_id_list) const + { + ComPtr<IWbemServices> pIWbemServices; + ComPtr<IEnumWbemClassObject> pEnumDevices; + ComPtr<IWbemLocator> pIWbemLocator; + ComArray<IWbemClassObject> pDevices(20); + bstr_ptr bstrDeviceID; + bstr_ptr bstrClassName; + bstr_ptr bstrNamespace; + DWORD uReturned = 0; + UINT iDevice = 0; + VARIANT var; + HRESULT hr; + + // CoInit if needed + CoInitialize(nullptr); + + // Create WMI + hr = CoCreateInstance( + __uuidof(WbemLocator), + nullptr, + CLSCTX_INPROC_SERVER, + __uuidof(IWbemLocator), + reinterpret_cast<void**>(pIWbemLocator.GetAddressOf())); + + if (FAILED(hr) || pIWbemLocator == nullptr) + { + osd_printf_error("Creating WbemLocator failed. Error: 0x%X\n", static_cast<unsigned int>(hr)); + return hr; + } + + // Create BSTRs for WMI + bstrNamespace = bstr_ptr(SysAllocString(L"\\\\.\\root\\cimv2")); + bstrDeviceID = bstr_ptr(SysAllocString(L"DeviceID")); + bstrClassName = bstr_ptr(SysAllocString(L"Win32_PNPEntity")); + + // Connect to WMI + hr = pIWbemLocator->ConnectServer( + bstrNamespace.get(), + nullptr, + nullptr, + nullptr, + 0L, + nullptr, + nullptr, + pIWbemServices.GetAddressOf()); + + if (FAILED(hr) || pIWbemServices == nullptr) + { + osd_printf_error("Connecting to WMI Server failed. Error: 0x%X\n", static_cast<unsigned int>(hr)); + return hr; + } + + // Switch security level to IMPERSONATE + (void)CoSetProxyBlanket( + pIWbemServices.Get(), + RPC_C_AUTHN_WINNT, + RPC_C_AUTHZ_NONE, + nullptr, + RPC_C_AUTHN_LEVEL_CALL, + RPC_C_IMP_LEVEL_IMPERSONATE, + nullptr, + 0); + + // Get list of Win32_PNPEntity devices + hr = pIWbemServices->CreateInstanceEnum(bstrClassName.get(), 0, nullptr, pEnumDevices.GetAddressOf()); + if (FAILED(hr) || pEnumDevices == nullptr) + { + osd_printf_error("Getting list of Win32_PNPEntity devices failed. Error: 0x%X\n", static_cast<unsigned int>(hr)); + return hr; + } + + // Loop over all devices + for (; ; ) + { + // Get a few at a time + hr = pEnumDevices->Next(10000, pDevices.Size(), pDevices.ReleaseAndGetAddressOf(), &uReturned); + if (FAILED(hr)) + { + osd_printf_error("Enumerating WMI classes failed. Error: 0x%X\n", static_cast<unsigned int>(hr)); + return hr; + } + + if (uReturned == 0) + break; + + for (iDevice = 0; iDevice < uReturned; iDevice++) + { + if (!pDevices[iDevice]) + continue; + + // For each device, get its device ID + hr = pDevices[iDevice]->Get(bstrDeviceID.get(), 0L, &var, nullptr, nullptr); + if (SUCCEEDED(hr) && var.vt == VT_BSTR && var.bstrVal != nullptr) + { + // Check if the device ID contains "IG_". If it does, then it’s an XInput device + // Unfortunately this information can not be found by just using DirectInput + if (wcsstr(var.bstrVal, L"IG_")) + { + // If it does, then get the VID/PID from var.bstrVal + DWORD dwPid = 0, dwVid = 0; + WCHAR* strVid = wcsstr(var.bstrVal, L"VID_"); + if (strVid && swscanf(strVid, L"VID_%4X", &dwVid) != 1) + dwVid = 0; + + WCHAR* strPid = wcsstr(var.bstrVal, L"PID_"); + if (strPid && swscanf(strPid, L"PID_%4X", &dwPid) != 1) + dwPid = 0; + + DWORD dwVidPid = MAKELONG(dwVid, dwPid); + + // Add the VID/PID to a linked list + xinput_id_list.push_back(dwVidPid); + } + } + } + } + + if (SUCCEEDED(hr)) + hr = S_OK; + + return hr; + } +}; + +#else +MODULE_NOT_SUPPORTED(winhybrid_joystick_module, OSD_JOYSTICKINPUT_PROVIDER, "winhybrid") +#endif + +MODULE_DEFINITION(JOYSTICKINPUT_WINHYBRID, winhybrid_joystick_module) diff --git a/src/osd/modules/input/input_xinput.cpp b/src/osd/modules/input/input_xinput.cpp index 8c7800c8c35..753fd49a729 100644 --- a/src/osd/modules/input/input_xinput.cpp +++ b/src/osd/modules/input/input_xinput.cpp @@ -23,224 +23,199 @@ // MAME headers #include "emu.h" #include "osdepend.h" -#include "ui/ui.h" // MAMEOS headers #include "winutil.h" #include "winmain.h" -#include "window.h" #include "input_common.h" #include "input_windows.h" +#include "input_xinput.h" -#define XINPUT_MAX_POV 4 -#define XINPUT_MAX_BUTTONS 10 -#define XINPUT_MAX_AXIS 4 -#define XINPUT_AXIS_MINVALUE -32767 -#define XINPUT_AXIS_MAXVALUE 32767 - -// default axis names -static const char *const xinput_axis_name[] = +xinput_api_helper::xinput_api_helper() +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + : XInputGetState("XInputGetState", xinput_dll_names, ARRAY_LENGTH(xinput_dll_names)) + , XInputGetCapabilities("XInputGetCapabilities", xinput_dll_names, ARRAY_LENGTH(xinput_dll_names)) +#endif { - "LSX", - "LSY", - "RSX", - "RSY" -}; +} -static const input_item_id xinput_axis_ids[] = +int xinput_api_helper::initialize() { - ITEM_ID_XAXIS, - ITEM_ID_YAXIS, - ITEM_ID_RXAXIS, - ITEM_ID_RYAXIS -}; - -static const USHORT xinput_pov_dir[] = { - XINPUT_GAMEPAD_DPAD_UP, - XINPUT_GAMEPAD_DPAD_DOWN, - XINPUT_GAMEPAD_DPAD_LEFT, - XINPUT_GAMEPAD_DPAD_RIGHT -}; - -static const char *const xinput_pov_names[] = { - "DPAD Up", - "DPAD Down", - "DPAD Left", - "DPAD Right" -}; +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + int status; + status = XInputGetState.initialize(); + if (status != 0) + { + osd_printf_error("Failed to initialize function pointer for %s. Error: %d\n", XInputGetState.name(), status); + return -1; + } -static const USHORT xinput_buttons[] = { - XINPUT_GAMEPAD_A, - XINPUT_GAMEPAD_B, - XINPUT_GAMEPAD_X, - XINPUT_GAMEPAD_Y, - XINPUT_GAMEPAD_LEFT_SHOULDER, - XINPUT_GAMEPAD_RIGHT_SHOULDER, - XINPUT_GAMEPAD_START, - XINPUT_GAMEPAD_BACK, - XINPUT_GAMEPAD_LEFT_THUMB, - XINPUT_GAMEPAD_RIGHT_THUMB, -}; + status = XInputGetCapabilities.initialize(); + if (status != 0) + { + osd_printf_error("Failed to initialize function pointer for %s. Error: %d\n", XInputGetCapabilities.name(), status); + return -1; + } +#endif -static const char *const xinput_button_names[] = { - "A", - "B", - "X", - "Y", - "Left Shoulder", - "Right Shoulder", - "Start", - "Back", - "Left Thumb", - "Right Thumb" -}; + return 0; +} -struct gamepad_state +#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +// Pass-through functions for Universal Windows +inline DWORD xinput_api_helper::XInputGetState(DWORD dwUserindex, XINPUT_STATE *pState) { - BYTE rgbButtons[XINPUT_MAX_BUTTONS]; - BYTE rgbPov[XINPUT_MAX_POV]; - BYTE bLeftTrigger; - BYTE bRightTrigger; - LONG sThumbLX; - LONG sThumbLY; - LONG sThumbRX; - LONG sThumbRY; -}; + return ::XInputGetState(dwUserindex, pState); +} -// state information for a gamepad; state must be first element -struct xinput_api_state +inline DWORD xinput_api_helper::XInputGetCapabilities(DWORD dwUserindex, DWORD dwFlags, XINPUT_CAPABILITIES* pCapabilities) { - UINT32 playerIndex; - XINPUT_STATE xstate; - XINPUT_CAPABILITIES caps; -}; + return ::XInputGetCapabilities(dwUserindex, dwFlags, pCapabilities); +} +#endif -// Typedef for pointers to XInput Functions -typedef lazy_loaded_function_p2<DWORD, DWORD, XINPUT_STATE*> xinput_get_state_fn; -typedef lazy_loaded_function_p3<DWORD, DWORD, DWORD, XINPUT_CAPABILITIES*> xinput_get_caps_fn; +//============================================================ +// create_xinput_device +//============================================================ -class xinput_interface +xinput_joystick_device * xinput_api_helper::create_xinput_device(running_machine &machine, UINT index, wininput_module &module) { -private: - const wchar_t* xinput_dll_names[2] = { L"xinput1_4.dll", L"xinput9_1_0.dll" }; + xinput_joystick_device *devinfo; -public: - xinput_get_state_fn XInputGetState; - xinput_get_caps_fn XInputGetCapabilities; - -private: - xinput_interface() - : XInputGetState("XInputGetState", xinput_dll_names, ARRAY_LENGTH(xinput_dll_names)), - XInputGetCapabilities("XInputGetCapabilities", xinput_dll_names, ARRAY_LENGTH(xinput_dll_names)) + XINPUT_CAPABILITIES caps = { 0 }; + if (FAILED(XInputGetCapabilities(index, 0, &caps))) { + // If we can't get the capabilities skip this device + return nullptr; } - int initialize() - { - int status; - status = XInputGetState.initialize(); - if (status != 0) - { - osd_printf_error("Failed to initialize function pointer for %s. Error: %d\n", XInputGetState.name(), status); - return -1; - } + char device_name[16]; + snprintf(device_name, sizeof(device_name), "XInput Player %u", index + 1); - status = XInputGetCapabilities.initialize(); - if (status != 0) - { - osd_printf_error("Failed to initialize function pointer for %s. Error: %d\n", XInputGetCapabilities.name(), status); - return -1; - } + // allocate the device object + devinfo = module.devicelist()->create_device1<xinput_joystick_device>(machine, device_name, module, shared_from_this()); - return 0; - } + // Set the player ID + devinfo->xinput_state.playerIndex = index; -public: - static DWORD get_interface(xinput_interface **ppinterface) - { - static xinput_interface s_instance; - DWORD error = s_instance.initialize(); - if (error == 0) - { - *ppinterface = &s_instance; - } + // Assign the caps we captured earlier + devinfo->xinput_state.caps = caps; - return error; - } -}; + return devinfo; +} //============================================================ // xinput_joystick_device //============================================================ -class xinput_joystick_device : public device_info +xinput_joystick_device::xinput_joystick_device(running_machine &machine, const char *name, input_module &module, std::shared_ptr<xinput_api_helper> helper) + : device_info(machine, name, DEVICE_CLASS_JOYSTICK, module), + gamepad({{0}}), + xinput_state({0}), + m_xinput_helper(helper), + m_configured(false) { -public: - gamepad_state gamepad; - xinput_api_state xinput_state; +} -private: - xinput_interface* xinput_api; +void xinput_joystick_device::poll() +{ + if (!m_configured) + return; -public: - xinput_joystick_device(running_machine &machine, const char *name, input_module &module) - : device_info(machine, name, DEVICE_CLASS_JOYSTICK, module), - gamepad({{0}}), - xinput_state({0}), - xinput_api(nullptr) + // poll the device first + HRESULT result = m_xinput_helper->XInputGetState(xinput_state.playerIndex, &xinput_state.xstate); + + // If we can't poll the device, skip + if (FAILED(result)) + return; + + // Copy the XState into State + // Start with the POV (DPAD) + for (int povindex = 0; povindex < XINPUT_MAX_POV; povindex++) { - // Attempt to get the xinput interface - xinput_interface::get_interface(&xinput_api); + int currentPov = xinput_pov_dir[povindex]; + gamepad.rgbPov[currentPov] = (xinput_state.xstate.Gamepad.wButtons & currentPov) ? 0xFF : 0; } - void poll() override + // Now do the buttons + for (int buttonindex = 0; buttonindex < XINPUT_MAX_BUTTONS; buttonindex++) { - // Nothing we can do if for some reason the API couldn't be loaded - if (xinput_api == nullptr) - return; + int currentButton = xinput_buttons[buttonindex]; + gamepad.rgbButtons[buttonindex] = (xinput_state.xstate.Gamepad.wButtons & currentButton) ? 0xFF : 0; + } - // poll the device first - HRESULT result = xinput_api->XInputGetState(xinput_state.playerIndex, &xinput_state.xstate); + // Now grab the axis values + // Each of the thumbstick axis members is a signed value between -32768 and 32767 describing the position of the thumbstick + // However, the Y axis values are inverted from what MAME expects, so multiply by -1 first + gamepad.sThumbLX = normalize_absolute_axis(xinput_state.xstate.Gamepad.sThumbLX, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE); + gamepad.sThumbLY = normalize_absolute_axis(xinput_state.xstate.Gamepad.sThumbLY * -1, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE); + gamepad.sThumbRX = normalize_absolute_axis(xinput_state.xstate.Gamepad.sThumbRX, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE); + gamepad.sThumbRY = normalize_absolute_axis(xinput_state.xstate.Gamepad.sThumbRY * -1, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE); - // If we can't poll the device, skip - if (FAILED(result)) - return; + // Now the triggers + gamepad.bLeftTrigger = xinput_state.xstate.Gamepad.bLeftTrigger; + gamepad.bRightTrigger = xinput_state.xstate.Gamepad.bRightTrigger; +} - // Copy the XState into State - // Start with the POV (DPAD) - for (int povindex = 0; povindex < XINPUT_MAX_POV; povindex++) - { - int currentPov = xinput_pov_dir[povindex]; - gamepad.rgbPov[currentPov] = (xinput_state.xstate.Gamepad.wButtons & currentPov) ? 0xFF : 0; - } +void xinput_joystick_device::reset() +{ + memset(&gamepad, 0, sizeof(gamepad)); +} - // Now do the buttons - for (int buttonindex = 0; buttonindex < XINPUT_MAX_BUTTONS; buttonindex++) - { - int currentButton = xinput_buttons[buttonindex]; - gamepad.rgbButtons[buttonindex] = (xinput_state.xstate.Gamepad.wButtons & currentButton) ? 0xFF : 0; - } +void xinput_joystick_device::configure() +{ + std::lock_guard<std::mutex> scope_lock(m_device_lock); + + if (m_configured) + return; - // Now grab the axis values - // Each of the thumbstick axis members is a signed value between -32768 and 32767 describing the position of the thumbstick - // However, the Y axis values are inverted from what MAME expects, so multiply by -1 first - gamepad.sThumbLX = normalize_absolute_axis(xinput_state.xstate.Gamepad.sThumbLX, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE); - gamepad.sThumbLY = normalize_absolute_axis(xinput_state.xstate.Gamepad.sThumbLY * -1, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE); - gamepad.sThumbRX = normalize_absolute_axis(xinput_state.xstate.Gamepad.sThumbRX, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE); - gamepad.sThumbRY = normalize_absolute_axis(xinput_state.xstate.Gamepad.sThumbRY * -1, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE); - - // Now the triggers - gamepad.bLeftTrigger = xinput_state.xstate.Gamepad.bLeftTrigger; - gamepad.bRightTrigger = xinput_state.xstate.Gamepad.bRightTrigger; + // Add the axes + for (int axisnum = 0; axisnum < XINPUT_MAX_AXIS; axisnum++) + { + device()->add_item( + xinput_axis_name[axisnum], + xinput_axis_ids[axisnum], + generic_axis_get_state, + &gamepad.sThumbLX + axisnum); } - void reset() override + // Populate the POVs + // For XBOX, we treat the DPAD as a hat switch + for (int povnum = 0; povnum < XINPUT_MAX_POV; povnum++) { - memset(&gamepad, 0, sizeof(gamepad)); + device()->add_item( + xinput_pov_names[povnum], + ITEM_ID_OTHER_SWITCH, + generic_button_get_state, + &gamepad.rgbPov[povnum]); } -}; + + // populate the buttons + for (int butnum = 0; butnum < XINPUT_MAX_BUTTONS; butnum++) + { + device()->add_item( + xinput_button_names[butnum], + static_cast<input_item_id>(ITEM_ID_BUTTON1 + butnum), + generic_button_get_state, + &gamepad.rgbButtons[butnum]); + } + + device()->add_item( + "Left Trigger", + static_cast<input_item_id>(ITEM_ID_BUTTON1 + XINPUT_MAX_BUTTONS), + generic_button_get_state, + &gamepad.bLeftTrigger); + + device()->add_item( + "Right Trigger", + static_cast<input_item_id>(ITEM_ID_BUTTON1 + XINPUT_MAX_BUTTONS + 1), + generic_button_get_state, + &gamepad.bRightTrigger); + + m_configured = true; +} //============================================================ // xinput_joystick_module @@ -249,12 +224,12 @@ public: class xinput_joystick_module : public wininput_module { private: - xinput_interface* xinput_api; + std::shared_ptr<xinput_api_helper> m_xinput_helper; public: xinput_joystick_module() : wininput_module(OSD_JOYSTICKINPUT_PROVIDER, "xinput"), - xinput_api(nullptr) + m_xinput_helper(nullptr) { } @@ -265,11 +240,12 @@ public: if (status != 0) return status; - // Make sure we can get the xinput API - status = xinput_interface::get_interface(&xinput_api); + // Create and initialize our helper + m_xinput_helper = std::make_shared<xinput_api_helper>(); + status = m_xinput_helper->initialize(); if (status != 0) { - osd_printf_error("xinput_joystick_module failed to get XInput interface! Error: %u\n", (unsigned int)status); + osd_printf_error("xinput_joystick_module failed to get XInput interface! Error: %u\n", static_cast<unsigned int>(status)); return -1; } @@ -279,9 +255,6 @@ public: protected: virtual void input_init(running_machine &machine) override { - // The Xinput API should have been obtained already - assert(xinput_api != nullptr); - xinput_joystick_device *devinfo; // Loop through each gamepad to determine if they are connected @@ -289,93 +262,22 @@ protected: { XINPUT_STATE state = {0}; - if (xinput_api->XInputGetState(i, &state) == ERROR_SUCCESS) + if (m_xinput_helper->XInputGetState(i, &state) == ERROR_SUCCESS) { // allocate and link in a new device - devinfo = create_xinput_device(machine, i); + devinfo = m_xinput_helper->create_xinput_device(machine, i, *this); if (devinfo == nullptr) continue; - // Add the axes - for (int axisnum = 0; axisnum < XINPUT_MAX_AXIS; axisnum++) - { - devinfo->device()->add_item( - xinput_axis_name[axisnum], - xinput_axis_ids[axisnum], - generic_axis_get_state, - &devinfo->gamepad.sThumbLX + axisnum); - } - - // Populate the POVs - // For XBOX, we treat the DPAD as a hat switch - for (int povnum = 0; povnum < XINPUT_MAX_POV; povnum++) - { - devinfo->device()->add_item( - xinput_pov_names[povnum], - ITEM_ID_OTHER_SWITCH, - generic_button_get_state, - &devinfo->gamepad.rgbPov[povnum]); - } - - // populate the buttons - for (int butnum = 0; butnum < XINPUT_MAX_BUTTONS; butnum++) - { - devinfo->device()->add_item( - xinput_button_names[butnum], - (input_item_id)(ITEM_ID_BUTTON1 + butnum), - generic_button_get_state, - &devinfo->gamepad.rgbButtons[butnum]); - } - - devinfo->device()->add_item( - "Left Trigger", - (input_item_id)(ITEM_ID_BUTTON1 + XINPUT_MAX_BUTTONS), - generic_button_get_state, - &devinfo->gamepad.bLeftTrigger); - - devinfo->device()->add_item( - "Right Trigger", - (input_item_id)(ITEM_ID_BUTTON1 + XINPUT_MAX_BUTTONS + 1), - generic_button_get_state, - &devinfo->gamepad.bRightTrigger); + // Configure each gamepad to add buttons and Axes, etc. + devinfo->configure(); } } } - - private: - //============================================================ - // create_xinput_device - //============================================================ - - xinput_joystick_device * create_xinput_device(running_machine &machine, UINT index) - { - xinput_joystick_device *devinfo; - - XINPUT_CAPABILITIES caps = {0}; - if (FAILED(xinput_api->XInputGetCapabilities(index, 0, &caps))) - { - // If we can't get the capabilities skip this device - return nullptr; - } - - char device_name[16]; - snprintf(device_name, sizeof(device_name), "XInput Player %u", index + 1); - - // allocate the device object - devinfo = devicelist()->create_device<xinput_joystick_device>(machine, device_name, *this); - - // Set the player ID - devinfo->xinput_state.playerIndex = index; - - // Assign the caps we captured earlier - devinfo->xinput_state.caps = caps; - - return devinfo; - } }; #else -MODULE_NOT_SUPPORTED(xinput_joystick_module, OSD_KEYBOARDINPUT_PROVIDER, "xinput") +MODULE_NOT_SUPPORTED(xinput_joystick_module, OSD_JOYSTICKINPUT_PROVIDER, "xinput") #endif MODULE_DEFINITION(JOYSTICKINPUT_XINPUT, xinput_joystick_module) diff --git a/src/osd/modules/input/input_xinput.h b/src/osd/modules/input/input_xinput.h new file mode 100644 index 00000000000..0a0e4ed0266 --- /dev/null +++ b/src/osd/modules/input/input_xinput.h @@ -0,0 +1,140 @@ +#ifndef INPUT_XINPUT_H_ +#define INPUT_XINPUT_H_ + +#include <mutex> + +#define XINPUT_MAX_POV 4 +#define XINPUT_MAX_BUTTONS 10 +#define XINPUT_MAX_AXIS 4 + +#define XINPUT_AXIS_MINVALUE -32767 +#define XINPUT_AXIS_MAXVALUE 32767 + +class xinput_joystick_device; +// default axis names +static const char *const xinput_axis_name[] = +{ + "LSX", + "LSY", + "RSX", + "RSY" +}; + +static const input_item_id xinput_axis_ids[] = +{ + ITEM_ID_XAXIS, + ITEM_ID_YAXIS, + ITEM_ID_RXAXIS, + ITEM_ID_RYAXIS +}; + +static const USHORT xinput_pov_dir[] = { + XINPUT_GAMEPAD_DPAD_UP, + XINPUT_GAMEPAD_DPAD_DOWN, + XINPUT_GAMEPAD_DPAD_LEFT, + XINPUT_GAMEPAD_DPAD_RIGHT +}; + +static const char *const xinput_pov_names[] = { + "DPAD Up", + "DPAD Down", + "DPAD Left", + "DPAD Right" +}; + +static const USHORT xinput_buttons[] = { + XINPUT_GAMEPAD_A, + XINPUT_GAMEPAD_B, + XINPUT_GAMEPAD_X, + XINPUT_GAMEPAD_Y, + XINPUT_GAMEPAD_LEFT_SHOULDER, + XINPUT_GAMEPAD_RIGHT_SHOULDER, + XINPUT_GAMEPAD_START, + XINPUT_GAMEPAD_BACK, + XINPUT_GAMEPAD_LEFT_THUMB, + XINPUT_GAMEPAD_RIGHT_THUMB, +}; + +static const char *const xinput_button_names[] = { + "A", + "B", + "X", + "Y", + "Left Shoulder", + "Right Shoulder", + "Start", + "Back", + "Left Thumb", + "Right Thumb" +}; + +struct gamepad_state +{ + BYTE rgbButtons[XINPUT_MAX_BUTTONS]; + BYTE rgbPov[XINPUT_MAX_POV]; + BYTE bLeftTrigger; + BYTE bRightTrigger; + LONG sThumbLX; + LONG sThumbLY; + LONG sThumbRX; + LONG sThumbRY; +}; + +// state information for a gamepad; state must be first element +struct xinput_api_state +{ + UINT32 playerIndex; + XINPUT_STATE xstate; + XINPUT_CAPABILITIES caps; +}; + +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +// Typedef for pointers to XInput Functions +typedef lazy_loaded_function_p2<DWORD, DWORD, XINPUT_STATE*> xinput_get_state_fn; +typedef lazy_loaded_function_p3<DWORD, DWORD, DWORD, XINPUT_CAPABILITIES*> xinput_get_caps_fn; +#endif + +class xinput_api_helper : public std::enable_shared_from_this<xinput_api_helper> +{ +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +private: + const wchar_t* xinput_dll_names[2] = { L"xinput1_4.dll", L"xinput9_1_0.dll" }; + +public: + xinput_get_state_fn XInputGetState; + xinput_get_caps_fn XInputGetCapabilities; +#endif + +public: + xinput_api_helper(); + + int initialize(); + xinput_joystick_device * create_xinput_device(running_machine &machine, UINT index, wininput_module &module); + +#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + // Pass-through functions for Universal Windows + inline DWORD XInputGetState(DWORD dwUserindex, XINPUT_STATE *pState); + inline DWORD XInputGetCapabilities(DWORD dwUserindex, DWORD dwFlags, XINPUT_CAPABILITIES* pCapabilities); +#endif +}; + +class xinput_joystick_device : public device_info +{ +public: + gamepad_state gamepad; + xinput_api_state xinput_state; + +private: + std::shared_ptr<xinput_api_helper> m_xinput_helper; + std::mutex m_device_lock; + bool m_configured; + +public: + xinput_joystick_device(running_machine &machine, const char *name, input_module &module, std::shared_ptr<xinput_api_helper> helper); + + void poll() override; + void reset() override; + void configure(); +}; + +#endif diff --git a/src/osd/modules/lib/osdlib.h b/src/osd/modules/lib/osdlib.h index 484633f137b..dcba7a6bc81 100644 --- a/src/osd/modules/lib/osdlib.h +++ b/src/osd/modules/lib/osdlib.h @@ -61,4 +61,14 @@ void osd_process_kill(void); int osd_setenv(const char *name, const char *value, int overwrite); +/*----------------------------------------------------------------------------- + osd_get_clipboard_text: retrieves text from the clipboard + + Return value: + + the returned string needs to be osd_free()-ed! + +-----------------------------------------------------------------------------*/ +char *osd_get_clipboard_text(void); + #endif /* __OSDLIB__ */ diff --git a/src/osd/modules/lib/osdlib_macosx.cpp b/src/osd/modules/lib/osdlib_macosx.cpp index 34837e8aae4..4d1f839cabd 100644 --- a/src/osd/modules/lib/osdlib_macosx.cpp +++ b/src/osd/modules/lib/osdlib_macosx.cpp @@ -14,6 +14,10 @@ #include <sys/types.h> #include <signal.h> +#include <mach/mach.h> +#include <mach/mach_time.h> +#include <Carbon/Carbon.h> + // MAME headers #include "osdcore.h" #include "osdlib.h" @@ -136,3 +140,82 @@ void osd_break_into_debugger(const char *message) printf("Ignoring MAME exception: %s\n", message); #endif } + + +//============================================================ +// osd_get_clipboard_text +//============================================================ + +char *osd_get_clipboard_text(void) +{ + OSStatus err; + + PasteboardRef pasteboard_ref; + err = PasteboardCreate(kPasteboardClipboard, &pasteboard_ref); + if (err) + return NULL; + + PasteboardSynchronize(pasteboard_ref); + + ItemCount item_count; + err = PasteboardGetItemCount(pasteboard_ref, &item_count); + + char *result = NULL; // core expects a malloced C string of uft8 data + for (UInt32 item_index = 1; (item_index <= item_count) && !result; item_index++) + { + PasteboardItemID item_id; + err = PasteboardGetItemIdentifier(pasteboard_ref, item_index, &item_id); + if (err) + continue; + + CFArrayRef flavor_type_array; + err = PasteboardCopyItemFlavors(pasteboard_ref, item_id, &flavor_type_array); + if (err) + continue; + + CFIndex const flavor_count = CFArrayGetCount(flavor_type_array); + for (CFIndex flavor_index = 0; (flavor_index < flavor_count) && !result; flavor_index++) + { + CFStringRef const flavor_type = (CFStringRef)CFArrayGetValueAtIndex(flavor_type_array, flavor_index); + + CFStringEncoding encoding; + if (UTTypeConformsTo(flavor_type, kUTTypeUTF16PlainText)) + encoding = kCFStringEncodingUTF16; + else if (UTTypeConformsTo (flavor_type, kUTTypeUTF8PlainText)) + encoding = kCFStringEncodingUTF8; + else if (UTTypeConformsTo (flavor_type, kUTTypePlainText)) + encoding = kCFStringEncodingMacRoman; + else + continue; + + CFDataRef flavor_data; + err = PasteboardCopyItemFlavorData(pasteboard_ref, item_id, flavor_type, &flavor_data); + + if (!err) + { + CFStringRef string_ref = CFStringCreateFromExternalRepresentation(kCFAllocatorDefault, flavor_data, encoding); + CFDataRef data_ref = CFStringCreateExternalRepresentation (kCFAllocatorDefault, string_ref, kCFStringEncodingUTF8, '?'); + CFRelease(string_ref); + CFRelease(flavor_data); + + CFIndex const length = CFDataGetLength(data_ref); + CFRange const range = CFRangeMake(0, length); + + result = reinterpret_cast<char *>(osd_malloc_array(length + 1)); + if (result) + { + CFDataGetBytes(data_ref, range, reinterpret_cast<unsigned char *>(result)); + result[length] = 0; + } + + CFRelease(data_ref); + } + } + + CFRelease(flavor_type_array); + } + + CFRelease(pasteboard_ref); + + return result; +} diff --git a/src/osd/modules/lib/osdlib_unix.cpp b/src/osd/modules/lib/osdlib_unix.cpp index fd60db54ba9..3b67e4a2f3a 100644 --- a/src/osd/modules/lib/osdlib_unix.cpp +++ b/src/osd/modules/lib/osdlib_unix.cpp @@ -18,6 +18,7 @@ #include "osdcore.h" #include "osdlib.h" +#include "sdlinc.h" //============================================================ // osd_getenv //============================================================ @@ -132,3 +133,29 @@ void osd_break_into_debugger(const char *message) printf("Ignoring MAME exception: %s\n", message); #endif } + +#ifdef SDLMAME_ANDROID +char *osd_get_clipboard_text(void) +{ + return nullptr; +} +#else +//============================================================ +// osd_get_clipboard_text +//============================================================ + +char *osd_get_clipboard_text(void) +{ + char *result = NULL; + + if (SDL_HasClipboardText()) + { + char *temp = SDL_GetClipboardText(); + result = (char *) osd_malloc_array(strlen(temp) + 1); + strcpy(result, temp); + SDL_free(temp); + } + return result; +} + +#endif diff --git a/src/osd/modules/lib/osdlib_win32.cpp b/src/osd/modules/lib/osdlib_win32.cpp index 572774d6c4c..c5792f0307d 100644 --- a/src/osd/modules/lib/osdlib_win32.cpp +++ b/src/osd/modules/lib/osdlib_win32.cpp @@ -21,6 +21,7 @@ #include "osdlib.h" #include "osdcomm.h" #include "osdcore.h" +#include "strconv.h" #ifdef OSD_WINDOWS #include "winutf8.h" @@ -240,3 +241,76 @@ void osd_break_into_debugger(const char *message) } #endif } + +//============================================================ +// get_clipboard_text_by_format +//============================================================ + +static char *get_clipboard_text_by_format(UINT format, char *(*convert)(LPCVOID data)) +{ + char *result = NULL; + HANDLE data_handle; + LPVOID data; + + // check to see if this format is available + if (IsClipboardFormatAvailable(format)) + { + // open the clipboard + if (OpenClipboard(NULL)) + { + // try to access clipboard data + data_handle = GetClipboardData(format); + if (data_handle != NULL) + { + // lock the data + data = GlobalLock(data_handle); + if (data != NULL) + { + // invoke the convert + result = (*convert)(data); + + // unlock the data + GlobalUnlock(data_handle); + } + } + + // close out the clipboard + CloseClipboard(); + } + } + return result; +} + +//============================================================ +// convert_wide +//============================================================ + +static char *convert_wide(LPCVOID data) +{ + return utf8_from_wstring((LPCWSTR) data); +} + +//============================================================ +// convert_ansi +//============================================================ + +static char *convert_ansi(LPCVOID data) +{ + return utf8_from_astring((LPCSTR) data); +} + +//============================================================ +// osd_get_clipboard_text +//============================================================ + +char *osd_get_clipboard_text(void) +{ + // try to access unicode text + char *result = get_clipboard_text_by_format(CF_UNICODETEXT, convert_wide); + + // try to access ANSI text + if (result == nullptr) + result = get_clipboard_text_by_format(CF_TEXT, convert_ansi); + + return result; +} diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp index a1ab9ab7677..a8856e4ca76 100644 --- a/src/osd/modules/lib/osdobj_common.cpp +++ b/src/osd/modules/lib/osdobj_common.cpp @@ -198,11 +198,11 @@ void osd_common_t::register_options() REGISTER_MODULE(m_mod_man, FONT_SDL); REGISTER_MODULE(m_mod_man, FONT_NONE); + REGISTER_MODULE(m_mod_man, SOUND_XAUDIO2); REGISTER_MODULE(m_mod_man, SOUND_DSOUND); REGISTER_MODULE(m_mod_man, SOUND_COREAUDIO); REGISTER_MODULE(m_mod_man, SOUND_JS); REGISTER_MODULE(m_mod_man, SOUND_SDL); - REGISTER_MODULE(m_mod_man, SOUND_XAUDIO2); REGISTER_MODULE(m_mod_man, SOUND_NONE); #ifdef SDLMAME_MACOSX @@ -241,6 +241,7 @@ void osd_common_t::register_options() REGISTER_MODULE(m_mod_man, LIGHTGUN_NONE); REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_SDL); + REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_WINHYBRID); REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_DINPUT); REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_XINPUT); REGISTER_MODULE(m_mod_man, JOYSTICK_NONE); @@ -303,6 +304,9 @@ void osd_common_t::register_options() // Register video options and update options video_options_add("none", nullptr); +#if USE_OPENGL + video_options_add("opengl", nullptr); +#endif video_register(); update_option(OSDOPTION_VIDEO, m_video_names); } diff --git a/src/osd/modules/osdwindow.h b/src/osd/modules/osdwindow.h index 47e9d7bd527..3286f47f358 100644 --- a/src/osd/modules/osdwindow.h +++ b/src/osd/modules/osdwindow.h @@ -120,6 +120,16 @@ public: float pixel_aspect() const { return monitor()->pixel_aspect(); } + bool swap_xy() + { + bool orientation_swap_xy = + (machine().system().flags & ORIENTATION_SWAP_XY) == ORIENTATION_SWAP_XY; + bool rotation_swap_xy = + (target()->orientation() & ROT90) == ROT90 || + (target()->orientation() & ROT270) == ROT270; + return orientation_swap_xy ^ rotation_swap_xy; + }; + virtual osd_dim get_size() = 0; #ifdef OSD_SDL @@ -201,4 +211,80 @@ private: }; + +//============================================================ +// CONSTANTS +//============================================================ + +#define MAX_VIDEO_WINDOWS (4) + +#define VIDEO_SCALE_MODE_NONE (0) + +#define GLSL_SHADER_MAX 10 + + +//============================================================ +// TYPE DEFINITIONS +//============================================================ + +struct osd_video_config +{ + // global configuration + int windowed; // start windowed? + int prescale; // prescale factor + int keepaspect; // keep aspect ratio + int numscreens; // number of screens + + // hardware options + int mode; // output mode + int waitvsync; // spin until vsync + int syncrefresh; // sync only to refresh rate + int switchres; // switch resolutions + + // d3d, accel, opengl + int filter; // enable filtering + //int filter; // enable filtering, disabled if glsl_filter>0 + + // OpenGL options + int glsl; + int glsl_filter; // glsl filtering, >0 disables filter + char * glsl_shader_mamebm[GLSL_SHADER_MAX]; // custom glsl shader set, mame bitmap + int glsl_shader_mamebm_num; // custom glsl shader set number, mame bitmap + char * glsl_shader_scrn[GLSL_SHADER_MAX]; // custom glsl shader set, screen bitmap + int glsl_shader_scrn_num; // custom glsl shader number, screen bitmap + int pbo; + int vbo; + int allowtexturerect; // allow GL_ARB_texture_rectangle, default: no + int forcepow2texture; // force power of two textures, default: no + + // dd, d3d + int triplebuf; // triple buffer + + //============================================================ + // SDL - options + //============================================================ + int novideo; // don't draw, for pure CPU benchmarking + + int centerh; + int centerv; + + // vector options + float beamwidth; // beam width + + // perftest + int perftest; // print out real video fps + + // X11 options + int restrictonemonitor; // in fullscreen, confine to Xinerama monitor 0 + + // YUV options + int scale_mode; +}; + +//============================================================ +// GLOBAL VARIABLES +//============================================================ + +extern osd_video_config video_config; + #endif /* __OSDWINDOW__ */ diff --git a/src/osd/modules/render/bgfx/shaders/chains/default/fs_blit.sc b/src/osd/modules/render/bgfx/shaders/chains/default/fs_blit.sc new file mode 100644 index 00000000000..9af7bcf0ee6 --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/default/fs_blit.sc @@ -0,0 +1,14 @@ +$input v_color0, v_texcoord0 + +// license:BSD-3-Clause +// copyright-holders:Dario Manesku + +#include "common.sh" + +// Samplers +SAMPLER2D(s_tex, 0); + +void main() +{ + gl_FragColor = texture2D(s_tex, v_texcoord0) * v_color0; +} diff --git a/src/osd/modules/render/bgfx/shaders/chains/default/varying.def.sc b/src/osd/modules/render/bgfx/shaders/chains/default/varying.def.sc new file mode 100644 index 00000000000..4bbc09efebe --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/default/varying.def.sc @@ -0,0 +1,10 @@ +vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0); +vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0); +vec2 v_texcoord1 : TEXCOORD1 = vec2(0.0, 0.0); +vec2 v_texcoord2 : TEXCOORD2 = vec2(0.0, 0.0); +vec2 v_texcoord3 : TEXCOORD3 = vec2(0.0, 0.0); +vec3 v_pos : TEXCOORD3 = vec3(0.0, 0.0, 0.0); + +vec3 a_position : POSITION; +vec4 a_color0 : COLOR0; +vec2 a_texcoord0 : TEXCOORD0; diff --git a/src/osd/modules/render/bgfx/shaders/chains/default/vs_blit.sc b/src/osd/modules/render/bgfx/shaders/chains/default/vs_blit.sc new file mode 100644 index 00000000000..405ef8feb3b --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/default/vs_blit.sc @@ -0,0 +1,14 @@ +$input a_position, a_texcoord0, a_color0 +$output v_texcoord0, v_color0 + +// license:BSD-3-Clause +// copyright-holders:Dario Manesku + +#include "common.sh" + +void main() +{ + gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); + v_texcoord0 = a_texcoord0; + v_color0 = a_color0; +} diff --git a/src/osd/modules/render/bgfx/shaders/fs_blit.sc b/src/osd/modules/render/bgfx/shaders/fs_blit.sc index a6835ff890d..9af7bcf0ee6 100644 --- a/src/osd/modules/render/bgfx/shaders/fs_blit.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_blit.sc @@ -3,7 +3,7 @@ $input v_color0, v_texcoord0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" // Samplers SAMPLER2D(s_tex, 0); diff --git a/src/osd/modules/render/bgfx/shaders/fs_color.sc b/src/osd/modules/render/bgfx/shaders/fs_color.sc index 65c128a6a2a..faa707f5aa1 100644 --- a/src/osd/modules/render/bgfx/shaders/fs_color.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_color.sc @@ -6,7 +6,7 @@ $input v_color0, v_texcoord0 // Color Convolution Effect //----------------------------------------------------------------------------- -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" // User-supplied uniform vec4 u_red_ratios; diff --git a/src/osd/modules/render/bgfx/shaders/fs_deconverge.sc b/src/osd/modules/render/bgfx/shaders/fs_deconverge.sc index b23e24951c3..0f7d5c4854f 100644 --- a/src/osd/modules/render/bgfx/shaders/fs_deconverge.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_deconverge.sc @@ -6,7 +6,7 @@ $input v_color0, v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3 // Deconvergence Effect //----------------------------------------------------------------------------- -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" // Samplers SAMPLER2D(s_tex, 0); diff --git a/src/osd/modules/render/bgfx/shaders/fs_defocus.sc b/src/osd/modules/render/bgfx/shaders/fs_defocus.sc index c9e76990f3f..77130d98d13 100644 --- a/src/osd/modules/render/bgfx/shaders/fs_defocus.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_defocus.sc @@ -6,7 +6,7 @@ $input v_color0, v_texcoord0 // Defocus Effect //----------------------------------------------------------------------------- -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" // Autos uniform vec4 u_tex_size0; diff --git a/src/osd/modules/render/bgfx/shaders/fs_distortion.sc b/src/osd/modules/render/bgfx/shaders/fs_distortion.sc index 8f4efa04cd3..0f69c288c5b 100644 --- a/src/osd/modules/render/bgfx/shaders/fs_distortion.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_distortion.sc @@ -6,7 +6,7 @@ $input v_color0, v_texcoord0 // Distortion Effect //----------------------------------------------------------------------------- -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" // Autos uniform vec4 u_swap_xy; diff --git a/src/osd/modules/render/bgfx/shaders/fs_gui.sc b/src/osd/modules/render/bgfx/shaders/fs_gui.sc index a6285212d2f..ab1bff59dee 100644 --- a/src/osd/modules/render/bgfx/shaders/fs_gui.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_gui.sc @@ -3,7 +3,7 @@ $input v_color0, v_texcoord0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" // Samplers SAMPLER2D(s_tex, 0); diff --git a/src/osd/modules/render/bgfx/shaders/fs_ntsc_decode.sc b/src/osd/modules/render/bgfx/shaders/fs_ntsc_decode.sc index 1c6a53fba29..b196674a094 100644 --- a/src/osd/modules/render/bgfx/shaders/fs_ntsc_decode.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_ntsc_decode.sc @@ -6,7 +6,7 @@ $input v_color0, v_texcoord0 // NTSC Decode Effect //----------------------------------------------------------------------------- -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" // Autos uniform vec4 u_source_dims; diff --git a/src/osd/modules/render/bgfx/shaders/fs_ntsc_encode.sc b/src/osd/modules/render/bgfx/shaders/fs_ntsc_encode.sc index 21bbb39240e..61964c10c30 100644 --- a/src/osd/modules/render/bgfx/shaders/fs_ntsc_encode.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_ntsc_encode.sc @@ -8,7 +8,7 @@ $input v_color0, v_texcoord0 // NB: intentionally wasteful of uniforms in order for easier slider utilization -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" // Autos uniform vec4 u_source_dims; diff --git a/src/osd/modules/render/bgfx/shaders/fs_phosphor.sc b/src/osd/modules/render/bgfx/shaders/fs_phosphor.sc index 4e752d94137..52b624b644b 100644 --- a/src/osd/modules/render/bgfx/shaders/fs_phosphor.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_phosphor.sc @@ -3,7 +3,7 @@ $input v_color0, v_texcoord0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" // User-supplied uniform vec4 u_passthrough; diff --git a/src/osd/modules/render/bgfx/shaders/fs_post.sc b/src/osd/modules/render/bgfx/shaders/fs_post.sc index 27c71a61eba..e4a3a984e6b 100644 --- a/src/osd/modules/render/bgfx/shaders/fs_post.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_post.sc @@ -6,7 +6,7 @@ $input v_color0, v_texcoord0 // Defocus Effect //----------------------------------------------------------------------------- -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" // Autos uniform vec4 u_swap_xy; diff --git a/src/osd/modules/render/bgfx/shaders/fs_prescale.sc b/src/osd/modules/render/bgfx/shaders/fs_prescale.sc index 1d8370dacf4..e17d867b621 100644 --- a/src/osd/modules/render/bgfx/shaders/fs_prescale.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_prescale.sc @@ -3,7 +3,7 @@ $input v_color0, v_texcoord0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" // Samplers SAMPLER2D(s_tex, 0); diff --git a/src/osd/modules/render/bgfx/shaders/fs_screen.sc b/src/osd/modules/render/bgfx/shaders/fs_screen.sc index d0eaa170d49..52dac92785c 100644 --- a/src/osd/modules/render/bgfx/shaders/fs_screen.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_screen.sc @@ -3,7 +3,7 @@ $input v_color0, v_texcoord0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" // Samplers SAMPLER2D(s_tex, 0); diff --git a/src/osd/modules/render/bgfx/shaders/makefile b/src/osd/modules/render/bgfx/shaders/makefile index 737ca43554b..e5ee052ab31 100644 --- a/src/osd/modules/render/bgfx/shaders/makefile +++ b/src/osd/modules/render/bgfx/shaders/makefile @@ -1,13 +1,29 @@ BGFX_DIR=../../../../../../3rdparty/bgfx -RUNTIME_DIR=../../../../../.. +RUNTIME_DIR=../../../../../../bgfx BUILD_DIR=../../../../../../build -include $(BGFX_DIR)/scripts/shader.mk +include shader.mk -rebuild: +SUBDIRS := $(patsubst .,,$(patsubst ./,,$(shell find . -type d))) + + +rebuild: main $(SUBDIRS) + +$(SUBDIRS): + @echo $@ + @make -s --no-print-directory TARGET=0 SHADERS_DIR=$@/ clean all + @make -s --no-print-directory TARGET=1 SHADERS_DIR=$@/ clean all + @make -s --no-print-directory TARGET=2 SHADERS_DIR=$@/ clean all + @make -s --no-print-directory TARGET=3 SHADERS_DIR=$@/ clean all + @make -s --no-print-directory TARGET=4 SHADERS_DIR=$@/ clean all + @make -s --no-print-directory TARGET=5 SHADERS_DIR=$@/ clean all + +main: @make -s --no-print-directory TARGET=0 clean all @make -s --no-print-directory TARGET=1 clean all @make -s --no-print-directory TARGET=2 clean all @make -s --no-print-directory TARGET=3 clean all @make -s --no-print-directory TARGET=4 clean all @make -s --no-print-directory TARGET=5 clean all + +.PHONY: main rebuild $(SUBDIRS) diff --git a/src/osd/modules/render/bgfx/shaders/shader.mk b/src/osd/modules/render/bgfx/shaders/shader.mk new file mode 100644 index 00000000000..6e6730b5c29 --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/shader.mk @@ -0,0 +1,147 @@ +# +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. +# License: http://www.opensource.org/licenses/BSD-2-Clause +# + +THISDIR:=../../../../../../3rdparty/bgfx/scripts +include $(THISDIR)/tools.mk + +# Define SHADERS_DIR if your shader files are in a different dir than the makefile including this. +# Notice: If defined, SHADERS_DIR should end with dir slash '/'. +# Example: +# SHADERS_DIR=shader_files/ + +ifeq ($(SHADERS_DIR), "./") + SHADERS_DIR:="" +endif + +ifndef TARGET +.PHONY: all +all: + @echo Usage: make TARGET=# [clean, all, rebuild] + @echo " TARGET=0 (hlsl - dx9)" + @echo " TARGET=1 (hlsl - dx11)" + @echo " TARGET=2 (glsl - nacl)" + @echo " TARGET=3 (glsl - android)" + @echo " TARGET=4 (glsl - linux)" + @echo " TARGET=5 (metal - OSX/iOS)" + @echo " VERBOSE=1 show build commands." +else + +ifeq ($(TARGET), 0) +VS_FLAGS=--platform windows -p vs_3_0 -O 3 +FS_FLAGS=--platform windows -p ps_3_0 -O 3 +SHADER_PATH=shaders/dx9/$(SHADERS_DIR) +else +ifeq ($(TARGET), 1) +VS_FLAGS=--platform windows -p vs_4_0 -O 3 +FS_FLAGS=--platform windows -p ps_4_0 -O 3 +CS_FLAGS=--platform windows -p cs_5_0 -O 1 +SHADER_PATH=shaders/dx11/$(SHADERS_DIR) +else +ifeq ($(TARGET), 2) +VS_FLAGS=--platform nacl +FS_FLAGS=--platform nacl +SHADER_PATH=shaders/gles/$(SHADERS_DIR) +else +ifeq ($(TARGET), 3) +VS_FLAGS=--platform android +FS_FLAGS=--platform android +CS_FLAGS=--platform android +SHADER_PATH=shaders/gles/$(SHADERS_DIR) +else +ifeq ($(TARGET), 4) +VS_FLAGS=--platform linux -p 120 +FS_FLAGS=--platform linux -p 120 +CS_FLAGS=--platform linux -p 430 +SHADER_PATH=shaders/glsl/$(SHADERS_DIR) +else +ifeq ($(TARGET), 5) +VS_FLAGS=--platform osx -p metal +FS_FLAGS=--platform osx -p metal +CS_FLAGS=--platform osx -p metal +SHADER_PATH=shaders/metal/$(SHADERS_DIR) +endif +endif +endif +endif +endif +endif + +THISDIR := $(dir $(lastword $(MAKEFILE_LIST))) +VS_FLAGS+=-i $(THISDIR)../src/;$(THISDIR)../examples/common/ +FS_FLAGS+=-i $(THISDIR)../src/;$(THISDIR)../examples/common/ +CS_FLAGS+=-i $(THISDIR)../src/$(THISDIR)../examples/common/ + +BUILD_OUTPUT_DIR=$(addprefix ./, $(RUNTIME_DIR)/$(SHADER_PATH)) +BUILD_INTERMEDIATE_DIR=$(addprefix $(BUILD_DIR)/, $(SHADER_PATH)) + +VS_SOURCES=$(notdir $(wildcard $(addprefix $(SHADERS_DIR), vs_*.sc))) +VS_DEPS=$(addprefix $(BUILD_INTERMEDIATE_DIR)/,$(addsuffix .bin.d, $(basename $(notdir $(VS_SOURCES))))) + +FS_SOURCES=$(notdir $(wildcard $(addprefix $(SHADERS_DIR), fs_*.sc))) +FS_DEPS=$(addprefix $(BUILD_INTERMEDIATE_DIR)/,$(addsuffix .bin.d, $(basename $(notdir $(FS_SOURCES))))) + +CS_SOURCES=$(notdir $(wildcard $(addprefix $(SHADERS_DIR), cs_*.sc))) +CS_DEPS=$(addprefix $(BUILD_INTERMEDIATE_DIR)/,$(addsuffix .bin.d, $(basename $(notdir $(CS_SOURCES))))) + +VS_BIN = $(addprefix $(BUILD_INTERMEDIATE_DIR)/, $(addsuffix .bin, $(basename $(notdir $(VS_SOURCES))))) +FS_BIN = $(addprefix $(BUILD_INTERMEDIATE_DIR)/, $(addsuffix .bin, $(basename $(notdir $(FS_SOURCES))))) +CS_BIN = $(addprefix $(BUILD_INTERMEDIATE_DIR)/, $(addsuffix .bin, $(basename $(notdir $(CS_SOURCES))))) + +BIN = $(VS_BIN) $(FS_BIN) +ASM = $(VS_ASM) $(FS_ASM) + +ifeq ($(TARGET), 1) +BIN += $(CS_BIN) +ASM += $(CS_ASM) +else +ifeq ($(TARGET), 3) +BIN += $(CS_BIN) +ASM += $(CS_ASM) +else +ifeq ($(TARGET), 4) +BIN += $(CS_BIN) +ASM += $(CS_ASM) +endif +endif +endif + +$(BUILD_INTERMEDIATE_DIR)/vs_%.bin : $(SHADERS_DIR)vs_%.sc + @echo [$(<)] + $(SILENT) $(SHADERC) $(VS_FLAGS) --type vertex --depends -o $(@) -f $(<) --disasm + $(SILENT) cp $(@) $(BUILD_OUTPUT_DIR)/$(@F) + +$(BUILD_INTERMEDIATE_DIR)/fs_%.bin : $(SHADERS_DIR)fs_%.sc + @echo [$(<)] + $(SILENT) $(SHADERC) $(FS_FLAGS) --type fragment --depends -o $(@) -f $(<) --disasm + $(SILENT) cp $(@) $(BUILD_OUTPUT_DIR)/$(@F) + +$(BUILD_INTERMEDIATE_DIR)/cs_%.bin : $(SHADERS_DIR)cs_%.sc + @echo [$(<)] + $(SILENT) $(SHADERC) $(CS_FLAGS) --type compute --depends -o $(@) -f $(<) --disasm + $(SILENT) cp $(@) $(BUILD_OUTPUT_DIR)/$(@F) + +.PHONY: all +all: dirs $(BIN) + @echo Target $(SHADER_PATH) + +.PHONY: clean +clean: + @echo Cleaning... + @-rm -vf $(BIN) + @-$(call CMD_RMDIR,$(BUILD_INTERMEDIATE_DIR)) + +.PHONY: dirs +dirs: + @-$(call CMD_MKDIR,$(BUILD_INTERMEDIATE_DIR)) + @-$(call CMD_MKDIR,$(BUILD_OUTPUT_DIR)) + +.PHONY: rebuild +rebuild: clean all + +endif # TARGET + +-include $(VS_DEPS) +-include $(FS_DEPS) +-include $(CS_DEPS) diff --git a/src/osd/modules/render/bgfx/shaders/vs_blit.sc b/src/osd/modules/render/bgfx/shaders/vs_blit.sc index fd37320eefb..405ef8feb3b 100644 --- a/src/osd/modules/render/bgfx/shaders/vs_blit.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_blit.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/shaders/vs_color.sc b/src/osd/modules/render/bgfx/shaders/vs_color.sc index fd37320eefb..405ef8feb3b 100644 --- a/src/osd/modules/render/bgfx/shaders/vs_color.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_color.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/shaders/vs_deconverge.sc b/src/osd/modules/render/bgfx/shaders/vs_deconverge.sc index b714f84e4a6..b77d85d1ea8 100644 --- a/src/osd/modules/render/bgfx/shaders/vs_deconverge.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_deconverge.sc @@ -4,7 +4,7 @@ $output v_color0, v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" // Autos uniform vec4 u_source_size; diff --git a/src/osd/modules/render/bgfx/shaders/vs_defocus.sc b/src/osd/modules/render/bgfx/shaders/vs_defocus.sc index fd37320eefb..405ef8feb3b 100644 --- a/src/osd/modules/render/bgfx/shaders/vs_defocus.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_defocus.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/shaders/vs_distortion.sc b/src/osd/modules/render/bgfx/shaders/vs_distortion.sc index fd37320eefb..405ef8feb3b 100644 --- a/src/osd/modules/render/bgfx/shaders/vs_distortion.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_distortion.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/shaders/vs_gui.sc b/src/osd/modules/render/bgfx/shaders/vs_gui.sc index fd37320eefb..405ef8feb3b 100644 --- a/src/osd/modules/render/bgfx/shaders/vs_gui.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_gui.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/shaders/vs_ntsc_decode.sc b/src/osd/modules/render/bgfx/shaders/vs_ntsc_decode.sc index fd37320eefb..405ef8feb3b 100644 --- a/src/osd/modules/render/bgfx/shaders/vs_ntsc_decode.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_ntsc_decode.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/shaders/vs_ntsc_encode.sc b/src/osd/modules/render/bgfx/shaders/vs_ntsc_encode.sc index fd37320eefb..405ef8feb3b 100644 --- a/src/osd/modules/render/bgfx/shaders/vs_ntsc_encode.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_ntsc_encode.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/shaders/vs_phosphor.sc b/src/osd/modules/render/bgfx/shaders/vs_phosphor.sc index fd37320eefb..405ef8feb3b 100644 --- a/src/osd/modules/render/bgfx/shaders/vs_phosphor.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_phosphor.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/shaders/vs_post.sc b/src/osd/modules/render/bgfx/shaders/vs_post.sc index fd37320eefb..405ef8feb3b 100644 --- a/src/osd/modules/render/bgfx/shaders/vs_post.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_post.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/shaders/vs_prescale.sc b/src/osd/modules/render/bgfx/shaders/vs_prescale.sc index fd37320eefb..405ef8feb3b 100644 --- a/src/osd/modules/render/bgfx/shaders/vs_prescale.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_prescale.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/shaders/vs_screen.sc b/src/osd/modules/render/bgfx/shaders/vs_screen.sc index fd37320eefb..405ef8feb3b 100644 --- a/src/osd/modules/render/bgfx/shaders/vs_screen.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_screen.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "common.sh" void main() { diff --git a/src/osd/modules/render/d3d/d3dhlsl.cpp b/src/osd/modules/render/d3d/d3dhlsl.cpp index 60bac93db84..712b80b71af 100644 --- a/src/osd/modules/render/d3d/d3dhlsl.cpp +++ b/src/osd/modules/render/d3d/d3dhlsl.cpp @@ -1789,7 +1789,7 @@ d3d_render_target* shaders::get_texture_target(render_primitive *prim, texture_i return nullptr; } - bool swap_xy = d3d->swap_xy(); + bool swap_xy = d3d->window().swap_xy(); int target_width = swap_xy ? static_cast<int>(prim->get_quad_height() + 0.5f) : static_cast<int>(prim->get_quad_width() + 0.5f); @@ -1944,7 +1944,7 @@ bool shaders::register_texture(render_primitive *prim, texture_info *texture) return false; } - bool swap_xy = d3d->swap_xy(); + bool swap_xy = d3d->window().swap_xy(); int target_width = swap_xy ? static_cast<int>(prim->get_quad_height() + 0.5f) : static_cast<int>(prim->get_quad_width() + 0.5f); @@ -2617,7 +2617,7 @@ void uniform::update() case CU_SWAP_XY: { - m_shader->set_bool("SwapXY", d3d->swap_xy()); + m_shader->set_bool("SwapXY", d3d->window().swap_xy()); break; } case CU_ORIENTATION_SWAP: diff --git a/src/osd/modules/render/d3dtarget.h b/src/osd/modules/render/d3dtarget.h deleted file mode 100644 index 566b1dbdfcd..00000000000 --- a/src/osd/modules/render/d3dtarget.h +++ /dev/null @@ -1,14 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -//============================================================ -// -// d3dtarget.h - Direct3D HLSL targets -// -//============================================================ - -#pragma once - -#ifndef __D3DTARGET__ -#define __D3DTARGET__ - -#endif // __D3DTARGET__ diff --git a/src/osd/modules/render/drawbgfx.cpp b/src/osd/modules/render/drawbgfx.cpp index 85b76864b23..4798bdbd4b6 100644 --- a/src/osd/modules/render/drawbgfx.cpp +++ b/src/osd/modules/render/drawbgfx.cpp @@ -43,6 +43,8 @@ #include "bgfx/slider.h" #include "bgfx/target.h" +#include "imgui/imgui.h" + //============================================================ // DEBUGGING //============================================================ @@ -198,6 +200,8 @@ int renderer_bgfx::create() memset(m_white, 0xff, sizeof(uint32_t) * 16 * 16); m_texinfo.push_back(rectangle_packer::packable_rectangle(WHITE_HASH, PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32), 16, 16, 16, nullptr, m_white)); + imguiCreate(); + return 0; } @@ -261,6 +265,8 @@ renderer_bgfx::~renderer_bgfx() void renderer_bgfx::exit() { + imguiDestroy(); + bgfx::shutdown(); s_window_set = false; } @@ -378,12 +384,6 @@ void renderer_bgfx::put_packed_quad(render_primitive *prim, UINT32 hash, ScreenV void renderer_bgfx::process_screen_quad(int screen, render_primitive* prim) { - uint32_t texture_flags = BGFX_TEXTURE_U_CLAMP | BGFX_TEXTURE_V_CLAMP; - if (video_config.filter == 0) - { - texture_flags |= BGFX_TEXTURE_MIN_POINT | BGFX_TEXTURE_MAG_POINT | BGFX_TEXTURE_MIP_POINT; - } - uint16_t tex_width(prim->texture.width); uint16_t tex_height(prim->texture.height); @@ -454,9 +454,15 @@ void renderer_bgfx::render_post_screen_quad(int view, render_primitive* prim, bg vertex[5].m_u = u[0]; vertex[5].m_v = v[0]; + uint32_t texture_flags = BGFX_TEXTURE_U_CLAMP | BGFX_TEXTURE_V_CLAMP; + if (video_config.filter == 0) + { + texture_flags |= BGFX_TEXTURE_MIN_POINT | BGFX_TEXTURE_MAG_POINT | BGFX_TEXTURE_MIP_POINT; + } + UINT32 blend = PRIMFLAG_GET_BLENDMODE(prim->flags); bgfx::setVertexBuffer(buffer); - bgfx::setTexture(0, m_screen_effect[blend]->uniform("s_tex")->handle(), m_targets->target(screen, "output")->texture()); + bgfx::setTexture(0, m_screen_effect[blend]->uniform("s_tex")->handle(), m_targets->target(screen, "output")->texture(), texture_flags); m_screen_effect[blend]->submit(view); } @@ -809,6 +815,10 @@ int renderer_bgfx::handle_screen_chains() } uint16_t screen_width(floor((prim->bounds.x1 - prim->bounds.x0) + 0.5f)); uint16_t screen_height(floor((prim->bounds.y1 - prim->bounds.y0) + 0.5f)); + if(window().swap_xy()) + { + std::swap(screen_width, screen_height); + } m_targets->update_target_sizes(screen_index, screen_width, screen_height, TARGET_STYLE_NATIVE); process_screen_quad(screen_index, prim); screen_index++; diff --git a/src/osd/modules/render/drawd3d.cpp b/src/osd/modules/render/drawd3d.cpp index 8f18bae8aac..2da64508647 100644 --- a/src/osd/modules/render/drawd3d.cpp +++ b/src/osd/modules/render/drawd3d.cpp @@ -27,7 +27,6 @@ #include "window.h" #include "drawd3d.h" #include "modules/render/d3d/d3dhlsl.h" -#include "d3dtarget.h" //============================================================ diff --git a/src/osd/modules/render/drawd3d.h b/src/osd/modules/render/drawd3d.h index 2f4b675cba2..a35f896c40e 100644 --- a/src/osd/modules/render/drawd3d.h +++ b/src/osd/modules/render/drawd3d.h @@ -54,17 +54,6 @@ public: virtual void record() override; virtual void toggle_fsfx() override; - bool swap_xy() - { - // todo: move to osd_window - bool orientation_swap_xy = - (window().machine().system().flags & ORIENTATION_SWAP_XY) == ORIENTATION_SWAP_XY; - bool rotation_swap_xy = - (window().target()->orientation() & ROT90) == ROT90 || - (window().target()->orientation() & ROT270) == ROT270; - return orientation_swap_xy ^ rotation_swap_xy; - }; - int initialize(); int device_create(HWND device_HWND); diff --git a/src/osd/modules/sync/work_osd.cpp b/src/osd/modules/sync/work_osd.cpp index 9f80c9aec76..72d074e97fc 100644 --- a/src/osd/modules/sync/work_osd.cpp +++ b/src/osd/modules/sync/work_osd.cpp @@ -29,9 +29,6 @@ #include "eminline.h" -#if defined(SDLMAME_MACOSX) -#include "osxutils.h" -#endif #if defined(SDLMAME_LINUX) || defined(SDLMAME_BSD) || defined(SDLMAME_HAIKU) || defined(SDLMAME_EMSCRIPTEN) || defined(SDLMAME_MACOSX) #include <pthread.h> #endif @@ -663,10 +660,6 @@ static void *worker_thread_entry(void *param) work_thread_info *thread = (work_thread_info *)param; osd_work_queue *queue = thread->queue; -#if defined(SDLMAME_MACOSX) - void *arp = NewAutoreleasePool(); -#endif - // loop until we exit for ( ;; ) { @@ -715,10 +708,6 @@ static void *worker_thread_entry(void *param) --queue->livethreads; } -#if defined(SDLMAME_MACOSX) - ReleaseAutoreleasePool(arp); -#endif - return NULL; } diff --git a/src/osd/osdcore.h b/src/osd/osdcore.h index 899f024d9f4..623c3ee3f11 100644 --- a/src/osd/osdcore.h +++ b/src/osd/osdcore.h @@ -774,11 +774,6 @@ void osd_free_executable(void *ptr, size_t size); -----------------------------------------------------------------------------*/ void osd_break_into_debugger(const char *message); - -/*----------------------------------------------------------------------------- - MESS specific code below ------------------------------------------------------------------------------*/ - /*----------------------------------------------------------------------------- osd_get_clipboard_text: retrieves text from the clipboard diff --git a/src/osd/sdl/README_SDL20.txt b/src/osd/sdl/README_SDL20.txt deleted file mode 100644 index 7787bdc5e39..00000000000 --- a/src/osd/sdl/README_SDL20.txt +++ /dev/null @@ -1,130 +0,0 @@ -====================================================================================== -SDLMAME now supports SDL from version 2.0 on upwards. -======================================================================================= - - -Warning -======= - -- SDL2.0 still is still under development, the following may or may not - work. -- if you are using wine on unix be sure to disable wintab32.dll - -Known bugs: -=========== - -* SDL1.3/X11: Some compound keys, e.g. "'" are not supported by SDL driver -* SDL2.0: sdlvideofps does not take -numscreens>1 into account. -* SDL1.3/WIN32: crashes with -rd d3d -* SDL1.3/WIN32: resizing does not work - -Build SDL 2.0 from HG -====================== - -Pull 2.0 from hg. Then - -sh autogen.sh -./configure --prefix=/usr/local/sdl13/ --disable-video-svga --enable-video-directfb --enable-fusionsound -make -[sudo] make install - -You may leave away the last two enables, if you do not want to play around with directfb - although it is lightning fast now :-) - -To build the files in test, do - -cd test -./configure --prefix=/usr/local/sdl13/ --with-sdl-pfx=/usr/local/sdl13 -make - -Replace /usr/local/sdl13 above with a safe location, this may as well be a directory in $HOME. - -Edit sdl.mak to have - -SDL_LIBVER = sdl2 -SDL_INSTALL_ROOT = /usr/local/sdl13 - -That's it. - -make -./mame -video sdl13 -rd opengl dkong - - -All drivers -=========== - -should support: - --waitvsync --prescale --resolution[X] --switchres --numscreens --screen[X] - -The following modes are working: - -SDL13 -===== - -This is driver using SDL texture and line drawing support. It supports --prescale, -filter and -waitvsync. The driver determines which pixel -formats perform best and converts textures to these pixel formats and at -the same time performs any necessary rotation. - -Basic usage examples: - -X11/opengl: ./mamed -video sdl13 -rd opengl mario -DFB/DFB: ./mamed -video sdl13 -vd directfb -rd directfb mario - -The performance of the directfb driver depends on the combined -support of the kernel framebuffer driver and the directfb driver. -Having loaded radeonfb I get the same performance as with the open source -radeon X11 driver. - -Using the SDL software renderer (preferred is -video soft, thought) - -X11,DFB,WIN32 ./mamed -video sdl13 -rd software - -Soft: -===== - -./mamed -mt -video soft -sm none -numscreens 2 mario - -OpenGL: -======= - -Plain opengl does work. Anything more advanced like pbo, fbo or glsl will -most probably not work with more than one screen. - - ./mamed -mt -video opengl mario -nogl_pbo -nogl_vbo -nogl_glsl -numscreens 2 - -YUV - modes: -============ - - ./mamed -mt -video soft -sm yuy2 mario - -Using DirectFB, the following should get you going - - ./mamed -mt -video soft -sm yuy2 -vd directfb -rd directfb mario - -for accelerated blitting on the framebuffer - provided directfb supports it. -At least my Radeon R480 is supported. - --video soft and -scale_mode (-sm) -================================= - -sdlmame supports 7 scale modes using textures in -video soft: - -none: All rendering/scaling in software. - -hwblit: Rendering in software/scaling with hardware (if supported) - -hwbest: Rendering in software/antialiased scaling with hardware (if supported) - -yv12, yv12x2, yuy2, yuy2x2: -Rendering in software / scaling with hardware (if supported) - -Whether these are actually hardware accelerated depends on the SDL driver -and the hardware. The SDL directfb driver supports all above if the hardware -supports it. However, only one YUV-texture per display is supported. -The second window consequently will get "software" YUV blitting. diff --git a/src/osd/sdl/emscripten_post.js b/src/osd/sdl/emscripten_post.js deleted file mode 100644 index 6bfad8790cb..00000000000 --- a/src/osd/sdl/emscripten_post.js +++ /dev/null @@ -1,10 +0,0 @@ -// MAME-JavaScript function mappings -var JSMAME = JSMAME || {}; -JSMAME.get_machine = Module.cwrap('_Z14js_get_machinev', 'number'); -JSMAME.get_ui = Module.cwrap('_Z9js_get_uiv', 'number'); -JSMAME.get_sound = Module.cwrap('_Z12js_get_soundv', 'number'); -JSMAME.ui_set_show_fps = Module.cwrap('_ZN10ui_manager12set_show_fpsEb', '', ['number', 'number']); -JSMAME.ui_get_show_fps = Module.cwrap('_ZNK10ui_manager8show_fpsEv', 'number', ['number']); -JSMAME.sound_manager_mute = Module.cwrap('_ZN13sound_manager4muteEbh', '', ['number', 'number', 'number']); -JSMAME.sdl_pauseaudio = Module.cwrap('SDL_PauseAudio', '', ['number']); -var JSMESS = JSMAME; diff --git a/src/osd/sdl/main.cpp b/src/osd/sdl/main.cpp deleted file mode 100644 index 7a73e6a82a9..00000000000 --- a/src/osd/sdl/main.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -//============================================================ -// -// main.c - Win32 main program -// -//============================================================ - -// standard windows headers -#ifdef OSD_SDL -#define _WIN32_WINNT 0x0400 -#endif -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#include <tchar.h> -#include <stdlib.h> - -// MAMEOS headers -#include "strconv.h" - -extern int utf8_main(int argc, char *argv[]); - - - -//============================================================ -// main -//============================================================ - -// undo the command-line #define that maps main to utf8_main in all other cases -#ifndef WINUI -#undef main -#undef wmain -#endif -#ifdef UNICODE -extern "C" int _tmain(int argc, TCHAR **argv) -{ - int i, rc; - char **utf8_argv; - - /* convert arguments to UTF-8 */ - utf8_argv = (char **) malloc(argc * sizeof(*argv)); - if (utf8_argv == NULL) - return 999; - for (i = 0; i < argc; i++) - { - utf8_argv[i] = utf8_from_tstring(argv[i]); - if (utf8_argv[i] == NULL) - return 999; - } - - /* run utf8_main */ - rc = utf8_main(argc, utf8_argv); - - /* free arguments */ - for (i = 0; i < argc; i++) - osd_free(utf8_argv[i]); - free(utf8_argv); - - return rc; -} -#endif diff --git a/src/osd/sdl/man/LICENSE b/src/osd/sdl/man/LICENSE deleted file mode 100644 index 670154e3538..00000000000 --- a/src/osd/sdl/man/LICENSE +++ /dev/null @@ -1,116 +0,0 @@ -CC0 1.0 Universal - -Statement of Purpose - -The laws of most jurisdictions throughout the world automatically confer -exclusive Copyright and Related Rights (defined below) upon the creator and -subsequent owner(s) (each and all, an "owner") of an original work of -authorship and/or a database (each, a "Work"). - -Certain owners wish to permanently relinquish those rights to a Work for the -purpose of contributing to a commons of creative, cultural and scientific -works ("Commons") that the public can reliably and without fear of later -claims of infringement build upon, modify, incorporate in other works, reuse -and redistribute as freely as possible in any form whatsoever and for any -purposes, including without limitation commercial purposes. These owners may -contribute to the Commons to promote the ideal of a free culture and the -further production of creative, cultural and scientific works, or to gain -reputation or greater distribution for their Work in part through the use and -efforts of others. - -For these and/or other purposes and motivations, and without any expectation -of additional consideration or compensation, the person associating CC0 with a -Work (the "Affirmer"), to the extent that he or she is an owner of Copyright -and Related Rights in the Work, voluntarily elects to apply CC0 to the Work -and publicly distribute the Work under its terms, with knowledge of his or her -Copyright and Related Rights in the Work and the meaning and intended legal -effect of CC0 on those rights. - -1. Copyright and Related Rights. A Work made available under CC0 may be -protected by copyright and related or neighboring rights ("Copyright and -Related Rights"). Copyright and Related Rights include, but are not limited -to, the following: - - i. the right to reproduce, adapt, distribute, perform, display, communicate, - and translate a Work; - - ii. moral rights retained by the original author(s) and/or performer(s); - - iii. publicity and privacy rights pertaining to a person's image or likeness - depicted in a Work; - - iv. rights protecting against unfair competition in regards to a Work, - subject to the limitations in paragraph 4(a), below; - - v. rights protecting the extraction, dissemination, use and reuse of data in - a Work; - - vi. database rights (such as those arising under Directive 96/9/EC of the - European Parliament and of the Council of 11 March 1996 on the legal - protection of databases, and under any national implementation thereof, - including any amended or successor version of such directive); and - - vii. other similar, equivalent or corresponding rights throughout the world - based on applicable law or treaty, and any national implementations thereof. - -2. Waiver. To the greatest extent permitted by, but not in contravention of, -applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and -unconditionally waives, abandons, and surrenders all of Affirmer's Copyright -and Related Rights and associated claims and causes of action, whether now -known or unknown (including existing as well as future claims and causes of -action), in the Work (i) in all territories worldwide, (ii) for the maximum -duration provided by applicable law or treaty (including future time -extensions), (iii) in any current or future medium and for any number of -copies, and (iv) for any purpose whatsoever, including without limitation -commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes -the Waiver for the benefit of each member of the public at large and to the -detriment of Affirmer's heirs and successors, fully intending that such Waiver -shall not be subject to revocation, rescission, cancellation, termination, or -any other legal or equitable action to disrupt the quiet enjoyment of the Work -by the public as contemplated by Affirmer's express Statement of Purpose. - -3. Public License Fallback. Should any part of the Waiver for any reason be -judged legally invalid or ineffective under applicable law, then the Waiver -shall be preserved to the maximum extent permitted taking into account -Affirmer's express Statement of Purpose. In addition, to the extent the Waiver -is so judged Affirmer hereby grants to each affected person a royalty-free, -non transferable, non sublicensable, non exclusive, irrevocable and -unconditional license to exercise Affirmer's Copyright and Related Rights in -the Work (i) in all territories worldwide, (ii) for the maximum duration -provided by applicable law or treaty (including future time extensions), (iii) -in any current or future medium and for any number of copies, and (iv) for any -purpose whatsoever, including without limitation commercial, advertising or -promotional purposes (the "License"). The License shall be deemed effective as -of the date CC0 was applied by Affirmer to the Work. Should any part of the -License for any reason be judged legally invalid or ineffective under -applicable law, such partial invalidity or ineffectiveness shall not -invalidate the remainder of the License, and in such case Affirmer hereby -affirms that he or she will not (i) exercise any of his or her remaining -Copyright and Related Rights in the Work or (ii) assert any associated claims -and causes of action with respect to the Work, in either case contrary to -Affirmer's express Statement of Purpose. - -4. Limitations and Disclaimers. - - a. No trademark or patent rights held by Affirmer are waived, abandoned, - surrendered, licensed or otherwise affected by this document. - - b. Affirmer offers the Work as-is and makes no representations or warranties - of any kind concerning the Work, express, implied, statutory or otherwise, - including without limitation warranties of title, merchantability, fitness - for a particular purpose, non infringement, or the absence of latent or - other defects, accuracy, or the present or absence of errors, whether or not - discoverable, all to the greatest extent permissible under applicable law. - - c. Affirmer disclaims responsibility for clearing rights of other persons - that may apply to the Work or any use thereof, including without limitation - any person's Copyright and Related Rights in the Work. Further, Affirmer - disclaims responsibility for obtaining any necessary consents, permissions - or other rights required for any use of the Work. - - d. Affirmer understands and acknowledges that Creative Commons is not a - party to this document and has no duty or obligation with respect to this - CC0 or use of the Work. - -For more information, please see -<http://creativecommons.org/publicdomain/zero/1.0/> diff --git a/src/osd/sdl/man/README.md b/src/osd/sdl/man/README.md deleted file mode 100644 index 61036986e6a..00000000000 --- a/src/osd/sdl/man/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# **man pages** # - -man pages for MAME and its tools is work of many different contributors, and contain information about usage of MAME and utilities that are comming in package. - -Licensed under [CC0 1.0 Universal (CC0 1.0)](https://creativecommons.org/publicdomain/zero/1.0/)
\ No newline at end of file diff --git a/src/osd/sdl/man/castool.1 b/src/osd/sdl/man/castool.1 deleted file mode 100644 index 1dd96b6eb3f..00000000000 --- a/src/osd/sdl/man/castool.1 +++ /dev/null @@ -1,46 +0,0 @@ -.\" -*- nroff -*- -.\" -.\" castool.1 -.\" -.\" Man page created from usage info -.\" Cesare Falco <c.falco@ubuntu.com>, February 2011 -.\" -.\" -.TH CASTOOL 1 2015-07-22 0.164 "MESS Generic cassette manipulation tool" -.\" -.\" -.\" NAME chapter -.SH NAME -castool \- MESS Generic cassette manipulation tool -.\" -.\" -.\" SYNOPSIS chapter -.SH SYNOPSIS -.B castool convert -.IB "format infile outfile" .wav -.\" -.\" -.\" DESCRIPTION chapter -.SH DESCRIPTION -.B castool -is a tool for the maintenance and manipulation of cassette -dumps that MESS users need to deal with. -.\" -.\" -.\" COMMANDS chapter -.SH COMMANDS -.TP -.B convert -Convert a cassette dump to a .wav audio file. See -.B castool -(without arguments) for a full list of supported cassette formats. -.\" -.\" -.\" EXAMPLES chapter -.SH EXAMPLES -.B castool convert tzx pyjamarama.tzx pyjamarama.wav -.\" -.\" -.\" SEE ALSO chapter -.SH SEE ALSO -mess(6) diff --git a/src/osd/sdl/man/chdman.1 b/src/osd/sdl/man/chdman.1 deleted file mode 100644 index f81b48abdea..00000000000 --- a/src/osd/sdl/man/chdman.1 +++ /dev/null @@ -1,255 +0,0 @@ -.\" -*- nroff -*- -.\" -.\" chdman.1 -.\" -.\" Man page created from source and usage information by -.\" Ashley T. Howes <debiandev@ashleyhowes.com>, February 2005 -.\" updated by Cesare Falco <c.falco@ubuntu.com>, February 2007 -.\" -.TH CHDMAN 1 2015-07-22 0.164 "MAME Compressed Hunks of Data (CHD) manager" -.\" -.\" NAME chapter -.SH NAME -chdman \- MAME Compressed Hunks of Data (CHD) manager -.\" -.\" SYNOPSIS chapter -.SH SYNOPSIS -.B chdman -.I option -.\" -.\" DESCRIPTION chapter -.SH DESCRIPTION -.B chdman -is the (C)ompressed (H)unks of (D)ata (CHD) manager for MAME. -It is a tool to manage CHD images. -.\" -.\" OPTIONS chapter -.SH OPTIONS -Please note that each option allows a set of switches, the meaning of each -is explained in the \fBSWITCHES\fR section below. Whenever the short form -for the switch is listed, the long one may be used instead. -.TP -.B help \fR[\fIoption\fR] -Print a summary of the available options or, if \fIoption\fR is given, a -detailed list of the valid switches for the option. -.TP -.B info \ -\-i \fIfilename\fR \ -[\fB\-v\fR] -Dump the header information from a drive image. -.TP -.B verify \ -\-i \fIfileiname\fR \ -[\fB\-ip \fIfilename\fR] -Validate the MD5/SHA1 on a drive image. -.TP -.B createraw \ -\-o \fIfilename\fR \ -[\fB\-op \fIfilename\fR] \ -[\fB\-f\fR] \ -\fB\-i \fIfilename\fR \ -[\fB\-isb \fIoffset\fR] \ -[\fB\-ish \fIoffset\fR] \ -[\fB\-ib \fIlength\fR] \ -[\fB\-ih \fIlength\fR] \ -\fB\-hs \fIbytes\fR \ -\fB\-us \fIbytes\fR \ -[\fB\-c none\fR|type1[,[...]]] \ -[\fB\-np \fIprocessors\fR] -Create a new compressed raw image from a raw file. -.TP -.B createhd \ -\-o \fIfilename\fR \ -[\fB\-op \fIfilename\fR] \ -[\fB\-f\fR] \ -[\fB\-i \fIfilename\fR] \ -[\fB\-isb \fIoffset\fR] \ -[\fB\-ish \fIoffset\fR] \ -[\fB\-ib \fIlength\fR] \ -[\fB\-ih \fIlength\fR] \ -[\fB\-hs \fIbytes\fR] \ -[\fB\-c none\fR|type1[,[...]]] \ -[\fB\-chs \fIcylinders\fB,\fIheads\fB,\fIsectors\fR] \ -[\fB\-ss \fIbytes\fR] \ -[\fB\-np \fIprocessors\fR] -Create a new compressed hard disk image from a raw file. -.TP -.B createcd \ -\-o \fIfilename\fR \ -[\fB\-op \fIfilename\fR] \ -[\fB\-f\fR] \ -\fB\-i \fIfilename\fR \ -[\fB\-hs \fIbytes\fR] \ -[\fB\-c none\fR|type1[,[...]]] \ -[\fB\-np \fIprocessors\fR] -Create a new compressed CD image from a raw file. -.TP -.B createld \ -\-o \fIfilename\fR \ -[\fB\-op \fIfilename\fR] \ -[\fB\-f\fR] \ -\fB\-i \fIfilename\fR \ -[\fB\-isf \fIoffset\fR] \ -[\fB\-if \fIlength\fR] \ -[\fB\-hs \fIbytes\fR] \ -[\fB\-c none\fR|type1[,[...]]] \ -[\fB\-np \fIprocessors\fR] -Create a new compressed laserdisc image from a raw file. -.TP -.B extractraw \ -\-o \fIfilename\fR \ -[\fB\-f\fR] \ -\fB\-i \fIfilename\fR \ -[\fB\-ip \fIfilename\fR] \ -[\fB\-isb \fIoffset\fR] \ -[\fB\-ish \fIoffset\fR] \ -[\fB\-ib \fIlength\fR] \ -[\fB\-ih \fIlength\fR] -Extract a raw file from a CHD image. -.TP -.B extracthd \ -\-o \fIfilename\fR \ -[\fB\-f\fR] \ -\fB\-i \fIfilename\fR \ -[\fB\-ip \fIfilename\fR] \ -[\fB\-isb \fIoffset\fR] \ -[\fB\-ish \fIoffset\fR] \ -[\fB\-ib \fIlength\fR] \ -[\fB\-ih \fIlength\fR] -Extract a hard disk block image from a CHD image. -.TP -.B extractcd \ -\-o \fIfilename\fR \ -[\fB\-ob \fIfilename\fR] \ -[\fB\-f\fR] \ -\fB\-i \fIfilename\fR \ -[\fB\-ip \fIfilename\fR] -Extract a CDRDAO .toc/.bin, CDRWIN .bin/.cue, or Sega Dreamcast .GDI file from a CHD\-CD image. -.TP -.B extractld \ -\-o \fIfilename\fR \ -[\fB\-f\fR] \ -\fB\-i \fIfilename\fR \ -[\fB\-ip \fIfilename\fR] \ -[\fB\-isf \fIoffset\fR] \ -[\fB\-if \fIlength\fR] -Extract a laserdisc image from a CHD\-LD image. -.TP -.B copy \ -\-o \fIfilename\fR \ -[\fB\-op \fIfilename\fR] \ -[\fB\-f\fR] \ -\fB\-i \fIfilename\fR \ -[\fB\-ip \fIfilename\fR] \ -[\fB\-isb \fIoffset\fR] \ -[\fB\-ish \fIoffset\fR] \ -[\fB\-ib \fIlength\fR] \ -[\fB\-ih \fIlength\fR] \ -\fB\-hs \fIbytes\fR \ -[\fB\-c none\fR|type1[,[...]]] \ -[\fB\-np \fIprocessors\fR] -Copy all hunks of data from one CHD file to another. The hunk sizes do not need to match. -If the source is shorter than the destination, the source data will be padded with 0s. -.TP -.B addmeta \ -\fB\-i \fIfilename\fR \ -\fB\-t \fItag\fR \ -[\fB\-ix \fIindex\fR] \ -[\fB\-vt \fItext\fR] \ -[\fB\-vf \fIfilename\fR] \ -[\fB\-nocs\fR] -Add metadata to the chd. -.TP -.B delmeta \ -\fB\-i \fIfilename\fR \ -\fB\-t \fItag\fR \ -[\fB\-ix \fIindex\fR] -Remove metadata from the chd. -.TP -.B dumpmeta \ -\fB\-i \fIfilename\fR \ -[\fB\-o \fIfilename\fR] \ -[\fB\-f\fR] \ -\fB\-t \fItag\fR \ -[\fB\-ix \fIindex\fR] -Dump metadata from the chd to standard output or to a file. -.\" -.\" SWITCHES chapter -.SH SWITCHES -.TP -.B \-\-chs, \-chs \fIcylinders,heads,sectors -Specifies CHS geometry values for CHD harddisks. -.TP -.B \-\-compression, \-c \fInone\fR|\fItype1\fR[,[...]] -Which compression codecs to use (up to 4). -.TP -.B \-\-force, \-f -Force overwriting an existing file. -.TP -.B \-\-hunksize, \-hs \fIbytes -Size of each unit, in hunks. -.TP -.B \-\-ident, \-id \fIfilename -Name of ident file to provide CHS information. -.TP -.B \-\-index, \-ix \fIindex -Indexed instance of the metadata tag. -.TP -.B \-\-input, \-i \fIfilename -Input file name. -.TP -.B \-\-inputbytes, \-ib \fIlength -Effective length of the input in bytes. -.TP -.B \-\-inputframes, \-if \fIlength -Effective length of the input in frames. -.TP -.B \-\-inputhunks, \-ih \fIlength -Effective length of the input in hunks. -.TP -.B \-\-inputparent, \-ip \fIfilename -Parent CHD's input file name. -.TP -.B \-\-inputstartbyte, \-isb \fIoffset -Starting byte offset within the input. -.TP -.B \-\-inputstartframe, \-isf \fIoffset -Starting frame offset within the input. -.TP -.B \-\-inputstarthunk, \-ish \fIoffset -Starting hunk offset within the input. -.TP -.B \-\-nochecksum, \-nocs -Do not include this metadata information in the overall SHA-1. -.TP -.B \-\-numprocessors, \-np \fIcount -Limits the number of processors to use during compression. -.TP -.B \-\-output, \-o \fIfilename -Output file name. -.TP -.B \-\-outputbin, \-ob \fIfilename -Output binary file name for extractcd. -.TP -.B \-\-outputparent, \-op \fIfilename -Parent CHD's output file name. -.TP -.B \-\-sectorsize, \-ss \fIbytes -Size of each hard disk sector. -.TP -.B \-\-tag, \-t \fItag -4-character tag for metadata. -.TP -.B \-\-valuefile, \-vf \fIfilename -Text file containing data to add. -.TP -.B \-\-valuetext, \-vt \fItext -Text for the metadata. -.TP -.B \-\-unitsize, \-us \fIbytes -Size of each unit, in bytes. -.TP -.B \-\-verbose, \-v -Output additional information about the operation. -.SH SEE ALSO -mame(6), mess(6) diff --git a/src/osd/sdl/man/floptool.1 b/src/osd/sdl/man/floptool.1 deleted file mode 100644 index 24d8e97c46a..00000000000 --- a/src/osd/sdl/man/floptool.1 +++ /dev/null @@ -1,47 +0,0 @@ -.\" -*- nroff -*- -.\" -.\" floptool.1 -.\" -.\" Man page created from usage info -.\" Cesare Falco <c.falco@ubuntu.com>, April 2014 -.\" -.\" -.TH FLOPTOOL 1 2015-07-22 0.164 "MESS Generic floppy manipulation tool" -.\" -.\" -.\" NAME chapter -.SH NAME -floptool \- MESS Generic floppy image manipulation tool -.\" -.\" -.\" SYNOPSIS chapter -.SH SYNOPSIS -.B floptool -.I option -.\" -.\" -.\" DESCRIPTION chapter -.SH DESCRIPTION -.B floptool -is a tool for the maintenance and manipulation of floppy disk -images that MESS users need to deal with. -.\" -.\" -.\" COMMANDS chapter -.SH COMMANDS -.TP -.B identify \fIinputfile\fR [\fIinputfile \fR... ] -Determine the format of a floppy disk image. -.TP -.B convert [\fIinputformat\fR|\fIauto\fR] \fIoutputformat inputfile outputfile -Convert a floppy disk image to a different format. -.\" -.\" -.\" EXAMPLES chapter -.SH EXAMPLES -.B floptool identify image.dsk -.\" -.\" -.\" SEE ALSO chapter -.SH SEE ALSO -mess(6) diff --git a/src/osd/sdl/man/imgtool.1 b/src/osd/sdl/man/imgtool.1 deleted file mode 100644 index 819da84de06..00000000000 --- a/src/osd/sdl/man/imgtool.1 +++ /dev/null @@ -1,157 +0,0 @@ -.\" -*- nroff -*- -.\" -.\" imgtool.1 -.\" -.\" Man page created from usage info and imgtool.txt -.\" Cesare Falco <c.falco@ubuntu.com>, February 2011 -.\" -.\" -.TH IMGTOOL 1 2015-07-22 0.164 "MESS media image manipulation tool" -.\" -.\" -.\" NAME chapter -.SH NAME -imgtool \- MESS media image manipulation tool -.\" -.\" -.\" SYNOPSIS chapter -.SH SYNOPSIS -.B imgtool create -.I format image -.RI [ option " ...]" -.br -.B imgtool dir -.I format image -.RI [ path ] -.br -.B imgtool get -.I format image file -.RI [ newname ] -.RB [ \-\-filter=\c -.IR filter ] -.RB [ \-\-fork=\c -.IR fork ] -.br -.B imgtool put -.IR "format image file " ... -.RI [ newname ] -.RI [ option " ...]" -.RB [ \-\-filter=\c -.IR filter ] -.RB [ \-\-fork=\c -.IR fork ] -.br -.B imgtool getall -.I format image -.RI [ path ] -.RB [ \-\-filter=\c -.IR filter ] -.br -.B imgtool del -.IR "format image file " ... -.br -.B imgtool mkdir -.I format image directory -.br -.B imgtool rmdir -.IR "format image directory " ... -.br -.BR "imgtool readsector" | writesector -.I format image track head sector file -.br -.B imgtool identify -.I image -.br -.BR "imgtool listformats" | listfilters -.br -.B imgtool -.B listdriveroptions -.I format -.\" -.\" -.\" DESCRIPTION chapter -.SH DESCRIPTION -.B imgtool -is a tool for the maintenance and manipulation of disk and -other types of images that MESS users need to deal with. Functions -include retrieving and storing files and CRC checking and validation. -Image files can also be within .zip files. -.\" -.\" -.\" OPTIONS chapter -.SH OPTIONS -.TP -.B create -Creates and image. Optional, image\-specific parameters can be -specified, see -.B imgtool listdriveroptions -command for a full list. -.TP -.B dir -Lists the contents of an image. -.TP -.B get -Gets a single file from an image. A filter can be specified to convert -custom file formats to ASCII, see -.B imgtool listfilters -command for a full list. File can optionally be renamed. -.TP -.B put -Puts file(s) on an image (wildcards and rename supported). -Filters are supplied to convert ASCII files to custom file formats, -see -.B imgtool listfilters -command for a full list. -.TP -.B getall -Gets all files off an image. Filters can be specified to convert -custom file formats to ASCII, see -.B imgtool listfilters -command for a full list. -.TP -.B del -Deletes a file on an image. -.TP -.B mkdir -Create a directory on an image. -.TP -.B rmdir -Delete directories on an image. -.TP -.B readsector -Extract content of a single sector from an image to a file. -.TP -.B writesector -Write file content to a specific sector on an image. -.TP -.B identify -Try to recognize the format of an image file. -.TP -.B listformats -Lists all image file formats supported by imgtool. -.TP -.B listfilters -Lists all filters supported by imgtool. -Filters are a mean to process data being written into or read out -of an image in a certain way. -.TP -.B listdriveroptions -Lists all format\-specific options for -.B imgtool put -and -.B imgtool create -commands. -.\" -.\" -.\" EXAMPLES chapter -.SH EXAMPLES -.B imgtool dir coco_jvc_rsdos myimageinazip.zip -.P -.B imgtool get coco_jvc_rsdos myimage.dsk myfile.bin mynewfile.txt -.P -.B imgtool getall coco_jvc_rsdos myimage.dsk -.\" -.\" -.\" SEE ALSO chapter -.SH SEE ALSO -mess (6) diff --git a/src/osd/sdl/man/jedutil.1 b/src/osd/sdl/man/jedutil.1 deleted file mode 100644 index e93d07a8e22..00000000000 --- a/src/osd/sdl/man/jedutil.1 +++ /dev/null @@ -1,49 +0,0 @@ -.\" -*- nroff -*- -.\" -.\" jedutil.1 -.\" -.\" Man page created from source and usage information -.\" Cesare Falco <c.falco@ubuntu.com>, February 2007 -.\" -.\" References -.\" http://aarongiles.com/?p=159 -.\" -.TH JEDUTIL 1 2015-07-22 0.164 "MAME JEDEC file utilities" -.\" -.\" NAME chapter -.SH NAME -jedutil \- MAME JEDEC file utilities -.\" -.\" SYNOPSIS chapter -.SH SYNOPSIS -.B jedutil -.RI [ option ] -.\" -.\" DESCRIPTION chapter -.SH DESCRIPTION -Data for Programmable Logic Devices (PLDs) are usually stored in a format known -as JEDEC, basically a text file allowing insertion of further information by -programmers. -.PP -MAME uses a raw binary representation of the same data, in order to -achieve correct identification of PLD data through CRC and SHA1 algorithms -(i.e. with the \-romident option). -.PP -.B jedutil -provides an easy way to convert PLDs data between these two formats. -.\" -.\" OPTIONS chapter -.SH OPTIONS -.TP -.B \-convert \fIinputfile outputfile \fR[\fIfuses\fR] -Converts JEDEC data between file formats. Both .jed (JEDEC) and .pla -(Berkeley standard PLA) files can be converted to a .bin (binary) file, -while a binary file can be converted to a .jed file only. -.TP -.B \-view \fIinputfile device -Dump logic equations. \fIinputfile\fR can be either a JED or binary file. -.TP -.B \-viewlist -View list of supported devices. -.SH SEE ALSO -mame(6), mess(6) diff --git a/src/osd/sdl/man/ldplayer.1 b/src/osd/sdl/man/ldplayer.1 deleted file mode 100644 index 40c0cb34794..00000000000 --- a/src/osd/sdl/man/ldplayer.1 +++ /dev/null @@ -1,52 +0,0 @@ -.\" -*- nroff -*- -.\" -.\" ldplayer.1 -.\" -.\" Man page created from source and usage information by -.\" Cesare Falco <c.falco@ubuntu.com>, August 2008 -.\" -.TH LDPLAYER 1 2012-03-25 0.145u5 "ldplayer" -.\" -.\" -.\" NAME chapter -.SH NAME -ldplayer \- MAME laserdisc image player -.\" -.\" -.\" SYNOPSIS chapter -.SH SYNOPSIS -.B ldplayer pr8210 -\-rompath \fI/path/to/pr8210.zip\fP\fB\\;\fP\fI/path/to/image.chd\fP -.\" -.\" -.\" DESCRIPTION chapter -.SH DESCRIPTION -.B ldplayer -is an optional utility that simply plays the audio and video from laserdisc -CHD files. It actually emulates and therefore behaves just like a real -laserdisc player \- you can pause, fast-forward, rewind, and all the rest. -.\" -.\" -.\" NOTES chapter -.SH NOTES -First of all, you need to go to your MAME ROMs folder and make a copy of -\fBcubeqst.zip\fP (the ROMs for Cube Quest). Rename it as \fBpr8210.zip\fP. -.P -Next, run ldplayer. -Note that the first path in the \fB\-rompath\fP option is the full path -to the \fBpr8210.zip\fP file and the second is the full path to the laserdisc -CHD file you wish to play. \fINote\fP the backslash and the semicolon -\- \fB\\;\fP \- between them. -.P -Once ldplayer is running, you can hit \fBTAB\fP like usual and check out -Inputs (this game) to see the controls. Space is the Play/Pause button, for -instance. Note that some laserdiscs (notably Cube Quest) have 30 seconds or -more of nothing at the start, so you either need to be patient or use -fast-forward to start seeing video. -.\" -.\" -.\" FILES chapter -.SH FILES -.TP -.B /etc/mame/ldplayer.ini -Main configuration file. diff --git a/src/osd/sdl/man/ldresample.1 b/src/osd/sdl/man/ldresample.1 deleted file mode 100644 index c56b8af2c06..00000000000 --- a/src/osd/sdl/man/ldresample.1 +++ /dev/null @@ -1,46 +0,0 @@ -.\" Hey, EMACS: -*- nroff -*- -.\" First parameter, NAME, should be all caps -.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection -.\" other parameters are allowed: see man(7), man(1) -.\" -.TH LDRESAMPLE 1 2015-07-22 0.164 "MAME laserdisc audio manipulation tool" -.\" -.\" Please adjust this date whenever revising the manpage. -.\" -.\" Some roff macros, for reference: -.\" .nh disable hyphenation -.\" .hy enable hyphenation -.\" .ad l left justify -.\" .ad b justify to both left and right margins -.\" .nf disable filling -.\" .fi enable filling -.\" .br insert line break -.\" .sp <n> insert n+1 empty lines -.\" for manpage-specific macros, see man(7) -.SH "NAME" -ldresample \- MAME laserdisc audio manipulation tool -.SH "SYNOPSIS" -.B ldresample -.I source.chd -.br -.B ldresample -.I source.chd -.I output.chd -.B offset -.B [slope] -.SH "DESCRIPTION" -Assists in resynchronizing audio tracks in a CHD (Compressed Hunks of Data) -file with frames. -.PP -.B Offset -parameter and \fBslope\fR option make a linear equation f(x) which -describes the sample offset from the source as a function of field number. -.SH "COPYRIGHT" -Copyright \(co 2008 Aaron Giles. BSD License. -.SH "SEE ALSO" -ldverify(1), mame(6), mess(6) -.SH "AUTHORS" -Written by Aaron Giles. -.PP -This manual page was written by Ludovic Lechapt <ludomatic@gmail.com>, -for the Debian project but may be used by others. diff --git a/src/osd/sdl/man/ldverify.1 b/src/osd/sdl/man/ldverify.1 deleted file mode 100644 index aae404164cb..00000000000 --- a/src/osd/sdl/man/ldverify.1 +++ /dev/null @@ -1,25 +0,0 @@ -.\" -*- nroff -*- -.\" -.\" ldverify.1 -.\" -.\" Man page created from source and usage information by -.\" Cesare Falco <c.falco@ubuntu.com>, August 2008 -.\" -.TH LDVERIFY 1 2015-07-22 0.164 "MAME laserdisc data checker" -.\" -.\" NAME chapter -.SH NAME -ldverify \- MAME laserdisc data checker -.\" -.\" SYNOPSIS chapter -.SH SYNOPSIS -.B ldverify \fR[\fIavifile.avi\fR|\fIchdfile.chd\fR] -.\" -.\" DESCRIPTION chapter -.SH DESCRIPTION -.B ldverify -is a tool which walks through either an AVI or CHD capture from a -laserdisc and ensures that there are no anomalies lurking in -the VBI data. -.SH SEE ALSO -ldresample(1), mame(6), mess(6) diff --git a/src/osd/sdl/man/mame.6 b/src/osd/sdl/man/mame.6 deleted file mode 100644 index 87e260ced5b..00000000000 --- a/src/osd/sdl/man/mame.6 +++ /dev/null @@ -1,1176 +0,0 @@ -.\" -*- nroff -*- -.\" -.\" mame.6 -.\" -.\" Man page created from usage and source information: -.\" * commands: see src/emu/clifront.c clifront.h -.\" * options: core entries, see src/emu/emuopts.c emuopts.h -.\" SDL-specific entries, see src/osd/sdl/sdlmain.c osdsdl.h -.\" Cesare Falco <c.falco@ubuntu.com>, February 2007 -.\" -.\" Also, some text borrowed from the xmame 0.106 man page, -.\" done by Rene Herrmann <rene.herrmann@berlin.de>, September 2000 -.\" and updated by Andrew Burton <burtona@gol.com>, July 2003 -.\" -.\" -.TH MAME 6 2015-07-22 0.164 "MAME \- The Multiple Arcade Machine Emulator" -.\" -.\" -.\" NAME chapter -.SH NAME -MAME \- The Multiple Arcade Machine Emulator -.\" -.\" -.\" SYNOPSIS chapter -.SH SYNOPSIS -.B mame -.RI [ options ] -.I gamename -.\" -.\" -.\" DESCRIPTION chapter -.SH DESCRIPTION -Started in 1997 by Nicola Salmoria, MAME was originally intended as a series -of emulators for individual games, which were later combined into a single -multi\-game emulator. In the following years, MAME grew over and over up to -the actual size, with more than 100 contributors to the project. -.\" -.\" -.\" OPTIONS chapter -.SH OPTIONS -.\" -.\" ******************************************************* -.SS Core commands -.\" ******************************************************* -.TP -.B \-help, \-? -Displays current MAME version and copyright notice. -.TP -.B \-validate, \-valid -Performs internal validation on every driver in the system. Run this -before submitting changes to ensure that you haven't violated any of -the core system rules. -.\" -.\" ******************************************************* -.SS Configuration commands -.\" ******************************************************* -.TP -.B \-createconfig, \-cc -Creates the default \fBmame.ini\fR file in the current directory. All the -configuration options (not commands) described below can be permanently -changed by editing this configuration file. -.TP -.B \-showconfig, \-sc -Displays the current configuration settings. -.TP -.B \-showusage, \-su -Displays a summary of all the command line options. For options that -are not mentioned here, the short summary given by \fB\-showusage\fR -is usually sufficient. -.\" -.\" ******************************************************* -.SS Frontend commands -.\" ******************************************************* -All the list commands below write info to the screen. -If you wish to write the info to a textfile instead, use redirection. -For example, -.B mame \-listxml > ~/mamelist.xml -writes the full list of supported game to file \fImamelist.xml\fR in your home -directory. -.TP -.B \-listxml, \-lx \fR[\fIgamename\fR|\fIwildcard\fR] -List comprehensive details for all of the supported games. The output -is quite long, so it is usually better to redirect this into a file. -The output is in XML format. By default all games are listed; however, -you can limit this list by specifying a driver name or wildcard after -the \-listxml command. -.TP -.B \-listfull, \-ll \fR[\fIgamename\fR|\fIwildcard\fR] -Displays a list of game driver names and descriptions. By default all -games are listed; however, you can limit this list by specifying a -driver name or wildcard after the \-listfull command. -.TP -.B \-listsource, \-ls \fR[\fIgamename\fR|\fIwildcard\fR] -Displays a list of drivers and the names of the source files their game -drivers live in. Useful for finding which driver a game runs on in -order to fix bugs. By default all games are listed; however, you can -limit this list by specifying a driver name or wildcard after the -\-listsource command. -.TP -.B \-listclones, \-lc \fR[\fIgamename\fR|\fIwildcard\fR] -Displays a list of clones. By default all clones are listed; however, -you can limit this list by specifying a driver name or wildcard after -the \-listclones command. -.TP -.B \-listbrothers, \-lb \fR[\fIgamename\fR|\fIwildcard\fR] -Displays a list of "brothers" or other drivers from same sourcefile. -By default all games are listed; however, you can limit this list by -specifying a driver name or wildcard after the \-listbrothers command. -.TP -.B \-listcrc -Displays a full list of CRCs of all ROM images referenced by all -drivers within MAME code. -.TP -.B \-listroms, \-lr \fIgamename -Displays a list of ROM images referenced by the specified game. -.TP -.B \-listsamples \fIgamename -Displays a list of samples referenced by the specified game. -.TP -.B \-verifyroms \fR[\fIgamename\fR|\fIwildcard\fR] -Checks for invalid or missing ROM images. By default all drivers that -have valid ZIP files or directories in the rompath are verified; -however, you can limit this list by specifying a driver name or -wildcard after the \-verifyroms command. -.TP -.B \-verifysamples \fR[\fIgamename\fR|\fIwildcard\fR] -Checks for invalid or missing samples. By default all drivers that -have valid ZIP files or directories in the samplepath are verified; -however, you can limit this list by specifying a driver name or -wildcard after the \-verifyroms command. -.TP -.B \-romident -Attempts to identify ROM files, if they are known to MAME, in the -specified .zip file or directory. This command can be used to try and -identify ROM sets taken from unknown boards. On exit, the errorlevel -is returned as one of the following: -.br -\fB0\fR all files were identified -.br -\fB7\fR all files were identified except for some "non\-ROM" files -.br -\fB8\fR some files were identified -.br -\fB9\fR no files were identified -.TP -.B \-listdevices, \-ld -Output the list of devices referenced by a given game or set of games. -.TP -.B \-listslots, \-lslot -Output the list of available slots and slot devices for the system. -.TP -.B \-listmedia, \-lm -Output the list of available media for the system. -.TP -.B \-listsoftware, \-lsoft -Output the list of known software for the system. -.TP -.B \-verifysoftware, \-vsoft \fR[\fIgamename\fR|\fIwildcard\fR] -Checks for invalid or missing ROM images in your software lists. -By default all drivers that have valid ZIP files or directories -in the rompath are verified; however, you can limit this list by -specifying a specific driver name or wildcard. -.TP -.B \-getsoftlist, \-glist -Retrieve software list by name. -.TP -.B \-verifysoftlist, \-vlist \fR[\fIsoftwarelistname\fR] -Checks a specified software list for missing ROM images if files exist -for issued softwarelistname. By default, all drivers that have valid -ZIP files or directories in the rompath are verified; however, you can -limit this list by specifying a specific softwarelistname (without .XML). -.TP -.B \-listmidi, \-mlist -Create a list of list available MIDI I/O devices for use with emulation. -.TP -.B \-listnetwork, \-nlist -List available network adapters. -.\" -.\" ******************************************************* -.SS Configuration options -.\" ******************************************************* -.TP -.B \-[no]readconfig, \-[no]rc -Enables or disables the reading of the config files. When enabled -(which is the default), MAME reads the following config files in order: -.br -1. \fBmame.ini\fR -.br -the main configuration file -.br -2. \fIname\fB.ini\fR -.br -where \fIname\fR is your executable name, i.e. mame unless you changed it -(e.g. if you renamed mame to mame0137, the parsed file will be -\fImame0137.ini\fR) -.br -3. \fBdebug.ini\fR, if the debugger is enabled -.br -4. \fBvector.ini\fR, for vector games only -.br -5. \fI[driver]\fB.ini\fR -.br -based on the source filename of the game driver -.br -6. \fI[parent]\fB.ini\fR -.br -for clones only, may be called recursively -.br -7. \fI[gamename]\fB.ini\fR -.br -note this sometimes resolves to the same of the source driver -.br -The settings in the later ini's override those in the earlier ini's. -So, for example, if you wanted to disable overlay effects in the -vector games, you can create a vector.ini with the "effect none" line -in it, and it will override whatever effect value you have in your -mame.ini. The default is ON (\-readconfig). -.TP -.B \-[no]writeconfig, \-[no]wc -Write configuration to \fI[driver]\fR.ini on exit. -Default is OFF (\-nowriteconfig). -.\" -.\" ******************************************************* -.SS Search path options -.\" ******************************************************* -Be careful to use the path, directory and file options in -mame.ini \fBONLY\fR. Otherwise, the outcome may be unpredictable and not -consistent across releases. -.TP -.B \-rompath, \-rp, \-biospath, \-bp \fIpathname -Specifies a list of paths within which to find ROM or hard disk images. -Multiple paths can be specified by separating them with semicolons. -The default is 'roms' (that is, a directory "roms" in the same directory -as the MAME executable). -.TP -.B \-hashpath \fIpathname -Specifies a list of paths within which to search for software hash files. -Multiple paths can be specified by separating them with semicolons. -The default is 'hash' (that is, a directory 'hash' in the same directory -as the MAME executable). -.TP -.B \-samplepath, \-sp \fIpathname -Specifies a list of paths within which to find sample files. Multiple -paths can be specified by separating them with semicolons. The default -is 'samples' (that is, a directory "samples" in the same directory as -the MAME executable). -.TP -.B \-artpath, \-artwork_directory \fIpathname -Specifies a list of paths within which to find artwork files. Multiple -paths can be specified by separating them with semicolons. The default -is 'artwork' (that is, a directory "artwork" in the same directory as -the MAME executable). -.TP -.B \-ctrlrpath, \-ctrlr_directory \fIpathname -Specifies a list of paths within which to find controller\-specific -configuration files. Multiple paths can be specified by separating -them with semicolons. The default is 'ctrlr' (that is, a directory -"ctrlr" in the same directory as the MAME executable). -.TP -.B \-inipath \fIpathname -Specifies a list of paths within which to find .INI files. Multiple -paths can be specified by separating them with semicolons. The default -is '/etc/mame/'. -.TP -.B \-fontpath \fIpathname -Specifies a list of paths within which to find .BDF font files. Multiple -paths can be specified by separating them with semicolons. The default -is '.' (that is, search in the same directory as the MAME executable). -.TP -.B \-cheatpath \fIpathname -Specifies a list of paths within which to find cheat files. Multiple -paths can be specified by separating them with semicolons. The default -is 'cheat' (that is, a directory 'cheat' in the same directory as -the MAME executable). -.TP -.B \-crosshairpath \fIpathname -Specifies a list of paths within which to find crosshair files. Multiple -paths can be specified by separating them with semicolons. The default -is 'crosshair' (that is, a directory "crosshair" in the same directory as -the MAME executable). If the Crosshair is set to default in the menu, -MAME will look for gamename\cross#.png and then cross#.png in the -specified crosshairpath, where # is the player number. Failing that, -MAME will use built\-in default crosshairs. -.\" -.\" ******************************************************* -.SS Output Directory Options -.\" ******************************************************* -.TP -.B \-cfg_directory \fIpathname -Specifies a single directory where configuration files are stored. -Configuration files store user configurable settings that are read at -startup and written when MAME exits. The default is 'cfg' (that is, -a directory "cfg" in the same directory as the MAME executable). If this -directory does not exist, it will be automatically created. -.TP -.B \-nvram_directory \fIpathname -Specifies a single directory where NVRAM files are stored. NVRAM files -store the contents of EEPROM and non\-volatile RAM (NVRAM) for games -which used this type of hardware. This data is read at startup and -written when MAME exits. The default is 'nvram' (that is, a directory -"nvram" in the same directory as the MAME executable). If this directory -does not exist, it will be automatically created. -.TP -.B \-input_directory \fIpathname -Specifies a single directory where input recording files are stored. -Input recordings are created via the \-record option and played back via -the \-playback option. The default is 'inp' (that is, a directory -"inp" in the same directory as the MAME executable). If this directory -does not exist, it will be automatically created. -.TP -.B \-state_directory \fIpathname -Specifies a single directory where save state files are stored. Save -state files are read and written either upon user request, or when using -the \-autosave option. The default is 'sta' (that is, a directory "sta" -in the same directory as the MAME executable). If this directory does -not exist, it will be automatically created. -.TP -.B \-snapshot_directory \fIpathname -Specifies a single directory where screen snapshots are stored, when -requested by the user. The default is 'snap' (that is, a directory -"snap" in the same directory as the MAME executable). If this directory -does not exist, it will be automatically created. -.TP -.B \-diff_directory \fIpathname -Specifies a single directory where hard drive differencing files are -stored. Hard drive differencing files store any data that is written -back to a hard disk image, in order to preserve the original image. The -differencing files are created at startup when a game with a hard disk -image. The default is 'diff' (that is, a directory "diff" in the same -directory as the MAME executable). If this directory does not exist, -it will be automatically created. -.TP -.B \-comment_directory \fIpathname -Specifies a single directory where debugger comment files are stored. -Debugger comment files are written by the debugger when comments are -added to the disassembly for a game. The default is 'comments' (that is, -a directory "comments" in the same directory as the MAME executable). -If this directory does not exist, it will be automatically created. -.\" -.\" ******************************************************* -.SS State/playback options -.\" ******************************************************* -.TP -.B \-state \fIslot -Immediately after starting the specified game, will cause the save -state in the specified \fIslot\fP to be loaded. -.TP -.B \-[no]autosave -When enabled, automatically creates a save state file when exiting MAME -and automatically attempts to reload it when later starting MAME with -the same game. This only works for games that have explicitly enabled -save state support in their driver. The default is OFF (\-noautosave). -.TP -.B \-playback, \-pb \fIfilename -Specifies a file from which to play back a series of game inputs. This -feature does not work reliably for all games, but can be used to watch -a previously recorded game session from start to finish. In order to -make things consistent, you should only record and playback with all -configuration (.cfg), NVRAM (.nv), and memory card files deleted. The -default is NULL (no playback). -.TP -.B \-[no]exit_after_playback -If play back is enabled (see \-playback option) the program exits when -end of file is reached. Otherwise the machine will continue to run. -Default is OFF (\-noexit_after_playback). -.TP -.B \-record, \-rec \fIfilename -Specifies a file to record all input from a game session. This can be -used to record a game session for later playback. This feature does not -work reliably for all games, but can be used to watch a previously -recorded game session from start to finish. In order to make things -consistent, you should only record and playback with all configuration -(.cfg), NVRAM (.nv), and memory card files deleted. The default is NULL -(no recording). -.TP -.B \-[no]record_timecode -Specify whether to create a timecode file. It contains a line with elapsed -times on each press of timecode shortcut key (default is F12). -This option works only when recording mode is enabled (\-record option). -The file is saved on inp folder. -Default is OFF (\-norecord_timecode). -.TP -.B \-mngwrite \fIfilename -Writes each video frame to the given \fIfilename\fP in MNG format, producing -an animation of the game session. Note that \-mngwrite only writes video -frames; it does not save any audio data. Use \-wavwrite for that, and -reassemble the audio/video using offline tools. The default is NULL (no -recording). -.TP -.B \-aviwrite \fIfilename -Stream video and sound data to the given \fIfilename\fP in AVI format, -producing an animation of the game session complete with sound. The -default is NULL (no recording). -.TP -.B \-wavwrite \fIfilename -Writes the final mixer output to the given \fIfilename\fP in WAV format, -producing an audio recording of the game session. The default is NULL -(no recording). -.TP -.B \-snapname \fIstring -Describes how MAME should name files for snapshots. \fIstring\fP -provides a template that is used to generate a filename. Three -simple substitutions are provided: the / character represents the -path separator on any target platform (even Windows); the literal \fB%g\fP -represents the driver name of the current game; and the literal \fB%i\fP -represents an incrementing index. If \fB%i\fP is omitted, then each -snapshot taken will overwrite the previous one; otherwise, MAME will -find the next empty value for \fB%i\fP and use that for a filename. The -default is \fB%g/%i\fP, which creates a separate folder for each game, -and names the snapshots under it starting with 0000 and increasing -from there. Example: if you use -.B mame robby \-snapname foo/%g%i -snapshots will be saved as \fBsnaps/foo/robby0000.png\fP, -\fBsnaps/foo/robby0001.png\fP and so on. -.TP -.B \-snapsize \fIwidth\fPx\fIheight -Hard\-codes the size for snapshots and movie recording. By default, -MAME will create snapshots at the game's current resolution in raw -pixels, and will create movies at the game's starting resolution in -raw pixels. If you specify this option, then MAME will create both -snapshots and movies at the size specified, and will bilinear filter -the result. Note that this size does not automatically rotate if the -game is vertically oriented. The default is 'auto'. -.TP -.B \-snapview internal\fR|\fBauto\fR|\fIviewname -Specifies the view to use when rendering snapshots and movies. By -default, both use a special 'internal' view, which renders a separate -snapshot per screen or renders movies only of the first screen. By -specifying this option, you can override this default behavior and -select a single view that will apply to all snapshots and movies. -Note that \fIviewname\fP does not need to be a perfect match; rather, it -will select the first view whose name matches all the characters -specified by \fIviewname\fP. For example, \-snapview native will match the -"Native (15:14)" view even though it is not a perfect match. -\fIviewname\fP can also be 'auto', which selects the first view with all -screens present. The default value is 'internal'. -.TP -.B \-[no]snapbilinear -Specify whether snapshot/movie should have bilinear filtering applied. -Default is ON (\-snapbilinear). -.TP -.B \-statename \fIstring -Describes how MAME should store save state files, relative to the -state_directory path. \fIstring\fP provides a template that -is used to generate a relative path. Two simple substitutions are -provided: the / character represents the path separator on any target -platform (even Windows); the literal \fB%g\fP represents the driver name of -the current game. The default is '%g', which creates a separate folder -for each game. Example: if you use -.B mame robby \-statename foo/%g -save states will be stored inside \fBsta/foo/robby/\fP. -.TP -.B \-[no]burnin -Tracks brightness of the screen during play and at the end of -emulation generates a PNG that can be used to simulate burn\-in -effects on other games. The resulting PNG is created such that the -least used\-areas of the screen are fully white (since burned\-in areas -are darker, all other areas of the screen must be lightened a touch). -The intention is that this PNG can be loaded via an artwork file with -a low alpha (e.g, 0.1\-0.2 seems to work well) and blended over the -entire screen. The PNG files are saved in the snap directory under -the gamename\\burnin\-<screen.name>.png. The default is OFF (\-noburnin). -.\" -.\" ******************************************************* -.SS Performance options -.\" ******************************************************* -.TP -.B \-[no]autoframeskip, \-[no]afs -Automatically determines the frameskip level while you're playing the -game, adjusting it constantly in a frantic attempt to keep the game -running at full speed. Turning this on overrides the value you have set -for \-frameskip below. The default is OFF (\-noautoframeskip). -.TP -.B \-frameskip, \-fs \fIvalue -Specifies the frameskip value (autoframeskip must be disabled). This is the -number of frames out of every 12 to drop when running. For example, if you -say \-frameskip 2, then MAME will display 10 out of every 12 frames. By -skipping those frames, you may be able to get full speed in a game that -requires more horsepower than your computer has. The default value is 0, -which skips no frames. -.TP -.B \-seconds_to_run, \-str \fIvalue -This option can be used for benchmarking and automated testing. It tells -MAME to stop execution after a fixed number of seconds. By combining -this with a fixed set of other command line options, you can set up a -consistent environment for benchmarking MAME performance. In addition, -upon exit, the \-str option will write a screenshot called final.png -to the game's snapshot directory. -.TP -.B \-[no]throttle -Configures the default thottling setting. When throttling is on, MAME -attempts to keep the game running at the game's intended speed. When -throttling is off, MAME runs the game as fast as it can. Note that the -fastest speed is more often than not limited by your graphics card, -especially for older games. The default is ON (\-throttle). -.TP -.B \-[no]sleep -Allows MAME to give time back to the system when running with \-throttle. -This allows other programs to have some CPU time, assuming that the -game isn't taxing 100% of your CPU resources. This option can potentially -cause hiccups in performance if other demanding programs are running. -The default is ON (\-sleep). -.TP -.B \-speed \fIvalue -Controls the speed of gameplay, relative to realtime; smaller numbers are -slower. Default is 1.00. -.TP -.B \-[no]refreshspeed, \-[no]rs -Automatically adjusts the \fB\-speed\fR parameter to keep the effective refresh -rate below that of the lowest screen refresh rate. -Default is OFF (\-norefreshspeed). -.\" -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" OS specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.TP -.B \-[no]multithreading, \-[no]mt -Enable multithreading; this enables rendering and blitting on a separate -thread. The default is OFF (\-nomultithreading). -.TP -.B \-numprocessors, \-np \fIvalue -Set number of processors; this overrides the number the system reports. -.TP -.B \-bench \fIvalue -Benchmark for the given number of emulated seconds; -implies \-video none \-sound none \-nothrottle. -.\" -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.TP -.B \-[no]sdlvideofps -Show SDL video performance. Default is OFF (\-nosdlvideofps). -.\" -.\" ******************************************************* -.SS Rotation options -.\" ******************************************************* -.TP -.B \-[no]rotate -Rotate the game to match its normal state (horizontal/vertical). This -ensures that both vertically and horizontally oriented games show up -correctly without the need to rotate your monitor. If you want to keep -the game displaying 'raw' on the screen the way it would have in the -arcade, turn this option OFF. The default is ON (\-rotate). -.TP -.B \-[no]ror | \-[no]rol -Rotate the game screen to the right (clockwise) or left (counter\- -clockwise) relative to either its normal state (if \-rotate is specified) -or its native state (if \-norotate is specified). -Default for both is OFF (\-noror \-norol). -.TP -.B \-[no]autoror | \-[no]autorol -These options are designed for use with pivoting screens that only -pivot in a single direction. If your screen only pivots clockwise, -use \-autorol to ensure that the game will fill the screen either -horizontally or vertically in one of the directions you can handle. -If your screen only pivots counter\-clockwise, use \-autoror. -Default for both is OFF (\-noautoror \-noautorol). -.TP -.B \-[no]flipx \-[no]flipy -Flip (mirror) the game screen either horizontally (\-flipx) or -vertically (\-flipy). The flips are applied after the \-rotate and -\-ror/\-rol options are applied. -Default for both is OFF (\-noflipx \-noflipy). -.\" -.\" ******************************************************* -.SS Artwork options -.\" ******************************************************* -.TP -.B \-[no]artwork_crop, \-[no]artcrop -Enable cropping of artwork to the game screen area only. This -option can also be controlled via the Video Options menu in the user -interface. The default is OFF (\-noartwork_crop). -.TP -.B \-[no]use_backdrops, \-[no]backdrop -Enables/disables the display of backdrops. The default is ON -(\-use_backdrops). -.TP -.B \-[no]use_overlays, \-[no]overlay -Enables/disables the display of overlays. The default is ON -(\-use_overlays). -.TP -.B \-[no]use_bezels, \-[no]bezel -Enables/disables the display of bezels. The default is ON -(\-use_bezels). -.TP -.B \-[no]use_cpanels, \-[no]cpanel -Enables/disables the display of cpanels. The default is ON -(\-use_bezels). -.TP -.B \-[no]use_marquees, \-[no]marquee -Enables/disables the display of marquees. The default is ON -(\-use_bezels). -.\" -.\" ******************************************************* -.SS Screen options -.\" ******************************************************* -.TP -.B \-brightness \fIvalue -Controls the default brightness, or black level, of the game screens. -This option does not affect the artwork or other parts of the display. -Using the MAME UI, you can individually set the brightness for each game -screen; this option controls the initial value for all visible game -screens. The standard value is 1.0. Selecting lower values (down to 0.1) -will produce a darkened display, while selecting higher values (up to -2.0) will give a brighter display. The default is 1.0. -.TP -.B \-contrast \fIvalue -Controls the contrast, or white level, of the game screens. This option -does not affect the artwork or other parts of the display. Using the -MAME UI, you can individually set the contrast for each game screen; -this option controls the initial value for all visible game screens. The -standard value is 1.0. Selecting lower values (down to 0.1) will produce -a dimmer display, while selecting higher values (up to 2.0) will -give a more saturated display. The default is 1.0. -.TP -.B \-gamma \fIvalue -Controls the gamma, which produces a potentially nonlinear black to -white ramp, for the game screens. This option does not affect the -artwork or other parts of the display. Using the MAME UI, you can -individually set the gamma for each game screen; this option controls -the initial value for all visible game screens. The standard value is -1.0, which gives a linear ramp from black to white. Selecting lower -values (down to 0.1) will increase the nonlinearity toward black, -while selecting higher values (up to 3.0) will push the nonlinearity -toward white. The default is 1.0. -.TP -.B \-pause_brightness \fIvalue -This controls the brightness level when MAME is paused. The default -value is 0.65. -.TP -.B \-effect\fR [\fInone\fR|\fIfilename[.png]\fR] -Name of a PNG file to use for visual effects, or 'none'. Default is 'none'. -.\" -.\" ******************************************************* -.SS Vector rendering options -.\" ******************************************************* -.TP -.B \-[no]antialias, \-[no]aa -Enables antialiased line rendering for vector games. The default is ON -(\-antialias). -.TP -.B \-beam \fIvalue -Sets the width of the vectors. This is a scaling factor against the -standard vector width. A value of 1.0 will keep the default vector line -width. Smaller values will reduce the width, and larger values will -increase the width. The default is 1.0. -.TP -.B \-flicker \fIvalue -Simulates a vector "flicker" effect, similar to a vector monitor that -needs adjustment. This option requires a float argument in the range of -0.00\-100.00 (0=none, 100=maximum). The default is 0. -.\" -.\" ******************************************************* -.SS Video options -.\" ******************************************************* -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.TP -.B \-video\fR [\fIsoft\fR|\fIopengl\fR|\fInone\fR] -Specifies which video subsystem to use for drawing: -.br -\fBsoft\fR uses software rendering, which is slower but more compatible. -.br -\fBopengl\fR uses OpenGL and your graphics accelerator to speed up many -aspects of drawing MAME including compositing artwork, overlays, and -bezels, as well as stretching the image to fit your screen. -output on some cards. -.br -\fBnone\fR does no drawing and is intended for CPU benchmarking. -.br -Default is SOFT. -.TP -.B \-[no]window, \-[no]w -Run MAME in either full screen or a window. This is a fully\-featured window -mode where the window resizes as necessary to track what the game does. -And you can resize it yourself with your OS's standard window controls. -The default is OFF (\-nowindow). -.TP -.B \-[no]maximize, \-[no]max -Controls initial window size in windowed mode. If it is set on, the -window will initially be set to the maximum supported size when you -start MAME. If it is turned off, the window will start out at the -smallest supported size. This option only has an effect when the -\-window option is used. The default is ON (\-maximize). -.TP -.B \-[no]keepaspect, \-[no]ka -Forces the correct aspect ratio. This means when you're resizing the window -in windowed mode the actual game image will resize in discrete steps to -maintain the proper shape of the game graphics. If you turn this off you can -resize the window to anything you like and get funny squishing and stretching. -The same applies for full\-screen. Default is ON (\-keepaspect). -.TP -.B \-[no]unevenstretch, \-[no]ues -Allow non\-integer stretch factors. Video purists should stay far, far away -from this option, while everyone else will be happy to know that it lets you -fill the screen properly in full\-screen mode. Default is ON (\-unevenstretch). -.TP -.B \-[no]centerh -Center horizontally within the view area. Default is ON (\-centerh). -.TP -.B \-[no]centerv -Center vertically within the view area. Default is ON (\-centerv). -.TP -.B \-[no]waitvsync, \-[no]vs -Enable waiting for the start of VBLANK before flipping screens; -reduces tearing effects. Default is OFF (\-nowaitvsync). -.TP -.B \-[no]syncrefresh, \-[no]srf -Enable using the start of VBLANK for throttling instead of the game time. -Default is OFF (\-nosyncrefresh). -.\" -.\" ******************************************************* -.SS Software video rendering subsystem options -.\" ******************************************************* -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.B NOTE: -All the options in this group are available only with softare video -rendering subsystem, i.e \fB\-video soft\fR. -.TP -.B \-prescale\fR [\fIvalue\fR] -Scale screen rendering by this amount in software. Default is 1. -.TP -.B \-scalemode, \-sm \fR[\fInone\fR|\fIasync\fR|\fIyv12\fR|\fIyuy2\fR|\fIyv12x2\fR|\fIyuy2x2\fR] -Hardware scaling mode. -.br -\fBnone\fR use software rendering. -.br -\fBasync\fR async overlay. -.br -\fByv12\fR yv12 overlay. -.br -\fByuy2\fR yuy2 overlay. -.br -\fByv12x2\fR yv12 overlay using x2 prescaling. -.br -\fByuy2x2\fR yuy2 overlay using x2 prescaling. -.br -Default is NONE. -.\" -.\" ******************************************************* -.SS OpenGL video rendering subsystem options -.\" ******************************************************* -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.B NOTE: -All the options in this group are available only with OpenGL video -rendering subsystem, i.e \fB\-video opengl\fR or \fB\-video opengl16\fR. -.TP -.B \-[no]filter, \-[no]glfilter, \-[no]flt -Enable bilinear filtering on screen output. Default is ON (\-filter). -.TP -.B \-prescale\fR [\fIvalue\fR] -Scale screen rendering by this amount in software. Default is 1. -.TP -.B \-[no]gl_forcepow2texture -Force power of two textures. Default is OFF (\-nogl_forcepow2texture). -.TP -.B \-[no]gl_notexturerect -Don't use OpenGL GL_ARB_texture_rectangle. Turn off if -corruption occurs in OpenGL mode, at cost of some performance -loss. Default is ON (\-gl_notexturerect). -.TP -.B \-[no]gl_vbo -Enable OpenGL VBO, if available, for a performance increase. -Turn off if corruption occurs. Default is ON (\-gl_vbo). -.TP -.B \-[no]gl_pbo -Enable OpenGL PBO, if available, for a performance increase. -Turn off if corruption occurs. Default is ON (\-gl_pbo). -.TP -.B \-[no]gl_glsl -Enable OpenGL GLSL, if available, for a performance increase. -Default is OFF (\-nogl_glsl). -.TP -.B \-gl_glsl_filter \fIvalue -Enable OpenGL GLSL filtering instead of FF filtering 0=plain, 1=bilinear. -Default is 1: bilinear. -.TP -.B \-glsl_shader_mame[0\-9] -Preferred custom OpenGL GLSL shader set mame bitmap (from 0 to 9). -.TP -.B \-glsl_shader_screen[0\-9] -Preferred custom OpenGL GLSL shader screen bitmap (from 0 to 9). -.TP -.B \-gl_glsl_vid_attr -Enable OpenGL GLSL handling of brightness and contrast. Better RGB game -performance for free. Default is ON. -.TP -.B \-screen -Explicit name for all screens; 'auto' here will try to make a best guess. -.TP -.B \-aspect, \-screen_aspect -Aspect ratio for all screens; 'auto' here will try to make a best guess. -.TP -.B \-resolution, \-r -Preferred resolution for all screens; -format is \fIwidth\fRx\fIheight\fR[@\fIrefreshrate\fR] or 'auto'. -.TP -.B \-view -Preferred view for all screens -.TP -.B \-screen[0\-3] -Explicit name of the first|second|third|fourth screen; 'auto' here will try -to make a best guess. -.TP -.B \-aspect[0\-3] -Aspect ratio of the first|second|third|fourth screen; 'auto' here will try -to make a best guess. -.TP -.B \-resolution[0\-3], \-r[0\-3] -Preferred resolution for the first|second|third|fourth screen; -format is \fIwidth\fRx\fIheight\fR[@\fIrefreshrate\fR] or 'auto'. -.TP -.B \-view[0\-3] -Preferred view for the first|second|third|fourth screen. -.\" -.\" ******************************************************* -.SS Full screen options -.\" ******************************************************* -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.TP -.B \-[no]switchres -Affects full screen mode only. Chooses if MAME can try to change the screen -resolution (color depth is normally left alone) when in full\-screen mode. If -it's off, you always get your desktop resolution in full\-screen mode (which can -be useful for LCDs). Default is OFF (\-noswitchres). -.TP -.B \-[no]useallheads -Split full screen image across monitors. Default is OFF (\-nouseallheads). -.\" -.\" ******************************************************* -.SS Sound options -.\" ******************************************************* -.TP -.B \-[no]sound -Enable or disable sound altogether. The default is ON (\-sound). -.TP -.B \-samplerate, \-srf \fIvalue -Sets the audio sample rate. Smaller values (e.g. 11025) cause lower -audio quality but faster emulation speed. Higher values (e.g. 48000) -cause higher audio quality but slower emulation speed. The default is -48000. -.TP -.B \-[no]samples -Use samples if available. The default is ON (\-samples). -.TP -.B \-volume, \-vol \fIvalue -Sets the startup volume. It can later be changed with the user interface -(see Keys section). The volume is an attenuation in dB: e.g., -"\-volume \-12" will start with \-12dB attenuation. The default is 0. -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.TP -.B \-audio_latency \fIvalue -This controls the amount of latency built into the audio streaming. -The latency parameter controls the lower threshold. The default is 1 -(meaning lower=1/5 and upper=2/5). Set it to 2 (\-audio_latency 2) to keep -the sound buffer between 2/5 and 3/5 full. If you crank it up to 4, -you can definitely notice the lag. -.\" -.\" ******************************************************* -.SS Input options -.\" ******************************************************* -.TP -.B \-[no]coin_lockout, \-[no]coinlock -Enables simulation of the "coin lockout" feature that is implmeneted -on a number of game PCBs. It was up to the operator whether or not -the coin lockout outputs were actually connected to the coin -mechanisms. If this feature is enabled, then attempts to enter a coin -while the lockout is active will fail and will display a popup message -in the user interface. If this feature is disabled, the coin lockout -signal will be ignored. The default is ON (\-coin_lockout). -.TP -.B \-ctrlr \fIcontroller -Enables support for special controllers. Configuration files are -loaded from the ctrlrpath. They are in the same format as the .cfg -files that are saved, but only control configuration data is read -from the file. The default is NULL (no controller file). -.TP -.B \-[no]mouse -Controls whether or not MAME looks for a mouse controller to use. Note -that in many cases, lightguns are treated as mice by the operating -system, so you may need to enable this to enable lightgun support. When -this is enabled, you will not be able to use your mouse while playing -a game. If you want to get control of your computer back, you will need -to either pause the game or quit. The default is OFF (\-nomouse). -.TP -.B \-[no]joystick, \-[no]joy -Controls whether or not MAME looks for joystick/gamepad controllers. -The default is ON (\-joystick). -.TP -.B \-[no]lightgun, \-[no]gun -Controls whether or not MAME makes use of lightgun controllers. -Note that most lightguns map to the mouse, so using \-lightgun and -\-mouse together may produce strange results. The default is OFF -(\-nolightgun). -.TP -.B \-[no]multikeyboard, \-[no]multikey -Determines whether MAME differentiates between multiple keyboards. -Some systems may report more than one keyboard; by default, the data -from all of these keyboards is combined so that it looks like a single -keyboard. Turning this option on will enable MAME to report keypresses -on different keyboards independently. The default is OFF -(\-nomultikeyboard). -.TP -.B \-[no]multimouse -Determines whether MAME differentiates between multiple mice. Some -systems may report more than one mouse device; by default, the data -from all of these mice is combined so that it looks like a single -mouse. Turning this option on will enable MAME to report mouse -movement and button presses on different mice independently. The -default is OFF (\-nomultimouse). -.TP -.B \-[no]steadykey, \-[no]steady -Some games require two or more buttons to be pressed at exactly the -same time to make special moves. Due to limitations in the PC keyboard -hardware, it can be difficult or even impossible to accomplish that -using the standard keyboard handling. This option selects a different -handling that makes it easier to register simultaneous button presses, -but has the disadvantage of making controls less responsive. The -default is OFF (\-nosteadykey). -.TP -.B \-[no]ui_active -Enable MAME user interface on top of emulated keyboard (if present). -Default is OFF (\-noui_active). -.TP -.B \-[no]offscreen_reload, \-[no]reload -Controls whether or not MAME treats a second button input from a -lightgun as a reload signal. In this case, MAME will report the gun's -position as (0,MAX) with the trigger held, which is equivalent to an -offscreen reload. This is only needed for games that required you to -shoot offscreen to reload, and then only if your gun does not support -off screen reloads. The default is OFF (\-nooffscreen_reload). -.TP -.B \-joystick_map, \-joymap \fImap -Controls how joystick values map to digital joystick controls. -See /usr/share/doc/mame/config.txt for full details on \fImap\fR format. -.TP -.B \-joystick_deadzone, \-joy_deadzone, \-jdz \fIvalue -If you play with an analog joystick, the center can drift a little. -joystick_deadzone tells how far along an axis you must move before the -axis starts to change. This option expects a float in the range of -0.0 to 1.0. Where 0 is the center of the joystick and 1 is the outer -limit. The default is 0.3. -.TP -.B \-joystick_saturation, \-joy_saturation, \-jsat \fIvalue -If you play with an analog joystick, the ends can drift a little, -and may not match in the +/\- directions. joystick_saturation tells how -far along an axis movement change will be accepted before it reaches -the maximum range. This option expects a float in the range of 0.0 to -1.0, where 0 is the center of the joystick and 1 is the outer limit. -The default is 0.85. -.TP -.B \-[no]natural, \-[no]nat -Allows user to specify whether or not to use a natural keyboard. -This allows you to start your game or system in a 'native' mode, depending -on your region, allowing compatibility for non\-"QWERTY" style keyboards. -The default is OFF (\-nonatural). -.TP -.B \-[no]joystick_contradictory, \-[no]joy_contradictory -Enable contradictory direction digital joystick input at the same time. -Default is OFF (\-nojoystick_contradictory). -.TP -.B \-coin_impulse \fItime -Set coin impulse time. A negative value for \fItime\fR disables the impulse; -set \fItime\fR to 0 to obey driver or give a positive value to set impulse time. -.\" -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.TP -.B \-uimodekey, \-umk -Specifies the key used to toggle between full and partial UI mode. -.TP -.B \-[no]keymap -Enable keymap for non\-QWERTY keyboards. Used in conjunction with -\fB\-keymap_file\fR. Default is OFF (\-nokeymap). -.TP -.B \-keymap_file \fIkeymap_file\fR -Specifies the full path to the keymap file to be used. A few -keymap files are available in \fB/usr/share/games/mess/keymaps\fR. -.TP -.B \-joy_idx[0\-8] \fIjoystick -With these options you can assign a joystick to a -specific index in MAME. Even if the kernel will list the joysticks -in a different order on the next boot, MAME will still see the joystick -as e.g. "Joystick 2". Use mame \-v to see which joysticks are recognized. -Default is 'auto'. -.TP -.B \-[no]sixaxis -Use special handling for PS3 Sixaxis controllers. -Default is OFF (\-nosixaxis). -.TP -.B \-lightgun_index[1\-8] -Map lightgun to specific index in MAME. -.TP -.B \-videodriver, \-vd \fIx11\fR|\fIdirectfb\fR|\fIauto\fR -SDL video driver to use; auto selects SDL default. -.TP -.B \-audiodriver, \-ad \fIalsa\fR|\fIarts\fR|\fIauto\fR -SDL audio driver to use; auto selects SDL default. -.TP -.B \-gl_lib \fIalsa\fR|\fIarts\fR|\fIauto\fR -Alternative libGL.so to use; auto selects SDL default. -.\" -.\" ******************************************************* -.SS Input automatic enable options -.\" ******************************************************* -.TP -.B \-paddle_device, \-paddle \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR] -.TP -.B \-adstick_device, \-adstick \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR] -.TP -.B \-pedal_device, \-pedal \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR] -.TP -.B \-dial_device, \-dial \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR] -.TP -.B \-trackball_device, \-trackball \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR] -.TP -.B \-lightgun_device \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR] -.TP -.B \-positional_device \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR] -.TP -.B \-mouse_device \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR] -Each of these options controls autoenabling the mouse, or joystick -depending on the presence of a particular class of analog -control for a particular game. For example, if you specify the option -\-paddle mouse, then any game that has a paddle control will automatically -enable mouse controls just as if you had explicitly specified \-mouse. -Note that these controls override the values of \-[no]mouse, \-[no]joystick, etc. -.\" -.\" ******************************************************* -.SS Debugging options -.\" ******************************************************* -.TP -.B \-[no]log -Creates a file called error.log which contains all of the internal -log messages generated by the MAME core and game drivers. The default -is OFF (\-nolog). -.TP -.B \-[no]verbose, \-[no]v -Displays internal diagnostic information. This information is very -useful for debugging problems with your configuration. \fBIMPORTANT\fP: when -reporting bugs, please run with mame \-verbose and include the resulting -information. The default is OFF (\-noverbose). -.TP -.B \-[no]update_in_pause -Enables updating the screen bitmap while the game is paused. This is -useful for debuggin in some scenarios (and gets in the way in others). -Default is OFF (\-noupdate_in_pause). -.TP -.B \-[no]debug, \-[no]d -Activates the integrated debugger. By default, the debugger is entered -by pressing the tilde (~) key during emulation. It is also entered -immediately at startup. The default is OFF (\-nodebug). -.TP -.B \-debugscript \fIfilename -Specifies a file that contains a list of debugger commands to execute -immediately upon startup. The default is NULL (no commands). -.\" -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.TP -.B \-debugger \fIdebugger_name -Name of the debugger to use. Default is AUTO. -.TP -.B \-debugger_font, \-dfont \fIfont_name -Specifies the font to use for debugging. Default is AUTO. -.TP -.B \-debugger_font_size, \-dfontsize \fIsize -Specifies the font size to use for debugging. -.TP -.B \-[no]oslog -Outputs the error.log data to the system debugger. This can be used at -the same time as \-log to output the log data to both targets as well. -Default is OFF (\-nooslog). -.\" -.\" ******************************************************* -.SS Misc options -.\" ******************************************************* -.TP -.B \-[no]drc -Enable DRC cpu core if available. Default is ON (\-drc). -.TP -.B \-[no]drc_use_c -Force DRC use C backend. Default is OFF (\-nodrc_use_c). -.TP -.B \-[no]drc_log_uml -Write DRC UML disassembly log. Default is OFF (\-nodrc_log_uml). -.TP -.B \-[no]drc_log_native -Write DRC native disassembly log. Default is OFF (\-no_drc_log_native). -.TP -.B \-bios \fIbiosname -Specifies the specific BIOS to use with the current game, for game -systems that make use of a BIOS. The \-listxml output will list all of -the possible BIOS names for a game. The default is 'default'. -.TP -.B \-[no]cheat, \-[no]c -Activates the cheat menu with autofire options and other tricks from -the cheat database, if present. -The default is OFF (\-nocheat). -.TP -.B \-[no]skip_gameinfo -Forces MAME to skip displaying the game info screen. The default is OFF -(\-noskip_gameinfo). -.TP -.B \-uifont \fIfontname -Specifies the name of a BDF font file to use for the UI font. If this -font cannot be found or cannot be loaded, the system will fall back -to its built\-in UI font. On some platforms \fIfontname\fP can be a system -font name instead of a BDF font file. The default is 'default' (use -the OSD\-determined default font). -.TP -.B \-ramsize, \-ram \fIvalue -Size of RAM (if supported by driver). -.TP -.B \-[no]confirm_quit -Display confirm quit screen on exit. Default is ON (\-confirm_quit). -.TP -.B \-[no]ui_mouse -Display UI mouse cursor. Default is OFF (\-noui_mouse). -.TP -.B \-autoboot_command, \-ab \fIcommand -Command string to execute after machine boot (in quotes ""). To issue -a quote to the emulation, use \fB"""\fP in the string. -Using \fB\\n\fP will issue a create a new line, issuing what was -typed prior as a command. Example: -\fB\-autoboot_command "load """$""",8,1\\n"\fP. -.TP -.B \-autoboot_delay \fR[\fIvalue\fP] -Timer delay (in seconds) to trigger command execution on autoboot. -Default is 2. -.TP -.B \-autoboot_script, \-script \fR[\fIfilename.lua\fP] -File containing scripting to execute after machine boot. -.TP -.B \-[no]http -Enable local http server. Default is OFF (\-nohttp). -.TP -.B \-http_port \fIport -Internal webserver listener port. -.TP -.B \-http_path \fIpath -Path to web files. Default is /usr/share/games/mess/web. -.TP -.B \-[no]console -Enable emulator LUA console. Default is OFF (\-noconsole). -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.TP -.B \-watchdog \fIvalue -Specifies a number of seconds after which MAME should automatically exit -if it detects that the emulation has locked up. -.\" -.\" -.\" SEE ALSO chapter -.SH SEE ALSO -chdman(1), jedutil(1), ldresample(1), ldverify(1), romcmp(1), testkeys(1) -.\" -.\" -.\" LEGAL NOTICE chapter -.SH LEGAL NOTICE -Please visit the MAME website for some important legal information: -.PP -http://mamedev.org/legal.html diff --git a/src/osd/sdl/man/mess.6 b/src/osd/sdl/man/mess.6 deleted file mode 100644 index 3062b2a613b..00000000000 --- a/src/osd/sdl/man/mess.6 +++ /dev/null @@ -1,1183 +0,0 @@ -.\" -*- nroff -*- -.\" -.\" mess.6 -.\" -.\" Man page created from usage and source information: -.\" * commands: see src/emu/clifront.c clifront.h -.\" * options: core entries, see src/emu/emuopts.c emuopts.h -.\" SDL-specific entries, see src/osd/sdl/sdlmain.c osdsdl.h -.\" Cesare Falco <c.falco@ubuntu.com>, March 2011 -.\" -.\" Some text borrowed from the xmame 0.106 man page, -.\" done by Rene Herrmann <rene.herrmann@berlin.de>, September 2000 -.\" and updated by Andrew Burton <burtona@gol.com>, July 2003 -.\" -.\" Other info's taken from MESS Wiki as well: -.\" http://www.mess.org/ -.\" -.\" -.TH MESS 6 2015-05-20 0.162 "The Multiple Emulator Super System (MESS)" -.\" -.\" -.\" NAME chapter -.SH NAME -MESS \- The Multiple Emulator Super System -.\" -.\" -.\" SYNOPSIS chapter -.SH SYNOPSIS -.B mess -.I system -.RI [ "media software" ] -.RI [ options ] -.\" -.\" -.\" DESCRIPTION chapter -.SH DESCRIPTION -MESS documents the hardware for a wide variety of (mostly vintage) computers, -video game consoles, and calculators through software emulation. As a nice -side effect, MESS allows software and games for these hardware platforms -to run on modern PCs. -.\" -.\" -.\" SOFTWARE chapter -.SH SOFTWARE -A \fIsoftware\fR entry may be specified to attach an image file to the -emulated system. In such a case, the appropriate \fImedia\fR switch -is also required: -.TP -.B \-cart, \-cart1 -Cartrigde, used mainly by game consoles -.TP -.B \-cass -Cassette (tape), widely used by old home computers -.TP -.B \-flop, -flop1 -Floppy disk -.TP -.B \-cdrom -CD-Rom -.\" -.\" -.\" OPTIONS chapter -.SH OPTIONS -.\" -.\" ******************************************************* -.SS Core commands -.\" ******************************************************* -.TP -.B \-help, \-? -Displays current MESS version and copyright notice. -.TP -.B \-validate, \-valid -Performs internal validation on every driver in MESS. Run this -before submitting changes to ensure that you haven't violated any of -the core system rules. -.\" -.\" ******************************************************* -.SS Configuration commands -.\" ******************************************************* -.TP -.B \-createconfig, \-cc -Creates the default \fBmess.ini\fR file in the current directory. All the -configuration options (not commands) described below can be permanently -changed by editing this configuration file. -.TP -.B \-showconfig, \-sc -Displays the current configuration settings. -.TP -.B \-showusage, \-su -Displays a summary of all the command line options. For options that -are not mentioned here, the short summary given by \fB\-showusage\fR -is usually sufficient. -.\" -.\" ******************************************************* -.SS Frontend commands -.\" ******************************************************* -All the list commands below write info to the screen. -If you wish to write the info to a textfile instead, use redirection. -For example, -.B mess \-listxml > ~/messlist.xml -writes the full list of supported systems to \fBmesslist.xml\fR in your -home directory. -.TP -.B \-listxml, \-lx \fR[\fIsystem\fR|\fIwildcard\fR] -List comprehensive details for all of the supported systems. The output -is quite long, so it is usually better to redirect this into a file. -The output is in XML format. By default all systems are listed; however, -you can limit this list by specifying a driver name or wildcard. -.TP -.B \-listfull, \-ll \fR[\fIsystem\fR|\fIwildcard\fR] -Displays a list of system driver names and descriptions. By default all -systems are listed; however, you can limit this list by specifying a -driver name or wildcard. -.TP -.B \-listsource, \-ls \fR[\fIsystem\fR|\fIwildcard\fR] -Displays a list of drivers and the names of the source files their system -drivers live in. Useful for finding which driver a system runs on in -order to fix bugs. By default all systems are listed; however, you can -limit this list by specifying a driver name or wildcard. -.TP -.B \-listclones, \-lc \fR[\fIsystem\fR|\fIwildcard\fR] -Displays a list of clones. By default all clones are listed; however, -you can limit this list by specifying a driver name or wildcard. -.TP -.B \-listbrothers, \-lb \fR[\fIsystem\fR|\fIwildcard\fR] -Displays a list of "brothers" or other drivers from same sourcefile. -By default all systems are listed; however, you can limit this list by -specifying a driver name or wildcard. -.TP -.B \-listcrc -Displays a full list of CRCs of all ROM images referenced by all -drivers within MESS code. -.TP -.B \-listroms, \-lr \fIsystem -Displays a list of ROM images referenced by the specified system. -.TP -.B \-listsamples \fIsystem -Displays a list of samples referenced by the specified system. -.TP -.B \-verifyroms \fR[\fIsystem\fR|\fIwildcard\fR] -Checks for invalid or missing ROM images. By default all drivers that -have valid ZIP files or directories in the rom path are verified; -however, you can limit this list by specifying a driver name or -wildcard. -.TP -.B \-verifysamples \fR[\fIsystem\fR|\fIwildcard\fR] -Checks for invalid or missing samples. By default all drivers that -have valid ZIP files or directories in the samplepath are verified; -however, you can limit this list by specifying a driver name or wildcard. -.TP -.B \-romident -Attempts to identify ROM files, if they are known to MESS, in the -specified .zip file or directory. This command can be used to try and -identify ROM sets taken from unknown boards. On exit, the errorlevel -is returned as one of the following: -.br -\fB0\fR all files were identified -.br -\fB7\fR all files were identified except for some "non\-ROM" files -.br -\fB8\fR some files were identified -.br -\fB9\fR no files were identified -.TP -.B \-listdevices, \-ld -Output the list of devices referenced by a given system or set of systems. -.TP -.B \-listslots, \-lslot -Output the list of available slots and slot devices for the system. -.TP -.B \-listmedia, \-lm -Output the list of available media for the system. -.TP -.B \-listsoftware, \-lsoft -Output the list of known software for the system. -.TP -.B \-verifysoftware, \-vsoft \fR[\fIgamename\fR|\fIwildcard\fR] -Checks for invalid or missing ROM images in your software lists. -By default all drivers that have valid ZIP files or directories -in the rompath are verified; however, you can limit this list by -specifying a specific driver name or wildcard. -.TP -.B \-getsoftlist, \-glist -Retrieve software list by name. -.TP -.B \-verifysoftlist, \-vlist \fR[\fIsoftwarelistname\fR] -Checks a specified software list for missing ROM images if files exist -for issued softwarelistname. By default, all drivers that have valid -ZIP files or directories in the rompath are verified; however, you can -limit this list by specifying a specific softwarelistname (without .XML). -.TP -.B \-listmidi, \-mlist -List available MIDI I/O devices. -.TP -.B \-listnetwork, \-nlist -List available network adapters. -.\" -.\" ******************************************************* -.SS Configuration options -.\" ******************************************************* -.TP -.B \-[no]readconfig, \-[no]rc -Enables or disables the reading of the config files. When enabled -(which is the default), MESS reads the following config files in order: -.br -1. \fBmess.ini\fR -.br -the main configuration file -.br -2. \fI[driver]\fB.ini\fR -.br -based on the source file name of the system driver -.br -3. \fI[parent]\fB.ini\fR -.br -for clones only, may be called recursively -.br -4. \fI[system]\fB.ini\fR -.br -note this sometimes resolves to the same of the source driver -.P -The settings in the later ini's override those in the earlier ini's. -The default is ON (\-readconfig). -.TP -.B \-[no]writeconfig, \-[no]wc -Write configuration to \fI[driver]\fR.ini on exit. -Default is OFF (\-nowriteconfig). -.\" -.\" ******************************************************* -.SS Search path options -.\" ******************************************************* -Be careful to use the path, directory and file options in -mess.ini ONLY. Otherwise, the outcome may be unpredictable and not -consistent across releases. -.TP -.B \-rompath, \-rp, \-biospath, \-bp \fIpathname -Specifies a list of paths within which to find ROM or hard disk images. -Multiple paths can be specified by separating them with semicolons. -The default is 'roms' (that is, a directory 'roms' in the same directory -as the MESS executable). -.TP -.B \-hashpath \fIpathname -Specifies a list of paths within which to search for software hash files. -Multiple paths can be specified by separating them with semicolons. -The default is 'hash' (that is, a directory 'hash' in the same directory -as the MESS executable). -.TP -.B \-samplepath, \-sp \fIpathname -Specifies a list of paths within which to find sample files. Multiple -paths can be specified by separating them with semicolons. The default -is 'samples' (that is, a directory 'samples' in the same directory as -the MESS executable). -.TP -.B \-artpath, \-artwork_directory \fIpathname -Specifies a list of paths within which to find artwork files. Multiple -paths can be specified by separating them with semicolons. The default -is 'artwork' (that is, a directory 'artwork' in the same directory as -the MESS executable). -.TP -.B \-ctrlrpath, \-ctrlr_directory \fIpathname -Specifies a list of paths within which to find controller\-specific -configuration files. Multiple paths can be specified by separating -them with semicolons. The default is 'ctrlr' (that is, a -directory 'ctrlr' in the same directory as the MESS executable). -.TP -.B \-inipath \fIpathname -Specifies a list of paths within which to find .ini files. Multiple -paths can be specified by separating them with semicolons. The default -is '/etc/mess'. -.TP -.B \-fontpath \fIpathname -Specifies a list of paths within which to find .bdf font files. Multiple -paths can be specified by separating them with semicolons. The default -is '.' (that is, search in the same directory as the MESS executable). -.TP -.B \-cheatpath \fIpathname -Specifies a list of paths within which to find cheat files. Multiple -paths can be specified by separating them with semicolons. The default -is 'cheat' (that is, a directory 'cheat' in the same directory as -the MESS executable). -.TP -.B \-crosshairpath \fIpathname -Specifies a list of paths within which to find crosshair files. Multiple -paths can be specified by separating them with semicolons. The default -is 'crosshair' (that is, a directory 'crosshair' in the same directory as -the MESS executable). If the Crosshair is set to default in the menu, -MESS will look for system/cross#.png and then cross#.png in the -specified path, where # is the player number. Failing that, -MESS will use built\-in default crosshairs. -.\" -.\" ******************************************************* -.SS Output Directory Options -.\" ******************************************************* -.TP -.B \-cfg_directory \fIpathname -Specifies a single directory where configuration files are stored. -Configuration files store user configurable settings that are read at -startup and written when MESS exits. The default is 'cfg' (that is, -a directory 'cfg' in the same directory as the MESS executable). If this -directory does not exist, it will be automatically created. -.TP -.B \-nvram_directory \fIpathname -Specifies a single directory where NVRAM files are stored. NVRAM files -store the contents of EEPROM and non\-volatile RAM (NVRAM) for systems -which used this type of hardware. This data is read at startup and -written when MESS exits. The default is 'nvram' (that is, a -directory 'nvram' in the same directory as the MESS executable). If this -directory does not exist, it will be automatically created. -.TP -.B \-input_directory \fIpathname -Specifies a single directory where input recording files are stored. -Input recordings are created via the \-record option and played back via -the \-playback option. The default is 'inp' (that is, a directory 'inp' -in the same directory as the MESS executable). If this directory -does not exist, it will be automatically created. -.TP -.B \-state_directory \fIpathname -Specifies a single directory where save state files are stored. Save -state files are read and written either upon user request, or when using -the \-autosave option. The default is 'sta' (that is, a directory 'sta' -in the same directory as the MESS executable). If this directory does -not exist, it will be automatically created. -.TP -.B \-snapshot_directory \fIpathname -Specifies a single directory where screen snapshots are stored, when -requested by the user. The default is 'snap' (that is, a directory 'snap' -in the same directory as the MESS executable). If this directory -does not exist, it will be automatically created. -.TP -.B \-diff_directory \fIpathname -Specifies a single directory where hard drive differencing files are -stored. Hard drive differencing files store any data that is written -back to a hard disk image, in order to preserve the original image. The -differencing files are created at startup when a system with a hard disk -image. The default is 'diff' (that is, a directory 'diff' in the same -directory as the MESS executable). If this directory does not exist, -it will be automatically created. -.TP -.B \-comment_directory \fIpathname -Specifies a single directory where debugger comment files are stored. -Debugger comment files are written by the debugger when comments are -added to the disassembly for a system. The default is 'comments' (that is, -a directory 'comments' in the same directory as the MESS executable). -If this directory does not exist, it will be automatically created. -.\" -.\" ******************************************************* -.SS State/playback options -.\" ******************************************************* -.TP -.B \-state \fIslot -Immediately after starting the specified system, will cause the save -state in the specified slot to be loaded. -.TP -.B \-[no]autosave -When enabled, automatically creates a save state file when exiting MESS -and automatically attempts to reload it when later starting MESS with -the same system. This only works for systems that have explicitly enabled -save state support in their driver. The default is OFF (\-noautosave). -.TP -.B \-playback, \-pb \fIfilename -Specifies a file from which to play back a series of system inputs. This -feature does not work reliably for all systems, but can be used to watch -a previously recorded system session from start to finish. In order to -make things consistent, you should only record and playback with all -configuration (.cfg), NVRAM (.nv), and memory card files deleted. The -default is NULL (no playback). -.TP -.B \-[no]exit_after_playback -If play back is enabled (see \-playback option) the program exits when -end of file is reached. Otherwise the machine will continue to run. -Default is OFF (\-noexit_after_playback). -.TP -.B \-record, \-rec \fIfilename -Specifies a file to record all input from a system session. This can be -used to record a system session for later playback. This feature does not -work reliably for all systems, but can be used to watch a previously -recorded system session from start to finish. In order to make things -consistent, you should only record and playback with all configuration -(.cfg), NVRAM (.nv), and memory card files deleted. The default is NULL -(no recording). -.TP -.B \-[no]record_timecode -Specify whether to create a timecode file. It contains a line with elapsed -times on each press of timecode shortcut key (default is F12). -This option works only when recording mode is enabled (\-record option). -The file is saved on inp folder. -Default is OFF (\-norecord_timecode). -.TP -.B \-mngwrite \fIfilename -Writes each video frame to the given file in MNG format, producing -an animation of the system session. -Note that \-mngwrite only writes video frames; it does not save any audio -data. Use \-wavwrite for that, and reassemble the audio/video using -offline tools. The default is NULL (no recording). -.TP -.B \-aviwrite \fIfilename -Stream video and sound data to the given file -in AVI format, producing an animation of the system session complete -with sound. The default is NULL (no recording). -.TP -.B \-wavwrite \fIfilename -Writes the final mixer output to the given file -in WAV format, producing an audio recording of the system session. -The default is NULL (no recording). -.TP -.B \-snapname \fIstring -Describes how MESS should name files for snapshots. \fIstring\fP -provides a template that is used to generate a filename. Three -simple substitutions are provided: the / character represents the -path separator on any target platform (even Windows); the literal \fB%g\fP -represents the driver name of the current system; and the literal \fB%i\fP -represents an incrementing index. If \fB%i\fP is omitted, then each -snapshot taken will overwrite the previous one; otherwise, MESS will -find the next empty value for \fB%i\fP and use that for a filename. The -default is '%g/%i', which creates a separate folder for each game, -and names the snapshots under it starting with 0000 and increasing -from there. In addition to the above, for drivers using different -media, like carts or floppy disks, you can also use the -\fB%d\fP\fI_[media]\fP indicator. Replace \fI[media]\fP with the media -switch you want to use. A few examples: if you use -.B mess nes \-cart robby \-snapname %g/%d_cart -snapshots will be saved as \fBsnaps/nes/robby.png\fP; if you use -.B mess c64 \-flop1 robby \-snapname %g/%d_flop1/%i -snapshots will be saved as \fBsnaps/c64/robby/0000.png\fP. -.TP -.B \-snapsize \fIwidth\fRx\fIheight -Hard\-codes the size for snapshots and movie recording. By default, -MESS will create snapshots at the system's current resolution in raw -pixels, and will create movies at the system's starting resolution in -raw pixels. If you specify this option, then MESS will create both -snapshots and movies at the size specified, and will bilinear filter -the result. Note that this size does not automatically rotate if the -system is vertically oriented. The default is 'auto'. -.TP -.B \-snapview internal\fR|\fBauto\fR|\fIviewname -Specifies the view to use when rendering snapshots and movies. By -default, both use a special 'internal' view, which renders a separate -snapshot per screen or renders movies only of the first screen. By -specifying this option, you can override this default behavior and -select a single view that will apply to all snapshots and movies. -Note that \fIviewname\fP does not need to be a perfect match; rather, it -will select the first view whose name matches all the characters -specified by \fIviewname\fP. For example, \-snapview native will match the -"Native (15:14)" view even though it is not a perfect match. -\fIviewname\fP can also be 'auto', which selects the first view with all -screens present. The default value is 'internal'. -.TP -.B \-[no]snapbilinear -Specify whether snapshot/movie should have bilinear filtering applied. -Default is ON (\-snapbilinear). -.TP -.B \-statename \fIstring -Describes how MESS should store save state files, relative to the -state_directory path. \fIstring\fP provides a template that -is used to generate a relative path. Two simple substitutions are -provided: the / character represents the path separator on any target -platform (even Windows); the literal \fB%g\fP represents the driver name of -the current game. The default is '%g', which creates a separate folder -for each game. In addition to the above, for drivers using different -media, like carts or floppy disks, you can also use the -\fB%d_\fP\fI[media]\fP indicator. Replace \fI[media]\fP with the media -switch you want to use. A few examples: if you use -.B mess nes \-cart robby \-statename %g/%d_cart -save states will be stored inside \fBsta/nes/robby/\fP; if you use -.B mess c64 \-flop1 robby \-statename %g/%d_flop1 -save states will be stored inside \fBsta/c64/robby/\fP. -.TP -.B \-[no]burnin -Tracks brightness of the screen during play and at the end of -emulation generates a PNG that can be used to simulate burn\-in -effects on other systems. The resulting PNG is created such that the -least\-used areas of the screen are fully white (since burned\-in areas -are darker, all other areas of the screen must be lightened a touch). -The intention is that this PNG can be loaded via an artwork file with -a low alpha (e.g, 0.1\-0.2 seems to work well) and blended over the -entire screen. The PNG files are saved in the snap directory under -the system/burnin\-<screen.name>.png. The default is OFF (\-noburnin). -.\" -.\" ******************************************************* -.SS Performance options -.\" ******************************************************* -.TP -.B \-[no]autoframeskip, \-[no]afs -Automatically determines the frameskip level while you're playing the -system, adjusting it constantly in a frantic attempt to keep the system -running at full speed. Turning this on overrides the value you have set -for \-frameskip below. The default is OFF (\-noautoframeskip). -.TP -.B \-frameskip, \-fs \fIvalue -Specifies the frameskip value (autoframeskip must be disabled). This is the -number of frames out of every 12 to drop when running. For example, if you -say \-frameskip 2, then MESS will display 10 out of every 12 frames. By -skipping those frames, you may be able to get full speed in a system that -requires more horsepower than your computer has. The default value is 0, -which skips no frames. -.TP -.B \-seconds_to_run, \-str \fIvalue -This option can be used for benchmarking and automated testing. It tells -MESS to stop execution after a fixed number of seconds. By combining -this with a fixed set of other command line options, you can set up a -consistent environment for benchmarking MESS performance. In addition, -upon exit, the \-str option will write a screenshot called final.png -to the system's snapshot directory. -.TP -.B \-[no]throttle -Configures the default thottling setting. When throttling is on, MESS -attempts to keep the system running at the system's intended speed. When -throttling is off, MESS runs the system as fast as it can. Note that the -fastest speed is more often than not limited by your graphics card, -especially for older systems. The default is ON (\-throttle). -.TP -.B \-[no]sleep -Allows MESS to give time back to the system when running with \-throttle. -This allows other programs to have some CPU time, assuming that the -system isn't taxing 100% of your CPU resources. This option can potentially -cause hiccups in performance if other demanding programs are running. -The default is ON (\-sleep). -.TP -.B \-speed \fIvalue -Controls the speed of gameplay, relative to realtime; smaller numbers are -slower. Default is 1.00. -.TP -.B \-[no]refreshspeed, \-[no]rs -Automatically adjusts the \-speed parameter to keep the effective refresh -rate below that of the lowest screen refresh rate. -Default is OFF (\-norefreshspeed). -.\" -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" OS specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.TP -.B \-[no]multithreading, \-[no]mt -Enable multithreading; this enables rendering and blitting on a separate -thread. The default is OFF (\-nomultithreading). -.TP -.B \-numprocessors, \-np \fIvalue -Set number of processors; this overrides the number the system reports. -.TP -.B \-bench \fIvalue -Benchmark for the given number of emulated seconds; -implies \-video none \-sound none \-nothrottle. -.\" -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.TP -.B \-[no]sdlvideofps -Show SDL video performance. Default is OFF (\-nosdlvideofps). -.\" -.\" ******************************************************* -.SS Rotation options -.\" ******************************************************* -.TP -.B \-[no]rotate -Rotate the system to match its normal state (horizontal/vertical). This -ensures that both vertically and horizontally oriented systems show up -correctly without the need to rotate your monitor. If you want to keep -the system displaying 'raw' on the screen the way the actual machine would -have, turn this option off. The default is ON (\-rotate). -.TP -.B \-[no]ror \-[no]rol -Rotate the system screen to the right (clockwise) or left -(counter\-clockwise) relative to either its normal state (if \-rotate -is specified) or its native state (if \-norotate is specified). -Default for both is OFF (\-noror \-norol). -.TP -.B \-[no]autoror \-[no]autorol -These options are designed for use with pivoting screens that only -pivot in a single direction. If your screen only pivots clockwise, -use \-autorol to ensure that the system will fill the screen either -horizontally or vertically in one of the directions you can handle. -If your screen only pivots counter\-clockwise, use \-autoror. -Default for both is OFF (\-noautoror \-noautorol). -.TP -.B \-[no]flipx \-[no]flipy -Flip (mirror) the system screen either horizontally (\-flipx) or -vertically (\-flipy). The flips are applied after the \-rotate and -\-ror/\-rol options are applied. -Default for both is OFF (\-noflipx \-noflipy). -.\" -.\" ******************************************************* -.SS Artwork options -.\" ******************************************************* -.TP -.B \-[no]artwork_crop, \-[no]artcrop -Enable cropping of artwork to the system screen area only. This -option can also be controlled via the Video Options menu in the user -interface. The default is OFF (\-noartwork_crop). -.TP -.B \-[no]use_backdrops, \-[no]backdrop -Enables/disables the display of backdrops. The default is ON -(\-use_backdrops). -.TP -.B \-[no]use_overlays, \-[no]overlay -Enables/disables the display of overlays. The default is ON -(\-use_overlays). -.TP -.B \-[no]use_bezels, \-[no]bezel -Enables/disables the display of bezels. The default is ON -(\-use_bezels). -.TP -.B \-[no]use_cpanels, \-[no]cpanel -Enables/disables the display of cpanels. The default is ON -(\-use_bezels). -.TP -.B \-[no]use_marquees, \-[no]marquee -Enables/disables the display of marquees. The default is ON -(\-use_bezels). -.\" -.\" ******************************************************* -.SS Screen options -.\" ******************************************************* -.TP -.B \-brightness \fIvalue -Controls the default brightness, or black level, of the system screens. -This option does not affect the artwork or other parts of the display. -Using the MESS UI, you can individually set the brightness for each system -screen; this option controls the initial value for all visible system -screens. The standard value is 1.0. Selecting lower values (down to 0.1) -will produce a darkened display, while selecting higher values (up to -2.0) will give a brighter display. The default is 1.0. -.TP -.B \-contrast \fIvalue -Controls the contrast, or white level, of the system screens. This option -does not affect the artwork or other parts of the display. Using the -MESS UI, you can individually set the contrast for each system screen; -this option controls the initial value for all visible system screens. The -standard value is 1.0. Selecting lower values (down to 0.1) will produce -a dimmer display, while selecting higher values (up to 2.0) will -give a more saturated display. The default is 1.0. -.TP -.B \-gamma \fIvalue -Controls the gamma, which produces a potentially nonlinear black to -white ramp, for the system screens. This option does not affect the -artwork or other parts of the display. Using the MESS UI, you can -individually set the gamma for each system screen; this option controls -the initial value for all visible system screens. The standard value is -1.0, which gives a linear ramp from black to white. Selecting lower -values (down to 0.1) will increase the nonlinearity toward black, -while selecting higher values (up to 3.0) will push the nonlinearity -toward white. The default is 1.0. -.TP -.B \-pause_brightness \fIvalue -This controls the brightness level when MESS is paused. The default -value is 0.65. -.TP -.B \-effect\fR [\fInone\fR|\fIfilename[.png]\fR] -Name of a PNG file to use for visual effects, or 'none'. Default is 'none'. -.\" -.\" ******************************************************* -.SS Vector rendering options -.\" ******************************************************* -.TP -.B \-[no]antialias, \-[no]aa -Enables antialiased line rendering for vector systems. The default is ON -(\-antialias). -.TP -.B \-beam \fIvalue -Sets the width of the vectors. This is a scaling factor against the -standard vector width. A value of 1.0 will keep the default vector line -width. Smaller values will reduce the width, and larger values will -increase the width. The default is 1.0. -.TP -.B \-flicker \fIvalue -Simulates a vector "flicker" effect, similar to a vector monitor that -needs adjustment. This option requires a float argument in the range of -0.00\-100.00 (0=none, 100=maximum). The default is 0. -.\" -.\" ******************************************************* -.SS Video options -.\" ******************************************************* -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.TP -.B \-video\fR [\fIsoft\fR|\fIopengl\fR|\fInone\fR] -Specifies which video subsystem to use for drawing: -.br -\fBsoft\fR uses software rendering, which is slower but more compatible. -.br -\fBopengl\fR uses OpenGL and your graphics accelerator to speed up many -aspects of drawing MESS including compositing artwork, overlays, and -bezels, as well as stretching the image to fit your screen. -.br -\fBnone\fR does no drawing and is intended for CPU benchmarking. -.br -Default is SOFT. -.TP -.B \-[no]window, \-[no]w -Run MESS in either full screen or a window. This is a fully\-featured window -mode where the window resizes as necessary to track what the system does. -And you can resize it yourself with your OS's standard window controls. -The default is OFF (\-nowindow). -.TP -.B \-[no]maximize, \-[no]max -Controls initial window size in windowed mode. If it is set on, the -window will initially be set to the maximum supported size when you -start MESS. If it is turned off, the window will start out at the -smallest supported size. This option only has an effect when the -\-window option is used. The default is ON (\-maximize). -.TP -.B \-[no]keepaspect, \-[no]ka -Forces the correct aspect ratio. This means when you're resizing the window -in windowed mode the actual system image will resize in discrete steps to -maintain the proper shape of the system graphics. If you turn this off you can -resize the window to anything you like and get funny squishing and stretching. -The same applies for full\-screen. Default is ON (\-keepaspect). -.TP -.B \-[no]unevenstretch, \-[no]ues -Allow non\-integer stretch factors. Video purists should stay far, far away -from this option, while everyone else will be happy to know that it lets you -fill the screen properly in full\-screen mode. Default is ON (\-unevenstretch). -.TP -.B \-[no]centerh -Center horizontally within the view area. Default is ON (\-centerh). -.TP -.B \-[no]centerv -Center vertically within the view area. Default is ON (\-centerv). -.TP -.B \-[no]waitvsync, \-[no]vs -Enable waiting for the start of VBLANK before flipping screens; -reduces tearing effects. Default is OFF (\-nowaitvsync). -.TP -.B \-[no]syncrefresh, \-[no]srf -Enable using the start of VBLANK for throttling instead of the game time. -Default is OFF (\-nosyncrefresh). -.\" -.\" ******************************************************* -.SS Software video rendering subsystem options -.\" ******************************************************* -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -All the options in this group are available only with softare video -rendering subsystem (\-video soft). -.TP -.B \-prescale\fR [\fIvalue\fR] -Scale screen rendering by this amount in software. Default is 1. -.TP -.B \-scalemode, \-sm \fR[\fInone\fR|\fIasync\fR|\fIyv12\fR|\fIyuy2\fR|\fIyv12x2\fR|\fIyuy2x2\fR] -Hardware scaling mode. -.br -\fBnone\fR use software rendering. -.br -\fBasync\fR async overlay. -.br -\fByv12\fR yv12 overlay. -.br -\fByuy2\fR yuy2 overlay. -.br -\fByv12x2\fR yv12 overlay using x2 prescaling. -.br -\fByuy2x2\fR yuy2 overlay using x2 prescaling. -.br -Default is NONE. -.\" -.\" ******************************************************* -.SS OpenGL video rendering subsystem options -.\" ******************************************************* -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -All the options in this group are available only with OpenGL video -rendering subsystem (\-video opengl or \-video opengl16). -.TP -.B \-[no]filter, \-[no]glfilter, \-[no]flt -Enable bilinear filtering on screen output. Default is ON (\-filter). -.TP -.B \-[no]gl_forcepow2texture -Force power of two textures. Default is OFF (\-nogl_forcepow2texture). -.TP -.B \-[no]gl_notexturerect -Don't use OpenGL GL_ARB_texture_rectangle. Turn off if -corruption occurs in OpenGL mode, at cost of some performance -loss. Default is ON (\-gl_notexturerect). -.TP -.B \-[no]gl_vbo -Enable OpenGL VBO, if available, for a performance increase. -Turn off if corruption occurs. Default is ON (\-gl_vbo). -.TP -.B \-[no]gl_pbo -Enable OpenGL PBO, if available, for a performance increase. -Turn off if corruption occurs. Default is ON (\-gl_pbo). -.TP -.B \-[no]gl_glsl -Enable OpenGL GLSL, if available, for a performance increase. -Default is OFF (\-nogl_glsl). -.TP -.B \-gl_glsl_filter \fIvalue -Enable OpenGL GLSL filtering instead of FF filtering 0=plain, 1=bilinear. -Default is 1: bilinear. -.TP -.BR \-glsl_shader_mame[0\-9] -Preferred custom OpenGL GLSL shader set mame bitmap (from 0 to 9). -.TP -.BR \-glsl_shader_screen[0\-9] -Preferred custom OpenGL GLSL shader screen bitmap (from 0 to 9). -.TP -.B \-gl_glsl_vid_attr -Enable OpenGL GLSL handling of brightness and contrast. Better RGB system -performance for free. Default is ON. -.TP -.B \-screen -Explicit name for all screens; 'auto' here will try to make a best guess. -.TP -.B \-aspect, \-screen_aspect -Aspect ratio for all screens; 'auto' here will try to make a best guess. -.TP -.B \-resolution, \-r -Preferred resolution for all screens; -format is \fIwidth\fRx\fIheight\fR[@\fIrefreshrate\fR] or 'auto'. -.TP -.B \-view -Preferred view for all screens -.TP -.B \-screen[0\-3] -Explicit name of the first|second|third|fourth screen; 'auto' here will try -to make a best guess. -.TP -.B \-aspect[0\-3] -Aspect ratio of the first|second|third|fourth screen; 'auto' here will try -to make a best guess. -.TP -.B \-resolution[0\-3], \-r[0\-3] -Preferred resolution for the first|second|third|fourth screen; -format is \fIwidth\fRx\fIheight\fR[@\fIrefreshrate\fR] or 'auto'. -.TP -.B \-view[0\-3] -Preferred view for the first|second|third|fourth screen. -.\" -.\" ******************************************************* -.SS Full screen options -.\" ******************************************************* -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.TP -.B \-[no]switchres -Affects full screen mode only. Chooses if MESS can try to change the -screen resolution (color depth is normally left alone) when in -full\-screen mode. If it's off, you always get your desktop resolution -in full\-screen mode (which can be useful for LCDs). -Default is OFF (\-noswitchres). -.TP -.B \-[no]useallheads -Split full screen image across monitors. Default is OFF (\-nouseallhead). -.\" -.\" ******************************************************* -.SS Sound options -.\" ******************************************************* -.TP -.B \-[no]sound -Enable or disable sound altogether. The default is ON (\-sound). -.TP -.B \-samplerate, \-sr \fIvalue -Sets the audio sample rate. Smaller values (e.g. 11025) cause lower -audio quality but faster emulation speed. Higher values (e.g. 48000) -cause higher audio quality but slower emulation speed. The default is -48000. -.TP -.B \-[no]samples -Use samples if available. The default is ON (\-samples). -.TP -.B \-volume, \-vol \fIvalue -Sets the startup volume. It can later be changed with the user interface -(see Keys section). The volume is an attenuation in dB: -for example, '\-volume \-12' will start with \-12dB attenuation. -The default is 0. -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.TP -.B \-audio_latency \fIvalue -This controls the amount of latency built into the audio streaming. -The latency parameter controls the lower threshold. The default is 3; -increase to reduce glitches, decrease for responsiveness. -.\" -.\" ******************************************************* -.SS Input options -.\" ******************************************************* -.TP -.B \-[no]coin_lockout, \-[no]coinlock -Enables simulation of the "coin lockout" feature that is implemented -on a number of arcade game PCBs. It was up to the operator whether or not -the coin lockout outputs were actually connected to the coin -mechanisms. If this feature is enabled, then attempts to enter a coin -while the lockout is active will fail and will display a popup message -in the user interface. If this feature is disabled, the coin lockout -signal will be ignored. The default is ON (\-coin_lockout). -.TP -.B \-ctrlr \fIcontroller -Enables support for special controllers. Configuration files are -loaded from the ctrlrpath. They are in the same format as the .cfg -files that are saved, but only control configuration data is read -from the file. The default is NULL (no controller file). -.TP -.B \-[no]mouse -Controls whether or not MESS looks for a mouse controller to use. Note -that in many cases, lightguns are treated as mice by the operating -system, so you may need to enable this to enable lightgun support. When -this is enabled, you will not be able to use your mouse while running -MESS. If you want to get control of your computer back, you will need -to either pause MESS or quit. The default is OFF (\-nomouse). -.TP -.B \-[no]joystick, \-[no]joy -Controls whether or not MESS looks for joystick/gamepad controllers. -The default is ON (\-joystick). -.TP -.B \-[no]lightgun, \-[no]gun -Controls whether or not MESS makes use of lightgun controllers. -Note that most lightguns map to the mouse, so using \-lightgun and -\-mouse together may produce strange results. The default is OFF -(\-nolightgun). -.TP -.B \-[no]multikeyboard, \-[no]multikey -Determines whether MESS differentiates between multiple keyboards. -Some systems may report more than one keyboard; by default, the data -from all of these keyboards is combined so that it looks like a single -keyboard. Turning this option on will enable MESS to report keypresses -on different keyboards independently. The default is OFF -(\-nomultikeyboard). -.TP -.B \-[no]multimouse -Determines whether MESS differentiates between multiple mice. Some -systems may report more than one mouse device; by default, the data -from all of these mice is combined so that it looks like a single -mouse. Turning this option on will enable MESS to report mouse -movement and button presses on different mice independently. The -default is OFF (\-nomultimouse). -.TP -.B \-[no]steadykey, \-[no]steady -Some systems require two or more buttons to be pressed at exactly the -same time to make special moves. Due to limitations in the PC keyboard -hardware, it can be difficult or even impossible to accomplish that -using the standard keyboard handling. This option selects a different -handling that makes it easier to register simultaneous button presses, -but has the disadvantage of making controls less responsive. The -default is OFF (\-nosteadykey). -.TP -.B \-[no]ui_active -Enable MESS user interface on top of emulated keyboard (if present). -User interface may be toggled during execution by pressing the key -defined with \-ui_modekey. -Default is OFF (\-noui_active). -.TP -.B \-[no]offscreen_reload, \-[no]reload -Controls whether or not MESS treats a second button input from a -lightgun as a reload signal. In this case, MESS will report the gun's -position as (0,MAX) with the trigger held, which is equivalent to an -offscreen reload. This is only needed for systems that required you to -shoot offscreen to reload, and then only if your gun does not support -off screen reloads. The default is OFF (\-nooffscreen_reload). -.TP -.B \-joystick_map, \-joymap \fImap -Controls how joystick values map to digital joystick controls. -See /usr/share/doc/mame\-common/config.txt for full details on -joymap format. -.TP -.B \-joystick_deadzone, \-joy_deadzone, \-jdz \fIvalue -If you play with an analog joystick, the center can drift a little. -joystick_deadzone tells how far along an axis you must move before the -axis starts to change. This option expects a float in the range of -0.0 to 1.0. Where 0 is the center of the joystick and 1 is the outer -limit. The default is 0.3. -.TP -.B \-joystick_saturation, \-joy_saturation, \-jsat \fIvalue -If you play with an analog joystick, the ends can drift a little, -and may not match in the +/\- directions. joystick_saturation tells how -far along an axis movement change will be accepted before it reaches -the maximum range. This option expects a float in the range of 0.0 to -1.0, where 0 is the center of the joystick and 1 is the outer limit. -The default is 0.85. -.TP -.B \-[no]natural, \-[no]nat -Allows user to specify whether or not to use a natural keyboard. -This allows you to start your game or system in a 'native' mode, depending -on your region, allowing compatibility for non\-"QWERTY" style keyboards. -The default is OFF (\-nonatural). -.TP -.B \-[no]joystick_contradictory, \-[no]joy_contradictory -Enable contradictory direction digital joystick input at the same time. -Default is OFF (\-nojoystick_contradictory). -.TP -.B \-uimodekey, \-umk -Specifies the key used to toggle between full and partial UI mode. -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.TP -.B \-[no]keymap -Enable keymap for non\-QWERTY keyboards. Used in conjunction -with \fB\-keymap_file\fR. Default is OFF (\-nokeymap). -.TP -.B \-keymap_file \fIkeymap_file -Specifies the full path to the keymap file to be used. A few -keymap files are available in /usr/share/games/mess/keymaps. -.TP -.B \-joy_idx[0\-8] \fIjoystick -With these options you can assign a joystick to a -specific index in MESS. Even if the kernel will list the joysticks -in a different order on the next boot, MESS will still see the joystick -as e.g. "Joystick 2". Use mame \-v to see which joysticks are recognized. -Default is 'auto'. -.TP -.B \-[no]sixaxis -Use special handling for PS3 Sixaxis controllers. -Default is OFF (\-nosixaxis). -.TP -.B \-lightgun_index[1\-8] -Map lightgun to specific index in MESS. -.TP -.B \-videodriver, \-vd x11\fR|\fBdirectfb\fR|\fBauto -SDL video driver to use; auto selects SDL default. -.TP -.B \-audiodriver, \-ad alsa\fR|\fBarts\fR|\fBauto -SDL audio driver to use; auto selects SDL default. -.TP -.B \-gl_lib alsa\fR|\fBarts\fR|\fBauto -Alternative libGL.so to use; auto selects SDL default. -.\" -.\" ******************************************************* -.SS Input automatic enable options -.\" ******************************************************* -.TP -.B \-paddle_device, \-paddle \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR] -.TP -.B \-adstick_device, \-adstick \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR] -.TP -.B \-pedal_device, \-pedal \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR] -.TP -.B \-dial_device, \-dial \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR] -.TP -.B \-trackball_device, \-trackball \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR] -.TP -.B \-lightgun_device \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR] -.TP -.B \-positional_device \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR] -.TP -.B \-mouse_device \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR] -Each of these options controls auto\-enabling the mouse, or joystick -depending on the presence of a particular class of analog -control for a particular system. For example, if you specify the option -\-paddle mouse, then any system that has a paddle control will automatically -enable mouse controls just as if you had explicitly specified \-mouse. -Note that these controls override the values of \-[no]mouse, -\-[no]joystick, etc. -.\" -.\" ******************************************************* -.SS Debugging options -.\" ******************************************************* -.TP -.B \-[no]log -Creates a file called error.log which contains all of the internal -log messages generated by the MESS core and system drivers. The default -is OFF (\-nolog). -.TP -.B \-[no]verbose, \-[no]v -Displays internal diagnostic information. This information is very -useful for debugging problems with your configuration. -Please use the \-verbose option and include the resulting information -when reporting bugs. The default is OFF (\-noverbose). -.TP -.B \-[no]update_in_pause -Enables updating the screen bitmap while the system is paused. This is -useful for debuggin in some scenarios (and gets in the way in others). -Default is OFF (\-noupdate_in_pause). -.TP -.B \-[no]debug, \-[no]d -Activates the integrated debugger. By default, the debugger is entered -by pressing the tilde (~) key during emulation. It is also entered -immediately at startup. The default is OFF (\-nodebug). -.TP -.B \-debugscript \fIfilename -Specifies a file that contains a list of debugger commands to execute -immediately upon startup. The default is NULL (no commands). -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.\" SDL specific -.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -.TP -.B \-debugger \fIdebugger_name -Name of the debugger to use. Default is AUTO. -.TP -.B \-debugger_font, \-dfont \fIfont_name -Specifies the font to use for debugging. Default is AUTO. -.TP -.B \-debugger_font_size, \-dfontsize \fIsize -Specifies the font size to use for debugging. -.TP -.B \-[no]oslog -Outputs the error.log data to the system debugger. This can be used at -the same time as \-log to output the log data to both targets as well. -Default is OFF (\-nooslog). -.\" -.\" ******************************************************* -.SS Misc options -.\" ******************************************************* -.TP -.B \-[no]drc -Enable DRC cpu core if available. Default is ON (\-drc). -.TP -.B \-[no]drc_use_c -Force DRC use C backend. Default is OFF (\-nodrc_use_c). -.TP -.B \-[no]drc_log_uml -Write DRC UML disassembly log. Default is OFF (\-nodrc_log_uml). -.TP -.B \-[no]drc_log_native -Write DRC native disassembly log. Default is OFF (\-no_drc_log_native). -.TP -.B \-bios \fIbiosname -Specifies the specific BIOS to use with the current system, for -systems that make use of a BIOS. The \-listxml output will list all of -the possible BIOS names for a system. The default is 'default'. -.TP -.B \-[no]cheat, \-[no]c -Activates the cheat menu with autofire options and other tricks from -the cheat database, if present. -The default is OFF (\-nocheat). -.TP -.B \-[no]skip_gameinfo -Forces MESS to skip displaying the system info screen. The default is OFF -(\-noskip_gameinfo). -.TP -.B \-uifont \fIfontname -Specifies the name of a BDF font file to use for the UI font. If this -font cannot be found or cannot be loaded, the system will fall back -to its built\-in UI font. On some platforms \fIfontname\fP can be a system -font name instead of a BDF font file. The default is 'default' (use -the OSD\-determined default font). -.TP -.B \-ramsize, \-ram \fIvalue -Size of RAM (if supported by driver). -.TP -.B \-[no]confirm_quit -Display confirm quit screen on exit. Default is ON (\-confirm_quit). -.TP -.B \-[no]ui_mouse -Display UI mouse cursor. Default is OFF (\-noui_mouse). -.TP -.B \-autoboot_command, \-ab \fIcommand -Command string to execute after machine boot (in quotes ""). To issue -a quote to the emulation, use \fB"""\fP in the string. -Using \fB\\n\fP will issue a create a new line, issuing what was -typed prior as a command. Example: -\fB\-autoboot_command "load """$""",8,1\\n"\fP. -.TP -.B \-autoboot_delay \fR[\fIvalue\fP] -Timer delay (in seconds) to trigger command execution on autoboot. -Default is 2. -.TP -.B \-autoboot_script, \-script \fR[\fIfilename.lua\fP] -File containing scripting to execute after machine boot. -.TP -.B \-[no]http -Enable local http server. Default is OFF (\-nohttp). -.TP -.B \-http_port \fIport -Internal webserver listener port. -.TP -.B \-http_path \fIpath -Path to web files. Default is /usr/share/games/mess/web. -.TP -.B \-[no]console -Enable emulator LUA console. Default is OFF (\-noconsole). -.TP -.B \-newui, \-nu -Use the new MESS UI. -.TP -.B \-watchdog \fIvalue -Specifies a number of seconds after which MESS should automatically exit -if it detects that the emulation has locked up. -.\" -.\" -.\" SEE ALSO chapter -.SH SEE ALSO -castool(1), chdman(1), floptool(1), imgtool(1), testkeys(1) -.\" -.\" -.\" LEGAL NOTICE chapter -.SH LEGAL NOTICE -Please visit the MAME website for some important legal information: -.PP -http://mamedev.org/legal.html diff --git a/src/osd/sdl/man/romcmp.1 b/src/osd/sdl/man/romcmp.1 deleted file mode 100644 index d7a89f92e80..00000000000 --- a/src/osd/sdl/man/romcmp.1 +++ /dev/null @@ -1,56 +0,0 @@ -.\" -*- nroff -*- -.\" -.\" romcmp.1 -.\" -.\" Man page created from FAQs, source and usage information by -.\" Ashley T. Howes <debiandev@ashleyhowes.com>, February 2005 -.\" updated by Cesare Falco <c.falco@ubuntu.com>, February 2007 -.\" -.\" References -.\" http://www.mame.net/mamefaq.html -.\" -.TH ROMCMP 1 2015-07-22 0.164 "MAME romset checking tool" -.\" -.\" NAME chapter -.SH NAME -romcmp \- MAME rom and romsets check and comparison tool -.\" -.\" SYNOPSIS chapter -.SH SYNOPSIS -.B romcmp -.RI [ \-option ] -.RI [ dir1 | zip1 ] -.RI [ dir2 | zip2 ] -.\" -.\" DESCRIPTION chapter -.SH DESCRIPTION -\fBromcmp\fP is a tool developed to detect the most common errors that -can occur when dumping ROMS, for example stuck bits and address line errors. -.PP -It can check the ROMs in ZIP files or subdirectories; it can also be used -to compare two ROM sets, by giving it two files or subdirectories -as parameters. It will determine which ROMS are identical and which are -the closest matches. This is useful when figuring out if a newly dumped -ROM set is a clone of another ROM set. -.\" -.\" OPTIONS chapter -.SH OPTIONS -.TP -.B \-d -Enables a slower, more comprehensive comparison. -.\" -.\" EXAMPLES chapter -.SH EXAMPLES -.B romcmp jumpkids.zip -will output the following: - - 11 files - 23.3c FIXED BITS (xxxxxx1x) - 23.3c FIRST AND SECOND HALF IDENTICAL - -This tells us that the 23.3C ROM in Jump Kids is bad, and incidentally, -it causes the missing sound in that game. -.\" -.\" SEE ALSO chapter -.SH SEE ALSO -mame(6) diff --git a/src/osd/sdl/man/testkeys.1 b/src/osd/sdl/man/testkeys.1 deleted file mode 100644 index 91ddd1eb93d..00000000000 --- a/src/osd/sdl/man/testkeys.1 +++ /dev/null @@ -1,27 +0,0 @@ -.\" -*- nroff -*- -.\" -.\" testkeys.1 -.\" -.\" Man page created from source and usage information -.\" Cesare Falco <c.falco@ubuntu.com>, February 2007 -.\" -.TH TESTKEYS 1 2015-07-22 0.164 "MAME SDL keycode scanner" -.\" -.\" NAME chapter -.SH NAME -testkeys \- MAME SDL keycode scanner -.\" -.\" SYNOPSIS chapter -.SH SYNOPSIS -.B testkeys -.\" -.\" DESCRIPTION chapter -.SH DESCRIPTION -Since 0.113 (SDL)MAME introduced keymap files to handle keyboards -with non\-us layouts. -.PP -This simple utility helps determining which SDL keycode is bound -to each key, thus making the process of compiling keymap files a -bit easier. -.SH SEE ALSO -mame(6), mess(6) diff --git a/src/osd/sdl/osxutils.h b/src/osd/sdl/osxutils.h deleted file mode 100644 index 61ec4527cf1..00000000000 --- a/src/osd/sdl/osxutils.h +++ /dev/null @@ -1,21 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Vas Crabb -//============================================================ -// -// osxutils.h - Mac OS X utilities for SDLMAME -// -// SDLMAME by Olivier Galibert and R. Belmont -// -//============================================================ - -#ifndef __SDLOSXUTILS__ -#define __SDLOSXUTILS__ - -//============================================================ -// PROTOTYPES -//============================================================ - -void * NewAutoreleasePool(void); -void ReleaseAutoreleasePool(void *pool); - -#endif diff --git a/src/osd/sdl/osxutils.mm b/src/osd/sdl/osxutils.mm deleted file mode 100644 index c71af922b59..00000000000 --- a/src/osd/sdl/osxutils.mm +++ /dev/null @@ -1,34 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Vas Crabb -//============================================================ -// -// osxutils.m - Mac OS X utilities for SDLMAME -// -// SDLMAME by Olivier Galibert and R. Belmont -// -//============================================================ - -#import <Foundation/Foundation.h> - -// MAMEOS headers -#import "osxutils.h" - - -//============================================================ -// NewAutoreleasePool -//============================================================ - -void * NewAutoreleasePool(void) -{ - return [[NSAutoreleasePool alloc] init]; -} - - -//============================================================ -// ReleaseAutoreleasePool -//============================================================ - -void ReleaseAutoreleasePool(void *pool) -{ - [(NSAutoreleasePool *)pool release]; -} diff --git a/src/osd/sdl/output.cpp b/src/osd/sdl/output.cpp index f2348f592e2..a2eb5b3dad1 100644 --- a/src/osd/sdl/output.cpp +++ b/src/osd/sdl/output.cpp @@ -11,6 +11,7 @@ #include <stdio.h> #include <fcntl.h> #include <unistd.h> +#include <inttypes.h> // MAME headers #include "emu.h" @@ -32,12 +33,6 @@ */ -#ifdef PTR64 -#define PID_FMT "%ld" -#else -#define PID_FMT "%d" -#endif - //============================================================ // TYPEDEFS //============================================================ @@ -83,7 +78,7 @@ bool sdl_osd_interface::output_init() output = fdopen(fildes, "w"); osd_printf_verbose("output: opened output notifier file %s\n", SDLMAME_OUTPUT); - fprintf(output, "MAME " PID_FMT " START %s\n", osd_getpid(), this->machine().system().name); + fprintf(output, "MAME %" PRIxPTR " START %s\n", osd_getpid(), this->machine().system().name); fflush(output); } @@ -100,7 +95,7 @@ void sdl_osd_interface::output_exit() { if (output != NULL) { - fprintf(output, "MAME " PID_FMT " STOP %s\n", osd_getpid(), machine().system().name); + fprintf(output, "MAME %" PRIxPTR " STOP %s\n", osd_getpid(), machine().system().name); fflush(output); fclose(output); output = NULL; @@ -116,7 +111,7 @@ static void notifier_callback(const char *outname, INT32 value, void *param) { if (output != NULL) { - fprintf(output, "OUT " PID_FMT " %s %d\n", osd_getpid(), outname, value); + fprintf(output, "OUT %" PRIxPTR " %s %d\n", osd_getpid(), outname, value); fflush(output); } } diff --git a/src/osd/sdl/sdlos_macosx.cpp b/src/osd/sdl/sdlos_macosx.cpp deleted file mode 100644 index 5afcfdc54eb..00000000000 --- a/src/osd/sdl/sdlos_macosx.cpp +++ /dev/null @@ -1,101 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Olivier Galibert, R. Belmont -//============================================================ -// -// sdlos_*.c - OS specific low level code -// -// SDLMAME by Olivier Galibert and R. Belmont -// -//============================================================ - -// standard sdl header -#include <sys/stat.h> -#include <unistd.h> - -#include <mach/mach.h> -#include <mach/mach_time.h> -#include <Carbon/Carbon.h> - -#include "sdlinc.h" - -// MAME headers -#include "osdcore.h" - - -//============================================================ -// osd_get_clipboard_text -//============================================================ - -char *osd_get_clipboard_text(void) -{ - OSStatus err; - - PasteboardRef pasteboard_ref; - err = PasteboardCreate(kPasteboardClipboard, &pasteboard_ref); - if (err) - return NULL; - - PasteboardSynchronize(pasteboard_ref); - - ItemCount item_count; - err = PasteboardGetItemCount(pasteboard_ref, &item_count); - - char *result = NULL; // core expects a malloced C string of uft8 data - for (UInt32 item_index = 1; (item_index <= item_count) && !result; item_index++) - { - PasteboardItemID item_id; - err = PasteboardGetItemIdentifier(pasteboard_ref, item_index, &item_id); - if (err) - continue; - - CFArrayRef flavor_type_array; - err = PasteboardCopyItemFlavors(pasteboard_ref, item_id, &flavor_type_array); - if (err) - continue; - - CFIndex const flavor_count = CFArrayGetCount(flavor_type_array); - for (CFIndex flavor_index = 0; (flavor_index < flavor_count) && !result; flavor_index++) - { - CFStringRef const flavor_type = (CFStringRef)CFArrayGetValueAtIndex(flavor_type_array, flavor_index); - - CFStringEncoding encoding; - if (UTTypeConformsTo(flavor_type, kUTTypeUTF16PlainText)) - encoding = kCFStringEncodingUTF16; - else if (UTTypeConformsTo (flavor_type, kUTTypeUTF8PlainText)) - encoding = kCFStringEncodingUTF8; - else if (UTTypeConformsTo (flavor_type, kUTTypePlainText)) - encoding = kCFStringEncodingMacRoman; - else - continue; - - CFDataRef flavor_data; - err = PasteboardCopyItemFlavorData(pasteboard_ref, item_id, flavor_type, &flavor_data); - - if (!err) - { - CFStringRef string_ref = CFStringCreateFromExternalRepresentation(kCFAllocatorDefault, flavor_data, encoding); - CFDataRef data_ref = CFStringCreateExternalRepresentation (kCFAllocatorDefault, string_ref, kCFStringEncodingUTF8, '?'); - CFRelease(string_ref); - CFRelease(flavor_data); - - CFIndex const length = CFDataGetLength(data_ref); - CFRange const range = CFRangeMake(0, length); - - result = reinterpret_cast<char *>(osd_malloc_array(length + 1)); - if (result) - { - CFDataGetBytes(data_ref, range, reinterpret_cast<unsigned char *>(result)); - result[length] = 0; - } - - CFRelease(data_ref); - } - } - - CFRelease(flavor_type_array); - } - - CFRelease(pasteboard_ref); - - return result; -} diff --git a/src/osd/sdl/sdlos_unix.cpp b/src/osd/sdl/sdlos_unix.cpp deleted file mode 100644 index 29bb10c6bdd..00000000000 --- a/src/osd/sdl/sdlos_unix.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Olivier Galibert, R. Belmont -//============================================================ -// -// sdlos_*.c - OS specific low level code -// -// SDLMAME by Olivier Galibert and R. Belmont -// -//============================================================ - -#include <stdlib.h> -#include <unistd.h> -#include <sys/mman.h> -#include <time.h> -#include <sys/time.h> -#include <sys/stat.h> -#ifdef SDLMAME_EMSCRIPTEN -#include <emscripten.h> -#endif - -#include "sdlinc.h" - -// MAME headers -#include "osdcore.h" - -#ifdef SDLMAME_ANDROID -char *osd_get_clipboard_text(void) -{ - return nullptr; -} -#else -//============================================================ -// osd_get_clipboard_text -//============================================================ - -char *osd_get_clipboard_text(void) -{ - char *result = NULL; - - if (SDL_HasClipboardText()) - { - char *temp = SDL_GetClipboardText(); - result = (char *) osd_malloc_array(strlen(temp) + 1); - strcpy(result, temp); - SDL_free(temp); - } - return result; -} - -#endif diff --git a/src/osd/sdl/sdlos_win32.cpp b/src/osd/sdl/sdlos_win32.cpp deleted file mode 100644 index 0de8a374817..00000000000 --- a/src/osd/sdl/sdlos_win32.cpp +++ /dev/null @@ -1,102 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Olivier Galibert, R. Belmont -//============================================================ -// -// sdlos_*.c - OS specific low level code -// -// SDLMAME by Olivier Galibert and R. Belmont -// -//============================================================ - -// standard sdl header -#include "sdlinc.h" - - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> - -// MAME headers -#include "osdcore.h" -#include "strconv.h" - - -//============================================================ -// get_clipboard_text_by_format -//============================================================ - -static char *get_clipboard_text_by_format(UINT format, char *(*convert)(LPCVOID data)) -{ - char *result = NULL; - HANDLE data_handle; - LPVOID data; - - // check to see if this format is available - if (IsClipboardFormatAvailable(format)) - { - // open the clipboard - if (OpenClipboard(NULL)) - { - // try to access clipboard data - data_handle = GetClipboardData(format); - if (data_handle != NULL) - { - // lock the data - data = GlobalLock(data_handle); - if (data != NULL) - { - // invoke the convert - result = (*convert)(data); - - // unlock the data - GlobalUnlock(data_handle); - } - } - - // close out the clipboard - CloseClipboard(); - } - } - return result; -} - - -//============================================================ -// convert_wide -//============================================================ - -static char *convert_wide(LPCVOID data) -{ - return utf8_from_wstring((LPCWSTR) data); -} - - - -//============================================================ -// convert_ansi -//============================================================ - -static char *convert_ansi(LPCVOID data) -{ - return utf8_from_astring((LPCSTR) data); -} - - - -//============================================================ -// osd_get_clipboard_text -//============================================================ - -char *osd_get_clipboard_text(void) -{ - char *result = NULL; - - // try to access unicode text - if (result == NULL) - result = get_clipboard_text_by_format(CF_UNICODETEXT, convert_wide); - - // try to access ANSI text - if (result == NULL) - result = get_clipboard_text_by_format(CF_TEXT, convert_ansi); - - return result; -} diff --git a/src/osd/sdl/testkeys.cpp b/src/osd/sdl/testkeys.cpp deleted file mode 100644 index 0f8157aa524..00000000000 --- a/src/osd/sdl/testkeys.cpp +++ /dev/null @@ -1,117 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Olivier Galibert, R. Belmont -//============================================================ -// -// testkey.c - A small utility to analyze SDL keycodes -// -// SDLMAME by Olivier Galibert and R. Belmont -// testkeys by couriersud -// -//============================================================ - -#include <stdio.h> -#include <ctype.h> -#include <string.h> -#include <wchar.h> - -#include "sdlinc.h" - -#include "unicode.h" - -struct key_lookup_table -{ - int code; - const char *name; -}; - -#define KE(x) { SDL_SCANCODE_ ## x, "SDL_SCANCODE_" #x }, -#define KE8(A, B, C, D, E, F, G, H) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G) KE(H) -#define KE7(A, B, C, D, E, F, G) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G) -#define KE5(A, B, C, D, E) KE(A) KE(B) KE(C) KE(D) KE(E) -#define KE3(A, B, C) KE(A) KE(B) KE(C) - - -static key_lookup_table sdl_lookup[] = -{ - KE7(UNKNOWN, BACKSPACE, TAB, CLEAR, RETURN, PAUSE, ESCAPE ) - KE(SPACE) - KE5(COMMA, MINUS, PERIOD, SLASH, 0 ) - KE8(1, 2, 3, 4, 5, 6, 7, 8 ) - KE5(9, SEMICOLON, EQUALS, PRINTSCREEN, AC_REFRESH) - KE5(LEFTBRACKET,BACKSLASH, RIGHTBRACKET, A, B ) - KE8(C, D, E, F, G, H, I, J ) - KE8(K, L, M, N, O, P, Q, R ) - KE8(S, T, U, V, W, X, Y, Z ) - KE8(DELETE, KP_0, KP_1, KP_2, KP_3, KP_4, KP_5, KP_6 ) - KE8(KP_7, KP_8, KP_9, KP_PERIOD, KP_DIVIDE, KP_MULTIPLY,KP_MINUS, KP_PLUS ) - KE8(KP_ENTER, KP_EQUALS, UP, DOWN, RIGHT, LEFT, INSERT, HOME ) - KE8(END, PAGEUP, PAGEDOWN, F1, F2, F3, F4, F5 ) - KE8(F6, F7, F8, F9, F10, F11, F12, F13 ) - KE8(F14, F15, NUMLOCKCLEAR, CAPSLOCK, SCROLLLOCK, RSHIFT, LSHIFT, RCTRL ) - KE7(LCTRL, RALT, LALT, LGUI, RGUI, KP_DECIMAL, APPLICATION) - KE5(MENU, NONUSBACKSLASH, UNDO, APOSTROPHE, GRAVE ) - {-1, ""} -}; - -static const char * lookup_key_name(const key_lookup_table *kt, int kc) -{ - int i=0; - while (kt[i].code>=0) - { - if (kc==kt[i].code) - return kt[i].name; - i++; - } - return NULL; -} - -#ifdef SDLMAME_WIN32 -int utf8_main(int argc, char *argv[]) -#else -int main(int argc, char *argv[]) -#endif -{ - SDL_Event event; - int quit = 0; - char lasttext[20] = ""; - - if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) { - fprintf(stderr, "Couldn't initialize SDL: %s\n", - SDL_GetError()); - exit(1); - } - SDL_CreateWindow("Input Test", 0, 0, 100, 100,0 ); - while(SDL_PollEvent(&event) || !quit) { - switch(event.type) { - case SDL_QUIT: - quit = 1; - break; - case SDL_KEYDOWN: - if (event.key.keysym.sym == SDLK_ESCAPE) - quit=1; - else - { - printf("ITEM_ID_XY %s 0x%x 0x%x %s\n", - lookup_key_name(sdl_lookup, event.key.keysym.scancode), - (int) event.key.keysym.scancode, - (int) event.key.keysym.sym, - ""); - lasttext[0] = 0; - } - break; - case SDL_KEYUP: - printf("ITEM_ID_XY %s 0x%x 0x%x %s\n", - lookup_key_name(sdl_lookup, event.key.keysym.scancode), - (int) event.key.keysym.scancode, - (int) event.key.keysym.sym, - lasttext); - break; - case SDL_TEXTINPUT: - strcpy(lasttext, event.text.text); - break; - } - event.type = 0; - } - SDL_Quit(); - return(0); -} diff --git a/src/osd/sdl/video.h b/src/osd/sdl/video.h index 307f3a898c9..0d9d66a5e61 100644 --- a/src/osd/sdl/video.h +++ b/src/osd/sdl/video.h @@ -15,16 +15,6 @@ #include "modules/osdwindow.h" //============================================================ -// CONSTANTS -//============================================================ - -#define MAX_VIDEO_WINDOWS (4) - -#define VIDEO_SCALE_MODE_NONE (0) - -#define GLSL_SHADER_MAX 10 - -//============================================================ // TYPE DEFINITIONS //============================================================ @@ -36,11 +26,6 @@ inline osd_rect SDL_Rect_to_osd_rect(const SDL_Rect &r) class sdl_monitor_info : public osd_monitor_info { public: -#if 0 - sdl_monitor_info() - : m_next(NULL), m_handle(0), m_aspect(0.0f) - {} -#endif sdl_monitor_info(const UINT64 handle, const char *monitor_device, float aspect) : osd_monitor_info(&m_handle, monitor_device, aspect), m_handle(handle) { @@ -56,66 +41,4 @@ private: UINT64 m_handle; // handle to the monitor }; -struct osd_video_config -{ - // global configuration - int windowed; // start windowed? - int prescale; // prescale factor - int keepaspect; // keep aspect ratio - int numscreens; // number of screens - - // hardware options - int mode; // output mode - int waitvsync; // spin until vsync - int syncrefresh; // sync only to refresh rate - int switchres; // switch resolutions - - int fullstretch; // FXIME: implement in windows! - - // d3d, accel, opengl - int filter; // enable filtering - //int filter; // enable filtering, disabled if glsl_filter>0 - - // OpenGL options - int glsl; - int glsl_filter; // glsl filtering, >0 disables filter - char * glsl_shader_mamebm[GLSL_SHADER_MAX]; // custom glsl shader set, mame bitmap - int glsl_shader_mamebm_num; // custom glsl shader set number, mame bitmap - char * glsl_shader_scrn[GLSL_SHADER_MAX]; // custom glsl shader set, screen bitmap - int glsl_shader_scrn_num; // custom glsl shader number, screen bitmap - int pbo; - int vbo; - int allowtexturerect; // allow GL_ARB_texture_rectangle, default: no - int forcepow2texture; // force power of two textures, default: no - - // dd, d3d - int triplebuf; // triple buffer - - //============================================================ - // SDL - options - //============================================================ - int novideo; // don't draw, for pure CPU benchmarking - - int centerh; - int centerv; - - // vector options - float beamwidth; // beam width - - // perftest - int perftest; // print out real video fps - - // X11 options - int restrictonemonitor; // in fullscreen, confine to Xinerama monitor 0 - - // YUV options - int scale_mode; -}; - -//============================================================ -// GLOBAL VARIABLES -//============================================================ - -extern osd_video_config video_config; - #endif diff --git a/src/osd/windows/main.cpp b/src/osd/windows/main.cpp index ccfddb27a0d..4ef0baf1c98 100644 --- a/src/osd/windows/main.cpp +++ b/src/osd/windows/main.cpp @@ -7,28 +7,22 @@ //============================================================ // standard windows headers +#ifdef OSD_SDL +#define _WIN32_WINNT 0x0501 +#endif #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <tchar.h> #include <stdlib.h> -// MAMEOS headers #include "strconv.h" extern int utf8_main(int argc, char *argv[]); - - - //============================================================ // main //============================================================ -// undo the command-line #define that maps main to utf8_main in all other cases -#ifndef WINUI -#undef main -#undef wmain -#endif - +#ifdef UNICODE extern "C" int _tmain(int argc, TCHAR **argv) { int i, rc; @@ -55,3 +49,4 @@ extern "C" int _tmain(int argc, TCHAR **argv) return rc; } +#endif diff --git a/src/osd/windows/video.cpp b/src/osd/windows/video.cpp index 559213657da..2da04f8b155 100644 --- a/src/osd/windows/video.cpp +++ b/src/osd/windows/video.cpp @@ -62,7 +62,7 @@ static void get_resolution(const char *defdata, const char *data, osd_window_con //============================================================ // FIXME: Temporary workaround -static osd_window_config windows[MAX_WINDOWS]; // configuration data per-window +static osd_window_config windows[MAX_VIDEO_WINDOWS]; // configuration data per-window bool windows_osd_interface::video_init() { diff --git a/src/osd/windows/video.h b/src/osd/windows/video.h index 9e040d90b78..f47a5260b8e 100644 --- a/src/osd/windows/video.h +++ b/src/osd/windows/video.h @@ -14,14 +14,6 @@ #include "modules/osdwindow.h" //============================================================ -// CONSTANTS -//============================================================ - -#define MAX_WINDOWS 4 - -#define GLSL_SHADER_MAX 10 - -//============================================================ // TYPE DEFINITIONS //============================================================ @@ -47,67 +39,9 @@ public: private: HMONITOR m_handle; // handle to the monitor +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) MONITORINFOEX m_info; // most recently retrieved info +#endif }; -struct osd_video_config -{ - // global configuration - int windowed; // start windowed? - int prescale; // prescale factor - int keepaspect; // keep aspect ratio - int numscreens; // number of screens - - // hardware options - int mode; // output mode - int waitvsync; // spin until vsync - int syncrefresh; // sync only to refresh rate - int switchres; // switch resolutions - - // d3d, accel, opengl - int filter; // enable filtering - //int filter; // enable filtering, disabled if glsl_filter>0 - - // OpenGL options - int glsl; - int glsl_filter; // glsl filtering, >0 disables filter - char * glsl_shader_mamebm[GLSL_SHADER_MAX]; // custom glsl shader set, mame bitmap - int glsl_shader_mamebm_num; // custom glsl shader set number, mame bitmap - char * glsl_shader_scrn[GLSL_SHADER_MAX]; // custom glsl shader set, screen bitmap - int glsl_shader_scrn_num; // custom glsl shader number, screen bitmap - int pbo; - int vbo; - int allowtexturerect; // allow GL_ARB_texture_rectangle, default: no - int forcepow2texture; // force power of two textures, default: no - - // dd, d3d - int triplebuf; // triple buffer - - //============================================================ - // SDL - options - //============================================================ - int novideo; // don't draw, for pure CPU benchmarking - - int centerh; - int centerv; - - // vector options - float beamwidth; // beam width - - // perftest - int perftest; // print out real video fps - - // X11 options - int restrictonemonitor; // in fullscreen, confine to Xinerama monitor 0 - - // YUV options - int scale_mode; -}; - -//============================================================ -// GLOBAL VARIABLES -//============================================================ - -extern osd_video_config video_config; - #endif diff --git a/src/osd/windows/winclip.cpp b/src/osd/windows/winclip.cpp deleted file mode 100644 index 7717f4e6188..00000000000 --- a/src/osd/windows/winclip.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -//============================================================ -// -// winclip.c - Win32 OSD core clipboard access functions -// -//============================================================ - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> - -#include "strconv.h" - -//============================================================ -// get_clipboard_text_by_format -//============================================================ - -static char *get_clipboard_text_by_format(UINT format, char *(*convert)(LPCVOID data)) -{ - char *result = NULL; - HANDLE data_handle; - LPVOID data; - - // check to see if this format is available - if (IsClipboardFormatAvailable(format)) - { - // open the clipboard - if (OpenClipboard(NULL)) - { - // try to access clipboard data - data_handle = GetClipboardData(format); - if (data_handle != NULL) - { - // lock the data - data = GlobalLock(data_handle); - if (data != NULL) - { - // invoke the convert - result = (*convert)(data); - - // unlock the data - GlobalUnlock(data_handle); - } - } - - // close out the clipboard - CloseClipboard(); - } - } - return result; -} - -//============================================================ -// convert_wide -//============================================================ - -static char *convert_wide(LPCVOID data) -{ - return utf8_from_wstring((LPCWSTR) data); -} - -//============================================================ -// convert_ansi -//============================================================ - -static char *convert_ansi(LPCVOID data) -{ - return utf8_from_astring((LPCSTR) data); -} - - - -//============================================================ -// osd_get_clipboard_text -//============================================================ - -char *osd_get_clipboard_text(void) -{ - char *result; - - // try to access unicode text - result = get_clipboard_text_by_format(CF_UNICODETEXT, convert_wide); - - // try to access ANSI text - if (result == NULL) - result = get_clipboard_text_by_format(CF_TEXT, convert_ansi); - - return result; -} diff --git a/src/osd/windows/window.h b/src/osd/windows/window.h index bc3544ba637..b42903b9dff 100644 --- a/src/osd/windows/window.h +++ b/src/osd/windows/window.h @@ -57,14 +57,22 @@ public: virtual bool win_has_menu() override { +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) return GetMenu(m_hwnd) ? true : false; +#else + return false; +#endif } virtual osd_dim get_size() override { +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) RECT client; GetClientRect(m_hwnd, &client); return osd_dim(client.right - client.left, client.bottom - client.top); +#else + throw ref new Platform::NotImplementedException(); +#endif } virtual osd_monitor_info *monitor() const override { return m_monitor; } diff --git a/src/osd/windows/winmain.cpp b/src/osd/windows/winmain.cpp index 55cbde387e6..c7b1cb619e8 100644 --- a/src/osd/windows/winmain.cpp +++ b/src/osd/windows/winmain.cpp @@ -52,6 +52,8 @@ // TYPE DEFINITIONS //************************************************************************** +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + template<typename _FunctionPtr> class dynamic_bind { @@ -217,6 +219,7 @@ public: } }; +#endif @@ -231,21 +234,23 @@ int _CRT_glob = 0; // LOCAL VARIABLES //************************************************************************** +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) static LPTOP_LEVEL_EXCEPTION_FILTER pass_thru_filter; -static HANDLE watchdog_reset_event; -static HANDLE watchdog_exit_event; -static HANDLE watchdog_thread; +static sampling_profiler *profiler = nullptr; +static symbol_manager *symbols = nullptr; -static running_machine *g_current_machine; +bool stack_walker::s_initialized = false; static int timeresult = !TIMERR_NOERROR; static TIMECAPS timecaps; +#endif -static sampling_profiler *profiler = nullptr; -static symbol_manager *symbols = nullptr; +static HANDLE watchdog_reset_event; +static HANDLE watchdog_exit_event; +static HANDLE watchdog_thread; -bool stack_walker::s_initialized = false; +static running_machine *g_current_machine; //************************************************************************** @@ -374,6 +379,7 @@ const options_entry windows_options::s_option_entries[] = // MAIN ENTRY POINT //************************************************************************** +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) //============================================================ // utf8_main @@ -432,18 +438,6 @@ int main(int argc, char *argv[]) return result; } - -//============================================================ -// windows_options -//============================================================ - -windows_options::windows_options() -: osd_options() -{ - add_entries(s_option_entries); -} - - //============================================================ // control_handler //============================================================ @@ -453,12 +447,12 @@ static BOOL WINAPI control_handler(DWORD type) // indicate to the user that we detected something switch (type) { - case CTRL_C_EVENT: fprintf(stderr, "Caught Ctrl+C"); break; - case CTRL_BREAK_EVENT: fprintf(stderr, "Caught Ctrl+break"); break; - case CTRL_CLOSE_EVENT: fprintf(stderr, "Caught console close"); break; - case CTRL_LOGOFF_EVENT: fprintf(stderr, "Caught logoff"); break; - case CTRL_SHUTDOWN_EVENT: fprintf(stderr, "Caught shutdown"); break; - default: fprintf(stderr, "Caught unexpected console event"); break; + case CTRL_C_EVENT: fprintf(stderr, "Caught Ctrl+C"); break; + case CTRL_BREAK_EVENT: fprintf(stderr, "Caught Ctrl+break"); break; + case CTRL_CLOSE_EVENT: fprintf(stderr, "Caught console close"); break; + case CTRL_LOGOFF_EVENT: fprintf(stderr, "Caught logoff"); break; + case CTRL_SHUTDOWN_EVENT: fprintf(stderr, "Caught shutdown"); break; + default: fprintf(stderr, "Caught unexpected console event"); break; } // if we don't have a machine yet, or if we are handling ctrl+c/ctrl+break, @@ -480,7 +474,18 @@ static BOOL WINAPI control_handler(DWORD type) return TRUE; } +#endif + + +//============================================================ +// windows_options +//============================================================ +windows_options::windows_options() +: osd_options() +{ + add_entries(s_option_entries); +} //============================================================ @@ -592,11 +597,13 @@ void windows_osd_interface::init(running_machine &machine) if (options.oslog()) machine.add_logerror_callback(output_oslog); +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) // crank up the multimedia timer resolution to its max // this gives the system much finer timeslices timeresult = timeGetDevCaps(&timecaps, sizeof(timecaps)); if (timeresult == TIMERR_NOERROR) timeBeginPeriod(timecaps.wPeriodMin); +#endif // if a watchdog thread is requested, create one int watchdog = options.watchdog(); @@ -611,11 +618,13 @@ void windows_osd_interface::init(running_machine &machine) } // create and start the profiler +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) if (profile > 0) { profiler = global_alloc(sampling_profiler(1000, profile - 1)); profiler->start(); } +#endif // initialize sockets win_init_sockets(); @@ -652,6 +661,7 @@ void windows_osd_interface::osd_exit() watchdog_thread = nullptr; } +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) // stop the profiler if (profiler != nullptr) { @@ -663,43 +673,12 @@ void windows_osd_interface::osd_exit() // restore the timer resolution if (timeresult == TIMERR_NOERROR) timeEndPeriod(timecaps.wPeriodMin); +#endif // one last pass at events winwindow_process_events(machine(), 0, 0); } -//============================================================ -// winmain_dump_stack -//============================================================ - -void winmain_dump_stack() -{ - // set up the stack walker - stack_walker walker; - if (!walker.reset()) - return; - - // walk the stack - while (walker.unwind()) - fprintf(stderr, " %p: %p%s\n", (void *)walker.frame(), (void *)walker.ip(), (symbols == nullptr) ? "" : symbols->symbol_for_address(walker.ip())); -} - - -//============================================================ -// check_for_double_click_start -//============================================================ - -static int is_double_click_start(int argc) -{ - STARTUPINFO startup_info = { sizeof(STARTUPINFO) }; - - // determine our startup information - GetStartupInfo(&startup_info); - - // try to determine if MAME was simply double-clicked - return (argc <= 1 && startup_info.dwFlags && !(startup_info.dwFlags & STARTF_USESTDHANDLES)); -} - //============================================================ // watchdog_thread_entry @@ -751,6 +730,40 @@ void winmain_watchdog_ping(void) } +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + +//============================================================ +// winmain_dump_stack +//============================================================ + +void winmain_dump_stack() +{ + // set up the stack walker + stack_walker walker; + if (!walker.reset()) + return; + + // walk the stack + while (walker.unwind()) + fprintf(stderr, " %p: %p%s\n", (void *)walker.frame(), (void *)walker.ip(), (symbols == nullptr) ? "" : symbols->symbol_for_address(walker.ip())); +} + + +//============================================================ +// check_for_double_click_start +//============================================================ + +static int is_double_click_start(int argc) +{ + STARTUPINFO startup_info = { sizeof(STARTUPINFO) }; + + // determine our startup information + GetStartupInfo(&startup_info); + + // try to determine if MAME was simply double-clicked + return (argc <= 1 && startup_info.dwFlags && !(startup_info.dwFlags & STARTF_USESTDHANDLES)); +} + //============================================================ // exception_filter //============================================================ @@ -1559,3 +1572,5 @@ void sampling_profiler::thread_run() Sleep(1); } } + +#endif
\ No newline at end of file diff --git a/src/osd/sdl/aueffectutil-Info.plist b/src/tools/aueffectutil-Info.plist index e5094157c33..e5094157c33 100644 --- a/src/osd/sdl/aueffectutil-Info.plist +++ b/src/tools/aueffectutil-Info.plist diff --git a/src/osd/sdl/aueffectutil.mm b/src/tools/aueffectutil.mm index 531d814e987..531d814e987 100644 --- a/src/osd/sdl/aueffectutil.mm +++ b/src/tools/aueffectutil.mm |