diff options
Diffstat (limited to 'src')
94 files changed, 955 insertions, 404 deletions
diff --git a/src/devices/bus/a2bus/pc_xporter.cpp b/src/devices/bus/a2bus/pc_xporter.cpp new file mode 100644 index 00000000000..2a5f9b38acf --- /dev/null +++ b/src/devices/bus/a2bus/pc_xporter.cpp @@ -0,0 +1,255 @@ +// license:BSD-3-Clause +// copyright-holders:R. Belmont +/********************************************************************* + + pcxporter.cpp + + Implementation of the Applied Engineering PC Transporter card + Preliminary version by R. Belmont + + The PC Transporter is basically a PC-XT on an Apple II card. + Features include: + - V30 CPU @ 4.77 MHz + - 768K of RAM, which defines the V30 address space from 0x00000 to 0xBFFFF + and is fully read/writable by the Apple's CPU. + - Usual XT hardware, mostly inside custom ASICs. There's a discrete + NEC uPD71054 (i8254-compatible PIT) though. + - CGA-compatible video, output to a separate CGA monitor or NTSC-compliant analog + RGB monitor (e.g. the IIgs RGB monitor). + - XT-compatible keyboard interface. + - PC-style floppy controller: supports 360K 5.25" disks and 720K 3.5" disks + - HDD controller which is redirected to a file on the Apple's filesystem + + The V30 BIOS is downloaded by the Apple; the Apple also writes text to the CGA screen prior to + the V30's being launched. + + The board was developed by The Engineering Department, a company made up mostly of early Apple + engineers including Apple /// designer Dr. Wendall Sander and ProDOS creator Dick Huston. + + Software and user documentation at: + http://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Interface%20Cards/CPU/AE%20PC%20Transporter/ + + Notes: + Registers live at CFxx; access CFFF to clear C800 reservation, + then read Cn00 to map C800-CFFF first. + + PC RAM from 0xA0000-0xAFFFF is where the V30 BIOS is downloaded, + plus used for general storage by the system. + RAM from 0xB0000-0xBFFFF is the CGA framebuffer as usual. + + CF00: PC memory pointer (bits 0-7) + CF01: PC memory pointer (bits 8-15) + CF02: PC memory pointer (bits 16-23) + CF03: read/write PC memory at the pointer and increment the pointer + CF04: read/write PC memory at the pointer and *don't* increment the pointer + + TODO: + - A2 probably also can access the V30's I/O space: where's that at? CF0E/CF0F + are suspects... + - There's likely A2 ROM at CnXX and C800-CBFF to support the "Slinky" memory + expansion card emulation function inside one of the custom ASICs. Need to + dump this... + +*********************************************************************/ + +#include "pc_xporter.h" + +/*************************************************************************** + PARAMETERS +***************************************************************************/ + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +const device_type A2BUS_PCXPORTER = &device_creator<a2bus_pcxporter_device>; + +static MACHINE_CONFIG_FRAGMENT( pcxporter ) +MACHINE_CONFIG_END + +/*************************************************************************** + FUNCTION PROTOTYPES +***************************************************************************/ + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor a2bus_pcxporter_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( pcxporter ); +} + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +a2bus_pcxporter_device::a2bus_pcxporter_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_a2bus_card_interface(mconfig, *this) +{ +} + +a2bus_pcxporter_device::a2bus_pcxporter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, A2BUS_PCXPORTER, "Applied Engineering PC Transporter", tag, owner, clock, "a2pcxport", __FILE__), + device_a2bus_card_interface(mconfig, *this) +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void a2bus_pcxporter_device::device_start() +{ + // set_a2bus_device makes m_slot valid + set_a2bus_device(); + + memset(m_ram, 0, 768*1024); + memset(m_regs, 0, 0x400); + m_offset = 0; + + save_item(NAME(m_ram)); + save_item(NAME(m_regs)); + save_item(NAME(m_offset)); +} + +void a2bus_pcxporter_device::device_reset() +{ +} + + +/*------------------------------------------------- + read_c0nx - called for reads from this card's c0nx space +-------------------------------------------------*/ + +UINT8 a2bus_pcxporter_device::read_c0nx(address_space &space, UINT8 offset) +{ + switch (offset) + { + default: + printf("Read c0n%x (PC=%x)\n", offset, space.device().safe_pc()); + break; + } + + return 0xff; +} + + +/*------------------------------------------------- + write_c0nx - called for writes to this card's c0nx space +-------------------------------------------------*/ + +void a2bus_pcxporter_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +{ + switch (offset) + { + default: + printf("Write %02x to c0n%x (PC=%x)\n", data, offset, space.device().safe_pc()); + break; + } +} + +/*------------------------------------------------- + read_cnxx - called for reads from this card's cnxx space +-------------------------------------------------*/ + +UINT8 a2bus_pcxporter_device::read_cnxx(address_space &space, UINT8 offset) +{ + // read only to trigger C800? + return 0xff; +} + +void a2bus_pcxporter_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data) +{ + printf("Write %02x to cn%02x (PC=%x)\n", data, offset, space.device().safe_pc()); +} + +/*------------------------------------------------- + read_c800 - called for reads from this card's c800 space +-------------------------------------------------*/ + +UINT8 a2bus_pcxporter_device::read_c800(address_space &space, UINT16 offset) +{ +// printf("Read C800 at %x\n", offset + 0xc800); + + if (offset < 0x400) + { + return 0xff; + } + else + { + UINT8 rv; + + switch (offset) + { + case 0x700: + return m_offset & 0xff; + + case 0x701: + return (m_offset >> 8) & 0xff; + + case 0x702: + return (m_offset >> 16) & 0xff; + + case 0x703: // read with increment + rv = m_ram[m_offset]; + m_offset++; + return rv; + + case 0x704: // read w/o increment + rv = m_ram[m_offset]; + return rv; + } + + return m_regs[offset]; + } +} + +/*------------------------------------------------- + write_c800 - called for writes to this card's c800 space +-------------------------------------------------*/ +void a2bus_pcxporter_device::write_c800(address_space &space, UINT16 offset, UINT8 data) +{ + if (offset < 0x400) + { + } + else + { + switch (offset) + { + case 0x700: + m_offset &= ~0xff; + m_offset |= data; +// printf("offset now %x (PC=%x)\n", m_offset, space.device().safe_pc()); + break; + + case 0x701: + m_offset &= ~0xff00; + m_offset |= (data<<8); +// printf("offset now %x (PC=%x)\n", m_offset, space.device().safe_pc()); + break; + + case 0x702: + m_offset &= ~0xff0000; + m_offset |= (data<<16); +// printf("offset now %x (PC=%x)\n", m_offset, space.device().safe_pc()); + break; + + case 0x703: // write w/increment + m_ram[m_offset] = data; + m_offset++; + break; + + case 0x704: // write w/o increment + m_ram[m_offset] = data; + break; + + default: + printf("%02x to C800 at %x\n", data, offset + 0xc800); + m_regs[offset] = data; + break; + } + } +} diff --git a/src/devices/bus/a2bus/pc_xporter.h b/src/devices/bus/a2bus/pc_xporter.h new file mode 100644 index 00000000000..7126439a265 --- /dev/null +++ b/src/devices/bus/a2bus/pc_xporter.h @@ -0,0 +1,53 @@ +// license:BSD-3-Clause +// copyright-holders:R. Belmont +/********************************************************************* + + pc_xporter.h + + Implementation of the Applied Engineering PC Transporter card + +*********************************************************************/ + +#pragma once + +#include "emu.h" +#include "a2bus.h" +#include "machine/genpc.h" + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +class a2bus_pcxporter_device: + public device_t, + public device_a2bus_card_interface +{ +public: + // construction/destruction + a2bus_pcxporter_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); + a2bus_pcxporter_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; + +protected: + virtual void device_start() override; + virtual void device_reset() override; + + // overrides of standard a2bus slot functions + virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; + virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; + virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; + virtual void write_cnxx(address_space &space, UINT8 offset, UINT8 data) override; + virtual UINT8 read_c800(address_space &space, UINT16 offset) override; + virtual void write_c800(address_space &space, UINT16 offset, UINT8 data) override; + +private: + UINT8 m_ram[768*1024]; + UINT8 m_regs[0x400]; + UINT32 m_offset; +}; + +// device type definition +extern const device_type A2BUS_PCXPORTER; + diff --git a/src/devices/bus/sms_ctrl/joypad.cpp b/src/devices/bus/sms_ctrl/joypad.cpp index b2537453c6a..99ca264cec4 100644 --- a/src/devices/bus/sms_ctrl/joypad.cpp +++ b/src/devices/bus/sms_ctrl/joypad.cpp @@ -2,7 +2,22 @@ // copyright-holders:Fabio Priuli /********************************************************************** - Sega Master System "Control Pad"/generic joystick emulation + Sega Mark III "Joypad" / Master System "Control Pad" emulation + + +Release data from the Sega Retro project: + +- Joypad: + + Year: 1985 Country/region: JP Model code: SJ-152 + +- Control Pad: + + Year: 1986 Country/region: US Model code: 3020 + Year: 1987 Country/region: JP Model code: 3020 + Year: 1987 Country/region: EU Model code: ? + Year: 1989 Country/region: BR Model code: 011770 + Year: 1989 Country/region: KR Model code: ? **********************************************************************/ diff --git a/src/devices/bus/sms_ctrl/joypad.h b/src/devices/bus/sms_ctrl/joypad.h index a67dd5f78b0..d8028bef6c3 100644 --- a/src/devices/bus/sms_ctrl/joypad.h +++ b/src/devices/bus/sms_ctrl/joypad.h @@ -2,7 +2,7 @@ // copyright-holders:Fabio Priuli /********************************************************************** - Sega Master System "Control Pad"/generic joystick emulation + Sega Mark III "Joypad" / Master System "Control Pad" emulation **********************************************************************/ diff --git a/src/devices/bus/sms_ctrl/lphaser.cpp b/src/devices/bus/sms_ctrl/lphaser.cpp index 7c1056da5f0..8a49c9a1554 100644 --- a/src/devices/bus/sms_ctrl/lphaser.cpp +++ b/src/devices/bus/sms_ctrl/lphaser.cpp @@ -4,6 +4,14 @@ Sega Master System "Light Phaser" (light gun) emulation + +Release data from the Sega Retro project: + + Year: 1986 Country/region: US Model code: 3050 + Year: 1987 Country/region: EU Model code: ? + Year: 1989 Country/region: BR Model code: 010470 + Year: 198? Country/region: KR Model code: ? + **********************************************************************/ #include "lphaser.h" diff --git a/src/devices/bus/sms_ctrl/paddle.cpp b/src/devices/bus/sms_ctrl/paddle.cpp index 5486c9a50bd..ec5acd4a5ee 100644 --- a/src/devices/bus/sms_ctrl/paddle.cpp +++ b/src/devices/bus/sms_ctrl/paddle.cpp @@ -2,7 +2,24 @@ // copyright-holders:Fabio Priuli /********************************************************************** - Sega Master System "Paddle Control" emulation + Sega Mark III "Paddle Control" emulation + + +Release data from the Sega Retro project: + + Year: 1987 Country/region: JP Model code: HPD-200 + +Notes: + + The main chip contained in the device is labeled 315-5243. + + The Paddle Control was only released in Japan. To work with the device, + paddle games need to detect the system region as Japanese, else they switch + to a different mode that uses the TH line as output to select which nibble + of the X axis will be read. This other mode is similar to how the US Sports + Pad works, so on an Export system, paddle games are somewhat playable with + that device, though it needs to be used inverted and the trackball needs to + be moved slowly, else the software for the paddle think it's moving backward. **********************************************************************/ diff --git a/src/devices/bus/sms_ctrl/paddle.h b/src/devices/bus/sms_ctrl/paddle.h index 8e092d63afe..fae7a93fb19 100644 --- a/src/devices/bus/sms_ctrl/paddle.h +++ b/src/devices/bus/sms_ctrl/paddle.h @@ -2,7 +2,7 @@ // copyright-holders:Fabio Priuli /********************************************************************** - Sega Master System "Paddle Control" emulation + Sega Mark III "Paddle Control" emulation **********************************************************************/ diff --git a/src/devices/bus/sms_ctrl/rfu.cpp b/src/devices/bus/sms_ctrl/rfu.cpp index 0ccc5ae4e9c..3c27307c137 100644 --- a/src/devices/bus/sms_ctrl/rfu.cpp +++ b/src/devices/bus/sms_ctrl/rfu.cpp @@ -2,12 +2,22 @@ // copyright-holders:Fabio Priuli /********************************************************************** - Sega Master System "Rapid Fire Unit" emulation + Sega SG-1000/Mark-III/SMS "Rapid Fire Unit" emulation -**********************************************************************/ -// This emulated device is the version released by Sega. In Brazil, Tec Toy -// released a version that does not have any switch to turn on/off auto-repeat. +Release data from the Sega Retro project: + + Year: 1985 Country/region: JP Model code: RF-150 + Year: 1987 Country/region: US Model code: 3046 + Year: 1988 Country/region: EU Model code: MK-3046-50 + Year: 1989 Country/region: BR Model code: 011050 + +Notes: + + This emulated device is the version released by Sega. In Brazil, Tec Toy + released a version that does not have any switch to turn on/off auto-repeat. + +**********************************************************************/ #include "rfu.h" diff --git a/src/devices/bus/sms_ctrl/rfu.h b/src/devices/bus/sms_ctrl/rfu.h index adc9a3443ba..6a56b06ae3a 100644 --- a/src/devices/bus/sms_ctrl/rfu.h +++ b/src/devices/bus/sms_ctrl/rfu.h @@ -2,7 +2,7 @@ // copyright-holders:Fabio Priuli /********************************************************************** - Sega Master System "Rapid Fire Unit" emulation + Sega SG-1000/Mark-III/SMS "Rapid Fire Unit" emulation **********************************************************************/ diff --git a/src/devices/bus/sms_ctrl/sports.cpp b/src/devices/bus/sms_ctrl/sports.cpp index 77356cec41f..b4bd54d81a1 100644 --- a/src/devices/bus/sms_ctrl/sports.cpp +++ b/src/devices/bus/sms_ctrl/sports.cpp @@ -4,29 +4,43 @@ Sega Master System "Sports Pad" (US model) emulation -**********************************************************************/ -// The games designed for the US model of the Sports Pad controller use the -// TH line of the controller port to select which nibble, of the two axis -// bytes, will be read at a time. The Japanese cartridge Sports Pad Soccer -// uses a different mode, because the Sega Mark III lacks the TH line, so -// there is a different Sports Pad model released in Japan (see sportsjp.c). - -// The Japanese SMS has the TH line connected, but doesn't report TH input -// on port 0xDD. However, a magazine raffled the US Sports Pad along with a -// Great Ice Hockey cartridge, in Japanese format, to owners of that console. -// So, Great Ice Hockey seems to just need TH pin as output to work, while -// other games designed for the US Sports Pad don't work on the Japanese SMS. - -// It was discovered that games designed for the Paddle Controller, released -// in Japan, switch to a mode incompatible with the original Paddle when -// detect the system region as Export. Similar to how the US model of the -// Sports Pad works, that mode uses the TH line as output to select which -// nibble of the X axis will be read. So, on an Export console version, paddle -// games are somewhat playable with the US Sport Pad model, though it needs to -// be used inverted and the trackball needs to be moved slowly, else the -// software for the paddle think it's moving backward. -// See http://mametesters.org/view.php?id=5872 for discussion. +Release data from the Sega Retro project: + + Year: 1987 Country/region: US Model code: 3040 + +TODO: + +- For low-level emulation, a device for the TMP42C66P, a Toshiba 4bit + microcontroller, needs to be created, but a dump of its internal ROM + seems to be required. +- Auto-repeat and Control/Sports mode switches are not emulated. + +Notes: + + Games designed for the US model of the Sports Pad controller use the + TH line of the controller port to select which nibble, of the two axis + bytes, will be read at a time. The Japanese cartridge Sports Pad Soccer + uses a different mode, because the Sega Mark III lacks the TH line, so + there is a different Sports Pad model released in Japan (see sportsjp.c). + + The Japanese SMS has the TH line connected, but doesn't report TH input + on port 0xDD. However, a magazine raffled the US Sports Pad along with a + Great Ice Hockey cartridge, in Japanese format, to owners of that console. + So, Great Ice Hockey seems to just need TH pin as output to work, while + other games designed for the US Sports Pad don't work on the Japanese SMS. + + It was discovered that games designed for the Paddle Controller, released + in Japan, switch to a mode incompatible with the original Paddle when + detect the system region as Export. Similar to how the US model of the + Sports Pad works, that mode uses the TH line as output to select which + nibble of the X axis will be read. So, on an Export console version, + paddle games are somewhat playable with the US Sport Pad model, though it + needs to be used inverted and the trackball needs to be moved slowly, else + the software for the paddle think it's moving backward. + See http://mametesters.org/view.php?id=5872 for discussion. + +**********************************************************************/ #include "sports.h" diff --git a/src/devices/bus/sms_ctrl/sportsjp.cpp b/src/devices/bus/sms_ctrl/sportsjp.cpp index 16c5198721c..ca2c3de1748 100644 --- a/src/devices/bus/sms_ctrl/sportsjp.cpp +++ b/src/devices/bus/sms_ctrl/sportsjp.cpp @@ -4,12 +4,25 @@ Sega Master System "Sports Pad" (Japanese model) emulation -**********************************************************************/ -// The Japanese Sports Pad controller is only required to play the cartridge -// Sports Pad Soccer, released in Japan. It uses a different mode than the -// used by the US model, due to the missing TH line on Sega Mark III -// controller ports. +Release data from the Sega Retro project: + + Year: 1988 Country/region: JP Model code: SP-500 + +TODO: + +- For low-level emulation, a device for the TMP42C66P, a Toshiba 4bit + microcontroller, needs to be created, but a dump of its internal ROM + seems to be required. + +Notes: + + The Japanese Sports Pad controller is only required to play the cartridge + Sports Pad Soccer, released in Japan. It uses a different mode than the + used by the US model, due to the missing TH line on Sega Mark III + controller ports. + +**********************************************************************/ #include "sportsjp.h" diff --git a/src/devices/bus/sms_exp/gender.cpp b/src/devices/bus/sms_exp/gender.cpp index 3de8961050c..49ccc50e24e 100644 --- a/src/devices/bus/sms_exp/gender.cpp +++ b/src/devices/bus/sms_exp/gender.cpp @@ -4,14 +4,14 @@ Sega Master System "Gender Adapter" emulation -**********************************************************************/ +The Gender Adapter is not an official Sega product. It is produced since 2006 +by the SMSPower website to permit to plug a cartridge on the expansion slot +on any SMS 1 model. This includes the Japanese SMS, which has FM sound, so +it is a way to get FM music of western cartridges that have FM code but were +not released in Japan. Some games have compatibility issues, confirmed on the +real hardware, when run plugged-in to the SMS expansion slot. -// The Gender Adapter is not an official Sega product. It is produced by the -// SMSPower website to permit to plug a cartridge on the expansion slot on any -// SMS 1 model. This includes the Japanese SMS, which has FM sound, so it is -// a way to get FM music of western cartridges that have FM code but were not -// released in Japan. Some games have compatibility issues, confirmed on the -// real hardware, when run plugged-in to the SMS expansion slot. +**********************************************************************/ #include "gender.h" diff --git a/src/devices/bus/ti99x/998board.cpp b/src/devices/bus/ti99x/998board.cpp index 6df84271cc4..0d1f081ed1b 100644 --- a/src/devices/bus/ti99x/998board.cpp +++ b/src/devices/bus/ti99x/998board.cpp @@ -296,7 +296,7 @@ READ8_MEMBER( mainboard8_device::readm ) { UINT8 value = 0; bool found; - if (TRACE_MEM) logerror("%s: read from %04x\n", tag(), offset); + if (TRACE_DETAIL) logerror("%s: read from %04x\n", tag(), offset); found = access_logical_r(space, offset, &value, mem_mask); m_waitcount = 2; @@ -487,10 +487,10 @@ bool mainboard8_device::access_logical_r(address_space& space, offs_t offset, UI logically_addressed_device *ldev = m_logcomp.first(); bus8z_device *bdev; - if (TRACE_MEM) logerror("%s: offset=%04x; CRUS=%d, PTGEN=%d\n", tag(), offset, m_CRUS? 1:0, m_PTGE? 0:1); + if (TRACE_DETAIL) logerror("%s: offset=%04x; CRUS=%d, PTGEN=%d\n", tag(), offset, m_CRUS? 1:0, m_PTGE? 0:1); while (ldev != nullptr) { - if (TRACE_MEM) logerror("%s: checking node=%s\n", tag(), ldev->m_config->name); + if (TRACE_DETAIL) logerror("%s: checking node=%s\n", tag(), ldev->m_config->name); // Check the mode if (((ldev->m_config->mode == NATIVE) && (m_CRUS==false)) || ((ldev->m_config->mode == TI99EM) && (m_CRUS==true)) diff --git a/src/emu/ui/datfile.cpp b/src/emu/ui/datfile.cpp index 799cdaf3823..08415084cf9 100644 --- a/src/emu/ui/datfile.cpp +++ b/src/emu/ui/datfile.cpp @@ -31,6 +31,7 @@ static std::string TAG_MESSINFO_R("# MESSINFO.DAT"); static std::string TAG_SYSINFO_R("# This file was generated on"); static std::string TAG_STORY_R("# version"); static std::string TAG_COMMAND_SEPARATOR("-----------------------------------------------"); +static std::string TAG_GAMEINIT_R("# GAMEINIT.DAT"); //------------------------------------------------- // Statics @@ -41,6 +42,7 @@ datfile_manager::dataindex datfile_manager::m_messidx; datfile_manager::dataindex datfile_manager::m_cmdidx; datfile_manager::dataindex datfile_manager::m_sysidx; datfile_manager::dataindex datfile_manager::m_storyidx; +datfile_manager::dataindex datfile_manager::m_ginitidx; datfile_manager::drvindex datfile_manager::m_drvidx; datfile_manager::drvindex datfile_manager::m_messdrvidx; datfile_manager::drvindex datfile_manager::m_menuidx; @@ -50,6 +52,7 @@ std::string datfile_manager::m_mame_rev; std::string datfile_manager::m_mess_rev; std::string datfile_manager::m_sysinfo_rev; std::string datfile_manager::m_story_rev; +std::string datfile_manager::m_ginit_rev; bool datfile_manager::first_run = true; //------------------------------------------------- @@ -95,6 +98,12 @@ datfile_manager::datfile_manager(running_machine &machine) : m_machine(machine) init_history(); parseclose(); } + + if (parseopen("gameinit.dat")) + { + init_gameinit(); + parseclose(); + } } } @@ -132,6 +141,18 @@ void datfile_manager::init_history() } //------------------------------------------------- +// initialize gameinit.dat index +//------------------------------------------------- +void datfile_manager::init_gameinit() +{ + int swcount = 0; + drvindex tmp; + int count = index_mame_mess_info(m_ginitidx, tmp, swcount); + osd_printf_verbose("Gameinit.dat games found = %i\n", count); + osd_printf_verbose("Rev = %s\n", m_ginit_rev.c_str()); +} + +//------------------------------------------------- // initialize mameinfo.dat index //------------------------------------------------- void datfile_manager::init_mameinfo() @@ -250,6 +271,11 @@ void datfile_manager::load_data_info(const game_driver *drv, std::string &buffer tag = TAG_STORY; index_idx = m_storyidx; break; + case UI_GINIT_LOAD: + filename = "gameinit.dat"; + tag = TAG_MAME; + index_idx = m_ginitidx; + break; } if (parseopen(filename.c_str())) @@ -261,7 +287,7 @@ void datfile_manager::load_data_info(const game_driver *drv, std::string &buffer load_driver_text(drv, buffer, driver_idx, TAG_DRIVER); // cleanup mameinfo and sysinfo double line spacing - if (tag == TAG_MAME || type == UI_SYSINFO_LOAD) + if ((tag == TAG_MAME && type != UI_GINIT_LOAD) || type == UI_SYSINFO_LOAD) strreplace(buffer, "\n\n", "\n"); parseclose(); @@ -354,6 +380,7 @@ int datfile_manager::index_mame_mess_info(dataindex &index, drvindex &index_drv, size_t foundtag; size_t t_mame = TAG_MAMEINFO_R.size(); size_t t_mess = TAG_MESSINFO_R.size(); + size_t t_ginit = TAG_GAMEINIT_R.size(); size_t t_info = TAG_INFO.size(); char rbuf[64 * 1024]; @@ -371,6 +398,11 @@ int datfile_manager::index_mame_mess_info(dataindex &index, drvindex &index_drv, size_t found = readbuf.find(" ", foundtag + t_mess + 1); m_mess_rev = readbuf.substr(foundtag + t_mess + 1, found - t_mess - foundtag); } + else if (m_ginit_rev.empty() && readbuf.compare(0, t_ginit, TAG_GAMEINIT_R) == 0) + { + size_t found = readbuf.find(" ", t_ginit + 1); + m_ginit_rev = readbuf.substr(t_ginit + 1, found - t_ginit); + } else if (readbuf.compare(0, t_info, TAG_INFO) == 0) { // TAG_INFO @@ -423,8 +455,6 @@ int datfile_manager::index_datafile(dataindex &index, int &swcount) } else if (m_story_rev.empty() && readbuf.compare(0, t_story, TAG_STORY_R) == 0) m_story_rev = readbuf.substr(t_story + 1); - - // TAG_INFO identifies the driver else if (readbuf.compare(0, t_info, TAG_INFO) == 0) { int curpoint = t_info + 1; diff --git a/src/emu/ui/datfile.h b/src/emu/ui/datfile.h index fa5f527a635..27bb8094704 100644 --- a/src/emu/ui/datfile.h +++ b/src/emu/ui/datfile.h @@ -37,6 +37,7 @@ public: std::string rev_messinfo() const { return m_mess_rev; } std::string rev_sysinfo() const { return m_sysinfo_rev; } std::string rev_storyinfo() const { return m_story_rev; } + std::string rev_ginitinfo() const { return m_ginit_rev; } bool has_history(const game_driver *driver) { return (m_histidx.find(driver) != m_histidx.end()); } bool has_mameinfo(const game_driver *driver) { return (m_mameidx.find(driver) != m_mameidx.end()); } @@ -44,12 +45,13 @@ public: bool has_command(const game_driver *driver) { return (m_cmdidx.find(driver) != m_cmdidx.end()); } bool has_sysinfo(const game_driver *driver) { return (m_sysidx.find(driver) != m_sysidx.end()); } bool has_story(const game_driver *driver) { return (m_storyidx.find(driver) != m_storyidx.end()); } + bool has_gameinit(const game_driver *driver) { return (m_ginitidx.find(driver) != m_ginitidx.end()); } bool has_software(std::string &softlist, std::string &softname, std::string &parentname); bool has_data(const game_driver *a = nullptr) { const game_driver *d = (a != nullptr) ? a : &machine().system(); - return (has_history(d) || has_mameinfo(d) || has_messinfo(d) || has_command(d) || has_sysinfo(d) || has_story(d)); + return (has_history(d) || has_mameinfo(d) || has_messinfo(d) || has_command(d) || has_sysinfo(d) || has_story(d) || has_gameinit(d)); } private: using drvindex = std::unordered_map<std::string, long>; @@ -57,7 +59,7 @@ private: using swindex = std::unordered_map<std::string, drvindex>; // global index - static dataindex m_histidx, m_mameidx, m_messidx, m_cmdidx, m_sysidx, m_storyidx; + static dataindex m_histidx, m_mameidx, m_messidx, m_cmdidx, m_sysidx, m_storyidx, m_ginitidx; static drvindex m_drvidx, m_messdrvidx, m_menuidx; static swindex m_swindex; @@ -68,6 +70,7 @@ private: void init_command(); void init_sysinfo(); void init_storyinfo(); + void init_gameinit(); // file open/close/seek bool parseopen(const char *filename); @@ -84,7 +87,7 @@ private: // internal state running_machine &m_machine; // reference to our machine std::string m_fullpath; - static std::string m_history_rev, m_mame_rev, m_mess_rev, m_sysinfo_rev, m_story_rev; + static std::string m_history_rev, m_mame_rev, m_mess_rev, m_sysinfo_rev, m_story_rev, m_ginit_rev; FILE *fp = nullptr; static bool first_run; }; diff --git a/src/emu/ui/datmenu.cpp b/src/emu/ui/datmenu.cpp index c623c8d1f2c..3a39ecf3254 100644 --- a/src/emu/ui/datmenu.cpp +++ b/src/emu/ui/datmenu.cpp @@ -290,6 +290,8 @@ void ui_menu_dats_view::init_items() m_items_list.emplace_back(_("Sysinfo"), UI_SYSINFO_LOAD, datfile.rev_sysinfo()); if (datfile.has_story(m_driver)) m_items_list.emplace_back(_("Mamescore"), UI_STORY_LOAD, datfile.rev_storyinfo()); + if (datfile.has_gameinit(m_driver)) + m_items_list.emplace_back(_("Gameinit"), UI_GINIT_LOAD, datfile.rev_ginitinfo()); if (datfile.has_command(m_driver)) m_items_list.emplace_back(_("Command"), UI_COMMAND_LOAD, ""); } diff --git a/src/emu/ui/filesel.cpp b/src/emu/ui/filesel.cpp index 7a8cd32ec94..58b3d338ffe 100644 --- a/src/emu/ui/filesel.cpp +++ b/src/emu/ui/filesel.cpp @@ -19,6 +19,8 @@ #include "ui/filesel.h" #include "imagedev/floppy.h" +#include <cstring> + /*************************************************************************** CONSTANTS @@ -224,6 +226,8 @@ ui_menu_file_create::ui_menu_file_create(running_machine &machine, render_contai m_image = image; m_ok = ok; *m_ok = true; + auto const sep = current_file.rfind(PATH_SEPARATOR); + std::strncpy(m_filename_buffer, current_file.c_str() + ((std::string::npos == sep) ? 0 : (sep + 1)), sizeof(m_filename_buffer)); } @@ -307,7 +311,7 @@ void ui_menu_file_create::handle() std::string tmp_file(m_filename_buffer); if (tmp_file.find(".") != -1 && tmp_file.find(".") < tmp_file.length() - 1) { - m_current_file.append(m_filename_buffer); + m_current_file = m_filename_buffer; ui_menu::stack_pop(machine()); } else diff --git a/src/emu/ui/menu.cpp b/src/emu/ui/menu.cpp index 5adb32543dd..00a9013f544 100644 --- a/src/emu/ui/menu.cpp +++ b/src/emu/ui/menu.cpp @@ -2137,8 +2137,7 @@ float ui_menu::draw_right_box_title(float x1, float y1, float x2, float y2) mui.draw_textured_box(container, x1 + UI_LINE_WIDTH, y1 + UI_LINE_WIDTH, x1 + midl - UI_LINE_WIDTH, y1 + line_height, bgcolor, rgb_t(255, 43, 43, 43), hilight_main_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE)); } - - if (bgcolor == UI_MOUSEOVER_BG_COLOR) + else if (bgcolor == UI_MOUSEOVER_BG_COLOR) container->add_rect(x1 + UI_LINE_WIDTH, y1 + UI_LINE_WIDTH, x1 + midl - UI_LINE_WIDTH, y1 + line_height, bgcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE)); @@ -2159,13 +2158,13 @@ std::string ui_menu::arts_render_common(float origx1, float origy1, float origx2 ui_manager &mui = machine().ui(); float line_height = mui.get_line_height(); std::string snaptext, searchstr; - get_title_search(snaptext, searchstr); - float gutter_width = 0.4f * line_height * machine().render().ui_aspect() * 1.3f; - - // apply title to right panel float title_size = 0.0f; float txt_lenght = 0.0f; + float gutter_width = 0.4f * line_height * machine().render().ui_aspect() * 1.3f; + get_title_search(snaptext, searchstr); + + // apply title to right panel for (int x = FIRST_VIEW; x < LAST_VIEW; x++) { mui.draw_text_full(container, _(arts_info[x].title), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, @@ -2174,14 +2173,8 @@ std::string ui_menu::arts_render_common(float origx1, float origy1, float origx2 title_size = MAX(txt_lenght, title_size); } - rgb_t fgcolor = UI_TEXT_COLOR; - rgb_t bgcolor = UI_TEXT_BG_COLOR; - if (m_focus == focused_menu::rightbottom) - { - fgcolor = rgb_t(0xff, 0xff, 0xff, 0x00); - bgcolor = rgb_t(0xff, 0xff, 0xff, 0xff); - } - + rgb_t fgcolor = (m_focus == focused_menu::rightbottom) ? rgb_t(0xff, 0xff, 0xff, 0x00) : UI_TEXT_COLOR; + rgb_t bgcolor = (m_focus == focused_menu::rightbottom) ? rgb_t(0xff, 0xff, 0xff, 0xff) : UI_TEXT_BG_COLOR; float middle = origx2 - origx1; // check size @@ -2233,11 +2226,15 @@ void ui_menu::draw_toolbar(float x1, float y1, float x2, float y2, bool software int m_valid = 0; for (int x = 0; x < UI_TOOLBAR_BUTTONS; ++x) + { if (t_bitmap[x]->valid()) + { m_valid++; + } + } float space_x = (y2 - y1) * container->manager().ui_aspect(); - float total = (m_valid * space_x) + ((m_valid - 1) * 0.01f); + float total = (m_valid * space_x) + ((m_valid - 1) * 0.001f); x1 = ((x2 - x1) * 0.5f) - (total / 2); x2 = x1 + space_x; @@ -2255,7 +2252,7 @@ void ui_menu::draw_toolbar(float x1, float y1, float x2, float y2, bool software } container->add_quad(x1, y1, x2, y2, color, t_texture[z], PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); - x1 += space_x + ((z < UI_TOOLBAR_BUTTONS - 1) ? 0.01f : 0.0f); + x1 += space_x + ((z < UI_TOOLBAR_BUTTONS - 1) ? 0.001f : 0.0f); x2 = x1 + space_x; } } @@ -2288,13 +2285,11 @@ void ui_menu::arts_render_images(bitmap_argb32 *tmp_bitmap, float origx1, float int screen_width = machine().render().ui_target().width(); int screen_height = machine().render().ui_target().height(); - int rot = machine().render().ui_target().orientation(); - if (rot == ROT90 || rot == ROT270) + if (machine().render().ui_target().orientation() & ORIENTATION_SWAP_XY) std::swap(screen_height, screen_width); int panel_width_pixel = panel_width * screen_width; int panel_height_pixel = panel_height * screen_height; - float ratio = 0.0f; // Calculate resize ratios for resizing float ratioW = (float)panel_width_pixel / tmp_bitmap->width(); @@ -2309,7 +2304,7 @@ void ui_menu::arts_render_images(bitmap_argb32 *tmp_bitmap, float origx1, float // smaller ratio will ensure that the image fits in the view dest_yPixel = tmp_bitmap->width() * 0.75f; ratioH = (float)panel_height_pixel / dest_yPixel; - ratio = MIN(ratioW, ratioH); + float ratio = MIN(ratioW, ratioH); dest_xPixel = tmp_bitmap->width() * ratio; dest_yPixel *= ratio; } @@ -2317,7 +2312,7 @@ void ui_menu::arts_render_images(bitmap_argb32 *tmp_bitmap, float origx1, float else if (ratioW < 1 || ratioH < 1 || (machine().ui().options().enlarge_snaps() && !no_available)) { // smaller ratio will ensure that the image fits in the view - ratio = MIN(ratioW, ratioH); + float ratio = MIN(ratioW, ratioH); dest_xPixel = tmp_bitmap->width() * ratio; dest_yPixel = tmp_bitmap->height() * ratio; } @@ -2455,8 +2450,7 @@ void ui_menu::draw_icon(int linenum, void *selectedref, float x0, float y0) int screen_width = machine().render().ui_target().width(); int screen_height = machine().render().ui_target().height(); - int rot = machine().render().ui_target().orientation(); - if (rot == ROT90 || rot == ROT270) + if (machine().render().ui_target().orientation() & ORIENTATION_SWAP_XY) std::swap(screen_height, screen_width); int panel_width_pixel = panel_width * screen_width; @@ -2500,12 +2494,9 @@ void ui_menu::draw_icon(int linenum, void *selectedref, float x0, float y0) icons_texture[linenum]->set_bitmap(*icons_bitmap[linenum], icons_bitmap[linenum]->cliprect(), TEXFORMAT_ARGB32); } - else { - if (icons_bitmap[linenum] != nullptr) - { - icons_bitmap[linenum]->reset(); - } - } + else if (icons_bitmap[linenum] != nullptr) + icons_bitmap[linenum]->reset(); + auto_free(machine(), tmp); } diff --git a/src/emu/ui/selgame.cpp b/src/emu/ui/selgame.cpp index d7b6c5ad961..349c59a605c 100644 --- a/src/emu/ui/selgame.cpp +++ b/src/emu/ui/selgame.cpp @@ -40,7 +40,8 @@ static const char *dats_info[] = { __("Mameinfo"), __("Sysinfo"), __("Messinfo"), - __("Command"), + __("Command"), + __("Gameinit"), __("Mamescore") }; std::vector<const game_driver *> ui_menu_select_game::m_sortedlist; @@ -582,9 +583,9 @@ void ui_menu_select_game::populate() { UINT32 flags_ui = MENU_FLAG_UI | MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW; item_append(_("Configure Options"), nullptr, flags_ui, (void *)(FPTR)CONF_OPTS); - item_append(_("Configure Machine"), nullptr, flags_ui, (void *)(FPTR)CONF_MACHINE); +// item_append(_("Configure Machine"), nullptr, flags_ui, (void *)(FPTR)CONF_MACHINE); TODO item_append(_("Plugins"), nullptr, flags_ui, (void *)(FPTR)CONF_PLUGINS); - skip_main_items = 3; + skip_main_items = 2; } else skip_main_items = 0; @@ -1004,14 +1005,14 @@ void ui_menu_select_game::inkey_select(const ui_menu_event *m_event) // special case for configure options if ((FPTR)driver == CONF_OPTS) ui_menu::stack_push(global_alloc_clear<ui_menu_game_options>(machine(), container)); - // special case for configure machine + /* special case for configure machine TODO else if ((FPTR)driver == CONF_MACHINE) { if (m_prev_selected != nullptr) ui_menu::stack_push(global_alloc_clear<ui_menu_machine_configure>(machine(), container, (const game_driver *)m_prev_selected)); else return; - } + } */ // special case for configure plugins else if ((FPTR)driver == CONF_PLUGINS) { @@ -1074,7 +1075,7 @@ void ui_menu_select_game::inkey_select_favorite(const ui_menu_event *m_event) // special case for configure options if ((FPTR)ui_swinfo == CONF_OPTS) ui_menu::stack_push(global_alloc_clear<ui_menu_game_options>(machine(), container)); - // special case for configure machine + /* special case for configure machine TODO else if ((FPTR)ui_swinfo == CONF_MACHINE) { if (m_prev_selected != nullptr) @@ -1085,7 +1086,7 @@ void ui_menu_select_game::inkey_select_favorite(const ui_menu_event *m_event) } else return; - } + } */ // special case for configure plugins else if ((FPTR)ui_swinfo == CONF_PLUGINS) { diff --git a/src/emu/ui/selgame.h b/src/emu/ui/selgame.h index dd302ebf8bc..b0eff04a609 100644 --- a/src/emu/ui/selgame.h +++ b/src/emu/ui/selgame.h @@ -40,7 +40,7 @@ private: enum { CONF_OPTS = 1, - CONF_MACHINE, +// CONF_MACHINE, CONF_PLUGINS, }; diff --git a/src/emu/ui/utils.h b/src/emu/ui/utils.h index d6087131285..a8737fb2e6b 100644 --- a/src/emu/ui/utils.h +++ b/src/emu/ui/utils.h @@ -95,6 +95,7 @@ enum UI_SYSINFO_LOAD, UI_MESSINFO_LOAD, UI_COMMAND_LOAD, + UI_GINIT_LOAD, UI_STORY_LOAD, UI_LAST_LOAD = UI_STORY_LOAD }; diff --git a/src/emu/video/vector.cpp b/src/emu/video/vector.cpp index 36c303eda42..e6db787d12c 100644 --- a/src/emu/video/vector.cpp +++ b/src/emu/video/vector.cpp @@ -332,32 +332,45 @@ UINT32 vector_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, } else { - float beam_intensity_width = m_beam_width_min; - float intensity = (float)curpoint->intensity / 255.0f; + float intensity_weight = normalized_sigmoid(intensity, m_beam_intensity_weight); - // check for dynamic intensity - if (m_min_intensity != m_max_intensity) - { - float intensity_weight = normalized_sigmoid(intensity, m_beam_intensity_weight); - beam_intensity_width = (m_beam_width_max - m_beam_width_min) * intensity_weight + m_beam_width_min; - } + // check for static intensity + float beam_width = m_min_intensity == m_max_intensity + ? m_beam_width_min + : m_beam_width_min + intensity_weight * (m_beam_width_max - m_beam_width_min); - float beam_width = beam_intensity_width * (1.0f / (float)VECTOR_WIDTH_DENOM); + // normalize width + beam_width *= 1.0f / (float)VECTOR_WIDTH_DENOM; coords.x0 = ((float)lastx - xoffs) * xscale; coords.y0 = ((float)lasty - yoffs) * yscale; coords.x1 = ((float)curpoint->x - xoffs) * xscale; coords.y1 = ((float)curpoint->y - yoffs) * yscale; - // extend zero-length vector line (vector point) by quarter beam_width on both sides - if (fabs(coords.x0 - coords.x1) < FLT_EPSILON && - fabs(coords.y0 - coords.y1) < FLT_EPSILON) + float xdistance = coords.x0 - coords.x1; + float ydistance = coords.y0 - coords.y1; + + // extend zero-length vector line (vector point) by 3/8 beam_width on both sides + if (fabs(xdistance) < FLT_EPSILON && + fabs(ydistance) < FLT_EPSILON) + { + coords.x0 += xratio * beam_width * 0.375f; + coords.y0 += yratio * beam_width * 0.375f; + coords.x1 -= xratio * beam_width * 0.375f; + coords.y1 -= yratio * beam_width * 0.375f; + } + // extend vector line by 3/8 beam_width on both sides + else { - coords.x0 += xratio * beam_width * 0.25f; - coords.y0 += yratio * beam_width * 0.25f; - coords.x1 -= xratio * beam_width * 0.25f; - coords.y1 -= yratio * beam_width * 0.25f; + float length = sqrt(xdistance * xdistance + ydistance * ydistance); + float xdirection = xdistance / length; + float ydirection = ydistance / length; + + coords.x0 += xratio * beam_width * 0.375f * (xdirection / xratio); + coords.y0 += yratio * beam_width * 0.375f * (ydirection / yratio); + coords.x1 -= xratio * beam_width * 0.375f * (xdirection / xratio); + coords.y1 -= yratio * beam_width * 0.375f * (ydirection / yratio); } if (curpoint->intensity != 0 && !render_clip_line(&coords, &clip)) diff --git a/src/lib/netlist/macro/nlm_ttl74xx.cpp b/src/lib/netlist/macro/nlm_ttl74xx.cpp index de42f26d730..49fea3c55c8 100644 --- a/src/lib/netlist/macro/nlm_ttl74xx.cpp +++ b/src/lib/netlist/macro/nlm_ttl74xx.cpp @@ -84,7 +84,7 @@ NETLIST_START(TTL74XX_lib) TT_FAMILY("74XX") TRUTHTABLE_END() - TRUTHTABLE_START(TTL_7400_NAND, 2, 1, 0, "+A,B") + TRUTHTABLE_START(TTL_7400_NAND, 2, 1, 0, "A,B") TT_HEAD("A,B|Q ") TT_LINE("0,X|1|22") TT_LINE("X,0|1|22") diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp index 6ea052b4132..9ebb1378e5b 100644 --- a/src/lib/netlist/nl_base.cpp +++ b/src/lib/netlist/nl_base.cpp @@ -840,10 +840,10 @@ ATTR_COLD void core_terminal_t::set_net(net_t &anet) ATTR_COLD terminal_t::terminal_t() : analog_t(TERMINAL) +, m_otherterm(NULL) , m_Idr1(NULL) , m_go1(NULL) , m_gt1(NULL) -, m_otherterm(NULL) { } diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index 24f2cde585a..e4374b75ad3 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -551,10 +551,6 @@ namespace netlist ATTR_COLD terminal_t(); - nl_double *m_Idr1; // drive current - nl_double *m_go1; // conductance for Voltage from other term - nl_double *m_gt1; // conductance for total conductance - terminal_t *m_otherterm; ATTR_HOT void set(const nl_double G) @@ -581,19 +577,31 @@ namespace netlist ATTR_HOT void schedule_solve(); ATTR_HOT void schedule_after(const netlist_time &after); + void set_ptrs(nl_double *gt, nl_double *go, nl_double *Idr) + { + m_gt1 = gt; + m_go1 = go; + m_Idr1 = Idr; + } + protected: virtual void save_register() override; virtual void reset() override; private: - ATTR_HOT void set_ptr(nl_double *ptr, const nl_double val) + ATTR_HOT void set_ptr(nl_double *ptr, const nl_double val) { if (ptr != NULL && *ptr != val) { *ptr = val; } } - }; + + nl_double *m_Idr1; // drive current + nl_double *m_go1; // conductance for Voltage from other term + nl_double *m_gt1; // conductance for total conductance + +}; // ----------------------------------------------------------------------------- diff --git a/src/lib/netlist/solver/nld_ms_direct.h b/src/lib/netlist/solver/nld_ms_direct.h index bdcec31ad44..ab67795507f 100644 --- a/src/lib/netlist/solver/nld_ms_direct.h +++ b/src/lib/netlist/solver/nld_ms_direct.h @@ -13,6 +13,13 @@ #include "solver/nld_solver.h" #include "solver/vector_base.h" +/* Disabling dynamic allocation gives a ~10% boost in performance + * This flag has been added to support continuous storage for arrays + * going forward in case we implement cuda solvers in the future. + */ +#define NL_USE_DYNAMIC_ALLOCATION (0) + + NETLIB_NAMESPACE_DEVICES_START() //#define nl_ext_double __float128 // slow, very slow @@ -43,7 +50,7 @@ protected: ATTR_HOT int solve_non_dynamic(const bool newton_raphson); ATTR_HOT void build_LE_A(); - ATTR_HOT void build_LE_RHS(nl_double * RESTRICT rhs); + ATTR_HOT void build_LE_RHS(); ATTR_HOT void LE_solve(); ATTR_HOT void LE_back_subst(nl_double * RESTRICT x); @@ -60,10 +67,19 @@ protected: */ ATTR_HOT nl_double compute_next_timestep(); + +#if (NL_USE_DYNAMIC_ALLOCATION) template <typename T1, typename T2> - inline nl_ext_double &A(const T1 r, const T2 c) { return m_A[r][c]; } + inline nl_ext_double &A(const T1 &r, const T2 &c) { return m_A[r * m_pitch + c]; } + template <typename T1> + inline nl_ext_double &RHS(const T1 &r) { return m_A[r * m_pitch + N()]; } +#else + template <typename T1, typename T2> + inline nl_ext_double &A(const T1 &r, const T2 &c) { return m_A[r][c]; } + template <typename T1> + inline nl_ext_double &RHS(const T1 &r) { return m_A[r][N()]; } - ATTR_ALIGN nl_double m_RHS[_storage_N]; +#endif ATTR_ALIGN nl_double m_last_RHS[_storage_N]; // right hand side - contains currents ATTR_ALIGN nl_double m_last_V[_storage_N]; @@ -71,7 +87,13 @@ protected: terms_t *m_rails_temp; private: - ATTR_ALIGN nl_ext_double m_A[_storage_N][((_storage_N + 7) / 8) * 8]; + static const unsigned m_pitch = (((_storage_N + 1) + 7) / 8) * 8; +#if (NL_USE_DYNAMIC_ALLOCATION) + ATTR_ALIGN nl_ext_double * RESTRICT m_A; +#else + ATTR_ALIGN nl_ext_double m_A[_storage_N][m_pitch]; +#endif + //ATTR_ALIGN nl_ext_double m_RHSx[_storage_N]; const unsigned m_dim; }; @@ -89,6 +111,9 @@ matrix_solver_direct_t<m_N, _storage_N>::~matrix_solver_direct_t() } pfree_array(m_terms); pfree_array(m_rails_temp); +#if (NL_USE_DYNAMIC_ALLOCATION) + pfree_array(m_A); +#endif } template <unsigned m_N, unsigned _storage_N> @@ -304,7 +329,6 @@ ATTR_COLD void matrix_solver_direct_t<m_N, _storage_N>::vsetup(analog_net_t::lis /* * save states */ - save(NLNAME(m_RHS)); save(NLNAME(m_last_RHS)); save(NLNAME(m_last_V)); @@ -312,6 +336,8 @@ ATTR_COLD void matrix_solver_direct_t<m_N, _storage_N>::vsetup(analog_net_t::lis { pstring num = pfmt("{1}")(k); + save(RHS(k), "RHS" + num); + save(m_terms[k]->go(),"GO" + num, m_terms[k]->count()); save(m_terms[k]->gt(),"GT" + num, m_terms[k]->count()); save(m_terms[k]->Idr(),"IDR" + num , m_terms[k]->count()); @@ -350,7 +376,7 @@ ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::build_LE_A() } template <unsigned m_N, unsigned _storage_N> -ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::build_LE_RHS(nl_double * RESTRICT rhs) +ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::build_LE_RHS() { const unsigned iN = N(); for (unsigned k = 0; k < iN; k++) @@ -370,7 +396,7 @@ ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::build_LE_RHS(nl_double * //rhsk = rhsk + go[i] * terms[i]->m_otherterm->net().as_analog().Q_Analog(); rhsk_b = rhsk_b + go[i] * *other_cur_analog[i]; - rhs[k] = rhsk_a + rhsk_b; + RHS(k) = rhsk_a + rhsk_b; } } @@ -398,7 +424,7 @@ ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::LE_solve() for (unsigned k = 0; k < kN; k++) { std::swap(A(i,k), A(maxrow,k)); } - std::swap(m_RHS[i], m_RHS[maxrow]); + std::swap(RHS(i), RHS(maxrow)); } /* FIXME: Singular matrix? */ const nl_double f = 1.0 / A(i,i); @@ -410,14 +436,18 @@ ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::LE_solve() const nl_double f1 = - A(j,i) * f; if (f1 != NL_FCONST(0.0)) { - nl_double * RESTRICT pi = &m_A[i][i+1]; - nl_double * RESTRICT pj = &m_A[j][i+1]; + nl_double * RESTRICT pi = &A(i,i+1); + nl_double * RESTRICT pj = &A(j,i+1); +#if 1 + vec_add_mult_scalar(kN-i,pj,f1,pi); +#else vec_add_mult_scalar(kN-i-1,pj,f1,pi); //for (unsigned k = i+1; k < kN; k++) // pj[k] = pj[k] + pi[k] * f1; //for (unsigned k = i+1; k < kN; k++) //A(j,k) += A(i,k) * f1; - m_RHS[j] += m_RHS[i] * f1; + RHS(j) += RHS(i) * f1; +#endif } } } @@ -444,7 +474,7 @@ ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::LE_solve() for (unsigned k = 0; k < e; k++) A(j,p[k]) += A(i,p[k]) * f1; #endif - m_RHS[j] += m_RHS[i] * f1; + RHS(j) += RHS(i) * f1; } } } @@ -464,7 +494,7 @@ ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::LE_back_subst( nl_double tmp = 0; for (unsigned k = j+1; k < kN; k++) tmp += A(j,k) * x[k]; - x[j] = (m_RHS[j] - tmp) / A(j,j); + x[j] = (RHS(j) - tmp) / A(j,j); } } else @@ -481,7 +511,7 @@ ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::LE_back_subst( const unsigned pk = p[k]; tmp += A(j,pk) * x[pk]; } - x[j] = (m_RHS[j] - tmp) / A(j,j); + x[j] = (RHS(j) - tmp) / A(j,j); } } } @@ -505,7 +535,7 @@ ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::LE_back_subst_full( //ip=indx[i]; USE_PIVOT_SEARCH //sum=b[ip]; //b[ip]=b[i]; - double sum=m_RHS[i];//x[i]; + double sum=RHS(i);//x[i]; for (int j=0; j < i; j++) sum -= A(i,j) * x[j]; x[i]=sum; @@ -580,10 +610,10 @@ template <unsigned m_N, unsigned _storage_N> ATTR_HOT inline int matrix_solver_direct_t<m_N, _storage_N>::vsolve_non_dynamic(const bool newton_raphson) { this->build_LE_A(); - this->build_LE_RHS(m_last_RHS); + this->build_LE_RHS(); for (unsigned i=0, iN=N(); i < iN; i++) - m_RHS[i] = m_last_RHS[i]; + m_last_RHS[i] = RHS(i); this->LE_solve(); @@ -599,7 +629,9 @@ matrix_solver_direct_t<m_N, _storage_N>::matrix_solver_direct_t(const solver_par { m_terms = palloc_array(terms_t *, N()); m_rails_temp = palloc_array(terms_t, N()); - +#if (NL_USE_DYNAMIC_ALLOCATION) + m_A = palloc_array(nl_ext_double, N() * m_pitch); +#endif for (unsigned k = 0; k < N(); k++) { m_terms[k] = palloc(terms_t); @@ -615,7 +647,9 @@ matrix_solver_direct_t<m_N, _storage_N>::matrix_solver_direct_t(const eSolverTyp { m_terms = palloc_array(terms_t *, N()); m_rails_temp = palloc_array(terms_t, N()); - +#if (NL_USE_DYNAMIC_ALLOCATION) + m_A = palloc_array(nl_ext_double, N() * m_pitch); +#endif for (unsigned k = 0; k < N(); k++) { m_terms[k] = palloc(terms_t); diff --git a/src/lib/netlist/solver/nld_ms_direct1.h b/src/lib/netlist/solver/nld_ms_direct1.h index fe5a439a9db..81e8c329edf 100644 --- a/src/lib/netlist/solver/nld_ms_direct1.h +++ b/src/lib/netlist/solver/nld_ms_direct1.h @@ -40,10 +40,10 @@ ATTR_HOT inline int matrix_solver_direct1_t::vsolve_non_dynamic(ATTR_UNUSED cons { analog_net_t *net = m_nets[0]; this->build_LE_A(); - this->build_LE_RHS(m_RHS); + this->build_LE_RHS(); //NL_VERBOSE_OUT(("{1} {2}\n", new_val, m_RHS[0] / m_A[0][0]); - nl_double new_val = m_RHS[0] / A(0,0); + nl_double new_val = RHS(0) / A(0,0); nl_double e = (new_val - net->Q_Analog()); nl_double cerr = nl_math::abs(e); diff --git a/src/lib/netlist/solver/nld_ms_direct2.h b/src/lib/netlist/solver/nld_ms_direct2.h index 06f00302d3c..4a6d768fe06 100644 --- a/src/lib/netlist/solver/nld_ms_direct2.h +++ b/src/lib/netlist/solver/nld_ms_direct2.h @@ -39,7 +39,7 @@ ATTR_HOT nl_double matrix_solver_direct2_t::vsolve() ATTR_HOT inline int matrix_solver_direct2_t::vsolve_non_dynamic(ATTR_UNUSED const bool newton_raphson) { build_LE_A(); - build_LE_RHS(m_RHS); + build_LE_RHS(); const nl_double a = A(0,0); const nl_double b = A(0,1); @@ -47,8 +47,8 @@ ATTR_HOT inline int matrix_solver_direct2_t::vsolve_non_dynamic(ATTR_UNUSED cons const nl_double d = A(1,1); nl_double new_val[2]; - new_val[1] = (a * m_RHS[1] - c * m_RHS[0]) / (a * d - b * c); - new_val[0] = (m_RHS[0] - b * new_val[1]) / a; + new_val[1] = (a * RHS(1) - c * RHS(0)) / (a * d - b * c); + new_val[0] = (RHS(0) - b * new_val[1]) / a; if (is_dynamic()) { diff --git a/src/lib/netlist/solver/nld_ms_sor_mat.h b/src/lib/netlist/solver/nld_ms_sor_mat.h index 4312c3039be..34c40c34d79 100644 --- a/src/lib/netlist/solver/nld_ms_sor_mat.h +++ b/src/lib/netlist/solver/nld_ms_sor_mat.h @@ -129,7 +129,7 @@ ATTR_HOT inline int matrix_solver_SOR_mat_t<m_N, _storage_N>::vsolve_non_dynamic int resched_cnt = 0; this->build_LE_A(); - this->build_LE_RHS(this->m_RHS); + this->build_LE_RHS(); #if 0 static int ws_cnt = 0; @@ -184,7 +184,7 @@ ATTR_HOT inline int matrix_solver_SOR_mat_t<m_N, _storage_N>::vsolve_non_dynamic for (unsigned i = 0; i < e; i++) Idrive = Idrive + this->A(k,p[i]) * new_v[p[i]]; - const nl_double delta = m_omega * (this->m_RHS[k] - Idrive) / this->A(k,k); + const nl_double delta = m_omega * (this->RHS(k) - Idrive) / this->A(k,k); cerr = std::max(cerr, nl_math::abs(delta)); new_v[k] += delta; } diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp index 3c8b0f4a663..701e418d4ef 100644 --- a/src/lib/netlist/solver/nld_solver.cpp +++ b/src/lib/netlist/solver/nld_solver.cpp @@ -79,9 +79,7 @@ ATTR_COLD void terms_t::set_pointers() { for (unsigned i = 0; i < count(); i++) { - m_term[i]->m_gt1 = &m_gt[i]; - m_term[i]->m_go1 = &m_go[i]; - m_term[i]->m_Idr1 = &m_Idr[i]; + m_term[i]->set_ptrs(&m_gt[i], &m_go[i], &m_Idr[i]); m_other_curanalog[i] = &m_term[i]->m_otherterm->net().m_cur_Analog; } } diff --git a/src/mame/audio/irem.cpp b/src/mame/audio/irem.cpp index 0020c880c30..0d16b99e066 100644 --- a/src/mame/audio/irem.cpp +++ b/src/mame/audio/irem.cpp @@ -419,9 +419,9 @@ NETLIST_START(kidniki_interface) PARAM(Solver.NR_LOOPS, 300) PARAM(Solver.GS_LOOPS, 1) PARAM(Solver.GS_THRESHOLD, 6) - //PARAM(Solver.ITERATIVE, "SOR") + PARAM(Solver.ITERATIVE, "SOR") //PARAM(Solver.ITERATIVE, "MAT") - PARAM(Solver.ITERATIVE, "GMRES") + //PARAM(Solver.ITERATIVE, "GMRES") PARAM(Solver.PARALLEL, 1) PARAM(Solver.SOR_FACTOR, 1.00) #else diff --git a/src/mame/drivers/ampoker2.cpp b/src/mame/drivers/ampoker2.cpp index 16dd4560c80..4297c6517d9 100644 --- a/src/mame/drivers/ampoker2.cpp +++ b/src/mame/drivers/ampoker2.cpp @@ -1141,7 +1141,7 @@ static MACHINE_CONFIG_START( ampoker2, ampoker2_state ) MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/2) /* 3 MHz */ MCFG_CPU_PROGRAM_MAP(ampoker2_map) MCFG_CPU_IO_MAP(ampoker2_io_map) - MCFG_CPU_PERIODIC_INT_DRIVER(ampoker2_state, nmi_line_pulse, 1536) + MCFG_CPU_PERIODIC_INT_DRIVER(ampoker2_state, nmi_line_pulse, 1536) MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(200)) /* 200 ms, measured */ MCFG_NVRAM_ADD_0FILL("nvram") @@ -1163,17 +1163,15 @@ static MACHINE_CONFIG_START( ampoker2, ampoker2_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("aysnd", AY8910,MASTER_CLOCK/4) /* 1.5 MHz, measured */ + MCFG_SOUND_ADD("aysnd", AY8910, MASTER_CLOCK/4) /* 1.5 MHz, measured */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( sigma2k, ampoker2 ) - /* basic machine hardware */ - /* video hardware */ MCFG_GFXDECODE_MODIFY("gfxdecode", sigma2k) - MCFG_VIDEO_START_OVERRIDE(ampoker2_state,sigma2k) + MCFG_VIDEO_START_OVERRIDE(ampoker2_state, sigma2k) MACHINE_CONFIG_END @@ -1371,7 +1369,7 @@ ROM_END * Driver Init * *************************/ -DRIVER_INIT_MEMBER(ampoker2_state,rabbitpk) +DRIVER_INIT_MEMBER(ampoker2_state, rabbitpk) { UINT8 *rom = memregion("maincpu")->base(); int size = memregion("maincpu")->bytes(); @@ -1392,7 +1390,7 @@ DRIVER_INIT_MEMBER(ampoker2_state,rabbitpk) } } -DRIVER_INIT_MEMBER(ampoker2_state,piccolop) +DRIVER_INIT_MEMBER(ampoker2_state, piccolop) { /* The protection is based on a stuck bit at RAM offset $C416. @@ -1440,16 +1438,16 @@ DRIVER_INIT_MEMBER(ampoker2_state,piccolop) *************************/ // YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT -GAMEL( 1990, ampoker2, 0, ampoker2, ampoker2, driver_device, 0, ROT0, "Novomatic", "American Poker II", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) -GAMEL( 1990, ampkr2b1, ampoker2, ampoker2, ampoker2, driver_device, 0, ROT0, "bootleg", "American Poker II (bootleg, set 1)", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) -GAMEL( 1990, ampkr2b2, ampoker2, ampoker2, ampoker2, driver_device, 0, ROT0, "bootleg", "American Poker II (bootleg, set 2)", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) -GAMEL( 1994, ampkr2b3, ampoker2, ampoker2, ampoker2, driver_device, 0, ROT0, "bootleg", "American Poker II (bootleg, set 3)", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) -GAMEL( 1994, ampkr2b4, ampoker2, ampoker2, ampoker2, driver_device, 0, ROT0, "bootleg", "American Poker II (bootleg, set 4)", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) -GAMEL( 1994, ampkr228, ampoker2, ampoker2, ampoker2, driver_device, 0, ROT0, "bootleg?", "American Poker II (iamp2 v28)", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) -GAMEL( 1995, ampkr95, ampoker2, ampoker2, ampkr95, driver_device, 0, ROT0, "bootleg", "American Poker 95", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) -GAMEL( 1990, pkrdewin, ampoker2, ampoker2, ampoker2, driver_device, 0, ROT0, "bootleg", "Poker De Win", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) -GAMEL( 1990, videomat, ampoker2, ampoker2, ampoker2, driver_device, 0, ROT0, "bootleg", "Videomat (Polish bootleg)", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) -GAMEL( 1990, rabbitpk, ampoker2, ampoker2, ampoker2, ampoker2_state, rabbitpk, ROT0, "bootleg", "Rabbit Poker (Arizona Poker v1.1?)", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) -GAMEL( 1995, sigmapkr, 0, ampoker2, sigmapkr, driver_device, 0, ROT0, "Sigma Inc.", "Sigma Poker", MACHINE_SUPPORTS_SAVE, layout_sigmapkr ) -GAMEL( 1998, sigma2k, 0, sigma2k, sigma2k, driver_device, 0, ROT0, "Sigma Inc.", "Sigma Poker 2000", MACHINE_SUPPORTS_SAVE, layout_sigmapkr ) +GAMEL( 1990, ampoker2, 0, ampoker2, ampoker2, driver_device, 0, ROT0, "Novomatic", "American Poker II", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) +GAMEL( 1990, ampkr2b1, ampoker2, ampoker2, ampoker2, driver_device, 0, ROT0, "bootleg", "American Poker II (bootleg, set 1)", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) +GAMEL( 1990, ampkr2b2, ampoker2, ampoker2, ampoker2, driver_device, 0, ROT0, "bootleg", "American Poker II (bootleg, set 2)", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) +GAMEL( 1994, ampkr2b3, ampoker2, ampoker2, ampoker2, driver_device, 0, ROT0, "bootleg", "American Poker II (bootleg, set 3)", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) +GAMEL( 1994, ampkr2b4, ampoker2, ampoker2, ampoker2, driver_device, 0, ROT0, "bootleg", "American Poker II (bootleg, set 4)", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) +GAMEL( 1994, ampkr228, ampoker2, ampoker2, ampoker2, driver_device, 0, ROT0, "bootleg?", "American Poker II (iamp2 v28)", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) +GAMEL( 1995, ampkr95, ampoker2, ampoker2, ampkr95, driver_device, 0, ROT0, "bootleg", "American Poker 95", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) +GAMEL( 1990, pkrdewin, ampoker2, ampoker2, ampoker2, driver_device, 0, ROT0, "bootleg", "Poker De Win", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) +GAMEL( 1990, videomat, ampoker2, ampoker2, ampoker2, driver_device, 0, ROT0, "bootleg", "Videomat (Polish bootleg)", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) +GAMEL( 1990, rabbitpk, ampoker2, ampoker2, ampoker2, ampoker2_state, rabbitpk, ROT0, "bootleg", "Rabbit Poker (Arizona Poker v1.1?)", MACHINE_SUPPORTS_SAVE, layout_ampoker2 ) +GAMEL( 1995, sigmapkr, 0, ampoker2, sigmapkr, driver_device, 0, ROT0, "Sigma Inc.", "Sigma Poker", MACHINE_SUPPORTS_SAVE, layout_sigmapkr ) +GAMEL( 1998, sigma2k, 0, sigma2k, sigma2k, driver_device, 0, ROT0, "Sigma Inc.", "Sigma Poker 2000", MACHINE_SUPPORTS_SAVE, layout_sigmapkr ) GAME( 1990, piccolop, ampoker2, ampoker2, piccolop, ampoker2_state, piccolop, ROT0, "Admiral/Novomatic", "Piccolo Poker 100", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/apple2e.cpp b/src/mame/drivers/apple2e.cpp index 7727c74379f..27b3dd0fc59 100644 --- a/src/mame/drivers/apple2e.cpp +++ b/src/mame/drivers/apple2e.cpp @@ -144,6 +144,7 @@ Address bus A0-A11 is Y0-Y11 #include "bus/a2bus/timemasterho.h" #include "bus/a2bus/mouse.h" #include "bus/a2bus/ezcgi.h" +#include "bus/a2bus/pc_xporter.h" #include "bus/a2bus/a2eauxslot.h" #include "bus/a2bus/a2estd80col.h" #include "bus/a2bus/a2eext80col.h" @@ -3188,6 +3189,7 @@ static SLOT_INTERFACE_START(apple2_cards) SLOT_INTERFACE("ezcgi9938", A2BUS_EZCGI_9938) /* E-Z Color Graphics Interface (TMS9938) */ SLOT_INTERFACE("ezcgi9958", A2BUS_EZCGI_9958) /* E-Z Color Graphics Interface (TMS9958) */ // SLOT_INTERFACE("magicmusician", A2BUS_MAGICMUSICIAN) /* Magic Musician Card */ + SLOT_INTERFACE("pcxport", A2BUS_PCXPORTER) /* Applied Engineering PC Transporter */ SLOT_INTERFACE_END static SLOT_INTERFACE_START(apple2eaux_cards) diff --git a/src/mame/drivers/cocoloco.cpp b/src/mame/drivers/cocoloco.cpp index 72b9a2d6060..d69564cc9d3 100644 --- a/src/mame/drivers/cocoloco.cpp +++ b/src/mame/drivers/cocoloco.cpp @@ -161,13 +161,15 @@ The third set is resetting after drawing the maze, and when start a game. - The attract one: + Attract reset: - bp D28E (this is after all the jsr tables that draw the maze) - $D296: jsr $E0CD... - $E189 (jsr $6337) ; $6337 ---> Goes nowhere. Hit the 00's (BRK) and reset. + bp d28e (this is after all the jsr tables that draw the maze) + $d296: jsr $e0cd... + $e189 (jsr $6337) ; $6337 ---> Goes nowhere. Hit the 00's (BRK) and reset. - Maybe should be jsr $E337 (MSB active)? There, there is a subroutina that has sense. + Start reset: + + $e0e9: 4c ee 60 ; jmp $60ee <--- nothing here. *************************************************************************************** @@ -220,6 +222,8 @@ public: DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); + DECLARE_DRIVER_INIT(cocob); + virtual void video_start() override; DECLARE_PALETTE_INIT(cocoloco); @@ -582,11 +586,17 @@ ROM_START( cocolocoa ) ROM_LOAD( "tbp28l22.bin", 0x0000, 0x0100, CRC(3bf3ccb0) SHA1(d61d19d38045f42a9adecf295e479fee239bed48) ) // same decode prom from abattle (astrof.cpp) ROM_END +/* This Petaco's 2-player game + seems to soffer of some bitrot. + + The code executes subroutines located out of the ROM space. + Finally jumps to nowhere. +*/ ROM_START( cocolocob ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "b1.bin", 0xd000, 0x0800, CRC(5ead42c4) SHA1(f2b8bf48f80c99c8c109ec67cdd6e1105f7f9702) ) ROM_LOAD( "b-c1.bin", 0xd800, 0x0800, CRC(104db6b3) SHA1(d0a9ce1b920124078f442bdcb226e8da9f96d60a) ) - ROM_LOAD( "c1.bin", 0xe000, 0x0800, CRC(8774b1bc) SHA1(b7c09883c136dedfffd0724b49cc5ff987831850) ) + ROM_LOAD( "c1.bin", 0xe000, 0x0800, BAD_DUMP CRC(8774b1bc) SHA1(b7c09883c136dedfffd0724b49cc5ff987831850) ) ROM_LOAD( "d1.bin", 0xe800, 0x0800, CRC(41b22627) SHA1(241659448074e5101ca7da3feb4a0a38580b12e9) ) ROM_LOAD( "d-e1.bin", 0xf000, 0x0800, CRC(db93f941) SHA1(b827341e408b5dc50acdfd3586f829f7bb2bb915) ) ROM_LOAD( "e1.bin", 0xf800, 0x0800, CRC(4e5705f0) SHA1(271d6c8eff331327dc1a75f7a4b0c64d3e363e3d) ) @@ -597,10 +607,28 @@ ROM_END /*********************************** +* Driver Init * +***********************************/ + +DRIVER_INIT_MEMBER(cocoloco_state, cocob) +{ +// Just for testing... + + UINT8 *rom = memregion("maincpu")->base(); + + rom[0xe18b] = rom[0xe18b] ^ 0x80; // with jsr $e337, the character doesn't turn and eat straight (maze included) + + rom[0xe049] = 0xea; + rom[0xe04a] = 0xea; + rom[0xe04b] = 0xea; +} + + +/*********************************** * Game Drivers * ***********************************/ -/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ -GAME( 198?, cocoloco, 0, cocoloco, cocoloco, driver_device, 0, ROT90, "Petaco S.A.", "Coco Loco (set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 198?, cocolocoa, cocoloco, cocoloco, cocolocoa, driver_device, 0, ROT90, "Recel S.A.", "Coco Loco (set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 198?, cocolocob, cocoloco, cocoloco, cocoloco, driver_device, 0, ROT90, "Petaco S.A.", "Coco Loco (set 3)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ +GAME( 198?, cocoloco, 0, cocoloco, cocoloco, driver_device, 0, ROT90, "Petaco S.A.", "Coco Loco (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 198?, cocolocoa, cocoloco, cocoloco, cocolocoa, driver_device, 0, ROT90, "Recel S.A.", "Coco Loco (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 198?, cocolocob, cocoloco, cocoloco, cocoloco, cocoloco_state, cocob, ROT90, "Petaco S.A.", "Coco Loco (set 3)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/hh_hmcs40.cpp b/src/mame/drivers/hh_hmcs40.cpp index acf581c19b5..783f16be481 100644 --- a/src/mame/drivers/hh_hmcs40.cpp +++ b/src/mame/drivers/hh_hmcs40.cpp @@ -1035,7 +1035,7 @@ INPUT_CHANGED_MEMBER(bzaxxon_state::input_changed) static MACHINE_CONFIG_START( bzaxxon, bzaxxon_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", HD38800, 400000) // approximation + MCFG_CPU_ADD("maincpu", HD38800, 450000) // approximation MCFG_HMCS40_WRITE_R_CB(0, WRITE8(bzaxxon_state, plate_w)) MCFG_HMCS40_WRITE_R_CB(1, WRITE8(bzaxxon_state, plate_w)) MCFG_HMCS40_WRITE_R_CB(2, WRITE8(bzaxxon_state, plate_w)) @@ -4087,7 +4087,7 @@ CONS( 1979, bmboxing, 0, 0, bmboxing, bmboxing, driver_device, 0, "Bambi CONS( 1982, bfriskyt, 0, 0, bfriskyt, bfriskyt, driver_device, 0, "Bandai", "Frisky Tom (Bandai)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK ) CONS( 1981, packmon, 0, 0, packmon, packmon, driver_device, 0, "Bandai", "Packri Monster", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK ) CONS( 1982, msthawk, 0, 0, msthawk, msthawk, driver_device, 0, "Bandai (Mattel license)", "Star Hawk (Mattel)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK ) -CONS( 1982, bzaxxon, 0, 0, bzaxxon, bzaxxon, driver_device, 0, "Bandai", "Zaxxon (Bandai)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK | MACHINE_NOT_WORKING ) +CONS( 1982, bzaxxon, 0, 0, bzaxxon, bzaxxon, driver_device, 0, "Bandai", "Zaxxon (Bandai)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK ) CONS( 1983, zackman, 0, 0, zackman, zackman, driver_device, 0, "Bandai", "Zackman", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK ) 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 ) diff --git a/src/mame/drivers/kurukuru.cpp b/src/mame/drivers/kurukuru.cpp index 33bbf1c4f2d..ce96756b66d 100644 --- a/src/mame/drivers/kurukuru.cpp +++ b/src/mame/drivers/kurukuru.cpp @@ -543,27 +543,27 @@ static INPUT_PORTS_START( kurukuru ) /* bits d0-d3 are JAMMA top side pins 20,21,22,23, bits d4-d7 are JAMMA bottom side pins 20,21,22,23 so that's player 1 left/right/button1/button2 then player 2 left/right/button1/button2 */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("1st (Bote/Botechin)") - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("2nd (Oume)") - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("3rd (Pyoko/Pyokorin)") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("4th (Kunio)") - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("5th (Pyon-Pyon)") - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_N) PORT_NAME("Unknown A0h - bit5") - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M) PORT_NAME("Unknown A0h - bit6") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("1st (Bote/Botechin)") // edge connector pin 20 top + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("2nd (Oume)") // edge connector pin 21 top + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("3rd (Pyoko/Pyokorin)") // edge connector pin 22 top + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("4th (Kunio)") // edge connector pin 23 top + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("5th (Pyon-Pyon)") // edge connector pin 20 bottom + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_N) PORT_NAME("Unknown A0h - bit5") // edge connector pin 21 bottom + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M) PORT_NAME("Unknown A0h - bit6") // edge connector pin 22 bottom + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) // edge connector pin 23 bottom PORT_START("IN1") /* routed to JAMMA top side 15, bottom 15, top 16, bottom 16, top 17, bottom 17, top 24, bottom 24 so that's test, tilt/slam, coin 1, coin 2, p1 start, p2 start, p1 button 3, p2 button 3 */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Medal In") - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9) PORT_NAME("Reset Button") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) PORT_NAME("Unknown B0h - bit4") - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE (2) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper feedback - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // edge connector pin 15 top + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Medal In") // edge connector pin 15 bottom + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9) PORT_NAME("Reset Button") // edge connector pin 16 top + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) // edge connector pin 16 bottom + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) PORT_NAME("Unknown B0h - bit4") // edge connector pin 17 top (active) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE (2) // edge connector pin 17 bottom + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper feedback, edge connector pin 24 top + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // edge connector pin 24 bottom PORT_START("DSW1") // found in the PCB: 11111111 PORT_DIPNAME( 0x07, 0x00, "Coinage A (100 Y)" ) PORT_DIPLOCATION("DSW1:1,2,3") @@ -620,24 +620,30 @@ INPUT_PORTS_END static INPUT_PORTS_START( ppj ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("1st (Boketa)") - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("2nd (Kunio)") - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("3rd (Pyon-Pyon)") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("4th (Pyokorin)") - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("5th (Botechin)") - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S) PORT_NAME("Unknown 70h - bit5") - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D) PORT_NAME("Unknown 70h - bit6") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) +/* bits d0-d3 are JAMMA top side pins 20,21,22,23, bits d4-d7 are JAMMA bottom side pins 20,21,22,23 + so that's player 1 left/right/button1/button2 then player 2 left/right/button1/button2 +*/ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("1st (Boketa)") // edge connector pin 20 top + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("2nd (Kunio)") // edge connector pin 21 top + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("3rd (Pyon-Pyon)") // edge connector pin 22 top + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("4th (Pyokorin)") // edge connector pin 23 top + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("5th (Botechin)") // edge connector pin 20 bottom + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S) PORT_NAME("Unknown 70h - bit5") // edge connector pin 21 bottom (active) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D) PORT_NAME("Unknown 70h - bit6") // edge connector pin 22 bottom (active) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) // edge connector pin 23 bottom PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Medal In") - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9) PORT_NAME("Reset Button") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) PORT_NAME("Unknown 60h - bit4") - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE (2) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper feedback - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) +/* routed to JAMMA top side 15, bottom 15, top 16, bottom 16, top 17, bottom 17, top 24, bottom 24 + so that's test, tilt/slam, coin 1, coin 2, p1 start, p2 start, p1 button 3, p2 button 3 +*/ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // edge connector pin 15 top + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Medal In") // edge connector pin 15 bottom + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9) PORT_NAME("Reset Button") // edge connector pin 16 top + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) // edge connector pin 16 bottom + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) PORT_NAME("Unknown 60h - bit4") // edge connector pin 17 top (active) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE (2) // edge connector pin 17 bottom + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper feedback, edge connector pin 24 top + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // edge connector pin 24 bottom PORT_START("DSW1") // found in the PCB: 00000000 (arranged for sale since they are uncommon settings) PORT_DIPNAME( 0x07, 0x03, "Coinage A (100 Y)" ) PORT_DIPLOCATION("DSW1:1,2,3") @@ -768,7 +774,7 @@ static MACHINE_CONFIG_START( ppj, kurukuru_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("ym2149", YM2149, YM2149_CLOCK) + MCFG_SOUND_ADD("ym2149", YM2149, YM2149_CLOCK) // pin 26 (/SEL) is low so final clock is clk/2, handled inside the ym2149 core MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2")) MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(kurukuru_state, ym2149_aout_w)) MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(kurukuru_state, ym2149_bout_w)) @@ -776,7 +782,7 @@ static MACHINE_CONFIG_START( ppj, kurukuru_state ) MCFG_SOUND_ADD("adpcm", MSM5205, M5205_CLOCK) MCFG_MSM5205_VCLK_CB(WRITELINE(kurukuru_state, kurukuru_msm5205_vck)) - MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) /* changed on the fly */ + MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) // changed on the fly MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) MACHINE_CONFIG_END @@ -837,8 +843,8 @@ ROM_END * Game Drivers * ***************************************************************************/ -/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ -GAME( 1990, kurukuru, 0, kurukuru, kurukuru, driver_device, 0, ROT0, "Success / Taiyo Jidoki", "Kuru Kuru Pyon Pyon (Japan)", 0 ) +/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ +GAME( 1990, kurukuru, 0, kurukuru, kurukuru, driver_device, 0, ROT0, "Success / Taiyo Jidoki", "Kuru Kuru Pyon Pyon (Japan)", 0 ) GAME( 199?, ppj, 0, ppj, ppj, driver_device, 0, ROT0, "Success / Taiyo Jidoki", "Pyon Pyon Jump (V1.40, Japan)", 0 ) // unemulated.... diff --git a/src/mame/drivers/naomi.cpp b/src/mame/drivers/naomi.cpp index 2e8b45ccbba..3944d61e0af 100644 --- a/src/mame/drivers/naomi.cpp +++ b/src/mame/drivers/naomi.cpp @@ -335,6 +335,7 @@ The Maze of the Kings (prototype) no cart * 21 (64Mb) pre Tokyo Bus Guide (Rev A) 840-0045C 23468A 18 (64Mb) present 315-6206 317-0290-COM requires 837-13844 JVS IO Virtua NBA (prototype) no cart * 21 (64Mb) present 315-6206 317-0271-COM * instead of EPROM have tiny PCB with 2 flashroms on it Virtua Tennis / Power Smash (prototype) no cart * 21 (64Mb) present 315-6206 317-0263-COM * flash-PCB, title screen have label "SOFT R&D Dept.#3", not dumped but known to exist +Wave Runner GP (original, Rev A) 840-0064C 23725A 12 (64Mb) present 315-6206 317-0306-COM 840-0064B-01 837-13668 171-7919A (C) Sega 1998 @@ -6523,12 +6524,30 @@ ROM_START( kick4csh ) ROM_PARAMETER( ":rom_board:key", "820857c9" ) ROM_END +ROM_START( wrungpo ) + NAOMI_BIOS + NAOMI_DEFAULT_EEPROM + + ROM_REGION( 0x6800000, "rom_board", ROMREGION_ERASEFF) + ROM_LOAD( "epr-23725a.ic22",0x0000000, 0x400000, CRC(f7a4d5e6) SHA1(4bf57d4ff1d42b50d22f289f6437b0c955c06e9e) ) + ROM_LOAD( "mpr-23719.ic1", 0x0800000, 0x1000000, CRC(b9fb79df) SHA1(1568320c25118f4ee5c508dcca4e4496ff23c067) ) + ROM_LOAD( "mpr-23720.ic2", 0x1800000, 0x1000000, CRC(d3f19874) SHA1(cde22c56dac233f5407d2e3ac8e6ea4f8681d0bf) ) + ROM_LOAD( "mpr-23721.ic3", 0x2800000, 0x1000000, CRC(f599a52e) SHA1(ca0edc2e9496f218117cef7d71bf1761bed8d4ac) ) + ROM_LOAD( "mpr-23722.ic4", 0x3800000, 0x1000000, CRC(e08a6a36) SHA1(ef37d8c7bc9d5055008d522825ef3e80e27745c2) ) + ROM_LOAD( "mpr-23723.ic5", 0x4800000, 0x1000000, CRC(651610eb) SHA1(4dfe4f876a5440bd1034f41a4d76e1d6bd3e0e32) ) + ROM_LOAD( "mpr-23724.ic6", 0x5800000, 0x1000000, CRC(c633c45a) SHA1(23b45140f965428d33e2424b0574715c0b952d05) ) + // note: origin ROM board have 12x8MB FlashROMs with same contents as above + + // 840-0064-01 2001 317-0306-COM Naomi + ROM_PARAMETER( ":rom_board:segam2crypt:key", "284ae7c3") +ROM_END + ROM_START( wrungp ) NAOMI_BIOS NAOMI_DEFAULT_EEPROM ROM_REGION( 0x6800000, "rom_board", ROMREGION_ERASEFF) - ROM_LOAD( "epr-24059.ic22", 0x0000000, 0x400000, CRC(f82c00b5) SHA1(e885a46b2d3d52d9222d9ce038766858a2046ea1) ) + ROM_LOAD( "epr-24059.ic22", 0x0000000, 0x400000, CRC(f82c00b5) SHA1(e885a46b2d3d52d9222d9ce038766858a2046ea1) ) ROM_LOAD( "mpr-23719.ic1", 0x0800000, 0x1000000, CRC(b9fb79df) SHA1(1568320c25118f4ee5c508dcca4e4496ff23c067) ) ROM_LOAD( "mpr-23720.ic2", 0x1800000, 0x1000000, CRC(d3f19874) SHA1(cde22c56dac233f5407d2e3ac8e6ea4f8681d0bf) ) ROM_LOAD( "mpr-23721.ic3", 0x2800000, 0x1000000, CRC(f599a52e) SHA1(ca0edc2e9496f218117cef7d71bf1761bed8d4ac) ) @@ -9498,6 +9517,7 @@ ROM_END /* 0054 */ GAME( 2000, starhrse, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Star Horse (big screens)", GAME_FLAGS ) /* 0055 */ GAME( 2000, starhrct, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Star Horse (server)", GAME_FLAGS ) /* 0056 */ GAME( 2000, starhrcl, naomi, naomim2, naomi, naomi_state, naomi, ROT270,"Sega", "Star Horse (satellite)", GAME_FLAGS ) +/* 0064-01*/GAME(2001, wrungpo, wrungp, naomim2, naomi, naomi_state, naomi, ROT0, "CRI / Sega", "Wave Runner GP (original, Rev A)", GAME_FLAGS ) /* 0064 */ GAME( 2001, wrungp, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "CRI / Sega", "Wave Runner GP", GAME_FLAGS ) /* 0068 */ GAME( 2001, crakndj2, naomi, naomim2, crackndj,naomi_state, naomi, ROT0, "Sega", "Crackin' DJ Part 2", GAME_FLAGS ) /* 0073 */ GAME( 2001, inunoos, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Inu No Osanpo / Dog Walking (Rev A)", GAME_FLAGS ) diff --git a/src/mame/drivers/toypop.cpp b/src/mame/drivers/toypop.cpp index 6dfdb4028cf..ace3e959c8a 100644 --- a/src/mame/drivers/toypop.cpp +++ b/src/mame/drivers/toypop.cpp @@ -4,10 +4,14 @@ "Universal System 16" Hardware (c) 1983/1986 Namco + driver by Angelo Salese, based off "wiped off due of not anymore licenseable" driver by Edgardo E. Contini Salvan. + TODO: - PAL is presumably inverted with address bit 11 (0x800) for 0x6000-0x7fff area between Libble Rabble and Toy Pop. - Proper sprite DMA. + - Flip Screen; + - Remaining outputs; Notes: ------ @@ -69,7 +73,7 @@ public: UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(master_vblank_irq); + TIMER_DEVICE_CALLBACK_MEMBER(master_scanline); INTERRUPT_GEN_MEMBER(slave_vblank_irq); DECLARE_READ8_MEMBER(irq_enable_r); @@ -82,12 +86,15 @@ public: DECLARE_READ8_MEMBER(dipB_h); //DECLARE_WRITE8_MEMBER(out_coin0); //DECLARE_WRITE8_MEMBER(out_coin1); + DECLARE_WRITE8_MEMBER(pal_bank_w); DECLARE_WRITE8_MEMBER(flip); DECLARE_WRITE8_MEMBER(slave_halt_ctrl_w); DECLARE_READ8_MEMBER(slave_shared_r); DECLARE_WRITE8_MEMBER(slave_shared_w); DECLARE_WRITE16_MEMBER(slave_irq_enable_w); DECLARE_WRITE8_MEMBER(sound_halt_ctrl_w); + DECLARE_READ8_MEMBER(bg_rmw_r); + DECLARE_WRITE8_MEMBER(bg_rmw_w); protected: // driver_device overrides // virtual void machine_start() override; @@ -97,6 +104,7 @@ protected: private: bool m_master_irq_enable; bool m_slave_irq_enable; + UINT8 m_pal_bank; void legacy_bg_draw(bitmap_ind16 &bitmap,const rectangle &cliprect); void legacy_fg_draw(bitmap_ind16 &bitmap,const rectangle &cliprect); @@ -155,7 +163,7 @@ PALETTE_INIT_MEMBER(namcos16_state, toypop) void namcos16_state::legacy_bg_draw(bitmap_ind16 &bitmap,const rectangle &cliprect) { int x, y; - const UINT16 pal_base = 0x300; + const UINT16 pal_base = 0x300 + (m_pal_bank << 4); const UINT32 src_base = 0x200/2; const UINT16 src_pitch = 288 / 2; @@ -200,7 +208,7 @@ void namcos16_state::legacy_fg_draw(bitmap_ind16 &bitmap,const rectangle &clipre } UINT16 tile = m_fgvram[count]; - UINT8 color = (m_fgattr[count] & 0x3f) + 0x40; + UINT8 color = (m_fgattr[count] & 0x3f) + (m_pal_bank<<6); gfx_0->transpen(bitmap,cliprect,tile,color,0,0,x*8,y*8,0); } @@ -214,6 +222,7 @@ void namcos16_state::legacy_obj_draw(bitmap_ind16 &bitmap,const rectangle &clipr UINT8 *base_spriteram = m_master_workram; const UINT16 bank1 = 0x0800; const UINT16 bank2 = 0x1000; + for (count=0x780;count<0x800;count+=2) { @@ -225,19 +234,20 @@ void namcos16_state::legacy_obj_draw(bitmap_ind16 &bitmap,const rectangle &clipr UINT8 tile = base_spriteram[count]; UINT8 color = base_spriteram[count+1]; int x = base_spriteram[count+bank1+1] + (base_spriteram[count+bank2+1] << 8); - x -= 56; - x = cliprect.max_x - x; + x -= 71; int y = base_spriteram[count+bank1+0]; - y -= 9; + y += 7; + // TODO: actually m_screen.height() + y = 224 - y; bool fx = (base_spriteram[count+bank2] & 1) == 1; bool fy = (base_spriteram[count+bank2] & 2) == 2; UINT8 width = ((base_spriteram[count+bank2] & 4) >> 2) + 1; UINT8 height = ((base_spriteram[count+bank2] & 8) >> 3) + 1; - if(width == 2) - x -=16; + if(height == 2) + y -=16; for(int yi=0;yi<height;yi++) { @@ -300,6 +310,23 @@ WRITE16_MEMBER(namcos16_state::slave_irq_enable_w) m_slave_irq_enable = (offset & 0x40000) ? false : true; } +READ8_MEMBER(namcos16_state::bg_rmw_r) +{ + UINT8 res; + + res = 0; + // note: following offset is written as offset * 2 + res |= (m_bgvram[offset] & 0x0f00) >> 4; + res |= (m_bgvram[offset] & 0x000f); + return res; +} + +WRITE8_MEMBER(namcos16_state::bg_rmw_w) +{ + // note: following offset is written as offset * 2 + m_bgvram[offset] = (data & 0xf) | ((data & 0xf0) << 4); +} + READ8_MEMBER(namcos16_state::dipA_l){ return ioport("DSW1")->read(); } // dips A READ8_MEMBER(namcos16_state::dipA_h){ return ioport("DSW1")->read() >> 4; } // dips A READ8_MEMBER(namcos16_state::dipB_l){ return ioport("DSW2")->read(); } // dips B @@ -310,6 +337,11 @@ WRITE8_MEMBER(namcos16_state::flip) flip_screen_set(data & 1); } +WRITE8_MEMBER(namcos16_state::pal_bank_w) +{ + m_pal_bank = offset & 1; +} + static ADDRESS_MAP_START( namcos16_master_base_map, AS_PROGRAM, 8, namcos16_state ) AM_RANGE(0x0000, 0x03ff) AM_RAM AM_SHARE("fgvram") AM_RANGE(0x0400, 0x07ff) AM_RAM AM_SHARE("fgattr") @@ -320,7 +352,7 @@ static ADDRESS_MAP_START( namcos16_master_base_map, AS_PROGRAM, 8, namcos16_stat AM_RANGE(0x8000, 0x8fff) AM_WRITE(slave_halt_ctrl_w) AM_RANGE(0x9000, 0x9fff) AM_WRITE(sound_halt_ctrl_w) - // 0xa000 palette bank + AM_RANGE(0xa000, 0xa001) AM_WRITE(pal_bank_w) AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("master_rom",0) ADDRESS_MAP_END @@ -346,6 +378,7 @@ static ADDRESS_MAP_START( slave_map, AS_PROGRAM, 16, namcos16_state ) AM_RANGE(0x000000, 0x007fff) AM_ROM AM_REGION("slave_rom", 0) AM_RANGE(0x080000, 0x0bffff) AM_RAM AM_RANGE(0x100000, 0x100fff) AM_READWRITE8(slave_shared_r,slave_shared_w,0x00ff) + AM_RANGE(0x180000, 0x187fff) AM_READWRITE8(bg_rmw_r,bg_rmw_w,0xffff) AM_RANGE(0x190000, 0x1dffff) AM_RAM AM_SHARE("bgvram") AM_RANGE(0x300000, 0x3fffff) AM_WRITE(slave_irq_enable_w) ADDRESS_MAP_END @@ -586,10 +619,25 @@ void namcos16_state::machine_reset() m_sound_cpu->set_input_line(INPUT_LINE_RESET,ASSERT_LINE); } -INTERRUPT_GEN_MEMBER(namcos16_state::master_vblank_irq) +TIMER_DEVICE_CALLBACK_MEMBER(namcos16_state::master_scanline) { - if(m_master_irq_enable == true) - device.execute().set_input_line(M6809_IRQ_LINE,HOLD_LINE); + int scanline = param; + + if(scanline == 224 && m_master_irq_enable == true) + m_master_cpu->set_input_line(M6809_IRQ_LINE,HOLD_LINE); + + // TODO: definitely can't fire from this, presume that a command send has a timing response ... + if(scanline == 0) + { + if (!m_namco58xx->read_reset_line()) + m_namco58xx->customio_run(); + + if (!m_namco56xx_1->read_reset_line()) + m_namco56xx_1->customio_run(); + + if (!m_namco56xx_2->read_reset_line()) + m_namco56xx_2->customio_run(); + } } INTERRUPT_GEN_MEMBER(namcos16_state::slave_vblank_irq) @@ -601,7 +649,7 @@ INTERRUPT_GEN_MEMBER(namcos16_state::slave_vblank_irq) static MACHINE_CONFIG_START( liblrabl, namcos16_state ) MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4) MCFG_CPU_PROGRAM_MAP(master_liblrabl_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", namcos16_state, master_vblank_irq) + MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", namcos16_state, master_scanline, "screen", 0, 1) MCFG_CPU_ADD("slave", M68000, MASTER_CLOCK) MCFG_CPU_PROGRAM_MAP(slave_map) @@ -610,8 +658,7 @@ static MACHINE_CONFIG_START( liblrabl, namcos16_state ) MCFG_CPU_ADD("audiocpu", M6809, MASTER_CLOCK/4) MCFG_CPU_PROGRAM_MAP(sound_map) MCFG_CPU_PERIODIC_INT_DRIVER(namcos16_state, irq0_line_hold, 60) - - + MCFG_DEVICE_ADD("58xx", NAMCO58XX, 0) MCFG_NAMCO58XX_IN_0_CB(IOPORT("COINS")) @@ -632,10 +679,7 @@ static MACHINE_CONFIG_START( liblrabl, namcos16_state ) MCFG_NAMCO56XX_IN_3_CB(IOPORT("SERVICE")) MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60.606060) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(36*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 32*8-1) + MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK,384,0,288,264,0,224) // derived from Galaxian HW, 60.606060 MCFG_SCREEN_UPDATE_DRIVER(namcos16_state, screen_update) MCFG_SCREEN_PALETTE("palette") @@ -715,5 +759,5 @@ ROM_START( toypop ) ROM_LOAD( "tp1-6.3d", 0x0000, 0x0100, CRC(16a9166a) SHA1(847cbaf7c88616576c410177e066ae1d792ac0ba) ) ROM_END -GAME( 1983, liblrabl, 0, liblrabl, liblrabl, driver_device, 0, ROT0, "Namco", "Libble Rabble", MACHINE_IS_SKELETON ) -GAME( 1986, toypop, 0, toypop, toypop, driver_device, 0, ROT0, "Namco", "Toypop", MACHINE_IS_SKELETON ) +GAME( 1983, liblrabl, 0, liblrabl, liblrabl, driver_device, 0, ROT0, "Namco", "Libble Rabble", MACHINE_NO_COCKTAIL ) +GAME( 1986, toypop, 0, toypop, toypop, driver_device, 0, ROT0, "Namco", "Toypop", MACHINE_NO_COCKTAIL ) diff --git a/src/mame/drivers/triforce.cpp b/src/mame/drivers/triforce.cpp index 41370050a70..3823f27179c 100644 --- a/src/mame/drivers/triforce.cpp +++ b/src/mame/drivers/triforce.cpp @@ -1024,7 +1024,7 @@ ROM_START( mkartag2a ) ROM_END /* Main board */ -/*Triforce*/GAME( 2002, triforce, 0, triforcegd, triforce, driver_device, 0, ROT0, "Sega", "Triforce Bios", MACHINE_IS_SKELETON|MACHINE_IS_BIOS_ROOT ) +/*Triforce*/GAME( 2002, triforce, 0, triforce_base, triforce, driver_device, 0, ROT0, "Sega", "Triforce Bios", MACHINE_IS_SKELETON|MACHINE_IS_BIOS_ROOT ) /* GDT-xxxx (Sega GD-ROM games) */ /* 0001 */ GAME( 2002, vs2002j, triforce, triforcegd, triforce, driver_device, 0, ROT0, "Sega / Amusement Vision", "Virtua Striker 2002 (GDT-0001)", MACHINE_IS_SKELETON ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 61d6b093de7..2c65ae0d192 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -27761,6 +27761,7 @@ wldkicksa // 2000.03 World Kicks (Asia, WK2 Ver.A) wldkicksj // 2000.03 World Kicks PCB (Japan, WKC1 Ver.A) wldrider // 2001.05 Wild Riders wrungp // 2001.08 Wave Runner GP +wrungpo // 2001.?? Wave Runner GP (original, Rev A) wsbbgd // 2001.06 Super Major League / World Series Baseball wwfroyal // 2000.11 WWF Royal Rumble xtrmhnt2 // 2006.09 Extreme Hunting 2 Tournament Edition diff --git a/src/osd/modules/render/bgfx/blendreader.cpp b/src/osd/modules/render/bgfx/blendreader.cpp index f96f20a4ba8..9e7ddb17ce3 100644 --- a/src/osd/modules/render/bgfx/blendreader.cpp +++ b/src/osd/modules/render/bgfx/blendreader.cpp @@ -14,8 +14,8 @@ const blend_reader::string_to_enum blend_reader::EQUATION_NAMES[blend_reader::EQ { "add", BGFX_STATE_BLEND_EQUATION_ADD }, { "sub", BGFX_STATE_BLEND_EQUATION_SUB }, { "subtract", BGFX_STATE_BLEND_EQUATION_SUB }, - { "revSub", BGFX_STATE_BLEND_EQUATION_REVSUB }, - { "revSubtract", BGFX_STATE_BLEND_EQUATION_REVSUB }, + { "revsub", BGFX_STATE_BLEND_EQUATION_REVSUB }, + { "revsubtract", BGFX_STATE_BLEND_EQUATION_REVSUB }, { "min", BGFX_STATE_BLEND_EQUATION_MIN }, { "max", BGFX_STATE_BLEND_EQUATION_MAX } }; @@ -25,18 +25,18 @@ const blend_reader::string_to_enum blend_reader::FUNCTION_NAMES[blend_reader::FU { "zero", BGFX_STATE_BLEND_ZERO }, { "1", BGFX_STATE_BLEND_ONE }, { "one", BGFX_STATE_BLEND_ONE }, - { "srcColor", BGFX_STATE_BLEND_SRC_COLOR }, - { "1-srcColor", BGFX_STATE_BLEND_INV_SRC_COLOR }, - { "invSrcColor", BGFX_STATE_BLEND_INV_SRC_COLOR }, - { "dstColor", BGFX_STATE_BLEND_DST_COLOR }, - { "1-dstColor", BGFX_STATE_BLEND_INV_DST_COLOR }, - { "invDstColor", BGFX_STATE_BLEND_INV_DST_COLOR }, - { "srcAlpha", BGFX_STATE_BLEND_SRC_ALPHA }, - { "1-srcAlpha", BGFX_STATE_BLEND_INV_SRC_ALPHA }, - { "invSrcAlpha", BGFX_STATE_BLEND_INV_SRC_ALPHA }, - { "dstAlpha", BGFX_STATE_BLEND_DST_ALPHA }, - { "1-dstAlpha", BGFX_STATE_BLEND_INV_DST_ALPHA }, - { "invDstAlpha", BGFX_STATE_BLEND_INV_DST_ALPHA } + { "srccolor", BGFX_STATE_BLEND_SRC_COLOR }, + { "1-srccolor", BGFX_STATE_BLEND_INV_SRC_COLOR }, + { "invsrccolor", BGFX_STATE_BLEND_INV_SRC_COLOR }, + { "dstcolor", BGFX_STATE_BLEND_DST_COLOR }, + { "1-dstcolor", BGFX_STATE_BLEND_INV_DST_COLOR }, + { "invdstcolor", BGFX_STATE_BLEND_INV_DST_COLOR }, + { "srcalpha", BGFX_STATE_BLEND_SRC_ALPHA }, + { "1-srcalpha", BGFX_STATE_BLEND_INV_SRC_ALPHA }, + { "invsrcalpha", BGFX_STATE_BLEND_INV_SRC_ALPHA }, + { "dstalpha", BGFX_STATE_BLEND_DST_ALPHA }, + { "1-dstalpha", BGFX_STATE_BLEND_INV_DST_ALPHA }, + { "invdstalpha", BGFX_STATE_BLEND_INV_DST_ALPHA } }; uint64_t blend_reader::read_from_value(const Value& value) diff --git a/src/osd/modules/render/bgfx/chainentryreader.cpp b/src/osd/modules/render/bgfx/chainentryreader.cpp index abaebf132e9..62547eb6912 100644 --- a/src/osd/modules/render/bgfx/chainentryreader.cpp +++ b/src/osd/modules/render/bgfx/chainentryreader.cpp @@ -129,24 +129,6 @@ bgfx_chain_entry* chain_entry_reader::read_from_value(const Value& value, std::s } } - if (value.HasMember("textures")) - { - const Value& texture_array = value["textures"]; - for (UINT32 i = 0; i < texture_array.Size(); i++) - { - std::string texture_path = std::string(options.bgfx_path()) + "/artwork/"; - if (!READER_CHECK(texture_array[i].IsString(), (prefix + "textures[" + std::to_string(i) + "]: Value must be a string\n").c_str())) - { - for (bgfx_entry_uniform* uniform : uniforms) delete uniform; - for (bgfx_suppressor* suppressor : suppressors) delete suppressor; - return nullptr; - } - std::string texture_name = texture_array[i].GetString(); - - textures.create_png_texture(texture_path, texture_name, texture_name); - } - } - std::string output = value["output"].GetString(); return new bgfx_chain_entry(name, effect, suppressors, inputs, uniforms, targets, output); } @@ -162,6 +144,5 @@ bool chain_entry_reader::validate_parameters(const Value& value, std::string pre if (!READER_CHECK(!value.HasMember("input") || value["input"].IsArray(), (prefix + "Value 'input' must be an array\n").c_str())) return false; if (!READER_CHECK(!value.HasMember("uniforms") || value["uniforms"].IsArray(), (prefix + "Value 'uniforms' must be an array\n").c_str())) return false; if (!READER_CHECK(!value.HasMember("disablewhen") || value["disablewhen"].IsArray(), (prefix + "Value 'disablewhen' must be an array\n").c_str())) return false; - if (!READER_CHECK(!value.HasMember("textures") || value["textures"].IsArray(), (prefix + "Value 'textures' must be an array\n").c_str())) return false; return true; }
\ No newline at end of file diff --git a/src/osd/modules/render/bgfx/chainmanager.cpp b/src/osd/modules/render/bgfx/chainmanager.cpp index 22be450be40..cba1bbc3c3d 100644 --- a/src/osd/modules/render/bgfx/chainmanager.cpp +++ b/src/osd/modules/render/bgfx/chainmanager.cpp @@ -4,8 +4,8 @@ // // chainmanager.cpp - BGFX shader chain manager // -// Maintains a string-to-entry lookup of BGFX shader effect -// chains, defined by chain.h and read by chainreader.h +// Provides loading for BGFX shader effect chains, defined +// by chain.h and read by chainreader.h // //============================================================ @@ -60,7 +60,7 @@ bgfx_chain* chain_manager::load_chain(std::string name, running_machine& machine data[size] = 0; Document document; - document.Parse<0>(data); + document.Parse<kParseCommentsFlag>(data); delete [] data; diff --git a/src/osd/modules/render/bgfx/chainmanager.h b/src/osd/modules/render/bgfx/chainmanager.h index 07e1dfd8594..8ed0b218bb4 100644 --- a/src/osd/modules/render/bgfx/chainmanager.h +++ b/src/osd/modules/render/bgfx/chainmanager.h @@ -4,8 +4,8 @@ // // chainmanager.h - BGFX shader chain manager // -// Maintains a string-to-entry lookup of BGFX shader -// effect chains, defined by chain.h and read by chainreader.h +// Provides loading for BGFX shader effect chains, defined +// by chain.h and read by chainreader.h // //============================================================ diff --git a/src/osd/modules/render/bgfx/cullreader.cpp b/src/osd/modules/render/bgfx/cullreader.cpp index 593e712fecb..616e7cabfe4 100644 --- a/src/osd/modules/render/bgfx/cullreader.cpp +++ b/src/osd/modules/render/bgfx/cullreader.cpp @@ -11,9 +11,11 @@ #include "cullreader.h" const cull_reader::string_to_enum cull_reader::MODE_NAMES[cull_reader::MODE_COUNT] = { - { "none", 0 }, - { "cw", BGFX_STATE_CULL_CW }, - { "ccw", BGFX_STATE_CULL_CCW } + { "none", 0 }, + { "cw", BGFX_STATE_CULL_CW }, + { "clockwise", BGFX_STATE_CULL_CW }, + { "ccw", BGFX_STATE_CULL_CCW }, + { "counterclockwise", BGFX_STATE_CULL_CCW } }; uint64_t cull_reader::read_from_value(const Value& value) diff --git a/src/osd/modules/render/bgfx/cullreader.h b/src/osd/modules/render/bgfx/cullreader.h index 5c521a108a2..0cb2a3d0f67 100644 --- a/src/osd/modules/render/bgfx/cullreader.h +++ b/src/osd/modules/render/bgfx/cullreader.h @@ -18,7 +18,7 @@ public: static uint64_t read_from_value(const Value& value); private: - static const int MODE_COUNT = 3; + static const int MODE_COUNT = 5; static const string_to_enum MODE_NAMES[MODE_COUNT]; }; diff --git a/src/osd/modules/render/bgfx/depthreader.cpp b/src/osd/modules/render/bgfx/depthreader.cpp index e904604b84d..b32eb426bb7 100644 --- a/src/osd/modules/render/bgfx/depthreader.cpp +++ b/src/osd/modules/render/bgfx/depthreader.cpp @@ -27,7 +27,7 @@ uint64_t depth_reader::read_from_value(const Value& value, std::string prefix) if (value.HasMember("writeenable")) { if (!READER_CHECK(value["writeenable"].IsBool(), (prefix + "Value 'writeenable' must be a boolean\n").c_str())) return 0; - write_enable = value["writeenable"].GetBool() ? BGFX_STATE_DEPTH_WRITE: 0; + write_enable = value["writeenable"].GetBool() ? BGFX_STATE_DEPTH_WRITE : 0; } uint64_t function = get_enum_from_value(value, "function", BGFX_STATE_DEPTH_TEST_ALWAYS, FUNCTION_NAMES, FUNCTION_COUNT); diff --git a/src/osd/modules/render/bgfx/effect.h b/src/osd/modules/render/bgfx/effect.h index 8c1c3c4f617..c4a5d49b2c5 100644 --- a/src/osd/modules/render/bgfx/effect.h +++ b/src/osd/modules/render/bgfx/effect.h @@ -2,7 +2,7 @@ // copyright-holders:Ryan Holtz //============================================================ // -// effect.cpp - BGFX shader material to be applied to a mesh +// effect.h - BGFX shader material to be applied to a mesh // //============================================================ diff --git a/src/osd/modules/render/bgfx/effectmanager.cpp b/src/osd/modules/render/bgfx/effectmanager.cpp index bbe1ce33482..cf5d4172c6d 100644 --- a/src/osd/modules/render/bgfx/effectmanager.cpp +++ b/src/osd/modules/render/bgfx/effectmanager.cpp @@ -68,7 +68,7 @@ bgfx_effect* effect_manager::load_effect(std::string name) data[size] = 0; Document document; - document.Parse<0>(data); + document.Parse<kParseCommentsFlag>(data); delete [] data; @@ -85,7 +85,7 @@ bgfx_effect* effect_manager::load_effect(std::string name) printf("Unable to load effect %s\n", path.c_str()); return nullptr; } - + m_effects[name] = effect; return effect; diff --git a/src/osd/modules/render/bgfx/frameparameter.h b/src/osd/modules/render/bgfx/frameparameter.h index 022a6f2065b..b7ab5525eda 100644 --- a/src/osd/modules/render/bgfx/frameparameter.h +++ b/src/osd/modules/render/bgfx/frameparameter.h @@ -1,9 +1,8 @@ - // license:BSD-3-Clause // copyright-holders:Ryan Holtz //============================================================ // -// frameparameter.cpp - Frame-based dynamic shader param +// frameparameter.h - Frame-based dynamic shader param // //============================================================ diff --git a/src/osd/modules/render/bgfx/inputpair.cpp b/src/osd/modules/render/bgfx/inputpair.cpp index ce4ece9508b..1f48171da7b 100644 --- a/src/osd/modules/render/bgfx/inputpair.cpp +++ b/src/osd/modules/render/bgfx/inputpair.cpp @@ -2,7 +2,7 @@ // copyright-holders:Ryan Holtz //============================================================ // -// inputpair.h - BGFX sampler-and-texture pair +// inputpair.cpp - BGFX sampler-and-texture pair // // Keeps track of the texture which is bound to the sampler // which is bound to the specified stage index. diff --git a/src/osd/modules/render/bgfx/fs_blit.sc b/src/osd/modules/render/bgfx/shaders/fs_blit.sc index ff6befc4272..a6835ff890d 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Samplers SAMPLER2D(s_tex, 0); diff --git a/src/osd/modules/render/bgfx/fs_color.sc b/src/osd/modules/render/bgfx/shaders/fs_color.sc index fae98f2a39f..65c128a6a2a 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" // User-supplied uniform vec4 u_red_ratios; diff --git a/src/osd/modules/render/bgfx/fs_deconverge.sc b/src/osd/modules/render/bgfx/shaders/fs_deconverge.sc index 409896ce40a..d58e1bf6df9 100644 --- a/src/osd/modules/render/bgfx/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 // Deconvergence Effect //----------------------------------------------------------------------------- -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Samplers SAMPLER2D(s_tex, 0); diff --git a/src/osd/modules/render/bgfx/fs_defocus.sc b/src/osd/modules/render/bgfx/shaders/fs_defocus.sc index 8c3ee7a4e6c..44ca7a93612 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Autos uniform vec4 u_tex_size0; diff --git a/src/osd/modules/render/bgfx/fs_distortion.sc b/src/osd/modules/render/bgfx/shaders/fs_distortion.sc index b3678abc669..1b93578a2cf 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Autos uniform vec4 u_swap_xy; diff --git a/src/osd/modules/render/bgfx/fs_gui.sc b/src/osd/modules/render/bgfx/shaders/fs_gui.sc index 9f539c1182a..a6285212d2f 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Samplers SAMPLER2D(s_tex, 0); diff --git a/src/osd/modules/render/bgfx/fs_ntsc_decode.sc b/src/osd/modules/render/bgfx/shaders/fs_ntsc_decode.sc index 1f5c9305053..cc8f633bf5b 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Autos uniform vec4 u_source_dims; diff --git a/src/osd/modules/render/bgfx/fs_ntsc_encode.sc b/src/osd/modules/render/bgfx/shaders/fs_ntsc_encode.sc index 61f5ae12ac9..3aeac29d20d 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Autos uniform vec4 u_source_dims; diff --git a/src/osd/modules/render/bgfx/fs_phosphor.sc b/src/osd/modules/render/bgfx/shaders/fs_phosphor.sc index e5ac1d91f35..4e752d94137 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" // User-supplied uniform vec4 u_passthrough; diff --git a/src/osd/modules/render/bgfx/fs_post.sc b/src/osd/modules/render/bgfx/shaders/fs_post.sc index 8fe9f227e3c..4a77dc88cbb 100644 --- a/src/osd/modules/render/bgfx/fs_post.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_post.sc @@ -6,7 +6,7 @@ $input v_color0, v_texcoord0, v_texcoord1 // Defocus Effect //----------------------------------------------------------------------------- -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Autos uniform vec4 u_swap_xy; @@ -113,11 +113,11 @@ void main() BaseColor.b = pow(BaseColor.b, u_power.b); // Scanline Simulation (may not affect bloom) - //if (u_prepare_bloom.x == 0.0) - //{ + if (u_prepare_bloom.x == 0.0) + { // Scanline Simulation (may not affect vector screen) - //if (u_prepare_vector.x == 0.0 && u_scanline_alpha.x > 0.0f) - //{ + if (u_prepare_vector.x == 0.0 && u_scanline_alpha.x > 0.0f) + { float BrightnessOffset = (u_scanline_bright_offset.x * u_scanline_alpha.x); float BrightnessScale = (u_scanline_bright_scale.x * u_scanline_alpha.x) + (1.0 - u_scanline_alpha.x); @@ -131,19 +131,19 @@ void main() float ScanBrightness = ScanSineScaled * BrightnessScale + BrightnessOffset * BrightnessScale; BaseColor.rgb *= mix(vec3(1.0, 1.0, 1.0), vec3(ScanBrightness, ScanBrightness, ScanBrightness), u_scanline_alpha.xxx); - //} + } // Hum Bar Simulation (may not affect vector screen) - //if (u_prepare_vector.x == 0.0 && u_humbar_alpha.x > 0.0f) - //{ - //float HumTimeStep = fract(u_time.x * 0.001); - //float HumBrightness = 1.0 - fract(BaseCoord.y + HumTimeStep) * u_humbar_alpha.x; - //BaseColor.rgb *= HumBrightness; - //} - //} - - //vec4 Output = u_prepare_vector.x > 0.0 ? BaseColor * (v_color0 + vec4(1.0, 1.0, 1.0, 0.0)) : BaseColor * v_color0; - //Output.a = 1.0; - - gl_FragColor = vec4(BaseColor.rgb, 1.0);//Output; + if (u_prepare_vector.x == 0.0 && u_humbar_alpha.x > 0.0f) + { + float HumTimeStep = fract(u_time.x * 0.001); + float HumBrightness = 1.0 - fract(BaseCoord.y + HumTimeStep) * u_humbar_alpha.x; + BaseColor.rgb *= HumBrightness; + } + } + + vec4 Output = u_prepare_vector.x > 0.0 ? BaseColor * (v_color0 + vec4(1.0, 1.0, 1.0, 0.0)) : BaseColor * v_color0; + Output.a = 1.0; + + gl_FragColor = Output; } diff --git a/src/osd/modules/render/bgfx/fs_prescale.sc b/src/osd/modules/render/bgfx/shaders/fs_prescale.sc index a6f377991f2..48d177b19fa 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Samplers SAMPLER2D(s_tex, 0); diff --git a/src/osd/modules/render/bgfx/fs_screen.sc b/src/osd/modules/render/bgfx/shaders/fs_screen.sc index cecf14b4730..d0eaa170d49 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Samplers SAMPLER2D(s_tex, 0); diff --git a/src/osd/modules/render/bgfx/makefile b/src/osd/modules/render/bgfx/shaders/makefile index 86735a61c38..737ca43554b 100644 --- a/src/osd/modules/render/bgfx/makefile +++ b/src/osd/modules/render/bgfx/shaders/makefile @@ -1,6 +1,6 @@ -BGFX_DIR=../../../../../3rdparty/bgfx -RUNTIME_DIR=../../../../.. -BUILD_DIR=../../../../../build +BGFX_DIR=../../../../../../3rdparty/bgfx +RUNTIME_DIR=../../../../../.. +BUILD_DIR=../../../../../../build include $(BGFX_DIR)/scripts/shader.mk diff --git a/src/osd/modules/render/bgfx/varying.def.sc b/src/osd/modules/render/bgfx/shaders/varying.def.sc index 95b607539a7..95b607539a7 100644 --- a/src/osd/modules/render/bgfx/varying.def.sc +++ b/src/osd/modules/render/bgfx/shaders/varying.def.sc diff --git a/src/osd/modules/render/bgfx/vs_blit.sc b/src/osd/modules/render/bgfx/shaders/vs_blit.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_color.sc b/src/osd/modules/render/bgfx/shaders/vs_color.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_deconverge.sc b/src/osd/modules/render/bgfx/shaders/vs_deconverge.sc index 284fe96e67b..6e13814c89b 100644 --- a/src/osd/modules/render/bgfx/vs_deconverge.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_deconverge.sc @@ -4,10 +4,10 @@ $output v_color0, v_texcoord0, v_texcoord1, v_texcoord2 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Autos -uniform vec4 u_tex_size0; +uniform vec4 u_source_size; // User-supplied uniform vec4 u_converge_red; @@ -23,9 +23,9 @@ void main() vec2 half_value = vec2(0.5, 0.5); - v_texcoord0 = (a_texcoord0 - half_value) * (1.0 + u_radial_converge_red.xy ) + half_value + u_converge_red.xy * (vec2(1.0, 1.0) / u_tex_size0.xy); - v_texcoord1 = (a_texcoord0 - half_value) * (1.0 + u_radial_converge_green.xy) + half_value + u_converge_green.xy * (vec2(1.0, 1.0) / u_tex_size0.xy); - v_texcoord2 = (a_texcoord0 - half_value) * (1.0 + u_radial_converge_blue.xy ) + half_value + u_converge_blue.xy * (vec2(1.0, 1.0) / u_tex_size0.xy); + v_texcoord0 = (a_texcoord0 - half_value) * (1.0 + u_radial_converge_red.xy ) + half_value + u_converge_red.xy * (vec2(1.0, 1.0) / u_source_size.xy); + v_texcoord1 = (a_texcoord0 - half_value) * (1.0 + u_radial_converge_green.xy) + half_value + u_converge_green.xy * (vec2(1.0, 1.0) / u_source_size.xy); + v_texcoord2 = (a_texcoord0 - half_value) * (1.0 + u_radial_converge_blue.xy ) + half_value + u_converge_blue.xy * (vec2(1.0, 1.0) / u_source_size.xy); v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/vs_defocus.sc b/src/osd/modules/render/bgfx/shaders/vs_defocus.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_distortion.sc b/src/osd/modules/render/bgfx/shaders/vs_distortion.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_gui.sc b/src/osd/modules/render/bgfx/shaders/vs_gui.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_ntsc_decode.sc b/src/osd/modules/render/bgfx/shaders/vs_ntsc_decode.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_ntsc_encode.sc b/src/osd/modules/render/bgfx/shaders/vs_ntsc_encode.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_phosphor.sc b/src/osd/modules/render/bgfx/shaders/vs_phosphor.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_post.sc b/src/osd/modules/render/bgfx/shaders/vs_post.sc index 12b4931a1ae..89923cc9338 100644 --- a/src/osd/modules/render/bgfx/vs_post.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_post.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_texcoord1, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" uniform vec4 u_swap_xy; diff --git a/src/osd/modules/render/bgfx/vs_prescale.sc b/src/osd/modules/render/bgfx/shaders/vs_prescale.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_screen.sc b/src/osd/modules/render/bgfx/shaders/vs_screen.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/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 "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/sliderreader.cpp b/src/osd/modules/render/bgfx/sliderreader.cpp index 3efe8749c03..b76d3d2c472 100644 --- a/src/osd/modules/render/bgfx/sliderreader.cpp +++ b/src/osd/modules/render/bgfx/sliderreader.cpp @@ -12,7 +12,7 @@ #include "slider.h" const slider_reader::string_to_enum slider_reader::TYPE_NAMES[slider_reader::TYPE_COUNT] = { - { "int_enum", uint64_t(bgfx_slider::slider_type::SLIDER_INT_ENUM) }, + { "intenum", uint64_t(bgfx_slider::slider_type::SLIDER_INT_ENUM) }, { "float", uint64_t(bgfx_slider::slider_type::SLIDER_FLOAT) }, { "int", uint64_t(bgfx_slider::slider_type::SLIDER_INT) }, { "color", uint64_t(bgfx_slider::slider_type::SLIDER_COLOR) }, @@ -24,11 +24,11 @@ const slider_reader::string_to_enum slider_reader::SCREEN_NAMES[slider_reader::S { "raster", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_RASTER) }, { "vector", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_VECTOR) }, { "crt", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_VECTOR_OR_RASTER) }, - { "vector_raster", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_VECTOR_OR_RASTER) }, + { "vectorraster", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_VECTOR_OR_RASTER) }, { "lcd", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_LCD) }, - { "non_vector", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_LCD_OR_RASTER) }, - { "lcd_raster", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_LCD_OR_RASTER) }, - { "lcd_vector", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_LCD_OR_VECTOR) }, + { "nonvector", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_LCD_OR_RASTER) }, + { "lcdraster", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_LCD_OR_RASTER) }, + { "lcdvector", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_LCD_OR_VECTOR) }, { "any", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_ANY) }, { "all", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_ANY) } }; diff --git a/src/osd/modules/render/bgfx/statereader.cpp b/src/osd/modules/render/bgfx/statereader.cpp index 0f5c0a2f88c..a318422d69d 100644 --- a/src/osd/modules/render/bgfx/statereader.cpp +++ b/src/osd/modules/render/bgfx/statereader.cpp @@ -1,5 +1,12 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz +//================================================================ +// +// statereader.cpp - Generic functions for reading state from +// a JSON file using RapidJSON. +// +//================================================================ + #include "statereader.h" uint64_t state_reader::get_enum_from_value(const Value& value, std::string name, const uint64_t default_value, const string_to_enum* enums, const int count) diff --git a/src/osd/modules/render/bgfx/statereader.h b/src/osd/modules/render/bgfx/statereader.h index 5b9a5f5625d..968837a1a19 100644 --- a/src/osd/modules/render/bgfx/statereader.h +++ b/src/osd/modules/render/bgfx/statereader.h @@ -1,5 +1,12 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz +//================================================================ +// +// statereader.h - Generic functions for reading state from a +// JSON file using RapidJSON. +// +//================================================================ + #pragma once #ifndef __DRAWBGFX_STATE_READER__ diff --git a/src/osd/modules/render/bgfx/suppressor.cpp b/src/osd/modules/render/bgfx/suppressor.cpp index b01e0f94d04..41a260d5d73 100644 --- a/src/osd/modules/render/bgfx/suppressor.cpp +++ b/src/osd/modules/render/bgfx/suppressor.cpp @@ -2,8 +2,8 @@ // copyright-holders:Ryan Holtz //============================================================ // -// suppressor.h - Conditionally suppress a bgfx chain entry -// from being processed. +// suppressor.cpp - Conditionally suppress a bgfx chain entry +// from being processed. // //============================================================ diff --git a/src/osd/modules/render/bgfx/suppressor.h b/src/osd/modules/render/bgfx/suppressor.h index 93166eff693..dd3702439ad 100644 --- a/src/osd/modules/render/bgfx/suppressor.h +++ b/src/osd/modules/render/bgfx/suppressor.h @@ -3,7 +3,7 @@ //============================================================ // // suppressor.h - Conditionally suppress a bgfx chain entry -// from being processed. +// from being processed. // //============================================================ diff --git a/src/osd/modules/render/bgfx/targetmanager.cpp b/src/osd/modules/render/bgfx/targetmanager.cpp index 9820f237a48..1aa0418938a 100644 --- a/src/osd/modules/render/bgfx/targetmanager.cpp +++ b/src/osd/modules/render/bgfx/targetmanager.cpp @@ -4,8 +4,8 @@ // // targetmanager.cpp - BGFX render target manager // -// Maintains a string-to-entry mapping for any registered -// render targets. +// Maintains a per-screen string-to-entry mapping for any +// registered render targets. // //============================================================ @@ -21,9 +21,8 @@ const int32_t target_manager::MAX_SCREENS = 100; -target_manager::target_manager(osd_options& options, texture_manager& textures) +target_manager::target_manager(texture_manager& textures) : m_textures(textures) - , m_options(options) , m_screen_count(0) { (void)m_options; // prevent carping about unused variable diff --git a/src/osd/modules/render/bgfx/targetmanager.h b/src/osd/modules/render/bgfx/targetmanager.h index 0ffc7a934b8..dcc8e8eec64 100644 --- a/src/osd/modules/render/bgfx/targetmanager.h +++ b/src/osd/modules/render/bgfx/targetmanager.h @@ -4,8 +4,8 @@ // // targetmanager.h - BGFX render target manager // -// Maintains a string-to-entry mapping for any registered -// render targets. +// Maintains a per-screen string-to-entry mapping for any +// registered render targets. // //============================================================ @@ -24,11 +24,10 @@ #include "texturemanager.h" class bgfx_target; -class osd_options; class target_manager { public: - target_manager(osd_options& options, texture_manager& textures); + target_manager(texture_manager& textures); ~target_manager(); bgfx_target* create_target(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, uint32_t style, bool double_buffer, bool filter, bool smooth, uint32_t screen); @@ -46,7 +45,6 @@ private: std::map<std::string, bgfx_target*> m_targets; texture_manager& m_textures; - osd_options& m_options; std::vector<osd_dim> m_guest_dims; std::vector<osd_dim> m_native_dims; diff --git a/src/osd/modules/render/bgfx/texturehandleprovider.h b/src/osd/modules/render/bgfx/texturehandleprovider.h index e309bea8d59..5620e54974e 100644 --- a/src/osd/modules/render/bgfx/texturehandleprovider.h +++ b/src/osd/modules/render/bgfx/texturehandleprovider.h @@ -2,7 +2,8 @@ // copyright-holders:Ryan Holtz //============================================================ // -// texturehandleprovider.h +// texturehandleprovider.h - base class for any class that +// can potentially return information about a texture handle // //============================================================ diff --git a/src/osd/modules/render/bgfx/timeparameter.h b/src/osd/modules/render/bgfx/timeparameter.h index 6a05be4fc03..f06bf2f1abb 100644 --- a/src/osd/modules/render/bgfx/timeparameter.h +++ b/src/osd/modules/render/bgfx/timeparameter.h @@ -2,7 +2,7 @@ // copyright-holders:Ryan Holtz //============================================================ // -// timeparameter.cpp - Time-based dynamic shader param +// timeparameter.h - Time-based dynamic shader param // //============================================================ diff --git a/src/osd/modules/render/bgfx/valueuniform.h b/src/osd/modules/render/bgfx/valueuniform.h index 2cce6970958..cf71742e8da 100644 --- a/src/osd/modules/render/bgfx/valueuniform.h +++ b/src/osd/modules/render/bgfx/valueuniform.h @@ -2,7 +2,7 @@ // copyright-holders:Ryan Holtz //============================================================ // -// valueuniform.cpp - BGFX shader chain fixed uniform +// valueuniform.h - BGFX shader chain fixed uniform // // Represents the mapping between a fixed value and a chain // shader uniform for a given entry diff --git a/src/osd/modules/render/bgfx/writereader.cpp b/src/osd/modules/render/bgfx/writereader.cpp index 7fd36a03fda..6ec148f9e46 100644 --- a/src/osd/modules/render/bgfx/writereader.cpp +++ b/src/osd/modules/render/bgfx/writereader.cpp @@ -1,26 +1,18 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz +//============================================================ +// +// cullreader.h - BGFX alpha/color write state JSON reader +// +//============================================================ + #include <bgfx/bgfx.h> #include "writereader.h" -const write_reader::string_to_enum write_reader::RGB_NAMES[write_reader::RGB_COUNT] = { - { "true", BGFX_STATE_RGB_WRITE }, - { "false", 0 }, - { "1", BGFX_STATE_RGB_WRITE }, - { "0", 0 } -}; - -const write_reader::string_to_enum write_reader::ALPHA_NAMES[write_reader::ALPHA_COUNT] = { - { "true", BGFX_STATE_ALPHA_WRITE }, - { "false", 0 }, - { "1", BGFX_STATE_ALPHA_WRITE }, - { "0", 0 } -}; - uint64_t write_reader::read_from_value(const Value& value) { - uint64_t rgb = get_enum_from_value(value, "rgb", 0, RGB_NAMES, RGB_COUNT); - uint64_t alpha = get_enum_from_value(value, "alpha", 0, ALPHA_NAMES, ALPHA_COUNT); + uint64_t rgb = get_bool(value, "rgb", false) ? BGFX_STATE_RGB_WRITE : 0; + uint64_t alpha = get_bool(value, "alpha", false) ? BGFX_STATE_ALPHA_WRITE : 0; return rgb | alpha; } diff --git a/src/osd/modules/render/bgfx/writereader.h b/src/osd/modules/render/bgfx/writereader.h index bd43b5899f5..7dcd1ac16c9 100644 --- a/src/osd/modules/render/bgfx/writereader.h +++ b/src/osd/modules/render/bgfx/writereader.h @@ -1,5 +1,11 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz +//============================================================ +// +// cullreader.h - BGFX alpha/color write state JSON reader +// +//============================================================ + #pragma once #ifndef __DRAWBGFX_WRITE_READER__ @@ -10,12 +16,6 @@ class write_reader : public state_reader { public: static uint64_t read_from_value(const Value& value); - -private: - static const int RGB_COUNT = 4; - static const int ALPHA_COUNT = 4; - static const string_to_enum RGB_NAMES[RGB_COUNT]; - static const string_to_enum ALPHA_NAMES[ALPHA_COUNT]; }; #endif // __DRAWBGFX_WRITE_READER__ diff --git a/src/osd/modules/render/d3d/d3dhlsl.cpp b/src/osd/modules/render/d3d/d3dhlsl.cpp index 62800ecf9c6..9d22e045b91 100644 --- a/src/osd/modules/render/d3d/d3dhlsl.cpp +++ b/src/osd/modules/render/d3d/d3dhlsl.cpp @@ -69,6 +69,7 @@ shaders::shaders() : { master_enable = false; vector_enable = true; + oversampling_enable = false; shadow_texture = nullptr; options = nullptr; paused = true; @@ -664,6 +665,7 @@ void shaders::init(d3d_base *d3dintf, running_machine *machine, renderer_d3d9 *r windows_options &winoptions = downcast<windows_options &>(machine->options()); master_enable = winoptions.d3d_hlsl_enable(); + oversampling_enable = winoptions.d3d_hlsl_oversampling(); snap_width = winoptions.d3d_snap_width(); snap_height = winoptions.d3d_snap_height(); @@ -945,7 +947,6 @@ int shaders::create_resources(bool reset) for (int i = 0; i < 13; i++) { effects[i]->add_uniform("SourceDims", uniform::UT_VEC2, uniform::CU_SOURCE_DIMS); - effects[i]->add_uniform("SourceRect", uniform::UT_VEC2, uniform::CU_SOURCE_RECT); effects[i]->add_uniform("TargetDims", uniform::UT_VEC2, uniform::CU_TARGET_DIMS); effects[i]->add_uniform("ScreenDims", uniform::UT_VEC2, uniform::CU_SCREEN_DIMS); effects[i]->add_uniform("QuadDims", uniform::UT_VEC2, uniform::CU_QUAD_DIMS); @@ -1438,7 +1439,6 @@ int shaders::downsample_pass(d3d_render_target *rt, int source_index, poly_info for (int bloom_index = 0; bloom_index < rt->bloom_count; bloom_index++) { curr_effect->set_vector("TargetDims", 2, rt->bloom_dims[bloom_index]); - curr_effect->set_int("BloomLevel", bloom_index + 1); curr_effect->set_texture("DiffuseTexture", bloom_index == 0 ? rt->source_texture[next_index] @@ -1824,6 +1824,9 @@ d3d_render_target* shaders::get_texture_target(render_primitive *prim, texture_i ? static_cast<int>(prim->get_quad_width() + 0.5f) : static_cast<int>(prim->get_quad_height() + 0.5f); + target_width *= oversampling_enable ? 2 : 1; + target_height *= oversampling_enable ? 2 : 1; + // find render target and check if the size of the target quad has changed d3d_render_target *target = find_render_target(texture); if (target != nullptr && target->target_width == target_width && target->target_height == target_height) @@ -1846,6 +1849,9 @@ d3d_render_target* shaders::get_vector_target(render_primitive *prim) int target_width = static_cast<int>(prim->get_quad_width() + 0.5f); int target_height = static_cast<int>(prim->get_quad_height() + 0.5f); + target_width *= oversampling_enable ? 2 : 1; + target_height *= oversampling_enable ? 2 : 1; + // find render target and check of the size of the target quad has changed d3d_render_target *target = find_render_target(d3d->get_width(), d3d->get_height(), 0, 0); if (target != nullptr && target->target_width == target_width && target->target_height == target_height) @@ -1863,7 +1869,10 @@ void shaders::create_vector_target(render_primitive *prim) int target_width = static_cast<int>(prim->get_quad_width() + 0.5f); int target_height = static_cast<int>(prim->get_quad_height() + 0.5f); - osd_printf_verbose("create_vector_target() - %f, %f; %d, %d\n", prim->get_quad_width(), prim->get_quad_height(), (int)(prim->get_quad_width() + 0.5f), (int)(prim->get_quad_height() + 0.5f)); + target_width *= oversampling_enable ? 2 : 1; + target_height *= oversampling_enable ? 2 : 1; + + osd_printf_verbose("create_vector_target() - %d, %d\n", target_width, target_height); if (!add_render_target(d3d, nullptr, d3d->get_width(), d3d->get_height(), target_width, target_height)) { vector_enable = false; @@ -1970,7 +1979,10 @@ bool shaders::register_texture(render_primitive *prim, texture_info *texture) ? static_cast<int>(prim->get_quad_width() + 0.5f) : static_cast<int>(prim->get_quad_height() + 0.5f); - osd_printf_verbose("register_texture() - %f, %f; %d, %d\n", prim->get_quad_width(), prim->get_quad_height(), (int)(prim->get_quad_width() + 0.5f), (int)(prim->get_quad_height() + 0.5f)); + target_width *= oversampling_enable ? 2 : 1; + target_height *= oversampling_enable ? 2 : 1; + + osd_printf_verbose("register_texture() - %d, %d\n", target_width, target_height); if (!add_render_target(d3d, texture, texture->get_width(), texture->get_height(), target_width, target_height)) { return false; @@ -2605,35 +2617,16 @@ void uniform::update() } case CU_SOURCE_DIMS: { - if (shadersys->curr_texture != nullptr) + if (shadersys->curr_texture) { vec2f sourcedims = shadersys->curr_texture->get_rawdims(); m_shader->set_vector("SourceDims", 2, &sourcedims.c.x); } - else - { - vec2f sourcedims = d3d->get_dims(); - m_shader->set_vector("SourceDims", 2, &sourcedims.c.x); - } - break; - } - case CU_SOURCE_RECT: - { - if (shadersys->curr_texture != nullptr) - { - vec2f delta = shadersys->curr_texture->get_uvstop() - shadersys->curr_texture->get_uvstart(); - m_shader->set_vector("SourceRect", 2, &delta.c.x); - } - else - { - float delta[2] = { 1.0f, 1.0f }; - m_shader->set_vector("SourceRect", 2, delta); - } break; } case CU_TARGET_DIMS: { - if (shadersys->curr_render_target != nullptr) + if (shadersys->curr_render_target) { float targetdims[2] = { static_cast<float>(shadersys->curr_render_target->target_width), @@ -2644,7 +2637,7 @@ void uniform::update() } case CU_QUAD_DIMS: { - if (shadersys->curr_poly != nullptr) + if (shadersys->curr_poly) { float quaddims[2] = { // round diff --git a/src/osd/modules/render/d3d/d3dhlsl.h b/src/osd/modules/render/d3d/d3dhlsl.h index 24e03822e80..a4c9f13b9ed 100644 --- a/src/osd/modules/render/d3d/d3dhlsl.h +++ b/src/osd/modules/render/d3d/d3dhlsl.h @@ -45,7 +45,6 @@ public: { CU_SCREEN_DIMS = 0, CU_SOURCE_DIMS, - CU_SOURCE_RECT, CU_TARGET_DIMS, CU_QUAD_DIMS, @@ -384,6 +383,7 @@ private: bool master_enable; // overall enable flag bool vector_enable; // vector post-processing enable flag + bool oversampling_enable; // oversampling enable flag bool paused; // whether or not rendering is currently paused int num_screens; // number of emulated physical screens int curr_screen; // current screen for render target operations diff --git a/src/osd/modules/render/drawbgfx.cpp b/src/osd/modules/render/drawbgfx.cpp index e54d764412d..3ef04cbf5cf 100644 --- a/src/osd/modules/render/drawbgfx.cpp +++ b/src/osd/modules/render/drawbgfx.cpp @@ -165,7 +165,7 @@ int renderer_bgfx::create() } m_textures = new texture_manager(); - m_targets = new target_manager(options, *m_textures); + m_targets = new target_manager(*m_textures); m_shaders = new shader_manager(options); m_effects = new effect_manager(options, *m_shaders); diff --git a/src/osd/windows/winmain.cpp b/src/osd/windows/winmain.cpp index 96032fef65b..0efb762a079 100644 --- a/src/osd/windows/winmain.cpp +++ b/src/osd/windows/winmain.cpp @@ -277,8 +277,9 @@ const options_entry windows_options::s_option_entries[] = // post-processing options { nullptr, nullptr, OPTION_HEADER, "DIRECT3D POST-PROCESSING OPTIONS" }, - { WINOPTION_HLSL_ENABLE";hlsl", "0", OPTION_BOOLEAN, "enables HLSL post-processing (PS3.0 required)" }, { WINOPTION_HLSLPATH, "hlsl", OPTION_STRING, "path to hlsl files" }, + { WINOPTION_HLSL_ENABLE";hlsl", "0", OPTION_BOOLEAN, "enables HLSL post-processing (PS3.0 required)" }, + { WINOPTION_HLSL_OVERSAMPLING, "0", OPTION_BOOLEAN, "enables HLSL oversampling" }, { WINOPTION_HLSL_WRITE, nullptr, OPTION_STRING, "enables HLSL AVI writing (huge disk bandwidth suggested)" }, { WINOPTION_HLSL_SNAP_WIDTH, "2048", OPTION_STRING, "HLSL upscaled-snapshot width" }, { WINOPTION_HLSL_SNAP_HEIGHT, "1536", OPTION_STRING, "HLSL upscaled-snapshot height" }, diff --git a/src/osd/windows/winmain.h b/src/osd/windows/winmain.h index 786954d4119..dd348ee4491 100644 --- a/src/osd/windows/winmain.h +++ b/src/osd/windows/winmain.h @@ -26,8 +26,9 @@ #define WINOPTION_MENU "menu" // core post-processing options -#define WINOPTION_HLSL_ENABLE "hlsl_enable" #define WINOPTION_HLSLPATH "hlslpath" +#define WINOPTION_HLSL_ENABLE "hlsl_enable" +#define WINOPTION_HLSL_OVERSAMPLING "hlsl_oversampling" #define WINOPTION_HLSL_WRITE "hlsl_write" #define WINOPTION_HLSL_SNAP_WIDTH "hlsl_snap_width" #define WINOPTION_HLSL_SNAP_HEIGHT "hlsl_snap_height" @@ -128,6 +129,7 @@ public: // core post-processing options const char *screen_post_fx_dir() const { return value(WINOPTION_HLSLPATH); } bool d3d_hlsl_enable() const { return bool_value(WINOPTION_HLSL_ENABLE); } + bool d3d_hlsl_oversampling() const { return bool_value(WINOPTION_HLSL_OVERSAMPLING); } const char *d3d_hlsl_write() const { return value(WINOPTION_HLSL_WRITE); } int d3d_snap_width() const { return int_value(WINOPTION_HLSL_SNAP_WIDTH); } int d3d_snap_height() const { return int_value(WINOPTION_HLSL_SNAP_HEIGHT); } |