From e9c1a1e474420b4021265e001eda50e1f8201133 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 15 Mar 2016 11:10:59 +1100 Subject: [PATCH 01/48] Fix use-after-move --- src/emu/fileio.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emu/fileio.cpp b/src/emu/fileio.cpp index b8e0c433575..e0d7cdd7772 100644 --- a/src/emu/fileio.cpp +++ b/src/emu/fileio.cpp @@ -835,11 +835,11 @@ osd_file::error emu_file::attempt__7zped() if (fileno != -1) { m__7zfile = std::move(_7z); - m__7zlength = _7z->current_uncompressed_length(); + m__7zlength = m__7zfile->current_uncompressed_length(); // build a hash with just the CRC m_hashes.reset(); - m_hashes.add_crc(_7z->current_crc()); + m_hashes.add_crc(m__7zfile->current_crc()); return (m_openflags & OPEN_FLAG_NO_PRELOAD) ? osd_file::error::NONE : load__7zped_file(); } From 10df10fa713e16dad6e21926901735230f38f330 Mon Sep 17 00:00:00 2001 From: Lord-Nightmare Date: Mon, 14 Mar 2016 20:49:09 -0400 Subject: [PATCH 02/48] NoteTaker: More floppy hookup, started tracing video writes. [Lord Nightmare] --- src/mame/drivers/notetaker.cpp | 104 +++++++++++++++++++++++---------- 1 file changed, 72 insertions(+), 32 deletions(-) diff --git a/src/mame/drivers/notetaker.cpp b/src/mame/drivers/notetaker.cpp index 3adde2898b3..2caacf9ceda 100644 --- a/src/mame/drivers/notetaker.cpp +++ b/src/mame/drivers/notetaker.cpp @@ -356,10 +356,12 @@ WRITE16_MEMBER(notetaker_state::FIFOBus_w) WRITE16_MEMBER( notetaker_state::DiskReg_w ) { + // See http://bitsavers.trailing-edge.com/pdf/xerox/notetaker/memos/19781023_More_NoteTaker_IO_Information.pdf but note that bit 12 (called bit 3 in documentation) was changed between oct 1978 and 1979 to reset the disk controller digital-PLL as ClrDiskCont' rather than acting as ProgBitClk0, which is permanently wired high instead, meaning only the 4.5Mhz - 18Mhz dot clocks are available for the CRTC. m_ADCSpd0 = (data&0x8000)?1:0; m_ADCSpd1 = (data&0x4000)?1:0; m_StopWordClock_q = (data&0x2000)?1:0; - m_ClrDiskCont_q = (data&0x1000)?1:0; + //if ((!(m_ClrDiskCont_q)) && (data&0x1000)) m_floppy->device_reset(); // reset on rising edge + m_ClrDiskCont_q = (data&0x1000)?1:0; // originally ProgBitClk0, but co-opted later to reset the FDC's external PLL m_ProgBitClk1 = (data&0x0800)?1:0; m_ProgBitClk2 = (data&0x0400)?1:0; m_ProgBitClk3 = (data&0x0200)?1:0; @@ -367,11 +369,40 @@ WRITE16_MEMBER( notetaker_state::DiskReg_w ) m_AnSel2 = (data&0x80)?1:0; m_AnSel1 = (data&0x40)?1:0; m_DriveSel1 = (data&0x20)?1:0; - m_DriveSel2 = (data&0x10)?1:0; - m_DriveSel3 = (data&0x08)?1:0; + m_DriveSel2 = (data&0x10)?1:0; // drive 2 not present on hardware, but could work if present + m_DriveSel3 = (data&0x08)?1:0; // drive 3 not present on hardware, but could work if present m_SideSelect = (data&0x04)?1:0; m_Disk5VOn = (data&0x02)?1:0; m_Disk12VOn = (data&0x01)?1:0; + + // ADC stuff + //TODO + + // FDC stuff + // first handle the motor stuff; we'll clobber whatever was in m_floppy, then reset it to what it should be + m_floppy = m_floppy0->get_device(); + m_floppy->mon_w(!(m_Disk5VOn && m_Disk12VOn)); // Disk5VOn and 12VOn can be thought of as a crude MotorOn signal as the motor won't run with either? of them missing. + //m_floppy = m_floppy0->get_device(); + //m_floppy->mon_w(!(m_Disk5VOn && m_Disk12VOn)); // Disk5VOn and 12VOn can be thought of as a crude MotorOn signal as the motor won't run with either? of them missing. + //m_floppy = m_floppy0->get_device(); + //m_floppy->mon_w(!(m_Disk5VOn && m_Disk12VOn)); // Disk5VOn and 12VOn can be thought of as a crude MotorOn signal as the motor won't run with either? of them missing. + // now restore m_floppy state to what it should be + if (m_DriveSel1) m_floppy = m_floppy0->get_device(); + //else if (m_DriveSel2) m_floppy = m_floppy1->get_device(); + //else if (m_DriveSel3) m_floppy = m_floppy2->get_device(); + else m_floppy = nullptr; + m_fdc->set_floppy(m_floppy); // select the floppy + if (m_floppy) + { + m_floppy->ss_w(m_SideSelect); + } + // Disk5VOn and 12VOn can be thought of as a crude MotorOn signal as the motor won't run with either? of them missing. + //m_floppy0->mon_w(!(m_Disk5VOn && m_Disk12VOn)); + //m_floppy1->mon_w(!(m_Disk5VOn && m_Disk12VOn)); + //m_floppy2->mon_w(!(m_Disk5VOn && m_Disk12VOn)); + + // CRTC clock rate stuff + //TODO } WRITE16_MEMBER( notetaker_state::LoadDispAddr_w ) @@ -557,7 +588,7 @@ static ADDRESS_MAP_START(notetaker_iocpu_io, AS_IO, 16, notetaker_state) AM_RANGE(0x60, 0x61) AM_MIRROR(0x7E1E) AM_WRITE(FIFOReg_w) // DAC sample and hold and frequency setup //AM_RANGE(0xa0, 0xa1) AM_MIRROR(0x7E18) AM_DEVREADWRITE("debug8255", 8255_device, read, write) // debugger board 8255 AM_RANGE(0xc0, 0xc1) AM_MIRROR(0x7E1E) AM_WRITE(FIFOBus_w) // DAC data write to FIFO - AM_RANGE(0x100, 0x101) AM_MIRROR(0x7E1E) AM_WRITE(DiskReg_w) // I/O register (adc speed, crtc pixel clock enable, +5 and +12v relays for floppy, etc) + AM_RANGE(0x100, 0x101) AM_MIRROR(0x7E1E) AM_WRITE(DiskReg_w) // I/O register (adc speed, crtc pixel clock and clock enable, +5 and +12v relays for floppy, etc) AM_RANGE(0x120, 0x127) AM_MIRROR(0x7E18) AM_DEVREADWRITE8("wd1791", fd1791_t, read, write, 0x00FF) // floppy controller AM_RANGE(0x140, 0x15f) AM_MIRROR(0x7E00) AM_DEVREADWRITE8("crt5027", crt5027_device, read, write, 0x00FF) // crt controller AM_RANGE(0x160, 0x161) AM_MIRROR(0x7E1E) AM_WRITE(LoadDispAddr_w) // loads the start address for the display framebuffer @@ -584,8 +615,8 @@ irq7 VSync (interrupt from the VSYN VSync pin from the crt5027) /* writes during boot of io roms v2.0: 0x88 to port 0x020 (PCR; BootSeqDone(1), processor not locked(0), battery charger off(0), rom not disabled(0) correction off&cr4 off(1), cr3 on(0), cr2 on(0), cr1 on (0);) -0x02 to port 0x100 (IOR write: enable 5v only relay control) -0x03 to port 0x100 (IOR write: in addition to above, enable 12v relay control) +0x0002 to port 0x100 (IOR write: enable 5v only relay control) +0x0003 to port 0x100 (IOR write: in addition to above, enable 12v relay control) 0x13 to port 0x000 PIC (ICW1, 8085 vector 0b000[ignored], edge trigger mode, interval of 8, single mode (no cascade/ICW3), ICW4 needed ) 0x08 to port 0x002 PIC (ICW2, T7-T3 = 0b00001) @@ -595,14 +626,14 @@ irq7 VSync (interrupt from the VSYN VSync pin from the crt5027) 0x0000 to port 0x1ae (reset UART) 0x0016 to port 0x048 (kbd control reg write) 0x0005 to port 0x1a8 (UART control reg write) -0x5f to port 0x140 \ -0xf2 to port 0x142 \ -0x7d to port 0x144 \ -0x1d to port 0x146 \_ set up CRTC -0x04 to port 0x148 / -0x10 to port 0x14a / -0x00 to port 0x154 / -0x1e to port 0x15a / +0x5f to port 0x140 (reg0 95 horizontal lines) \ +0xf2 to port 0x142 (reg1 interlaced, hswidth=0xE, hsdelay=2) \ +0x7d to port 0x144 (reg2 16 scans/row, 5 chars/datarow) \ +0x1d to port 0x146 (reg3 0 skew bits, 0x1D datarows/frame) \_ set up CRTC +0x04 to port 0x148 (reg4 4 scan lines/frame / +0x10 to port 0x14a (reg5 0x10 vdatastart) / +0x00 to port 0x154 (reset the crtc) / +0x1e to port 0x15a (reg8 load cursor line address = 0x1e) / 0x0a03 to port 0x100 (IOR write: set bit clock to 12Mhz) 0x2a03 to port 0x100 (IOR write: enable crtc clock chain) 0x00 to port 0x15c (fire off crtc timing chain) @@ -613,8 +644,8 @@ read from 0x44 (byte wide) to check input fifo status ... more stuff here missing relating to making the beep tone through fifo (around pc=6b6) read keyboard uart until mouse button is clicked (WaitNoBug) (around pc=6bc) read keyboard uart until mouse button is released (WaitBug) -0x2a23 to port 0x100 (select drive 2) -0x2a23 to port 0x100 (select drive 2) +0x2a23 to port 0x100 (select drive 1) +0x2a23 to port 0x100 (select drive 1) 0x3a23 to port 0x100 (unset disk separator clear (allow disk head reading)) 0x3a27 to port 0x100 (select disk side 1) 0x3a07 to port 0x100 (unselect all drives) @@ -653,8 +684,12 @@ void notetaker_state::machine_start() // allocate the DAC timer, and set it to fire NEVER. We'll set it up properly in IPReset. m_FIFO_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(notetaker_state::timer_fifoclk),this)); m_FIFO_timer->adjust(attotime::never); - // floppy stuff - m_floppy = NULL; + // FDC: /DDEN is tied permanently LOW so MFM mode is ALWAYS ON + m_fdc->dden_w(0); + // Keyboard UART: /SWE is tied permanently LOW + m_kbduart->set_input_pin(AY31015_SWE, 0); // status word outputs are permanently enabled (pin 16 SFD(SWE) tied low, active) + // EIA UART: /SWE is tied permanently LOW + m_eiauart->set_input_pin(AY31015_SWE, 0); // status word outputs are permanently enabled (pin 16 SFD(SWE) tied low, active) // savestate stuff // TODO: add me! } @@ -669,11 +704,12 @@ void notetaker_state::machine_reset() /* IP Reset; this emulates the IPReset' signal */ void notetaker_state::ip_reset() { - // not-really-reset related, set line on Keybaord UART - m_kbduart->set_input_pin(AY31015_SWE, 0); // status word outputs are permanently enabled (pin 16 SFD(SWE) tied low, active) // reset the Keyboard UART m_kbduart->set_input_pin(AY31015_XR, 0); // MR - pin 21 m_kbduart->set_input_pin(AY31015_XR, 1); // '' + // reset the EIA UART + m_eiauart->set_input_pin(AY31015_XR, 0); // MR - pin 21 + m_eiauart->set_input_pin(AY31015_XR, 1); // '' // reset the IPConReg latch at #f1 m_BootSeqDone = 0; m_ProcLock = 0; @@ -683,6 +719,9 @@ void notetaker_state::ip_reset() m_LedInd6 = 0; m_LedInd7 = 0; m_LedInd8 = 0; + // Clear the DAC FIFO + for (int i=0; i<16; i++) m_outfifo[i] = 0; + m_outfifo_count = m_outfifo_tail_ptr = m_outfifo_head_ptr = 0; // reset the FIFOReg latch at #h9 m_TabletYOn = 0; m_TabletXOn = 0; @@ -692,7 +731,10 @@ void notetaker_state::ip_reset() m_SHConB = 0; m_SHConA = 0; m_SetSH = 0; - // reset the DiskReg latches at #c4 and #b4 on the disk/display controller board + // handle consequences of above + m_FIFO_timer->adjust(attotime::from_hz(((XTAL_960kHz/10)/4)/((m_FrSel0<<3)+(m_FrSel1<<2)+(m_FrSel2<<1)+1))); // FIFO timer is clocked by 960khz divided by 10 (74ls162 decade counter), divided by 4 (mc14568B with divider 1 pins set to 4), divided by 1,3,5,7,9,11,13,15 (or 0,2,4,6,8,10,12,14?) + // todo: handle tablet and sample/hold stuff as well + // reset the DiskReg latches at #c4 and #b4 on the disk/display/eia controller board m_ADCSpd0 = 0; m_ADCSpd1 = 0; m_StopWordClock_q = 0; @@ -709,19 +751,17 @@ void notetaker_state::ip_reset() m_SideSelect = 0; m_Disk5VOn = 0; m_Disk12VOn = 0; - // Clear the DAC FIFO - for (int i=0; i<16; i++) m_outfifo[i] = 0; - m_outfifo_count = m_outfifo_tail_ptr = m_outfifo_head_ptr = 0; - // Reset the DAC Timer - m_FIFO_timer->adjust(attotime::from_hz(((XTAL_960kHz/10)/4)/((m_FrSel0<<3)+(m_FrSel1<<2)+(m_FrSel2<<1)+1))); // FIFO timer is clocked by 960khz divided by 10 (74ls162 decade counter), divided by 4 (mc14568B with divider 1 pins set to 4), divided by 1,3,5,7,9,11,13,15 (or 0,2,4,6,8,10,12,14?) - // stuff on display/eia board also reset by IPReset: + // handle the consequences of the above. + // Disk12VOn probably runs the drive motor, and MotorOn is hard-wired to low/active, so turn the motor for all drives OFF + m_floppy = m_floppy0->get_device(); + m_floppy->mon_w(1); + //m_floppy = m_floppy1->get_device(); + //m_floppy->mon_w(1); + //m_floppy = m_floppy2->get_device(); + //m_floppy->mon_w(1); + m_floppy = nullptr; // select no drive // reset the Framebuffer Display Address: m_DispAddr = 0; - // reset the EIA UART - m_eiauart->set_input_pin(AY31015_XR, 0); // MR - pin 21 - m_eiauart->set_input_pin(AY31015_XR, 1); // '' - // reset the DiskReg latches at #c4 and #b4 on the disk/display/eia board - // write me! } /* EP Reset; this emulates the EPReset' signal */ From 3b5a16983fbca21b91c23eb1b9c174bb8f12ecc7 Mon Sep 17 00:00:00 2001 From: Happy Date: Mon, 14 Mar 2016 19:51:57 -0600 Subject: [PATCH 03/48] N64: Add ability to change reported EEPROM size at runtime Adjust timing for SI <-> PIF DMA. --- src/mame/drivers/n64.cpp | 5 +++++ src/mame/machine/n64.cpp | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/mame/drivers/n64.cpp b/src/mame/drivers/n64.cpp index 770c42a6a09..b4b22a35aca 100644 --- a/src/mame/drivers/n64.cpp +++ b/src/mame/drivers/n64.cpp @@ -111,6 +111,11 @@ static INPUT_PORTS_START( n64 ) PORT_CONFSETTING(0x0000, "Retail") PORT_CONFSETTING(0x0100, "Development") + PORT_CONFNAME(0xC000, 0x8000, "EEPROM Size") + PORT_CONFSETTING(0x0000, "None") + PORT_CONFSETTING(0x8000, "4KB") + PORT_CONFSETTING(0xC000, "16KB") + //Player 1 PORT_START("P1") PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Button A / Left Click") diff --git a/src/mame/machine/n64.cpp b/src/mame/machine/n64.cpp index 32ba2ee627e..b7968787d94 100644 --- a/src/mame/machine/n64.cpp +++ b/src/mame/machine/n64.cpp @@ -1043,7 +1043,7 @@ READ32_MEMBER( n64_periphs::vi_reg_r ) break; case 0x10/4: // VI_CURRENT_REG - ret = (m_screen->vpos() & 0x3FE) + field; // << 1); + ret = (m_screen->vpos() & 0x3FE) + field; break; case 0x14/4: // VI_BURST_REG @@ -1742,7 +1742,7 @@ int n64_periphs::pif_channel_handle_command(int channel, int slength, UINT8 *sda { // Read EEPROM status rdata[0] = 0x00; - rdata[1] = 0x80; + rdata[1] = (machine().root_device().ioport("input")->read() >> 8) & 0xC0; rdata[2] = 0x00; return 0; @@ -2127,9 +2127,7 @@ void n64_periphs::pif_dma(int direction) } } si_status |= 1; - si_dma_timer->adjust(attotime::from_hz(1000)); - //si_status |= 0x1000; - //signal_rcp_interrupt(SI_INTERRUPT); + si_dma_timer->adjust(attotime::from_hz(10000)); } READ32_MEMBER( n64_periphs::si_reg_r ) @@ -2171,6 +2169,7 @@ WRITE32_MEMBER( n64_periphs::si_reg_w ) case 0x18/4: // SI_STATUS_REG si_status = 0; + si_dma_timer->adjust(attotime::never); clear_rcp_interrupt(SI_INTERRUPT); break; From a38db0bcc1680d04cf9938322865882afafa88d4 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 15 Mar 2016 12:57:36 +1100 Subject: [PATCH 04/48] Fix 7z name match, fix VS2015 build --- src/lib/util/aviio.cpp | 2 +- src/lib/util/un7z.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/util/aviio.cpp b/src/lib/util/aviio.cpp index 8483adb24f6..339a4de3231 100644 --- a/src/lib/util/aviio.cpp +++ b/src/lib/util/aviio.cpp @@ -467,10 +467,10 @@ private: , m_saved_avih_offset(0) , m_soundbuf() , m_soundbuf_samples(0) - , m_soundbuf_chansamples{ 0 } , m_soundbuf_chunks(0) , m_soundbuf_frames(0) { + std::fill(std::begin(m_soundbuf_chansamples), std::end(m_soundbuf_chansamples), 0); } avi_stream *get_video_stream(); diff --git a/src/lib/util/un7z.cpp b/src/lib/util/un7z.cpp index 80c0a6bcba6..b05e4623e57 100644 --- a/src/lib/util/un7z.cpp +++ b/src/lib/util/un7z.cpp @@ -431,7 +431,7 @@ void m7z_file_impl::make_utf8_name(int index) out_pos += produced; assert(out_pos < m_utf8_buf.size()); } - m_utf16_buf[out_pos++] = '\0'; + m_utf8_buf[out_pos++] = '\0'; } } // anonymous namespace From 49281dda9962722e71c61f6e04d10fcee4579e61 Mon Sep 17 00:00:00 2001 From: Lord-Nightmare Date: Tue, 15 Mar 2016 02:16:24 -0400 Subject: [PATCH 05/48] Symbolics 3600: more documentation of the FEP pcb from pcb pictures. [Lord Nightmare] --- src/mame/drivers/symbolics.cpp | 66 ++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/src/mame/drivers/symbolics.cpp b/src/mame/drivers/symbolics.cpp index 7818c0363ff..f09c51a99ed 100644 --- a/src/mame/drivers/symbolics.cpp +++ b/src/mame/drivers/symbolics.cpp @@ -36,12 +36,10 @@ Address maps (x = ignored; * = selects address within this range, ? = unknown, 1 a23 a22 a21 a20 a19 a18 a17 a16 a15 a14 a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 (a0 via UDS/LDS) ? ? ? ? ? 0 0 0 0 * * * * * * * * * * * * * * 0 R ROM 00H ? ? ? ? ? 0 0 0 0 * * * * * * * * * * * * * * 1 R ROM 00L -? ? ? ? ? 0 0 0 1 * * * * * * * * * * * * * * 0 R ROM 04H -? ? ? ? ? 0 0 0 1 * * * * * * * * * * * * * * 1 R ROM 04L -? ? ? ? ? 0 0 1 0 x x x x x x x x x x x x x x 0 R Open bus? -? ? ? ? ? 0 0 1 0 x x x x x x x x x x x x x x 1 R Open bus? -? ? ? ? ? 0 0 1 1 * * * * * * * * * * * * * * 0 R ROM 10H -? ? ? ? ? 0 0 1 1 * * * * * * * * * * * * * * 1 R ROM 10L +? ? ? ? ? 0 0 0 1 * * * * * * * * * * * * * * 0 R ROM 04H ?? +? ? ? ? ? 0 0 0 1 * * * * * * * * * * * * * * 1 R ROM 04L ?? +? ? ? ? ? 0 0 1 x * * * * * * * * * * * * * * 0 R ROM 10H ?? +? ? ? ? ? 0 0 1 x * * * * * * * * * * * * * * 1 R ROM 10L ?? ? ? ? ? ? 0 1 * * * * * * * * * * * * * * * * * RW RAM <- recheck this, might be a weird hole between 20000-20fff ? ? ? ? ? ? 1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? * ? Something maps here... | | | | | @@ -49,10 +47,9 @@ a23 a22 a21 a20 a19 a18 a17 a16 a15 a14 a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 static ADDRESS_MAP_START(m68k_mem, AS_PROGRAM, 16, symbolics_state ) ADDRESS_MAP_UNMAP_HIGH - AM_RANGE(0x000000, 0x00ffff) AM_ROM /* ROM */ - // 10000-17fff open bus here? - AM_RANGE(0x018000, 0x01ffff) AM_ROM /* ROM */ - AM_RANGE(0x020000, 0x03ffff) AM_RAM /* Local FEP ram seems to be here? */ + AM_RANGE(0x000000, 0x01ffff) AM_ROM /* ROM */ + AM_RANGE(0x020000, 0x03ffff) AM_RAM /* Local FEP ram seems to be here? there are 18 mcm4164s on the pcb which probably map here, plus 2 parity bits? */ + AM_RANGE(0x800000, 0xffffff) AM_RAM /* paged access to lispm ram? */ // there is stuff mapped at 40000 and ffxxx as well, ffxxx may be the main lisp cpu's microcode and macrocode areas ADDRESS_MAP_END @@ -93,7 +90,8 @@ DRIVER_INIT_MEMBER(symbolics_state,symbolics) static MACHINE_CONFIG_START( symbolics, symbolics_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, 10000000) /* PLACEHOLDER CLOCK, TODO: add correct clock */ + //XTALS: 16MHz @H11, 4.9152MHz @J5, 66.67MHz @J10 + MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz/2) /* MC68000L8 @A27; clock is guessed to be derived from the 16Mhz xtal @ H11 */ MCFG_CPU_PROGRAM_MAP(m68k_mem) MCFG_CPU_IO_MAP(m68k_io) @@ -106,13 +104,45 @@ MACHINE_CONFIG_END ROM_START( s3600 ) ROM_REGION16_BE(0x40000,"maincpu", 0) ROM_SYSTEM_BIOS( 0, "v127", "Symbolics 3600 L-Machine FEP V127") - ROMX_LOAD("00h.127.27128.d13", 0x00000, 0x4000, CRC(b8d7c8da) SHA1(663a09359f5db63beeac00e5c2783ccc25b94250), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "00H.127" - ROMX_LOAD("00l.127.27c128.d7", 0x00001, 0x4000, CRC(cc7bae9a) SHA1(057538eb821c4d00dde19cfe5136ccc0aee43800), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "00L.127" - ROMX_LOAD("04h.127.27c128.d15", 0x08000, 0x4000, CRC(e01a717b) SHA1(b87a670f7be13553485ce88fad5fcf90f01473c4), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "04H.127" - ROMX_LOAD("04l.127.27c128.d9", 0x08001, 0x4000, CRC(68d169fa) SHA1(d6fab3132fca332a9bedb174fddf5fc8c69d05b6), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "04L.127" - ROMX_LOAD("10h.127.27c128.d16", 0x18000, 0x4000, CRC(2ea7a70d) SHA1(61cc97aada028612c24d788d946d77e82116cf30), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "10H.127" - ROMX_LOAD("10l.127.27128.d10", 0x18001, 0x4000, CRC(b8ddb3c8) SHA1(e6c3b96340c5c767ef18abf48b73fa8e5d7353b9), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "10L.127" + ROMX_LOAD("00h.127.27c128.d13", 0x00000, 0x4000, CRC(b8d7c8da) SHA1(663a09359f5db63beeac00e5c2783ccc25b94250), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "00H.127" @D13 + ROMX_LOAD("00l.127.27128.d7", 0x00001, 0x4000, CRC(cc7bae9a) SHA1(057538eb821c4d00dde19cfe5136ccc0aee43800), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "00L.127" @D7 + ROMX_LOAD("04h.127.27128.d14", 0x08000, 0x4000, CRC(e01a717b) SHA1(b87a670f7be13553485ce88fad5fcf90f01473c4), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "04H.127" @D14 + ROMX_LOAD("04l.127.27128.d8", 0x08001, 0x4000, CRC(68d169fa) SHA1(d6fab3132fca332a9bedb174fddf5fc8c69d05b6), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "04L.127" @D8 + ROMX_LOAD("10h.127.27128.d16", 0x10000, 0x4000, CRC(2ea7a70d) SHA1(61cc97aada028612c24d788d946d77e82116cf30), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "10H.127" @D16 + ROMX_LOAD("10l.127.27c128.d10", 0x10001, 0x4000, CRC(b8ddb3c8) SHA1(e6c3b96340c5c767ef18abf48b73fa8e5d7353b9), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "10L.127" @D10 + ROMX_LOAD("10h.127.27128.d16", 0x18000, 0x4000, CRC(2ea7a70d) SHA1(61cc97aada028612c24d788d946d77e82116cf30), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "10H.127" @D16 + ROMX_LOAD("10l.127.27c128.d10", 0x18001, 0x4000, CRC(b8ddb3c8) SHA1(e6c3b96340c5c767ef18abf48b73fa8e5d7353b9), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "10L.127" @D10 + // D17, D11 are empty sockets, // note: load all the PLAs, PALs and PROMs here + /* + LBBUFA.4 mb7124 @A6 + LBBUFB.4 mb7124 @A7 + LBBUFC.4 mb7124 @A9 + LBAAR.4 @A12 + LBPAR.4A @A13 + PROCA.4 pal16R8A @A25 + HSADR.4 pal1???? @C4 + DYNMEM.5 pal16R8A @C20 + ?EDVAL.4? @C21 <- recheck this label! very faded + REQSEL.4A @C22 + DY2ACK pal16L8A @C23 + PROC.4 pal? @C25 + UDMDMA.4 pal? @D2 + FEP 4642 16pprom? @D4 + HRSQ.4 pal @D5 + d7, d8, d10 are eproms, see above + d11 is empty socket marked 2764 + d13, d14, d16 are eproms, see above + d17 is empty socket marked 2764 + ???????? @E21 <- unreadable label + LDBD.4 pal16L8A @G18 + PAGTAG.5 @H20 + UDMABC.4 pal @I3 + SERDMA.4 @I7 + SERIAB.4 @I8 + LBARB.4 @I18 + SERCTL.4 @K5 + */ ROM_END /****************************************************************************** @@ -120,4 +150,4 @@ ROM_END ******************************************************************************/ /* YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME FLAGS */ -COMP( 1984, s3600, 0, 0, symbolics, symbolics, symbolics_state, symbolics, "Symbolics", "3600", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +COMP( 1984, s3600, 0, 0, symbolics, symbolics, symbolics_state, symbolics, "Symbolics", "3600", MACHINE_IS_SKELETON | MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) From f5caa4a8695863aee50392e3039c63fad7a5831a Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 15 Mar 2016 11:07:52 +0100 Subject: [PATCH 06/48] tms1k: make disasm tables human-readable and added initial TP0320 --- src/devices/cpu/tms0980/tms0980.cpp | 6 + src/devices/cpu/tms0980/tms0980.h | 1 + src/devices/cpu/tms0980/tms0980d.cpp | 458 +++++++++++---------------- src/tools/unidasm.cpp | 2 + 4 files changed, 197 insertions(+), 270 deletions(-) diff --git a/src/devices/cpu/tms0980/tms0980.cpp b/src/devices/cpu/tms0980/tms0980.cpp index 3ea3ca918b1..feddc785eda 100644 --- a/src/devices/cpu/tms0980/tms0980.cpp +++ b/src/devices/cpu/tms0980/tms0980.cpp @@ -491,6 +491,12 @@ offs_t tms0980_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UIN return CPU_DISASSEMBLE_NAME(tms0980)(this, buffer, pc, oprom, opram, options); } +offs_t tp0320_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +{ + extern CPU_DISASSEMBLE(tp0320); + return CPU_DISASSEMBLE_NAME(tp0320)(this, buffer, pc, oprom, opram, options); +} + void tms1xxx_cpu_device::state_string_export(const device_state_entry &entry, std::string &str) const { switch (entry.index()) diff --git a/src/devices/cpu/tms0980/tms0980.h b/src/devices/cpu/tms0980/tms0980.h index c253d28ee40..f8b78481310 100644 --- a/src/devices/cpu/tms0980/tms0980.h +++ b/src/devices/cpu/tms0980/tms0980.h @@ -489,6 +489,7 @@ protected: // overrides //virtual void device_start() override; //virtual void device_reset() override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; //virtual machine_config_constructor device_mconfig_additions() const override; }; diff --git a/src/devices/cpu/tms0980/tms0980d.cpp b/src/devices/cpu/tms0980/tms0980d.cpp index 371047b0a79..6f14e1172fd 100644 --- a/src/devices/cpu/tms0980/tms0980d.cpp +++ b/src/devices/cpu/tms0980/tms0980d.cpp @@ -13,26 +13,26 @@ enum e_mnemonics { - zA10AAC=0, zA6AAC, zA8AAC, zAC1AC, zACACC, zACNAA, zALEC, zALEM, zAMAAC, zBRANCH, zCALL, zCCLA, + zILL = 0, + zA10AAC, zA6AAC, zA8AAC, zAC1AC, zACACC, zACNAA, zALEC, zALEM, zAMAAC, zBRANCH, zCALL, zCCLA, zCLA, zCLO, zCOMC, zCOMX, zCOMX8, zCPAIZ, zCTMDYN, zDAN, zDMAN, zDMEA, zDNAA, - zDYN, zIA, zIMAC, zIYC, zKNEZ, zLDP, zLDX, zLDX3, zLDX4, zMNEA, zMNEZ, + zDYN, zIA, zIMAC, zIYC, zKNEZ, zLDP, zLDX2, zLDX3, zLDX4, zMNEA, zMNEZ, zNDMEA, zOFF, zRBIT, zREAC, zRETN, zRSTR, zSAL, zSAMAN, zSBIT, zSBL, zSEAC, zSETR, zTAM, zTAMACS, zTAMDYN, zTAMIY, zTAMIYC, zTAMZA, zTAY, zTBIT, zTCMIY, zTCY, zTDO, zTKA, zTKM, zTMA, - zTMY, zTYA, zXDA, zXMA, zYMCY, zYNEA, zYNEC, - zILL + zTMY, zTYA, zXDA, zXMA, zYMCY, zYNEA, zYNEC }; static const char *const s_mnemonic[] = { + "?", "A10AAC", "A6AAC", "A8AAC", "AC1AC", "ACACC", "ACNAA", "ALEC", "ALEM", "AMAAC", "BRANCH", "CALL", "CCLA", "CLA", "CLO", "COMC", "COMX", "COMX8", "CPAIZ", "CTMDYN", "DAN", "DMAN", "DMEA", "DNAA", "DYN", "IA", "IMAC", "IYC", "KNEZ", "LDP", "LDX", "LDX", "LDX", "MNEA", "MNEZ", "NDMEA", "OFF", "RBIT", "REAC", "RETN", "RSTR", "SAL", "SAMAN", "SBIT", "SBL", "SEAC", "SETR", "TAM", "TAMACS", "TAMDYN", "TAMIY", "TAMIYC", "TAMZA", "TAY", "TBIT", "TCMIY", "TCY", "TDO", "TKA", "TKM", "TMA", - "TMY", "TYA", "XDA", "XMA", "YMCY", "YNEA", "YNEC", - "?" + "TMY", "TYA", "XDA", "XMA", "YMCY", "YNEA", "YNEC" }; @@ -41,323 +41,241 @@ static const char *const s_mnemonic[] = static const UINT32 s_flags[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _OVER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _OUT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0 + 0, 0, 0, 0, 0, 0, 0 }; enum e_addressing { - zB0=0, zI2, zI3, zI4, zB7 + zB0 = 0, zI2, zI3, zI4, zB7 }; static const UINT8 s_addressing[] = { + zB0, zB0, zB0, zB0, zI4, zI4, zI4, zI4, zB0, zB0, zB7, zB7, zB0, zB0, zB0, zB0, zB0, zB0, zB0, zB0, zB0, zB0, zB0, zB0, zB0, zB0, zB0, zB0, zB0, zI4, zI2, zI3, zI4, zB0, zB0, zB0, zB0, zI2, zB0, zB0, zB0, zB0, zB0, zI2, zB0, zB0, zB0, zB0, zI4, zB0, zB0, zB0, zB0, zB0, zI2, zI4, zI4, zB0, zB0, zB0, zB0, - zB0, zB0, zB0, zB0, zI4, zB0, zI4, - zB0 -}; - - -static const UINT8 tms0980_i2_value[4] = -{ - 0, 2, 1, 3 -}; -static const UINT8 tms0980_i3_value[8] = -{ - 0, 4, 2, 6, 1, 5, 3, 7 -}; -static const UINT8 tms0980_i4_value[16] = -{ - 0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe, 0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf + zB0, zB0, zB0, zB0, zI4, zB0, zI4 }; // opcode luts -static const UINT8 tms0980_mnemonic[512] = -{ - /* 0x000 */ - zCOMX, zALEM, zYNEA, zXMA, zDYN, zIYC, zCLA, zDMAN, - zTKA, zMNEA, zTKM, zILL, zILL, zSETR, zKNEZ, zILL, - /* 0x010 */ - zDMEA, zDNAA, zCCLA, zNDMEA, zILL, zAMAAC, zILL, zILL, - zCTMDYN, zXDA, zILL, zILL, zILL, zILL, zILL, zILL, - /* 0x020 */ - zTBIT, zTBIT, zTBIT, zTBIT, zILL, zILL, zILL, zILL, - zTAY, zTMA, zTMY, zTYA, zTAMDYN, zTAMIYC, zTAMZA, zTAM, - /* 0x030 */ - zSAMAN, zCPAIZ, zIMAC, zMNEZ, zILL, zILL, zILL, zILL, - zTCY, zYNEC, zTCMIY, zACACC, zACNAA, zTAMACS, zALEC, zYMCY, - /* 0x040 */ - zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, - zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, - /* 0x050 */ - zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, - zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, - /* 0x060 */ - zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, - zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, - /* 0x070 */ - zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, - zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, - /* 0x080 */ - zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, - zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, - /* 0x090 */ - zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, - zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, - /* 0x0A0 */ - zSBIT, zSBIT, zSBIT, zSBIT, zRBIT, zRBIT, zRBIT, zRBIT, - zILL, zILL, zILL, zILL, zILL, zILL, zILL, zILL, - /* 0x0B0 */ - zTDO, zSAL, zCOMX8, zSBL, zREAC, zSEAC, zOFF, zILL, - zILL, zILL, zILL, zILL, zILL, zILL, zILL, zRETN, - /* 0x0C0 */ - zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, - zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, - /* 0x0D0 */ - zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, - zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, - /* 0x0E0 */ - zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, - zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, - /* 0x0F0 */ - zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, - zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, - /* 0x100 */ - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - /* 0x180 */ - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL -}; - - static const UINT8 tms1000_mnemonic[256] = { - /* 0x00 */ - zCOMX, zA8AAC, zYNEA, zTAM, zTAMZA, zA10AAC, zA6AAC, zDAN, - zTKA, zKNEZ, zTDO, zCLO, zRSTR, zSETR, zIA, zRETN, - zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, - zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, - zTAMIY, zTMA, zTMY, zTYA, zTAY, zAMAAC, zMNEZ, zSAMAN, - zIMAC, zALEM, zDMAN, zIYC, zDYN, zCPAIZ, zXMA, zCLA, - zSBIT, zSBIT, zSBIT, zSBIT, zRBIT, zRBIT, zRBIT, zRBIT, - zTBIT, zTBIT, zTBIT, zTBIT, zLDX, zLDX, zLDX, zLDX, - /* 0x40 */ - zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, - zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, - zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, - zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, - zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, - zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, - zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, - zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, - /* 0x80 */ - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - /* 0xc0 */ - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL +/* 0x00 */ + zCOMX, zA8AAC, zYNEA, zTAM, zTAMZA, zA10AAC, zA6AAC, zDAN, zTKA, zKNEZ, zTDO, zCLO, zRSTR, zSETR, zIA, zRETN, // 0 + zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, // 1 + zTAMIY, zTMA, zTMY, zTYA, zTAY, zAMAAC, zMNEZ, zSAMAN, zIMAC, zALEM, zDMAN, zIYC, zDYN, zCPAIZ, zXMA, zCLA, // 2 + zSBIT, zSBIT, zSBIT, zSBIT, zRBIT, zRBIT, zRBIT, zRBIT, zTBIT, zTBIT, zTBIT, zTBIT, zLDX2, zLDX2, zLDX2, zLDX2, // 3 + zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, // 4 + zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, // 5 + zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, // 6 + zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, // 7 +/* 0x80 */ + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 8 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 9 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // A + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // B + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // C + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // D + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // E + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL // F +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ }; static const UINT8 tms1100_mnemonic[256] = { - /* 0x00 */ - zMNEA, zALEM, zYNEA, zXMA, zDYN, zIYC, zAMAAC, zDMAN, - zTKA, zCOMX, zTDO, zCOMC, zRSTR, zSETR, zKNEZ, zRETN, - zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, - zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, - /* 0x20 */ - zTAY, zTMA, zTMY, zTYA, zTAMDYN, zTAMIYC, zTAMZA, zTAM, - zLDX3, zLDX3, zLDX3, zLDX3, zLDX3, zLDX3, zLDX3, zLDX3, - zSBIT, zSBIT, zSBIT, zSBIT, zRBIT, zRBIT, zRBIT, zRBIT, - zTBIT, zTBIT, zTBIT, zTBIT, zSAMAN, zCPAIZ, zIMAC, zMNEZ, - /* 0x40 */ - zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, - zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, - zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, - zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, - /* 0x60 */ - zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, - zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, - zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, - zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zCLA, - /* 0x80 */ - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, - /* 0xC0 */ - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, - zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, +/* 0x00 */ + zMNEA, zALEM, zYNEA, zXMA, zDYN, zIYC, zAMAAC, zDMAN, zTKA, zCOMX, zTDO, zCOMC, zRSTR, zSETR, zKNEZ, zRETN, // 0 + zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, // 1 + zTAY, zTMA, zTMY, zTYA, zTAMDYN, zTAMIYC, zTAMZA, zTAM, zLDX3, zLDX3, zLDX3, zLDX3, zLDX3, zLDX3, zLDX3, zLDX3, // 2 + zSBIT, zSBIT, zSBIT, zSBIT, zRBIT, zRBIT, zRBIT, zRBIT, zTBIT, zTBIT, zTBIT, zTBIT, zSAMAN, zCPAIZ, zIMAC, zMNEZ, // 3 + zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, // 4 + zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, // 5 + zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, // 6 + zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zAC1AC, zCLA, // 7 +/* 0x80 */ + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 8 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 9 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // A + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // B + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // C + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // D + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // E + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL // F +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ +}; + + +static const UINT8 tms0980_mnemonic[512] = +{ +/* 0x000 */ + zCOMX, zALEM, zYNEA, zXMA, zDYN, zIYC, zCLA, zDMAN, zTKA, zMNEA, zTKM, 0, 0, zSETR, zKNEZ, 0, // 0 + zDMEA, zDNAA, zCCLA, zNDMEA, 0, zAMAAC, 0, 0, zCTMDYN, zXDA, 0, 0, 0, 0, 0, 0, // 1 + zTBIT, zTBIT, zTBIT, zTBIT, 0, 0, 0, 0, zTAY, zTMA, zTMY, zTYA, zTAMDYN, zTAMIYC, zTAMZA, zTAM, // 2 + zSAMAN, zCPAIZ, zIMAC, zMNEZ, 0, 0, 0, 0, zTCY, zYNEC, zTCMIY, zACACC, zACNAA, zTAMACS, zALEC, zYMCY, // 3 + zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, // 4 + zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, // 5 + zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, // 6 + zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, // 7 +/* 0x080 */ + zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, // 8 + zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, // 9 + zSBIT, zSBIT, zSBIT, zSBIT, zRBIT, zRBIT, zRBIT, zRBIT, 0, 0, 0, 0, 0, 0, 0, 0, // A + zTDO, zSAL, zCOMX8, zSBL, zREAC, zSEAC, zOFF, 0, 0, 0, 0, 0, 0, 0, 0, zRETN, // B + zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, // C + zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, // D + zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, // E + zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, // F +/* 0x100 */ + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 0 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 1 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 2 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 3 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 4 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 5 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 6 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 7 +/* 0x180 */ + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // 8 + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // 9 + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // A + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // B + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // C + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // D + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // E + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL // F +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ +}; + + +static const UINT8 tp0320_mnemonic[512] = +{ +/* 0x000 */ + 0, zALEM, zYNEA, zXMA, zDYN, zIYC, zCLA, zDMAN, zTKA, zMNEA, zTKM, 0, 0, 0, zKNEZ, 0, // 0 + zDMEA, zDNAA, zCCLA, zNDMEA, 0, zAMAAC, 0, 0, zCTMDYN, zXDA, 0, 0, 0, 0, 0, 0, // 1 + zTBIT, zTBIT, zTBIT, zTBIT, 0, 0, 0, 0, zTAY, zTMA, zTMY, zTYA, zTAMDYN, zTAMIYC, zTAMZA, zTAM, // 2 + zSAMAN, zCPAIZ, zIMAC, zMNEZ, 0, 0, 0, zYMCY, zTCY, zYNEC, zTCMIY, zACACC, zACNAA, zTAMACS, zALEC, 0, // 3 + zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, // 4 + zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, // 5 + zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, // 6 + zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, zACACC, // 7 +/* 0x080 */ + zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, zLDP, // 8 + zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, zLDX4, // 9 + zSBIT, zSBIT, zSBIT, zSBIT, zRBIT, zRBIT, zRBIT, zRBIT, 0, 0, 0, 0, 0, 0, 0, 0, // A + zTDO, zSAL, zCOMX8, zSBL, zREAC, zSEAC, zOFF, 0, 0, 0, 0, 0, 0, 0, 0, zRETN, // B + zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, zACNAA, // C + zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, zTAMACS, // D + zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, zALEC, // E + zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, zYMCY, // F +/* 0x100 */ + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 0 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 1 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 2 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 3 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 4 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 5 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 6 + zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, zBRANCH, // 7 +/* 0x180 */ + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // 8 + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // 9 + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // A + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // B + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // C + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // D + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, // E + zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL, zCALL // F +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ }; // disasm -CPU_DISASSEMBLE( tms0980 ) +static const UINT8 i2_value[4] = { - char *dst = buffer; - UINT16 op, instr; + 0, 2, 1, 3 +}; + +static const UINT8 i3_value[8] = +{ + 0, 4, 2, 6, 1, 5, 3, 7 +}; + +static const UINT8 i4_value[16] = +{ + 0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe, 0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf +}; + +static offs_t tms1k_dasm(char *dst, const UINT8 *oprom, const UINT8 *lut_mnemonic, UINT16 opcode_mask) +{ + // get current opcode int pos = 0; - - op = ( ( oprom[pos] << 8 ) | oprom[pos + 1] ) & 0x01FF; - pos += 2; - - instr = tms0980_mnemonic[op]; - - dst += sprintf( dst, "%-8s ", s_mnemonic[instr] ); + UINT16 op = oprom[pos++]; + if (opcode_mask & 0x100) + op = (op << 8 | oprom[pos++]) & 0x1ff; + + // convert to mnemonic/param + UINT16 instr = lut_mnemonic[op]; + dst += sprintf(dst, "%-8s ", s_mnemonic[instr]); switch( s_addressing[instr] ) { - default: - case zB0: - break; - case zI2: - dst += sprintf( dst, "%d", tms0980_i2_value[ op & 0x03 ] ); - break; - case zI4: - dst += sprintf( dst, "%d", tms0980_i4_value[ op & 0x0F ] ); - break; - case zB7: - dst += sprintf( dst, "$%02X", ( op & 0x7F ) << 1 ); - break; + case zI2: + dst += sprintf(dst, "%d", i2_value[op & 0x03]); + break; + case zI3: + dst += sprintf(dst, "%d", i3_value[op & 0x07]); + break; + case zI4: + dst += sprintf(dst, "%d", i4_value[op & 0x0f]); + break; + case zB7: + if (opcode_mask & 0x100) + dst += sprintf(dst, "$%02X", op << 1 & 0xfe); + else + dst += sprintf(dst, "$%02X", op & 0x3f); + break; + default: + break; } return pos | s_flags[instr] | DASMFLAG_SUPPORTED; } -CPU_DISASSEMBLE( tms1000 ) +CPU_DISASSEMBLE(tms1000) { - char *dst = buffer; - UINT8 op, instr; - int pos = 0; - - op = oprom[pos]; - pos += 1; - - instr = tms1000_mnemonic[op]; - - dst += sprintf( dst, "%-8s ", s_mnemonic[instr] ); - - switch( s_addressing[instr] ) - { - default: - case zB0: - break; - case zI2: - dst += sprintf( dst, "%d", tms0980_i2_value[ op & 0x03 ] ); - break; - case zI4: - dst += sprintf( dst, "%d", tms0980_i4_value[ op & 0x0F ] ); - break; - case zB7: - dst += sprintf( dst, "$%02X", ( op & 0x3F ) ); - break; - } - - return pos | s_flags[instr] | DASMFLAG_SUPPORTED; + return tms1k_dasm(buffer, oprom, tms1000_mnemonic, 0xff); } - -CPU_DISASSEMBLE( tms1100 ) +CPU_DISASSEMBLE(tms1100) { - char *dst = buffer; - UINT8 op, instr; - int pos = 0; - - op = oprom[pos]; - pos += 1; - - instr = tms1100_mnemonic[op]; - - dst += sprintf( dst, "%-8s ", s_mnemonic[instr] ); - - switch( s_addressing[instr] ) - { - default: - case zB0: - break; - case zI2: - dst += sprintf( dst, "%d", tms0980_i2_value[ op & 0x03 ] ); - break; - case zI3: - dst += sprintf( dst, "%d", tms0980_i3_value[ op & 0x07 ] ); - break; - case zI4: - dst += sprintf( dst, "%d", tms0980_i4_value[ op & 0x0F ] ); - break; - case zB7: - dst += sprintf( dst, "$%02X", ( op & 0x3F ) ); - break; - } - - return pos | s_flags[instr] | DASMFLAG_SUPPORTED; + return tms1k_dasm(buffer, oprom, tms1100_mnemonic, 0xff); +} + +CPU_DISASSEMBLE(tms0980) +{ + return tms1k_dasm(buffer, oprom, tms0980_mnemonic, 0x1ff); +} + +CPU_DISASSEMBLE(tp0320) +{ + return tms1k_dasm(buffer, oprom, tp0320_mnemonic, 0x1ff); } diff --git a/src/tools/unidasm.cpp b/src/tools/unidasm.cpp index bf0d7c42959..59cce01ad29 100644 --- a/src/tools/unidasm.cpp +++ b/src/tools/unidasm.cpp @@ -181,6 +181,7 @@ CPU_DISASSEMBLE( tms7000 ); CPU_DISASSEMBLE( tms9900 ); CPU_DISASSEMBLE( tms9980 ); CPU_DISASSEMBLE( tms9995 ); +CPU_DISASSEMBLE( tp0320 ); CPU_DISASSEMBLE( tx0_64kw ); CPU_DISASSEMBLE( tx0_8kw ); CPU_DISASSEMBLE( ucom4 ); @@ -333,6 +334,7 @@ static const dasm_table_entry dasm_table[] = { "tms9900", _16be, 0, CPU_DISASSEMBLE_NAME(tms9900) }, { "tms9980", _8bit, 0, CPU_DISASSEMBLE_NAME(tms9980) }, { "tms9995", _8bit, 0, CPU_DISASSEMBLE_NAME(tms9995) }, + { "tp0320", _16be, 0, CPU_DISASSEMBLE_NAME(tp0320) }, { "tx0_64kw", _32be, -2, CPU_DISASSEMBLE_NAME(tx0_64kw) }, { "tx0_8kw", _32be, -2, CPU_DISASSEMBLE_NAME(tx0_8kw) }, { "ucom4", _8bit, 0, CPU_DISASSEMBLE_NAME(ucom4) }, From bf72bef707ee9d1f453effb4334ca7ef4b82e00e Mon Sep 17 00:00:00 2001 From: David Haywood Date: Tue, 15 Mar 2016 11:26:47 +0000 Subject: [PATCH 07/48] new clones Crazy Climber (Spanish, Rodmar bootleg) [A.R.P.A.] Buccaneers (set 3, harder) [system11] --- src/mame/drivers/cclimber.cpp | 32 ++++++++++++++ src/mame/drivers/vigilant.cpp | 82 +++++++++++++++++++++++++---------- src/mame/mame.lst | 2 + 3 files changed, 93 insertions(+), 23 deletions(-) diff --git a/src/mame/drivers/cclimber.cpp b/src/mame/drivers/cclimber.cpp index bc924df4980..f8b89ed07b2 100644 --- a/src/mame/drivers/cclimber.cpp +++ b/src/mame/drivers/cclimber.cpp @@ -1382,6 +1382,37 @@ ROM_START( cclimbroper ) ROM_END +ROM_START( cclimbrrod ) + ROM_REGION( 0x6000, "maincpu", 0 ) + ROM_LOAD( "cc5.bin", 0x0000, 0x1000, CRC(a67238e9) SHA1(f873b754f658f32e2462b63544cbb7f0866e23ff) ) + ROM_LOAD( "cc4.bin", 0x1000, 0x1000, CRC(4b1abea6) SHA1(eae7c96fc0b64d313bed4a75bd6d397b37eaac7e) ) + ROM_LOAD( "cc3.bin", 0x2000, 0x1000, CRC(5612bb3c) SHA1(213846bb3393467260f401b00b821cbab7ac9636) ) + ROM_LOAD( "cc2.bin", 0x3000, 0x1000, CRC(653cebc4) SHA1(c0b664389f7a6f58e880ba0870118aa26c636a37) ) + ROM_LOAD( "cc1.bin", 0x4000, 0x1000, CRC(3fcf912b) SHA1(d540895018bc409ae011ce5841c8c5384bbbb1b9) ) + + ROM_REGION( 0x4000, "gfx1", 0 ) + ROM_LOAD( "cc13.bin", 0x0000, 0x0800, CRC(8e0299f5) SHA1(77aa4fd6ee2177971753168bad6eac33034d3fb9) ) + /* 0x0800-0x0fff - empty */ + ROM_LOAD( "cc12.bin", 0x1000, 0x0800, CRC(e8cd7b53) SHA1(d4d6120fa14016e197340e8d1eb1141f0eb0eee8) ) + /* 0x1800-0xffff - empty */ + ROM_LOAD( "cc11.bin", 0x2000, 0x0800, CRC(921ebd9a) SHA1(95873fcab5da5e4affacdb6c3cab12b305f4b9fd) ) + /* 0x2800-0x2fff - empty */ + ROM_LOAD( "cc10.bin", 0x3000, 0x0800, CRC(8ab5fa6b) SHA1(ff31d2c89fe8cd5a276247b11418fb60de03804c)) + /* 0x3800-0x3fff - empty */ + + ROM_REGION( 0x1000, "gfx2", 0 ) + ROM_LOAD( "cc9.bin", 0x0000, 0x0800, CRC(6fb2afaf) SHA1(d2fe31d00af10e6bcabef51885ce52fb17d1bfbc) ) + ROM_LOAD( "cc8.bin", 0x0800, 0x0800, CRC(227ee804) SHA1(0cda61a0ceeab299e7d40d33bf6dad3490928323) ) + + ROM_REGION( 0x2000, "samples", 0 ) /* samples */ + ROM_LOAD( "cc7.cpu", 0x0000, 0x1000, CRC(5f0bcdfb) SHA1(7f79bf6de117348f606696ed7ea1937bbf926612) ) + ROM_LOAD( "cc6.cpu", 0x1000, 0x1000, CRC(9003ffbd) SHA1(fd016056aabc23957643f37230f03842294f795e) ) + + ROM_REGION( 0x0060, "proms", 0 ) // NOT verified on this board + ROM_LOAD( "cclimber.pr1", 0x0000, 0x0020, CRC(751c3325) SHA1(edce2bc883996c1d72dc6c1c9f62799b162d415a) ) + ROM_LOAD( "cclimber.pr2", 0x0020, 0x0020, CRC(ab1940fa) SHA1(8d98e05cbaa6f55770c12e0a9a8ed9c73cc54423) ) + ROM_LOAD( "cclimber.pr3", 0x0040, 0x0020, CRC(71317756) SHA1(1195f0a037e379cc1a3c0314cb746f5cd2bffe50) ) +ROM_END /* Sets below are Crazy Kong Part II and have an extra screen in attract mode, showing a caged Kong and copyright */ @@ -2516,6 +2547,7 @@ GAME( 1980, ccboot, cclimber, cclimberx, cclimber, cclimber_state, cclimber GAME( 1980, ccboot2, cclimber, cclimberx, cclimber, cclimber_state, cclimberj,ROT0, "bootleg", "Crazy Climber (bootleg set 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1980, ccbootmr, cclimber, cclimberx, cclimber, cclimber_state, cclimberj,ROT0, "bootleg (Model Racing)", "Crazy Climber (Model Racing bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 1980, cclimbroper, cclimber, cclimber, cclimber, driver_device, 0, ROT0, "bootleg (Operamatic)", "Crazy Climber (Spanish, Operamatic bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1980, cclimbrrod, cclimber, cclimber, cclimber, driver_device, 0, ROT0, "bootleg (Rodmar)", "Crazy Climber (Spanish, Rodmar bootleg)", MACHINE_SUPPORTS_SAVE ) /* these sets have ugly colours, no extra attract screen, and no graphics for the extra attract screen in the BG roms - there is a Falcon logo in the text roms which is unused diff --git a/src/mame/drivers/vigilant.cpp b/src/mame/drivers/vigilant.cpp index 239a7c85a53..35053e8f5e2 100644 --- a/src/mame/drivers/vigilant.cpp +++ b/src/mame/drivers/vigilant.cpp @@ -1005,30 +1005,30 @@ ROM_END ROM_START( buccanrs ) ROM_REGION( 0x30000, "maincpu", 0 ) /* 64k for code + 128k for bankswitching */ - ROM_LOAD( "11.u58", 0x00000, 0x10000, CRC(bf1d7e6f) SHA1(55dcf993515b57c3eb1fab98097a2171df3e38ed) ) // both halves are identical (correct for rom type on this board tho) - ROM_LOAD( "12.u25", 0x10000, 0x10000, CRC(87303ba8) SHA1(49a25393e853b9adf7df00a6f9c38a526a02ea4e) ) + ROM_LOAD( "BC-011_K-163.U58", 0x00000, 0x10000, CRC(bf1d7e6f) SHA1(55dcf993515b57c3eb1fab98097a2171df3e38ed) ) // both halves are identical (correct for rom type on this board tho) + ROM_LOAD( "BC-012_K-163.U25", 0x10000, 0x10000, CRC(87303ba8) SHA1(49a25393e853b9adf7df00a6f9c38a526a02ea4e) ) ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for sound */ - ROM_LOAD( "1.u128", 0x00000, 0x10000, CRC(eb65f8c3) SHA1(82566becb630ce92303905dc0c5bef9e80e9caad) ) + ROM_LOAD( "BC-001_K-0161.U128", 0x00000, 0x10000, CRC(eb65f8c3) SHA1(82566becb630ce92303905dc0c5bef9e80e9caad) ) ROM_REGION( 0x20000, "gfx1", 0 ) - ROM_LOAD( "7.u212", 0x00000, 0x10000, CRC(95e3c517) SHA1(9954830ebc3a6414a3236f4e41981db082e5ea19) ) - ROM_LOAD( "8.u189", 0x10000, 0x10000, CRC(fe2377ab) SHA1(8578c5466d98f140fdfc41e91cd841e725786e32) ) + ROM_LOAD( "BC-003_K-0161.U212", 0x00000, 0x10000, CRC(95e3c517) SHA1(9954830ebc3a6414a3236f4e41981db082e5ea19) ) + ROM_LOAD( "BC-004_K-0161.U189", 0x10000, 0x10000, CRC(fe2377ab) SHA1(8578c5466d98f140fdfc41e91cd841e725786e32) ) ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "3.u100", 0x00000, 0x10000, CRC(16dc435f) SHA1(0c13e9786b356770c84f94684697e43d0ea9e7cc) ) + ROM_LOAD( "BC-005_K-0161.U113", 0x00000, 0x10000, CRC(16dc435f) SHA1(0c13e9786b356770c84f94684697e43d0ea9e7cc) ) ROM_CONTINUE( 0x20000, 0x10000 ) - ROM_LOAD( "4.u80", 0x10000, 0x10000, CRC(4fe3bf97) SHA1(7910ace1eed80bfafa1f9f057ed67e23aa446a22) ) - ROM_LOAD( "6.u52", 0x40000, 0x10000, CRC(078aef7f) SHA1(72e60d39d8af8bd31e9ae019b12620797eb0af7f) ) + ROM_LOAD( "BC-006_K-161.U80", 0x10000, 0x10000, CRC(4fe3bf97) SHA1(7910ace1eed80bfafa1f9f057ed67e23aa446a22) ) + ROM_LOAD( "BC-008_K-161.U52", 0x40000, 0x10000, CRC(078aef7f) SHA1(72e60d39d8af8bd31e9ae019b12620797eb0af7f) ) ROM_CONTINUE( 0x60000, 0x10000 ) - ROM_LOAD( "5.u70", 0x50000, 0x10000, CRC(f650fa90) SHA1(c87081b4d6b09f865d08c5120da3d0fb3196a2c3) ) + ROM_LOAD( "BC-007_K-161.U70", 0x50000, 0x10000, CRC(f650fa90) SHA1(c87081b4d6b09f865d08c5120da3d0fb3196a2c3) ) ROM_REGION( 0x40000, "gfx3", 0 ) - ROM_LOAD( "9.u49", 0x20000, 0x20000, CRC(0c6188fb) SHA1(d49034384c6d0e94db2890223b32a2a49e79a639) ) - ROM_LOAD( "10.u27", 0x00000, 0x20000, CRC(2d383ff8) SHA1(3062baac27feba69c6ed94935c5ced72d89ed4fb) ) + ROM_LOAD( "BC-009_K-163.U49", 0x20000, 0x20000, CRC(0c6188fb) SHA1(d49034384c6d0e94db2890223b32a2a49e79a639) ) + ROM_LOAD( "BC-010_K-163.U27", 0x00000, 0x20000, CRC(2d383ff8) SHA1(3062baac27feba69c6ed94935c5ced72d89ed4fb) ) ROM_REGION( 0x10000, "samples", 0 ) /* samples */ - ROM_LOAD( "2.u74", 0x00000, 0x10000, CRC(36ee1dac) SHA1(6dfd2a885c0b1c9347abc4b204ade66551c4b404) ) + ROM_LOAD( "BC-002_K-0161.U74", 0x00000, 0x10000, CRC(36ee1dac) SHA1(6dfd2a885c0b1c9347abc4b204ade66551c4b404) ) ROM_REGION( 0x400, "proms", 0 ) ROM_LOAD( "prom1.u54", 0x0000, 0x0100, CRC(c324835e) SHA1(cf6ffe38523badfda211d341410e93e647de87a9) ) // == ic52 video timing prom from vigilante @@ -1045,29 +1045,64 @@ ROM_END ROM_START( buccanrsa ) ROM_REGION( 0x30000, "maincpu", 0 ) /* 64k for code + 128k for bankswitching */ ROM_LOAD( "bc-011", 0x00000, 0x08000, CRC(6b657ef1) SHA1(a3356654d4b04177af23b39e924cc5ad64930bb6) ) - ROM_LOAD( "12.u25", 0x10000, 0x10000, CRC(87303ba8) SHA1(49a25393e853b9adf7df00a6f9c38a526a02ea4e) ) // not from this set, hopefully its only a data rom + ROM_LOAD( "BC-012_K-163.U25", 0x10000, 0x10000, CRC(87303ba8) SHA1(49a25393e853b9adf7df00a6f9c38a526a02ea4e) ) ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for sound */ - ROM_LOAD( "1.u128", 0x00000, 0x10000, CRC(eb65f8c3) SHA1(82566becb630ce92303905dc0c5bef9e80e9caad) ) + ROM_LOAD( "BC-001_K-0161.U128", 0x00000, 0x10000, CRC(eb65f8c3) SHA1(82566becb630ce92303905dc0c5bef9e80e9caad) ) ROM_REGION( 0x20000, "gfx1", 0 ) - ROM_LOAD( "7.u212", 0x00000, 0x10000, CRC(95e3c517) SHA1(9954830ebc3a6414a3236f4e41981db082e5ea19) ) - ROM_LOAD( "8.u189", 0x10000, 0x10000, CRC(fe2377ab) SHA1(8578c5466d98f140fdfc41e91cd841e725786e32) ) + ROM_LOAD( "BC-003_K-0161.U212", 0x00000, 0x10000, CRC(95e3c517) SHA1(9954830ebc3a6414a3236f4e41981db082e5ea19) ) + ROM_LOAD( "BC-004_K-0161.U189", 0x10000, 0x10000, CRC(fe2377ab) SHA1(8578c5466d98f140fdfc41e91cd841e725786e32) ) ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "3.u100", 0x00000, 0x10000, CRC(16dc435f) SHA1(0c13e9786b356770c84f94684697e43d0ea9e7cc) ) + ROM_LOAD( "BC-005_K-0161.U113", 0x00000, 0x10000, CRC(16dc435f) SHA1(0c13e9786b356770c84f94684697e43d0ea9e7cc) ) ROM_CONTINUE( 0x20000, 0x10000 ) - ROM_LOAD( "4.u80", 0x10000, 0x10000, CRC(4fe3bf97) SHA1(7910ace1eed80bfafa1f9f057ed67e23aa446a22) ) // was double size (2nd half blank) in this set) - ROM_LOAD( "6.u52", 0x40000, 0x10000, CRC(078aef7f) SHA1(72e60d39d8af8bd31e9ae019b12620797eb0af7f) ) + ROM_LOAD( "BC-006_K-161.U80", 0x10000, 0x10000, CRC(4fe3bf97) SHA1(7910ace1eed80bfafa1f9f057ed67e23aa446a22) ) + ROM_LOAD( "BC-008_K-161.U52", 0x40000, 0x10000, CRC(078aef7f) SHA1(72e60d39d8af8bd31e9ae019b12620797eb0af7f) ) ROM_CONTINUE( 0x60000, 0x10000 ) - ROM_LOAD( "5.u70", 0x50000, 0x10000, CRC(f650fa90) SHA1(c87081b4d6b09f865d08c5120da3d0fb3196a2c3) ) // was double size (2nd half blank) in this set) + ROM_LOAD( "BC-007_K-161.U70", 0x50000, 0x10000, CRC(f650fa90) SHA1(c87081b4d6b09f865d08c5120da3d0fb3196a2c3) ) ROM_REGION( 0x40000, "gfx3", 0 ) - ROM_LOAD( "9.u49", 0x20000, 0x20000, CRC(0c6188fb) SHA1(d49034384c6d0e94db2890223b32a2a49e79a639) ) - ROM_LOAD( "10.u27", 0x00000, 0x20000, CRC(2d383ff8) SHA1(3062baac27feba69c6ed94935c5ced72d89ed4fb) ) + ROM_LOAD( "BC-009_K-163.U49", 0x20000, 0x20000, CRC(0c6188fb) SHA1(d49034384c6d0e94db2890223b32a2a49e79a639) ) + ROM_LOAD( "BC-010_K-163.U27", 0x00000, 0x20000, CRC(2d383ff8) SHA1(3062baac27feba69c6ed94935c5ced72d89ed4fb) ) ROM_REGION( 0x10000, "samples", 0 ) /* samples */ - ROM_LOAD( "2.u74", 0x00000, 0x10000, CRC(36ee1dac) SHA1(6dfd2a885c0b1c9347abc4b204ade66551c4b404) ) + ROM_LOAD( "BC-002_K-0161.U74", 0x00000, 0x10000, CRC(36ee1dac) SHA1(6dfd2a885c0b1c9347abc4b204ade66551c4b404) ) + + ROM_REGION( 0x400, "proms", 0 ) + ROM_LOAD( "prom1.u54", 0x0000, 0x0100, CRC(c324835e) SHA1(cf6ffe38523badfda211d341410e93e647de87a9) ) // == ic52 video timing prom from vigilante + ROM_LOAD( "prom4.u79", 0x0100, 0x0100, CRC(e6506ef4) SHA1(079841da7640b14d94aaaeb572bf018932b58293) ) + ROM_LOAD( "prom3.u88", 0x0200, 0x0100, CRC(b43d094f) SHA1(2bed4892d8a91d7faac5a07bf858d9294eb30606) ) + ROM_LOAD( "prom2.u99", 0x0300, 0x0100, CRC(e0aa8869) SHA1(ac8bdfeba69420ba56ec561bf3d0f1229d02cea2) ) +ROM_END + + +ROM_START( buccanrsb ) + ROM_REGION( 0x30000, "maincpu", 0 ) /* 64k for code + 128k for bankswitching */ + ROM_LOAD( "rr_Du.u58", 0x00000, 0x08000, CRC(dcad3a8b) SHA1(e961927bdff28db18b829ce3f64051ff1604d1e6) ) + ROM_LOAD( "BC-012_K-163.U25", 0x10000, 0x10000, CRC(87303ba8) SHA1(49a25393e853b9adf7df00a6f9c38a526a02ea4e) ) + + ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for sound */ + ROM_LOAD( "BC-001_K-0161.U128", 0x00000, 0x10000, CRC(eb65f8c3) SHA1(82566becb630ce92303905dc0c5bef9e80e9caad) ) + + ROM_REGION( 0x20000, "gfx1", 0 ) + ROM_LOAD( "BC-003_K-0161.U212", 0x00000, 0x10000, CRC(95e3c517) SHA1(9954830ebc3a6414a3236f4e41981db082e5ea19) ) + ROM_LOAD( "BC-004_K-0161.U189", 0x10000, 0x10000, CRC(fe2377ab) SHA1(8578c5466d98f140fdfc41e91cd841e725786e32) ) + + ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_LOAD( "BC-005_K-0161.U113", 0x00000, 0x10000, CRC(16dc435f) SHA1(0c13e9786b356770c84f94684697e43d0ea9e7cc) ) + ROM_CONTINUE( 0x20000, 0x10000 ) + ROM_LOAD( "BC-006_K-161.U80", 0x10000, 0x10000, CRC(4fe3bf97) SHA1(7910ace1eed80bfafa1f9f057ed67e23aa446a22) ) + ROM_LOAD( "BC-008_K-161.U52", 0x40000, 0x10000, CRC(078aef7f) SHA1(72e60d39d8af8bd31e9ae019b12620797eb0af7f) ) + ROM_CONTINUE( 0x60000, 0x10000 ) + ROM_LOAD( "BC-007_K-161.U70", 0x50000, 0x10000, CRC(f650fa90) SHA1(c87081b4d6b09f865d08c5120da3d0fb3196a2c3) ) + + ROM_REGION( 0x40000, "gfx3", 0 ) + ROM_LOAD( "BC-009_K-163.U49", 0x20000, 0x20000, CRC(0c6188fb) SHA1(d49034384c6d0e94db2890223b32a2a49e79a639) ) + ROM_LOAD( "BC-010_K-163.U27", 0x00000, 0x20000, CRC(2d383ff8) SHA1(3062baac27feba69c6ed94935c5ced72d89ed4fb) ) + + ROM_REGION( 0x10000, "samples", 0 ) /* samples */ + ROM_LOAD( "BC-002_K-0161.U74", 0x00000, 0x10000, CRC(36ee1dac) SHA1(6dfd2a885c0b1c9347abc4b204ade66551c4b404) ) ROM_REGION( 0x400, "proms", 0 ) ROM_LOAD( "prom1.u54", 0x0000, 0x0100, CRC(c324835e) SHA1(cf6ffe38523badfda211d341410e93e647de87a9) ) // == ic52 video timing prom from vigilante @@ -1090,3 +1125,4 @@ GAME( 1988, kikcubicb, kikcubic, kikcubic, kikcubic, driver_device, 0, ROT0, GAME( 1989, buccanrs, 0, buccanrs, buccanrs, driver_device, 0, ROT0, "Duintronic", "Buccaneers (set 1)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) GAME( 1989, buccanrsa, buccanrs, buccanrs, buccanra, driver_device, 0, ROT0, "Duintronic", "Buccaneers (set 2)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1989, buccanrsb, buccanrs, buccanrs, buccanrs, driver_device, 0, ROT0, "Duintronic", "Buccaneers (set 3, harder)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index ac22cb7c080..5922ef777c0 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -8890,6 +8890,7 @@ ccbootmr // Model Racing bootleg cclimber // (c) 1980 Nichibutsu cclimberj // (c) 1980 Nichibutsu cclimbroper // Operamatic bootleg +cclimbrrod // Rodmar bootleg ckong // (c) 1981 (Kyoei) ckongalc // bootleg (Alca) ckongdks // Spanish Crazy Kong bootleg @@ -35650,6 +35651,7 @@ videopkr // (c) 1984 InterFlip @source:vigilant.cpp buccanrs // (c) 1989 Duintronic buccanrsa // (c) 1989 Duintronic +buccanrsb // (c) 1989 Duintronic kikcubic // (c) 1988 (Japan) kikcubicb // bootleg vigilant // (c) 1988 (World Rev E) From 492b212192ade04a87e23aa42bb14ad4aa422a80 Mon Sep 17 00:00:00 2001 From: mahlemiut Date: Wed, 16 Mar 2016 12:07:48 +1300 Subject: [PATCH 08/48] svga_s3: fix potential crash when hardware pointer is at the edge of VRAM, and fix viewport scrolling in Red Hat Linux / XF86_S3. --- src/devices/video/pc_vga.cpp | 96 +++++++++++++++++++++--------------- src/devices/video/pc_vga.h | 1 + 2 files changed, 56 insertions(+), 41 deletions(-) diff --git a/src/devices/video/pc_vga.cpp b/src/devices/video/pc_vga.cpp index 7710e3402c3..80cbae9b225 100644 --- a/src/devices/video/pc_vga.cpp +++ b/src/devices/video/pc_vga.cpp @@ -224,6 +224,17 @@ TIMER_CALLBACK_MEMBER(vga_device::vblank_timer_cb) m_vblank_timer->adjust( machine().first_screen()->time_until_pos(vga.crtc.vert_blank_start + vga.crtc.vert_blank_end) ); } +TIMER_CALLBACK_MEMBER(s3_vga_device::vblank_timer_cb) +{ + // not sure if this is correct, but XF86_S3 seems to expect the viewport scrolling to be faster + if(s3.memory_config & 0x08) + vga.crtc.start_addr = vga.crtc.start_addr_latch << 2; + else + vga.crtc.start_addr = vga.crtc.start_addr_latch; + vga.attribute.pel_shift = vga.attribute.pel_shift_latch; + m_vblank_timer->adjust( machine().first_screen()->time_until_pos(vga.crtc.vert_blank_start + vga.crtc.vert_blank_end) ); +} + void vga_device::device_start() { zero(); @@ -1051,50 +1062,53 @@ UINT32 s3_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, // printf("%08x: %02x %02x %02x %02x\n",src+x*4,vga.memory[src+x*4],vga.memory[src+x*4+1],vga.memory[src+x*4+2],vga.memory[src+x*4+3]); for(y=0;y<64;y++) { - dst = &bitmap.pix32(cy + y, cx); - for(x=0;x<64;x++) + if(cy + y < cliprect.max_y && cx < cliprect.max_x) { - UINT16 bita = (vga.memory[(src+1) % vga.svga_intf.vram_size] | ((vga.memory[(src+0) % vga.svga_intf.vram_size]) << 8)) >> (15-(x % 16)); - UINT16 bitb = (vga.memory[(src+3) % vga.svga_intf.vram_size] | ((vga.memory[(src+2) % vga.svga_intf.vram_size]) << 8)) >> (15-(x % 16)); - val = ((bita & 0x01) << 1) | (bitb & 0x01); - if(s3.extended_dac_ctrl & 0x10) - { // X11 mode - switch(val) - { - case 0x00: - // no change - break; - case 0x01: - // no change - break; - case 0x02: - dst[x] = bg_col; - break; - case 0x03: - dst[x] = fg_col; - break; + dst = &bitmap.pix32(cy + y, cx); + for(x=0;x<64;x++) + { + UINT16 bita = (vga.memory[(src+1) % vga.svga_intf.vram_size] | ((vga.memory[(src+0) % vga.svga_intf.vram_size]) << 8)) >> (15-(x % 16)); + UINT16 bitb = (vga.memory[(src+3) % vga.svga_intf.vram_size] | ((vga.memory[(src+2) % vga.svga_intf.vram_size]) << 8)) >> (15-(x % 16)); + val = ((bita & 0x01) << 1) | (bitb & 0x01); + if(s3.extended_dac_ctrl & 0x10) + { // X11 mode + switch(val) + { + case 0x00: + // no change + break; + case 0x01: + // no change + break; + case 0x02: + dst[x] = bg_col; + break; + case 0x03: + dst[x] = fg_col; + break; + } } - } - else - { // Windows mode - switch(val) - { - case 0x00: - dst[x] = bg_col; - break; - case 0x01: - dst[x] = fg_col; - break; - case 0x02: // screen data - // no change - break; - case 0x03: // inverted screen data - dst[x] = ~(dst[x]); - break; + else + { // Windows mode + switch(val) + { + case 0x00: + dst[x] = bg_col; + break; + case 0x01: + dst[x] = fg_col; + break; + case 0x02: // screen data + // no change + break; + case 0x03: // inverted screen data + dst[x] = ~(dst[x]); + break; + } } + if(x % 16 == 15) + src+=4; } - if(x % 16 == 15) - src+=4; } } } @@ -3388,7 +3402,6 @@ void ibm8514a_device::ibm8514_write(UINT32 offset, UINT32 src) { int data_size = 8; UINT32 xfer; - address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); switch(ibm8514.pixel_control & 0x00c0) { @@ -3428,6 +3441,7 @@ void ibm8514a_device::ibm8514_write(UINT32 offset, UINT32 src) ibm8514.src_x = 0; break; case 0x00c0: // use source plane + address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); if(m_vga->mem_linear_r(space,src,0xff) != 0x00) ibm8514_write_fg(offset); else diff --git a/src/devices/video/pc_vga.h b/src/devices/video/pc_vga.h index 9c729ba7a6e..a7f0552ffdb 100644 --- a/src/devices/video/pc_vga.h +++ b/src/devices/video/pc_vga.h @@ -568,6 +568,7 @@ public: virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; virtual machine_config_constructor device_mconfig_additions() const override; + virtual TIMER_CALLBACK_MEMBER(vblank_timer_cb) override; ibm8514a_device* get_8514() { return m_8514; } protected: From 4865a87134addb57783f1b1e2456276f239c2349 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 16 Mar 2016 01:00:11 +0100 Subject: [PATCH 09/48] tms1k: preparation for splitting source file --- src/devices/cpu/tms0980/tms0980.cpp | 156 +++++++++------------------ src/devices/cpu/tms0980/tms0980.h | 96 +++++++++++++---- src/devices/cpu/tms0980/tms0980d.cpp | 4 +- src/mame/drivers/microvsn.cpp | 2 +- 4 files changed, 130 insertions(+), 128 deletions(-) diff --git a/src/devices/cpu/tms0980/tms0980.cpp b/src/devices/cpu/tms0980/tms0980.cpp index feddc785eda..f0ff6bd124b 100644 --- a/src/devices/cpu/tms0980/tms0980.cpp +++ b/src/devices/cpu/tms0980/tms0980.cpp @@ -53,13 +53,6 @@ cycle #5 - Execute: 1. Execute BRANCH/CALL/RETN part #1 -*/ - -#include "tms0980.h" -#include "debugger.h" - -/* - The MCU cores contains a set of fixed instructions and a set of instructions created using microinstructions. A subset of the instruction set could be defined from the microinstructions by @@ -73,57 +66,8 @@ unknown cycle: CME, SSE, SSS */ -/* Microinstructions */ -#define M_15TN (1<<0) /* 15 to -ALU */ -#define M_ATN (1<<1) /* ACC to -ALU */ -#define M_AUTA (1<<2) /* ALU to ACC */ -#define M_AUTY (1<<3) /* ALU to Y */ -#define M_C8 (1<<4) /* CARRY8 to STATUS */ -#define M_CIN (1<<5) /* Carry In to ALU */ -#define M_CKM (1<<6) /* CKB to MEM */ -#define M_CKN (1<<7) /* CKB to -ALU */ -#define M_CKP (1<<8) /* CKB to +ALU */ -#define M_MTN (1<<9) /* MEM to -ALU */ -#define M_MTP (1<<10) /* MEM to +ALU */ -#define M_NATN (1<<11) /* ~ACC to -ALU */ -#define M_NE (1<<12) /* COMP to STATUS */ -#define M_STO (1<<13) /* ACC to MEM */ -#define M_STSL (1<<14) /* STATUS to Status Latch */ -#define M_YTP (1<<15) /* Y to +ALU */ - -#define M_CME (1<<16) /* Conditional Memory Enable */ -#define M_DMTP (1<<17) /* DAM to +ALU */ -#define M_NDMTP (1<<18) /* ~DAM to +ALU */ -#define M_SSE (1<<19) /* Special Status Enable */ -#define M_SSS (1<<20) /* Special Status Sample */ - -#define M_RSTR (1<<21) /* -> line #36, F_RSTR (TMS02x0 custom) */ -#define M_UNK1 (1<<22) /* -> line #37, F_???? (TMS0270 custom) */ - -/* Standard/fixed instructions - these are documented more in their specific handlers below */ -#define F_BR (1<<0) -#define F_CALL (1<<1) -#define F_CLO (1<<2) -#define F_COMC (1<<3) -#define F_COMX (1<<4) -#define F_COMX8 (1<<5) -#define F_LDP (1<<6) -#define F_LDX (1<<7) -#define F_RBIT (1<<8) -#define F_RETN (1<<9) -#define F_RSTR (1<<10) -#define F_SBIT (1<<11) -#define F_SETR (1<<12) -#define F_TDO (1<<13) -#define F_TPC (1<<14) - -#define F_OFF (1<<15) -#define F_REAC (1<<16) -#define F_SAL (1<<17) -#define F_SBL (1<<18) -#define F_SEAC (1<<19) -#define F_XDA (1<<20) - +#include "tms0980.h" +#include "debugger.h" // supported types: // note: dice information assumes the orientation is pictured with RAM at the bottom-left, except where noted @@ -209,32 +153,32 @@ const device_type TP0320 = &device_creator; // 28-pin SDIP, . // internal memory maps -static ADDRESS_MAP_START(program_11bit_9, AS_PROGRAM, 16, tms1xxx_cpu_device) +static ADDRESS_MAP_START(program_11bit_9, AS_PROGRAM, 16, tms1k_base_device) AM_RANGE(0x000, 0xfff) AM_ROM ADDRESS_MAP_END -static ADDRESS_MAP_START(program_10bit_8, AS_PROGRAM, 8, tms1xxx_cpu_device) +static ADDRESS_MAP_START(program_10bit_8, AS_PROGRAM, 8, tms1k_base_device) AM_RANGE(0x000, 0x3ff) AM_ROM ADDRESS_MAP_END -static ADDRESS_MAP_START(program_11bit_8, AS_PROGRAM, 8, tms1xxx_cpu_device) +static ADDRESS_MAP_START(program_11bit_8, AS_PROGRAM, 8, tms1k_base_device) AM_RANGE(0x000, 0x7ff) AM_ROM ADDRESS_MAP_END -static ADDRESS_MAP_START(program_12bit_8, AS_PROGRAM, 8, tms1xxx_cpu_device) +static ADDRESS_MAP_START(program_12bit_8, AS_PROGRAM, 8, tms1k_base_device) AM_RANGE(0x000, 0xfff) AM_ROM ADDRESS_MAP_END -static ADDRESS_MAP_START(data_64x4, AS_DATA, 8, tms1xxx_cpu_device) +static ADDRESS_MAP_START(data_64x4, AS_DATA, 8, tms1k_base_device) AM_RANGE(0x00, 0x3f) AM_RAM ADDRESS_MAP_END -static ADDRESS_MAP_START(data_128x4, AS_DATA, 8, tms1xxx_cpu_device) +static ADDRESS_MAP_START(data_128x4, AS_DATA, 8, tms1k_base_device) AM_RANGE(0x00, 0x7f) AM_RAM ADDRESS_MAP_END -static ADDRESS_MAP_START(data_64x9_as4, AS_DATA, 8, tms1xxx_cpu_device) +static ADDRESS_MAP_START(data_64x9_as4, AS_DATA, 8, tms1k_base_device) AM_RANGE(0x00, 0x7f) AM_RAM AM_RANGE(0x80, 0x8f) AM_RAM AM_MIRROR(0x70) // DAM ADDRESS_MAP_END @@ -242,11 +186,11 @@ ADDRESS_MAP_END // device definitions tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms1xxx_cpu_device(mconfig, TMS1000, "TMS1000", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 2 /* x width */, 10 /* prg width */, ADDRESS_MAP_NAME(program_10bit_8), 6 /* data width */, ADDRESS_MAP_NAME(data_64x4), "tms1000", __FILE__) + : tms1k_base_device(mconfig, TMS1000, "TMS1000", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 2 /* x width */, 10 /* prg width */, ADDRESS_MAP_NAME(program_10bit_8), 6 /* data width */, ADDRESS_MAP_NAME(data_64x4), "tms1000", __FILE__) { } tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) - : tms1xxx_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) + : tms1k_base_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) { } tms1070_cpu_device::tms1070_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) @@ -497,7 +441,7 @@ offs_t tp0320_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT return CPU_DISASSEMBLE_NAME(tp0320)(this, buffer, pc, oprom, opram, options); } -void tms1xxx_cpu_device::state_string_export(const device_state_entry &entry, std::string &str) const +void tms1k_base_device::state_string_export(const device_state_entry &entry, std::string &str) const { switch (entry.index()) { @@ -519,7 +463,7 @@ enum TMS1XXX_A, TMS1XXX_X, TMS1XXX_Y, TMS1XXX_STATUS }; -void tms1xxx_cpu_device::device_start() +void tms1k_base_device::device_start() { m_program = &space(AS_PROGRAM); m_data = &space(AS_DATA); @@ -630,7 +574,7 @@ void tms1xxx_cpu_device::device_start() void tms0270_cpu_device::device_start() { // common init - tms1xxx_cpu_device::device_start(); + tms1k_base_device::device_start(); m_read_ctl.resolve_safe(0); m_write_ctl.resolve_safe(); @@ -665,7 +609,7 @@ void tms0270_cpu_device::device_start() // device_reset - device-specific reset //------------------------------------------------- -void tms1xxx_cpu_device::device_reset() +void tms1k_base_device::device_reset() { m_pa = 0xf; m_pb = 0xf; @@ -696,7 +640,7 @@ void tms1xxx_cpu_device::device_reset() void tms1000_cpu_device::device_reset() { // common reset - tms1xxx_cpu_device::device_reset(); + tms1k_base_device::device_reset(); // pre-decode instructionset m_fixed_decode.resize(0x100); @@ -758,7 +702,7 @@ void tms1400_cpu_device::device_reset() void tms0970_cpu_device::device_reset() { // common reset - tms1xxx_cpu_device::device_reset(); + tms1k_base_device::device_reset(); // pre-decode instructionset m_fixed_decode.resize(0x100); @@ -824,7 +768,7 @@ UINT32 tms0980_cpu_device::decode_micro(UINT8 sel) void tms0980_cpu_device::device_reset() { // common reset - tms1xxx_cpu_device::device_reset(); + tms1k_base_device::device_reset(); // pre-decode instructionset m_fixed_decode.resize(0x200); @@ -876,7 +820,7 @@ void tms0270_cpu_device::device_reset() // program counter/opcode decode //------------------------------------------------- -void tms1xxx_cpu_device::next_pc() +void tms1k_base_device::next_pc() { // The program counter is a LFSR. To put it simply, the feedback bit is a XOR of the two highest bits, // but it makes an exception when all low bits are set (eg. in TMS1000 case, when PC is 0x1f or 0x3f). @@ -891,7 +835,7 @@ void tms1xxx_cpu_device::next_pc() m_pc = (m_pc << 1 | fb) & m_pc_mask; } -void tms1xxx_cpu_device::read_opcode() +void tms1k_base_device::read_opcode() { debugger_instruction_hook(this, m_rom_address); m_opcode = m_program->read_byte(m_rom_address); @@ -918,9 +862,9 @@ void tms0980_cpu_device::read_opcode() else m_micro = m_micro_decode[m_opcode]; - // TMS02x0/TMS1980: RSTR is on the mpla - if (m_micro & M_RSTR) - m_fixed |= F_RSTR; + // redirect mpla fixed instructions + if (m_micro & M_RSTR) m_fixed |= F_RSTR; + if (m_micro & M_SETR) m_fixed |= F_SETR; next_pc(); } @@ -931,7 +875,7 @@ void tms0980_cpu_device::read_opcode() // i/o handling //------------------------------------------------- -void tms1xxx_cpu_device::write_o_output(UINT8 index) +void tms1k_base_device::write_o_output(UINT8 index) { // a hardcoded table is supported if the output pla is unknown m_o = (m_output_pla_table == nullptr) ? m_opla->read(index) : m_output_pla_table[index]; @@ -988,7 +932,7 @@ void tms0270_cpu_device::dynamic_output() } -UINT8 tms1xxx_cpu_device::read_k_input() +UINT8 tms1k_base_device::read_k_input() { // K1,2,4,8 (KC test pin is not emulated) return m_read_k(0, 0xff) & 0xf; @@ -1013,7 +957,7 @@ UINT8 tms0270_cpu_device::read_k_input() } -void tms1xxx_cpu_device::set_cki_bus() +void tms1k_base_device::set_cki_bus() { switch (m_opcode & 0xf8) { @@ -1077,7 +1021,7 @@ void tms0980_cpu_device::set_cki_bus() // note: add(latch) and bl(branch latch) are specific to 0980 series, // c(chapter) bits are specific to 1100(and 1400) series -void tms1xxx_cpu_device::op_br() +void tms1k_base_device::op_br() { // BR/BL: conditional branch if (m_status) @@ -1089,7 +1033,7 @@ void tms1xxx_cpu_device::op_br() } } -void tms1xxx_cpu_device::op_call() +void tms1k_base_device::op_call() { // CALL/CALLL: conditional call if (m_status) @@ -1109,7 +1053,7 @@ void tms1xxx_cpu_device::op_call() } } -void tms1xxx_cpu_device::op_retn() +void tms1k_base_device::op_retn() { // RETN: return from subroutine if (m_clatch == 1) @@ -1184,7 +1128,7 @@ void tms1400_cpu_device::op_retn() // TMS1000/common -void tms1xxx_cpu_device::op_sbit() +void tms1k_base_device::op_sbit() { // SBIT: set memory bit if (m_ram_out == -1) @@ -1192,7 +1136,7 @@ void tms1xxx_cpu_device::op_sbit() m_ram_out |= (m_cki_bus ^ 0xf); } -void tms1xxx_cpu_device::op_rbit() +void tms1k_base_device::op_rbit() { // RBIT: reset memory bit if (m_ram_out == -1) @@ -1200,52 +1144,52 @@ void tms1xxx_cpu_device::op_rbit() m_ram_out &= m_cki_bus; } -void tms1xxx_cpu_device::op_setr() +void tms1k_base_device::op_setr() { // SETR: set one R-output line m_r = m_r | (1 << m_y); m_write_r(0, m_r & m_r_mask, 0xffff); } -void tms1xxx_cpu_device::op_rstr() +void tms1k_base_device::op_rstr() { // RSTR: reset one R-output line m_r = m_r & ~(1 << m_y); m_write_r(0, m_r & m_r_mask, 0xffff); } -void tms1xxx_cpu_device::op_tdo() +void tms1k_base_device::op_tdo() { // TDO: transfer accumulator and status latch to O-output write_o_output(m_status_latch << 4 | m_a); } -void tms1xxx_cpu_device::op_clo() +void tms1k_base_device::op_clo() { // CLO: clear O-output write_o_output(0); } -void tms1xxx_cpu_device::op_ldx() +void tms1k_base_device::op_ldx() { // LDX: load X register with (x_bits) constant m_x = m_c4 >> (4-m_x_bits); } -void tms1xxx_cpu_device::op_comx() +void tms1k_base_device::op_comx() { // COMX: complement X register m_x ^= m_x_mask; } -void tms1xxx_cpu_device::op_comx8() +void tms1k_base_device::op_comx8() { // COMX8: complement MSB of X register // note: on TMS1100, the mnemonic is simply called "COMX" m_x ^= 1 << (m_x_bits-1); } -void tms1xxx_cpu_device::op_ldp() +void tms1k_base_device::op_ldp() { // LDP: load page buffer with constant m_pb = m_c4; @@ -1258,17 +1202,17 @@ void tms1100_cpu_device::op_setr() { // SETR: same, but X register MSB must be clear if (~m_x & (1 << (m_x_bits-1))) - tms1xxx_cpu_device::op_setr(); + tms1k_base_device::op_setr(); } void tms1100_cpu_device::op_rstr() { // RSTR: same, but X register MSB must be clear if (~m_x & (1 << (m_x_bits-1))) - tms1xxx_cpu_device::op_rstr(); + tms1k_base_device::op_rstr(); } -void tms1xxx_cpu_device::op_comc() +void tms1k_base_device::op_comc() { // COMC: complement chapter buffer m_cb ^= 1; @@ -1277,7 +1221,7 @@ void tms1xxx_cpu_device::op_comc() // TMS1400-specific -void tms1xxx_cpu_device::op_tpc() +void tms1k_base_device::op_tpc() { // TPC: transfer page buffer to chapter buffer m_cb = m_pb & 3; @@ -1310,38 +1254,38 @@ void tms0980_cpu_device::op_comx() m_x ^= (m_x_mask >> 1); } -void tms1xxx_cpu_device::op_xda() +void tms1k_base_device::op_xda() { // XDA: exchange DAM and A // note: setting A to DAM is done with DMTP and AUTA during this instruction m_ram_address |= (0x10 << (m_x_bits-1)); } -void tms1xxx_cpu_device::op_off() +void tms1k_base_device::op_off() { // OFF: request auto power-off m_power_off(1); } -void tms1xxx_cpu_device::op_seac() +void tms1k_base_device::op_seac() { // SEAC: set end around carry m_eac = 1; } -void tms1xxx_cpu_device::op_reac() +void tms1k_base_device::op_reac() { // REAC: reset end around carry m_eac = 0; } -void tms1xxx_cpu_device::op_sal() +void tms1k_base_device::op_sal() { // SAL: set add latch (reset is done with RETN) m_add = 1; } -void tms1xxx_cpu_device::op_sbl() +void tms1k_base_device::op_sbl() { // SBL: set branch latch (reset is done with RETN) m_bl = 1; @@ -1388,7 +1332,7 @@ void tms0270_cpu_device::op_tdo() // execute_run //------------------------------------------------- -void tms1xxx_cpu_device::execute_run() +void tms1k_base_device::execute_run() { do { diff --git a/src/devices/cpu/tms0980/tms0980.h b/src/devices/cpu/tms0980/tms0980.h index f8b78481310..af14ebd6500 100644 --- a/src/devices/cpu/tms0980/tms0980.h +++ b/src/devices/cpu/tms0980/tms0980.h @@ -15,24 +15,24 @@ // K input pins #define MCFG_TMS1XXX_READ_K_CB(_devcb) \ - tms1xxx_cpu_device::set_read_k_callback(*device, DEVCB_##_devcb); + tms1k_base_device::set_read_k_callback(*device, DEVCB_##_devcb); // O/Segment output pins #define MCFG_TMS1XXX_WRITE_O_CB(_devcb) \ - tms1xxx_cpu_device::set_write_o_callback(*device, DEVCB_##_devcb); + tms1k_base_device::set_write_o_callback(*device, DEVCB_##_devcb); // Use this if the output PLA is unknown: // If the microinstructions (or other) PLA is unknown, try using one from another romset. #define MCFG_TMS1XXX_OUTPUT_PLA(_pla) \ - tms1xxx_cpu_device::set_output_pla(*device, _pla); + tms1k_base_device::set_output_pla(*device, _pla); // R output pins (also called D on some chips) #define MCFG_TMS1XXX_WRITE_R_CB(_devcb) \ - tms1xxx_cpu_device::set_write_r_callback(*device, DEVCB_##_devcb); + tms1k_base_device::set_write_r_callback(*device, DEVCB_##_devcb); // OFF request on TMS0980 and up #define MCFG_TMS1XXX_POWER_OFF_CB(_devcb) \ - tms1xxx_cpu_device::set_power_off_callback(*device, DEVCB_##_devcb); + tms1k_base_device::set_power_off_callback(*device, DEVCB_##_devcb); // TMS0270 was designed to interface with TMS5100, set it up at driver level @@ -88,11 +88,11 @@ */ -class tms1xxx_cpu_device : public cpu_device +class tms1k_base_device : public cpu_device { public: // construction/destruction - tms1xxx_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) + tms1k_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_BIG, byte_bits > 8 ? 16 : 8, prgwidth, 0, program) , m_data_config("data", ENDIANNESS_BIG, 8, datawidth, 0, data) @@ -113,11 +113,69 @@ public: { } // static configuration helpers - template static devcb_base &set_read_k_callback(device_t &device, _Object object) { return downcast(device).m_read_k.set_callback(object); } - template static devcb_base &set_write_o_callback(device_t &device, _Object object) { return downcast(device).m_write_o.set_callback(object); } - template static devcb_base &set_write_r_callback(device_t &device, _Object object) { return downcast(device).m_write_r.set_callback(object); } - template static devcb_base &set_power_off_callback(device_t &device, _Object object) { return downcast(device).m_power_off.set_callback(object); } - static void set_output_pla(device_t &device, const UINT16 *output_pla) { downcast(device).m_output_pla_table = output_pla; } + template static devcb_base &set_read_k_callback(device_t &device, _Object object) { return downcast(device).m_read_k.set_callback(object); } + template static devcb_base &set_write_o_callback(device_t &device, _Object object) { return downcast(device).m_write_o.set_callback(object); } + template static devcb_base &set_write_r_callback(device_t &device, _Object object) { return downcast(device).m_write_r.set_callback(object); } + template static devcb_base &set_power_off_callback(device_t &device, _Object object) { return downcast(device).m_power_off.set_callback(object); } + static void set_output_pla(device_t &device, const UINT16 *output_pla) { downcast(device).m_output_pla_table = output_pla; } + + // microinstructions + enum + { + M_15TN = (1<<0), /* 15 to -ALU */ + M_ATN = (1<<1), /* ACC to -ALU */ + M_AUTA = (1<<2), /* ALU to ACC */ + M_AUTY = (1<<3), /* ALU to Y */ + M_C8 = (1<<4), /* CARRY8 to STATUS */ + M_CIN = (1<<5), /* Carry In to ALU */ + M_CKM = (1<<6), /* CKB to MEM */ + M_CKN = (1<<7), /* CKB to -ALU */ + M_CKP = (1<<8), /* CKB to +ALU */ + M_MTN = (1<<9), /* MEM to -ALU */ + M_MTP = (1<<10), /* MEM to +ALU */ + M_NATN = (1<<11), /* ~ACC to -ALU */ + M_NE = (1<<12), /* COMP to STATUS */ + M_STO = (1<<13), /* ACC to MEM */ + M_STSL = (1<<14), /* STATUS to Status Latch */ + M_YTP = (1<<15), /* Y to +ALU */ + + M_CME = (1<<16), /* Conditional Memory Enable */ + M_DMTP = (1<<17), /* DAM to +ALU */ + M_NDMTP = (1<<18), /* ~DAM to +ALU */ + M_SSE = (1<<19), /* Special Status Enable */ + M_SSS = (1<<20), /* Special Status Sample */ + + M_SETR = (1<<21), /* -> line #0d, F_SETR (TP0320 custom), */ + M_RSTR = (1<<22), /* -> line #36, F_RSTR (TMS02x0 custom), */ + M_UNK1 = (1<<23) /* -> line #37, F_???? (TMS0270 custom), */ + }; + + // standard/fixed instructions - these are documented more in their specific handlers + enum + { + F_BR = (1<<0), + F_CALL = (1<<1), + F_CLO = (1<<2), + F_COMC = (1<<3), + F_COMX = (1<<4), + F_COMX8 = (1<<5), + F_LDP = (1<<6), + F_LDX = (1<<7), + F_RBIT = (1<<8), + F_RETN = (1<<9), + F_RSTR = (1<<10), + F_SBIT = (1<<11), + F_SETR = (1<<12), + F_TDO = (1<<13), + F_TPC = (1<<14), + + F_OFF = (1<<15), + F_REAC = (1<<16), + F_SAL = (1<<17), + F_SBL = (1<<18), + F_SEAC = (1<<19), + F_XDA = (1<<20) + }; protected: // device-level overrides @@ -247,7 +305,7 @@ protected: -class tms1000_cpu_device : public tms1xxx_cpu_device +class tms1000_cpu_device : public tms1k_base_device { public: tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -332,8 +390,8 @@ protected: virtual void op_call() override; virtual void op_retn() override; - virtual void op_setr() override { tms1xxx_cpu_device::op_setr(); } // no anomaly with MSB of X register - virtual void op_rstr() override { tms1xxx_cpu_device::op_rstr(); } // " + virtual void op_setr() override { tms1k_base_device::op_setr(); } // no anomaly with MSB of X register + virtual void op_rstr() override { tms1k_base_device::op_rstr(); } // " }; class tms1470_cpu_device : public tms1400_cpu_device @@ -429,10 +487,10 @@ protected: // overrides virtual machine_config_constructor device_mconfig_additions() const override; - virtual void write_o_output(UINT8 index) override { tms1xxx_cpu_device::write_o_output(index); } - virtual UINT8 read_k_input() override { return tms1xxx_cpu_device::read_k_input(); } + virtual void write_o_output(UINT8 index) override { tms1k_base_device::write_o_output(index); } + virtual UINT8 read_k_input() override { return tms1k_base_device::read_k_input(); } - virtual void op_setr() override { tms1xxx_cpu_device::op_setr(); } + virtual void op_setr() override { tms1k_base_device::op_setr(); } virtual void op_tdo() override; }; @@ -454,7 +512,7 @@ protected: virtual machine_config_constructor device_mconfig_additions() const override; - virtual void write_o_output(UINT8 index) override { tms1xxx_cpu_device::write_o_output(index); } + virtual void write_o_output(UINT8 index) override { tms1k_base_device::write_o_output(index); } virtual UINT8 read_k_input() override; virtual void dynamic_output() override; diff --git a/src/devices/cpu/tms0980/tms0980d.cpp b/src/devices/cpu/tms0980/tms0980d.cpp index 6f14e1172fd..81eba3739b5 100644 --- a/src/devices/cpu/tms0980/tms0980d.cpp +++ b/src/devices/cpu/tms0980/tms0980d.cpp @@ -166,10 +166,10 @@ static const UINT8 tms0980_mnemonic[512] = static const UINT8 tp0320_mnemonic[512] = { /* 0x000 */ - 0, zALEM, zYNEA, zXMA, zDYN, zIYC, zCLA, zDMAN, zTKA, zMNEA, zTKM, 0, 0, 0, zKNEZ, 0, // 0 + 0, zALEM, zYNEA, zXMA, zDYN, zIYC, zCLA, zDMAN, zTKA, zMNEA, zTKM, 0, 0, zSETR, zKNEZ, 0, // 0 zDMEA, zDNAA, zCCLA, zNDMEA, 0, zAMAAC, 0, 0, zCTMDYN, zXDA, 0, 0, 0, 0, 0, 0, // 1 zTBIT, zTBIT, zTBIT, zTBIT, 0, 0, 0, 0, zTAY, zTMA, zTMY, zTYA, zTAMDYN, zTAMIYC, zTAMZA, zTAM, // 2 - zSAMAN, zCPAIZ, zIMAC, zMNEZ, 0, 0, 0, zYMCY, zTCY, zYNEC, zTCMIY, zACACC, zACNAA, zTAMACS, zALEC, 0, // 3 + zSAMAN, zCPAIZ, zIMAC, zMNEZ, 0, 0, zRSTR, zYMCY, zTCY, zYNEC, zTCMIY, zACACC, zACNAA, zTAMACS, zALEC, 0, // 3 zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, zTCY, // 4 zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, zYNEC, // 5 zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, zTCMIY, // 6 diff --git a/src/mame/drivers/microvsn.cpp b/src/mame/drivers/microvsn.cpp index b7ff8fba4c8..6056ad38edd 100644 --- a/src/mame/drivers/microvsn.cpp +++ b/src/mame/drivers/microvsn.cpp @@ -547,7 +547,7 @@ DEVICE_IMAGE_LOAD_MEMBER(microvision_state, microvsn_cart) if (pla) m_pla = 1; - tms1xxx_cpu_device::set_output_pla(m_tms1100, m_pla ? microvision_output_pla_1 : microvision_output_pla_0); + tms1k_base_device::set_output_pla(m_tms1100, m_pla ? microvision_output_pla_1 : microvision_output_pla_0); // Set default setting for PCB type and RC type m_pcb_type = microvision_state::PCB_TYPE_UNKNOWN; From ce5cb07631ec328fa970624dd517239201072829 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 16 Mar 2016 01:26:37 +0100 Subject: [PATCH 10/48] tms1k: split part 2, renamed files --- scripts/src/cpu.lua | 15 ++++++++------- scripts/target/mame/arcade.lua | 2 +- scripts/target/mame/mess.lua | 2 +- src/devices/cpu/tms0980/tms1000.h | 10 ++++++++++ .../cpu/tms0980/{tms0980.cpp => tms1k_base.cpp} | 2 +- .../cpu/tms0980/{tms0980.h => tms1k_base.h} | 6 +++--- .../cpu/tms0980/{tms0980d.cpp => tms1k_dasm.cpp} | 2 +- src/mame/drivers/microvsn.cpp | 2 +- src/mame/includes/hh_tms1k.h | 2 +- 9 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 src/devices/cpu/tms0980/tms1000.h rename src/devices/cpu/tms0980/{tms0980.cpp => tms1k_base.cpp} (99%) rename src/devices/cpu/tms0980/{tms0980.h => tms1k_base.h} (99%) rename src/devices/cpu/tms0980/{tms0980d.cpp => tms1k_dasm.cpp} (99%) diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index ed6378f93f8..7986bf158e7 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -1842,19 +1842,20 @@ if (CPUS["AVR8"]~=null or _OPTIONS["with-tools"]) then end -------------------------------------------------- --- Texas Instruments TMS0980 ---@src/devices/cpu/tms0980/tms0980.h,CPUS["TMS0980"] = true +-- Texas Instruments TMS1000 series +--@src/devices/cpu/tms0980/tms1000.h,CPUS["TMS1000"] = true -------------------------------------------------- -if (CPUS["TMS0980"]~=null) then +if (CPUS["TMS1000"]~=null) then files { - MAME_DIR .. "src/devices/cpu/tms0980/tms0980.cpp", - MAME_DIR .. "src/devices/cpu/tms0980/tms0980.h", + MAME_DIR .. "src/devices/cpu/tms0980/tms1k_base.cpp", + MAME_DIR .. "src/devices/cpu/tms0980/tms1k_base.h", + MAME_DIR .. "src/devices/cpu/tms0980/tms1000.h", } end -if (CPUS["TMS0980"]~=null or _OPTIONS["with-tools"]) then - table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/tms0980/tms0980d.cpp") +if (CPUS["TMS1000"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/tms0980/tms1k_dasm.cpp") end -------------------------------------------------- diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index 17f8df2f760..27deeddb3a4 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -100,7 +100,7 @@ CPUS["SM8500"] = true CPUS["MINX"] = true CPUS["SSEM"] = true CPUS["AVR8"] = true ---CPUS["TMS0980"] = true +--CPUS["TMS1000"] = true CPUS["I4004"] = true CPUS["SUPERFX"] = true CPUS["Z8"] = true diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index eb0322cd2f7..cef8524680f 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -101,7 +101,7 @@ CPUS["SM8500"] = true CPUS["MINX"] = true CPUS["SSEM"] = true CPUS["AVR8"] = true -CPUS["TMS0980"] = true +CPUS["TMS1000"] = true CPUS["I4004"] = true CPUS["SUPERFX"] = true CPUS["Z8"] = true diff --git a/src/devices/cpu/tms0980/tms1000.h b/src/devices/cpu/tms0980/tms1000.h new file mode 100644 index 00000000000..8b042b78cf8 --- /dev/null +++ b/src/devices/cpu/tms0980/tms1000.h @@ -0,0 +1,10 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol, hap + +#ifndef _TMS1000_H_ +#define _TMS1000_H_ + +#include "tms1k_base.h" + + +#endif /* _TMS1000_H_ */ diff --git a/src/devices/cpu/tms0980/tms0980.cpp b/src/devices/cpu/tms0980/tms1k_base.cpp similarity index 99% rename from src/devices/cpu/tms0980/tms0980.cpp rename to src/devices/cpu/tms0980/tms1k_base.cpp index f0ff6bd124b..b09d8b11273 100644 --- a/src/devices/cpu/tms0980/tms0980.cpp +++ b/src/devices/cpu/tms0980/tms1k_base.cpp @@ -66,7 +66,7 @@ unknown cycle: CME, SSE, SSS */ -#include "tms0980.h" +#include "tms1k_base.h" #include "debugger.h" // supported types: diff --git a/src/devices/cpu/tms0980/tms0980.h b/src/devices/cpu/tms0980/tms1k_base.h similarity index 99% rename from src/devices/cpu/tms0980/tms0980.h rename to src/devices/cpu/tms0980/tms1k_base.h index af14ebd6500..c1585bd22f0 100644 --- a/src/devices/cpu/tms0980/tms0980.h +++ b/src/devices/cpu/tms0980/tms1k_base.h @@ -6,8 +6,8 @@ */ -#ifndef _TMS0980_H_ -#define _TMS0980_H_ +#ifndef _TMS1KBASE_H_ +#define _TMS1KBASE_H_ #include "emu.h" #include "machine/pla.h" @@ -574,4 +574,4 @@ extern const device_type TMS0270; extern const device_type TP0320; -#endif /* _TMS0980_H_ */ +#endif /* _TMS1KBASE_H_ */ diff --git a/src/devices/cpu/tms0980/tms0980d.cpp b/src/devices/cpu/tms0980/tms1k_dasm.cpp similarity index 99% rename from src/devices/cpu/tms0980/tms0980d.cpp rename to src/devices/cpu/tms0980/tms1k_dasm.cpp index 81eba3739b5..054d4f09699 100644 --- a/src/devices/cpu/tms0980/tms0980d.cpp +++ b/src/devices/cpu/tms0980/tms1k_dasm.cpp @@ -8,7 +8,7 @@ #include "emu.h" #include "debugger.h" -#include "tms0980.h" +#include "tms1k_base.h" enum e_mnemonics diff --git a/src/mame/drivers/microvsn.cpp b/src/mame/drivers/microvsn.cpp index 6056ad38edd..65a84d4ff92 100644 --- a/src/mame/drivers/microvsn.cpp +++ b/src/mame/drivers/microvsn.cpp @@ -17,7 +17,7 @@ of the games were clocked at around 500KHz, 550KHz, or 300KHz. #include "emu.h" #include "cpu/mcs48/mcs48.h" -#include "cpu/tms0980/tms0980.h" +#include "cpu/tms0980/tms1000.h" #include "sound/dac.h" #include "rendlay.h" diff --git a/src/mame/includes/hh_tms1k.h b/src/mame/includes/hh_tms1k.h index 46f6530ae7a..3b9db9aa1b6 100644 --- a/src/mame/includes/hh_tms1k.h +++ b/src/mame/includes/hh_tms1k.h @@ -11,7 +11,7 @@ #include "emu.h" -#include "cpu/tms0980/tms0980.h" +#include "cpu/tms0980/tms1000.h" #include "sound/speaker.h" From 1a479042cf4c8e3b707e1409ab265ed7fe706fdd Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 16 Mar 2016 01:33:56 +0100 Subject: [PATCH 11/48] tms1k: split part 2, renamed folder tms0980 to tms1000 --- scripts/src/cpu.lua | 10 +++++----- src/devices/cpu/{tms0980 => tms1000}/tms1000.h | 0 src/devices/cpu/{tms0980 => tms1000}/tms1k_base.cpp | 0 src/devices/cpu/{tms0980 => tms1000}/tms1k_base.h | 0 src/devices/cpu/{tms0980 => tms1000}/tms1k_dasm.cpp | 0 src/mame/drivers/microvsn.cpp | 2 +- src/mame/includes/hh_tms1k.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) rename src/devices/cpu/{tms0980 => tms1000}/tms1000.h (100%) rename src/devices/cpu/{tms0980 => tms1000}/tms1k_base.cpp (100%) rename src/devices/cpu/{tms0980 => tms1000}/tms1k_base.h (100%) rename src/devices/cpu/{tms0980 => tms1000}/tms1k_dasm.cpp (100%) diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index 7986bf158e7..c4e505bb37a 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -1843,19 +1843,19 @@ end -------------------------------------------------- -- Texas Instruments TMS1000 series ---@src/devices/cpu/tms0980/tms1000.h,CPUS["TMS1000"] = true +--@src/devices/cpu/tms1000/tms1000.h,CPUS["TMS1000"] = true -------------------------------------------------- if (CPUS["TMS1000"]~=null) then files { - MAME_DIR .. "src/devices/cpu/tms0980/tms1k_base.cpp", - MAME_DIR .. "src/devices/cpu/tms0980/tms1k_base.h", - MAME_DIR .. "src/devices/cpu/tms0980/tms1000.h", + MAME_DIR .. "src/devices/cpu/tms1000/tms1k_base.cpp", + MAME_DIR .. "src/devices/cpu/tms1000/tms1k_base.h", + MAME_DIR .. "src/devices/cpu/tms1000/tms1000.h", } end if (CPUS["TMS1000"]~=null or _OPTIONS["with-tools"]) then - table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/tms0980/tms1k_dasm.cpp") + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/tms1000/tms1k_dasm.cpp") end -------------------------------------------------- diff --git a/src/devices/cpu/tms0980/tms1000.h b/src/devices/cpu/tms1000/tms1000.h similarity index 100% rename from src/devices/cpu/tms0980/tms1000.h rename to src/devices/cpu/tms1000/tms1000.h diff --git a/src/devices/cpu/tms0980/tms1k_base.cpp b/src/devices/cpu/tms1000/tms1k_base.cpp similarity index 100% rename from src/devices/cpu/tms0980/tms1k_base.cpp rename to src/devices/cpu/tms1000/tms1k_base.cpp diff --git a/src/devices/cpu/tms0980/tms1k_base.h b/src/devices/cpu/tms1000/tms1k_base.h similarity index 100% rename from src/devices/cpu/tms0980/tms1k_base.h rename to src/devices/cpu/tms1000/tms1k_base.h diff --git a/src/devices/cpu/tms0980/tms1k_dasm.cpp b/src/devices/cpu/tms1000/tms1k_dasm.cpp similarity index 100% rename from src/devices/cpu/tms0980/tms1k_dasm.cpp rename to src/devices/cpu/tms1000/tms1k_dasm.cpp diff --git a/src/mame/drivers/microvsn.cpp b/src/mame/drivers/microvsn.cpp index 65a84d4ff92..e936ac16deb 100644 --- a/src/mame/drivers/microvsn.cpp +++ b/src/mame/drivers/microvsn.cpp @@ -17,7 +17,7 @@ of the games were clocked at around 500KHz, 550KHz, or 300KHz. #include "emu.h" #include "cpu/mcs48/mcs48.h" -#include "cpu/tms0980/tms1000.h" +#include "cpu/tms1000/tms1000.h" #include "sound/dac.h" #include "rendlay.h" diff --git a/src/mame/includes/hh_tms1k.h b/src/mame/includes/hh_tms1k.h index 3b9db9aa1b6..aa1c2da67aa 100644 --- a/src/mame/includes/hh_tms1k.h +++ b/src/mame/includes/hh_tms1k.h @@ -11,7 +11,7 @@ #include "emu.h" -#include "cpu/tms0980/tms1000.h" +#include "cpu/tms1000/tms1000.h" #include "sound/speaker.h" From d76a9644cf97730775906a4bc836d6f588989430 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 16 Mar 2016 02:59:29 +0100 Subject: [PATCH 12/48] tms1k: split part 3, done --- scripts/src/cpu.lua | 20 +- src/devices/cpu/tms1000/tms0270.cpp | 181 ++++++ src/devices/cpu/tms1000/tms0270.h | 71 +++ src/devices/cpu/tms1000/tms0970.cpp | 161 +++++ src/devices/cpu/tms1000/tms0970.h | 57 ++ src/devices/cpu/tms1000/tms0980.cpp | 231 +++++++ src/devices/cpu/tms1000/tms0980.h | 60 ++ src/devices/cpu/tms1000/tms1000.cpp | 126 ++++ src/devices/cpu/tms1000/tms1000.h | 45 ++ src/devices/cpu/tms1000/tms1100.cpp | 87 +++ src/devices/cpu/tms1000/tms1100.h | 56 ++ src/devices/cpu/tms1000/tms1400.cpp | 143 +++++ src/devices/cpu/tms1000/tms1400.h | 61 ++ src/devices/cpu/tms1000/tms1k_base.cpp | 831 +------------------------ src/devices/cpu/tms1000/tms1k_base.h | 286 +-------- src/devices/cpu/tms1000/tp0320.cpp | 40 ++ src/devices/cpu/tms1000/tp0320.h | 32 + src/mame/drivers/microvsn.cpp | 4 +- src/mame/includes/hh_tms1k.h | 7 +- 19 files changed, 1383 insertions(+), 1116 deletions(-) create mode 100644 src/devices/cpu/tms1000/tms0270.cpp create mode 100644 src/devices/cpu/tms1000/tms0270.h create mode 100644 src/devices/cpu/tms1000/tms0970.cpp create mode 100644 src/devices/cpu/tms1000/tms0970.h create mode 100644 src/devices/cpu/tms1000/tms0980.cpp create mode 100644 src/devices/cpu/tms1000/tms0980.h create mode 100644 src/devices/cpu/tms1000/tms1000.cpp create mode 100644 src/devices/cpu/tms1000/tms1100.cpp create mode 100644 src/devices/cpu/tms1000/tms1100.h create mode 100644 src/devices/cpu/tms1000/tms1400.cpp create mode 100644 src/devices/cpu/tms1000/tms1400.h create mode 100644 src/devices/cpu/tms1000/tp0320.cpp create mode 100644 src/devices/cpu/tms1000/tp0320.h diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index c4e505bb37a..4d3f98a3e4c 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -1844,13 +1844,32 @@ end -------------------------------------------------- -- Texas Instruments TMS1000 series --@src/devices/cpu/tms1000/tms1000.h,CPUS["TMS1000"] = true +--@src/devices/cpu/tms1000/tms1100.h,CPUS["TMS1000"] = true +--@src/devices/cpu/tms1000/tms1400.h,CPUS["TMS1000"] = true +--@src/devices/cpu/tms1000/tms0970.h,CPUS["TMS1000"] = true +--@src/devices/cpu/tms1000/tms0980.h,CPUS["TMS1000"] = true +--@src/devices/cpu/tms1000/tms0270.h,CPUS["TMS1000"] = true +--@src/devices/cpu/tms1000/tp0320.h,CPUS["TMS1000"] = true -------------------------------------------------- if (CPUS["TMS1000"]~=null) then files { MAME_DIR .. "src/devices/cpu/tms1000/tms1k_base.cpp", MAME_DIR .. "src/devices/cpu/tms1000/tms1k_base.h", + MAME_DIR .. "src/devices/cpu/tms1000/tms1000.cpp", MAME_DIR .. "src/devices/cpu/tms1000/tms1000.h", + MAME_DIR .. "src/devices/cpu/tms1000/tms1100.cpp", + MAME_DIR .. "src/devices/cpu/tms1000/tms1100.h", + MAME_DIR .. "src/devices/cpu/tms1000/tms1400.cpp", + MAME_DIR .. "src/devices/cpu/tms1000/tms1400.h", + MAME_DIR .. "src/devices/cpu/tms1000/tms0970.cpp", + MAME_DIR .. "src/devices/cpu/tms1000/tms0970.h", + MAME_DIR .. "src/devices/cpu/tms1000/tms0980.cpp", + MAME_DIR .. "src/devices/cpu/tms1000/tms0980.h", + MAME_DIR .. "src/devices/cpu/tms1000/tms0270.cpp", + MAME_DIR .. "src/devices/cpu/tms1000/tms0270.h", + MAME_DIR .. "src/devices/cpu/tms1000/tp0320.cpp", + MAME_DIR .. "src/devices/cpu/tms1000/tp0320.h", } end @@ -1880,7 +1899,6 @@ end --@src/devices/cpu/tms9900/tms9900.h,CPUS["TMS9900"] = true --@src/devices/cpu/tms9900/tms9980a.h,CPUS["TMS9900"] = true --@src/devices/cpu/tms9900/tms9995.h,CPUS["TMS9900"] = true - -------------------------------------------------- if (CPUS["TMS9900"]~=null) then diff --git a/src/devices/cpu/tms1000/tms0270.cpp b/src/devices/cpu/tms1000/tms0270.cpp new file mode 100644 index 00000000000..fae494efc47 --- /dev/null +++ b/src/devices/cpu/tms1000/tms0270.cpp @@ -0,0 +1,181 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol, hap +/* + + TMS1000 family - TMS0270 + +*/ + +#include "tms0270.h" +#include "debugger.h" + +// TMS0270 is a TMS0980 with earrings and a new hat. The new changes look like a quick afterthought, almost hacky +// - RAM, ROM, and main instructions PLAs is the same as TMS0980 +// - 64-term microinstructions PLA between the RAM and ROM, supporting 20 microinstructions plus optional separate lines for custom opcode handling +// - 48-term output PLA above the RAM (rotate opla 90 degrees) +const device_type TMS0270 = &device_creator; // 40-pin DIP, 16 O pins, 8+ R pins (some R pins are internally hooked up to support more I/O) +// newer TMS0270 chips (eg. Speak & Math) have 42 pins + +// TMS0260 is same or similar? + + +// internal memory maps +static ADDRESS_MAP_START(program_11bit_9, AS_PROGRAM, 16, tms1k_base_device) + AM_RANGE(0x000, 0xfff) AM_ROM +ADDRESS_MAP_END + +static ADDRESS_MAP_START(data_64x9_as4, AS_DATA, 8, tms1k_base_device) + AM_RANGE(0x00, 0x7f) AM_RAM + AM_RANGE(0x80, 0x8f) AM_RAM AM_MIRROR(0x70) // DAM +ADDRESS_MAP_END + + +// device definitions +tms0270_cpu_device::tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms0980_cpu_device(mconfig, TMS0270, "TMS0270", tag, owner, clock, 16 /* o pins */, 16 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_11bit_9), 8 /* data width */, ADDRESS_MAP_NAME(data_64x9_as4), "tms0270", __FILE__) + , m_read_ctl(*this) + , m_write_ctl(*this) + , m_write_pdc(*this) +{ } + + +// machine configs +static MACHINE_CONFIG_FRAGMENT(tms0270) + + // main opcodes PLA, microinstructions PLA, output PLA + MCFG_PLA_ADD("ipla", 9, 22, 24) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) + MCFG_PLA_ADD("mpla", 6, 22, 64) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) + MCFG_PLA_ADD("opla", 6, 16, 48) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) +MACHINE_CONFIG_END + +machine_config_constructor tms0270_cpu_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME(tms0270); +} + + +// device_start/reset +void tms0270_cpu_device::device_start() +{ + // common init + tms1k_base_device::device_start(); + + m_read_ctl.resolve_safe(0); + m_write_ctl.resolve_safe(); + m_write_pdc.resolve_safe(); + + // zerofill + m_r_prev = 0; + m_chipsel = 0; + m_ctl_dir = 0; + m_ctl_out = 0; + m_pdc = -1; // ! + + m_o_latch_low = 0; + m_o_latch = 0; + m_o_latch_prev = 0; + + // register for savestates + save_item(NAME(m_r_prev)); + save_item(NAME(m_chipsel)); + save_item(NAME(m_ctl_dir)); + save_item(NAME(m_ctl_out)); + save_item(NAME(m_pdc)); + + save_item(NAME(m_o_latch_low)); + save_item(NAME(m_o_latch)); + save_item(NAME(m_o_latch_prev)); +} + +void tms0270_cpu_device::device_reset() +{ + // common reset + tms0980_cpu_device::device_reset(); + + m_o_latch_low = 0; + m_o_latch = 0; + m_o_latch_prev = 0; +} + + +// i/o handling +void tms0270_cpu_device::dynamic_output() +{ + // R11: TMS5100 CTL port direction (0=read from TMS5100, 1=write to TMS5100) + m_ctl_dir = m_r >> 11 & 1; + + // R12: chip select (off=display via OPLA, on=TMS5100 via ACC/CKB) + m_chipsel = m_r >> 12 & 1; + + if (m_chipsel) + { + // ACC via SEG G,B,C,D: TMS5100 CTL pins + if (m_ctl_dir && m_a != m_ctl_out) + { + m_ctl_out = m_a; + m_write_ctl(0, m_ctl_out, 0xff); + } + + // R10 via SEG E: TMS5100 PDC pin + if (m_pdc != (m_r >> 10 & 1)) + { + m_pdc = m_r >> 10 & 1; + m_write_pdc(m_pdc); + } + } + else + { + // standard O-output + if (m_o_latch != m_o_latch_prev) + { + write_o_output(m_o_latch); + m_o_latch_prev = m_o_latch; + } + } + + // standard R-output + if (m_r != m_r_prev) + { + m_write_r(0, m_r & m_r_mask, 0xffff); + m_r_prev = m_r; + } +} + +UINT8 tms0270_cpu_device::read_k_input() +{ + // external: TMS5100 CTL port via SEG G,B,C,D + if (m_chipsel) + return (m_ctl_dir) ? m_ctl_out : m_read_ctl(0, 0xff) & 0xf; + + // standard K-input otherwise + UINT8 k = m_read_k(0, 0xff) & 0x1f; + return (k & 0x10) ? 0xf : k; // the TMS0270 KF line asserts all K-inputs +} + + +// opcode deviations +void tms0270_cpu_device::op_setr() +{ + // same as default, but handle write to output in dynamic_output + m_r = m_r | (1 << m_y); +} + +void tms0270_cpu_device::op_rstr() +{ + // same as default, but handle write to output in dynamic_output + m_r = m_r & ~(1 << m_y); +} + +void tms0270_cpu_device::op_tdo() +{ + // TDO: transfer data out + if (m_status) + m_o_latch_low = m_a; + else + m_o_latch = m_o_latch_low | (m_a << 4 & 0x30); + + // write to output is done in dynamic_output +} diff --git a/src/devices/cpu/tms1000/tms0270.h b/src/devices/cpu/tms1000/tms0270.h new file mode 100644 index 00000000000..6d4e0142f3a --- /dev/null +++ b/src/devices/cpu/tms1000/tms0270.h @@ -0,0 +1,71 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol, hap +/* + + TMS1000 family - TMS0270 + +*/ + +#ifndef _TMS0270_H_ +#define _TMS0270_H_ + +#include "tms0980.h" + + +// TMS0270 was designed to interface with TMS5100, set it up at driver level +#define MCFG_TMS0270_READ_CTL_CB(_devcb) \ + tms0270_cpu_device::set_read_ctl_callback(*device, DEVCB_##_devcb); + +#define MCFG_TMS0270_WRITE_CTL_CB(_devcb) \ + tms0270_cpu_device::set_write_ctl_callback(*device, DEVCB_##_devcb); + +#define MCFG_TMS0270_WRITE_PDC_CB(_devcb) \ + tms0270_cpu_device::set_write_pdc_callback(*device, DEVCB_##_devcb); + + +class tms0270_cpu_device : public tms0980_cpu_device +{ +public: + tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // static configuration helpers + template static devcb_base &set_read_ctl_callback(device_t &device, _Object object) { return downcast(device).m_read_ctl.set_callback(object); } + template static devcb_base &set_write_ctl_callback(device_t &device, _Object object) { return downcast(device).m_write_ctl.set_callback(object); } + template static devcb_base &set_write_pdc_callback(device_t &device, _Object object) { return downcast(device).m_write_pdc.set_callback(object); } + +protected: + // overrides + virtual void device_start() override; + virtual void device_reset() override; + + virtual machine_config_constructor device_mconfig_additions() const override; + + virtual void write_o_output(UINT8 index) override { tms1k_base_device::write_o_output(index); } + virtual UINT8 read_k_input() override; + virtual void dynamic_output() override; + + virtual void op_setr() override; + virtual void op_rstr() override; + virtual void op_tdo() override; + +private: + // state specific to interface with TMS5100 + UINT16 m_r_prev; + UINT8 m_chipsel; + UINT8 m_ctl_out; + UINT8 m_ctl_dir; + int m_pdc; + + UINT8 m_o_latch_low; + UINT8 m_o_latch; + UINT8 m_o_latch_prev; + + devcb_read8 m_read_ctl; + devcb_write8 m_write_ctl; + devcb_write_line m_write_pdc; +}; + + +extern const device_type TMS0270; + +#endif /* _TMS0270_H_ */ diff --git a/src/devices/cpu/tms1000/tms0970.cpp b/src/devices/cpu/tms1000/tms0970.cpp new file mode 100644 index 00000000000..2eabe847bb9 --- /dev/null +++ b/src/devices/cpu/tms1000/tms0970.cpp @@ -0,0 +1,161 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol, hap +/* + + TMS1000 family - TMS0950, TMS0970, TMS1990 + +*/ + +#include "tms0970.h" +#include "debugger.h" + +// TMS0950 is a TMS1000 with a TMS0980 style opla, it was quickly succeeded by the TMS0970 +// - RAM, ROM, microinstructions is the same as TMS1000 +// - 10-term inverted output PLA and segment PLA on the top-left +const device_type TMS0950 = &device_creator; // 28-pin DIP, 8 O pins, 11? R pins + +// TMS0970 is a stripped-down version of the TMS0980, itself acting more like a TMS1000 +// - RAM and ROM is the same as TMS1000 +// - main instructions PLAs at the top half, to the right of the midline +// * see TMS0980 notes, except that the fixed instruction list differs: +// RETN, SETR, RBIT, SBIT, LDX, COMX, TDO, ..., redir(----0-00), LDP +// - 32-term microinstructions PLA between the RAM and ROM, supporting 15 microinstructions +// - 16-term inverted output PLA and segment PLA above the RAM (rotate opla 90 degrees) +const device_type TMS0970 = &device_creator; // 28-pin DIP, 11 R pins (note: pinout may slightly differ from chip to chip) +const device_type TMS1990 = &device_creator; // 28-pin DIP, ? R pins.. + + +// internal memory maps +static ADDRESS_MAP_START(program_10bit_8, AS_PROGRAM, 8, tms1k_base_device) + AM_RANGE(0x000, 0x3ff) AM_ROM +ADDRESS_MAP_END + +static ADDRESS_MAP_START(data_64x4, AS_DATA, 8, tms1k_base_device) + AM_RANGE(0x00, 0x3f) AM_RAM +ADDRESS_MAP_END + + +// device definitions +tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms1000_cpu_device(mconfig, TMS0970, "TMS0970", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 2 /* x width */, 10 /* prg width */, ADDRESS_MAP_NAME(program_10bit_8), 6 /* data width */, ADDRESS_MAP_NAME(data_64x4), "tms0970", __FILE__) +{ } + +tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) + : tms1000_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) +{ } + +tms0950_cpu_device::tms0950_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms0970_cpu_device(mconfig, TMS0950, "TMS0950", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms0950", __FILE__) +{ } + +tms1990_cpu_device::tms1990_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms0970_cpu_device(mconfig, TMS1990, "TMS1990", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1990", __FILE__) +{ } + + +// machine configs +static MACHINE_CONFIG_FRAGMENT(tms0950) + + // microinstructions PLA, output PLA, segment PLA + MCFG_PLA_ADD("mpla", 8, 16, 30) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) + MCFG_PLA_ADD("opla", 4, 8, 10) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) + MCFG_PLA_ADD("spla", 3, 8, 8) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) +MACHINE_CONFIG_END + +machine_config_constructor tms0950_cpu_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME(tms0950); +} + +static MACHINE_CONFIG_FRAGMENT(tms0970) + + // main opcodes PLA, microinstructions PLA, output PLA, segment PLA + MCFG_PLA_ADD("ipla", 8, 15, 18) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) + MCFG_PLA_ADD("mpla", 5, 15, 32) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) + MCFG_PLA_ADD("opla", 4, 8, 16) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) + MCFG_PLA_ADD("spla", 3, 8, 8) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) +MACHINE_CONFIG_END + +machine_config_constructor tms0970_cpu_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME(tms0970); +} + + +// device_reset +void tms0970_cpu_device::device_reset() +{ + // common reset + tms1k_base_device::device_reset(); + + // pre-decode instructionset + m_fixed_decode.resize(0x100); + memset(&m_fixed_decode[0], 0, 0x100*sizeof(UINT32)); + m_micro_decode.resize(0x100); + memset(&m_micro_decode[0], 0, 0x100*sizeof(UINT32)); + + for (int op = 0; op < 0x100; op++) + { + // upper half of the opcodes is always branch/call + if (op & 0x80) + m_fixed_decode[op] = (op & 0x40) ? F_CALL: F_BR; + + // 5 output bits select a microinstruction index + UINT32 imask = m_ipla->read(op); + UINT8 msel = imask & 0x1f; + + // but if (from bottom to top) term 1 is active and output bit 5 is 0, R2,R4-R7 directly select a microinstruction index + if (imask & 0x40 && (imask & 0x20) == 0) + msel = (op & 0xf) | (op >> 1 & 0x10); + + msel = BITSWAP8(msel,7,6,5,0,1,2,3,4); // lines are reversed + UINT32 mmask = m_mpla->read(msel); + mmask ^= 0x09fe; // invert active-negative + + // _____ _____ _____ _____ ______ _____ ______ _____ _____ + const UINT32 md[15] = { M_CKM, M_CKP, M_YTP, M_MTP, M_ATN, M_NATN, M_MTN, M_15TN, M_CKN, M_NE, M_C8, M_CIN, M_AUTA, M_AUTY, M_STO }; + + for (int bit = 0; bit < 15; bit++) + if (mmask & (1 << bit)) + m_micro_decode[op] |= md[bit]; + + // the other ipla terms each select a fixed instruction + const UINT32 id[8] = { F_LDP, F_TDO, F_COMX, F_LDX, F_SBIT, F_RBIT, F_SETR, F_RETN }; + + for (int bit = 0; bit < 8; bit++) + if (imask & (0x80 << bit)) + m_fixed_decode[op] |= id[bit]; + } +} + + +// i/o handling +void tms0970_cpu_device::write_o_output(UINT8 index) +{ + m_o = m_spla->read(index); + m_write_o(0, m_o & m_o_mask, 0xffff); +} + + +// opcode deviations +void tms0970_cpu_device::op_setr() +{ + // SETR: set output register + // DDIG line is a coincidence between the selected output pla row(s) and segment pla row(s) + int ddig = (m_opla->read(m_a) & m_o) ? 1 : 0; + m_r = (m_r & ~(1 << m_y)) | (ddig << m_y); +} + +void tms0970_cpu_device::op_tdo() +{ + // TDO: transfer digits to output + write_o_output(m_a & 0x7); + m_write_r(0, m_r & m_r_mask, 0xffff); +} diff --git a/src/devices/cpu/tms1000/tms0970.h b/src/devices/cpu/tms1000/tms0970.h new file mode 100644 index 00000000000..627dfa24c69 --- /dev/null +++ b/src/devices/cpu/tms1000/tms0970.h @@ -0,0 +1,57 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol, hap +/* + + TMS1000 family - TMS0950, TMS0970, TMS1990 + +*/ + +#ifndef _TMS0970_H_ +#define _TMS0970_H_ + +#include "tms1000.h" + + +class tms0970_cpu_device : public tms1000_cpu_device +{ +public: + tms0970_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms0970_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); + +protected: + // overrides + virtual void device_reset() override; + virtual machine_config_constructor device_mconfig_additions() const override; + + virtual void write_o_output(UINT8 index) override; + + virtual void op_setr() override; + virtual void op_tdo() override; +}; + +class tms0950_cpu_device : public tms0970_cpu_device +{ +public: + tms0950_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + // overrides + virtual void device_reset() override { tms1000_cpu_device::device_reset(); } + virtual machine_config_constructor device_mconfig_additions() const override; + + virtual void op_rstr() override { ; } // assume it has no RSTR or CLO + virtual void op_clo() override { ; } // " +}; + +class tms1990_cpu_device : public tms0970_cpu_device +{ +public: + tms1990_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + +extern const device_type TMS0950; +extern const device_type TMS0970; +extern const device_type TMS1990; + +#endif /* _TMS0970_H_ */ diff --git a/src/devices/cpu/tms1000/tms0980.cpp b/src/devices/cpu/tms1000/tms0980.cpp new file mode 100644 index 00000000000..cda96386b38 --- /dev/null +++ b/src/devices/cpu/tms1000/tms0980.cpp @@ -0,0 +1,231 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol, hap +/* + + TMS1000 family - TMS0980, TMS1980 + +*/ + +#include "tms0980.h" +#include "debugger.h" + +// TMS0980 +// - 64x9bit RAM array at the bottom-left (set up as 144x4) +// - 2048x9bit ROM array at the bottom-left +// - main instructions PLAs at the top half, to the right of the midline +// * top section is assumed to be the CKI bus select +// * middle section is for microinstruction redirection, this part may differ per die +// * rest is fixed instructions select, from top-to-bottom: SEAC, LDX, COMX, COMX8, +// TDO, SBIT, RETN, SETR, REAC, XDA, SAL, RBIT, ..., OFF, SBL, LDP, redir(------00- + R0^BL) +// - 64-term microinstructions PLA between the RAM and ROM, supporting 20 microinstructions +// - 16-term inverted output PLA and segment PLA above the RAM (rotate opla 90 degrees) +const device_type TMS0980 = &device_creator; // 28-pin DIP, 9 R pins + +// TMS1980 is a TMS0980 with a TMS1x00 style opla +// - RAM, ROM, and main instructions PLAs is the same as TMS0980 +// - one of the microinstructions redirects to a RSTR instruction, like on TMS0270 +// - 32-term inverted output PLA above the RAM, 7 bits! (rotate opla 270 degrees) +const device_type TMS1980 = &device_creator; // 28-pin DIP, 7 O pins, 10 R pins, high voltage + + +// internal memory maps +static ADDRESS_MAP_START(program_11bit_9, AS_PROGRAM, 16, tms1k_base_device) + AM_RANGE(0x000, 0xfff) AM_ROM +ADDRESS_MAP_END + +static ADDRESS_MAP_START(data_64x9_as4, AS_DATA, 8, tms1k_base_device) + AM_RANGE(0x00, 0x7f) AM_RAM + AM_RANGE(0x80, 0x8f) AM_RAM AM_MIRROR(0x70) // DAM +ADDRESS_MAP_END + + +// device definitions +tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms0970_cpu_device(mconfig, TMS0980, "TMS0980", tag, owner, clock, 8 /* o pins */, 9 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_11bit_9), 8 /* data width */, ADDRESS_MAP_NAME(data_64x9_as4), "tms0980", __FILE__) +{ } + +tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) + : tms0970_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) +{ } + +tms1980_cpu_device::tms1980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms0980_cpu_device(mconfig, TMS1980, "TMS1980", tag, owner, clock, 7, 10, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tms1980", __FILE__) +{ } + + +// machine configs +static MACHINE_CONFIG_FRAGMENT(tms0980) + + // main opcodes PLA, microinstructions PLA, output PLA, segment PLA + MCFG_PLA_ADD("ipla", 9, 22, 24) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) + MCFG_PLA_ADD("mpla", 6, 20, 64) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) + MCFG_PLA_ADD("opla", 4, 8, 16) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) + MCFG_PLA_ADD("spla", 3, 8, 8) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) +MACHINE_CONFIG_END + +machine_config_constructor tms0980_cpu_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME(tms0980); +} + +static MACHINE_CONFIG_FRAGMENT(tms1980) + + // main opcodes PLA, microinstructions PLA, output PLA + MCFG_PLA_ADD("ipla", 9, 22, 24) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) + MCFG_PLA_ADD("mpla", 6, 22, 64) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) + MCFG_PLA_ADD("opla", 5, 7, 32) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) +MACHINE_CONFIG_END + +machine_config_constructor tms1980_cpu_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME(tms1980); +} + + +// disasm +offs_t tms0980_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +{ + extern CPU_DISASSEMBLE(tms0980); + return CPU_DISASSEMBLE_NAME(tms0980)(this, buffer, pc, oprom, opram, options); +} + + +// device_reset +UINT32 tms0980_cpu_device::decode_micro(UINT8 sel) +{ + UINT32 decode = 0; + + sel = BITSWAP8(sel,7,6,0,1,2,3,4,5); // lines are reversed + UINT32 mask = m_mpla->read(sel); + mask ^= 0x43fc3; // invert active-negative + + // M_RSTR is specific to TMS02x0/TMS1980, it redirects to F_RSTR + // M_UNK1 is specific to TMS0270, unknown/unused yet and apparently not connected on every TMS0270 + // _______ ______ _____ _____ _____ _____ ______ _____ ______ _____ _____ + const UINT32 md[22] = { M_NDMTP, M_DMTP, M_AUTY, M_AUTA, M_CKM, M_SSE, M_CKP, M_YTP, M_MTP, M_ATN, M_NATN, M_MTN, M_15TN, M_CKN, M_NE, M_C8, M_SSS, M_CME, M_CIN, M_STO, M_RSTR, M_UNK1 }; + + for (int bit = 0; bit < 22 && bit < m_mpla->outputs(); bit++) + if (mask & (1 << bit)) + decode |= md[bit]; + + return decode; +} + +void tms0980_cpu_device::device_reset() +{ + // common reset + tms1k_base_device::device_reset(); + + // pre-decode instructionset + m_fixed_decode.resize(0x200); + memset(&m_fixed_decode[0], 0, 0x200*sizeof(UINT32)); + m_micro_decode.resize(0x200); + memset(&m_micro_decode[0], 0, 0x200*sizeof(UINT32)); + + for (int op = 0; op < 0x200; op++) + { + // upper half of the opcodes is always branch/call + if (op & 0x100) + m_fixed_decode[op] = (op & 0x80) ? F_CALL: F_BR; + + UINT32 imask = m_ipla->read(op); + + // 6 output bits select a microinstruction index + m_micro_decode[op] = decode_micro(imask & 0x3f); + + // the other ipla terms each select a fixed instruction + const UINT32 id[15] = { F_LDP, F_SBL, F_OFF, F_RBIT, F_SAL, F_XDA, F_REAC, F_SETR, F_RETN, F_SBIT, F_TDO, F_COMX8, F_COMX, F_LDX, F_SEAC }; + + for (int bit = 0; bit < 15; bit++) + if (imask & (0x80 << bit)) + m_fixed_decode[op] |= id[bit]; + } + + // like on TMS0970, one of the terms directly select a microinstruction index (via R4-R8), + // but it can't be pre-determined when it's active + m_micro_direct.resize(0x40); + memset(&m_micro_decode[0], 0, 0x40*sizeof(UINT32)); + + for (int op = 0; op < 0x40; op++) + m_micro_direct[op] = decode_micro(op); +} + + +// program counter/opcode decode +void tms0980_cpu_device::read_opcode() +{ + debugger_instruction_hook(this, m_rom_address << 1); + m_opcode = m_program->read_word(m_rom_address << 1) & 0x1ff; + m_c4 = BITSWAP8(m_opcode,7,6,5,4,0,1,2,3) & 0xf; // opcode operand is bitswapped for most opcodes + + m_fixed = m_fixed_decode[m_opcode]; + + // if ipla term 0 is active, R4-R8 directly select a microinstruction index when R0 or R0^BL is 0 + int r0 = m_opcode >> 8 & 1; + if (m_ipla->read(m_opcode) & 0x40 && !((r0 & m_bl) ^ r0)) + m_micro = m_micro_direct[m_opcode & 0x3f]; + else + m_micro = m_micro_decode[m_opcode]; + + // redirect mpla fixed instructions + if (m_micro & M_RSTR) m_fixed |= F_RSTR; + if (m_micro & M_SETR) m_fixed |= F_SETR; + + next_pc(); +} + + +// i/o handling +UINT8 tms0980_cpu_device::read_k_input() +{ + UINT8 k = m_read_k(0, 0xff) & 0x1f; + UINT8 k3 = (k & 0x10) ? 3: 0; // the TMS0980 K3 line is simply K1|K2 + return (k & 0xf) | k3; +} + +void tms0980_cpu_device::set_cki_bus() +{ + switch (m_opcode & 0x1f8) + { + // 000001XXX: K-inputs + case 0x008: + m_cki_bus = read_k_input(); + break; + + // 0X0100XXX: select bit + case 0x020: case 0x0a0: + m_cki_bus = 1 << (m_c4 >> 2) ^ 0xf; + break; + + // 0X1XXXXXX: constant + case 0x040: case 0x048: case 0x050: case 0x058: case 0x060: case 0x068: case 0x070: case 0x078: + case 0x0c0: case 0x0c8: case 0x0d0: case 0x0d8: case 0x0e0: case 0x0e8: case 0x0f0: case 0x0f8: + m_cki_bus = m_c4; + break; + + default: + m_cki_bus = 0; + break; + } +} + + +// opcode deviations +void tms0980_cpu_device::op_comx() +{ + // COMX: complement X register, but not the MSB + m_x ^= (m_x_mask >> 1); +} + +void tms1980_cpu_device::op_tdo() +{ + // TDO: transfer accumulator and status(not status_latch!) to O-output + write_o_output(m_status << 4 | m_a); +} diff --git a/src/devices/cpu/tms1000/tms0980.h b/src/devices/cpu/tms1000/tms0980.h new file mode 100644 index 00000000000..793c32cb1fc --- /dev/null +++ b/src/devices/cpu/tms1000/tms0980.h @@ -0,0 +1,60 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol, hap +/* + + TMS1000 family - TMS0980, TMS1980 + +*/ + +#ifndef _TMS0980_H_ +#define _TMS0980_H_ + +#include "tms0970.h" + + +class tms0980_cpu_device : public tms0970_cpu_device +{ +public: + tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); + +protected: + // overrides + virtual void device_reset() override; + + virtual machine_config_constructor device_mconfig_additions() const override; + + virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } + virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + + virtual UINT8 read_k_input() override; + virtual void set_cki_bus() override; + virtual void read_opcode() override; + + virtual void op_comx() override; + + UINT32 decode_micro(UINT8 sel); +}; + +class tms1980_cpu_device : public tms0980_cpu_device +{ +public: + tms1980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + // overrides + virtual machine_config_constructor device_mconfig_additions() const override; + + virtual void write_o_output(UINT8 index) override { tms1k_base_device::write_o_output(index); } + virtual UINT8 read_k_input() override { return tms1k_base_device::read_k_input(); } + + virtual void op_setr() override { tms1k_base_device::op_setr(); } + virtual void op_tdo() override; +}; + + +extern const device_type TMS0980; +extern const device_type TMS1980; + +#endif /* _TMS0980_H_ */ diff --git a/src/devices/cpu/tms1000/tms1000.cpp b/src/devices/cpu/tms1000/tms1000.cpp new file mode 100644 index 00000000000..2edb517155f --- /dev/null +++ b/src/devices/cpu/tms1000/tms1000.cpp @@ -0,0 +1,126 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol, hap +/* + + TMS1000 family - TMS1000, TMS1070, TMS1040, TMS1200 + +*/ + +#include "tms1000.h" +#include "debugger.h" + +// TMS1000 +// - 64x4bit RAM array at the bottom-left +// - 1024x8bit ROM array at the bottom-right +// * FYI, the row-selector to the left of it is laid out as: +// 3,4,11,12,19,20,27,28,35,36,43,44,51,52,59,60,0,7,8,15,16,23,24,31,32,39,40,47,48,55,56,63, +// 2,5,10,13,18,21,26,29,34,37,42,45,50,53,58,61,1,6,9,14,17,22,25,30,33,38,41,46,49,54,57,62 +// - 30-term microinstructions PLA(mpla) at the top half, to the right of the midline, supporting 16 microinstructions +// - 20-term output PLA(opla) at the top-left +// - the ALU is between the opla and mpla +const device_type TMS1000 = &device_creator; // 28-pin DIP, 11 R pins +const device_type TMS1070 = &device_creator; // high voltage version +const device_type TMS1040 = &device_creator; // same as TMS1070 with just a different pinout? +const device_type TMS1200 = &device_creator; // 40-pin DIP, 13 R pins +// TMS1270 has 10 O pins, how does that work? + + +// internal memory maps +static ADDRESS_MAP_START(program_10bit_8, AS_PROGRAM, 8, tms1k_base_device) + AM_RANGE(0x000, 0x3ff) AM_ROM +ADDRESS_MAP_END + +static ADDRESS_MAP_START(data_64x4, AS_DATA, 8, tms1k_base_device) + AM_RANGE(0x00, 0x3f) AM_RAM +ADDRESS_MAP_END + + +// device definitions +tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms1k_base_device(mconfig, TMS1000, "TMS1000", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 2 /* x width */, 10 /* prg width */, ADDRESS_MAP_NAME(program_10bit_8), 6 /* data width */, ADDRESS_MAP_NAME(data_64x4), "tms1000", __FILE__) +{ } + +tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) + : tms1k_base_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) +{ } + +tms1070_cpu_device::tms1070_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms1000_cpu_device(mconfig, TMS1070, "TMS1070", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1070", __FILE__) +{ } + +tms1040_cpu_device::tms1040_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms1000_cpu_device(mconfig, TMS1040, "TMS1040", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1040", __FILE__) +{ } + +tms1200_cpu_device::tms1200_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms1000_cpu_device(mconfig, TMS1200, "TMS1200", tag, owner, clock, 8, 13, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1200", __FILE__) +{ } + + +// machine configs +static MACHINE_CONFIG_FRAGMENT(tms1000) + + // microinstructions PLA, output PLA + MCFG_PLA_ADD("mpla", 8, 16, 30) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) + MCFG_PLA_ADD("opla", 5, 8, 20) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) +MACHINE_CONFIG_END + +machine_config_constructor tms1000_cpu_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME(tms1000); +} + + +// disasm +offs_t tms1000_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +{ + extern CPU_DISASSEMBLE(tms1000); + return CPU_DISASSEMBLE_NAME(tms1000)(this, buffer, pc, oprom, opram, options); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void tms1000_cpu_device::device_reset() +{ + // common reset + tms1k_base_device::device_reset(); + + // pre-decode instructionset + m_fixed_decode.resize(0x100); + memset(&m_fixed_decode[0], 0, 0x100*sizeof(UINT32)); + m_micro_decode.resize(0x100); + memset(&m_micro_decode[0], 0, 0x100*sizeof(UINT32)); + + for (int op = 0; op < 0x100; op++) + { + // _____ _____ ______ _____ ______ _____ _____ _____ _____ + const UINT32 md[16] = { M_STSL, M_AUTY, M_AUTA, M_CIN, M_C8, M_NE, M_CKN, M_15TN, M_MTN, M_NATN, M_ATN, M_MTP, M_YTP, M_CKP, M_CKM, M_STO }; + UINT16 mask = m_mpla->read(op); + mask ^= 0x3fc8; // invert active-negative + + for (int bit = 0; bit < 16; bit++) + if (mask & (1 << bit)) + m_micro_decode[op] |= md[bit]; + } + + // the fixed instruction set is not programmable + m_fixed_decode[0x00] = F_COMX; + m_fixed_decode[0x0a] = F_TDO; + m_fixed_decode[0x0b] = F_CLO; + m_fixed_decode[0x0c] = F_RSTR; + m_fixed_decode[0x0d] = F_SETR; + m_fixed_decode[0x0f] = F_RETN; + + for (int i = 0x10; i < 0x20; i++) m_fixed_decode[i] = F_LDP; + for (int i = 0x30; i < 0x34; i++) m_fixed_decode[i] = F_SBIT; + for (int i = 0x34; i < 0x38; i++) m_fixed_decode[i] = F_RBIT; + for (int i = 0x3c; i < 0x40; i++) m_fixed_decode[i] = F_LDX; + + for (int i = 0x80; i < 0xc0; i++) m_fixed_decode[i] = F_BR; + for (int i = 0xc0; i < 0x100; i++) m_fixed_decode[i] = F_CALL; +} diff --git a/src/devices/cpu/tms1000/tms1000.h b/src/devices/cpu/tms1000/tms1000.h index 8b042b78cf8..1a2d98822e5 100644 --- a/src/devices/cpu/tms1000/tms1000.h +++ b/src/devices/cpu/tms1000/tms1000.h @@ -1,5 +1,10 @@ // license:BSD-3-Clause // copyright-holders:Wilbert Pol, hap +/* + + TMS1000 family - TMS1000, TMS1070, TMS1040, TMS1200 + +*/ #ifndef _TMS1000_H_ #define _TMS1000_H_ @@ -7,4 +12,44 @@ #include "tms1k_base.h" +class tms1000_cpu_device : public tms1k_base_device +{ +public: + tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); + +protected: + // overrides + virtual void device_reset() override; + virtual machine_config_constructor device_mconfig_additions() const override; + + + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; +}; + +class tms1070_cpu_device : public tms1000_cpu_device +{ +public: + tms1070_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + +class tms1040_cpu_device : public tms1000_cpu_device +{ +public: + tms1040_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + +class tms1200_cpu_device : public tms1000_cpu_device +{ +public: + tms1200_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + +extern const device_type TMS1000; +extern const device_type TMS1070; +extern const device_type TMS1040; +extern const device_type TMS1200; + #endif /* _TMS1000_H_ */ diff --git a/src/devices/cpu/tms1000/tms1100.cpp b/src/devices/cpu/tms1000/tms1100.cpp new file mode 100644 index 00000000000..39b6ed70e6f --- /dev/null +++ b/src/devices/cpu/tms1000/tms1100.cpp @@ -0,0 +1,87 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol, hap +/* + + TMS1000 family - TMS1100, TMS1170, TMS1300, TMS1370 + +*/ + +#include "tms1100.h" +#include "debugger.h" + +// TMS1100 is nearly the same as TMS1000, some different opcodes, and with double the RAM and ROM +const device_type TMS1100 = &device_creator; // 28-pin DIP, 11 R pins +const device_type TMS1170 = &device_creator; // high voltage version +const device_type TMS1300 = &device_creator; // 40-pin DIP, 16 R pins +const device_type TMS1370 = &device_creator; // high voltage version + + +// internal memory maps +static ADDRESS_MAP_START(program_11bit_8, AS_PROGRAM, 8, tms1k_base_device) + AM_RANGE(0x000, 0x7ff) AM_ROM +ADDRESS_MAP_END + +static ADDRESS_MAP_START(data_128x4, AS_DATA, 8, tms1k_base_device) + AM_RANGE(0x00, 0x7f) AM_RAM +ADDRESS_MAP_END + + +// device definitions +tms1100_cpu_device::tms1100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms1000_cpu_device(mconfig, TMS1100, "TMS1100", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 3 /* x width */, 11 /* prg width */, ADDRESS_MAP_NAME(program_11bit_8), 7 /* data width */, ADDRESS_MAP_NAME(data_128x4), "tms1100", __FILE__) +{ } + +tms1100_cpu_device::tms1100_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) + : tms1000_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) +{ } + +tms1170_cpu_device::tms1170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms1100_cpu_device(mconfig, TMS1170, "TMS1170", tag, owner, clock, 8, 11, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1170", __FILE__) +{ } + +tms1300_cpu_device::tms1300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms1100_cpu_device(mconfig, TMS1300, "TMS1300", tag, owner, clock, 8, 16, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1300", __FILE__) +{ } + +tms1370_cpu_device::tms1370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms1100_cpu_device(mconfig, TMS1370, "TMS1370", tag, owner, clock, 8, 16, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1370", __FILE__) +{ } + + +// disasm +offs_t tms1100_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +{ + extern CPU_DISASSEMBLE(tms1100); + return CPU_DISASSEMBLE_NAME(tms1100)(this, buffer, pc, oprom, opram, options); +} + + +// device_reset +void tms1100_cpu_device::device_reset() +{ + tms1000_cpu_device::device_reset(); + + // small differences in 00-3f area + m_fixed_decode[0x00] = 0; + m_fixed_decode[0x09] = F_COMX8; // ! + m_fixed_decode[0x0b] = F_COMC; + + for (int i = 0x28; i < 0x30; i++) m_fixed_decode[i] = F_LDX; + for (int i = 0x3c; i < 0x40; i++) m_fixed_decode[i] = 0; +} + + +// opcode deviations +void tms1100_cpu_device::op_setr() +{ + // SETR: same, but X register MSB must be clear + if (~m_x & (1 << (m_x_bits-1))) + tms1k_base_device::op_setr(); +} + +void tms1100_cpu_device::op_rstr() +{ + // RSTR: same, but X register MSB must be clear + if (~m_x & (1 << (m_x_bits-1))) + tms1k_base_device::op_rstr(); +} diff --git a/src/devices/cpu/tms1000/tms1100.h b/src/devices/cpu/tms1000/tms1100.h new file mode 100644 index 00000000000..ae3c5868532 --- /dev/null +++ b/src/devices/cpu/tms1000/tms1100.h @@ -0,0 +1,56 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol, hap +/* + + TMS1000 family - TMS1100, TMS1170, TMS1300, TMS1370 + +*/ + +#ifndef _TMS1100_H_ +#define _TMS1100_H_ + +#include "tms1000.h" + + +class tms1100_cpu_device : public tms1000_cpu_device +{ +public: + tms1100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1100_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); + +protected: + // overrides + virtual void device_reset() override; + + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + + virtual void op_setr() override; + virtual void op_rstr() override; +}; + +class tms1170_cpu_device : public tms1100_cpu_device +{ +public: + tms1170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + +class tms1300_cpu_device : public tms1100_cpu_device +{ +public: + tms1300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + +class tms1370_cpu_device : public tms1100_cpu_device +{ +public: + tms1370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + +extern const device_type TMS1100; +extern const device_type TMS1170; +extern const device_type TMS1300; +extern const device_type TMS1370; + + +#endif /* _TMS1100_H_ */ diff --git a/src/devices/cpu/tms1000/tms1400.cpp b/src/devices/cpu/tms1000/tms1400.cpp new file mode 100644 index 00000000000..f1bada9c6c9 --- /dev/null +++ b/src/devices/cpu/tms1000/tms1400.cpp @@ -0,0 +1,143 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol, hap +/* + + TMS1000 family - TMS1400, TMS1470, TMS1600, TMS1670 + + TODO: + - emulate TMS1600 L-pins + +*/ + +#include "tms1400.h" +#include "debugger.h" + +// TMS1400 follows the TMS1100, it doubles the ROM size again (4 chapters of 16 pages), and adds a 3-level callstack +// - rotate the view and mirror the OR-mask to get the proper layout of the mpla, the default is identical to tms1100 +// - the opla size is increased from 20 to 32 terms +const device_type TMS1400 = &device_creator; // 28-pin DIP, 11 R pins (TMS1400CR is same, but with TMS1100 pinout) +const device_type TMS1470 = &device_creator; // high voltage version, 1 R pin removed for Vdd + +// TMS1600 adds more I/O to the TMS1400, input pins are doubled with added L1,2,4,8 +// - rotate the view and mirror the OR-mask to get the proper layout of the mpla, the default is identical to tms1100 +// - the opla size is increased from 20 to 32 terms +const device_type TMS1600 = &device_creator; // 40-pin DIP, 16 R pins +const device_type TMS1670 = &device_creator; // high voltage version + + +// internal memory maps +static ADDRESS_MAP_START(program_12bit_8, AS_PROGRAM, 8, tms1k_base_device) + AM_RANGE(0x000, 0xfff) AM_ROM +ADDRESS_MAP_END + +static ADDRESS_MAP_START(data_128x4, AS_DATA, 8, tms1k_base_device) + AM_RANGE(0x00, 0x7f) AM_RAM +ADDRESS_MAP_END + + +// device definitions +tms1400_cpu_device::tms1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms1100_cpu_device(mconfig, TMS1400, "TMS1400", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 3 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_12bit_8), 7 /* data width */, ADDRESS_MAP_NAME(data_128x4), "tms1400", __FILE__) +{ } + +tms1400_cpu_device::tms1400_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) + : tms1100_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) +{ } + +tms1470_cpu_device::tms1470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms1400_cpu_device(mconfig, TMS1470, "TMS1470", tag, owner, clock, 8, 10, 6, 8, 3, 12, ADDRESS_MAP_NAME(program_12bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1470", __FILE__) +{ } + + +tms1600_cpu_device::tms1600_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms1400_cpu_device(mconfig, TMS1600, "TMS1600", tag, owner, clock, 8, 16, 6, 8, 3, 12, ADDRESS_MAP_NAME(program_12bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1600", __FILE__) +{ } + +tms1600_cpu_device::tms1600_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) + : tms1400_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) +{ } + +tms1670_cpu_device::tms1670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms1600_cpu_device(mconfig, TMS1670, "TMS1670", tag, owner, clock, 8, 16, 6, 8, 3, 12, ADDRESS_MAP_NAME(program_12bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1670", __FILE__) +{ } + + +// machine configs +static MACHINE_CONFIG_FRAGMENT(tms1400) + + // microinstructions PLA, output PLA + MCFG_PLA_ADD("mpla", 8, 16, 30) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) + MCFG_PLA_ADD("opla", 5, 8, 32) + MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) +MACHINE_CONFIG_END + +machine_config_constructor tms1400_cpu_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME(tms1400); +} + + +// device_reset +void tms1400_cpu_device::device_reset() +{ + tms1100_cpu_device::device_reset(); + + // small differences in 00-3f area + m_fixed_decode[0x0b] = F_TPC; +} + + +// opcode deviations +void tms1400_cpu_device::op_br() +{ + // BR/BL: conditional branch + if (m_status) + { + m_pa = m_pb; // don't care about clatch + m_ca = m_cb; + m_pc = m_opcode & m_pc_mask; + } +} + +void tms1400_cpu_device::op_call() +{ + // CALL/CALLL: conditional call + if (m_status) + { + // 3-level stack, mask clatch 3 bits (no need to mask others) + m_clatch = (m_clatch << 1 | 1) & 7; + + m_sr = m_sr << m_pc_bits | m_pc; + m_pc = m_opcode & m_pc_mask; + + m_ps = m_ps << 4 | m_pa; + m_pa = m_pb; + + m_cs = m_cs << 2 | m_ca; + m_ca = m_cb; + } + else + { + m_pb = m_pa; + m_cb = m_ca; + } +} + +void tms1400_cpu_device::op_retn() +{ + // RETN: return from subroutine + if (m_clatch & 1) + { + m_clatch >>= 1; + + m_pc = m_sr & m_pc_mask; + m_sr >>= m_pc_bits; + + m_pa = m_pb = m_ps & 0xf; + m_ps >>= 4; + + m_ca = m_cb = m_cs & 3; + m_cs >>= 2; + } +} diff --git a/src/devices/cpu/tms1000/tms1400.h b/src/devices/cpu/tms1000/tms1400.h new file mode 100644 index 00000000000..f4c2f177d16 --- /dev/null +++ b/src/devices/cpu/tms1000/tms1400.h @@ -0,0 +1,61 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol, hap +/* + + TMS1000 family - TMS1400, TMS1470, TMS1600, TMS1670 + +*/ + +#ifndef _TMS1400_H_ +#define _TMS1400_H_ + +#include "tms1100.h" + + +class tms1400_cpu_device : public tms1100_cpu_device +{ +public: + tms1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1400_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); + +protected: + // overrides + virtual void device_reset() override; + virtual machine_config_constructor device_mconfig_additions() const override; + + virtual void op_br() override; + virtual void op_call() override; + virtual void op_retn() override; + + virtual void op_setr() override { tms1k_base_device::op_setr(); } // no anomaly with MSB of X register + virtual void op_rstr() override { tms1k_base_device::op_rstr(); } // " +}; + +class tms1470_cpu_device : public tms1400_cpu_device +{ +public: + tms1470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + +class tms1600_cpu_device : public tms1400_cpu_device +{ +public: + tms1600_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1600_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); +}; + +class tms1670_cpu_device : public tms1600_cpu_device +{ +public: + tms1670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + +extern const device_type TMS1400; +extern const device_type TMS1470; +extern const device_type TMS1600; +extern const device_type TMS1670; + + +#endif /* _TMS1400_H_ */ diff --git a/src/devices/cpu/tms1000/tms1k_base.cpp b/src/devices/cpu/tms1000/tms1k_base.cpp index b09d8b11273..10e041b5104 100644 --- a/src/devices/cpu/tms1000/tms1k_base.cpp +++ b/src/devices/cpu/tms1000/tms1k_base.cpp @@ -2,10 +2,9 @@ // copyright-holders:Wilbert Pol, hap /* - TMS0980/TMS1000-family MCU cores + TMS1000 family - base/shared TODO: - - emulate TMS1600 L-pins - fix debugger disasm view @@ -69,378 +68,7 @@ unknown cycle: CME, SSE, SSS #include "tms1k_base.h" #include "debugger.h" -// supported types: -// note: dice information assumes the orientation is pictured with RAM at the bottom-left, except where noted - -// TMS1000 -// - 64x4bit RAM array at the bottom-left -// - 1024x8bit ROM array at the bottom-right -// * FYI, the row-selector to the left of it is laid out as: -// 3,4,11,12,19,20,27,28,35,36,43,44,51,52,59,60,0,7,8,15,16,23,24,31,32,39,40,47,48,55,56,63, -// 2,5,10,13,18,21,26,29,34,37,42,45,50,53,58,61,1,6,9,14,17,22,25,30,33,38,41,46,49,54,57,62 -// - 30-term microinstructions PLA(mpla) at the top half, to the right of the midline, supporting 16 microinstructions -// - 20-term output PLA(opla) at the top-left -// - the ALU is between the opla and mpla -const device_type TMS1000 = &device_creator; // 28-pin DIP, 11 R pins -const device_type TMS1070 = &device_creator; // high voltage version -const device_type TMS1040 = &device_creator; // same as TMS1070 with just a different pinout? -const device_type TMS1200 = &device_creator; // 40-pin DIP, 13 R pins -// TMS1270 has 10 O pins, how does that work? - -// TMS1100 is nearly the same as TMS1000, some different opcodes, and with double the RAM and ROM -const device_type TMS1100 = &device_creator; // 28-pin DIP, 11 R pins -const device_type TMS1170 = &device_creator; // high voltage version -const device_type TMS1300 = &device_creator; // 40-pin DIP, 16 R pins -const device_type TMS1370 = &device_creator; // high voltage version - -// TMS1400 follows the TMS1100, it doubles the ROM size again (4 chapters of 16 pages), and adds a 3-level callstack -// - rotate the view and mirror the OR-mask to get the proper layout of the mpla, the default is identical to tms1100 -// - the opla size is increased from 20 to 32 terms -const device_type TMS1400 = &device_creator; // 28-pin DIP, 11 R pins (TMS1400CR is same, but with TMS1100 pinout) -const device_type TMS1470 = &device_creator; // high voltage version, 1 R pin removed for Vdd - -// TMS1600 adds more I/O to the TMS1400, input pins are doubled with added L1,2,4,8 -// - rotate the view and mirror the OR-mask to get the proper layout of the mpla, the default is identical to tms1100 -// - the opla size is increased from 20 to 32 terms -const device_type TMS1600 = &device_creator; // 40-pin DIP, 16 R pins -const device_type TMS1670 = &device_creator; // high voltage version - -// TMS0980 -// - 64x9bit RAM array at the bottom-left (set up as 144x4) -// - 2048x9bit ROM array at the bottom-left -// - main instructions PLAs at the top half, to the right of the midline -// * top section is assumed to be the CKI bus select -// * middle section is for microinstruction redirection, this part may differ per die -// * rest is fixed instructions select, from top-to-bottom: SEAC, LDX, COMX, COMX8, -// TDO, SBIT, RETN, SETR, REAC, XDA, SAL, RBIT, ..., OFF, SBL, LDP, redir(------00- + R0^BL) -// - 64-term microinstructions PLA between the RAM and ROM, supporting 20 microinstructions -// - 16-term inverted output PLA and segment PLA above the RAM (rotate opla 90 degrees) -const device_type TMS0980 = &device_creator; // 28-pin DIP, 9 R pins - -// TMS1980 is a TMS0980 with a TMS1x00 style opla -// - RAM, ROM, and main instructions PLAs is the same as TMS0980 -// - one of the microinstructions redirects to a RSTR instruction, like on TMS0270 -// - 32-term inverted output PLA above the RAM, 7 bits! (rotate opla 270 degrees) -const device_type TMS1980 = &device_creator; // 28-pin DIP, 7 O pins, 10 R pins, high voltage - -// TMS0950 is a TMS1000 with a TMS0980 style opla, it was quickly succeeded by the TMS0970 -// - RAM, ROM, microinstructions is the same as TMS1000 -// - 10-term inverted output PLA and segment PLA on the top-left -const device_type TMS0950 = &device_creator; // 28-pin DIP, 8 O pins, 11? R pins - -// TMS0970 is a stripped-down version of the TMS0980, itself acting more like a TMS1000 -// - RAM and ROM is the same as TMS1000 -// - main instructions PLAs at the top half, to the right of the midline -// * see TMS0980 notes, except that the fixed instruction list differs: -// RETN, SETR, RBIT, SBIT, LDX, COMX, TDO, ..., redir(----0-00), LDP -// - 32-term microinstructions PLA between the RAM and ROM, supporting 15 microinstructions -// - 16-term inverted output PLA and segment PLA above the RAM (rotate opla 90 degrees) -const device_type TMS0970 = &device_creator; // 28-pin DIP, 11 R pins (note: pinout may slightly differ from chip to chip) -const device_type TMS1990 = &device_creator; // 28-pin DIP, ? R pins.. - -// TMS0270 on the other hand, is a TMS0980 with earrings and a new hat. The new changes look like a quick afterthought, almost hacky -// - RAM, ROM, and main instructions PLAs is the same as TMS0980 -// - 64-term microinstructions PLA between the RAM and ROM, supporting 20 microinstructions plus optional separate lines for custom opcode handling -// - 48-term output PLA above the RAM (rotate opla 90 degrees) -const device_type TMS0270 = &device_creator; // 40-pin DIP, 16 O pins, 8+ R pins (some R pins are internally hooked up to support more I/O) -// newer TMS0270 chips (eg. Speak & Math) have 42 pins -// TMS0260 is same or similar? - -// TP0320 is TI's first CMOS MCU with integrated LCD controller, the die is still very similar to TMS0980 -// - ROM and main RAM is same as on TMS0980 with different row-select -// - -const device_type TP0320 = &device_creator; // 28-pin SDIP, .. - - -// internal memory maps -static ADDRESS_MAP_START(program_11bit_9, AS_PROGRAM, 16, tms1k_base_device) - AM_RANGE(0x000, 0xfff) AM_ROM -ADDRESS_MAP_END - -static ADDRESS_MAP_START(program_10bit_8, AS_PROGRAM, 8, tms1k_base_device) - AM_RANGE(0x000, 0x3ff) AM_ROM -ADDRESS_MAP_END - -static ADDRESS_MAP_START(program_11bit_8, AS_PROGRAM, 8, tms1k_base_device) - AM_RANGE(0x000, 0x7ff) AM_ROM -ADDRESS_MAP_END - -static ADDRESS_MAP_START(program_12bit_8, AS_PROGRAM, 8, tms1k_base_device) - AM_RANGE(0x000, 0xfff) AM_ROM -ADDRESS_MAP_END - - -static ADDRESS_MAP_START(data_64x4, AS_DATA, 8, tms1k_base_device) - AM_RANGE(0x00, 0x3f) AM_RAM -ADDRESS_MAP_END - -static ADDRESS_MAP_START(data_128x4, AS_DATA, 8, tms1k_base_device) - AM_RANGE(0x00, 0x7f) AM_RAM -ADDRESS_MAP_END - -static ADDRESS_MAP_START(data_64x9_as4, AS_DATA, 8, tms1k_base_device) - AM_RANGE(0x00, 0x7f) AM_RAM - AM_RANGE(0x80, 0x8f) AM_RAM AM_MIRROR(0x70) // DAM -ADDRESS_MAP_END - - -// device definitions -tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms1k_base_device(mconfig, TMS1000, "TMS1000", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 2 /* x width */, 10 /* prg width */, ADDRESS_MAP_NAME(program_10bit_8), 6 /* data width */, ADDRESS_MAP_NAME(data_64x4), "tms1000", __FILE__) -{ } - -tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) - : tms1k_base_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) -{ } - -tms1070_cpu_device::tms1070_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms1000_cpu_device(mconfig, TMS1070, "TMS1070", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1070", __FILE__) -{ } - -tms1040_cpu_device::tms1040_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms1000_cpu_device(mconfig, TMS1040, "TMS1040", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1040", __FILE__) -{ } - -tms1200_cpu_device::tms1200_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms1000_cpu_device(mconfig, TMS1200, "TMS1200", tag, owner, clock, 8, 13, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1200", __FILE__) -{ } - - -tms1100_cpu_device::tms1100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms1000_cpu_device(mconfig, TMS1100, "TMS1100", tag, owner, clock, 8, 11, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1100", __FILE__) -{ } - -tms1100_cpu_device::tms1100_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) - : tms1000_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) -{ } - -tms1170_cpu_device::tms1170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms1100_cpu_device(mconfig, TMS1170, "TMS1170", tag, owner, clock, 8, 11, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1170", __FILE__) -{ } - -tms1300_cpu_device::tms1300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms1100_cpu_device(mconfig, TMS1300, "TMS1300", tag, owner, clock, 8, 16, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1300", __FILE__) -{ } - -tms1370_cpu_device::tms1370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms1100_cpu_device(mconfig, TMS1370, "TMS1370", tag, owner, clock, 8, 16, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1370", __FILE__) -{ } - - -tms1400_cpu_device::tms1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms1100_cpu_device(mconfig, TMS1400, "TMS1400", tag, owner, clock, 8, 11, 6, 8, 3, 12, ADDRESS_MAP_NAME(program_12bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1400", __FILE__) -{ } - -tms1400_cpu_device::tms1400_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) - : tms1100_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) -{ } - -tms1470_cpu_device::tms1470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms1400_cpu_device(mconfig, TMS1470, "TMS1470", tag, owner, clock, 8, 10, 6, 8, 3, 12, ADDRESS_MAP_NAME(program_12bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1470", __FILE__) -{ } - - -tms1600_cpu_device::tms1600_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms1400_cpu_device(mconfig, TMS1600, "TMS1600", tag, owner, clock, 8, 16, 6, 8, 3, 12, ADDRESS_MAP_NAME(program_12bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1600", __FILE__) -{ } - -tms1600_cpu_device::tms1600_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) - : tms1400_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) -{ } - -tms1670_cpu_device::tms1670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms1600_cpu_device(mconfig, TMS1670, "TMS1670", tag, owner, clock, 8, 16, 6, 8, 3, 12, ADDRESS_MAP_NAME(program_12bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1670", __FILE__) -{ } - - -tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms1000_cpu_device(mconfig, TMS0970, "TMS0970", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms0970", __FILE__) -{ } - -tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) - : tms1000_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) -{ } - -tms0950_cpu_device::tms0950_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms0970_cpu_device(mconfig, TMS0950, "TMS0950", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms0950", __FILE__) -{ } - -tms1990_cpu_device::tms1990_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms0970_cpu_device(mconfig, TMS1990, "TMS1990", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1990", __FILE__) -{ } - - -tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms0970_cpu_device(mconfig, TMS0980, "TMS0980", tag, owner, clock, 8, 9, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tms0980", __FILE__) -{ } - -tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) - : tms0970_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) -{ } - -tms1980_cpu_device::tms1980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms0980_cpu_device(mconfig, TMS1980, "TMS1980", tag, owner, clock, 7, 10, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tms1980", __FILE__) -{ } - - -tms0270_cpu_device::tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms0980_cpu_device(mconfig, TMS0270, "TMS0270", tag, owner, clock, 16, 16, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tms0270", __FILE__) - , m_read_ctl(*this) - , m_write_ctl(*this) - , m_write_pdc(*this) -{ } - - -tp0320_cpu_device::tp0320_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms0980_cpu_device(mconfig, TP0320, "TP0320", tag, owner, clock, 7, 10, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tp0320", __FILE__) -{ } - - -// machine configs -static MACHINE_CONFIG_FRAGMENT(tms1000) - - // microinstructions PLA, output PLA - MCFG_PLA_ADD("mpla", 8, 16, 30) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) - MCFG_PLA_ADD("opla", 5, 8, 20) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) -MACHINE_CONFIG_END - -machine_config_constructor tms1000_cpu_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME(tms1000); -} - - -static MACHINE_CONFIG_FRAGMENT(tms1400) - - // microinstructions PLA, output PLA - MCFG_PLA_ADD("mpla", 8, 16, 30) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) - MCFG_PLA_ADD("opla", 5, 8, 32) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) -MACHINE_CONFIG_END - -machine_config_constructor tms1400_cpu_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME(tms1400); -} - - -static MACHINE_CONFIG_FRAGMENT(tms0950) - - // microinstructions PLA, output PLA, segment PLA - MCFG_PLA_ADD("mpla", 8, 16, 30) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) - MCFG_PLA_ADD("opla", 4, 8, 10) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) - MCFG_PLA_ADD("spla", 3, 8, 8) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) -MACHINE_CONFIG_END - -machine_config_constructor tms0950_cpu_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME(tms0950); -} - - -static MACHINE_CONFIG_FRAGMENT(tms0970) - - // main opcodes PLA, microinstructions PLA, output PLA, segment PLA - MCFG_PLA_ADD("ipla", 8, 15, 18) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) - MCFG_PLA_ADD("mpla", 5, 15, 32) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) - MCFG_PLA_ADD("opla", 4, 8, 16) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) - MCFG_PLA_ADD("spla", 3, 8, 8) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) -MACHINE_CONFIG_END - -machine_config_constructor tms0970_cpu_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME(tms0970); -} - - -static MACHINE_CONFIG_FRAGMENT(tms0980) - - // main opcodes PLA, microinstructions PLA, output PLA, segment PLA - MCFG_PLA_ADD("ipla", 9, 22, 24) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) - MCFG_PLA_ADD("mpla", 6, 20, 64) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) - MCFG_PLA_ADD("opla", 4, 8, 16) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) - MCFG_PLA_ADD("spla", 3, 8, 8) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) -MACHINE_CONFIG_END - -machine_config_constructor tms0980_cpu_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME(tms0980); -} - - -static MACHINE_CONFIG_FRAGMENT(tms1980) - - // main opcodes PLA, microinstructions PLA, output PLA - MCFG_PLA_ADD("ipla", 9, 22, 24) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) - MCFG_PLA_ADD("mpla", 6, 22, 64) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) - MCFG_PLA_ADD("opla", 5, 7, 32) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) -MACHINE_CONFIG_END - -machine_config_constructor tms1980_cpu_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME(tms1980); -} - - -static MACHINE_CONFIG_FRAGMENT(tms0270) - - // main opcodes PLA, microinstructions PLA, output PLA - MCFG_PLA_ADD("ipla", 9, 22, 24) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) - MCFG_PLA_ADD("mpla", 6, 22, 64) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) - MCFG_PLA_ADD("opla", 6, 16, 48) - MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) -MACHINE_CONFIG_END - -machine_config_constructor tms0270_cpu_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME(tms0270); -} - - // disasm -offs_t tms1000_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) -{ - extern CPU_DISASSEMBLE(tms1000); - return CPU_DISASSEMBLE_NAME(tms1000)(this, buffer, pc, oprom, opram, options); -} - -offs_t tms1100_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) -{ - extern CPU_DISASSEMBLE(tms1100); - return CPU_DISASSEMBLE_NAME(tms1100)(this, buffer, pc, oprom, opram, options); -} - -offs_t tms0980_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) -{ - extern CPU_DISASSEMBLE(tms0980); - return CPU_DISASSEMBLE_NAME(tms0980)(this, buffer, pc, oprom, opram, options); -} - -offs_t tp0320_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) -{ - extern CPU_DISASSEMBLE(tp0320); - return CPU_DISASSEMBLE_NAME(tp0320)(this, buffer, pc, oprom, opram, options); -} - void tms1k_base_device::state_string_export(const device_state_entry &entry, std::string &str) const { switch (entry.index()) @@ -452,7 +80,6 @@ void tms1k_base_device::state_string_export(const device_state_entry &entry, std } - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -571,38 +198,6 @@ void tms1k_base_device::device_start() m_icountptr = &m_icount; } -void tms0270_cpu_device::device_start() -{ - // common init - tms1k_base_device::device_start(); - - m_read_ctl.resolve_safe(0); - m_write_ctl.resolve_safe(); - m_write_pdc.resolve_safe(); - - // zerofill - m_r_prev = 0; - m_chipsel = 0; - m_ctl_dir = 0; - m_ctl_out = 0; - m_pdc = -1; // ! - - m_o_latch_low = 0; - m_o_latch = 0; - m_o_latch_prev = 0; - - // register for savestates - save_item(NAME(m_r_prev)); - save_item(NAME(m_chipsel)); - save_item(NAME(m_ctl_dir)); - save_item(NAME(m_ctl_out)); - save_item(NAME(m_pdc)); - - save_item(NAME(m_o_latch_low)); - save_item(NAME(m_o_latch)); - save_item(NAME(m_o_latch_prev)); -} - //------------------------------------------------- @@ -637,184 +232,6 @@ void tms1k_base_device::device_reset() } -void tms1000_cpu_device::device_reset() -{ - // common reset - tms1k_base_device::device_reset(); - - // pre-decode instructionset - m_fixed_decode.resize(0x100); - memset(&m_fixed_decode[0], 0, 0x100*sizeof(UINT32)); - m_micro_decode.resize(0x100); - memset(&m_micro_decode[0], 0, 0x100*sizeof(UINT32)); - - for (int op = 0; op < 0x100; op++) - { - // _____ _____ ______ _____ ______ _____ _____ _____ _____ - const UINT32 md[16] = { M_STSL, M_AUTY, M_AUTA, M_CIN, M_C8, M_NE, M_CKN, M_15TN, M_MTN, M_NATN, M_ATN, M_MTP, M_YTP, M_CKP, M_CKM, M_STO }; - UINT16 mask = m_mpla->read(op); - mask ^= 0x3fc8; // invert active-negative - - for (int bit = 0; bit < 16; bit++) - if (mask & (1 << bit)) - m_micro_decode[op] |= md[bit]; - } - - // the fixed instruction set is not programmable - m_fixed_decode[0x00] = F_COMX; - m_fixed_decode[0x0a] = F_TDO; - m_fixed_decode[0x0b] = F_CLO; - m_fixed_decode[0x0c] = F_RSTR; - m_fixed_decode[0x0d] = F_SETR; - m_fixed_decode[0x0f] = F_RETN; - - for (int i = 0x10; i < 0x20; i++) m_fixed_decode[i] = F_LDP; - for (int i = 0x30; i < 0x34; i++) m_fixed_decode[i] = F_SBIT; - for (int i = 0x34; i < 0x38; i++) m_fixed_decode[i] = F_RBIT; - for (int i = 0x3c; i < 0x40; i++) m_fixed_decode[i] = F_LDX; - - for (int i = 0x80; i < 0xc0; i++) m_fixed_decode[i] = F_BR; - for (int i = 0xc0; i < 0x100; i++) m_fixed_decode[i] = F_CALL; -} - -void tms1100_cpu_device::device_reset() -{ - tms1000_cpu_device::device_reset(); - - // small differences in 00-3f area - m_fixed_decode[0x00] = 0; - m_fixed_decode[0x09] = F_COMX8; // ! - m_fixed_decode[0x0b] = F_COMC; - - for (int i = 0x28; i < 0x30; i++) m_fixed_decode[i] = F_LDX; - for (int i = 0x3c; i < 0x40; i++) m_fixed_decode[i] = 0; -} - -void tms1400_cpu_device::device_reset() -{ - tms1100_cpu_device::device_reset(); - - // small differences in 00-3f area - m_fixed_decode[0x0b] = F_TPC; -} - - -void tms0970_cpu_device::device_reset() -{ - // common reset - tms1k_base_device::device_reset(); - - // pre-decode instructionset - m_fixed_decode.resize(0x100); - memset(&m_fixed_decode[0], 0, 0x100*sizeof(UINT32)); - m_micro_decode.resize(0x100); - memset(&m_micro_decode[0], 0, 0x100*sizeof(UINT32)); - - for (int op = 0; op < 0x100; op++) - { - // upper half of the opcodes is always branch/call - if (op & 0x80) - m_fixed_decode[op] = (op & 0x40) ? F_CALL: F_BR; - - // 5 output bits select a microinstruction index - UINT32 imask = m_ipla->read(op); - UINT8 msel = imask & 0x1f; - - // but if (from bottom to top) term 1 is active and output bit 5 is 0, R2,R4-R7 directly select a microinstruction index - if (imask & 0x40 && (imask & 0x20) == 0) - msel = (op & 0xf) | (op >> 1 & 0x10); - - msel = BITSWAP8(msel,7,6,5,0,1,2,3,4); // lines are reversed - UINT32 mmask = m_mpla->read(msel); - mmask ^= 0x09fe; // invert active-negative - - // _____ _____ _____ _____ ______ _____ ______ _____ _____ - const UINT32 md[15] = { M_CKM, M_CKP, M_YTP, M_MTP, M_ATN, M_NATN, M_MTN, M_15TN, M_CKN, M_NE, M_C8, M_CIN, M_AUTA, M_AUTY, M_STO }; - - for (int bit = 0; bit < 15; bit++) - if (mmask & (1 << bit)) - m_micro_decode[op] |= md[bit]; - - // the other ipla terms each select a fixed instruction - const UINT32 id[8] = { F_LDP, F_TDO, F_COMX, F_LDX, F_SBIT, F_RBIT, F_SETR, F_RETN }; - - for (int bit = 0; bit < 8; bit++) - if (imask & (0x80 << bit)) - m_fixed_decode[op] |= id[bit]; - } -} - - -UINT32 tms0980_cpu_device::decode_micro(UINT8 sel) -{ - UINT32 decode = 0; - - sel = BITSWAP8(sel,7,6,0,1,2,3,4,5); // lines are reversed - UINT32 mask = m_mpla->read(sel); - mask ^= 0x43fc3; // invert active-negative - - // M_RSTR is specific to TMS02x0/TMS1980, it redirects to F_RSTR - // M_UNK1 is specific to TMS0270, unknown/unused yet and apparently not connected on every TMS0270 - // _______ ______ _____ _____ _____ _____ ______ _____ ______ _____ _____ - const UINT32 md[22] = { M_NDMTP, M_DMTP, M_AUTY, M_AUTA, M_CKM, M_SSE, M_CKP, M_YTP, M_MTP, M_ATN, M_NATN, M_MTN, M_15TN, M_CKN, M_NE, M_C8, M_SSS, M_CME, M_CIN, M_STO, M_RSTR, M_UNK1 }; - - for (int bit = 0; bit < 22 && bit < m_mpla->outputs(); bit++) - if (mask & (1 << bit)) - decode |= md[bit]; - - return decode; -} - -void tms0980_cpu_device::device_reset() -{ - // common reset - tms1k_base_device::device_reset(); - - // pre-decode instructionset - m_fixed_decode.resize(0x200); - memset(&m_fixed_decode[0], 0, 0x200*sizeof(UINT32)); - m_micro_decode.resize(0x200); - memset(&m_micro_decode[0], 0, 0x200*sizeof(UINT32)); - - for (int op = 0; op < 0x200; op++) - { - // upper half of the opcodes is always branch/call - if (op & 0x100) - m_fixed_decode[op] = (op & 0x80) ? F_CALL: F_BR; - - UINT32 imask = m_ipla->read(op); - - // 6 output bits select a microinstruction index - m_micro_decode[op] = decode_micro(imask & 0x3f); - - // the other ipla terms each select a fixed instruction - const UINT32 id[15] = { F_LDP, F_SBL, F_OFF, F_RBIT, F_SAL, F_XDA, F_REAC, F_SETR, F_RETN, F_SBIT, F_TDO, F_COMX8, F_COMX, F_LDX, F_SEAC }; - - for (int bit = 0; bit < 15; bit++) - if (imask & (0x80 << bit)) - m_fixed_decode[op] |= id[bit]; - } - - // like on TMS0970, one of the terms directly select a microinstruction index (via R4-R8), - // but it can't be pre-determined when it's active - m_micro_direct.resize(0x40); - memset(&m_micro_decode[0], 0, 0x40*sizeof(UINT32)); - - for (int op = 0; op < 0x40; op++) - m_micro_direct[op] = decode_micro(op); -} - -void tms0270_cpu_device::device_reset() -{ - // common reset - tms0980_cpu_device::device_reset(); - - m_o_latch_low = 0; - m_o_latch = 0; - m_o_latch_prev = 0; -} - - //------------------------------------------------- // program counter/opcode decode @@ -847,28 +264,6 @@ void tms1k_base_device::read_opcode() next_pc(); } -void tms0980_cpu_device::read_opcode() -{ - debugger_instruction_hook(this, m_rom_address << 1); - m_opcode = m_program->read_word(m_rom_address << 1) & 0x1ff; - m_c4 = BITSWAP8(m_opcode,7,6,5,4,0,1,2,3) & 0xf; // opcode operand is bitswapped for most opcodes - - m_fixed = m_fixed_decode[m_opcode]; - - // if ipla term 0 is active, R4-R8 directly select a microinstruction index when R0 or R0^BL is 0 - int r0 = m_opcode >> 8 & 1; - if (m_ipla->read(m_opcode) & 0x40 && !((r0 & m_bl) ^ r0)) - m_micro = m_micro_direct[m_opcode & 0x3f]; - else - m_micro = m_micro_decode[m_opcode]; - - // redirect mpla fixed instructions - if (m_micro & M_RSTR) m_fixed |= F_RSTR; - if (m_micro & M_SETR) m_fixed |= F_SETR; - - next_pc(); -} - //------------------------------------------------- @@ -882,81 +277,12 @@ void tms1k_base_device::write_o_output(UINT8 index) m_write_o(0, m_o & m_o_mask, 0xffff); } -void tms0970_cpu_device::write_o_output(UINT8 index) -{ - m_o = m_spla->read(index); - m_write_o(0, m_o & m_o_mask, 0xffff); -} - - -void tms0270_cpu_device::dynamic_output() -{ - // R11: TMS5100 CTL port direction (0=read from TMS5100, 1=write to TMS5100) - m_ctl_dir = m_r >> 11 & 1; - - // R12: chip select (off=display via OPLA, on=TMS5100 via ACC/CKB) - m_chipsel = m_r >> 12 & 1; - - if (m_chipsel) - { - // ACC via SEG G,B,C,D: TMS5100 CTL pins - if (m_ctl_dir && m_a != m_ctl_out) - { - m_ctl_out = m_a; - m_write_ctl(0, m_ctl_out, 0xff); - } - - // R10 via SEG E: TMS5100 PDC pin - if (m_pdc != (m_r >> 10 & 1)) - { - m_pdc = m_r >> 10 & 1; - m_write_pdc(m_pdc); - } - } - else - { - // standard O-output - if (m_o_latch != m_o_latch_prev) - { - write_o_output(m_o_latch); - m_o_latch_prev = m_o_latch; - } - } - - // standard R-output - if (m_r != m_r_prev) - { - m_write_r(0, m_r & m_r_mask, 0xffff); - m_r_prev = m_r; - } -} - - UINT8 tms1k_base_device::read_k_input() { // K1,2,4,8 (KC test pin is not emulated) return m_read_k(0, 0xff) & 0xf; } -UINT8 tms0980_cpu_device::read_k_input() -{ - UINT8 k = m_read_k(0, 0xff) & 0x1f; - UINT8 k3 = (k & 0x10) ? 3: 0; // the TMS0980 K3 line is simply K1|K2 - return (k & 0xf) | k3; -} - -UINT8 tms0270_cpu_device::read_k_input() -{ - // external: TMS5100 CTL port via SEG G,B,C,D - if (m_chipsel) - return (m_ctl_dir) ? m_ctl_out : m_read_ctl(0, 0xff) & 0xf; - - // standard K-input otherwise - UINT8 k = m_read_k(0, 0xff) & 0x1f; - return (k & 0x10) ? 0xf : k; // the TMS0270 KF line asserts all K-inputs -} - - void tms1k_base_device::set_cki_bus() { switch (m_opcode & 0xf8) @@ -983,32 +309,6 @@ void tms1k_base_device::set_cki_bus() } } -void tms0980_cpu_device::set_cki_bus() -{ - switch (m_opcode & 0x1f8) - { - // 000001XXX: K-inputs - case 0x008: - m_cki_bus = read_k_input(); - break; - - // 0X0100XXX: select bit - case 0x020: case 0x0a0: - m_cki_bus = 1 << (m_c4 >> 2) ^ 0xf; - break; - - // 0X1XXXXXX: constant - case 0x040: case 0x048: case 0x050: case 0x058: case 0x060: case 0x068: case 0x070: case 0x078: - case 0x0c0: case 0x0c8: case 0x0d0: case 0x0d8: case 0x0e0: case 0x0e8: case 0x0f0: case 0x0f8: - m_cki_bus = m_c4; - break; - - default: - m_cki_bus = 0; - break; - } -} - //------------------------------------------------- @@ -1068,62 +368,6 @@ void tms1k_base_device::op_retn() } -// TMS1400-specific - -void tms1400_cpu_device::op_br() -{ - // BR/BL: conditional branch - if (m_status) - { - m_pa = m_pb; // don't care about clatch - m_ca = m_cb; - m_pc = m_opcode & m_pc_mask; - } -} - -void tms1400_cpu_device::op_call() -{ - // CALL/CALLL: conditional call - if (m_status) - { - // 3-level stack, mask clatch 3 bits (no need to mask others) - m_clatch = (m_clatch << 1 | 1) & 7; - - m_sr = m_sr << m_pc_bits | m_pc; - m_pc = m_opcode & m_pc_mask; - - m_ps = m_ps << 4 | m_pa; - m_pa = m_pb; - - m_cs = m_cs << 2 | m_ca; - m_ca = m_cb; - } - else - { - m_pb = m_pa; - m_cb = m_ca; - } -} - -void tms1400_cpu_device::op_retn() -{ - // RETN: return from subroutine - if (m_clatch & 1) - { - m_clatch >>= 1; - - m_pc = m_sr & m_pc_mask; - m_sr >>= m_pc_bits; - - m_pa = m_pb = m_ps & 0xf; - m_ps >>= 4; - - m_ca = m_cb = m_cs & 3; - m_cs >>= 2; - } -} - - // handle other: // TMS1000/common @@ -1198,20 +442,6 @@ void tms1k_base_device::op_ldp() // TMS1100-specific -void tms1100_cpu_device::op_setr() -{ - // SETR: same, but X register MSB must be clear - if (~m_x & (1 << (m_x_bits-1))) - tms1k_base_device::op_setr(); -} - -void tms1100_cpu_device::op_rstr() -{ - // RSTR: same, but X register MSB must be clear - if (~m_x & (1 << (m_x_bits-1))) - tms1k_base_device::op_rstr(); -} - void tms1k_base_device::op_comc() { // COMC: complement chapter buffer @@ -1228,32 +458,8 @@ void tms1k_base_device::op_tpc() } -// TMS0970-specific (and possibly child classes) - -void tms0970_cpu_device::op_setr() -{ - // SETR: set output register - // DDIG line is a coincidence between the selected output pla row(s) and segment pla row(s) - int ddig = (m_opla->read(m_a) & m_o) ? 1 : 0; - m_r = (m_r & ~(1 << m_y)) | (ddig << m_y); -} - -void tms0970_cpu_device::op_tdo() -{ - // TDO: transfer digits to output - write_o_output(m_a & 0x7); - m_write_r(0, m_r & m_r_mask, 0xffff); -} - - // TMS0980-specific (and possibly child classes) -void tms0980_cpu_device::op_comx() -{ - // COMX: complement X register, but not the MSB - m_x ^= (m_x_mask >> 1); -} - void tms1k_base_device::op_xda() { // XDA: exchange DAM and A @@ -1292,41 +498,6 @@ void tms1k_base_device::op_sbl() } -// TMS1980-specific - -void tms1980_cpu_device::op_tdo() -{ - // TDO: transfer accumulator and status(not status_latch!) to O-output - write_o_output(m_status << 4 | m_a); -} - - -// TMS0270-specific - -void tms0270_cpu_device::op_setr() -{ - // same as default, but handle write to output in dynamic_output - m_r = m_r | (1 << m_y); -} - -void tms0270_cpu_device::op_rstr() -{ - // same as default, but handle write to output in dynamic_output - m_r = m_r & ~(1 << m_y); -} - -void tms0270_cpu_device::op_tdo() -{ - // TDO: transfer data out - if (m_status) - m_o_latch_low = m_a; - else - m_o_latch = m_o_latch_low | (m_a << 4 & 0x30); - - // write to output is done in dynamic_output -} - - //------------------------------------------------- // execute_run diff --git a/src/devices/cpu/tms1000/tms1k_base.h b/src/devices/cpu/tms1000/tms1k_base.h index c1585bd22f0..9ad108b1dca 100644 --- a/src/devices/cpu/tms1000/tms1k_base.h +++ b/src/devices/cpu/tms1000/tms1k_base.h @@ -2,7 +2,10 @@ // copyright-holders:Wilbert Pol, hap /* - TMS0980/TMS1000-family MCU cores + TMS1000 family - base/shared + + Don't include this file, include the specific device header instead, + for example tms1000.h */ @@ -35,17 +38,6 @@ tms1k_base_device::set_power_off_callback(*device, DEVCB_##_devcb); -// TMS0270 was designed to interface with TMS5100, set it up at driver level -#define MCFG_TMS0270_READ_CTL_CB(_devcb) \ - tms0270_cpu_device::set_read_ctl_callback(*device, DEVCB_##_devcb); - -#define MCFG_TMS0270_WRITE_CTL_CB(_devcb) \ - tms0270_cpu_device::set_write_ctl_callback(*device, DEVCB_##_devcb); - -#define MCFG_TMS0270_WRITE_PDC_CB(_devcb) \ - tms0270_cpu_device::set_write_pdc_callback(*device, DEVCB_##_devcb); - - // pinout reference /* @@ -304,274 +296,4 @@ protected: }; - -class tms1000_cpu_device : public tms1k_base_device -{ -public: - tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); - -protected: - // overrides - virtual void device_reset() override; - virtual machine_config_constructor device_mconfig_additions() const override; - - - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; -}; - -class tms1070_cpu_device : public tms1000_cpu_device -{ -public: - tms1070_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -class tms1040_cpu_device : public tms1000_cpu_device -{ -public: - tms1040_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - - -class tms1200_cpu_device : public tms1000_cpu_device -{ -public: - tms1200_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - - -class tms1100_cpu_device : public tms1000_cpu_device -{ -public: - tms1100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms1100_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); - -protected: - // overrides - virtual void device_reset() override; - - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; - - virtual void op_setr() override; - virtual void op_rstr() override; -}; - -class tms1170_cpu_device : public tms1100_cpu_device -{ -public: - tms1170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -class tms1300_cpu_device : public tms1100_cpu_device -{ -public: - tms1300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -class tms1370_cpu_device : public tms1100_cpu_device -{ -public: - tms1370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - - -class tms1400_cpu_device : public tms1100_cpu_device -{ -public: - tms1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms1400_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); - -protected: - // overrides - virtual void device_reset() override; - virtual machine_config_constructor device_mconfig_additions() const override; - - virtual void op_br() override; - virtual void op_call() override; - virtual void op_retn() override; - - virtual void op_setr() override { tms1k_base_device::op_setr(); } // no anomaly with MSB of X register - virtual void op_rstr() override { tms1k_base_device::op_rstr(); } // " -}; - -class tms1470_cpu_device : public tms1400_cpu_device -{ -public: - tms1470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - - -class tms1600_cpu_device : public tms1400_cpu_device -{ -public: - tms1600_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms1600_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); -}; - -class tms1670_cpu_device : public tms1600_cpu_device -{ -public: - tms1670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - - -class tms0970_cpu_device : public tms1000_cpu_device -{ -public: - tms0970_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms0970_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); - -protected: - // overrides - virtual void device_reset() override; - virtual machine_config_constructor device_mconfig_additions() const override; - - virtual void write_o_output(UINT8 index) override; - - virtual void op_setr() override; - virtual void op_tdo() override; -}; - -class tms0950_cpu_device : public tms0970_cpu_device -{ -public: - tms0950_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - // overrides - virtual void device_reset() override { tms1000_cpu_device::device_reset(); } - virtual machine_config_constructor device_mconfig_additions() const override; - - virtual void op_rstr() override { ; } // assume it has no RSTR or CLO - virtual void op_clo() override { ; } // " -}; - -class tms1990_cpu_device : public tms0970_cpu_device -{ -public: - tms1990_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - - -class tms0980_cpu_device : public tms0970_cpu_device -{ -public: - tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); - -protected: - // overrides - virtual void device_reset() override; - - virtual machine_config_constructor device_mconfig_additions() const override; - - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; - - virtual UINT8 read_k_input() override; - virtual void set_cki_bus() override; - virtual void read_opcode() override; - - virtual void op_comx() override; - - UINT32 decode_micro(UINT8 sel); -}; - -class tms1980_cpu_device : public tms0980_cpu_device -{ -public: - tms1980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - // overrides - virtual machine_config_constructor device_mconfig_additions() const override; - - virtual void write_o_output(UINT8 index) override { tms1k_base_device::write_o_output(index); } - virtual UINT8 read_k_input() override { return tms1k_base_device::read_k_input(); } - - virtual void op_setr() override { tms1k_base_device::op_setr(); } - virtual void op_tdo() override; -}; - - -class tms0270_cpu_device : public tms0980_cpu_device -{ -public: - tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - - // static configuration helpers - template static devcb_base &set_read_ctl_callback(device_t &device, _Object object) { return downcast(device).m_read_ctl.set_callback(object); } - template static devcb_base &set_write_ctl_callback(device_t &device, _Object object) { return downcast(device).m_write_ctl.set_callback(object); } - template static devcb_base &set_write_pdc_callback(device_t &device, _Object object) { return downcast(device).m_write_pdc.set_callback(object); } - -protected: - // overrides - virtual void device_start() override; - virtual void device_reset() override; - - virtual machine_config_constructor device_mconfig_additions() const override; - - virtual void write_o_output(UINT8 index) override { tms1k_base_device::write_o_output(index); } - virtual UINT8 read_k_input() override; - virtual void dynamic_output() override; - - virtual void op_setr() override; - virtual void op_rstr() override; - virtual void op_tdo() override; - -private: - // state specific to interface with TMS5100 - UINT16 m_r_prev; - UINT8 m_chipsel; - UINT8 m_ctl_out; - UINT8 m_ctl_dir; - int m_pdc; - - UINT8 m_o_latch_low; - UINT8 m_o_latch; - UINT8 m_o_latch_prev; - - devcb_read8 m_read_ctl; - devcb_write8 m_write_ctl; - devcb_write_line m_write_pdc; -}; - - -class tp0320_cpu_device : public tms0980_cpu_device -{ -public: - tp0320_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - // overrides - //virtual void device_start() override; - //virtual void device_reset() override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; - - //virtual machine_config_constructor device_mconfig_additions() const override; -}; - - -extern const device_type TMS1000; -extern const device_type TMS1070; -extern const device_type TMS1040; -extern const device_type TMS1200; -extern const device_type TMS1100; -extern const device_type TMS1170; -extern const device_type TMS1300; -extern const device_type TMS1370; -extern const device_type TMS1400; -extern const device_type TMS1470; -extern const device_type TMS1600; -extern const device_type TMS1670; -extern const device_type TMS0950; -extern const device_type TMS0970; -extern const device_type TMS1990; -extern const device_type TMS0980; -extern const device_type TMS1980; -extern const device_type TMS0270; -extern const device_type TP0320; - - #endif /* _TMS1KBASE_H_ */ diff --git a/src/devices/cpu/tms1000/tp0320.cpp b/src/devices/cpu/tms1000/tp0320.cpp new file mode 100644 index 00000000000..71a5eda71f1 --- /dev/null +++ b/src/devices/cpu/tms1000/tp0320.cpp @@ -0,0 +1,40 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol, hap +/* + + TMS1000 family - TP0320 + +*/ + +#include "tp0320.h" +#include "debugger.h" + +// TP0320 is TI's first CMOS MCU with integrated LCD controller, the die is still very similar to TMS0980 +// - ROM and main RAM is same as on TMS0980 with different row-select +// - +const device_type TP0320 = &device_creator; // 28-pin SDIP, .. + + +// internal memory maps +static ADDRESS_MAP_START(program_11bit_9, AS_PROGRAM, 16, tms1k_base_device) + AM_RANGE(0x000, 0xfff) AM_ROM +ADDRESS_MAP_END + +static ADDRESS_MAP_START(data_64x9_as4, AS_DATA, 8, tms1k_base_device) + AM_RANGE(0x00, 0x7f) AM_RAM + AM_RANGE(0x80, 0x8f) AM_RAM AM_MIRROR(0x70) // DAM +ADDRESS_MAP_END + + +// device definitions +tp0320_cpu_device::tp0320_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms0980_cpu_device(mconfig, TP0320, "TP0320", tag, owner, clock, 7 /* o pins */, 10 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_11bit_9), 8 /* data width */, ADDRESS_MAP_NAME(data_64x9_as4), "tp0320", __FILE__) +{ } + + +// disasm +offs_t tp0320_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +{ + extern CPU_DISASSEMBLE(tp0320); + return CPU_DISASSEMBLE_NAME(tp0320)(this, buffer, pc, oprom, opram, options); +} diff --git a/src/devices/cpu/tms1000/tp0320.h b/src/devices/cpu/tms1000/tp0320.h new file mode 100644 index 00000000000..32e18e5159f --- /dev/null +++ b/src/devices/cpu/tms1000/tp0320.h @@ -0,0 +1,32 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol, hap +/* + + TMS1000 family - TP0320 + +*/ + +#ifndef _TP0320_H_ +#define _TP0320_H_ + +#include "tms0980.h" + + +class tp0320_cpu_device : public tms0980_cpu_device +{ +public: + tp0320_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + // overrides + //virtual void device_start() override; + //virtual void device_reset() override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + + //virtual machine_config_constructor device_mconfig_additions() const override; +}; + + +extern const device_type TP0320; + +#endif /* _TP0320_H_ */ diff --git a/src/mame/drivers/microvsn.cpp b/src/mame/drivers/microvsn.cpp index e936ac16deb..33f0795ff1a 100644 --- a/src/mame/drivers/microvsn.cpp +++ b/src/mame/drivers/microvsn.cpp @@ -17,7 +17,7 @@ of the games were clocked at around 500KHz, 550KHz, or 300KHz. #include "emu.h" #include "cpu/mcs48/mcs48.h" -#include "cpu/tms1000/tms1000.h" +#include "cpu/tms1000/tms1100.h" #include "sound/dac.h" #include "rendlay.h" @@ -547,7 +547,7 @@ DEVICE_IMAGE_LOAD_MEMBER(microvision_state, microvsn_cart) if (pla) m_pla = 1; - tms1k_base_device::set_output_pla(m_tms1100, m_pla ? microvision_output_pla_1 : microvision_output_pla_0); + tms1100_cpu_device::set_output_pla(m_tms1100, m_pla ? microvision_output_pla_1 : microvision_output_pla_0); // Set default setting for PCB type and RC type m_pcb_type = microvision_state::PCB_TYPE_UNKNOWN; diff --git a/src/mame/includes/hh_tms1k.h b/src/mame/includes/hh_tms1k.h index aa1c2da67aa..46372415b47 100644 --- a/src/mame/includes/hh_tms1k.h +++ b/src/mame/includes/hh_tms1k.h @@ -9,9 +9,14 @@ #ifndef _HH_TMS1K_H_ #define _HH_TMS1K_H_ - #include "emu.h" #include "cpu/tms1000/tms1000.h" +#include "cpu/tms1000/tms1100.h" +#include "cpu/tms1000/tms1400.h" +#include "cpu/tms1000/tms0970.h" +#include "cpu/tms1000/tms0980.h" +#include "cpu/tms1000/tms0270.h" +#include "cpu/tms1000/tp0320.h" #include "sound/speaker.h" From 7c5bbfdf66e0fc87fa8f88b8891d901b96923d20 Mon Sep 17 00:00:00 2001 From: balr0g Date: Wed, 16 Mar 2016 01:21:17 -0400 Subject: [PATCH 13/48] Put back Doxygen search box (nw) --- doxygen/doxy-boot.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doxygen/doxy-boot.js b/doxygen/doxy-boot.js index 4b48553acc4..17fd6e11583 100644 --- a/doxygen/doxy-boot.js +++ b/doxygen/doxy-boot.js @@ -25,6 +25,7 @@ $( document ).ready(function() { $("div#navrow5 > ul.tablist").addClass("pagination pagination-sm pagination-centered"); $("ul.tablist").css("margin-top", "0.5em"); $("ul.tablist").css("margin-bottom", "0.5em"); + $("ul.tablist").css("padding-right", "50px"); $("li.current").addClass("active"); $("iframe").attr("scrolling", "yes"); @@ -58,7 +59,7 @@ $( document ).ready(function() { $("div.ttname a").css("color", 'white'); $("div.ttdef,div.ttdoc,div.ttdeci").addClass("panel-body"); - $('#MSearchBox').parent().remove(); + //$('#MSearchBox').parent().remove(); //$('div.fragment.well div.line:first').css('margin-top', '15px'); //$('div.fragment.well div.line:last').css('margin-bottom', '15px'); From eaed2fb593e34a0b67597a1e1a0de9148f9e20b3 Mon Sep 17 00:00:00 2001 From: balr0g Date: Wed, 16 Mar 2016 01:55:11 -0400 Subject: [PATCH 14/48] Do not sort Doxygen member functions and macros for now (nw) --- doxygen/doxygen.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doxygen/doxygen.config b/doxygen/doxygen.config index c78081f9f05..d7115e0ef71 100644 --- a/doxygen/doxygen.config +++ b/doxygen/doxygen.config @@ -517,7 +517,7 @@ INLINE_INFO = YES # name. If set to NO the members will appear in declaration order. # The default value is: YES. -SORT_MEMBER_DOCS = YES +SORT_MEMBER_DOCS = NO # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member From d83d2a22335c340e96bbf48ed9a4a7ac91fab4fe Mon Sep 17 00:00:00 2001 From: balr0g Date: Wed, 16 Mar 2016 01:56:08 -0400 Subject: [PATCH 15/48] Begin documenting machine config macros (nw) --- src/emu/mconfig.h | 79 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 67 insertions(+), 12 deletions(-) diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h index dc1a2e99b0a..4fb118ca1c5 100644 --- a/src/emu/mconfig.h +++ b/src/emu/mconfig.h @@ -1,12 +1,13 @@ // license:BSD-3-Clause // copyright-holders:Aaron Giles -/*************************************************************************** +/***************************************************************************/ +/** + * @file mconfig.h + * @defgroup MACHINE_CONFIG Machine configuration macros and functions + * @{ + */ +/***************************************************************************/ - mconfig.h - - Machine configuration macros and functions. - -***************************************************************************/ #pragma once @@ -81,26 +82,52 @@ private: }; +//*************************************************************************/ +/** @name Machine config start/end macros */ +//*************************************************************************/ -//************************************************************************** -// MACHINE CONFIG MACROS -//************************************************************************** - -// start/end tags for the machine driver +/** + @def MACHINE_CONFIG_NAME(_name) + Returns the internal name for the machine config. + @param _name name of desired config + @hideinitializer + */ #define MACHINE_CONFIG_NAME(_name) construct_machine_config_##_name +/** + @def MACHINE_CONFIG_START(_name, _class) + Begins a new machine config. + @param _name name of this config + @param _class driver_device class for this config + @hideinitializer + */ #define MACHINE_CONFIG_START(_name, _class) \ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner, device_t *device) \ { \ devcb_base *devcb = NULL; \ (void)devcb; \ if (owner == NULL) owner = config.device_add(NULL, "root", &driver_device_creator<_class>, 0); + +/** + @def MACHINE_CONFIG_FRAGMENT(_name) + Begins a partial machine_config that can only be included in another "root" machine_config. This is also used for machine_configs that are specified as part of a device. + @param _name name of this config fragment + @hideinitializer +*/ #define MACHINE_CONFIG_FRAGMENT(_name) \ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner, device_t *device) \ { \ devcb_base *devcb = NULL; \ (void)devcb; \ assert(owner != NULL); + +/** + @def MACHINE_CONFIG_DERIVED(_name, _base) + Begins a machine_config that is derived from another machine_config. + @param _name name of this config + @param _base name of the parent config + @hideinitializer +*/ #define MACHINE_CONFIG_DERIVED(_name, _base) \ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner, device_t *device) \ { \ @@ -108,6 +135,15 @@ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t (void)devcb; \ owner = MACHINE_CONFIG_NAME(_base)(config, owner, device); \ assert(owner != NULL); + +/** +@def MACHINE_CONFIG_DERIVED_CLASS(_name, _base, _class) +Begins a machine_config that is derived from another machine_config that can specify an alternate driver_device class +@param _name name of this config +@param _base name of the parent config +@param _class name of the alternate driver_device class +@hideinitializer +*/ #define MACHINE_CONFIG_DERIVED_CLASS(_name, _base, _class) \ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner, device_t *device) \ { \ @@ -115,14 +151,32 @@ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t (void)devcb; \ if (owner == NULL) owner = config.device_add(NULL, "root", &driver_device_creator<_class>, 0); \ owner = MACHINE_CONFIG_NAME(_base)(config, owner, device); + +/** +@def MACHINE_CONFIG_END +Ends a machine_config. +@hideinitializer +*/ #define MACHINE_CONFIG_END \ return owner; \ } -// use this to declare external references to a machine driver +//*************************************************************************/ +/** @name Standalone machine config macros */ +//*************************************************************************/ + +/** +@def MACHINE_CONFIG_EXTERN(_name) +References an external machine config. +@param _name Name of the machine config to reference +@hideinitializer +*/ #define MACHINE_CONFIG_EXTERN(_name) \ extern device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner, device_t *device) +//*************************************************************************/ +/** @name Core machine config options */ +//*************************************************************************/ // importing data from other machine drivers #define MCFG_FRAGMENT_ADD(_name) \ @@ -160,3 +214,4 @@ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t device = config.device_find(owner, _tag); #endif /* __MCONFIG_H__ */ + /** @} */ From 2a342184c17f3e80730eb87477c883b6938aa61f Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 16 Mar 2016 08:58:39 +0100 Subject: [PATCH 16/48] tms1k: correct copyright tags, what's left of the old core before i rewrote it, is all in dasm and tms1k_base.* --- src/devices/cpu/tms1000/tms0270.cpp | 9 +++++---- src/devices/cpu/tms1000/tms0270.h | 2 +- src/devices/cpu/tms1000/tms0970.cpp | 2 +- src/devices/cpu/tms1000/tms0970.h | 2 +- src/devices/cpu/tms1000/tms0980.cpp | 10 +++++----- src/devices/cpu/tms1000/tms0980.h | 2 +- src/devices/cpu/tms1000/tms1000.cpp | 2 +- src/devices/cpu/tms1000/tms1000.h | 2 +- src/devices/cpu/tms1000/tms1100.cpp | 2 +- src/devices/cpu/tms1000/tms1100.h | 2 +- src/devices/cpu/tms1000/tms1400.cpp | 2 +- src/devices/cpu/tms1000/tms1400.h | 2 +- src/devices/cpu/tms1000/tp0320.cpp | 18 ++++++++++++------ src/devices/cpu/tms1000/tp0320.h | 2 +- 14 files changed, 33 insertions(+), 26 deletions(-) diff --git a/src/devices/cpu/tms1000/tms0270.cpp b/src/devices/cpu/tms1000/tms0270.cpp index fae494efc47..b38ce2c13b7 100644 --- a/src/devices/cpu/tms1000/tms0270.cpp +++ b/src/devices/cpu/tms1000/tms0270.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol, hap +// copyright-holders:hap /* TMS1000 family - TMS0270 @@ -11,7 +11,8 @@ // TMS0270 is a TMS0980 with earrings and a new hat. The new changes look like a quick afterthought, almost hacky // - RAM, ROM, and main instructions PLAs is the same as TMS0980 -// - 64-term microinstructions PLA between the RAM and ROM, supporting 20 microinstructions plus optional separate lines for custom opcode handling +// - 64-term microinstructions PLA between the RAM and ROM, similar to TMS0980, +// plus optional separate lines for custom opcode handling // - 48-term output PLA above the RAM (rotate opla 90 degrees) const device_type TMS0270 = &device_creator; // 40-pin DIP, 16 O pins, 8+ R pins (some R pins are internally hooked up to support more I/O) // newer TMS0270 chips (eg. Speak & Math) have 42 pins @@ -24,7 +25,7 @@ static ADDRESS_MAP_START(program_11bit_9, AS_PROGRAM, 16, tms1k_base_device) AM_RANGE(0x000, 0xfff) AM_ROM ADDRESS_MAP_END -static ADDRESS_MAP_START(data_64x9_as4, AS_DATA, 8, tms1k_base_device) +static ADDRESS_MAP_START(data_144x4, AS_DATA, 8, tms1k_base_device) AM_RANGE(0x00, 0x7f) AM_RAM AM_RANGE(0x80, 0x8f) AM_RAM AM_MIRROR(0x70) // DAM ADDRESS_MAP_END @@ -32,7 +33,7 @@ ADDRESS_MAP_END // device definitions tms0270_cpu_device::tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms0980_cpu_device(mconfig, TMS0270, "TMS0270", tag, owner, clock, 16 /* o pins */, 16 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_11bit_9), 8 /* data width */, ADDRESS_MAP_NAME(data_64x9_as4), "tms0270", __FILE__) + : tms0980_cpu_device(mconfig, TMS0270, "TMS0270", tag, owner, clock, 16 /* o pins */, 16 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_11bit_9), 8 /* data width */, ADDRESS_MAP_NAME(data_144x4), "tms0270", __FILE__) , m_read_ctl(*this) , m_write_ctl(*this) , m_write_pdc(*this) diff --git a/src/devices/cpu/tms1000/tms0270.h b/src/devices/cpu/tms1000/tms0270.h index 6d4e0142f3a..5cac8c810ad 100644 --- a/src/devices/cpu/tms1000/tms0270.h +++ b/src/devices/cpu/tms1000/tms0270.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol, hap +// copyright-holders:hap /* TMS1000 family - TMS0270 diff --git a/src/devices/cpu/tms1000/tms0970.cpp b/src/devices/cpu/tms1000/tms0970.cpp index 2eabe847bb9..88b9a52be39 100644 --- a/src/devices/cpu/tms1000/tms0970.cpp +++ b/src/devices/cpu/tms1000/tms0970.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol, hap +// copyright-holders:hap /* TMS1000 family - TMS0950, TMS0970, TMS1990 diff --git a/src/devices/cpu/tms1000/tms0970.h b/src/devices/cpu/tms1000/tms0970.h index 627dfa24c69..62cfb57c4e2 100644 --- a/src/devices/cpu/tms1000/tms0970.h +++ b/src/devices/cpu/tms1000/tms0970.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol, hap +// copyright-holders:hap /* TMS1000 family - TMS0950, TMS0970, TMS1990 diff --git a/src/devices/cpu/tms1000/tms0980.cpp b/src/devices/cpu/tms1000/tms0980.cpp index cda96386b38..b5884c70ad7 100644 --- a/src/devices/cpu/tms1000/tms0980.cpp +++ b/src/devices/cpu/tms1000/tms0980.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol, hap +// copyright-holders:hap /* TMS1000 family - TMS0980, TMS1980 @@ -10,7 +10,7 @@ #include "debugger.h" // TMS0980 -// - 64x9bit RAM array at the bottom-left (set up as 144x4) +// - 144x4bit RAM array at the bottom-left (128+16, set up as 8x18x4) // - 2048x9bit ROM array at the bottom-left // - main instructions PLAs at the top half, to the right of the midline // * top section is assumed to be the CKI bus select @@ -33,7 +33,7 @@ static ADDRESS_MAP_START(program_11bit_9, AS_PROGRAM, 16, tms1k_base_device) AM_RANGE(0x000, 0xfff) AM_ROM ADDRESS_MAP_END -static ADDRESS_MAP_START(data_64x9_as4, AS_DATA, 8, tms1k_base_device) +static ADDRESS_MAP_START(data_144x4, AS_DATA, 8, tms1k_base_device) AM_RANGE(0x00, 0x7f) AM_RAM AM_RANGE(0x80, 0x8f) AM_RAM AM_MIRROR(0x70) // DAM ADDRESS_MAP_END @@ -41,7 +41,7 @@ ADDRESS_MAP_END // device definitions tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms0970_cpu_device(mconfig, TMS0980, "TMS0980", tag, owner, clock, 8 /* o pins */, 9 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_11bit_9), 8 /* data width */, ADDRESS_MAP_NAME(data_64x9_as4), "tms0980", __FILE__) + : tms0970_cpu_device(mconfig, TMS0980, "TMS0980", tag, owner, clock, 8 /* o pins */, 9 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_11bit_9), 8 /* data width */, ADDRESS_MAP_NAME(data_144x4), "tms0980", __FILE__) { } tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) @@ -49,7 +49,7 @@ tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, device_typ { } tms1980_cpu_device::tms1980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms0980_cpu_device(mconfig, TMS1980, "TMS1980", tag, owner, clock, 7, 10, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tms1980", __FILE__) + : tms0980_cpu_device(mconfig, TMS1980, "TMS1980", tag, owner, clock, 7, 10, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_144x4), "tms1980", __FILE__) { } diff --git a/src/devices/cpu/tms1000/tms0980.h b/src/devices/cpu/tms1000/tms0980.h index 793c32cb1fc..93d8cf22fc3 100644 --- a/src/devices/cpu/tms1000/tms0980.h +++ b/src/devices/cpu/tms1000/tms0980.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol, hap +// copyright-holders:hap /* TMS1000 family - TMS0980, TMS1980 diff --git a/src/devices/cpu/tms1000/tms1000.cpp b/src/devices/cpu/tms1000/tms1000.cpp index 2edb517155f..65fc28f6c1a 100644 --- a/src/devices/cpu/tms1000/tms1000.cpp +++ b/src/devices/cpu/tms1000/tms1000.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol, hap +// copyright-holders:hap /* TMS1000 family - TMS1000, TMS1070, TMS1040, TMS1200 diff --git a/src/devices/cpu/tms1000/tms1000.h b/src/devices/cpu/tms1000/tms1000.h index 1a2d98822e5..361e4e6fe83 100644 --- a/src/devices/cpu/tms1000/tms1000.h +++ b/src/devices/cpu/tms1000/tms1000.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol, hap +// copyright-holders:hap /* TMS1000 family - TMS1000, TMS1070, TMS1040, TMS1200 diff --git a/src/devices/cpu/tms1000/tms1100.cpp b/src/devices/cpu/tms1000/tms1100.cpp index 39b6ed70e6f..042a0bcf6bf 100644 --- a/src/devices/cpu/tms1000/tms1100.cpp +++ b/src/devices/cpu/tms1000/tms1100.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol, hap +// copyright-holders:hap /* TMS1000 family - TMS1100, TMS1170, TMS1300, TMS1370 diff --git a/src/devices/cpu/tms1000/tms1100.h b/src/devices/cpu/tms1000/tms1100.h index ae3c5868532..2a78af0f283 100644 --- a/src/devices/cpu/tms1000/tms1100.h +++ b/src/devices/cpu/tms1000/tms1100.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol, hap +// copyright-holders:hap /* TMS1000 family - TMS1100, TMS1170, TMS1300, TMS1370 diff --git a/src/devices/cpu/tms1000/tms1400.cpp b/src/devices/cpu/tms1000/tms1400.cpp index f1bada9c6c9..e9246b18685 100644 --- a/src/devices/cpu/tms1000/tms1400.cpp +++ b/src/devices/cpu/tms1000/tms1400.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol, hap +// copyright-holders:hap /* TMS1000 family - TMS1400, TMS1470, TMS1600, TMS1670 diff --git a/src/devices/cpu/tms1000/tms1400.h b/src/devices/cpu/tms1000/tms1400.h index f4c2f177d16..0b73babc223 100644 --- a/src/devices/cpu/tms1000/tms1400.h +++ b/src/devices/cpu/tms1000/tms1400.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol, hap +// copyright-holders:hap /* TMS1000 family - TMS1400, TMS1470, TMS1600, TMS1670 diff --git a/src/devices/cpu/tms1000/tp0320.cpp b/src/devices/cpu/tms1000/tp0320.cpp index 71a5eda71f1..177396e36aa 100644 --- a/src/devices/cpu/tms1000/tp0320.cpp +++ b/src/devices/cpu/tms1000/tp0320.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol, hap +// copyright-holders:hap /* TMS1000 family - TP0320 @@ -10,8 +10,14 @@ #include "debugger.h" // TP0320 is TI's first CMOS MCU with integrated LCD controller, the die is still very similar to TMS0980 -// - ROM and main RAM is same as on TMS0980 with different row-select -// - +// - 2048x9bit ROM, same as on TMS0980 with different row-select +// - 192x4bit RAM array at the bottom-left (set up as 16x12x4) +// - 16x4bit LCD RAM, above main RAM array +// - main instructions PLAs at the same position as TMS0980, fixed opcodes: +// * LDP, RETN, OFF, bb?, be?, b9?, ba?, RBIT, SBIT, COMX8, bc?, LDX, XDA, TDO, SEAC, REAC, SAL, SBL +// - 64-term microinstructions PLA between the RAM and ROM, similar to TMS0980, +// plus separate lines for custom opcode handling like TMS0270, used for SETR and RSTR +// - 24-term output PLA above LCD RAM const device_type TP0320 = &device_creator; // 28-pin SDIP, .. @@ -20,15 +26,15 @@ static ADDRESS_MAP_START(program_11bit_9, AS_PROGRAM, 16, tms1k_base_device) AM_RANGE(0x000, 0xfff) AM_ROM ADDRESS_MAP_END -static ADDRESS_MAP_START(data_64x9_as4, AS_DATA, 8, tms1k_base_device) +static ADDRESS_MAP_START(data_192x4, AS_DATA, 8, tms1k_base_device) AM_RANGE(0x00, 0x7f) AM_RAM - AM_RANGE(0x80, 0x8f) AM_RAM AM_MIRROR(0x70) // DAM + AM_RANGE(0x80, 0xbf) AM_RAM AM_MIRROR(0x40) // DAM ADDRESS_MAP_END // device definitions tp0320_cpu_device::tp0320_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms0980_cpu_device(mconfig, TP0320, "TP0320", tag, owner, clock, 7 /* o pins */, 10 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_11bit_9), 8 /* data width */, ADDRESS_MAP_NAME(data_64x9_as4), "tp0320", __FILE__) + : tms0980_cpu_device(mconfig, TP0320, "TP0320", tag, owner, clock, 7 /* o pins */, 10 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_11bit_9), 8 /* data width */, ADDRESS_MAP_NAME(data_192x4), "tp0320", __FILE__) { } diff --git a/src/devices/cpu/tms1000/tp0320.h b/src/devices/cpu/tms1000/tp0320.h index 32e18e5159f..9b110abdf40 100644 --- a/src/devices/cpu/tms1000/tp0320.h +++ b/src/devices/cpu/tms1000/tp0320.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Wilbert Pol, hap +// copyright-holders:hap /* TMS1000 family - TP0320 From 7b7f2a3fb02c4515392b307ea04bb968450bdbbf Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 16 Mar 2016 11:55:47 +0100 Subject: [PATCH 17/48] layouts: added button panel to starwbc --- src/mame/drivers/hh_tms1k.cpp | 8 +- src/mame/layout/starwbc.lay | 200 ++++++++++++++++++++++++++++------ 2 files changed, 171 insertions(+), 37 deletions(-) diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp index e1be21683b7..62bacd72ecd 100644 --- a/src/mame/drivers/hh_tms1k.cpp +++ b/src/mame/drivers/hh_tms1k.cpp @@ -145,8 +145,8 @@ #include "simon.lh" // clickable #include "ssimon.lh" // clickable #include "splitsec.lh" -#include "starwbc.lh" -#include "stopthie.lh" +#include "starwbc.lh" // clickable +#include "stopthie.lh" // clickable #include "tandy12.lh" // clickable #include "tbreakup.lh" #include "tc4.lh" @@ -5757,8 +5757,8 @@ COMP( 1983, fxmcr165, 0, 0, fxmcr165, fxmcr165, driver_device, 0, "Gak CONS( 1979, elecdet, 0, 0, elecdet, elecdet, driver_device, 0, "Ideal", "Electronic Detective", MACHINE_SUPPORTS_SAVE ) // *** -CONS( 1979, starwbc, 0, 0, starwbc, starwbc, driver_device, 0, "Kenner", "Star Wars - Electronic Battle Command", MACHINE_SUPPORTS_SAVE ) -CONS( 1979, starwbcp, starwbc, 0, starwbc, starwbc, driver_device, 0, "Kenner", "Star Wars - Electronic Battle Command (patent)", MACHINE_SUPPORTS_SAVE ) +CONS( 1979, starwbc, 0, 0, starwbc, starwbc, driver_device, 0, "Kenner", "Star Wars - Electronic Battle Command", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1979, starwbcp, starwbc, 0, starwbc, starwbc, driver_device, 0, "Kenner", "Star Wars - Electronic Battle Command (patent)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) COMP( 1979, astro, 0, 0, astro, astro, driver_device, 0, "Kosmos", "Astro", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) diff --git a/src/mame/layout/starwbc.lay b/src/mame/layout/starwbc.lay index 6469cb7dc9a..faa5e219c6d 100644 --- a/src/mame/layout/starwbc.lay +++ b/src/mame/layout/starwbc.lay @@ -4,9 +4,22 @@ - - - + + + + + + + + + + + + + + + + @@ -29,27 +42,61 @@ - - - - + + + + + + + + - - - - + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -65,20 +112,19 @@ - - - - - - - - - + + + + + + + + - + @@ -100,28 +146,116 @@ - - + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From a3b35f8bc689901ac82a2d47bbe344a57c3632ba Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 16 Mar 2016 19:42:01 +1100 Subject: [PATCH 18/48] Move font enumeration to OSD, separate font name from display name as needed for OSX --- .gitignore | 8 +- src/emu/rendfont.cpp | 26 ++-- src/emu/rendfont.h | 6 +- src/emu/ui/custui.cpp | 67 +++------ src/emu/ui/custui.h | 29 ++-- src/emu/ui/selector.cpp | 25 +++- src/emu/ui/selector.h | 3 +- src/osd/modules/font/font_dwrite.cpp | 17 ++- src/osd/modules/font/font_module.h | 17 ++- src/osd/modules/font/font_none.cpp | 48 +------ src/osd/modules/font/font_osx.cpp | 145 ++++++++++++++----- src/osd/modules/font/font_sdl.cpp | 199 +++++++++++++++----------- src/osd/modules/font/font_windows.cpp | 118 ++++++++++----- src/osd/modules/lib/osdobj_common.cpp | 34 ----- src/osd/modules/lib/osdobj_common.h | 14 +- src/osd/osdepend.h | 30 +++- src/osd/strconv.h | 16 ++- 17 files changed, 455 insertions(+), 347 deletions(-) diff --git a/.gitignore b/.gitignore index f01c2c01e05..5256e5fea85 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,9 @@ *~ +.*.sw? +*.pyc +*.pyo +.DS_Store + /* /*/ !/3rdparty/ @@ -30,11 +35,10 @@ /.idea regtests/chdman/temp regtests/jedutil/output -*.pyc *.mo /CMakeLists.txt /src/devices/cpu/m68000/m68kops.cpp /src/devices/cpu/m68000/m68kops.h /src/devices/cpu/m68000/m68kmake.* /src/devices/cpu/m68000/m68kmake -!/src/devices/cpu/m68000/m68kmake.cpp \ No newline at end of file +!/src/devices/cpu/m68000/m68kmake.cpp diff --git a/src/emu/rendfont.cpp b/src/emu/rendfont.cpp index 27a14bb0d55..bcd1ca35d78 100644 --- a/src/emu/rendfont.cpp +++ b/src/emu/rendfont.cpp @@ -123,7 +123,7 @@ render_font::render_font(render_manager &manager, const char *filename) m_yoffs(0), m_scale(1.0f), m_rawsize(0), - m_osdfont(nullptr), + m_osdfont(), m_height_cmd(0), m_yoffs_cmd(0) { @@ -134,19 +134,18 @@ render_font::render_font(render_manager &manager, const char *filename) if (filename != nullptr) { m_osdfont = manager.machine().osd().font_alloc(); - if (m_osdfont != nullptr) + if (m_osdfont) { if (m_osdfont->open(manager.machine().options().font_path(), filename, m_height)) { - m_scale = 1.0f / (float)m_height; - m_format = FF_OSD; + m_scale = 1.0f / (float)m_height; + m_format = FF_OSD; - //mamep: allocate command glyph font - render_font_command_glyph(); - return; - } - global_free(m_osdfont); - m_osdfont = nullptr; + //mamep: allocate command glyph font + render_font_command_glyph(); + return; + } + m_osdfont.reset(); } } @@ -199,13 +198,6 @@ render_font::~render_font() } delete[] elem; } - - // release the OSD font - if (m_osdfont != nullptr) - { - m_osdfont->close(); - global_free(m_osdfont); - } } diff --git a/src/emu/rendfont.h b/src/emu/rendfont.h index 1f05babd789..b2ec2f12568 100644 --- a/src/emu/rendfont.h +++ b/src/emu/rendfont.h @@ -96,14 +96,14 @@ private: int m_height; // height of the font, from ascent to descent int m_yoffs; // y offset from baseline to descent float m_scale; // 1 / height precomputed - glyph *m_glyphs[256]; // array of glyph subtables + glyph *m_glyphs[256]; // array of glyph subtables std::vector m_rawdata; // pointer to the raw data for the font UINT64 m_rawsize; // size of the raw font data - osd_font *m_osdfont; // handle to the OSD font + std::unique_ptr m_osdfont; // handle to the OSD font int m_height_cmd; // height of the font, from ascent to descent int m_yoffs_cmd; // y offset from baseline to descent - glyph *m_glyphs_cmd[256]; // array of glyph subtables + glyph *m_glyphs_cmd[256]; // array of glyph subtables std::vector m_rawdata_cmd; // pointer to the raw data for the font // constants diff --git a/src/emu/ui/custui.cpp b/src/emu/ui/custui.cpp index a6279ac5b54..14f5cefc4b6 100644 --- a/src/emu/ui/custui.cpp +++ b/src/emu/ui/custui.cpp @@ -9,14 +9,16 @@ *********************************************************************/ #include "emu.h" -#include "ui/ui.h" -#include "ui/menu.h" -#include "ui/selector.h" #include "ui/custui.h" + +#include "ui/ui.h" +#include "ui/selector.h" #include "ui/utils.h" + #include -const char *ui_menu_custom_ui::hide_status[] = { + +const char *const ui_menu_custom_ui::hide_status[] = { __("Show All"), __("Hide Filters"), __("Hide Info/Image"), @@ -192,24 +194,23 @@ void ui_menu_custom_ui::custom_render(void *selectedref, float top, float bottom ui_menu_font_ui::ui_menu_font_ui(running_machine &machine, render_container *container) : ui_menu(machine, container) { ui_options &moptions = machine.ui().options(); -#ifdef UI_WINDOWS - std::string name(machine.options().ui_font()); list(); +#ifdef UI_WINDOWS m_bold = (strreplace(name, "[B]", "") + strreplace(name, "[b]", "") > 0); m_italic = (strreplace(name, "[I]", "") + strreplace(name, "[i]", "") > 0); +#endif m_actual = 0; for (size_t index = 0; index < m_fonts.size(); index++) { - if (m_fonts[index] == name) + if (m_fonts[index].first == name) { m_actual = index; break; } } -#endif m_info_size = moptions.infos_size(); m_font_size = moptions.font_rows(); @@ -231,43 +232,17 @@ ui_menu_font_ui::ui_menu_font_ui(running_machine &machine, render_container *con } -#ifdef UI_WINDOWS -//------------------------------------------------- -// fonts enumerator CALLBACK -//------------------------------------------------- - -int CALLBACK ui_menu_font_ui::EnumFontFamiliesExProc(const LOGFONT *lpelfe, const TEXTMETRIC *lpntme, DWORD FontType, LPARAM lParam) -{ - std::vector *lpc = (std::vector*)lParam; - std::string utf((char *)lpelfe->lfFaceName); - if (utf[0] != '@') - lpc->push_back(utf); - - return 1; -} - //------------------------------------------------- // create fonts list //------------------------------------------------- void ui_menu_font_ui::list() { - // create LOGFONT structure - LOGFONT lf; - lf.lfCharSet = ANSI_CHARSET; - lf.lfFaceName[0] = '\0'; - - HDC hDC = GetDC( nullptr ); - EnumFontFamiliesEx( hDC, &lf, (FONTENUMPROC)EnumFontFamiliesExProc, (LPARAM)&m_fonts, 0 ); - ReleaseDC( nullptr, hDC ); - - // sort - std::stable_sort(m_fonts.begin(), m_fonts.end()); + machine().osd().get_font_families(machine().options().font_path(), m_fonts); // add default string to the top of array - m_fonts.insert(m_fonts.begin(), std::string(_("default"))); + m_fonts.emplace(m_fonts.begin(), std::string("default"), std::string(_("default"))); } -#endif //------------------------------------------------- // dtor @@ -278,18 +253,18 @@ ui_menu_font_ui::~ui_menu_font_ui() std::string error_string; ui_options &moptions = machine().ui().options(); + std::string name(m_fonts[m_actual].first); #ifdef UI_WINDOWS - std::string name(m_fonts[m_actual]); - if (m_fonts[m_actual] != "default") + if (name != "default") { if (m_italic) name.insert(0, "[I]"); if (m_bold) name.insert(0, "[B]"); } +#endif machine().options().set_value(OPTION_UI_FONT, name.c_str(), OPTION_PRIORITY_CMDLINE, error_string); machine().options().mark_changed(OPTION_UI_FONT); -#endif moptions.set_value(OPTION_INFOS_SIZE, m_info_size, OPTION_PRIORITY_CMDLINE, error_string); moptions.set_value(OPTION_FONT_ROWS, m_font_size, OPTION_PRIORITY_CMDLINE, error_string); @@ -325,7 +300,6 @@ void ui_menu_font_ui::handle() } break; -#ifdef UI_WINDOWS case MUI_FNT: if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT) @@ -335,11 +309,15 @@ void ui_menu_font_ui::handle() } else if (m_event->iptkey == IPT_UI_SELECT) { - ui_menu::stack_push(global_alloc_clear(machine(), container, m_fonts, m_actual)); + std::vector display_names; + display_names.reserve(m_fonts.size()); + for (auto const &font : m_fonts) display_names.emplace_back(font.second); + ui_menu::stack_push(global_alloc_clear(machine(), container, std::move(display_names), m_actual)); changed = true; } break; +#ifdef UI_WINDOWS case MUI_BOLD: case MUI_ITALIC: if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT || m_event->iptkey == IPT_UI_SELECT) @@ -364,13 +342,12 @@ void ui_menu_font_ui::populate() // set filter arrow UINT32 arrow_flags; -#ifdef UI_WINDOWS // add fonts option arrow_flags = get_arrow_flags(0, m_fonts.size() - 1, m_actual); - std::string name(m_fonts[m_actual]); - item_append(_("UI Font"), name.c_str(), arrow_flags, (void *)(FPTR)MUI_FNT); + item_append(_("UI Font"), m_fonts[m_actual].second.c_str(), arrow_flags, (void *)(FPTR)MUI_FNT); - if (name != "default") +#ifdef UI_WINDOWS + if (m_fonts[m_actual].first != "default") { item_append(_("Bold"), m_bold ? "On" : "Off", m_bold ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)MUI_BOLD); item_append(_("Italic"), m_italic ? "On" : "Off", m_italic ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)MUI_ITALIC); diff --git a/src/emu/ui/custui.h b/src/emu/ui/custui.h index 2ff13994cb6..46f42967b6a 100644 --- a/src/emu/ui/custui.h +++ b/src/emu/ui/custui.h @@ -10,13 +10,14 @@ #pragma once -#ifndef __UI_CUSTUI_H__ -#define __UI_CUSTUI_H__ +#ifndef MAME_EMU_UI_UI_CUSTUI_H +#define MAME_EMU_UI_UI_CUSTUI_H + +#include "ui/menu.h" + +#include +#include -#ifdef UI_WINDOWS -#define WIN32_LEAN_AND_MEAN -#include -#endif //------------------------------------------------- // Custom UI menu @@ -39,9 +40,9 @@ private: COLORS_MENU, HIDE_MENU }; - static const char *hide_status[]; + static const char *const hide_status[]; std::vector m_lang; - UINT16 m_currlang; + std::uint16_t m_currlang; }; //------------------------------------------------- @@ -67,14 +68,12 @@ private: MUI_ITALIC }; -#ifdef UI_WINDOWS - UINT16 m_actual; - std::vector m_fonts; - bool m_bold, m_italic; - void list(); - static int CALLBACK EnumFontFamiliesExProc(const LOGFONT *lpelfe, const TEXTMETRIC *lpntme, DWORD FontType, LPARAM lParam); + std::uint16_t m_actual; + std::vector > m_fonts; +#ifdef UI_WINDOWS + bool m_bold, m_italic; #endif float m_info_min, m_info_max, m_info_size; @@ -182,4 +181,4 @@ private: rgb_t &m_original; }; -#endif /* __UI_CUSTUI_H__ */ +#endif // MAME_EMU_UI_UI_CUSTUI_H diff --git a/src/emu/ui/selector.cpp b/src/emu/ui/selector.cpp index 330694fd497..5f1704b79fe 100644 --- a/src/emu/ui/selector.cpp +++ b/src/emu/ui/selector.cpp @@ -18,13 +18,26 @@ // ctor / dtor //------------------------------------------------- -ui_menu_selector::ui_menu_selector(running_machine &machine, render_container *container, std::vector s_sel, UINT16 &s_actual, int category, int _hover) - : ui_menu(machine, container), m_selector(s_actual) +ui_menu_selector::ui_menu_selector(running_machine &machine, render_container *container, std::vector const &s_sel, UINT16 &s_actual, int category, int _hover) + : ui_menu(machine, container) + , m_selector(s_actual) + , m_category(category) + , m_hover(_hover) + , m_first_pass(true) + , m_str_items(s_sel) +{ + m_search[0] = '\0'; + m_searchlist[0] = nullptr; +} + +ui_menu_selector::ui_menu_selector(running_machine &machine, render_container *container, std::vector &&s_sel, UINT16 &s_actual, int category, int _hover) + : ui_menu(machine, container) + , m_selector(s_actual) + , m_category(category) + , m_hover(_hover) + , m_first_pass(true) + , m_str_items(std::move(s_sel)) { - m_category = category; - m_first_pass = true; - m_hover = _hover; - m_str_items = s_sel; m_search[0] = '\0'; m_searchlist[0] = nullptr; } diff --git a/src/emu/ui/selector.h b/src/emu/ui/selector.h index 595ca1f578d..b2ccba2a8b6 100644 --- a/src/emu/ui/selector.h +++ b/src/emu/ui/selector.h @@ -28,7 +28,8 @@ enum class ui_menu_selector : public ui_menu { public: - ui_menu_selector(running_machine &machine, render_container *container, std::vector _sel, UINT16 &_actual, int _category = 0, int _hover = 0); + ui_menu_selector(running_machine &machine, render_container *container, std::vector const &_sel, UINT16 &_actual, int _category = 0, int _hover = 0); + ui_menu_selector(running_machine &machine, render_container *container, std::vector &&_sel, UINT16 &_actual, int _category = 0, int _hover = 0); virtual ~ui_menu_selector(); virtual void populate() override; virtual void handle() override; diff --git a/src/osd/modules/font/font_dwrite.cpp b/src/osd/modules/font/font_dwrite.cpp index cfcc952ef0d..0271aeaa249 100644 --- a/src/osd/modules/font/font_dwrite.cpp +++ b/src/osd/modules/font/font_dwrite.cpp @@ -345,7 +345,7 @@ public: { } - virtual bool open(const char *font_path, const char *_name, int &height) override + virtual bool open(std::string const &font_path, std::string const &_name, int &height) override { if (m_d2dfactory == nullptr || m_dwriteFactory == nullptr || m_wicFactory == nullptr) return false; @@ -359,11 +359,11 @@ public: bool italic = (strreplace(name, "[I]", "") + strreplace(name, "[i]", "") > 0); // convert the face name - auto familyName = std::wstring(std::unique_ptr(wstring_from_utf8(name.c_str()), osd_free).get()); + std::unique_ptr familyName(wstring_from_utf8(name.c_str()), osd_free); // find the font HR_RET0(find_font( - familyName.c_str(), + familyName.get(), bold ? DWRITE_FONT_WEIGHT_BOLD : DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STRETCH_NORMAL, italic ? DWRITE_FONT_STYLE_ITALIC : DWRITE_FONT_STYLE_NORMAL, @@ -397,7 +397,7 @@ public: // pixel of a black & white font //------------------------------------------------- - virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) override + virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) override { const int MEM_ALIGN_CONST = 31; const int BITMAP_PAD = 50; @@ -714,9 +714,14 @@ public: return 0; } - virtual osd_font *font_alloc() override + virtual osd_font::ptr font_alloc() override { - return global_alloc(osd_font_dwrite(m_d2dfactory, m_dwriteFactory, m_wicFactory)); + return std::make_unique(m_d2dfactory, m_dwriteFactory, m_wicFactory); + } + + virtual bool get_font_families(std::string const &font_path, std::vector > &result) override + { + return false; } }; diff --git a/src/osd/modules/font/font_module.h b/src/osd/modules/font/font_module.h index c9c7b1f40cb..81ffaca74e5 100644 --- a/src/osd/modules/font/font_module.h +++ b/src/osd/modules/font/font_module.h @@ -5,12 +5,16 @@ * */ -#ifndef FONT_MODULE_H_ -#define FONT_MODULE_H_ +#ifndef MAME_OSD_MODULES_FONT_FONTMODULE_H +#define MAME_OSD_MODULES_FONT_FONTMODULE_H #include "osdepend.h" #include "modules/osdmodule.h" +#include +#include + + //============================================================ // CONSTANTS //============================================================ @@ -21,8 +25,13 @@ class font_module { public: virtual ~font_module() { } - virtual osd_font *font_alloc() = 0; + + /** attempt to allocate a font instance */ + virtual osd_font::ptr font_alloc() = 0; + + /** attempt to list available font families */ + virtual bool get_font_families(std::string const &font_path, std::vector > &result) = 0; }; -#endif /* FONT_MODULE_H_ */ +#endif // MAME_OSD_MODULES_FONT_FONTMODULE_H diff --git a/src/osd/modules/font/font_none.cpp b/src/osd/modules/font/font_none.cpp index de9d01bb103..2716b52cf8e 100644 --- a/src/osd/modules/font/font_none.cpp +++ b/src/osd/modules/font/font_none.cpp @@ -8,61 +8,25 @@ #include "font_module.h" #include "modules/osdmodule.h" -//------------------------------------------------- -// font_open - attempt to "open" a handle to the -// font with the given name -//------------------------------------------------- - class osd_font_none : public osd_font { public: virtual ~osd_font_none() { } - virtual bool open(const char *font_path, const char *name, int &height) override; - virtual void close() override; - virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) override; + virtual bool open(std::string const &font_path, std::string const &name, int &height) override { return false; } + virtual void close() override { } + virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) override { return false; } }; -bool osd_font_none::open(const char *font_path, const char *_name, int &height) -{ - return false; -} - -//------------------------------------------------- -// font_close - release resources associated with -// a given OSD font -//------------------------------------------------- - -void osd_font_none::close() -{ -} - -//------------------------------------------------- -// font_get_bitmap - allocate and populate a -// BITMAP_FORMAT_ARGB32 bitmap containing the -// pixel values rgb_t(0xff,0xff,0xff,0xff) -// or rgb_t(0x00,0xff,0xff,0xff) for each -// pixel of a black & white font -//------------------------------------------------- - -bool osd_font_none::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) -{ - return false; -} - class font_none : public osd_module, public font_module { public: - font_none() : osd_module(OSD_FONT_PROVIDER, "none"), font_module() - { - } + font_none() : osd_module(OSD_FONT_PROVIDER, "none"), font_module() { } virtual int init(const osd_options &options) override { return 0; } - virtual osd_font *font_alloc() override - { - return global_alloc(osd_font_none); - } + virtual osd_font::ptr font_alloc() override { return std::make_unique(); } + virtual bool get_font_families(std::string const &font_path, std::vector > &result) override { return false; } }; MODULE_DEFINITION(FONT_NONE, font_none) diff --git a/src/osd/modules/font/font_osx.cpp b/src/osd/modules/font/font_osx.cpp index 831321fdf34..8e310714649 100644 --- a/src/osd/modules/font/font_osx.cpp +++ b/src/osd/modules/font/font_osx.cpp @@ -10,14 +10,11 @@ #ifdef SDLMAME_MACOSX -#include - #include "corealloc.h" #include "fileio.h" -#define POINT_SIZE 144.0 -#define EXTRA_HEIGHT 1.0 -#define EXTRA_WIDTH 1.15 +#include +#include //------------------------------------------------- // font_open - attempt to "open" a handle to the @@ -27,48 +24,64 @@ class osd_font_osx : public osd_font { public: - virtual ~osd_font_osx() { } + osd_font_osx() : m_font(NULL) { } + osd_font_osx(osd_font_osx &&obj) : m_font(obj.m_font) { obj.m_font = NULL; } + virtual ~osd_font_osx() { close(); } - virtual bool open(const char *font_path, const char *name, int &height); + virtual bool open(std::string const &font_path, std::string const &name, int &height); virtual void close(); - virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs); + virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs); + + osd_font_osx &operator=(osd_font_osx &&obj) + { + using std::swap; + swap(m_font, obj.m_font); + return *this; + } + private: + osd_font_osx(osd_font_osx const &) = delete; + osd_font_osx &operator=(osd_font_osx const &) = delete; + + static constexpr CGFloat POINT_SIZE = 144.0; + static constexpr CGFloat EXTRA_HEIGHT = 1.0; + static constexpr CGFloat EXTRA_WIDTH = 1.15; + CTFontRef m_font; }; -bool osd_font_osx::open(const char *font_path, const char *name, int &height) +bool osd_font_osx::open(std::string const &font_path, std::string const &name, int &height) { - m_font = NULL; - osd_printf_verbose("FONT NAME %s\n", name); + osd_printf_verbose("FONT NAME %s\n", name.c_str()); #if 0 - if (!strcmp(name, "default")) + if (name != "default") { name = "LucidaGrande"; } #endif - CFStringRef const font_name = CFStringCreateWithCString(NULL, name, kCFStringEncodingUTF8); - if (kCFNotFound != CFStringFind(font_name, CFSTR(".BDF"), kCFCompareCaseInsensitive | kCFCompareBackwards | kCFCompareAnchored | kCFCompareNonliteral).location) + CFStringRef const font_name = CFStringCreateWithCString(NULL, name.c_str(), kCFStringEncodingUTF8); + if (font_name && (kCFNotFound != CFStringFind(font_name, CFSTR(".BDF"), kCFCompareCaseInsensitive | kCFCompareBackwards | kCFCompareAnchored | kCFCompareNonliteral).location)) { // handle bdf fonts in the core CFRelease(font_name); return false; } CTFontRef ct_font = NULL; - if (font_name != NULL) + if (font_name) { CTFontDescriptorRef const font_descriptor = CTFontDescriptorCreateWithNameAndSize(font_name, 0.0); - if (font_descriptor != NULL) + if (font_descriptor) { ct_font = CTFontCreateWithFontDescriptor(font_descriptor, POINT_SIZE, &CGAffineTransformIdentity); CFRelease(font_descriptor); } + CFRelease(font_name); } - CFRelease(font_name); if (!ct_font) { - osd_printf_verbose("Couldn't find/open font %s, using MAME default\n", name); + osd_printf_verbose("Couldn't find/open font %s, using MAME default\n", name.c_str()); return false; } @@ -84,6 +97,7 @@ bool osd_font_osx::open(const char *font_path, const char *name, int &height) line_height += CTFontGetLeading(ct_font); height = ceilf(line_height * EXTRA_HEIGHT); + close(); m_font = ct_font; return true; } @@ -96,9 +110,8 @@ bool osd_font_osx::open(const char *font_path, const char *name, int &height) void osd_font_osx::close() { if (m_font != NULL) - { CFRelease(m_font); - } + m_font = NULL; } //------------------------------------------------- @@ -109,7 +122,7 @@ void osd_font_osx::close() // pixel of a black & white font //------------------------------------------------- -bool osd_font_osx::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) +bool osd_font_osx::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) { UniChar uni_char; CGGlyph glyph; @@ -180,21 +193,89 @@ bool osd_font_osx::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 & class font_osx : public osd_module, public font_module { public: - font_osx() - : osd_module(OSD_FONT_PROVIDER, "osx"), font_module() + font_osx() : osd_module(OSD_FONT_PROVIDER, "osx"), font_module() { } + + virtual int init(const osd_options &options) override { return 0; } + virtual osd_font::ptr font_alloc() override { return std::make_unique(); } + virtual bool get_font_families(std::string const &font_path, std::vector > &result) override; + +private: + static CFComparisonResult sort_callback(CTFontDescriptorRef first, CTFontDescriptorRef second, void *refCon) { + CFStringRef left = (CFStringRef)CTFontDescriptorCopyLocalizedAttribute(first, kCTFontDisplayNameAttribute, NULL); + if (!left) left = (CFStringRef)CTFontDescriptorCopyAttribute(first, kCTFontNameAttribute); + CFStringRef right = (CFStringRef)CTFontDescriptorCopyLocalizedAttribute(second, kCTFontDisplayNameAttribute, NULL); + if (!right) right = (CFStringRef)CTFontDescriptorCopyAttribute(second, kCTFontNameAttribute); + + CFComparisonResult result; + if (left && right) result = CFStringCompareWithOptions(left, right, CFRangeMake(0, CFStringGetLength(left)), kCFCompareCaseInsensitive | kCFCompareLocalized | kCFCompareNonliteral); + else if (!left) result = kCFCompareLessThan; + else if (!right) result = kCFCompareGreaterThan; + else result = kCFCompareEqualTo; + + if (left) CFRelease(left); + if (right) CFRelease(right); + return result; } - - virtual int init(const osd_options &options) { return 0; } - - osd_font *font_alloc() - { - return global_alloc(osd_font_osx); - } - }; + +bool font_osx::get_font_families(std::string const &font_path, std::vector > &result) +{ + CFStringRef keys[] = { kCTFontCollectionRemoveDuplicatesOption }; + std::uintptr_t values[ARRAY_LENGTH(keys)] = { 1 }; + CFDictionaryRef const options = CFDictionaryCreate(kCFAllocatorDefault, (void const **)keys, (void const **)values, ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, NULL); + CTFontCollectionRef const collection = CTFontCollectionCreateFromAvailableFonts(NULL); + CFRelease(options); + if (!collection) return false; + + CFArrayRef const descriptors = CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback(collection, &sort_callback, nullptr); + CFRelease(collection); + if (!descriptors) return false; + + result.clear(); + CFIndex const count = CFArrayGetCount(descriptors); + result.reserve(count); + for (CFIndex i = 0; i != count; i++) + { + CTFontDescriptorRef const font = (CTFontDescriptorRef)CFArrayGetValueAtIndex(descriptors, i); + CFStringRef const name = (CFStringRef)CTFontDescriptorCopyAttribute(font, kCTFontNameAttribute); + CFStringRef const display = (CFStringRef)CTFontDescriptorCopyLocalizedAttribute(font, kCTFontDisplayNameAttribute, NULL); + + if (name && display) + { + char const *utf; + std::vector buf; + + utf = CFStringGetCStringPtr(name, kCFStringEncodingUTF8); + if (!utf) + { + buf.resize(CFStringGetMaximumSizeForEncoding(std::max(CFStringGetLength(name), CFStringGetLength(display)), kCFStringEncodingUTF8)); + CFStringGetCString(name, &buf[0], buf.size(), kCFStringEncodingUTF8); + } + std::string utf8name(utf ? utf : &buf[0]); + + utf = CFStringGetCStringPtr(display, kCFStringEncodingUTF8); + if (!utf) + { + buf.resize(CFStringGetMaximumSizeForEncoding(CFStringGetLength(display), kCFStringEncodingUTF8)); + CFStringGetCString(display, &buf[0], buf.size(), kCFStringEncodingUTF8); + } + std::string utf8display(utf ? utf : &buf[0]); + + result.emplace_back(std::move(utf8name), std::move(utf8display)); + } + + if (name) CFRelease(name); + if (display) CFRelease(display); + } + + return true; +} + #else /* SDLMAME_MACOSX */ - MODULE_NOT_SUPPORTED(font_osx, OSD_FONT_PROVIDER, "osx") + +MODULE_NOT_SUPPORTED(font_osx, OSD_FONT_PROVIDER, "osx") + #endif MODULE_DEFINITION(FONT_OSX, font_osx) diff --git a/src/osd/modules/font/font_sdl.cpp b/src/osd/modules/font/font_sdl.cpp index ace9963a28b..bbb3f7ba049 100644 --- a/src/osd/modules/font/font_sdl.cpp +++ b/src/osd/modules/font/font_sdl.cpp @@ -20,7 +20,6 @@ #include "corealloc.h" #include "fileio.h" -#define POINT_SIZE 144.0 //------------------------------------------------- // font_open - attempt to "open" a handle to the @@ -30,38 +29,53 @@ class osd_font_sdl : public osd_font { public: - virtual ~osd_font_sdl() { } + osd_font_sdl() : m_font(nullptr) { } + osd_font_sdl(osd_font_sdl &&obj) : m_font(obj.m_font) { obj.m_font = nullptr; } + virtual ~osd_font_sdl() { close(); } - virtual bool open(const char *font_path, const char *name, int &height); + virtual bool open(std::string const &font_path, std::string const &name, int &height); virtual void close(); - virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs); + virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs); + + osd_font_sdl & operator=(osd_font_sdl &&obj) + { + using std::swap; + swap(m_font, obj.m_font); + return *this; + } + private: + osd_font_sdl(osd_font_sdl const &) = delete; + osd_font_sdl & operator=(osd_font_sdl const &) = delete; + + static constexpr double POINT_SIZE = 144.0; + #ifndef SDLMAME_HAIKU - TTF_Font *search_font_config(std::string name, bool bold, bool italic, bool underline, bool &bakedstyles); + TTF_Font *search_font_config(std::string const &name, bool bold, bool italic, bool underline, bool &bakedstyles); #endif - bool BDF_Check_Magic(std::string name); - TTF_Font * TTF_OpenFont_Magic(std::string name, int fsize); + bool BDF_Check_Magic(std::string const &name); + TTF_Font * TTF_OpenFont_Magic(std::string const &name, int fsize); + TTF_Font *m_font; }; -bool osd_font_sdl::open(const char *font_path, const char *_name, int &height) +bool osd_font_sdl::open(std::string const &font_path, std::string const &_name, int &height) { - TTF_Font *font = (TTF_Font *)NULL; + TTF_Font *font = nullptr; bool bakedstyles = false; int style = 0; // accept qualifiers from the name std::string name(_name); - - if (name.compare("default")==0) + if (name.compare("default") == 0) { name = "Liberation Sans"; } - bool bold = (strreplace(name, "[B]", "") + strreplace(name, "[b]", "") > 0); - bool italic = (strreplace(name, "[I]", "") + strreplace(name, "[i]", "") > 0); - bool underline = (strreplace(name, "[U]", "") + strreplace(name, "[u]", "") > 0); - bool strike = (strreplace(name, "[S]", "") + strreplace(name, "[s]", "") > 0); + bool const bold = (strreplace(name, "[B]", "") + strreplace(name, "[b]", "") > 0); + bool const italic = (strreplace(name, "[I]", "") + strreplace(name, "[i]", "") > 0); + bool const underline = (strreplace(name, "[U]", "") + strreplace(name, "[u]", "") > 0); + bool const strike = (strreplace(name, "[S]", "") + strreplace(name, "[s]", "") > 0); // first up, try it as a filename font = TTF_OpenFont_Magic(name, POINT_SIZE); @@ -72,7 +86,7 @@ bool osd_font_sdl::open(const char *font_path, const char *_name, int &height) { osd_printf_verbose("Searching font %s in -%s\n", name.c_str(), OPTION_FONTPATH); //emu_file file(options().font_path(), OPEN_FLAG_READ); - emu_file file(font_path, OPEN_FLAG_READ); + emu_file file(font_path.c_str(), OPEN_FLAG_READ); if (file.open(name.c_str()) == osd_file::error::NONE) { std::string full_name = file.fullpath(); @@ -96,7 +110,7 @@ bool osd_font_sdl::open(const char *font_path, const char *_name, int &height) { osd_printf_verbose("font %s is not TrueType or BDF, using MAME default\n", name.c_str()); } - return NULL; + return false; } // apply styles @@ -117,6 +131,7 @@ bool osd_font_sdl::open(const char *font_path, const char *_name, int &height) height = TTF_FontLineSkip(font); + close(); m_font = font; return true; } @@ -128,7 +143,9 @@ bool osd_font_sdl::open(const char *font_path, const char *_name, int &height) void osd_font_sdl::close() { - TTF_CloseFont(this->m_font); + if (m_font) + TTF_CloseFont(m_font); + m_font = nullptr; } //------------------------------------------------- @@ -139,17 +156,17 @@ void osd_font_sdl::close() // pixel of a black & white font //------------------------------------------------- -bool osd_font_sdl::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) +bool osd_font_sdl::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) { TTF_Font *ttffont; SDL_Surface *drawsurf; SDL_Color fcol = { 0xff, 0xff, 0xff }; - UINT16 ustr[16]; + std::uint16_t ustr[16]; ttffont = m_font; memset(ustr,0,sizeof(ustr)); - ustr[0] = (UINT16)chnum; + ustr[0] = (std::uint16_t)chnum; drawsurf = TTF_RenderUNICODE_Solid(ttffont, ustr, fcol); // was nothing returned? @@ -161,8 +178,8 @@ bool osd_font_sdl::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 & // copy the rendered character image into it for (int y = 0; y < bitmap.height(); y++) { - UINT32 *dstrow = &bitmap.pix32(y); - UINT8 *srcrow = (UINT8 *)drawsurf->pixels; + std::uint32_t *dstrow = &bitmap.pix32(y); + std::uint8_t *srcrow = (std::uint8_t *)drawsurf->pixels; srcrow += (y * drawsurf->pitch); @@ -182,7 +199,7 @@ bool osd_font_sdl::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 & return bitmap.valid(); } -TTF_Font * osd_font_sdl::TTF_OpenFont_Magic(std::string name, int fsize) +TTF_Font * osd_font_sdl::TTF_OpenFont_Magic(std::string const &name, int fsize) { emu_file file(OPEN_FLAG_READ); if (file.open(name.c_str()) == osd_file::error::NONE) @@ -191,12 +208,12 @@ TTF_Font * osd_font_sdl::TTF_OpenFont_Magic(std::string name, int fsize) unsigned char magic[5] = { 0x00, 0x01, 0x00, 0x00, 0x00 }; file.read(buffer,5); if (memcmp(buffer, magic, 5)) - return NULL; + return nullptr; } return TTF_OpenFont(name.c_str(), POINT_SIZE); } -bool osd_font_sdl::BDF_Check_Magic(std::string name) +bool osd_font_sdl::BDF_Check_Magic(std::string const &name) { emu_file file(OPEN_FLAG_READ); if (file.open(name.c_str()) == osd_file::error::NONE) @@ -213,54 +230,42 @@ bool osd_font_sdl::BDF_Check_Magic(std::string name) } #ifndef SDLMAME_HAIKU -TTF_Font *osd_font_sdl::search_font_config(std::string name, bool bold, bool italic, bool underline, bool &bakedstyles) +TTF_Font *osd_font_sdl::search_font_config(std::string const &name, bool bold, bool italic, bool underline, bool &bakedstyles) { - TTF_Font *font = (TTF_Font *)NULL; - FcConfig *config; - FcPattern *pat; - FcObjectSet *os; - FcFontSet *fontset; + TTF_Font *font = nullptr; FcValue val; - config = FcConfigGetCurrent(); - pat = FcPatternCreate(); - os = FcObjectSetCreate(); - FcPatternAddString(pat, FC_FAMILY, (const FcChar8 *)name.c_str()); + FcConfig *const config = FcConfigGetCurrent(); + std::unique_ptr pat(FcPatternCreate(), &FcPatternDestroy); + std::unique_ptr os(FcObjectSetCreate(), &FcObjectSetDestroy); + FcPatternAddString(pat.get(), FC_FAMILY, (const FcChar8 *)name.c_str()); // try and get a font with the requested styles baked-in if (bold) { if (italic) - { - FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Bold Italic"); - } + FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Bold Italic"); else - { - FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Bold"); - } + FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Bold"); } else if (italic) { - FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Italic"); + FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Italic"); } else { - FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Regular"); + FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Regular"); } - FcPatternAddString(pat, FC_FONTFORMAT, (const FcChar8 *)"TrueType"); + FcPatternAddString(pat.get(), FC_FONTFORMAT, (const FcChar8 *)"TrueType"); - FcObjectSetAdd(os, FC_FILE); - fontset = FcFontList(config, pat, os); + FcObjectSetAdd(os.get(), FC_FILE); + std::unique_ptr fontset(FcFontList(config, pat.get(), os.get()), &FcFontSetDestroy); for (int i = 0; i < fontset->nfont; i++) { - if (FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) != FcResultMatch) - { - continue; - } - - if (val.type != FcTypeString) + if ((FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) != FcResultMatch) || + (val.type != FcTypeString)) { continue; } @@ -281,43 +286,25 @@ TTF_Font *osd_font_sdl::search_font_config(std::string name, bool bold, bool ita // didn't get a font above? try again with no baked-in styles if (!font) { - FcPatternDestroy(pat); - FcFontSetDestroy(fontset); + pat.reset(FcPatternCreate()); + FcPatternAddString(pat.get(), FC_FAMILY, (const FcChar8 *)name.c_str()); + FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Regular"); + FcPatternAddString(pat.get(), FC_FONTFORMAT, (const FcChar8 *)"TrueType"); + fontset.reset(FcFontList(config, pat.get(), os.get())); - pat = FcPatternCreate(); - FcPatternAddString(pat, FC_FAMILY, (const FcChar8 *)name.c_str()); - FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Regular"); - FcPatternAddString(pat, FC_FONTFORMAT, (const FcChar8 *)"TrueType"); - fontset = FcFontList(config, pat, os); - - for (int i = 0; i < fontset->nfont; i++) + for (int i = 0; (i < fontset->nfont) && !font; i++) { - if (FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) != FcResultMatch) + if ((FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) == FcResultMatch) && + (val.type == FcTypeString)) { - continue; - } + osd_printf_verbose("Matching unstyled font: %s\n", val.u.s); - if (val.type != FcTypeString) - { - continue; - } - - osd_printf_verbose("Matching unstyled font: %s\n", val.u.s); - { - std::string match_name((const char*)val.u.s); + std::string const match_name((const char *)val.u.s); font = TTF_OpenFont_Magic(match_name, POINT_SIZE); } - - if (font) - { - break; - } } } - FcPatternDestroy(pat); - FcObjectSetDestroy(os); - FcFontSetDestroy(fontset); return font; } #endif @@ -330,9 +317,9 @@ public: { } - osd_font *font_alloc() + osd_font::ptr font_alloc() { - return global_alloc(osd_font_sdl); + return std::make_unique(); } virtual int init(const osd_options &options) @@ -349,9 +336,53 @@ public: { TTF_Quit(); } + + virtual bool get_font_families(std::string const &font_path, std::vector > &result) override; }; + +bool font_sdl::get_font_families(std::string const &font_path, std::vector > &result) +{ + result.clear(); + + // TODO: enumerate TTF files in font path, since we can load them, too + + FcConfig *const config = FcConfigGetCurrent(); + std::unique_ptr pat(FcPatternCreate(), &FcPatternDestroy); + FcPatternAddString(pat.get(), FC_FONTFORMAT, (const FcChar8 *)"TrueType"); + + std::unique_ptr os(FcObjectSetCreate(), &FcObjectSetDestroy); + FcObjectSetAdd(os.get(), FC_FAMILY); + FcObjectSetAdd(os.get(), FC_FILE); + + std::unique_ptr fontset(FcFontList(config, pat.get(), os.get()), &FcFontSetDestroy); + for (int i = 0; (i < fontset->nfont); i++) + { + FcValue val; + if ((FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) == FcResultMatch) && + (val.type == FcTypeString) && + (FcPatternGet(fontset->fonts[i], FC_FAMILY, 0, &val) == FcResultMatch) && + (val.type == FcTypeString)) + { + auto const compare_fonts = [](std::pair const &a, std::pair const &b) -> bool + { + int const first = core_stricmp(a.first.c_str(), b.first.c_str()); + if (first < 0) return true; + else if (first > 0) return false; + else return core_stricmp(b.second.c_str(), b.second.c_str()) < 0; + }; + std::pair font((const char *)val.u.s, (const char *)val.u.s); + auto const pos = std::lower_bound(result.begin(), result.end(), font, compare_fonts); + if ((result.end() == pos) || (pos->first != font.first)) result.emplace(pos, std::move(font)); + } + } + + return true; +} + #else /* SDLMAME_UNIX */ - MODULE_NOT_SUPPORTED(font_sdl, OSD_FONT_PROVIDER, "sdl") + +MODULE_NOT_SUPPORTED(font_sdl, OSD_FONT_PROVIDER, "sdl") + #endif MODULE_DEFINITION(FONT_SDL, font_sdl) diff --git a/src/osd/modules/font/font_windows.cpp b/src/osd/modules/font/font_windows.cpp index 6d561e5cddd..0de5231f8a0 100644 --- a/src/osd/modules/font/font_windows.cpp +++ b/src/osd/modules/font/font_windows.cpp @@ -5,49 +5,64 @@ * */ +#define WIN32_LEAN_AND_MEAN + #include "font_module.h" #include "modules/osdmodule.h" #if defined(OSD_WINDOWS) || defined(SDLMAME_WIN32) -#define WIN32_LEAN_AND_MEAN -#include -#include -#include -#include -#include - #include "font_module.h" #include "modules/osdmodule.h" #include "strconv.h" #include "corestr.h" #include "corealloc.h" -#include "fileio.h" -//#define POINT_SIZE 144.0 -#define DEFAULT_FONT_HEIGHT (200) +#include -//------------------------------------------------- -// font_open - attempt to "open" a handle to the -// font with the given name -//------------------------------------------------- +#include +#include +#include +#include +#include + + +namespace { class osd_font_windows : public osd_font { public: osd_font_windows(): m_font(NULL) { } - virtual ~osd_font_windows() { } + osd_font_windows(osd_font_windows &&obj) : m_font(obj.m_font) { obj.m_font = NULL; } + virtual ~osd_font_windows() {close(); } - virtual bool open(const char *font_path, const char *name, int &height) override; + virtual bool open(std::string const &font_path, std::string const &name, int &height) override; virtual void close() override; - virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) override; + virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) override; + + osd_font_windows &operator=(osd_font_windows &&obj) + { + using std::swap; + swap(m_font, obj.m_font); + return *this; + } + private: + osd_font_windows(osd_font_windows const &) = delete; + osd_font_windows &operator=(osd_font_windows const &) = delete; + + //#define POINT_SIZE 144.0 + static constexpr LONG DEFAULT_HEIGHT = 200; + HGDIOBJ m_font; }; -bool osd_font_windows::open(const char *font_path, const char *_name, int &height) +bool osd_font_windows::open(std::string const &font_path, std::string const &_name, int &height) { + // don't leak a handle if we already have a font open + close(); + // accept qualifiers from the name std::string name(_name); if (name.compare("default")==0) name = "Tahoma"; @@ -56,7 +71,7 @@ bool osd_font_windows::open(const char *font_path, const char *_name, int &heigh // build a basic LOGFONT description of what we want LOGFONT logfont; - logfont.lfHeight = DEFAULT_FONT_HEIGHT; + logfont.lfHeight = DEFAULT_HEIGHT; logfont.lfWidth = 0; logfont.lfEscapement = 0; logfont.lfOrientation = 0; @@ -85,13 +100,19 @@ bool osd_font_windows::open(const char *font_path, const char *_name, int &heigh // select it into a temp DC and get the real font name HDC dummyDC = CreateCompatibleDC(NULL); HGDIOBJ oldfont = SelectObject(dummyDC, m_font); - TCHAR realname[100]; - GetTextFace(dummyDC, ARRAY_LENGTH(realname), realname); + std::vector realname((std::max)(GetTextFace(dummyDC, 0, nullptr), 0)); + int facelen = GetTextFace(dummyDC, realname.size(), &realname[0]); SelectObject(dummyDC, oldfont); DeleteDC(dummyDC); + if (facelen <= 0) + { + DeleteObject(m_font); + m_font = NULL; + return false; + } // if it doesn't match our request, fail - char *utf = utf8_from_tstring(realname); + char *utf = utf8_from_tstring(&realname[0]); int result = core_stricmp(utf, name.c_str()); osd_free(utf); @@ -115,7 +136,7 @@ void osd_font_windows::close() // delete the font ojbect if (m_font != NULL) DeleteObject(m_font); - + m_font = NULL; } //------------------------------------------------- @@ -269,20 +290,51 @@ bool osd_font_windows::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT class font_win : public osd_module, public font_module { public: - font_win() : osd_module(OSD_FONT_PROVIDER, "win"), font_module() - { - } + font_win() : osd_module(OSD_FONT_PROVIDER, "win"), font_module() { } virtual int init(const osd_options &options) override { return 0; } - virtual osd_font *font_alloc() override - { - return global_alloc(osd_font_windows); - } + virtual osd_font::ptr font_alloc() override { return std::make_unique(); } + virtual bool get_font_families(std::string const &font_path, std::vector > &result) override; + +private: + static int CALLBACK font_family_callback(LOGFONT const *lpelfe, TEXTMETRIC const *lpntme, DWORD FontType, LPARAM lParam) + { + auto &result = *reinterpret_cast > *>(lParam); + char *face = utf8_from_tstring(lpelfe->lfFaceName); + if ((*face != '@') && (result.empty() || (result.back().first != face))) result.emplace_back(face, face); + osd_free(face); + return TRUE; + } }; -#else /* SDLMAME_UNIX */ - MODULE_NOT_SUPPORTED(font_win, OSD_FONT_PROVIDER, "win") -#endif + + +bool font_win::get_font_families(std::string const &font_path, std::vector > &result) +{ + result.clear(); + + LOGFONT logfont; + std::memset(&logfont, 0, sizeof(logfont)); + logfont.lfCharSet = DEFAULT_CHARSET; + logfont.lfFaceName[0] = '\0'; + logfont.lfPitchAndFamily = 0; + + HDC dummyDC = CreateCompatibleDC(nullptr); + HRESULT err = EnumFontFamiliesEx(dummyDC, &logfont, &font_family_callback, reinterpret_cast(&result), 0); + DeleteDC(dummyDC); + + std::stable_sort(result.begin(), result.end()); + + return !FAILED(err); +} + +} // anonymous namespace + +#else // defined(OSD_WINDOWS) || defined(SDLMAME_WIN32) + +MODULE_NOT_SUPPORTED(font_win, OSD_FONT_PROVIDER, "win") + +#endif // defined(OSD_WINDOWS) || defined(SDLMAME_WIN32) MODULE_DEFINITION(FONT_WINDOWS, font_win) diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp index 5cb7cb85da4..f85a322dc58 100644 --- a/src/osd/modules/lib/osdobj_common.cpp +++ b/src/osd/modules/lib/osdobj_common.cpp @@ -507,40 +507,6 @@ void osd_common_t::customize_input_type_list(simple_list &type } -//------------------------------------------------- -// font_open - attempt to "open" a handle to the -// font with the given name -//------------------------------------------------- - -osd_font *osd_common_t::font_open(const char *name, int &height) -{ - return nullptr; -} - - -//------------------------------------------------- -// font_close - release resources associated with -// a given OSD font -//------------------------------------------------- - -void osd_common_t::font_close(osd_font *font) -{ -} - - -//------------------------------------------------- -// font_get_bitmap - allocate and populate a -// BITMAP_FORMAT_ARGB32 bitmap containing the -// pixel values rgb_t(0xff,0xff,0xff,0xff) -// or rgb_t(0x00,0xff,0xff,0xff) for each -// pixel of a black & white font -//------------------------------------------------- - -bool osd_common_t::font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) -{ - return false; -} - //------------------------------------------------- // get_slider_list - allocate and populate a // list of OS-dependent slider values. diff --git a/src/osd/modules/lib/osdobj_common.h b/src/osd/modules/lib/osdobj_common.h index 592391b5161..27e8d29d4a5 100644 --- a/src/osd/modules/lib/osdobj_common.h +++ b/src/osd/modules/lib/osdobj_common.h @@ -10,8 +10,8 @@ #pragma once -#ifndef __OSDOBJ_COMMON_H__ -#define __OSDOBJ_COMMON__ +#ifndef MAME_OSD_LIB_OSDOBJ_COMMON_H +#define MAME_OSD_LIB_OSDOBJ_COMMON_H #include "osdepend.h" #include "modules/osdmodule.h" @@ -182,18 +182,14 @@ public: // input overridables virtual void customize_input_type_list(simple_list &typelist) override; - // font overridables - virtual osd_font *font_open(const char *name, int &height); - virtual void font_close(osd_font *font); - virtual bool font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs); - // video overridables virtual slider_state *get_slider_list() override; // command option overrides virtual bool execute_command(const char *command) override; - virtual osd_font *font_alloc() override { return m_font_module->font_alloc(); } + virtual osd_font::ptr font_alloc() override { return m_font_module->font_alloc(); } + virtual bool get_font_families(std::string const &font_path, std::vector > &result) override { return m_font_module->get_font_families(font_path, result); } virtual osd_midi_device *create_midi_device() override { return m_midi->create_midi_device(); } @@ -286,4 +282,4 @@ debug_module *osd_debugger_creator() return global_alloc(_DeviceClass()); } -#endif /* __OSDOBJ_COMMON_H__ */ +#endif // MAME_OSD_LIB_OSDOBJ_COMMON_H diff --git a/src/osd/osdepend.h b/src/osd/osdepend.h index 3e5b7d91e8f..b6ab45003e1 100644 --- a/src/osd/osdepend.h +++ b/src/osd/osdepend.h @@ -10,14 +10,18 @@ #pragma once -#ifndef __OSDEPEND_H__ -#define __OSDEPEND_H__ +#ifndef MAME_OSD_OSDEPEND_H +#define MAME_OSD_OSDEPEND_H #include "emucore.h" #include "osdcore.h" #include "unicode.h" #include "cliopts.h" +#include +#include +#include + // forward references class input_type_entry; // FIXME: including emu.h does not work because emu.h includes osdepend.h @@ -32,11 +36,22 @@ class input_type_entry; // FIXME: including emu.h does not work because emu. class osd_font { public: - virtual ~osd_font() {} + typedef std::unique_ptr ptr; - virtual bool open(const char *font_path, const char *name, int &height) = 0; + virtual ~osd_font() { } + + /** attempt to "open" a handle to the font with the given name */ + virtual bool open(std::string const &font_path, std::string const &name, int &height) = 0; + + /** release resources associated with a given OSD font */ virtual void close() = 0; - virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) = 0; + + /*! + * allocate and populate a BITMAP_FORMAT_ARGB32 bitmap containing + * the pixel values rgb_t(0xff,0xff,0xff,0xff) or + * rgb_t(0x00,0xff,0xff,0xff) for each pixel of a black & white font + */ + virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) = 0; }; // ======================> osd_interface @@ -68,7 +83,8 @@ public: virtual slider_state *get_slider_list() = 0; // font interface - virtual osd_font *font_alloc() = 0; + virtual osd_font::ptr font_alloc() = 0; + virtual bool get_font_families(std::string const &font_path, std::vector > &result) = 0; // command option overrides virtual bool execute_command(const char *command) = 0; @@ -80,4 +96,4 @@ protected: virtual ~osd_interface() { } }; -#endif /* __OSDEPEND_H__ */ +#endif // MAME_OSD_OSDEPEND_H diff --git a/src/osd/strconv.h b/src/osd/strconv.h index 5de23d0b89b..6d23d78fbb1 100644 --- a/src/osd/strconv.h +++ b/src/osd/strconv.h @@ -6,8 +6,8 @@ // //============================================================ -#ifndef __OSD_STRCONV__ -#define __OSD_STRCONV__ +#ifndef MAME_OSD_STRCONV_H +#define MAME_OSD_STRCONV_H #include "osdcore.h" @@ -17,12 +17,14 @@ // FUNCTION PROTOTYPES //============================================================ -#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS) +#if defined(WIN32) -#if defined(SDLMAME_WIN32) +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN -#include #endif + +#include + // the result of these functions has to be released with osd_free() CHAR *astring_from_utf8(const char *s); @@ -39,7 +41,7 @@ char *utf8_from_wstring(const WCHAR *s); #define utf8_from_tstring utf8_from_astring #endif // UNICODE -#endif //SDLMAME_WIN32 +#endif // defined(WIN32) -#endif // __OSD_STRCONV__ +#endif // MAME_OSD_STRCONV_H From 74e10d87fafe0c88720b359b0e69b600c7c01685 Mon Sep 17 00:00:00 2001 From: Lord-Nightmare Date: Wed, 16 Mar 2016 10:35:58 -0400 Subject: [PATCH 19/48] Symbolics 3600: Fix ROM mapping, add a few more PLD/PLA/PAL labels. [Lord Nightmare] --- src/mame/drivers/symbolics.cpp | 79 +++++++++++++++++++++++----------- 1 file changed, 53 insertions(+), 26 deletions(-) diff --git a/src/mame/drivers/symbolics.cpp b/src/mame/drivers/symbolics.cpp index f09c51a99ed..b7a027d7279 100644 --- a/src/mame/drivers/symbolics.cpp +++ b/src/mame/drivers/symbolics.cpp @@ -21,11 +21,22 @@ public: required_device m_maincpu; DECLARE_DRIVER_INIT(symbolics); + DECLARE_READ16_MEMBER(buserror_r); //protected: // virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; }; +READ16_MEMBER(symbolics_state::buserror_r) +{ + if(!space.debugger_access()) + { + m_maincpu->set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE); + m_maincpu->set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE); + } + return 0; +} + /****************************************************************************** Address Maps @@ -34,12 +45,22 @@ public: Address maps (x = ignored; * = selects address within this range, ? = unknown, 1/0 = decodes only when this bit is set to 1/0) 68k address map: a23 a22 a21 a20 a19 a18 a17 a16 a15 a14 a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 (a0 via UDS/LDS) -? ? ? ? ? 0 0 0 0 * * * * * * * * * * * * * * 0 R ROM 00H -? ? ? ? ? 0 0 0 0 * * * * * * * * * * * * * * 1 R ROM 00L -? ? ? ? ? 0 0 0 1 * * * * * * * * * * * * * * 0 R ROM 04H ?? -? ? ? ? ? 0 0 0 1 * * * * * * * * * * * * * * 1 R ROM 04L ?? -? ? ? ? ? 0 0 1 x * * * * * * * * * * * * * * 0 R ROM 10H ?? -? ? ? ? ? 0 0 1 x * * * * * * * * * * * * * * 1 R ROM 10L ?? +? ? ? ? ? 0 0 0 0 0 * * * * * * * * * * * * * 0 R ROM 00H @D13 first half +? ? ? ? ? 0 0 0 0 0 * * * * * * * * * * * * * 1 R ROM 00L @D7 first half +? ? ? ? ? 0 0 0 0 1 * * * * * * * * * * * * * 0 R ROM 04H @D14 first half +? ? ? ? ? 0 0 0 0 1 * * * * * * * * * * * * * 1 R ROM 04L @D8 first half +? ? ? ? ? 0 0 0 1 0 * * * * * * * * * * * * * 0 R ROM 10H @D16 first half +? ? ? ? ? 0 0 0 1 0 * * * * * * * * * * * * * 1 R ROM 10L @D10 first half +? ? ? ? ? 0 0 0 1 1 * * * * * * * * * * * * * 0 R Open Bus (socket @D17 first half) +? ? ? ? ? 0 0 0 1 1 * * * * * * * * * * * * * 1 R Open Bus (socket @D11 first half) +? ? ? ? ? 0 0 1 0 0 * * * * * * * * * * * * * 0 R ROM 00H @D13 second half +? ? ? ? ? 0 0 1 0 0 * * * * * * * * * * * * * 1 R ROM 00L @D7 second half +? ? ? ? ? 0 0 1 0 1 * * * * * * * * * * * * * 0 R ROM 04H @D14 second half +? ? ? ? ? 0 0 1 0 1 * * * * * * * * * * * * * 1 R ROM 04L @D8 second half +? ? ? ? ? 0 0 1 1 0 * * * * * * * * * * * * * 0 R ROM 10H @D16 second half +? ? ? ? ? 0 0 1 1 0 * * * * * * * * * * * * * 1 R ROM 10L @D10 second half +? ? ? ? ? 0 0 1 1 1 * * * * * * * * * * * * * 0 R Open Bus (socket @D17 second half) +? ? ? ? ? 0 0 1 1 1 * * * * * * * * * * * * * 1 R Open Bus (socket @D11 second half) ? ? ? ? ? 0 1 * * * * * * * * * * * * * * * * * RW RAM <- recheck this, might be a weird hole between 20000-20fff ? ? ? ? ? ? 1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? * ? Something maps here... | | | | | @@ -47,9 +68,10 @@ a23 a22 a21 a20 a19 a18 a17 a16 a15 a14 a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 static ADDRESS_MAP_START(m68k_mem, AS_PROGRAM, 16, symbolics_state ) ADDRESS_MAP_UNMAP_HIGH - AM_RANGE(0x000000, 0x01ffff) AM_ROM /* ROM */ + AM_RANGE(0x000000, 0x01ffff) AM_ROM /* ROM lives here, and writing to 0x00-0x08 writes to the main lisp ram? */ AM_RANGE(0x020000, 0x03ffff) AM_RAM /* Local FEP ram seems to be here? there are 18 mcm4164s on the pcb which probably map here, plus 2 parity bits? */ - AM_RANGE(0x800000, 0xffffff) AM_RAM /* paged access to lispm ram? */ + //AM_RANGE(0x040000, 0xffffff) AM_READ(buserror_r); + //AM_RANGE(0x800000, 0xffffff) AM_RAM /* paged access to lispm ram? */ // there is stuff mapped at 40000 and ffxxx as well, ffxxx may be the main lisp cpu's microcode and macrocode areas ADDRESS_MAP_END @@ -104,16 +126,21 @@ MACHINE_CONFIG_END ROM_START( s3600 ) ROM_REGION16_BE(0x40000,"maincpu", 0) ROM_SYSTEM_BIOS( 0, "v127", "Symbolics 3600 L-Machine FEP V127") - ROMX_LOAD("00h.127.27c128.d13", 0x00000, 0x4000, CRC(b8d7c8da) SHA1(663a09359f5db63beeac00e5c2783ccc25b94250), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "00H.127" @D13 - ROMX_LOAD("00l.127.27128.d7", 0x00001, 0x4000, CRC(cc7bae9a) SHA1(057538eb821c4d00dde19cfe5136ccc0aee43800), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "00L.127" @D7 - ROMX_LOAD("04h.127.27128.d14", 0x08000, 0x4000, CRC(e01a717b) SHA1(b87a670f7be13553485ce88fad5fcf90f01473c4), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "04H.127" @D14 - ROMX_LOAD("04l.127.27128.d8", 0x08001, 0x4000, CRC(68d169fa) SHA1(d6fab3132fca332a9bedb174fddf5fc8c69d05b6), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "04L.127" @D8 - ROMX_LOAD("10h.127.27128.d16", 0x10000, 0x4000, CRC(2ea7a70d) SHA1(61cc97aada028612c24d788d946d77e82116cf30), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "10H.127" @D16 - ROMX_LOAD("10l.127.27c128.d10", 0x10001, 0x4000, CRC(b8ddb3c8) SHA1(e6c3b96340c5c767ef18abf48b73fa8e5d7353b9), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "10L.127" @D10 - ROMX_LOAD("10h.127.27128.d16", 0x18000, 0x4000, CRC(2ea7a70d) SHA1(61cc97aada028612c24d788d946d77e82116cf30), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "10H.127" @D16 - ROMX_LOAD("10l.127.27c128.d10", 0x18001, 0x4000, CRC(b8ddb3c8) SHA1(e6c3b96340c5c767ef18abf48b73fa8e5d7353b9), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "10L.127" @D10 - // D17, D11 are empty sockets, + ROMX_LOAD("00h.127.27c128.d13", 0x00000, 0x2000, CRC(b8d7c8da) SHA1(663a09359f5db63beeac00e5c2783ccc25b94250), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "00H.127" @D13 + ROM_CONTINUE( 0x10000, 0x2000 ) + ROMX_LOAD("00l.127.27128.d7", 0x00001, 0x2000, CRC(cc7bae9a) SHA1(057538eb821c4d00dde19cfe5136ccc0aee43800), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "00L.127" @D7 + ROM_CONTINUE( 0x10001, 0x2000 ) + ROMX_LOAD("04h.127.27128.d14", 0x04000, 0x2000, CRC(e01a717b) SHA1(b87a670f7be13553485ce88fad5fcf90f01473c4), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "04H.127" @D14 + ROM_CONTINUE( 0x14000, 0x2000 ) + ROMX_LOAD("04l.127.27128.d8", 0x04001, 0x2000, CRC(68d169fa) SHA1(d6fab3132fca332a9bedb174fddf5fc8c69d05b6), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "04L.127" @D8 + ROM_CONTINUE( 0x14001, 0x2000 ) + ROMX_LOAD("10h.127.27128.d16", 0x08000, 0x2000, CRC(2ea7a70d) SHA1(61cc97aada028612c24d788d946d77e82116cf30), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "10H.127" @D16 + ROM_CONTINUE( 0x18000, 0x2000 ) + ROMX_LOAD("10l.127.27c128.d10", 0x08001, 0x2000, CRC(b8ddb3c8) SHA1(e6c3b96340c5c767ef18abf48b73fa8e5d7353b9), ROM_SKIP(1) | ROM_BIOS(1)) // Label: "10L.127" @D10 + ROM_CONTINUE( 0x18001, 0x2000 ) + // D17, D11 are empty sockets; these would map to 0x0c000-0ffff and 0x1c000-0x1ffff // note: load all the PLAs, PALs and PROMs here + // picture is at https://4310b1a9-a-11c96037-s-sites.googlegroups.com/a/ricomputermuseum.org/home/Home/equipment/symbolics-3645/Symbolics_3645_FEP.jpg /* LBBUFA.4 mb7124 @A6 LBBUFB.4 mb7124 @A7 @@ -123,25 +150,25 @@ ROM_START( s3600 ) PROCA.4 pal16R8A @A25 HSADR.4 pal1???? @C4 DYNMEM.5 pal16R8A @C20 - ?EDVAL.4? @C21 <- recheck this label! very faded + PCDYNCTL @C21 REQSEL.4A @C22 DY2ACK pal16L8A @C23 PROC.4 pal? @C25 - UDMDMA.4 pal? @D2 - FEP 4642 16pprom? @D4 - HRSQ.4 pal @D5 + UDMAHA.4 pal? @D3 + FEP 4642 16pprom? @D5 + HRSQ.4 pal @D6 d7, d8, d10 are eproms, see above d11 is empty socket marked 2764 d13, d14, d16 are eproms, see above d17 is empty socket marked 2764 - ???????? @E21 <- unreadable label + ?DVZNUR? @E21 <- unreadable label, recheck! LDBD.4 pal16L8A @G18 PAGTAG.5 @H20 - UDMABC.4 pal @I3 - SERDMA.4 @I7 - SERIAB.4 @I8 + UDMABC.4 pal @I4 + SERDMA.4 @I8 + SERIAB.4 @I9 LBARB.4 @I18 - SERCTL.4 @K5 + SERCTL.4 @K6 */ ROM_END From 6ecc87bc2844a35cfd96f02b5deb5756f17913a9 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 17 Mar 2016 04:08:11 +1100 Subject: [PATCH 20/48] Fix drawing characters outside Unicode BMP with SDL Font selection on Linux seems to be working provided you don't choose C/J/K fonts Selecting a C/J/K font causes MAME to give a black screen when dropping back to main menu Since fallback fonts aren't used, this means you can't use the Chinese/Japanese localisations with SDL font provider --- src/osd/modules/font/font_sdl.cpp | 113 ++++++++++++------------------ 1 file changed, 46 insertions(+), 67 deletions(-) diff --git a/src/osd/modules/font/font_sdl.cpp b/src/osd/modules/font/font_sdl.cpp index bbb3f7ba049..2e7d875ede4 100644 --- a/src/osd/modules/font/font_sdl.cpp +++ b/src/osd/modules/font/font_sdl.cpp @@ -8,7 +8,12 @@ #include "font_module.h" #include "modules/osdmodule.h" -#if defined(SDLMAME_UNIX) && (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_SOLARIS)) && (!defined(SDLMAME_HAIKU)) && (!defined(SDLMAME_EMSCRIPTEN)) +#if defined(SDLMAME_UNIX) && !defined(SDLMAME_MACOSX) && !defined(SDLMAME_SOLARIS) && !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN) + +#include "corestr.h" +#include "corealloc.h" +#include "fileio.h" +#include "unicode.h" #include #ifndef SDLMAME_HAIKU @@ -16,11 +21,6 @@ #endif -#include "corestr.h" -#include "corealloc.h" -#include "fileio.h" - - //------------------------------------------------- // font_open - attempt to "open" a handle to the // font with the given name @@ -29,8 +29,8 @@ class osd_font_sdl : public osd_font { public: - osd_font_sdl() : m_font(nullptr) { } - osd_font_sdl(osd_font_sdl &&obj) : m_font(obj.m_font) { obj.m_font = nullptr; } + osd_font_sdl() : m_font(nullptr, &TTF_CloseFont) { } + osd_font_sdl(osd_font_sdl &&obj) : m_font(std::move(obj.m_font)) { } virtual ~osd_font_sdl() { close(); } virtual bool open(std::string const &font_path, std::string const &name, int &height); @@ -45,25 +45,25 @@ public: } private: + typedef std::unique_ptr TTF_Font_ptr; + osd_font_sdl(osd_font_sdl const &) = delete; osd_font_sdl & operator=(osd_font_sdl const &) = delete; static constexpr double POINT_SIZE = 144.0; #ifndef SDLMAME_HAIKU - TTF_Font *search_font_config(std::string const &name, bool bold, bool italic, bool underline, bool &bakedstyles); + TTF_Font_ptr search_font_config(std::string const &name, bool bold, bool italic, bool underline, bool &bakedstyles); #endif bool BDF_Check_Magic(std::string const &name); - TTF_Font * TTF_OpenFont_Magic(std::string const &name, int fsize); + TTF_Font_ptr TTF_OpenFont_Magic(std::string const &name, int fsize); - TTF_Font *m_font; + TTF_Font_ptr m_font; }; bool osd_font_sdl::open(std::string const &font_path, std::string const &_name, int &height) { - TTF_Font *font = nullptr; bool bakedstyles = false; - int style = 0; // accept qualifiers from the name std::string name(_name); @@ -78,7 +78,7 @@ bool osd_font_sdl::open(std::string const &font_path, std::string const &_name, bool const strike = (strreplace(name, "[S]", "") + strreplace(name, "[s]", "") > 0); // first up, try it as a filename - font = TTF_OpenFont_Magic(name, POINT_SIZE); + TTF_Font_ptr font = TTF_OpenFont_Magic(name, POINT_SIZE); // if no success, try the font path @@ -114,6 +114,7 @@ bool osd_font_sdl::open(std::string const &font_path, std::string const &_name, } // apply styles + int style = 0; if (!bakedstyles) { style |= bold ? TTF_STYLE_BOLD : 0; @@ -127,12 +128,11 @@ bool osd_font_sdl::open(std::string const &font_path, std::string const &_name, if (strike) osd_printf_warning("Ignoring strikethrough for SDL_TTF older than 2.0.10\n"); #endif // PATCHLEVEL - TTF_SetFontStyle(font, style); + TTF_SetFontStyle(font.get(), style); - height = TTF_FontLineSkip(font); + height = TTF_FontLineSkip(font.get()); - close(); - m_font = font; + m_font = std::move(font); return true; } @@ -143,9 +143,7 @@ bool osd_font_sdl::open(std::string const &font_path, std::string const &_name, void osd_font_sdl::close() { - if (m_font) - TTF_CloseFont(m_font); - m_font = nullptr; + m_font.reset(); } //------------------------------------------------- @@ -158,16 +156,10 @@ void osd_font_sdl::close() bool osd_font_sdl::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) { - TTF_Font *ttffont; - SDL_Surface *drawsurf; - SDL_Color fcol = { 0xff, 0xff, 0xff }; + SDL_Color const fcol = { 0xff, 0xff, 0xff }; std::uint16_t ustr[16]; - - ttffont = m_font; - - memset(ustr,0,sizeof(ustr)); - ustr[0] = (std::uint16_t)chnum; - drawsurf = TTF_RenderUNICODE_Solid(ttffont, ustr, fcol); + ustr[utf16_from_uchar(ustr, ARRAY_LENGTH(ustr), chnum)] = 0; + std::unique_ptr const drawsurf(TTF_RenderUNICODE_Solid(m_font.get(), ustr, fcol), &SDL_FreeSurface); // was nothing returned? if (drawsurf) @@ -178,39 +170,35 @@ bool osd_font_sdl::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::in // copy the rendered character image into it for (int y = 0; y < bitmap.height(); y++) { - std::uint32_t *dstrow = &bitmap.pix32(y); - std::uint8_t *srcrow = (std::uint8_t *)drawsurf->pixels; - - srcrow += (y * drawsurf->pitch); + std::uint32_t *const dstrow = &bitmap.pix32(y); + std::uint8_t const *const srcrow = reinterpret_cast(drawsurf->pixels) + (y * drawsurf->pitch); for (int x = 0; x < drawsurf->w; x++) { - dstrow[x] = srcrow[x] ? rgb_t(0xff,0xff,0xff,0xff) : rgb_t(0x00,0xff,0xff,0xff); + dstrow[x] = srcrow[x] ? rgb_t(0xff, 0xff, 0xff, 0xff) : rgb_t(0x00, 0xff, 0xff, 0xff); } } // what are these? xoffs = yoffs = 0; width = drawsurf->w; - - SDL_FreeSurface(drawsurf); } return bitmap.valid(); } -TTF_Font * osd_font_sdl::TTF_OpenFont_Magic(std::string const &name, int fsize) +osd_font_sdl::TTF_Font_ptr osd_font_sdl::TTF_OpenFont_Magic(std::string const &name, int fsize) { emu_file file(OPEN_FLAG_READ); if (file.open(name.c_str()) == osd_file::error::NONE) { - unsigned char buffer[5] = { 0xff, 0xff, 0xff, 0xff, 0xff }; - unsigned char magic[5] = { 0x00, 0x01, 0x00, 0x00, 0x00 }; - file.read(buffer,5); - if (memcmp(buffer, magic, 5)) - return nullptr; + unsigned char const magic[] = { 0x00, 0x01, 0x00, 0x00, 0x00 }; + unsigned char buffer[sizeof(magic)] = { 0xff, 0xff, 0xff, 0xff, 0xff }; + if ((sizeof(magic) != file.read(buffer, sizeof(magic))) || memcmp(buffer, magic, sizeof(magic))) + return TTF_Font_ptr(nullptr, &TTF_CloseFont); + file.close(); } - return TTF_OpenFont(name.c_str(), POINT_SIZE); + return TTF_Font_ptr(TTF_OpenFont(name.c_str(), POINT_SIZE), &TTF_CloseFont); } bool osd_font_sdl::BDF_Check_Magic(std::string const &name) @@ -218,22 +206,18 @@ bool osd_font_sdl::BDF_Check_Magic(std::string const &name) emu_file file(OPEN_FLAG_READ); if (file.open(name.c_str()) == osd_file::error::NONE) { - unsigned char buffer[9]; - unsigned char magic[9] = { 'S', 'T', 'A', 'R', 'T', 'F', 'O', 'N', 'T' }; - file.read(buffer, 9); - file.close(); - if (!memcmp(buffer, magic, 9)) + unsigned char const magic[] = { 'S', 'T', 'A', 'R', 'T', 'F', 'O', 'N', 'T' }; + unsigned char buffer[sizeof(magic)]; + if ((sizeof(magic) != file.read(buffer, sizeof(magic))) || memcmp(buffer, magic, sizeof(magic))) return true; } - return false; } #ifndef SDLMAME_HAIKU -TTF_Font *osd_font_sdl::search_font_config(std::string const &name, bool bold, bool italic, bool underline, bool &bakedstyles) +osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &name, bool bold, bool italic, bool underline, bool &bakedstyles) { - TTF_Font *font = nullptr; - FcValue val; + TTF_Font_ptr font(nullptr, &TTF_CloseFont); FcConfig *const config = FcConfigGetCurrent(); std::unique_ptr pat(FcPatternCreate(), &FcPatternDestroy); @@ -262,24 +246,18 @@ TTF_Font *osd_font_sdl::search_font_config(std::string const &name, bool bold, b FcObjectSetAdd(os.get(), FC_FILE); std::unique_ptr fontset(FcFontList(config, pat.get(), os.get()), &FcFontSetDestroy); - for (int i = 0; i < fontset->nfont; i++) + for (int i = 0; (i < fontset->nfont) && !font; i++) { - if ((FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) != FcResultMatch) || - (val.type != FcTypeString)) + FcValue val; + if ((FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) == FcResultMatch) && (val.type != FcTypeString)) { - continue; - } + osd_printf_verbose("Matching font: %s\n", val.u.s); - osd_printf_verbose("Matching font: %s\n", val.u.s); - { std::string match_name((const char*)val.u.s); font = TTF_OpenFont_Magic(match_name, POINT_SIZE); - } - if (font) - { - bakedstyles = true; - break; + if (font) + bakedstyles = true; } } @@ -294,8 +272,8 @@ TTF_Font *osd_font_sdl::search_font_config(std::string const &name, bool bold, b for (int i = 0; (i < fontset->nfont) && !font; i++) { - if ((FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) == FcResultMatch) && - (val.type == FcTypeString)) + FcValue val; + if ((FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) == FcResultMatch) && (val.type == FcTypeString)) { osd_printf_verbose("Matching unstyled font: %s\n", val.u.s); @@ -340,6 +318,7 @@ public: virtual bool get_font_families(std::string const &font_path, std::vector > &result) override; }; + bool font_sdl::get_font_families(std::string const &font_path, std::vector > &result) { result.clear(); From 593c9d5ce6eec5a5e1922e1a63dca73a1d4b778d Mon Sep 17 00:00:00 2001 From: smf- Date: Wed, 16 Mar 2016 18:19:11 +0000 Subject: [PATCH 21/48] Build with vs2015 Update 2 RC --- scripts/genie.lua | 1 + src/mame/drivers/symbolics.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/genie.lua b/scripts/genie.lua index 3b441df21c4..e991bb5ed38 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -1280,6 +1280,7 @@ end } configuration { "vs2015" } buildoptions { + "/wd4334", -- warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration "/wd4457", -- warning C4457: declaration of 'xxx' hides function parameter "/wd4458", -- warning C4458: declaration of 'xxx' hides class member diff --git a/src/mame/drivers/symbolics.cpp b/src/mame/drivers/symbolics.cpp index b7a027d7279..4e5ea4b918f 100644 --- a/src/mame/drivers/symbolics.cpp +++ b/src/mame/drivers/symbolics.cpp @@ -7,6 +7,7 @@ ******************************************************************************/ /* Core includes */ +#include "emu.h" #include "cpu/m68000/m68000.h" class symbolics_state : public driver_device From 8437514d2cf5ebc5da08e53783e91702f46888fb Mon Sep 17 00:00:00 2001 From: Scott Stone Date: Wed, 16 Mar 2016 15:03:47 -0400 Subject: [PATCH 22/48] Update nes.xml hash with new multigame dumps from TeamEurope (nw) --- hash/nes.xml | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 93 insertions(+), 3 deletions(-) diff --git a/hash/nes.xml b/hash/nes.xml index 57ae778df37..b850e5abd63 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -79788,6 +79788,22 @@ that the real dumps might surface --> + + CoolBoy 198-in-1 + 201? + <unknown> + + + + + + + + + + + + 777777-in-1 (8 bit Slim Station, NEWPXP-DVT22-A PCB)(Unl)[U][!] 19?? @@ -79836,9 +79852,8 @@ that the real dumps might surface --> - - CoolBoy 400 in 1 + CoolBoy 400-in-1 19?? <unknown> @@ -79914,6 +79929,54 @@ that the real dumps might surface --> + + Game 450-in-1 + 201? + <unknown> + + + + + + + + + + + + + + Game 500-in-1 + 201? + <unknown> + + + + + + + + + + + + + + Super Game 218-in-1 + 201? + <unknown> + + + + + + + + + + + + Super Game 360-in-1 19?? @@ -79930,9 +79993,24 @@ that the real dumps might surface --> + + Super Game 402-in-1 + 201? + <unknown> + + + + + + + + + + + - Games Xplosion 121 in 1 + Games Xplosion 121-in-1 19?? <unknown> @@ -79947,6 +80025,18 @@ that the real dumps might surface --> + + Handheld 210-in-1 + 201? + <unknown> + + + + + + + + From 3db357bff45784d675acc0f85aaca8c73b52858e Mon Sep 17 00:00:00 2001 From: couriersud Date: Wed, 16 Mar 2016 20:10:22 +0100 Subject: [PATCH 23/48] A lot of ttf fonts (including C/J/K fonts like unifont) do not have an type attribute "Regular". This fix will load the first font found if no "bold" "bold italic" "italic" or "regular" attribute was found. [Couriersud] --- src/osd/modules/font/font_sdl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osd/modules/font/font_sdl.cpp b/src/osd/modules/font/font_sdl.cpp index 2e7d875ede4..47960b02f55 100644 --- a/src/osd/modules/font/font_sdl.cpp +++ b/src/osd/modules/font/font_sdl.cpp @@ -266,7 +266,8 @@ osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &n { pat.reset(FcPatternCreate()); FcPatternAddString(pat.get(), FC_FAMILY, (const FcChar8 *)name.c_str()); - FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Regular"); + //Quite a lot of fonts don't have a "Regular" font type attribute + //FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Regular"); FcPatternAddString(pat.get(), FC_FONTFORMAT, (const FcChar8 *)"TrueType"); fontset.reset(FcFontList(config, pat.get(), os.get())); From 1ed5e0df43a10d932f378aa8b723e9459fe54314 Mon Sep 17 00:00:00 2001 From: couriersud Date: Wed, 16 Mar 2016 20:11:30 +0100 Subject: [PATCH 24/48] Netlist: Some code simplification --- src/lib/netlist/nl_base.cpp | 37 ++++++----------------------------- src/lib/netlist/nl_base.h | 5 +---- src/lib/netlist/plib/plists.h | 8 ++------ 3 files changed, 9 insertions(+), 41 deletions(-) diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp index 964ac8b4e03..80f635b3f73 100644 --- a/src/lib/netlist/nl_base.cpp +++ b/src/lib/netlist/nl_base.cpp @@ -653,48 +653,23 @@ ATTR_COLD void net_t::save_register() object_t::save_register(); } -ATTR_HOT /* inline */ void core_terminal_t::update_dev(const UINT32 mask) -{ - inc_stat(netdev().stat_call_count); - if ((state() & mask) != 0) - { - device().update_dev(); - } -} - ATTR_HOT /* inline */ void net_t::update_devs() { //assert(m_num_cons != 0); nl_assert(this->isRailNet()); - const UINT32 masks[4] = { 1, 5, 3, 1 }; - const UINT32 mask = masks[ (m_cur_Q << 1) | m_new_Q ]; + const int masks[4] = { 1, 5, 3, 1 }; + const int mask = masks[ (m_cur_Q << 1) | m_new_Q ]; m_in_queue = 2; /* mark as taken ... */ m_cur_Q = m_new_Q; -#if 0 - core_terminal_t * t[256]; - core_terminal_t *p = m_list_active.first(); - int cnt = 0; - while (p != NULL) + + for (core_terminal_t *p = m_list_active.first(); p != NULL; p = p->next()) { + inc_stat(p->netdev().stat_call_count); if ((p->state() & mask) != 0) - t[cnt++] = p; - p = m_list_active.next(p); + p->device().update_dev(); } - - for (int i=0; idevice().update_dev(); - -#else - core_terminal_t *p = m_list_active.first(); - - while (p != NULL) - { - p->update_dev(mask); - p = m_list_active.next(p); - } -#endif } ATTR_COLD void net_t::reset() diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index c824a1564fc..72911c9b25c 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -495,16 +495,13 @@ namespace netlist ATTR_HOT net_t & net() { return *m_net;} ATTR_HOT bool is_state(const state_e astate) const { return (m_state == astate); } - ATTR_HOT state_e state() const { return m_state; } + ATTR_HOT const state_e &state() const { return m_state; } ATTR_HOT void set_state(const state_e astate) { nl_assert(astate != STATE_NONEX); m_state = astate; } - - ATTR_HOT /* inline */ void update_dev(const UINT32 mask); - protected: virtual void save_register() override { diff --git a/src/lib/netlist/plib/plists.h b/src/lib/netlist/plib/plists.h index 323e12dad0d..d63d4fbe898 100644 --- a/src/lib/netlist/plib/plists.h +++ b/src/lib/netlist/plib/plists.h @@ -210,18 +210,14 @@ public: ATTR_HOT void remove(const _ListClass &elem) { - _ListClass **p = &m_head; - while (*p != &elem) + _ListClass **p; + for (p = &m_head; *p != &elem; p = &((*p)->m_next)) { //nl_assert(*p != NULL); - p = &((*p)->m_next); } (*p) = elem.m_next; } - - ATTR_HOT static _ListClass *next(const _ListClass &elem) { return elem.m_next; } - ATTR_HOT static _ListClass *next(const _ListClass *elem) { return elem->m_next; } ATTR_HOT _ListClass *first() const { return m_head; } ATTR_HOT void clear() { m_head = NULL; } ATTR_HOT bool is_empty() const { return (m_head == NULL); } From 0f3bc4ca99633240848e024eddb781e9764e2891 Mon Sep 17 00:00:00 2001 From: couriersud Date: Wed, 16 Mar 2016 21:07:17 +0100 Subject: [PATCH 25/48] Fix linux font loading. [Couriersud] --- src/osd/modules/font/font_sdl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osd/modules/font/font_sdl.cpp b/src/osd/modules/font/font_sdl.cpp index 47960b02f55..3c8a69d5d63 100644 --- a/src/osd/modules/font/font_sdl.cpp +++ b/src/osd/modules/font/font_sdl.cpp @@ -249,7 +249,7 @@ osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &n for (int i = 0; (i < fontset->nfont) && !font; i++) { FcValue val; - if ((FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) == FcResultMatch) && (val.type != FcTypeString)) + if ((FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) == FcResultMatch) && (val.type == FcTypeString)) { osd_printf_verbose("Matching font: %s\n", val.u.s); From 5d4c65c071fba2f65e5562a81b5231724ff939ff Mon Sep 17 00:00:00 2001 From: Brad Hughes Date: Wed, 16 Mar 2016 16:51:12 -0400 Subject: [PATCH 26/48] Rename ioprocs parameters from "generic" which MS C++ compiler treats as keyword when compiling with /ZW --- src/lib/formats/ioprocs.cpp | 40 ++++++++++++++++++------------------- src/lib/formats/ioprocs.h | 10 +++++----- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/lib/formats/ioprocs.cpp b/src/lib/formats/ioprocs.cpp index 9f00e3bb9d5..3efb1055e56 100644 --- a/src/lib/formats/ioprocs.cpp +++ b/src/lib/formats/ioprocs.cpp @@ -121,49 +121,49 @@ const struct io_procs corefile_ioprocs_noclose = calls for accessing generic IO *********************************************************************/ -static void io_generic_seek(struct io_generic *generic, UINT64 offset) +static void io_generic_seek(struct io_generic *genio, UINT64 offset) { - generic->procs->seekproc(generic->file, offset, SEEK_SET); + genio->procs->seekproc(genio->file, offset, SEEK_SET); } -void io_generic_close(struct io_generic *generic) +void io_generic_close(struct io_generic *genio) { - if (generic->procs->closeproc) - generic->procs->closeproc(generic->file); + if (genio->procs->closeproc) + genio->procs->closeproc(genio->file); } -void io_generic_read(struct io_generic *generic, void *buffer, UINT64 offset, size_t length) +void io_generic_read(struct io_generic *genio, void *buffer, UINT64 offset, size_t length) { UINT64 size; size_t bytes_read; - size = io_generic_size(generic); + size = io_generic_size(genio); if (size <= offset) { bytes_read = 0; } else { - io_generic_seek(generic, offset); - bytes_read = generic->procs->readproc(generic->file, buffer, length); + io_generic_seek(genio, offset); + bytes_read = genio->procs->readproc(genio->file, buffer, length); } - memset(((UINT8 *) buffer) + bytes_read, generic->filler, length - bytes_read); + memset(((UINT8 *) buffer) + bytes_read, genio->filler, length - bytes_read); } -void io_generic_write(struct io_generic *generic, const void *buffer, UINT64 offset, size_t length) +void io_generic_write(struct io_generic *genio, const void *buffer, UINT64 offset, size_t length) { UINT64 filler_size = 0; char filler_buffer[1024]; size_t bytes_to_write; UINT64 size; - size = io_generic_size(generic); + size = io_generic_size(genio); if (size < offset) { @@ -171,27 +171,27 @@ void io_generic_write(struct io_generic *generic, const void *buffer, UINT64 off offset = size; } - io_generic_seek(generic, offset); + io_generic_seek(genio, offset); if (filler_size) { - memset(filler_buffer, generic->filler, sizeof(filler_buffer)); + memset(filler_buffer, genio->filler, sizeof(filler_buffer)); do { bytes_to_write = (filler_size > sizeof(filler_buffer)) ? sizeof(filler_buffer) : (size_t) filler_size; - generic->procs->writeproc(generic->file, filler_buffer, bytes_to_write); + genio->procs->writeproc(genio->file, filler_buffer, bytes_to_write); filler_size -= bytes_to_write; } while(filler_size > 0); } if (length > 0) - generic->procs->writeproc(generic->file, buffer, length); + genio->procs->writeproc(genio->file, buffer, length); } -void io_generic_write_filler(struct io_generic *generic, UINT8 filler, UINT64 offset, size_t length) +void io_generic_write_filler(struct io_generic *genio, UINT8 filler, UINT64 offset, size_t length) { UINT8 buffer[512]; size_t this_length; @@ -201,7 +201,7 @@ void io_generic_write_filler(struct io_generic *generic, UINT8 filler, UINT64 of while(length > 0) { this_length = MIN(length, sizeof(buffer)); - io_generic_write(generic, buffer, offset, this_length); + io_generic_write(genio, buffer, offset, this_length); offset += this_length; length -= this_length; } @@ -209,7 +209,7 @@ void io_generic_write_filler(struct io_generic *generic, UINT8 filler, UINT64 of -UINT64 io_generic_size(struct io_generic *generic) +UINT64 io_generic_size(struct io_generic *genio) { - return generic->procs->filesizeproc(generic->file); + return genio->procs->filesizeproc(genio->file); } diff --git a/src/lib/formats/ioprocs.h b/src/lib/formats/ioprocs.h index 824e0d38129..08acbe45295 100644 --- a/src/lib/formats/ioprocs.h +++ b/src/lib/formats/ioprocs.h @@ -61,11 +61,11 @@ extern const struct io_procs corefile_ioprocs_noclose; -void io_generic_close(struct io_generic *generic); -void io_generic_read(struct io_generic *generic, void *buffer, UINT64 offset, size_t length); -void io_generic_write(struct io_generic *generic, const void *buffer, UINT64 offset, size_t length); -void io_generic_write_filler(struct io_generic *generic, UINT8 filler, UINT64 offset, size_t length); -UINT64 io_generic_size(struct io_generic *generic); +void io_generic_close(struct io_generic *genio); +void io_generic_read(struct io_generic *genio, void *buffer, UINT64 offset, size_t length); +void io_generic_write(struct io_generic *genio, const void *buffer, UINT64 offset, size_t length); +void io_generic_write_filler(struct io_generic *genio, UINT8 filler, UINT64 offset, size_t length); +UINT64 io_generic_size(struct io_generic *genio); From 3326bc6fab1747089743995c958a9df9823f432a Mon Sep 17 00:00:00 2001 From: balr0g Date: Wed, 16 Mar 2016 16:55:22 -0400 Subject: [PATCH 27/48] Fix crash on load due to buffer overrun in gba cart loader (nw) --- src/devices/bus/gba/gba_slot.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/devices/bus/gba/gba_slot.cpp b/src/devices/bus/gba/gba_slot.cpp index 10c5d45a0a8..737ff5fa6ed 100644 --- a/src/devices/bus/gba/gba_slot.cpp +++ b/src/devices/bus/gba/gba_slot.cpp @@ -295,17 +295,17 @@ int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) // first detect nvram type based on strings inside the file for (int i = 0; i < len; i++) { - if (!memcmp(&ROM[i], "EEPROM_V", 8)) + if ((i Date: Wed, 16 Mar 2016 22:05:14 +0100 Subject: [PATCH 28/48] svi318: rewrite banking, add expander bus, add svi601 super expander and slot modules for the sv801 disk controller, sv803 16k memory epansion and the sv807 64k memory expansion --- scripts/src/bus.lua | 36 +++ scripts/target/mame/mess.lua | 2 + src/devices/bus/svi3x8/expander/expander.cpp | 151 ++++++++++ src/devices/bus/svi3x8/expander/expander.h | 162 +++++++++++ src/devices/bus/svi3x8/expander/modules.cpp | 13 + src/devices/bus/svi3x8/expander/modules.h | 19 ++ src/devices/bus/svi3x8/expander/sv601.cpp | 98 +++++++ src/devices/bus/svi3x8/expander/sv601.h | 59 ++++ src/devices/bus/svi3x8/slot/cards.cpp | 15 + src/devices/bus/svi3x8/slot/cards.h | 21 ++ src/devices/bus/svi3x8/slot/slot.cpp | 284 +++++++++++++++++++ src/devices/bus/svi3x8/slot/slot.h | 178 ++++++++++++ src/devices/bus/svi3x8/slot/sv801.cpp | 144 ++++++++++ src/devices/bus/svi3x8/slot/sv801.h | 61 ++++ src/devices/bus/svi3x8/slot/sv803.cpp | 68 +++++ src/devices/bus/svi3x8/slot/sv803.h | 44 +++ src/devices/bus/svi3x8/slot/sv807.cpp | 163 +++++++++++ src/devices/bus/svi3x8/slot/sv807.h | 60 ++++ src/mame/drivers/svi318.cpp | 191 +++++++++---- 19 files changed, 1711 insertions(+), 58 deletions(-) create mode 100644 src/devices/bus/svi3x8/expander/expander.cpp create mode 100644 src/devices/bus/svi3x8/expander/expander.h create mode 100644 src/devices/bus/svi3x8/expander/modules.cpp create mode 100644 src/devices/bus/svi3x8/expander/modules.h create mode 100644 src/devices/bus/svi3x8/expander/sv601.cpp create mode 100644 src/devices/bus/svi3x8/expander/sv601.h create mode 100644 src/devices/bus/svi3x8/slot/cards.cpp create mode 100644 src/devices/bus/svi3x8/slot/cards.h create mode 100644 src/devices/bus/svi3x8/slot/slot.cpp create mode 100644 src/devices/bus/svi3x8/slot/slot.h create mode 100644 src/devices/bus/svi3x8/slot/sv801.cpp create mode 100644 src/devices/bus/svi3x8/slot/sv801.h create mode 100644 src/devices/bus/svi3x8/slot/sv803.cpp create mode 100644 src/devices/bus/svi3x8/slot/sv803.h create mode 100644 src/devices/bus/svi3x8/slot/sv807.cpp create mode 100644 src/devices/bus/svi3x8/slot/sv807.h diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 1379c572fa8..d6bc6cfedda 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -2587,3 +2587,39 @@ if (BUSES["NEWBRAIN"]~=null) then MAME_DIR .. "src/devices/bus/newbrain/fdc.h", } end + +--------------------------------------------------- +-- +--@src/devices/bus/svi3x8/expander/expander.h,BUSES["SVI_EXPANDER"] = true +--------------------------------------------------- + +if (BUSES["SVI_EXPANDER"]~=null) then + files { + MAME_DIR .. "src/devices/bus/svi3x8/expander/expander.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/expander/expander.h", + MAME_DIR .. "src/devices/bus/svi3x8/expander/modules.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/expander/modules.h", + MAME_DIR .. "src/devices/bus/svi3x8/expander/sv601.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/expander/sv601.h", + } +end + +--------------------------------------------------- +-- +--@src/devices/bus/svi3x8/slot/slot.h,BUSES["SVI_SLOT"] = true +--------------------------------------------------- + +if (BUSES["SVI_SLOT"]~=null) then + files { + MAME_DIR .. "src/devices/bus/svi3x8/slot/slot.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/slot/slot.h", + MAME_DIR .. "src/devices/bus/svi3x8/slot/cards.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/slot/cards.h", + MAME_DIR .. "src/devices/bus/svi3x8/slot/sv801.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/slot/sv801.h", + MAME_DIR .. "src/devices/bus/svi3x8/slot/sv803.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/slot/sv803.h", + MAME_DIR .. "src/devices/bus/svi3x8/slot/sv807.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/slot/sv807.h", + } +end diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index cef8524680f..5687a044a41 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -652,6 +652,8 @@ BUSES["SMS_EXP"] = true BUSES["SNES"] = true BUSES["SNES_CTRL"] = true BUSES["SPC1000"] = true +BUSES["SVI_EXPANDER"] = true +BUSES["SVI_SLOT"] = true BUSES["TI99PEB"] = true BUSES["TI99X"] = true BUSES["TIKI100"] = true diff --git a/src/devices/bus/svi3x8/expander/expander.cpp b/src/devices/bus/svi3x8/expander/expander.cpp new file mode 100644 index 00000000000..faddf3f24ac --- /dev/null +++ b/src/devices/bus/svi3x8/expander/expander.cpp @@ -0,0 +1,151 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SVI 318/328 Expansion Slot + + 50-pin slot + +***************************************************************************/ + +#include "expander.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type SVI_EXPANDER = &device_creator; + + +//************************************************************************** +// SLOT DEVICE +//************************************************************************** + +//------------------------------------------------- +// svi_expander_device - constructor +//------------------------------------------------- + +svi_expander_device::svi_expander_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, SVI_EXPANDER, "SVI 318/328 Expander Bus", tag, owner, clock, "svi_expander", __FILE__), + device_slot_interface(mconfig, *this), + m_module(nullptr), + m_int_handler(*this), + m_romdis_handler(*this), + m_ramdis_handler(*this), + m_ctrl1_handler(*this), + m_ctrl2_handler(*this) +{ +} + +//------------------------------------------------- +// svi_expander_device - destructor +//------------------------------------------------- + +svi_expander_device::~svi_expander_device() +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void svi_expander_device::device_start() +{ + // get inserted module + m_module = dynamic_cast(get_card_device()); + + // resolve callbacks + m_int_handler.resolve_safe(); + m_romdis_handler.resolve_safe(); + m_ramdis_handler.resolve_safe(); + m_ctrl1_handler.resolve_safe(); + m_ctrl2_handler.resolve_safe(); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void svi_expander_device::device_reset() +{ +} + +//------------------------------------------------- +// host to module interface +//------------------------------------------------- + +READ8_MEMBER( svi_expander_device::mreq_r ) +{ + if (m_module) + return m_module->mreq_r(space, offset); + + return 0xff; +} + +WRITE8_MEMBER( svi_expander_device::mreq_w ) +{ + if (m_module) + m_module->mreq_w(space, offset, data); +} + +READ8_MEMBER( svi_expander_device::iorq_r ) +{ + if (m_module) + return m_module->iorq_r(space, offset); + + return 0xff; +} + +WRITE8_MEMBER( svi_expander_device::iorq_w ) +{ + if (m_module) + m_module->iorq_w(space, offset, data); +} + +WRITE_LINE_MEMBER( svi_expander_device::bk21_w ) +{ + if (m_module) + m_module->bk21_w(state); +} + +WRITE_LINE_MEMBER( svi_expander_device::bk22_w ) +{ + if (m_module) + m_module->bk22_w(state); +} + +WRITE_LINE_MEMBER( svi_expander_device::bk31_w ) +{ + if (m_module) + m_module->bk31_w(state); +} + +WRITE_LINE_MEMBER( svi_expander_device::bk32_w ) +{ + if (m_module) + m_module->bk32_w(state); +} + + +//************************************************************************** +// CARTRIDGE INTERFACE +//************************************************************************** + +//------------------------------------------------- +// device_svi_expander_interface - constructor +//------------------------------------------------- + +device_svi_expander_interface::device_svi_expander_interface(const machine_config &mconfig, device_t &device) : + device_slot_card_interface(mconfig, device) +{ + m_expander = dynamic_cast(device.owner()); +} + +//------------------------------------------------- +// ~device_expansion_interface - destructor +//------------------------------------------------- + +device_svi_expander_interface::~device_svi_expander_interface() +{ +} diff --git a/src/devices/bus/svi3x8/expander/expander.h b/src/devices/bus/svi3x8/expander/expander.h new file mode 100644 index 00000000000..a2bed1f609b --- /dev/null +++ b/src/devices/bus/svi3x8/expander/expander.h @@ -0,0 +1,162 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SVI 318/328 Expander Slot + + 50-pin slot + + 1 +5V 2 /CNTRL2 + 3 +12V 4 -12V + 5 /CNTRL1 6 /WAIT + 7 /RST 8 CPUCLK + 9 A15 10 A14 + 11 A13 12 A12 + 13 A11 14 A10 + 15 A9 16 A8 + 17 A7 18 A6 + 19 A5 20 A4 + 21 A3 22 A2 + 23 A1 24 A0 + 25 /RFSH 26 /EXCSR + 27 /M1 28 /EXCSW + 29 /WR 30 /MREQ + 31 /IORQ 32 /RD + 33 D0 34 D1 + 35 D2 36 D3 + 37 D4 38 D5 + 39 D6 40 D7 + 41 CSOUND 42 /INT + 43 /RAMDIS 44 /ROMDIS + 45 /BK32 46 /BK31 + 47 /BK22 48 /BK21 + 49 GND 50 GND + +***************************************************************************/ + +#pragma once + +#ifndef __SVI3X8_EXPANDER_H__ +#define __SVI3X8_EXPANDER_H__ + +#include "emu.h" + + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_SVI_EXPANDER_BUS_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, SVI_EXPANDER, 0) \ + MCFG_DEVICE_SLOT_INTERFACE(svi_expander_modules, NULL, false) \ + +#define MCFG_SVI_EXPANDER_INT_HANDLER(_devcb) \ + devcb = &svi_expander_device::set_int_handler(*device, DEVCB_##_devcb); + +#define MCFG_SVI_EXPANDER_ROMDIS_HANDLER(_devcb) \ + devcb = &svi_expander_device::set_romdis_handler(*device, DEVCB_##_devcb); + +#define MCFG_SVI_EXPANDER_RAMDIS_HANDLER(_devcb) \ + devcb = &svi_expander_device::set_ramdis_handler(*device, DEVCB_##_devcb); + +#define MCFG_SVI_EXPANDER_CTRL1_HANDLER(_devcb) \ + devcb = &svi_expander_device::set_ctrl1_handler(*device, DEVCB_##_devcb); + +#define MCFG_SVI_EXPANDER_CTRL2_HANDLER(_devcb) \ + devcb = &svi_expander_device::set_ctrl2_handler(*device, DEVCB_##_devcb); + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +class device_svi_expander_interface; + +// ======================> svi_expander_device + +class svi_expander_device : public device_t, public device_slot_interface +{ +public: + // construction/destruction + svi_expander_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + virtual ~svi_expander_device(); + + // callbacks + template static devcb_base &set_int_handler(device_t &device, _Object object) + { return downcast(device).m_int_handler.set_callback(object); } + + template static devcb_base &set_romdis_handler(device_t &device, _Object object) + { return downcast(device).m_romdis_handler.set_callback(object); } + + template static devcb_base &set_ramdis_handler(device_t &device, _Object object) + { return downcast(device).m_ramdis_handler.set_callback(object); } + + template static devcb_base &set_ctrl1_handler(device_t &device, _Object object) + { return downcast(device).m_ctrl1_handler.set_callback(object); } + + template static devcb_base &set_ctrl2_handler(device_t &device, _Object object) + { return downcast(device).m_ctrl2_handler.set_callback(object); } + + // called from cart device + DECLARE_WRITE_LINE_MEMBER( int_w ) { m_int_handler(state); } + DECLARE_WRITE_LINE_MEMBER( romdis_w ) { m_romdis_handler(state); } + DECLARE_WRITE_LINE_MEMBER( ramdis_w ) { m_ramdis_handler(state); } + DECLARE_WRITE_LINE_MEMBER( ctrl1_w ) { m_ctrl1_handler(state); } + DECLARE_WRITE_LINE_MEMBER( ctrl2_w ) { m_ctrl2_handler(state); } + + // called from host + DECLARE_READ8_MEMBER( mreq_r ); + DECLARE_WRITE8_MEMBER( mreq_w ); + DECLARE_READ8_MEMBER( iorq_r ); + DECLARE_WRITE8_MEMBER( iorq_w ); + + DECLARE_WRITE_LINE_MEMBER( bk21_w ); + DECLARE_WRITE_LINE_MEMBER( bk22_w ); + DECLARE_WRITE_LINE_MEMBER( bk31_w ); + DECLARE_WRITE_LINE_MEMBER( bk32_w ); + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + +private: + device_svi_expander_interface *m_module; + + devcb_write_line m_int_handler; + devcb_write_line m_romdis_handler; + devcb_write_line m_ramdis_handler; + devcb_write_line m_ctrl1_handler; + devcb_write_line m_ctrl2_handler; +}; + +// ======================> device_svi_expander_interface + +class device_svi_expander_interface : public device_slot_card_interface +{ +public: + // construction/destruction + device_svi_expander_interface(const machine_config &mconfig, device_t &device); + virtual ~device_svi_expander_interface(); + + virtual DECLARE_READ8_MEMBER( mreq_r ) { return 0xff; }; + virtual DECLARE_WRITE8_MEMBER( mreq_w ){}; + virtual DECLARE_READ8_MEMBER( iorq_r ) { return 0xff; }; + virtual DECLARE_WRITE8_MEMBER( iorq_w ){}; + + virtual void bk21_w(int state) {}; + virtual void bk22_w(int state) {}; + virtual void bk31_w(int state) {}; + virtual void bk32_w(int state) {}; + +protected: + svi_expander_device *m_expander; +}; + +// device type definition +extern const device_type SVI_EXPANDER; + +// include here so drivers don't need to +#include "modules.h" + +#endif // __SVI3X8_EXPANDER_H__ diff --git a/src/devices/bus/svi3x8/expander/modules.cpp b/src/devices/bus/svi3x8/expander/modules.cpp new file mode 100644 index 00000000000..f613dcf4094 --- /dev/null +++ b/src/devices/bus/svi3x8/expander/modules.cpp @@ -0,0 +1,13 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SVI 318/328 Expander Bus Modules + +***************************************************************************/ + +#include "modules.h" + +SLOT_INTERFACE_START( svi_expander_modules ) + SLOT_INTERFACE("sv601", SV601) +SLOT_INTERFACE_END diff --git a/src/devices/bus/svi3x8/expander/modules.h b/src/devices/bus/svi3x8/expander/modules.h new file mode 100644 index 00000000000..953b7094935 --- /dev/null +++ b/src/devices/bus/svi3x8/expander/modules.h @@ -0,0 +1,19 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SVI 318/328 Expander Bus Modules + +***************************************************************************/ + +#pragma once + +#ifndef __SVI_EXPANDER_MODULES_H__ +#define __SVI_EXPANDER_MODULES_H__ + +#include "emu.h" +#include "sv601.h" + +SLOT_INTERFACE_EXTERN( svi_expander_modules ); + +#endif // __SVI_EXPANDER_MODULES_H__ diff --git a/src/devices/bus/svi3x8/expander/sv601.cpp b/src/devices/bus/svi3x8/expander/sv601.cpp new file mode 100644 index 00000000000..fadb45f9a26 --- /dev/null +++ b/src/devices/bus/svi3x8/expander/sv601.cpp @@ -0,0 +1,98 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SV-601 Super Expander for SVI-318/328 + +***************************************************************************/ + +#include "sv601.h" + + +//************************************************************************** +// CONSTANTS/MACROS +//************************************************************************** + +#define VERBOSE 0 + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type SV601 = &device_creator; + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( sv601 ) + MCFG_SVI_SLOT_BUS_ADD + MCFG_SVI_SLOT_INT_HANDLER(WRITELINE(sv601_device, int_w)) + MCFG_SVI_SLOT_ROMDIS_HANDLER(WRITELINE(sv601_device, romdis_w)) + MCFG_SVI_SLOT_RAMDIS_HANDLER(WRITELINE(sv601_device, ramdis_w)) + MCFG_SVI_SLOT_ADD("0", NULL) + MCFG_SVI_SLOT_ADD("1", NULL) + MCFG_SVI_SLOT_ADD("2", NULL) + MCFG_SVI_SLOT_ADD("3", NULL) + MCFG_SVI_SLOT_ADD("4", NULL) + MCFG_SVI_SLOT_ADD("5", NULL) + MCFG_SVI_SLOT_ADD("6", NULL) +MACHINE_CONFIG_END + +machine_config_constructor sv601_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( sv601 ); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// sv601_device - constructor +//------------------------------------------------- + +sv601_device::sv601_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, SV601, "SV-601 Super Expander", tag, owner, clock, "sv601", __FILE__), + device_svi_expander_interface(mconfig, *this), + m_slotbus(*this, "slotbus") +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void sv601_device::device_start() +{ +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void sv601_device::device_reset() +{ +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +WRITE_LINE_MEMBER( sv601_device::int_w ) { m_expander->int_w(state); } +WRITE_LINE_MEMBER( sv601_device::romdis_w ) { m_expander->romdis_w(state); } +WRITE_LINE_MEMBER( sv601_device::ramdis_w ) { m_expander->ramdis_w(state); } + +READ8_MEMBER( sv601_device::mreq_r ) { return m_slotbus->mreq_r(space, offset); } +WRITE8_MEMBER( sv601_device::mreq_w ) { m_slotbus->mreq_w(space, offset, data); } +READ8_MEMBER( sv601_device::iorq_r ) { return m_slotbus->iorq_r(space, offset); } +WRITE8_MEMBER( sv601_device::iorq_w ) { m_slotbus->iorq_w(space, offset, data); } + +void sv601_device::bk21_w(int state) { m_slotbus->bk21_w(state); } +void sv601_device::bk22_w(int state) { m_slotbus->bk22_w(state); } +void sv601_device::bk31_w(int state) { m_slotbus->bk31_w(state); } +void sv601_device::bk32_w(int state) { m_slotbus->bk32_w(state); } diff --git a/src/devices/bus/svi3x8/expander/sv601.h b/src/devices/bus/svi3x8/expander/sv601.h new file mode 100644 index 00000000000..bf1133cfedb --- /dev/null +++ b/src/devices/bus/svi3x8/expander/sv601.h @@ -0,0 +1,59 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SV-601 Super Expander for SVI-318/328 + +***************************************************************************/ + +#pragma once + +#ifndef __SVI3X8_EXPANDER_SV601_H__ +#define __SVI3X8_EXPANDER_SV601_H__ + +#include "emu.h" +#include "expander.h" +#include "bus/svi3x8/slot/slot.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> sv601_device + +class sv601_device : public device_t, public device_svi_expander_interface +{ +public: + // construction/destruction + sv601_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // from slots + WRITE_LINE_MEMBER( int_w ); + WRITE_LINE_MEMBER( romdis_w ); + WRITE_LINE_MEMBER( ramdis_w ); + + // from host + virtual DECLARE_READ8_MEMBER( mreq_r ) override; + virtual DECLARE_WRITE8_MEMBER( mreq_w ) override; + virtual DECLARE_READ8_MEMBER( iorq_r ) override; + virtual DECLARE_WRITE8_MEMBER( iorq_w ) override; + + virtual void bk21_w(int state) override; + virtual void bk22_w(int state) override; + virtual void bk31_w(int state) override; + virtual void bk32_w(int state) override; + +protected: + virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_start() override; + virtual void device_reset() override; + +private: + required_device m_slotbus; +}; + +// device type definition +extern const device_type SV601; + +#endif // __SVI3X8_EXPANDER_SV601_H__ diff --git a/src/devices/bus/svi3x8/slot/cards.cpp b/src/devices/bus/svi3x8/slot/cards.cpp new file mode 100644 index 00000000000..e86317dedb4 --- /dev/null +++ b/src/devices/bus/svi3x8/slot/cards.cpp @@ -0,0 +1,15 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SVI 318/328 Slot Cards + +***************************************************************************/ + +#include "cards.h" + +SLOT_INTERFACE_START( svi_slot_cards ) + SLOT_INTERFACE("sv801", SV801) + SLOT_INTERFACE("sv803", SV803) + SLOT_INTERFACE("sv807", SV807) +SLOT_INTERFACE_END diff --git a/src/devices/bus/svi3x8/slot/cards.h b/src/devices/bus/svi3x8/slot/cards.h new file mode 100644 index 00000000000..22d601a22fa --- /dev/null +++ b/src/devices/bus/svi3x8/slot/cards.h @@ -0,0 +1,21 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SVI 318/328 Slot Cards + +***************************************************************************/ + +#pragma once + +#ifndef __SVI3X8_SLOT_CARDS_H__ +#define __SVI3X8_SLOT_CARDS_H__ + +#include "emu.h" +#include "sv801.h" +#include "sv803.h" +#include "sv807.h" + +SLOT_INTERFACE_EXTERN( svi_slot_cards ); + +#endif // __SVI3X8_SLOT_CARDS_H__ diff --git a/src/devices/bus/svi3x8/slot/slot.cpp b/src/devices/bus/svi3x8/slot/slot.cpp new file mode 100644 index 00000000000..5ab951e18f1 --- /dev/null +++ b/src/devices/bus/svi3x8/slot/slot.cpp @@ -0,0 +1,284 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SVI 318/328 Expansion Slot + +***************************************************************************/ + +#include "slot.h" + + +//************************************************************************** +// SLOT BUS DEVICE +//************************************************************************** + +const device_type SVI_SLOT_BUS = &device_creator; + +//------------------------------------------------- +// svi_slot_bus_device - constructor +//------------------------------------------------- + +svi_slot_bus_device::svi_slot_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, SVI_SLOT_BUS, "SVI Slot Bus", tag, owner, clock, "svislotbus", __FILE__), + m_int_handler(*this), + m_romdis_handler(*this), + m_ramdis_handler(*this) +{ +} + +//------------------------------------------------- +// svi_slot_bus_device - destructor +//------------------------------------------------- + +svi_slot_bus_device::~svi_slot_bus_device() +{ + m_dev.detach_all(); +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void svi_slot_bus_device::device_start() +{ + // resolve callbacks + m_int_handler.resolve_safe(); + m_romdis_handler.resolve_safe(); + m_ramdis_handler.resolve_safe(); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void svi_slot_bus_device::device_reset() +{ +} + +//------------------------------------------------- +// add_card - add new card to our bus +//------------------------------------------------- + +void svi_slot_bus_device::add_card(device_svi_slot_interface *card) +{ + card->set_bus_device(this); + m_dev.append(*card); +} + +//------------------------------------------------- +// mreq_r - memory read from slot +//------------------------------------------------- + +READ8_MEMBER( svi_slot_bus_device::mreq_r ) +{ + device_svi_slot_interface *entry = m_dev.first(); + UINT8 data = 0xff; + + romdis_w(1); + ramdis_w(1); + + while (entry) + { + data &= entry->mreq_r(space, offset); + entry = entry->next(); + } + + return data; +} + +//------------------------------------------------- +// mreq_w - memory write to slot +//------------------------------------------------- + +WRITE8_MEMBER( svi_slot_bus_device::mreq_w ) +{ + device_svi_slot_interface *entry = m_dev.first(); + + romdis_w(1); + ramdis_w(1); + + while (entry) + { + entry->mreq_w(space, offset, data); + entry = entry->next(); + } +} + +//------------------------------------------------- +// iorq_r - memory read from slot +//------------------------------------------------- + +READ8_MEMBER( svi_slot_bus_device::iorq_r ) +{ + device_svi_slot_interface *entry = m_dev.first(); + UINT8 data = 0xff; + + while (entry) + { + data &= entry->iorq_r(space, offset); + entry = entry->next(); + } + + return data; +} + +//------------------------------------------------- +// iorq_w - memory write to slot +//------------------------------------------------- + +WRITE8_MEMBER( svi_slot_bus_device::iorq_w ) +{ + device_svi_slot_interface *entry = m_dev.first(); + + while (entry) + { + entry->iorq_w(space, offset, data); + entry = entry->next(); + } +} + +//------------------------------------------------- +// bk21_w - signal from host to slots +//------------------------------------------------- + +WRITE_LINE_MEMBER( svi_slot_bus_device::bk21_w ) +{ + device_svi_slot_interface *entry = m_dev.first(); + + while (entry) + { + entry->bk21_w(state); + entry = entry->next(); + } +} + +//------------------------------------------------- +// bk22_w - signal from host to slots +//------------------------------------------------- + +WRITE_LINE_MEMBER( svi_slot_bus_device::bk22_w ) +{ + device_svi_slot_interface *entry = m_dev.first(); + + while (entry) + { + entry->bk22_w(state); + entry = entry->next(); + } +} + +//------------------------------------------------- +// bk31_w - signal from host to slots +//------------------------------------------------- + +WRITE_LINE_MEMBER( svi_slot_bus_device::bk31_w ) +{ + device_svi_slot_interface *entry = m_dev.first(); + + while (entry) + { + entry->bk31_w(state); + entry = entry->next(); + } +} + +//------------------------------------------------- +// bk32_w - signal from host to slots +//------------------------------------------------- + +WRITE_LINE_MEMBER( svi_slot_bus_device::bk32_w ) +{ + device_svi_slot_interface *entry = m_dev.first(); + + while (entry) + { + entry->bk32_w(state); + entry = entry->next(); + } +} + + +//************************************************************************** +// SVI SLOT DEVICE +//************************************************************************** + +const device_type SVI_SLOT = &device_creator; + +//------------------------------------------------- +// svi_slot_device - constructor +//------------------------------------------------- + +svi_slot_device::svi_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, SVI_SLOT, "SVI Slot", tag, owner, clock, "svislot", __FILE__), + device_slot_interface(mconfig, *this), + m_bus_tag(nullptr) +{ +} + +//------------------------------------------------- +// set_bus - set owner bus tag +//------------------------------------------------- + +void svi_slot_device::set_bus(device_t &device, device_t *owner, const char *bus_tag) +{ + svi_slot_device &card = dynamic_cast(device); + card.m_owner = owner; + card.m_bus_tag = bus_tag; +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void svi_slot_device::device_start() +{ + device_svi_slot_interface *dev = dynamic_cast(get_card_device()); + + if (dev) + { + svi_slot_bus_device *bus = downcast(m_owner->subdevice(m_bus_tag)); + bus->add_card(dev); + } +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void svi_slot_device::device_reset() +{ +} + + +//************************************************************************** +// CARD INTERFACE +//************************************************************************** + +//------------------------------------------------- +// device_svi_slot_interface - constructor +//------------------------------------------------- + +device_svi_slot_interface::device_svi_slot_interface(const machine_config &mconfig, device_t &device) : + device_slot_card_interface(mconfig, device), + m_next(nullptr), + m_bus(nullptr) +{ +} + +//------------------------------------------------- +// ~device_svi_slot_interface - destructor +//------------------------------------------------- + +device_svi_slot_interface::~device_svi_slot_interface() +{ +} + +//------------------------------------------------- +// set_bus_device - set bus we are attached to +//------------------------------------------------- + +void device_svi_slot_interface::set_bus_device(svi_slot_bus_device *bus) +{ + m_bus = bus; +} diff --git a/src/devices/bus/svi3x8/slot/slot.h b/src/devices/bus/svi3x8/slot/slot.h new file mode 100644 index 00000000000..6cea923f6f6 --- /dev/null +++ b/src/devices/bus/svi3x8/slot/slot.h @@ -0,0 +1,178 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SVI 318/328 Expansion Slot + + 50-pin slot + + 1 +5V 2 +5V + 3 +12V 4 -12V + 5 GND 6 /WAIT + 7 /RST 8 CPUCLK + 9 A15 10 A14 + 11 A13 12 A12 + 13 A11 14 A10 + 15 A9 16 A8 + 17 A7 18 A6 + 19 A5 20 A4 + 21 A3 22 A2 + 23 A1 24 A0 + 25 /RFSH 26 GND + 27 /M1 28 GND + 29 /WR 30 /MREQ + 31 /IORQ 32 /RD + 33 D0 34 D1 + 35 D2 36 D3 + 37 D4 38 D5 + 39 D6 40 D7 + 41 CSOUND 42 /INT + 43 /RAMDIS 44 /ROMDIS + 45 /BK32 46 /BK31 + 47 /BK22 48 /BK21 + 49 GND 50 GND + +***************************************************************************/ + +#pragma once + +#ifndef __SVI3X8_SLOT_H__ +#define __SVI3X8_SLOT_H__ + +#include "emu.h" + + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_SVI_SLOT_BUS_ADD \ + MCFG_DEVICE_ADD("slotbus", SVI_SLOT_BUS, 0) + +#define MCFG_SVI_SLOT_ADD(_tag, _def_slot) \ + MCFG_DEVICE_ADD(_tag, SVI_SLOT, 0) \ + MCFG_DEVICE_SLOT_INTERFACE(svi_slot_cards, _def_slot, false) \ + svi_slot_device::set_bus(*device, owner, "slotbus"); + +#define MCFG_SVI_SLOT_INT_HANDLER(_devcb) \ + devcb = &svi_slot_bus_device::set_int_handler(*device, DEVCB_##_devcb); + +#define MCFG_SVI_SLOT_ROMDIS_HANDLER(_devcb) \ + devcb = &svi_slot_bus_device::set_romdis_handler(*device, DEVCB_##_devcb); + +#define MCFG_SVI_SLOT_RAMDIS_HANDLER(_devcb) \ + devcb = &svi_slot_bus_device::set_ramdis_handler(*device, DEVCB_##_devcb); + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +class device_svi_slot_interface; + +// ======================> svi_slot_bus_device + +class svi_slot_bus_device : public device_t +{ +public: + // construction/destruction + svi_slot_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + virtual ~svi_slot_bus_device(); + + // callbacks + template static devcb_base &set_int_handler(device_t &device, _Object object) + { return downcast(device).m_int_handler.set_callback(object); } + + template static devcb_base &set_romdis_handler(device_t &device, _Object object) + { return downcast(device).m_romdis_handler.set_callback(object); } + + template static devcb_base &set_ramdis_handler(device_t &device, _Object object) + { return downcast(device).m_ramdis_handler.set_callback(object); } + + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + void add_card(device_svi_slot_interface *card); + + // from slot + DECLARE_WRITE_LINE_MEMBER( romdis_w ) { m_romdis_handler(state); }; + DECLARE_WRITE_LINE_MEMBER( ramdis_w ) { m_ramdis_handler(state); }; + + // from host + DECLARE_READ8_MEMBER( mreq_r ); + DECLARE_WRITE8_MEMBER( mreq_w ); + DECLARE_READ8_MEMBER( iorq_r ); + DECLARE_WRITE8_MEMBER( iorq_w ); + + DECLARE_WRITE_LINE_MEMBER( bk21_w ); + DECLARE_WRITE_LINE_MEMBER( bk22_w ); + DECLARE_WRITE_LINE_MEMBER( bk31_w ); + DECLARE_WRITE_LINE_MEMBER( bk32_w ); + +private: + simple_list m_dev; + + devcb_write_line m_int_handler; + devcb_write_line m_romdis_handler; + devcb_write_line m_ramdis_handler; +}; + +// device type definition +extern const device_type SVI_SLOT_BUS; + +// ======================> svi_slot_device + +class svi_slot_device : public device_t, public device_slot_interface +{ +public: + // construction/destruction + svi_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // inline configuration + static void set_bus(device_t &device, device_t *owner, const char *bus_tag); + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + // configuration + const char *m_bus_tag; +}; + +// device type definition +extern const device_type SVI_SLOT; + +// ======================> svi_slot_device + +class device_svi_slot_interface : public device_slot_card_interface +{ +public: + // construction/destruction + device_svi_slot_interface(const machine_config &mconfig, device_t &device); + virtual ~device_svi_slot_interface(); + + void set_bus_device(svi_slot_bus_device *bus); + + device_svi_slot_interface *next() const { return m_next; } + device_svi_slot_interface *m_next; + + virtual DECLARE_READ8_MEMBER( mreq_r ) { return 0xff; }; + virtual DECLARE_WRITE8_MEMBER( mreq_w ) {}; + virtual DECLARE_READ8_MEMBER( iorq_r ) { return 0xff; }; + virtual DECLARE_WRITE8_MEMBER( iorq_w ) {}; + + virtual DECLARE_WRITE_LINE_MEMBER( bk21_w ) {}; + virtual DECLARE_WRITE_LINE_MEMBER( bk22_w ) {}; + virtual DECLARE_WRITE_LINE_MEMBER( bk31_w ) {}; + virtual DECLARE_WRITE_LINE_MEMBER( bk32_w ) {}; + +protected: + svi_slot_bus_device *m_bus; +}; + +// include here so drivers don't need to +#include "cards.h" + +#endif // __SVI3X8_SLOT_H__ diff --git a/src/devices/bus/svi3x8/slot/sv801.cpp b/src/devices/bus/svi3x8/slot/sv801.cpp new file mode 100644 index 00000000000..544c68e2988 --- /dev/null +++ b/src/devices/bus/svi3x8/slot/sv801.cpp @@ -0,0 +1,144 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SV-801 Disk Controller + +***************************************************************************/ + +#include "sv801.h" +#include "softlist.h" +#include "formats/svi_dsk.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type SV801 = &device_creator; + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +FLOPPY_FORMATS_MEMBER( sv801_device::floppy_formats ) + FLOPPY_SVI_FORMAT +FLOPPY_FORMATS_END + +static SLOT_INTERFACE_START( svi_floppies ) + SLOT_INTERFACE("dd", FLOPPY_525_DD) +SLOT_INTERFACE_END + +static MACHINE_CONFIG_FRAGMENT( sv801 ) + MCFG_FD1793_ADD("fdc", XTAL_1MHz) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(sv801_device, intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(sv801_device, drq_w)) + + MCFG_FLOPPY_DRIVE_ADD("fdc:0", svi_floppies, "dd", sv801_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", svi_floppies, "dd", sv801_device::floppy_formats) + + MCFG_SOFTWARE_LIST_ADD("disk_list", "svi318_flop") +MACHINE_CONFIG_END + +machine_config_constructor sv801_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( sv801 ); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// sv801_device - constructor +//------------------------------------------------- + +sv801_device::sv801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, SV801, "SV-801 Disk Controller", tag, owner, clock, "sv801", __FILE__), + device_svi_slot_interface(mconfig, *this), + m_fdc(*this, "fdc"), + m_floppy0(*this, "fdc:0"), + m_floppy1(*this, "fdc:1"), + m_floppy(nullptr), + m_irq(0), m_drq(0) +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void sv801_device::device_start() +{ +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void sv801_device::device_reset() +{ +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +WRITE_LINE_MEMBER( sv801_device::intrq_w ) +{ + m_irq = state; +} + +WRITE_LINE_MEMBER( sv801_device::drq_w ) +{ + m_drq = state; +} + +WRITE8_MEMBER( sv801_device::motor_w ) +{ + m_floppy = nullptr; + + if (BIT(data, 0)) m_floppy = m_floppy0->get_device(); + if (BIT(data, 1)) m_floppy = m_floppy1->get_device(); + + m_fdc->set_floppy(m_floppy); + + if (m_floppy0->get_device()) + m_floppy0->get_device()->mon_w(!BIT(data, 2)); + if (m_floppy1->get_device()) + m_floppy1->get_device()->mon_w(!BIT(data, 3)); +} + +READ8_MEMBER( sv801_device::iorq_r ) +{ + switch (offset) + { + case 0x30: return m_fdc->status_r(space, 0); + case 0x31: return m_fdc->track_r(space, 0); + case 0x32: return m_fdc->sector_r(space, 0); + case 0x33: return m_fdc->data_r(space, 0); + case 0x34: return (m_drq << 6) | (m_irq << 7); + } + + return 0xff; +} + +WRITE8_MEMBER( sv801_device::iorq_w ) +{ + switch (offset) + { + case 0x30: m_fdc->cmd_w(space, 0, data); break; + case 0x31: m_fdc->track_w(space, 0, data); break; + case 0x32: m_fdc->sector_w(space, 0, data); break; + case 0x33: m_fdc->data_w(space, 0, data); break; + case 0x34: motor_w(space, 0, data); break; + case 0x38: + m_fdc->dden_w(BIT(data, 0)); + if (m_floppy) + m_floppy->ss_w(BIT(data, 1)); + break; + } +} diff --git a/src/devices/bus/svi3x8/slot/sv801.h b/src/devices/bus/svi3x8/slot/sv801.h new file mode 100644 index 00000000000..2f670f05ad1 --- /dev/null +++ b/src/devices/bus/svi3x8/slot/sv801.h @@ -0,0 +1,61 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SV-801 Disk Controller + +***************************************************************************/ + +#pragma once + +#ifndef __SVI3X8_SLOT_SV801_H__ +#define __SVI3X8_SLOT_SV801_H__ + +#include "emu.h" +#include "slot.h" +#include "machine/wd_fdc.h" +#include "imagedev/floppy.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> sv801_device + +class sv801_device : public device_t, public device_svi_slot_interface +{ +public: + // construction/destruction + sv801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + DECLARE_FLOPPY_FORMATS(floppy_formats); + + virtual DECLARE_READ8_MEMBER( iorq_r ) override; + virtual DECLARE_WRITE8_MEMBER( iorq_w ) override; + + DECLARE_WRITE_LINE_MEMBER( intrq_w ); + DECLARE_WRITE_LINE_MEMBER( drq_w ); + +protected: + virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_start() override; + virtual void device_reset() override; + +private: + DECLARE_WRITE8_MEMBER( motor_w ); + + required_device m_fdc; + required_device m_floppy0; + required_device m_floppy1; + + floppy_image_device *m_floppy; + + int m_irq; + int m_drq; +}; + +// device type definition +extern const device_type SV801; + +#endif // __SVI3X8_SLOT_SV801_H__ diff --git a/src/devices/bus/svi3x8/slot/sv803.cpp b/src/devices/bus/svi3x8/slot/sv803.cpp new file mode 100644 index 00000000000..7035efeaa7a --- /dev/null +++ b/src/devices/bus/svi3x8/slot/sv803.cpp @@ -0,0 +1,68 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SV-803 16k memory expansion for SVI-318 + +***************************************************************************/ + +#include "sv803.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type SV803 = &device_creator; + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// sv803_device - constructor +//------------------------------------------------- + +sv803_device::sv803_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, SV803, "SV-803 16k RAM Cartridge", tag, owner, clock, "sv803", __FILE__), + device_svi_slot_interface(mconfig, *this) +{ + m_ram = std::make_unique(0x4000); + memset(m_ram.get(), 0xff, 0x4000); +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void sv803_device::device_start() +{ +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void sv803_device::device_reset() +{ +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +READ8_MEMBER( sv803_device::mreq_r ) +{ + if (offset >= 0x8000 && offset <= 0xbfff) + return m_ram[offset - 0x8000]; + + return 0xff; +} + +WRITE8_MEMBER( sv803_device::mreq_w ) +{ + if (offset >= 0x8000 && offset <= 0xbfff) + m_ram[offset - 0x8000] = data; +} diff --git a/src/devices/bus/svi3x8/slot/sv803.h b/src/devices/bus/svi3x8/slot/sv803.h new file mode 100644 index 00000000000..9dea0ea9180 --- /dev/null +++ b/src/devices/bus/svi3x8/slot/sv803.h @@ -0,0 +1,44 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SV-803 16k memory expansion for SVI-318 + +***************************************************************************/ + +#pragma once + +#ifndef __SVI3X8_SLOT_SV803_H__ +#define __SVI3X8_SLOT_SV803_H__ + +#include "emu.h" +#include "slot.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> sv803_device + +class sv803_device : public device_t, public device_svi_slot_interface +{ +public: + // construction/destruction + sv803_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + virtual DECLARE_READ8_MEMBER( mreq_r ) override; + virtual DECLARE_WRITE8_MEMBER( mreq_w ) override; + +protected: + virtual void device_start() override; + virtual void device_reset() override; + +private: + std::unique_ptr m_ram; +}; + +// device type definition +extern const device_type SV803; + +#endif // __SVI3X8_SLOT_SV803_H__ diff --git a/src/devices/bus/svi3x8/slot/sv807.cpp b/src/devices/bus/svi3x8/slot/sv807.cpp new file mode 100644 index 00000000000..14cf5001674 --- /dev/null +++ b/src/devices/bus/svi3x8/slot/sv807.cpp @@ -0,0 +1,163 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SV-807 64k memory expansion for SVI-318/328 + + TODO: + - Switch S6 (but needs to be off for the SVI anyway) + +***************************************************************************/ + +#include "sv807.h" + + +//************************************************************************** +// CONSTANTS / MACROS +//************************************************************************** + +#define BK21_ACTIVE ((m_bk21 == 0) && (m_switch->read() & 0x01)) +#define BK22_ACTIVE ((m_bk22 == 0) && (m_switch->read() & 0x02)) +#define BK31_ACTIVE ((m_bk31 == 0) && (m_switch->read() & 0x04)) +#define BK32_ACTIVE ((m_bk32 == 0) && (m_switch->read() & 0x08)) +#define BK02_ACTIVE (m_switch->read() & 0x10) + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type SV807 = &device_creator; + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +static INPUT_PORTS_START( sv807_switches ) + PORT_START("S") + PORT_DIPNAME(0x01, 0x00, "Bank/Page 21") + PORT_DIPLOCATION("S:1") + PORT_DIPSETTING(0x00, "Off") + PORT_DIPSETTING(0x01, "On") + PORT_DIPNAME(0x02, 0x02, "Bank/Page 22") + PORT_DIPLOCATION("S:2") + PORT_DIPSETTING(0x00, "Off") + PORT_DIPSETTING(0x02, "On") + PORT_DIPNAME(0x04, 0x04, "Bank/Page 31") + PORT_DIPLOCATION("S:3") + PORT_DIPSETTING(0x00, "Off") + PORT_DIPSETTING(0x04, "On") + PORT_DIPNAME(0x08, 0x00, "Bank/Page 32") + PORT_DIPLOCATION("S:4") + PORT_DIPSETTING(0x00, "Off") + PORT_DIPSETTING(0x08, "On") + PORT_DIPNAME(0x10, 0x00, "Bank/Page 02") + PORT_DIPLOCATION("S:5") + PORT_DIPSETTING(0x00, "Off") + PORT_DIPSETTING(0x10, "On") + PORT_DIPNAME(0x20, 0x00, "48k/32k") + PORT_DIPLOCATION("S:6") + PORT_DIPSETTING(0x00, "Off") + PORT_DIPSETTING(0x20, "On") +INPUT_PORTS_END + +ioport_constructor sv807_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( sv807_switches ); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// sv807_device - constructor +//------------------------------------------------- + +sv807_device::sv807_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, SV803, "SV-807 64k RAM Cartridge", tag, owner, clock, "sv807", __FILE__), + device_svi_slot_interface(mconfig, *this), + m_switch(*this, "S"), + m_bk21(1), m_bk22(1), m_bk31(1), m_bk32(1) +{ + m_ram_bank1 = std::make_unique(0x8000); + m_ram_bank2 = std::make_unique(0x8000); + memset(m_ram_bank1.get(), 0xff, 0x8000); + memset(m_ram_bank2.get(), 0xff, 0x8000); +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void sv807_device::device_start() +{ +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void sv807_device::device_reset() +{ +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +// test setup: S2 = enabled (22), S3 = enabled (31) + +READ8_MEMBER( sv807_device::mreq_r ) +{ + if ((BK21_ACTIVE || BK31_ACTIVE) && offset < 0x8000) + { + m_bus->romdis_w(0); + return m_ram_bank1[offset]; + } + + if ((BK22_ACTIVE || BK32_ACTIVE || BK02_ACTIVE) && offset >= 0x8000) + { + m_bus->ramdis_w(0); + return m_ram_bank2[offset - 0x8000]; + } + + return 0xff; +} + +WRITE8_MEMBER( sv807_device::mreq_w ) +{ + if ((BK21_ACTIVE || BK31_ACTIVE) && offset < 0x8000) + { + m_bus->romdis_w(0); + m_ram_bank1[offset] = data; + } + + if ((BK22_ACTIVE || BK32_ACTIVE || BK02_ACTIVE) && offset >= 0x8000) + { + m_bus->ramdis_w(0); + m_ram_bank2[offset - 0x8000] = data; + } +} + +void sv807_device::bk21_w(int state) +{ + m_bk21 = state; +} + +void sv807_device::bk22_w(int state) +{ + m_bk22 = state; +} + +void sv807_device::bk31_w(int state) +{ + m_bk31 = state; +} + +void sv807_device::bk32_w(int state) +{ + m_bk32 = state; +} diff --git a/src/devices/bus/svi3x8/slot/sv807.h b/src/devices/bus/svi3x8/slot/sv807.h new file mode 100644 index 00000000000..deebb9bf79e --- /dev/null +++ b/src/devices/bus/svi3x8/slot/sv807.h @@ -0,0 +1,60 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SV-807 64k memory expansion for SVI-318/328 + +***************************************************************************/ + +#pragma once + +#ifndef __SVI3X8_SLOT_SV807_H__ +#define __SVI3X8_SLOT_SV807_H__ + +#include "emu.h" +#include "slot.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> sv807_device + +class sv807_device : public device_t, public device_svi_slot_interface +{ +public: + // construction/destruction + sv807_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual ioport_constructor device_input_ports() const override; + + virtual DECLARE_READ8_MEMBER( mreq_r ) override; + virtual DECLARE_WRITE8_MEMBER( mreq_w ) override; + + virtual void bk21_w(int state) override; + virtual void bk22_w(int state) override; + virtual void bk31_w(int state) override; + virtual void bk32_w(int state) override; + +protected: + virtual void device_start() override; + virtual void device_reset() override; + +private: + required_ioport m_switch; + + std::unique_ptr m_ram_bank1; + std::unique_ptr m_ram_bank2; + + int m_bk21; + int m_bk22; + int m_bk31; + int m_bk32; +}; + +// device type definition +extern const device_type SV807; + +#endif // __SVI3X8_SLOT_SV807_H__ diff --git a/src/mame/drivers/svi318.cpp b/src/mame/drivers/svi318.cpp index 2529508e2b3..b2a6a2975f3 100644 --- a/src/mame/drivers/svi318.cpp +++ b/src/mame/drivers/svi318.cpp @@ -22,9 +22,17 @@ #include "formats/svi_cas.h" #include "bus/generic/slot.h" #include "bus/generic/carts.h" +#include "bus/svi3x8/expander/expander.h" #include "softlist.h" +//************************************************************************** +// CONSTANTS & MACROS +//************************************************************************** + +#define IS_SVI328 (m_ram->size() == 64 * 1024) + + //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -39,18 +47,32 @@ public: m_basic(*this, "basic"), m_speaker(*this, "speaker"), m_cassette(*this, "cassette"), - m_cart(*this, "cartslot"), + m_cart_rom(*this, "cartslot"), + m_expander(*this, "exp"), m_keyboard(*this, "KEY"), m_buttons(*this, "BUTTONS"), + m_intvdp(0), m_intexp(0), + m_romdis(1), m_ramdis(1), + m_cart(1), m_bk21(1), m_keyboard_row(0) {} DECLARE_READ8_MEMBER( ppi_port_a_r ); DECLARE_READ8_MEMBER( ppi_port_b_r ); DECLARE_WRITE8_MEMBER( ppi_port_c_w ); - DECLARE_WRITE8_MEMBER( psg_port_b_w ); + DECLARE_WRITE8_MEMBER( bank_w ); DECLARE_WRITE_LINE_MEMBER( intvdp_w ); + READ8_MEMBER( page1_r ); + WRITE8_MEMBER( page1_w ); + READ8_MEMBER( page2_r ); + WRITE8_MEMBER( page2_w ); + + // from expander bus + DECLARE_WRITE_LINE_MEMBER( intexp_w ); + DECLARE_WRITE_LINE_MEMBER( romdis_w ); + DECLARE_WRITE_LINE_MEMBER( ramdis_w ); + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cartridge); protected: @@ -58,17 +80,23 @@ protected: virtual void machine_reset() override; private: - void reset_memory_configuration(); - required_device m_maincpu; required_device m_ram; required_memory_region m_basic; required_device m_speaker; required_device m_cassette; - required_device m_cart; + required_device m_cart_rom; + required_device m_expander; required_ioport_array<16> m_keyboard; required_ioport m_buttons; + int m_intvdp; + int m_intexp; + int m_romdis; + int m_ramdis; + int m_cart; + int m_bk21; + UINT8 m_keyboard_row; }; @@ -79,10 +107,13 @@ private: static ADDRESS_MAP_START( svi3x8_mem, AS_PROGRAM, 8, svi3x8_state ) ADDRESS_MAP_UNMAP_HIGH + AM_RANGE(0x0000, 0x7fff) AM_READWRITE(page1_r, page1_w) + AM_RANGE(0x8000, 0xffff) AM_READWRITE(page2_r, page2_w) ADDRESS_MAP_END static ADDRESS_MAP_START( svi3x8_io, AS_IO, 8, svi3x8_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) + AM_RANGE(0x00, 0x7f) AM_DEVREADWRITE("exp", svi_expander_device, iorq_r, iorq_w) AM_RANGE(0x80, 0x80) AM_MIRROR(0x22) AM_DEVWRITE("vdp", tms9928a_device, vram_write) AM_RANGE(0x81, 0x81) AM_MIRROR(0x22) AM_DEVWRITE("vdp", tms9928a_device, register_write) AM_RANGE(0x84, 0x84) AM_MIRROR(0x22) AM_DEVREAD("vdp", tms9928a_device, vram_read) @@ -261,7 +292,8 @@ WRITE_LINE_MEMBER( svi3x8_state::intvdp_w ) { // note: schematics show a CNTRL line that allows switching between // IRQ and NMI for the interrupt - m_maincpu->set_input_line(INPUT_LINE_IRQ0, state); + m_intvdp = state; + m_maincpu->set_input_line(INPUT_LINE_IRQ0, (m_intvdp || m_intexp) ? ASSERT_LINE : CLEAR_LINE); } @@ -269,69 +301,90 @@ WRITE_LINE_MEMBER( svi3x8_state::intvdp_w ) // MACHINE EMULATION //************************************************************************** -void svi3x8_state::reset_memory_configuration() -{ - m_maincpu->space(AS_PROGRAM).install_rom(0x0000, 0x7fff, m_basic->base()); - - if (m_ram->size() == 64 * 1024) - { - // SVI-328 - m_maincpu->space(AS_PROGRAM).install_ram(0x8000, 0xffff, m_ram->pointer()); - } - else - { - // SVI-318 - m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x8000, 0xbfff); - m_maincpu->space(AS_PROGRAM).install_ram(0xc000, 0xffff, m_ram->pointer()); - } -} - void svi3x8_state::machine_start() { // register for save states + save_item(NAME(m_intvdp)); + save_item(NAME(m_intexp)); + save_item(NAME(m_romdis)); + save_item(NAME(m_ramdis)); + save_item(NAME(m_cart)); + save_item(NAME(m_bk21)); save_item(NAME(m_keyboard_row)); } void svi3x8_state::machine_reset() { - reset_memory_configuration(); + m_intvdp = 0; + m_intexp = 0; + m_romdis = 1; + m_ramdis = 1; + m_cart = 1; + m_bk21 = 1; } -WRITE8_MEMBER( svi3x8_state::psg_port_b_w ) +READ8_MEMBER( svi3x8_state::page1_r) { - reset_memory_configuration(); + if (m_cart == 0) + return m_cart_rom->exists() ? m_cart_rom->read_rom(space, offset) : 0xff; - // CART - if (BIT(data, 0) == 0) - { - if (m_cart->exists()) - m_maincpu->space(AS_PROGRAM).install_rom(0x0000, 0x7fff, m_cart->get_rom_base()); - else - m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x0000, 0x7fff); - } - else - { - // BK21 (SV-328) - if (BIT(data, 1) == 0) - { - if (m_ram->size() == 64 * 1024) - m_maincpu->space(AS_PROGRAM).install_ram(0x0000, 0x7fff, m_ram->pointer() + 0x8000); - else - m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x0000, 0x7fff); - } + UINT8 data = m_expander->mreq_r(space, offset); - // BK22 (SV-807) - if (BIT(data, 2) == 0) - m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x8000, 0xffff); + if (m_romdis == 1) + data = m_basic->u8(offset); - // BK31 (SV-807) - if (BIT(data, 3) == 0) - m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x0000, 0x7fff); + if (m_bk21 == 0 && IS_SVI328) + data = m_ram->read(offset); - // BK32 (SV-807) - if (BIT(data, 4) == 0) - m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x8000, 0xffff); - } + return data; +} + +WRITE8_MEMBER( svi3x8_state::page1_w) +{ + if (m_cart == 0) + return; + + m_expander->mreq_w(space, offset, data); + + if (m_bk21 == 0 && IS_SVI328) + m_ram->write(offset, data); +} + +READ8_MEMBER( svi3x8_state::page2_r) +{ + offset += 0x8000; + + UINT8 data = m_expander->mreq_r(space, offset); + + if (m_ramdis == 1 && (offset >= 0x4000 || IS_SVI328)) + return m_ram->read(IS_SVI328 ? offset : offset - 0xc000); + + return data; +} + +WRITE8_MEMBER( svi3x8_state::page2_w ) +{ + offset += 0x8000; + + m_expander->mreq_w(space, offset, data); + + if (m_ramdis == 1 && (offset >= 0x4000 || IS_SVI328)) + m_ram->write(IS_SVI328 ? offset : offset - 0xc000, data); +} + +WRITE8_MEMBER( svi3x8_state::bank_w ) +{ + logerror("bank_w: %02x\n", data); + + m_cart = BIT(data, 0); + m_bk21 = BIT(data, 1); + + m_expander->bk21_w(BIT(data, 1)); + m_expander->bk22_w(BIT(data, 2)); + m_expander->bk31_w(BIT(data, 3)); + m_expander->bk32_w(BIT(data, 4)); + + // TODO: handle ROM2/ROM3 enable (bit 6 + 7) output().set_value("led_caps_lock", BIT(data, 5)); } @@ -372,6 +425,22 @@ WRITE8_MEMBER( svi3x8_state::ppi_port_c_w ) m_speaker->level_w(BIT(data, 7)); } +WRITE_LINE_MEMBER( svi3x8_state::intexp_w ) +{ + m_intexp = state; + m_maincpu->set_input_line(INPUT_LINE_IRQ0, (m_intvdp || m_intexp) ? ASSERT_LINE : CLEAR_LINE); +} + +WRITE_LINE_MEMBER( svi3x8_state::romdis_w ) +{ + m_romdis = state; +} + +WRITE_LINE_MEMBER( svi3x8_state::ramdis_w ) +{ + m_ramdis = state; +} + //************************************************************************** // CARTRIDGE @@ -379,7 +448,7 @@ WRITE8_MEMBER( svi3x8_state::ppi_port_c_w ) DEVICE_IMAGE_LOAD_MEMBER( svi3x8_state, cartridge ) { - UINT32 size = m_cart->common_get_size("rom"); + UINT32 size = m_cart_rom->common_get_size("rom"); if (size != 0x8000) { @@ -387,8 +456,8 @@ DEVICE_IMAGE_LOAD_MEMBER( svi3x8_state, cartridge ) return IMAGE_INIT_FAIL; } - m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); - m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); + m_cart_rom->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); + m_cart_rom->common_load_rom(m_cart_rom->get_rom_base(), size, "rom"); return IMAGE_INIT_PASS; } @@ -427,7 +496,7 @@ static MACHINE_CONFIG_START( svi318, svi3x8_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ADD("psg", AY8910, XTAL_10_738635MHz / 6) MCFG_AY8910_PORT_A_READ_CB(IOPORT("JOY")) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(svi3x8_state, psg_port_b_w)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(svi3x8_state, bank_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) // cassette @@ -442,6 +511,12 @@ static MACHINE_CONFIG_START( svi318, svi3x8_state ) MCFG_GENERIC_EXTENSIONS("bin,rom") MCFG_GENERIC_LOAD(svi3x8_state, cartridge) MCFG_SOFTWARE_LIST_ADD("cart_list", "svi318_cart") + + // expander bus + MCFG_SVI_EXPANDER_BUS_ADD("exp") + MCFG_SVI_EXPANDER_INT_HANDLER(WRITELINE(svi3x8_state, intexp_w)) + MCFG_SVI_EXPANDER_ROMDIS_HANDLER(WRITELINE(svi3x8_state, romdis_w)) + MCFG_SVI_EXPANDER_RAMDIS_HANDLER(WRITELINE(svi3x8_state, ramdis_w)) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( svi318n, svi318 ) From 804fa20d56f5fc1019da249d24acb63233e30bf0 Mon Sep 17 00:00:00 2001 From: cracyc Date: Wed, 16 Mar 2016 16:44:53 -0500 Subject: [PATCH 29/48] pcat_dyn: make post text screen work with trident (nw) --- src/devices/bus/isa/trident.cpp | 6 ++++-- src/devices/machine/atapicdr.cpp | 12 ++++++++---- src/devices/machine/atapicdr.h | 1 + src/mame/drivers/pcat_dyn.cpp | 12 ++++++------ 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/devices/bus/isa/trident.cpp b/src/devices/bus/isa/trident.cpp index 4f47bdd7212..85b83d968cc 100644 --- a/src/devices/bus/isa/trident.cpp +++ b/src/devices/bus/isa/trident.cpp @@ -191,6 +191,7 @@ void trident_vga_device::device_reset() // Windows 3.1 TGUI9440AGi drivers do not set the pointer colour registers? tri.cursor_bg = 0x00000000; tri.cursor_fg = 0xffffffff; + tri.pixel_depth = 0x10; //disable 8bpp mode by default } UINT32 trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) @@ -443,7 +444,6 @@ void trident_vga_device::trident_seq_reg_write(UINT8 index, UINT8 data) } else { - if(LOG) logerror("Trident SR%02X: %s mode write %02x\n",index,tri.new_mode ? "new" : "old",data); switch(index) { case 0x0b: @@ -490,6 +490,7 @@ void trident_vga_device::trident_seq_reg_write(UINT8 index, UINT8 data) if(!LOG) logerror("Trident: Sequencer index %02x read\n",index); } } + if(LOG) logerror("Trident SR%02X: %s mode write %02x\n",index,tri.new_mode ? "new" : "old",data); } UINT8 trident_vga_device::trident_crtc_reg_read(UINT8 index) @@ -605,7 +606,6 @@ void trident_vga_device::trident_crtc_reg_write(UINT8 index, UINT8 data) } else { - if(LOG) logerror("Trident CR%02X: write %02x\n",index,data); switch(index) { case 0x1e: // Module Testing Register @@ -704,6 +704,7 @@ void trident_vga_device::trident_crtc_reg_write(UINT8 index, UINT8 data) break; } } + if(LOG) logerror("Trident CR%02X: write %02x\n",index,data); } UINT8 trident_vga_device::trident_gc_reg_read(UINT8 index) @@ -764,6 +765,7 @@ void trident_vga_device::trident_gc_reg_write(UINT8 index, UINT8 data) break; } } + if(LOG) logerror("Trident GC%02X: write %02x\n",index,data); } READ8_MEMBER(trident_vga_device::port_03c0_r) diff --git a/src/devices/machine/atapicdr.cpp b/src/devices/machine/atapicdr.cpp index 151d8d1bb10..13fd79570dd 100644 --- a/src/devices/machine/atapicdr.cpp +++ b/src/devices/machine/atapicdr.cpp @@ -72,11 +72,15 @@ void atapi_cdrom_device::device_start() m_identify_buffer[ 49 ] = 0x0600; // Word 49=Capabilities, IORDY may be disabled (bit_10), LBA Supported mandatory (bit_9) - m_media_change = true; - atapi_hle_device::device_start(); } +void atapi_cdrom_device::device_reset() +{ + atapi_hle_device::device_reset(); + m_media_change = true; +} + void atapi_cdrom_device::process_buffer() { if(m_cdrom != m_image->get_cdrom_file()) @@ -130,10 +134,10 @@ void atapi_cdrom_device::ExecCommand() } break; case T10SPC_CMD_INQUIRY: + break; case T10SPC_CMD_REQUEST_SENSE: + m_media_change = false; break; } t10mmc::ExecCommand(); - if((command[0] == T10SPC_CMD_REQUEST_SENSE) && m_media_change) - m_media_change = false; } diff --git a/src/devices/machine/atapicdr.h b/src/devices/machine/atapicdr.h index 2c310113c5c..dc5220c000d 100644 --- a/src/devices/machine/atapicdr.h +++ b/src/devices/machine/atapicdr.h @@ -28,6 +28,7 @@ public: protected: // device-level overrides virtual void device_start() override; + virtual void device_reset() override; virtual machine_config_constructor device_mconfig_additions() const override; virtual void perform_diagnostic() override; diff --git a/src/mame/drivers/pcat_dyn.cpp b/src/mame/drivers/pcat_dyn.cpp index 00b1a7df54d..baaa94626ee 100644 --- a/src/mame/drivers/pcat_dyn.cpp +++ b/src/mame/drivers/pcat_dyn.cpp @@ -23,7 +23,7 @@ If the output isn't satisfactory, it prints "I/O BOARD FAILURE". #include "emu.h" #include "cpu/i386/i386.h" #include "machine/pcshare.h" -#include "video/pc_vga.h" +#include "bus/isa/trident.h" #include "machine/bankdev.h" #include "machine/ds128x.h" #include "machine/ins8250.h" @@ -56,7 +56,7 @@ WRITE8_MEMBER(pcat_dyn_state::bank2_w) static ADDRESS_MAP_START( pcat_map, AS_PROGRAM, 32, pcat_dyn_state ) AM_RANGE(0x00000000, 0x0009ffff) AM_RAM - AM_RANGE(0x000a0000, 0x000bffff) AM_DEVREADWRITE8("vga", vga_device, mem_r, mem_w, 0xffffffff) + AM_RANGE(0x000a0000, 0x000bffff) AM_DEVREADWRITE8("vga", trident_vga_device, mem_r, mem_w, 0xffffffff) AM_RANGE(0x000c0000, 0x000c7fff) AM_ROM AM_REGION("video_bios", 0) AM_RANGE(0x000d0000, 0x000d0fff) AM_ROM AM_REGION("game_prg", 0x0000) AM_WRITE8(bank1_w, 0xffffffff) AM_RANGE(0x000d1000, 0x000d1fff) AM_ROM AM_REGION("game_prg", 0x1000) AM_WRITE8(bank2_w, 0xffffffff) @@ -70,9 +70,9 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( pcat_io, AS_IO, 32, pcat_dyn_state ) AM_IMPORT_FROM(pcat32_io_common) - AM_RANGE(0x03b0, 0x03bf) AM_DEVREADWRITE8("vga", vga_device, port_03b0_r, port_03b0_w, 0xffffffff) - AM_RANGE(0x03c0, 0x03cf) AM_DEVREADWRITE8("vga", vga_device, port_03c0_r, port_03c0_w, 0xffffffff) - AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", vga_device, port_03d0_r, port_03d0_w, 0xffffffff) + AM_RANGE(0x03b0, 0x03bf) AM_DEVREADWRITE8("vga", trident_vga_device, port_03b0_r, port_03b0_w, 0xffffffff) + AM_RANGE(0x03c0, 0x03cf) AM_DEVREADWRITE8("vga", trident_vga_device, port_03c0_r, port_03c0_w, 0xffffffff) + AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", trident_vga_device, port_03d0_r, port_03d0_w, 0xffffffff) AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8("ns16550", ns16550_device, ins8250_r, ins8250_w, 0xffffffff) ADDRESS_MAP_END @@ -126,7 +126,7 @@ static MACHINE_CONFIG_START( pcat_dyn, pcat_dyn_state ) MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic8259_1", pic8259_device, inta_cb) /* video hardware */ - MCFG_FRAGMENT_ADD( pcvideo_vga ) + MCFG_FRAGMENT_ADD( pcvideo_trident_vga ) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_REFRESH_RATE(60) From 5d52e272bad00b5d9abbcd915b01c16deb6ebbf7 Mon Sep 17 00:00:00 2001 From: balr0g Date: Wed, 16 Mar 2016 19:04:35 -0400 Subject: [PATCH 30/48] Remove no-longer-needed normalization from gba (nw) --- src/emu/attotime.h | 11 ----------- src/mame/drivers/gba.cpp | 4 ---- 2 files changed, 15 deletions(-) diff --git a/src/emu/attotime.h b/src/emu/attotime.h index 0cdaa424ca0..a0915ae07f2 100644 --- a/src/emu/attotime.h +++ b/src/emu/attotime.h @@ -117,17 +117,6 @@ public: UINT64 as_ticks(UINT32 frequency) const; const char *as_string(int precision = 9) const; - // Needed by gba.c FIXME: this shouldn't be necessary? - - void normalize() - { - while (m_attoseconds >= ATTOSECONDS_PER_SECOND) - { - m_seconds++; - m_attoseconds -= ATTOSECONDS_PER_SECOND; - } - } - attoseconds_t attoseconds() const { return m_attoseconds; } seconds_t seconds() const { return m_seconds; } diff --git a/src/mame/drivers/gba.cpp b/src/mame/drivers/gba.cpp index abaea79d40d..f2c05930332 100644 --- a/src/mame/drivers/gba.cpp +++ b/src/mame/drivers/gba.cpp @@ -35,8 +35,6 @@ static inline void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, co } } -#define GBA_ATTOTIME_NORMALIZE(a) a.normalize() - static const UINT32 timer_clks[4] = { 16777216, 16777216/64, 16777216/256, 16777216/1024 }; @@ -343,7 +341,6 @@ TIMER_CALLBACK_MEMBER(gba_state::timer_expire) final = clocksel / rate; m_timer_hz[tmr] = final; time = attotime::from_hz(final); - GBA_ATTOTIME_NORMALIZE(time); m_tmr_timer[tmr]->adjust(time, tmr, time); } @@ -1639,7 +1636,6 @@ WRITE32_MEMBER(gba_state::gba_io_w) if( !(data & 0x40000) ) // if we're not in Count-Up mode { attotime time = attotime::from_hz(final); - GBA_ATTOTIME_NORMALIZE(time); m_tmr_timer[offset]->adjust(time, offset, time); } } From 157de7d935dad7ea732088f0f48d92c925b3bc37 Mon Sep 17 00:00:00 2001 From: balr0g Date: Wed, 16 Mar 2016 19:30:11 -0400 Subject: [PATCH 31/48] Remove extraneous character (nw) --- doxygen/doxygen.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doxygen/doxygen.config b/doxygen/doxygen.config index d7115e0ef71..9cdc7792934 100644 --- a/doxygen/doxygen.config +++ b/doxygen/doxygen.config @@ -118,7 +118,7 @@ ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = YES # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -1# inherited members of a class in the documentation of that class as if those +# inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. # The default value is: NO. From d0ce8784a7005e3c4912847f4ffbe2c41404a28f Mon Sep 17 00:00:00 2001 From: Justin Kerk Date: Thu, 17 Mar 2016 01:42:48 +0000 Subject: [PATCH 32/48] Build more of font_sdl.cpp with Emscripten since there is an SDL2_ttf port now (nw) --- scripts/genie.lua | 1 + scripts/src/main.lua | 1 + src/osd/modules/font/font_sdl.cpp | 22 ++++++++++++++-------- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index e991bb5ed38..0a7c79d5825 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -1059,6 +1059,7 @@ configuration { "asmjs" } buildoptions { "-std=gnu89", "-Wno-implicit-function-declaration", + "-s USE_SDL_TTF=2", } buildoptions_cpp { "-x c++", diff --git a/scripts/src/main.lua b/scripts/src/main.lua index c9c99a354c3..18a5b28210f 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -109,6 +109,7 @@ end local emccopts = "" emccopts = emccopts .. " -O3" emccopts = emccopts .. " -s USE_SDL=2" + emccopts = emccopts .. " -s USE_SDL_TTF=2" emccopts = emccopts .. " --memory-init-file 0" emccopts = emccopts .. " -s ALLOW_MEMORY_GROWTH=0" emccopts = emccopts .. " -s TOTAL_MEMORY=268435456" diff --git a/src/osd/modules/font/font_sdl.cpp b/src/osd/modules/font/font_sdl.cpp index 3c8a69d5d63..cdcfc1bcedb 100644 --- a/src/osd/modules/font/font_sdl.cpp +++ b/src/osd/modules/font/font_sdl.cpp @@ -8,15 +8,19 @@ #include "font_module.h" #include "modules/osdmodule.h" -#if defined(SDLMAME_UNIX) && !defined(SDLMAME_MACOSX) && !defined(SDLMAME_SOLARIS) && !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN) +#if defined(SDLMAME_UNIX) && !defined(SDLMAME_MACOSX) && !defined(SDLMAME_SOLARIS) && !defined(SDLMAME_HAIKU) #include "corestr.h" #include "corealloc.h" #include "fileio.h" #include "unicode.h" +#ifdef SDLMAME_EMSCRIPTEN +#include +#else #include -#ifndef SDLMAME_HAIKU +#endif +#if !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN) #include #endif @@ -52,7 +56,7 @@ private: static constexpr double POINT_SIZE = 144.0; -#ifndef SDLMAME_HAIKU +#if !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN) TTF_Font_ptr search_font_config(std::string const &name, bool bold, bool italic, bool underline, bool &bakedstyles); #endif bool BDF_Check_Magic(std::string const &name); @@ -97,7 +101,7 @@ bool osd_font_sdl::open(std::string const &font_path, std::string const &_name, } // if that didn't work, crank up the FontConfig database -#ifndef SDLMAME_HAIKU +#if !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN) if (!font) { font = search_font_config(name, bold, italic, underline, bakedstyles); @@ -214,7 +218,7 @@ bool osd_font_sdl::BDF_Check_Magic(std::string const &name) return false; } -#ifndef SDLMAME_HAIKU +#if !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN) osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &name, bool bold, bool italic, bool underline, bool &bakedstyles) { TTF_Font_ptr font(nullptr, &TTF_CloseFont); @@ -296,12 +300,12 @@ public: { } - osd_font::ptr font_alloc() + osd_font::ptr font_alloc() override { return std::make_unique(); } - virtual int init(const osd_options &options) + virtual int init(const osd_options &options) override { if (TTF_Init() == -1) { @@ -311,7 +315,7 @@ public: return 0; } - virtual void exit() + virtual void exit() override { TTF_Quit(); } @@ -326,6 +330,7 @@ bool font_sdl::get_font_families(std::string const &font_path, std::vector pat(FcPatternCreate(), &FcPatternDestroy); FcPatternAddString(pat.get(), FC_FONTFORMAT, (const FcChar8 *)"TrueType"); @@ -355,6 +360,7 @@ bool font_sdl::get_font_families(std::string const &font_path, std::vectorfirst != font.first)) result.emplace(pos, std::move(font)); } } +#endif return true; } From 4cc9dd016a15cb562070c8be42036e0368a1f87c Mon Sep 17 00:00:00 2001 From: Justin Kerk Date: Thu, 17 Mar 2016 02:04:19 +0000 Subject: [PATCH 33/48] Don't need to ifdef this out anymore either (nw) --- src/osd/modules/file/posixsocket.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/osd/modules/file/posixsocket.cpp b/src/osd/modules/file/posixsocket.cpp index f6f465dd5d7..d6655e4cf15 100644 --- a/src/osd/modules/file/posixsocket.cpp +++ b/src/osd/modules/file/posixsocket.cpp @@ -50,10 +50,6 @@ public: virtual error read(void *buffer, std::uint64_t offset, std::uint32_t count, std::uint32_t &actual) override { -#if defined(EMSCRIPTEN) - m_listening = false; - return error::FAILURE; // TODO: work out what it dislikes about emscripten -#else fd_set readfds; FD_ZERO(&readfds); FD_SET(m_sock, &readfds); @@ -107,7 +103,6 @@ public: { return error::FAILURE; } -#endif } virtual error write(void const *buffer, std::uint64_t offset, std::uint32_t count, std::uint32_t &actual) override From 776bfad1c1f4e9a4dd5e799f9ca5e9145ca644a0 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Thu, 17 Mar 2016 03:03:36 +0100 Subject: [PATCH 34/48] svi318: add support for the 80 column card (sv806) --- scripts/src/bus.lua | 2 + src/devices/bus/svi3x8/slot/cards.cpp | 1 + src/devices/bus/svi3x8/slot/cards.h | 1 + src/devices/bus/svi3x8/slot/sv806.cpp | 150 ++++++++++++++++++++++++++ src/devices/bus/svi3x8/slot/sv806.h | 55 ++++++++++ 5 files changed, 209 insertions(+) create mode 100644 src/devices/bus/svi3x8/slot/sv806.cpp create mode 100644 src/devices/bus/svi3x8/slot/sv806.h diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index d6bc6cfedda..e4451462806 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -2619,6 +2619,8 @@ if (BUSES["SVI_SLOT"]~=null) then MAME_DIR .. "src/devices/bus/svi3x8/slot/sv801.h", MAME_DIR .. "src/devices/bus/svi3x8/slot/sv803.cpp", MAME_DIR .. "src/devices/bus/svi3x8/slot/sv803.h", + MAME_DIR .. "src/devices/bus/svi3x8/slot/sv806.cpp", + MAME_DIR .. "src/devices/bus/svi3x8/slot/sv806.h", MAME_DIR .. "src/devices/bus/svi3x8/slot/sv807.cpp", MAME_DIR .. "src/devices/bus/svi3x8/slot/sv807.h", } diff --git a/src/devices/bus/svi3x8/slot/cards.cpp b/src/devices/bus/svi3x8/slot/cards.cpp index e86317dedb4..8e60b1ae1d8 100644 --- a/src/devices/bus/svi3x8/slot/cards.cpp +++ b/src/devices/bus/svi3x8/slot/cards.cpp @@ -11,5 +11,6 @@ SLOT_INTERFACE_START( svi_slot_cards ) SLOT_INTERFACE("sv801", SV801) SLOT_INTERFACE("sv803", SV803) + SLOT_INTERFACE("sv806", SV806) SLOT_INTERFACE("sv807", SV807) SLOT_INTERFACE_END diff --git a/src/devices/bus/svi3x8/slot/cards.h b/src/devices/bus/svi3x8/slot/cards.h index 22d601a22fa..03492742e53 100644 --- a/src/devices/bus/svi3x8/slot/cards.h +++ b/src/devices/bus/svi3x8/slot/cards.h @@ -14,6 +14,7 @@ #include "emu.h" #include "sv801.h" #include "sv803.h" +#include "sv806.h" #include "sv807.h" SLOT_INTERFACE_EXTERN( svi_slot_cards ); diff --git a/src/devices/bus/svi3x8/slot/sv806.cpp b/src/devices/bus/svi3x8/slot/sv806.cpp new file mode 100644 index 00000000000..3db7d8ee2a7 --- /dev/null +++ b/src/devices/bus/svi3x8/slot/sv806.cpp @@ -0,0 +1,150 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SV-806 80 Column Cartridge for SVI-318/328 + +***************************************************************************/ + +#include "sv806.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type SV806 = &device_creator; + +//------------------------------------------------- +// rom_region - device-specific ROM region +//------------------------------------------------- + +ROM_START( sv806 ) + ROM_REGION(0x1000, "gfx", 0) + ROM_SYSTEM_BIOS(0, "en", "English Character Set") + ROMX_LOAD("sv806.ic27", 0x0000, 0x1000, CRC(850bc232) SHA1(ed45cb0e9bd18a9d7bd74f87e620f016a7ae840f), ROM_BIOS(1)) + ROM_SYSTEM_BIOS(1, "se", "Swedish Character Set") + ROMX_LOAD("sv806se.ic27", 0x0000, 0x1000, CRC(daea8956) SHA1(3f16d5513ad35692488ae7d864f660e76c6e8ed3), ROM_BIOS(2)) +ROM_END + +const rom_entry *sv806_device::device_rom_region() const +{ + return ROM_NAME( sv806 ); +} + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( sv806 ) + MCFG_SCREEN_ADD_MONOCHROME("80col", RASTER, rgb_t::green) + MCFG_SCREEN_RAW_PARAMS((XTAL_12MHz / 6) * 8, 864, 0, 640, 317, 0, 192) + MCFG_SCREEN_UPDATE_DEVICE("crtc", hd6845_device, screen_update) + + MCFG_PALETTE_ADD_MONOCHROME("palette") + + MCFG_MC6845_ADD("crtc", HD6845, "80col", XTAL_12MHz / 6) + MCFG_MC6845_SHOW_BORDER_AREA(false) + MCFG_MC6845_CHAR_WIDTH(8) + MCFG_MC6845_UPDATE_ROW_CB(sv806_device, crtc_update_row) +MACHINE_CONFIG_END + +machine_config_constructor sv806_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( sv806 ); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// sv806_device - constructor +//------------------------------------------------- + +sv806_device::sv806_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, SV806, "SV-806 80 Column Cartridge", tag, owner, clock, "sv806", __FILE__), + device_svi_slot_interface(mconfig, *this), + m_crtc(*this, "crtc"), + m_palette(*this, "palette"), + m_gfx(*this, "gfx"), + m_ram_enabled(0) +{ + m_ram = std::make_unique(0x800); + memset(m_ram.get(), 0xff, 0x800); +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void sv806_device::device_start() +{ +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +MC6845_UPDATE_ROW( sv806_device::crtc_update_row ) +{ + const pen_t *pen = m_palette->pens(); + + for (int i = 0; i < x_count; i++) + { + UINT8 data = m_gfx->u8((m_ram[(ma + i) & 0x7ff] << 4) | ra); + + if (i == cursor_x) + data = 0xff; + + bitmap.pix32(y, i * 8 + 0) = pen[BIT(data, 7)]; + bitmap.pix32(y, i * 8 + 1) = pen[BIT(data, 6)]; + bitmap.pix32(y, i * 8 + 2) = pen[BIT(data, 5)]; + bitmap.pix32(y, i * 8 + 3) = pen[BIT(data, 4)]; + bitmap.pix32(y, i * 8 + 4) = pen[BIT(data, 3)]; + bitmap.pix32(y, i * 8 + 5) = pen[BIT(data, 2)]; + bitmap.pix32(y, i * 8 + 6) = pen[BIT(data, 1)]; + bitmap.pix32(y, i * 8 + 7) = pen[BIT(data, 0)]; + } +} + +READ8_MEMBER( sv806_device::mreq_r ) +{ + if (offset >= 0xf000 && m_ram_enabled) + { + m_bus->ramdis_w(0); + return m_ram[offset & 0x7ff]; + } + + return 0xff; +} + +WRITE8_MEMBER( sv806_device::mreq_w ) +{ + if (offset >= 0xf000 && m_ram_enabled) + { + m_bus->ramdis_w(0); + m_ram[offset & 0x7ff] = data; + } +} + +READ8_MEMBER( sv806_device::iorq_r ) +{ + if (offset == 0x51) + return m_crtc->register_r(space, 0); + + return 0xff; +} + +WRITE8_MEMBER( sv806_device::iorq_w ) +{ + switch (offset) + { + case 0x50: m_crtc->address_w(space, 0, data); break; + case 0x51: m_crtc->register_w(space, 0, data); break; + case 0x58: m_ram_enabled = data; break; + } +} diff --git a/src/devices/bus/svi3x8/slot/sv806.h b/src/devices/bus/svi3x8/slot/sv806.h new file mode 100644 index 00000000000..4782faa4812 --- /dev/null +++ b/src/devices/bus/svi3x8/slot/sv806.h @@ -0,0 +1,55 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + SV-806 80 column card for SVI-318/328 + +***************************************************************************/ + +#pragma once + +#ifndef __SVI3X8_SLOT_SV806_H__ +#define __SVI3X8_SLOT_SV806_H__ + +#include "emu.h" +#include "slot.h" +#include "video/mc6845.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> sv806_device + +class sv806_device : public device_t, public device_svi_slot_interface +{ +public: + // construction/destruction + sv806_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + virtual DECLARE_READ8_MEMBER( mreq_r ) override; + virtual DECLARE_WRITE8_MEMBER( mreq_w ) override; + virtual DECLARE_READ8_MEMBER( iorq_r ) override; + virtual DECLARE_WRITE8_MEMBER( iorq_w ) override; + + MC6845_UPDATE_ROW(crtc_update_row); + +protected: + virtual const rom_entry *device_rom_region() const override; + virtual machine_config_constructor device_mconfig_additions() const override; + virtual void device_start() override; + +private: + required_device m_crtc; + required_device m_palette; + required_memory_region m_gfx; + + std::unique_ptr m_ram; + int m_ram_enabled; +}; + +// device type definition +extern const device_type SV806; + +#endif // __SVI3X8_SLOT_SV806_H__ From f0e580e40a333fd9363e23710d440c5bfa1b5bce Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 17 Mar 2016 12:01:47 +1100 Subject: [PATCH 35/48] Clear error status on persistent streams --- src/emu/debug/dvdisasm.cpp | 2 ++ src/lib/util/corefile.cpp | 1 + src/mame/drivers/ssem.cpp | 1 + 3 files changed, 4 insertions(+) diff --git a/src/emu/debug/dvdisasm.cpp b/src/emu/debug/dvdisasm.cpp index 6daca107f86..10cb3e75e64 100644 --- a/src/emu/debug/dvdisasm.cpp +++ b/src/emu/debug/dvdisasm.cpp @@ -370,6 +370,7 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines) // allocate disassembly buffer const auto total_bytes = m_total.x * m_total.y; + m_dasm.clear(); m_dasm.reserve(total_bytes).seekp(total_bytes); // iterate over lines @@ -387,6 +388,7 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines) // convert back and set the address of this instruction m_byteaddress[instr] = pcbyte; + m_dasm.clear(); util::stream_format(m_dasm.seekp(base), source.m_space.is_octal() ? " %0*o " : " %0*X ", source.m_space.logaddrchars()/2*char_num, source.m_space.byte_to_address(pcbyte)); diff --git a/src/lib/util/corefile.cpp b/src/lib/util/corefile.cpp index ec1e25340e3..5c16d886fe3 100644 --- a/src/lib/util/corefile.cpp +++ b/src/lib/util/corefile.cpp @@ -611,6 +611,7 @@ int core_text_file::puts(char const *s) int core_text_file::vprintf(util::format_argument_pack const &args) { + m_printf_buffer.clear(); m_printf_buffer.reserve(1024); m_printf_buffer.seekp(0, ovectorstream::beg); util::stream_format(m_printf_buffer, args); diff --git a/src/mame/drivers/ssem.cpp b/src/mame/drivers/ssem.cpp index 278d02518fb..dac314aa9eb 100644 --- a/src/mame/drivers/ssem.cpp +++ b/src/mame/drivers/ssem.cpp @@ -416,6 +416,7 @@ void ssem_state::glyph_print(bitmap_rgb32 &bitmap, INT32 x, INT32 y, Format &&fm { const rectangle &visarea = m_screen->visible_area(); + m_glyph_print_buf.clear(); m_glyph_print_buf.seekp(0, util::ovectorstream::beg); util::stream_format(m_glyph_print_buf, std::forward(fmt), std::forward(args)...); m_glyph_print_buf.put('\0'); From f99198c5c266ca4ce3e298df49641e1dbbd8a984 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 17 Mar 2016 13:28:30 +1100 Subject: [PATCH 36/48] Implement couriersud's proposal to put style name in the config name for SDL fonts Enumerate available font styles as well as families Still has a problem in that TTC fonts are enumerated but can't be loaded by SDL_ttf --- src/osd/modules/font/font_sdl.cpp | 83 +++++++++++++++---------------- 1 file changed, 40 insertions(+), 43 deletions(-) diff --git a/src/osd/modules/font/font_sdl.cpp b/src/osd/modules/font/font_sdl.cpp index cdcfc1bcedb..4d9b3228d2e 100644 --- a/src/osd/modules/font/font_sdl.cpp +++ b/src/osd/modules/font/font_sdl.cpp @@ -57,7 +57,7 @@ private: static constexpr double POINT_SIZE = 144.0; #if !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN) - TTF_Font_ptr search_font_config(std::string const &name, bool bold, bool italic, bool underline, bool &bakedstyles); + TTF_Font_ptr search_font_config(std::string const &family, std::string const &style, bool &bakedstyles); #endif bool BDF_Check_Magic(std::string const &name); TTF_Font_ptr TTF_OpenFont_Magic(std::string const &name, int fsize); @@ -69,29 +69,29 @@ bool osd_font_sdl::open(std::string const &font_path, std::string const &_name, { bool bakedstyles = false; - // accept qualifiers from the name std::string name(_name); if (name.compare("default") == 0) { - name = "Liberation Sans"; + name = "Liberation Sans|Regular"; } - bool const bold = (strreplace(name, "[B]", "") + strreplace(name, "[b]", "") > 0); - bool const italic = (strreplace(name, "[I]", "") + strreplace(name, "[i]", "") > 0); + // accept qualifiers from the name bool const underline = (strreplace(name, "[U]", "") + strreplace(name, "[u]", "") > 0); bool const strike = (strreplace(name, "[S]", "") + strreplace(name, "[s]", "") > 0); + std::string::size_type const separator = name.rfind('|'); + std::string const family(name.substr(0, separator)); + std::string const style((std::string::npos != separator) ? name.substr(separator + 1) : std::string()); // first up, try it as a filename - TTF_Font_ptr font = TTF_OpenFont_Magic(name, POINT_SIZE); + TTF_Font_ptr font = TTF_OpenFont_Magic(family, POINT_SIZE); // if no success, try the font path - if (!font) { - osd_printf_verbose("Searching font %s in -%s\n", name.c_str(), OPTION_FONTPATH); + osd_printf_verbose("Searching font %s in -%s\n", family.c_str(), OPTION_FONTPATH); //emu_file file(options().font_path(), OPEN_FLAG_READ); emu_file file(font_path.c_str(), OPEN_FLAG_READ); - if (file.open(name.c_str()) == osd_file::error::NONE) + if (file.open(family.c_str()) == osd_file::error::NONE) { std::string full_name = file.fullpath(); font = TTF_OpenFont_Magic(full_name, POINT_SIZE); @@ -104,7 +104,7 @@ bool osd_font_sdl::open(std::string const &font_path, std::string const &_name, #if !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN) if (!font) { - font = search_font_config(name, bold, italic, underline, bakedstyles); + font = search_font_config(family, style, bakedstyles); } #endif @@ -118,21 +118,21 @@ bool osd_font_sdl::open(std::string const &font_path, std::string const &_name, } // apply styles - int style = 0; + int styleflags = 0; if (!bakedstyles) { - style |= bold ? TTF_STYLE_BOLD : 0; - style |= italic ? TTF_STYLE_ITALIC : 0; + if ((style.find("Bold") != std::string::npos) || (style.find("Black") != std::string::npos)) styleflags |= TTF_STYLE_BOLD; + if ((style.find("Italic") != std::string::npos) || (style.find("Oblique") != std::string::npos)) styleflags |= TTF_STYLE_ITALIC; } - style |= underline ? TTF_STYLE_UNDERLINE : 0; + styleflags |= underline ? TTF_STYLE_UNDERLINE : 0; // SDL_ttf 2.0.9 and earlier does not define TTF_STYLE_STRIKETHROUGH #if SDL_VERSIONNUM(TTF_MAJOR_VERSION, TTF_MINOR_VERSION, TTF_PATCHLEVEL) > SDL_VERSIONNUM(2,0,9) - style |= strike ? TTF_STYLE_STRIKETHROUGH : 0; + styleflags |= strike ? TTF_STYLE_STRIKETHROUGH : 0; #else if (strike) osd_printf_warning("Ignoring strikethrough for SDL_TTF older than 2.0.10\n"); #endif // PATCHLEVEL - TTF_SetFontStyle(font.get(), style); + TTF_SetFontStyle(font.get(), styleflags); height = TTF_FontLineSkip(font.get()); @@ -219,31 +219,18 @@ bool osd_font_sdl::BDF_Check_Magic(std::string const &name) } #if !defined(SDLMAME_HAIKU) && !defined(SDLMAME_EMSCRIPTEN) -osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &name, bool bold, bool italic, bool underline, bool &bakedstyles) +osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &family, std::string const &style, bool &bakedstyles) { TTF_Font_ptr font(nullptr, &TTF_CloseFont); FcConfig *const config = FcConfigGetCurrent(); std::unique_ptr pat(FcPatternCreate(), &FcPatternDestroy); std::unique_ptr os(FcObjectSetCreate(), &FcObjectSetDestroy); - FcPatternAddString(pat.get(), FC_FAMILY, (const FcChar8 *)name.c_str()); + FcPatternAddString(pat.get(), FC_FAMILY, (const FcChar8 *)family.c_str()); // try and get a font with the requested styles baked-in - if (bold) - { - if (italic) - FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Bold Italic"); - else - FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Bold"); - } - else if (italic) - { - FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Italic"); - } - else - { - FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Regular"); - } + if (!style.empty()) + FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)style.c_str()); FcPatternAddString(pat.get(), FC_FONTFORMAT, (const FcChar8 *)"TrueType"); @@ -266,12 +253,10 @@ osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &n } // didn't get a font above? try again with no baked-in styles - if (!font) + if (!font && !style.empty()) { pat.reset(FcPatternCreate()); - FcPatternAddString(pat.get(), FC_FAMILY, (const FcChar8 *)name.c_str()); - //Quite a lot of fonts don't have a "Regular" font type attribute - //FcPatternAddString(pat.get(), FC_STYLE, (const FcChar8 *)"Regular"); + FcPatternAddString(pat.get(), FC_FAMILY, (const FcChar8 *)family.c_str()); FcPatternAddString(pat.get(), FC_FONTFORMAT, (const FcChar8 *)"TrueType"); fontset.reset(FcFontList(config, pat.get(), os.get())); @@ -338,6 +323,7 @@ bool font_sdl::get_font_families(std::string const &font_path, std::vector os(FcObjectSetCreate(), &FcObjectSetDestroy); FcObjectSetAdd(os.get(), FC_FAMILY); FcObjectSetAdd(os.get(), FC_FILE); + FcObjectSetAdd(os.get(), FC_STYLE); std::unique_ptr fontset(FcFontList(config, pat.get(), os.get()), &FcFontSetDestroy); for (int i = 0; (i < fontset->nfont); i++) @@ -350,19 +336,30 @@ bool font_sdl::get_font_families(std::string const &font_path, std::vector const &a, std::pair const &b) -> bool { - int const first = core_stricmp(a.first.c_str(), b.first.c_str()); - if (first < 0) return true; - else if (first > 0) return false; - else return core_stricmp(b.second.c_str(), b.second.c_str()) < 0; + int const second = core_stricmp(a.second.c_str(), b.second.c_str()); + if (second < 0) return true; + else if (second > 0) return false; + else return core_stricmp(b.first.c_str(), b.first.c_str()) < 0; }; - std::pair font((const char *)val.u.s, (const char *)val.u.s); + std::string config((const char *)val.u.s); + std::string display(config); + if ((FcPatternGet(fontset->fonts[i], FC_STYLE, 0, &val) == FcResultMatch) && (val.type == FcTypeString)) + { + config.push_back('|'); + config.append((const char *)val.u.s); + display.push_back(' '); + display.append((const char *)val.u.s); + } + std::pair font(std::move(config), std::move(display)); auto const pos = std::lower_bound(result.begin(), result.end(), font, compare_fonts); if ((result.end() == pos) || (pos->first != font.first)) result.emplace(pos, std::move(font)); } } -#endif return true; +#else + return false; +#endif } #else /* SDLMAME_UNIX */ From c54c32a82eed46b43bc8b4faddc1a328118e5a43 Mon Sep 17 00:00:00 2001 From: Justin Kerk Date: Thu, 17 Mar 2016 04:37:24 +0000 Subject: [PATCH 37/48] Don't need this either (nw) --- src/osd/modules/lib/osdlib_unix.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/osd/modules/lib/osdlib_unix.cpp b/src/osd/modules/lib/osdlib_unix.cpp index 9b2721a62cf..fd60db54ba9 100644 --- a/src/osd/modules/lib/osdlib_unix.cpp +++ b/src/osd/modules/lib/osdlib_unix.cpp @@ -14,10 +14,6 @@ #include #include -#ifdef SDLMAME_EMSCRIPTEN -#include -#endif - // MAME headers #include "osdcore.h" #include "osdlib.h" From a01a40c0a9f5fe8dbeadde660afa4030d81621a6 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 17 Mar 2016 20:56:50 +1100 Subject: [PATCH 38/48] Fix TTC loading (thanks for the tip, Sarayan) --- src/osd/modules/font/font_osx.cpp | 2 +- src/osd/modules/font/font_sdl.cpp | 43 +++++++++++++++++++++---------- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/osd/modules/font/font_osx.cpp b/src/osd/modules/font/font_osx.cpp index 8e310714649..e1c5137b397 100644 --- a/src/osd/modules/font/font_osx.cpp +++ b/src/osd/modules/font/font_osx.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Olivier Galibert, R. Belmont +// copyright-holders:Olivier Galibert, R. Belmont, Vas Crabb /* * font_osx.c * diff --git a/src/osd/modules/font/font_sdl.cpp b/src/osd/modules/font/font_sdl.cpp index 4d9b3228d2e..8c24dc60722 100644 --- a/src/osd/modules/font/font_sdl.cpp +++ b/src/osd/modules/font/font_sdl.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Olivier Galibert, R. Belmont +// copyright-holders:Olivier Galibert, R. Belmont, Vas Crabb /* * font_sdl.c * @@ -60,7 +60,7 @@ private: TTF_Font_ptr search_font_config(std::string const &family, std::string const &style, bool &bakedstyles); #endif bool BDF_Check_Magic(std::string const &name); - TTF_Font_ptr TTF_OpenFont_Magic(std::string const &name, int fsize); + TTF_Font_ptr TTF_OpenFont_Magic(std::string const &name, int fsize, long index); TTF_Font_ptr m_font; }; @@ -83,7 +83,7 @@ bool osd_font_sdl::open(std::string const &font_path, std::string const &_name, std::string const style((std::string::npos != separator) ? name.substr(separator + 1) : std::string()); // first up, try it as a filename - TTF_Font_ptr font = TTF_OpenFont_Magic(family, POINT_SIZE); + TTF_Font_ptr font = TTF_OpenFont_Magic(family, POINT_SIZE, 0); // if no success, try the font path if (!font) @@ -94,7 +94,7 @@ bool osd_font_sdl::open(std::string const &font_path, std::string const &_name, if (file.open(family.c_str()) == osd_file::error::NONE) { std::string full_name = file.fullpath(); - font = TTF_OpenFont_Magic(full_name, POINT_SIZE); + font = TTF_OpenFont_Magic(full_name, POINT_SIZE, 0); if (font) osd_printf_verbose("Found font %s\n", full_name.c_str()); } @@ -191,18 +191,26 @@ bool osd_font_sdl::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::in return bitmap.valid(); } -osd_font_sdl::TTF_Font_ptr osd_font_sdl::TTF_OpenFont_Magic(std::string const &name, int fsize) +osd_font_sdl::TTF_Font_ptr osd_font_sdl::TTF_OpenFont_Magic(std::string const &name, int fsize, long index) { emu_file file(OPEN_FLAG_READ); if (file.open(name.c_str()) == osd_file::error::NONE) { - unsigned char const magic[] = { 0x00, 0x01, 0x00, 0x00, 0x00 }; - unsigned char buffer[sizeof(magic)] = { 0xff, 0xff, 0xff, 0xff, 0xff }; - if ((sizeof(magic) != file.read(buffer, sizeof(magic))) || memcmp(buffer, magic, sizeof(magic))) - return TTF_Font_ptr(nullptr, &TTF_CloseFont); + unsigned char const ttf_magic[] = { 0x00, 0x01, 0x00, 0x00, 0x00 }; + unsigned char const ttc1_magic[] = { 0x74, 0x74, 0x63, 0x66, 0x00, 0x01, 0x00, 0x00 }; + unsigned char const ttc2_magic[] = { 0x74, 0x74, 0x63, 0x66, 0x00, 0x02, 0x00, 0x00 }; + unsigned char buffer[std::max({ sizeof(ttf_magic), sizeof(ttc1_magic), sizeof(ttc2_magic) })]; + auto const bytes_read = file.read(buffer, sizeof(buffer)); file.close(); + + if ((bytes_read >= sizeof(ttf_magic)) && !std::memcmp(buffer, ttf_magic, sizeof(ttf_magic))) + return TTF_Font_ptr(TTF_OpenFont(name.c_str(), POINT_SIZE), &TTF_CloseFont); + + if (((bytes_read >= sizeof(ttc1_magic)) && !std::memcmp(buffer, ttc1_magic, sizeof(ttc1_magic))) || + ((bytes_read >= sizeof(ttc2_magic)) && !std::memcmp(buffer, ttc2_magic, sizeof(ttc2_magic)))) + return TTF_Font_ptr(TTF_OpenFontIndex(name.c_str(), POINT_SIZE, index), &TTF_CloseFont); } - return TTF_Font_ptr(TTF_OpenFont(name.c_str(), POINT_SIZE), &TTF_CloseFont); + return TTF_Font_ptr(nullptr, &TTF_CloseFont); } bool osd_font_sdl::BDF_Check_Magic(std::string const &name) @@ -235,6 +243,7 @@ osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &f FcPatternAddString(pat.get(), FC_FONTFORMAT, (const FcChar8 *)"TrueType"); FcObjectSetAdd(os.get(), FC_FILE); + FcObjectSetAdd(os.get(), FC_INDEX); std::unique_ptr fontset(FcFontList(config, pat.get(), os.get()), &FcFontSetDestroy); for (int i = 0; (i < fontset->nfont) && !font; i++) @@ -244,8 +253,9 @@ osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &f { osd_printf_verbose("Matching font: %s\n", val.u.s); - std::string match_name((const char*)val.u.s); - font = TTF_OpenFont_Magic(match_name, POINT_SIZE); + std::string const match_name((const char*)val.u.s); + long const index = ((FcPatternGet(fontset->fonts[i], FC_INDEX, 0, &val) == FcResultMatch) && (val.type == FcTypeInteger)) ? val.u.i : 0; + font = TTF_OpenFont_Magic(match_name, POINT_SIZE, index); if (font) bakedstyles = true; @@ -253,6 +263,7 @@ osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &f } // didn't get a font above? try again with no baked-in styles + // note that this simply returns the first match for the family name, which could be regular if you're lucky, but it could be bold oblique or something if (!font && !style.empty()) { pat.reset(FcPatternCreate()); @@ -267,8 +278,12 @@ osd_font_sdl::TTF_Font_ptr osd_font_sdl::search_font_config(std::string const &f { osd_printf_verbose("Matching unstyled font: %s\n", val.u.s); - std::string const match_name((const char *)val.u.s); - font = TTF_OpenFont_Magic(match_name, POINT_SIZE); + std::string const match_name((const char*)val.u.s); + long const index = ((FcPatternGet(fontset->fonts[i], FC_INDEX, 0, &val) == FcResultMatch) && (val.type == FcTypeInteger)) ? val.u.i : 0; + font = TTF_OpenFont_Magic(match_name, POINT_SIZE, index); + + if (font) + bakedstyles = false; } } } From d604c8b9d915664f4236bff2fea69926e4795c5f Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 17 Mar 2016 21:31:00 +1100 Subject: [PATCH 39/48] Do single conversion instead of two (nw) --- src/osd/modules/font/font_sdl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osd/modules/font/font_sdl.cpp b/src/osd/modules/font/font_sdl.cpp index 8c24dc60722..bfe3013032e 100644 --- a/src/osd/modules/font/font_sdl.cpp +++ b/src/osd/modules/font/font_sdl.cpp @@ -161,9 +161,9 @@ void osd_font_sdl::close() bool osd_font_sdl::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) { SDL_Color const fcol = { 0xff, 0xff, 0xff }; - std::uint16_t ustr[16]; - ustr[utf16_from_uchar(ustr, ARRAY_LENGTH(ustr), chnum)] = 0; - std::unique_ptr const drawsurf(TTF_RenderUNICODE_Solid(m_font.get(), ustr, fcol), &SDL_FreeSurface); + char ustr[16]; + ustr[utf8_from_uchar(ustr, ARRAY_LENGTH(ustr), chnum)] = '\0'; + std::unique_ptr const drawsurf(TTF_RenderUTF8_Solid(m_font.get(), ustr, fcol), &SDL_FreeSurface); // was nothing returned? if (drawsurf) From 6a3aedad9467430022ac7058cca674ef34082a84 Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 17 Mar 2016 11:35:03 +0100 Subject: [PATCH 40/48] neogeo: unibios 3.2 added --- src/mame/drivers/ng_aes.cpp | 23 +++----------- src/mame/includes/neogeo.h | 63 +++++++++++++++++++------------------ 2 files changed, 37 insertions(+), 49 deletions(-) diff --git a/src/mame/drivers/ng_aes.cpp b/src/mame/drivers/ng_aes.cpp index 994dfbef4e5..42577544f51 100644 --- a/src/mame/drivers/ng_aes.cpp +++ b/src/mame/drivers/ng_aes.cpp @@ -1523,27 +1523,12 @@ MACHINE_CONFIG_END ROM_START( aes ) ROM_REGION16_BE( 0x20000, "mainbios", 0 ) ROM_SYSTEM_BIOS( 0, "asia", "Asia AES" ) - ROM_LOAD16_WORD_SWAP_BIOS( 0, "neo-epo.bin", 0x00000, 0x020000, CRC(d27a71f1) SHA1(1b3b22092f30c4d1b2c15f04d1670eb1e9fbea07) ) /* AES Console (Asia?) Bios */ + ROM_LOAD16_WORD_SWAP_BIOS( 0, "neo-epo.bin", 0x00000, 0x020000, CRC(d27a71f1) SHA1(1b3b22092f30c4d1b2c15f04d1670eb1e9fbea07) ) /* AES Console (Asia?) Bios */ ROM_SYSTEM_BIOS( 1, "japan", "Japan AES" ) - ROM_LOAD16_WORD_SWAP_BIOS( 1, "neo-po.bin", 0x00000, 0x020000, CRC(16d0c132) SHA1(4e4a440cae46f3889d20234aebd7f8d5f522e22c) ) /* AES Console (Japan) Bios */ + ROM_LOAD16_WORD_SWAP_BIOS( 1, "neo-po.bin", 0x00000, 0x020000, CRC(16d0c132) SHA1(4e4a440cae46f3889d20234aebd7f8d5f522e22c) ) /* AES Console (Japan) Bios */ ROM_SYSTEM_BIOS( 2, "devel", "Development System ROM" ) - ROM_LOAD16_WORD_SWAP_BIOS( 2, "neodebug.rom", 0x00000, 0x020000, CRC(698ebb7d) SHA1(081c49aa8cc7dad5939833dc1b18338321ea0a07) ) /* Official debug (development) ROM, for home-use base board */ - ROM_SYSTEM_BIOS( 3, "unibios31", "Universe Bios (Hack, Ver. 3.1)" ) - ROM_LOAD16_WORD_SWAP_BIOS( 3, "uni-bios_3_1.rom", 0x00000, 0x020000, CRC(0c58093f) SHA1(29329a3448c2505e1ff45ffa75e61e9693165153) ) /* Universe Bios v3.1 (hack) */ - ROM_SYSTEM_BIOS( 4, "unibios30", "Universe Bios (Hack, Ver. 3.0)" ) - ROM_LOAD16_WORD_SWAP_BIOS( 4, "uni-bios_3_0.rom", 0x00000, 0x020000, CRC(a97c89a9) SHA1(97a5eff3b119062f10e31ad6f04fe4b90d366e7f) ) /* Universe Bios v3.0 (hack) */ - ROM_SYSTEM_BIOS( 5, "unibios23", "Universe Bios (Hack, Ver. 2.3)" ) - ROM_LOAD16_WORD_SWAP_BIOS( 5, "uni-bios_2_3.rom", 0x00000, 0x020000, CRC(27664eb5) SHA1(5b02900a3ccf3df168bdcfc98458136fd2b92ac0) ) /* Universe Bios v2.3 (hack) */ - ROM_SYSTEM_BIOS( 6, "unibios23o", "Universe Bios (Hack, Ver. 2.3, older?)" ) - ROM_LOAD16_WORD_SWAP_BIOS( 6, "uni-bios_2_3o.rom", 0x00000, 0x020000, CRC(601720ae) SHA1(1b8a72c720cdb5ee3f1d735bbcf447b09204b8d9) ) /* Universe Bios v2.3 (hack) alt version, withdrawn? */ - ROM_SYSTEM_BIOS( 7, "unibios22", "Universe Bios (Hack, Ver. 2.2)" ) - ROM_LOAD16_WORD_SWAP_BIOS( 7, "uni-bios_2_2.rom", 0x00000, 0x020000, CRC(2d50996a) SHA1(5241a4fb0c63b1a23fd1da8efa9c9a9bd3b4279c) ) /* Universe Bios v2.2 (hack) */ - ROM_SYSTEM_BIOS( 8, "unibios21", "Universe Bios (Hack, Ver. 2.1)" ) - ROM_LOAD16_WORD_SWAP_BIOS( 8, "uni-bios_2_1.rom", 0x00000, 0x020000, CRC(8dabf76b) SHA1(c23732c4491d966cf0373c65c83c7a4e88f0082c) ) /* Universe Bios v2.1 (hack) */ - ROM_SYSTEM_BIOS( 9, "unibios20", "Universe Bios (Hack, Ver. 2.0)" ) - ROM_LOAD16_WORD_SWAP_BIOS( 9, "uni-bios_2_0.rom", 0x00000, 0x020000, CRC(0c12c2ad) SHA1(37bcd4d30f3892078b46841d895a6eff16dc921e) ) /* Universe Bios v2.0 (hack) */ - ROM_SYSTEM_BIOS(10, "unibios13", "Universe Bios (Hack, Ver. 1.3)" ) - ROM_LOAD16_WORD_SWAP_BIOS(10, "uni-bios_1_3.rom", 0x00000, 0x020000, CRC(b24b44a0) SHA1(eca8851d30557b97c309a0d9f4a9d20e5b14af4e) ) /* Universe Bios v1.3 (hack) - note: versions older than 1.3 don't support AES hardware */ + ROM_LOAD16_WORD_SWAP_BIOS( 2, "neodebug.rom", 0x00000, 0x020000, CRC(698ebb7d) SHA1(081c49aa8cc7dad5939833dc1b18338321ea0a07) ) /* Official debug (development) ROM, for home-use base board */ + NEOGEO_UNIBIOS(3) ROM_REGION( 0x200000, "maincpu", ROMREGION_ERASEFF ) diff --git a/src/mame/includes/neogeo.h b/src/mame/includes/neogeo.h index da50cb62765..714d9a1c4ee 100644 --- a/src/mame/includes/neogeo.h +++ b/src/mame/includes/neogeo.h @@ -386,6 +386,34 @@ ADDRESS_MAP_EXTERN(neogeo_main_map,16); #define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \ ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(bios+1)) /* Note '+1' */ +#define NEOGEO_UNIBIOS(x) \ + ROM_SYSTEM_BIOS( x+ 0, "unibios32", "Universe Bios (Hack, Ver. 3.2)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( x+ 0, "uni-bios_3_2.rom", 0x00000, 0x020000, CRC(a4e8b9b3) SHA1(c92f18c3f1edda543d264ecd0ea915240e7c8258) ) /* Universe Bios v3.2 (hack) */ \ + ROM_SYSTEM_BIOS( x+ 1, "unibios31", "Universe Bios (Hack, Ver. 3.1)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( x+ 1, "uni-bios_3_1.rom", 0x00000, 0x020000, CRC(0c58093f) SHA1(29329a3448c2505e1ff45ffa75e61e9693165153) ) /* Universe Bios v3.1 (hack) */ \ + ROM_SYSTEM_BIOS( x+ 2, "unibios30", "Universe Bios (Hack, Ver. 3.0)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( x+ 2, "uni-bios_3_0.rom", 0x00000, 0x020000, CRC(a97c89a9) SHA1(97a5eff3b119062f10e31ad6f04fe4b90d366e7f) ) /* Universe Bios v3.0 (hack) */ \ + ROM_SYSTEM_BIOS( x+ 3, "unibios23", "Universe Bios (Hack, Ver. 2.3)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( x+ 3, "uni-bios_2_3.rom", 0x00000, 0x020000, CRC(27664eb5) SHA1(5b02900a3ccf3df168bdcfc98458136fd2b92ac0) ) /* Universe Bios v2.3 (hack) */ \ + ROM_SYSTEM_BIOS( x+ 4, "unibios23o", "Universe Bios (Hack, Ver. 2.3, older?)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( x+ 4, "uni-bios_2_3o.rom", 0x00000, 0x020000, CRC(601720ae) SHA1(1b8a72c720cdb5ee3f1d735bbcf447b09204b8d9) ) /* Universe Bios v2.3 (hack) alt version, withdrawn? */ \ + ROM_SYSTEM_BIOS( x+ 5, "unibios22", "Universe Bios (Hack, Ver. 2.2)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( x+ 5, "uni-bios_2_2.rom", 0x00000, 0x020000, CRC(2d50996a) SHA1(5241a4fb0c63b1a23fd1da8efa9c9a9bd3b4279c) ) /* Universe Bios v2.2 (hack) */ \ + ROM_SYSTEM_BIOS( x+ 6, "unibios21", "Universe Bios (Hack, Ver. 2.1)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( x+ 6, "uni-bios_2_1.rom", 0x00000, 0x020000, CRC(8dabf76b) SHA1(c23732c4491d966cf0373c65c83c7a4e88f0082c) ) /* Universe Bios v2.1 (hack) */ \ + ROM_SYSTEM_BIOS( x+ 7, "unibios20", "Universe Bios (Hack, Ver. 2.0)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( x+ 7, "uni-bios_2_0.rom", 0x00000, 0x020000, CRC(0c12c2ad) SHA1(37bcd4d30f3892078b46841d895a6eff16dc921e) ) /* Universe Bios v2.0 (hack) */ \ + ROM_SYSTEM_BIOS( x+ 8, "unibios13", "Universe Bios (Hack, Ver. 1.3)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( x+ 8, "uni-bios_1_3.rom", 0x00000, 0x020000, CRC(b24b44a0) SHA1(eca8851d30557b97c309a0d9f4a9d20e5b14af4e) ) /* Universe Bios v1.3 (hack) */ \ + ROM_SYSTEM_BIOS( x+ 9, "unibios12", "Universe Bios (Hack, Ver. 1.2)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( x+ 9, "uni-bios_1_2.rom", 0x00000, 0x020000, CRC(4fa698e9) SHA1(682e13ec1c42beaa2d04473967840c88fd52c75a) ) /* Universe Bios v1.2 (hack) */ \ + ROM_SYSTEM_BIOS( x+10, "unibios12o", "Universe Bios (Hack, Ver. 1.2, older)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( x+10, "uni-bios_1_2o.rom", 0x00000, 0x020000, CRC(e19d3ce9) SHA1(af88ef837f44a3af2d7144bb46a37c8512b67770) ) /* Universe Bios v1.2 (hack) alt version */ \ + ROM_SYSTEM_BIOS( x+11, "unibios11", "Universe Bios (Hack, Ver. 1.1)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( x+11, "uni-bios_1_1.rom", 0x00000, 0x020000, CRC(5dda0d84) SHA1(4153d533c02926a2577e49c32657214781ff29b7) ) /* Universe Bios v1.1 (hack) */ \ + ROM_SYSTEM_BIOS( x+12, "unibios10", "Universe Bios (Hack, Ver. 1.0)" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( x+12, "uni-bios_1_0.rom", 0x00000, 0x020000, CRC(0ce453a0) SHA1(3b4c0cd26c176fc6b26c3a2f95143dd478f6abf9) ) /* Universe Bios v1.0 (hack) */ + #define NEOGEO_BIOS \ ROM_REGION16_BE( 0x80000, "mainbios", 0 ) \ ROM_SYSTEM_BIOS( 0, "euro", "Europe MVS (Ver. 2)" ) \ @@ -398,7 +426,7 @@ ADDRESS_MAP_EXTERN(neogeo_main_map,16); ROM_SYSTEM_BIOS( 3, "us-e", "US MVS (Ver. 1)" ) \ ROM_LOAD16_WORD_SWAP_BIOS( 3, "sp-e.sp1", 0x00000, 0x020000, CRC(2723a5b5) SHA1(5dbff7531cf04886cde3ef022fb5ca687573dcb8) ) /* US, 6 Slot (V5?) */ \ ROM_SYSTEM_BIOS( 4, "us-v2", "US MVS (4 slot, Ver 2)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS(4, "v2.bin", 0x00000, 0x020000, CRC(62f021f4) SHA1(62d372269e1b3161c64ae21123655a0a22ffd1bb) ) /* US, 4 slot */ \ + ROM_LOAD16_WORD_SWAP_BIOS( 4, "v2.bin", 0x00000, 0x020000, CRC(62f021f4) SHA1(62d372269e1b3161c64ae21123655a0a22ffd1bb) ) /* US, 4 slot */ \ \ ROM_SYSTEM_BIOS( 5, "asia", "Asia MVS (Ver. 3)" ) \ ROM_LOAD16_WORD_SWAP_BIOS( 5, "asia-s3.rom", 0x00000, 0x020000, CRC(91b64be3) SHA1(720a3e20d26818632aedf2c2fd16c54f213543e1) ) /* Asia */ \ @@ -412,36 +440,11 @@ ADDRESS_MAP_EXTERN(neogeo_main_map,16); ROM_SYSTEM_BIOS( 9, "mv1c", "NEO-MVH MV1C" ) \ ROM_LOAD16_WORD_SWAP_BIOS( 9, "sp-45.sp1", 0x00000, 0x080000, CRC(03cc9f6a) SHA1(cdf1f49e3ff2bac528c21ed28449cf35b7957dc1) ) /* Latest Asia bios */ \ ROM_SYSTEM_BIOS( 10, "japan-j3", "Japan MVS (J3)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS( 10, "japan-j3.bin", 0x00000, 0x020000, CRC(dff6d41f) SHA1(e92910e20092577a4523a6b39d578a71d4de7085) ) /* Latest Japan bios; correct chip label unknown */ \ - ROM_SYSTEM_BIOS(11, "japan-hotel", "Custom Japanese Hotel" ) \ - ROM_LOAD16_WORD_SWAP_BIOS(11, "sp-1v1_3db8c.bin", 0x00000, 0x020000, CRC(162f0ebe) SHA1(fe1c6dd3dfcf97d960065b1bb46c1e11cb7bf271) ) /* 'rare MVS found in japanese hotels' shows v1.3 in test mode */ \ + ROM_LOAD16_WORD_SWAP_BIOS( 10, "japan-j3.bin", 0x00000, 0x020000, CRC(dff6d41f) SHA1(e92910e20092577a4523a6b39d578a71d4de7085) ) /* Latest Japan bios; correct chip label unknown */ \ + ROM_SYSTEM_BIOS( 11, "japan-hotel", "Custom Japanese Hotel" ) \ + ROM_LOAD16_WORD_SWAP_BIOS( 11, "sp-1v1_3db8c.bin", 0x00000, 0x020000, CRC(162f0ebe) SHA1(fe1c6dd3dfcf97d960065b1bb46c1e11cb7bf271) ) /* 'rare MVS found in japanese hotels' shows v1.3 in test mode */ \ \ - ROM_SYSTEM_BIOS(12, "unibios31", "Universe Bios (Hack, Ver. 3.1)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS(12, "uni-bios_3_1.rom", 0x00000, 0x020000, CRC(0c58093f) SHA1(29329a3448c2505e1ff45ffa75e61e9693165153) ) /* Universe Bios v3.1 (hack) */ \ - ROM_SYSTEM_BIOS(13, "unibios30", "Universe Bios (Hack, Ver. 3.0)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS(13, "uni-bios_3_0.rom", 0x00000, 0x020000, CRC(a97c89a9) SHA1(97a5eff3b119062f10e31ad6f04fe4b90d366e7f) ) /* Universe Bios v3.0 (hack) */ \ - ROM_SYSTEM_BIOS(14, "unibios23", "Universe Bios (Hack, Ver. 2.3)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS(14, "uni-bios_2_3.rom", 0x00000, 0x020000, CRC(27664eb5) SHA1(5b02900a3ccf3df168bdcfc98458136fd2b92ac0) ) /* Universe Bios v2.3 (hack) */ \ - ROM_SYSTEM_BIOS(15, "unibios23o", "Universe Bios (Hack, Ver. 2.3, older?)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS(15, "uni-bios_2_3o.rom", 0x00000, 0x020000, CRC(601720ae) SHA1(1b8a72c720cdb5ee3f1d735bbcf447b09204b8d9) ) /* Universe Bios v2.3 (hack) alt version, withdrawn? */ \ - ROM_SYSTEM_BIOS(16, "unibios22", "Universe Bios (Hack, Ver. 2.2)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS(16, "uni-bios_2_2.rom", 0x00000, 0x020000, CRC(2d50996a) SHA1(5241a4fb0c63b1a23fd1da8efa9c9a9bd3b4279c) ) /* Universe Bios v2.2 (hack) */ \ - ROM_SYSTEM_BIOS(17, "unibios21", "Universe Bios (Hack, Ver. 2.1)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS(17, "uni-bios_2_1.rom", 0x00000, 0x020000, CRC(8dabf76b) SHA1(c23732c4491d966cf0373c65c83c7a4e88f0082c) ) /* Universe Bios v2.1 (hack) */ \ - ROM_SYSTEM_BIOS(18, "unibios20", "Universe Bios (Hack, Ver. 2.0)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS(18, "uni-bios_2_0.rom", 0x00000, 0x020000, CRC(0c12c2ad) SHA1(37bcd4d30f3892078b46841d895a6eff16dc921e) ) /* Universe Bios v2.0 (hack) */ \ - ROM_SYSTEM_BIOS(19, "unibios13", "Universe Bios (Hack, Ver. 1.3)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS(19, "uni-bios_1_3.rom", 0x00000, 0x020000, CRC(b24b44a0) SHA1(eca8851d30557b97c309a0d9f4a9d20e5b14af4e) ) /* Universe Bios v1.3 (hack) */ \ - ROM_SYSTEM_BIOS(20, "unibios12", "Universe Bios (Hack, Ver. 1.2)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS(20, "uni-bios_1_2.rom", 0x00000, 0x020000, CRC(4fa698e9) SHA1(682e13ec1c42beaa2d04473967840c88fd52c75a) ) /* Universe Bios v1.2 (hack) */ \ - ROM_SYSTEM_BIOS(21, "unibios12o", "Universe Bios (Hack, Ver. 1.2, older)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS(21, "uni-bios_1_2o.rom", 0x00000, 0x020000, CRC(e19d3ce9) SHA1(af88ef837f44a3af2d7144bb46a37c8512b67770) ) /* Universe Bios v1.2 (hack) alt version */ \ - ROM_SYSTEM_BIOS(22, "unibios11", "Universe Bios (Hack, Ver. 1.1)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS(22, "uni-bios_1_1.rom", 0x00000, 0x020000, CRC(5dda0d84) SHA1(4153d533c02926a2577e49c32657214781ff29b7) ) /* Universe Bios v1.1 (hack) */ \ - ROM_SYSTEM_BIOS(23, "unibios10", "Universe Bios (Hack, Ver. 1.0)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS(23, "uni-bios_1_0.rom", 0x00000, 0x020000, CRC(0ce453a0) SHA1(3b4c0cd26c176fc6b26c3a2f95143dd478f6abf9) ) /* Universe Bios v1.0 (hack) */ - - + NEOGEO_UNIBIOS(12) #define NEO_BIOS_AUDIO_64K(name, hash) \ From 28d4ceee068dd838850a9d2b586be1aeafe745c9 Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 17 Mar 2016 12:06:54 +0100 Subject: [PATCH 41/48] Neo-Geo updates: [JacKc] * added correct roms labels and locations for ASOII and Burning Fight early prototypes * added roms location for last Resort prototype * marked alpham2p AES VERSION * marked burningfp AES VERSION * marked lresortp MVS VERSION --- src/mame/drivers/neogeo_noslot.cpp | 102 +++++++++++++++-------------- 1 file changed, 52 insertions(+), 50 deletions(-) diff --git a/src/mame/drivers/neogeo_noslot.cpp b/src/mame/drivers/neogeo_noslot.cpp index f3f79953c03..1a7a3c53c4c 100644 --- a/src/mame/drivers/neogeo_noslot.cpp +++ b/src/mame/drivers/neogeo_noslot.cpp @@ -707,33 +707,33 @@ ROM_START( alpham2 ) /* MVS AND AES VERSION */ ROM_LOAD16_BYTE( "007-c4.c4", 0x200001, 0x080000, CRC(7d588349) SHA1(a5ed789d7bbc25be5c5b2d99883b64d379c103a2) ) /* Plane 2,3 */ /* TC534200 */ ROM_END -ROM_START( alpham2p ) /* early prototype - all roms were hand labeled with CRCs, dumps verified against them */ +ROM_START( alpham2p ) /* early prototype - all roms were hand labeled with CRCs, dumps verified against them */ /* AES VERSION*/ ROM_REGION( 0x100000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "proto_007-p1.p1", 0x000001, 0x080000, CRC(c763e52a) SHA1(b24acbac255c5ee1a2e92e77cdde6620a24081cf) ) - ROM_LOAD16_BYTE( "proto_007-p2.p2", 0x000000, 0x080000, CRC(7a0b435c) SHA1(40e6f42a92001d9f4e51898dd7489da143b6b74b) ) + ROM_LOAD16_BYTE( "007_p1_faac.p1", 0x000001, 0x080000, CRC(c763e52a) SHA1(b24acbac255c5ee1a2e92e77cdde6620a24081cf) ) + ROM_LOAD16_BYTE( "007_p2_1813.p2", 0x000000, 0x080000, CRC(7a0b435c) SHA1(40e6f42a92001d9f4e51898dd7489da143b6b74b) ) - NEO_SFIX_128K( "proto_007-s1.s1", CRC(efc9ae2e) SHA1(a594826b0082fe5a13191673e8d9aa42517230f5) ) + NEO_SFIX_128K( "007_s1_36f1.s1", CRC(efc9ae2e) SHA1(a594826b0082fe5a13191673e8d9aa42517230f5) ) - NEO_BIOS_AUDIO_128K( "proto_007-m1.m1", CRC(5976b464) SHA1(ec824567ecc3579f6d86c9d9385710cbaeef16a3) ) + NEO_BIOS_AUDIO_128K( "007_m1_9384.m1", CRC(5976b464) SHA1(ec824567ecc3579f6d86c9d9385710cbaeef16a3) ) ROM_REGION( 0x200000, "ymsnd", 0 ) - ROM_LOAD( "proto_007-v11.v11", 0x000000, 0x080000, CRC(18eaa9e1) SHA1(85c94d8660f8a32e4ca8e015f0bd704208482d68) ) - ROM_LOAD( "proto_007-v12.v12", 0x080000, 0x080000, CRC(2487d495) SHA1(49af3c4dc6a38c5158d3641fd8f9a40041b42aa6) ) - ROM_LOAD( "proto_007-v13.v13", 0x100000, 0x080000, CRC(25e60f25) SHA1(d06b0df872372de38fcf90187195070ac5f8c651) ) - ROM_LOAD( "proto_007-v21.v21", 0x180000, 0x080000, CRC(ac44b75a) SHA1(7399a05cd4e2c7ecde4a7323d3e189255afe5fc2) ) + ROM_LOAD( "007_v11_1bb4.v11", 0x000000, 0x080000, CRC(18eaa9e1) SHA1(85c94d8660f8a32e4ca8e015f0bd704208482d68) ) + ROM_LOAD( "007_v12_c8e8.v12", 0x080000, 0x080000, CRC(2487d495) SHA1(49af3c4dc6a38c5158d3641fd8f9a40041b42aa6) ) + ROM_LOAD( "007_v13_09fa.v13", 0x100000, 0x080000, CRC(25e60f25) SHA1(d06b0df872372de38fcf90187195070ac5f8c651) ) + ROM_LOAD( "007_v21_28c2.v21", 0x180000, 0x080000, CRC(ac44b75a) SHA1(7399a05cd4e2c7ecde4a7323d3e189255afe5fc2) ) ROM_REGION( 0x080000, "ymsnd.deltat", 0 ) ROM_COPY( "ymsnd", 0x180000, 0x00000, 0x80000 ) ROM_REGION( 0x400000, "sprites", 0 ) // note, ROM_LOAD32_BYTE - ROM_LOAD32_BYTE( "proto_007-c1.c1", 0x000000, 0x80000, CRC(24841639) SHA1(fcc2a349121dad86ffefc44b9f0e8ba616ce0d30) ) /* Plane 0 */ - ROM_LOAD32_BYTE( "proto_007-c2.c2", 0x000002, 0x80000, CRC(912763ab) SHA1(cedf26d7d85ad140399ee62813c71f35e65498d6) ) /* Plane 2 */ - ROM_LOAD32_BYTE( "proto_007-c3.c3", 0x000001, 0x80000, CRC(0743bde2) SHA1(0d13ad6333909ad3cf10f9ac360f9abf191318de) ) /* Plane 1 */ - ROM_LOAD32_BYTE( "proto_007-c4.c4", 0x000003, 0x80000, CRC(61240212) SHA1(dee36f6604adaeb96e0d761a7256241c066b1cd2) ) /* Plane 3 */ - ROM_LOAD32_BYTE( "proto_007-c5.c5", 0x200000, 0x80000, CRC(cf9f4c53) SHA1(f979c85f83d9f76e554c2617f85f6d4efca6799c) ) /* Plane 0 */ - ROM_LOAD32_BYTE( "proto_007-c6.c6", 0x200002, 0x80000, CRC(3d903b19) SHA1(001a8c762336b855fe1df69fe2e605d30a3f00a1) ) /* Plane 2 */ - ROM_LOAD32_BYTE( "proto_007-c7.c7", 0x200001, 0x80000, CRC(e41e3875) SHA1(730aceb8a66cb33d0194b096568f053ad7dc000a) ) /* Plane 1 */ - ROM_LOAD32_BYTE( "proto_007-c8.c8", 0x200003, 0x80000, CRC(4483e2cf) SHA1(47c3364f5c36ae9dc3a49fe37ca60bcee0e73314) ) /* Plane 3 */ + ROM_LOAD32_BYTE( "007_c1_210e.c11", 0x000000, 0x80000, CRC(24841639) SHA1(fcc2a349121dad86ffefc44b9f0e8ba616ce0d30) ) /* Plane 0 */ + ROM_LOAD32_BYTE( "007-c2_29ae.c12", 0x000002, 0x80000, CRC(912763ab) SHA1(cedf26d7d85ad140399ee62813c71f35e65498d6) ) /* Plane 2 */ + ROM_LOAD32_BYTE( "007_c3_c873.c13", 0x000001, 0x80000, CRC(0743bde2) SHA1(0d13ad6333909ad3cf10f9ac360f9abf191318de) ) /* Plane 1 */ + ROM_LOAD32_BYTE( "007_c4_2462.c14", 0x000003, 0x80000, CRC(61240212) SHA1(dee36f6604adaeb96e0d761a7256241c066b1cd2) ) /* Plane 3 */ + ROM_LOAD32_BYTE( "007_c5_5f16.c15", 0x200000, 0x80000, CRC(cf9f4c53) SHA1(f979c85f83d9f76e554c2617f85f6d4efca6799c) ) /* Plane 0 */ + ROM_LOAD32_BYTE( "007-c6_8abc.c16", 0x200002, 0x80000, CRC(3d903b19) SHA1(001a8c762336b855fe1df69fe2e605d30a3f00a1) ) /* Plane 2 */ + ROM_LOAD32_BYTE( "007_c7_c983.c17", 0x200001, 0x80000, CRC(e41e3875) SHA1(730aceb8a66cb33d0194b096568f053ad7dc000a) ) /* Plane 1 */ + ROM_LOAD32_BYTE( "007_c8_b599.c18", 0x200003, 0x80000, CRC(4483e2cf) SHA1(47c3364f5c36ae9dc3a49fe37ca60bcee0e73314) ) /* Plane 3 */ ROM_END /**************************************** @@ -1067,32 +1067,33 @@ ROM_START( burningfh ) /* AES VERSION (US) */ ROM_LOAD16_BYTE( "018-c4.c4", 0x200001, 0x100000, CRC(e2e0aff7) SHA1(1c691c092a6e2787de4f433b0eb9252bfdaa7e16) ) /* Plane 2,3 */ /* HN62408 */ ROM_END -ROM_START( burningfp ) /* early prototype - all roms were hand labeled with CRCs, dumps verified against them */ +ROM_START( burningfp ) /* early prototype - all roms were hand labeled with CRCs, dumps verified against them */ /*AES VERSION */ + /* NEO-AEG PROG-EP / NEO-AEG CHA-EP */ ROM_REGION( 0x100000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "proto_018-p1.p1", 0x000001, 0x080000, CRC(5b4032e7) SHA1(55df91dad6f484d3d49c28ab5972700bf71a8662) ) - ROM_LOAD16_BYTE( "proto_018-p2.p2", 0x000000, 0x080000, CRC(78762f68) SHA1(12170fc6efe75cb5d32624033d3d341032c97548) ) + ROM_LOAD16_BYTE( "018_p1_9397.p1", 0x000001, 0x080000, CRC(5b4032e7) SHA1(55df91dad6f484d3d49c28ab5972700bf71a8662) ) + ROM_LOAD16_BYTE( "018_p2_e335.p2", 0x000000, 0x080000, CRC(78762f68) SHA1(12170fc6efe75cb5d32624033d3d341032c97548) ) - NEO_SFIX_128K( "proto_018-s1.s1", CRC(f3d130e8) SHA1(2fdeb93f4bb2a60d391cac2822be41661b1e1795) ) + NEO_SFIX_128K( "018_s1_9899.s1", CRC(f3d130e8) SHA1(2fdeb93f4bb2a60d391cac2822be41661b1e1795) ) - NEO_BIOS_AUDIO_128K( "proto_018-m1.m1", CRC(470dd5d4) SHA1(4291811b4aefe45261a1ae3631b6999fcd74fb3f) ) + NEO_BIOS_AUDIO_128K( "018_m1_4586.m1", CRC(470dd5d4) SHA1(4291811b4aefe45261a1ae3631b6999fcd74fb3f) ) ROM_REGION( 0x200000, "ymsnd", 0 ) - ROM_LOAD( "proto_018-v11.v11", 0x000000, 0x080000, CRC(dc07ea3c) SHA1(c3e71aaec44ead7ddc581565d16b90030e6db5fd) ) - ROM_LOAD( "proto_018-v12.v12", 0x080000, 0x080000, CRC(f1ae637c) SHA1(02a4c7d4a544350a314ab7b26d8c9d3baa8f5778) ) - ROM_LOAD( "proto_018-v21.v21", 0x100000, 0x080000, CRC(9f3b4eda) SHA1(7f516923d04daa483b4b99c9babba66505931a34) ) + ROM_LOAD( "018_v11_56ac.v11", 0x000000, 0x080000, CRC(dc07ea3c) SHA1(c3e71aaec44ead7ddc581565d16b90030e6db5fd) ) + ROM_LOAD( "018_v12_db95.v12", 0x080000, 0x080000, CRC(f1ae637c) SHA1(02a4c7d4a544350a314ab7b26d8c9d3baa8f5778) ) + ROM_LOAD( "018_v21_98dd.v21", 0x100000, 0x080000, CRC(9f3b4eda) SHA1(7f516923d04daa483b4b99c9babba66505931a34) ) ROM_REGION( 0x080000, "ymsnd.deltat", 0 ) ROM_COPY( "ymsnd", 0x100000, 0x00000, 0x80000 ) ROM_REGION( 0x400000, "sprites", 0 ) // note, ROM_LOAD32_BYTE - ROM_LOAD32_BYTE( "proto_018-c1.c1", 0x000000, 0x80000, CRC(6569018b) SHA1(25040e0a9c2b72900100a22a2a41de5f6c339d8a) ) /* Plane 0 */ - ROM_LOAD32_BYTE( "proto_018-c2.c2", 0x000002, 0x80000, CRC(6949b501) SHA1(d8ee48837faff6cc849046ee8757b2b94d440303) ) /* Plane 2 */ - ROM_LOAD32_BYTE( "proto_018-c3.c3", 0x000001, 0x80000, CRC(410f653b) SHA1(ce94667721baa7b2c318fc268e3bb9209671c9f5) ) /* Plane 1 */ - ROM_LOAD32_BYTE( "proto_018-c4.c4", 0x000003, 0x80000, CRC(d43bf2a5) SHA1(c27985d8973611d02570f469a0d8cb4f5b63b614) ) /* Plane 3 */ - ROM_LOAD32_BYTE( "proto_018-c5.c5", 0x200000, 0x80000, CRC(837d09d3) SHA1(d3b06931fca6123604549599544b04529ef34c53) ) /* Plane 0 */ - ROM_LOAD32_BYTE( "proto_018-c6.c6", 0x200002, 0x80000, CRC(5fee51e7) SHA1(835c632fa12a1d5b4104cd80b8f686ac80b314a1) ) /* Plane 2 */ - ROM_LOAD32_BYTE( "proto_018-c7.c7", 0x200001, 0x80000, CRC(0f3f0823) SHA1(ec1d681c1795de43d20f30f85956e2473ec39c95) ) /* Plane 1 */ - ROM_LOAD32_BYTE( "proto_018-c8.c8", 0x200003, 0x80000, CRC(67cc9e34) SHA1(dc72a464c1456a4d2f7b992b416a984fb7885e99) ) /* Plane 3 */ + ROM_LOAD32_BYTE( "018_c1_ba06.c11", 0x000000, 0x80000, CRC(6569018b) SHA1(25040e0a9c2b72900100a22a2a41de5f6c339d8a) ) /* Plane 0 */ + ROM_LOAD32_BYTE( "018_c2_d534.c12", 0x000002, 0x80000, CRC(6949b501) SHA1(d8ee48837faff6cc849046ee8757b2b94d440303) ) /* Plane 2 */ + ROM_LOAD32_BYTE( "018_c3_9d70.c13", 0x000001, 0x80000, CRC(410f653b) SHA1(ce94667721baa7b2c318fc268e3bb9209671c9f5) ) /* Plane 1 */ + ROM_LOAD32_BYTE( "018_c4_bf9d.c14", 0x000003, 0x80000, CRC(d43bf2a5) SHA1(c27985d8973611d02570f469a0d8cb4f5b63b614) ) /* Plane 3 */ + ROM_LOAD32_BYTE( "018_c5_ac9d.c15", 0x200000, 0x80000, CRC(837d09d3) SHA1(d3b06931fca6123604549599544b04529ef34c53) ) /* Plane 0 */ + ROM_LOAD32_BYTE( "018_c6_d2a5.c16", 0x200002, 0x80000, CRC(5fee51e7) SHA1(835c632fa12a1d5b4104cd80b8f686ac80b314a1) ) /* Plane 2 */ + ROM_LOAD32_BYTE( "018_c7_d568.c17", 0x200001, 0x80000, CRC(0f3f0823) SHA1(ec1d681c1795de43d20f30f85956e2473ec39c95) ) /* Plane 1 */ + ROM_LOAD32_BYTE( "018_c8_d256.c18", 0x200003, 0x80000, CRC(67cc9e34) SHA1(dc72a464c1456a4d2f7b992b416a984fb7885e99) ) /* Plane 3 */ ROM_END /**************************************** @@ -1310,32 +1311,33 @@ ROM_START( lresort ) ROM_LOAD16_BYTE( "024-c4.c4", 0x200001, 0x080000, CRC(7382fefb) SHA1(e916dec5bb5462eb9ae9711f08c7388937abb980) ) /* Plane 2,3 */ /* TC534200 */ ROM_END -ROM_START( lresortp ) /* prototype - all roms were hand labeled with CRCs */ +ROM_START( lresortp ) /* prototype - all roms were hand labeled with CRCs */ /* MVS VERSION */ + /* NEO-MVS PROG-EP / NEO-MVS CHA-EPG */ ROM_REGION( 0x100000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "024_p1_5937.bin", 0x000001, 0x080000, CRC(8e6008ee) SHA1(6779663118782207156dc9fa9e24e81e30c6391c) ) - ROM_LOAD16_BYTE( "024_p2_8d37.bin", 0x000000, 0x080000, CRC(6d9ee90f) SHA1(ecd42182988092417bc96db8301ea408e47735f2) ) + ROM_LOAD16_BYTE( "024_p1_5937.podd", 0x000001, 0x080000, CRC(8e6008ee) SHA1(6779663118782207156dc9fa9e24e81e30c6391c) ) + ROM_LOAD16_BYTE( "024_p2_8d37.peven", 0x000000, 0x080000, CRC(6d9ee90f) SHA1(ecd42182988092417bc96db8301ea408e47735f2) ) - NEO_SFIX_128K( "024_s1_22fe.bin", CRC(5cef5cc6) SHA1(9ec305007bdb356e9f8f279beae5e2bcb3f2cf7b) ) + NEO_SFIX_128K( "024_s1_22fe.s1", CRC(5cef5cc6) SHA1(9ec305007bdb356e9f8f279beae5e2bcb3f2cf7b) ) - NEO_BIOS_AUDIO_128K( "024_m1_fc7a.bin", CRC(22122875) SHA1(540c21559163381467679f836cb068adaf526659) ) + NEO_BIOS_AUDIO_128K( "024_m1_fc7a.m1", CRC(22122875) SHA1(540c21559163381467679f836cb068adaf526659) ) ROM_REGION( 0x200000, "ymsnd", 0 ) - ROM_LOAD( "024_v11_b085.bin", 0x000000, 0x080000, CRC(0722da38) SHA1(66a9b463d5277908b3a01c03de82b3de9118f2cb) ) // 024_v11_b085.bin 024-v1.v1 [1/2] IDENTICAL - ROM_LOAD( "024_v12_d3b7.bin", 0x080000, 0x080000, CRC(670ce3ec) SHA1(9004aa85d4a9b0ecf9cf9357b073ed55a98fdb02) ) // 024_v12_d3b7.bin 024-v1.v1 [2/2] IDENTICAL - ROM_LOAD( "024_v13_a31e.bin", 0x100000, 0x080000, CRC(2e39462b) SHA1(b0a9b1a3377bf0369f3020192505c46ca52927d6) ) // 024_v13_a31e.bin 024-v2.v2 [1/2] IDENTICAL - ROM_LOAD( "024_v24_2f0f.bin", 0x180000, 0x080000, CRC(7944754f) SHA1(d42a46c5127c6c62041ebffb0007af8a24abd360) ) // 024_v24_2f0f.bin 024-v2.v2 [2/2] IDENTICAL + ROM_LOAD( "024_v11_b085.v11", 0x000000, 0x080000, CRC(0722da38) SHA1(66a9b463d5277908b3a01c03de82b3de9118f2cb) ) // 024_v11_b085.bin 024-v1.v1 [1/2] IDENTICAL + ROM_LOAD( "024_v12_d3b7.v12", 0x080000, 0x080000, CRC(670ce3ec) SHA1(9004aa85d4a9b0ecf9cf9357b073ed55a98fdb02) ) // 024_v12_d3b7.bin 024-v1.v1 [2/2] IDENTICAL + ROM_LOAD( "024_v13_a31e.v13", 0x100000, 0x080000, CRC(2e39462b) SHA1(b0a9b1a3377bf0369f3020192505c46ca52927d6) ) // 024_v13_a31e.bin 024-v2.v2 [1/2] IDENTICAL + ROM_LOAD( "024_v24_2f0f.v24", 0x180000, 0x080000, CRC(7944754f) SHA1(d42a46c5127c6c62041ebffb0007af8a24abd360) ) // 024_v24_2f0f.bin 024-v2.v2 [2/2] IDENTICAL NO_DELTAT_REGION ROM_REGION( 0x400000, "sprites", 0 ) // note, ROM_LOAD32_BYTE - ROM_LOAD32_BYTE( "024_c1_b764.bin", 0x000000, 0x80000, CRC(677749ec) SHA1(6f94675e037956a380652ab1056e6f1dec605bec) ) /* Plane 0 */ - ROM_LOAD32_BYTE( "024_c2_1951.bin", 0x000002, 0x80000, CRC(104d7b59) SHA1(404e8776ee8df4ca282eb7b747759af8628ddca1) ) /* Plane 2 */ - ROM_LOAD32_BYTE( "024_c3_0f63.bin", 0x000001, 0x80000, CRC(b0965a74) SHA1(e8026dd4f722ccab9c913261d09ab8843ef56a0e) ) /* Plane 1 */ - ROM_LOAD32_BYTE( "024_c4_c5b5.bin", 0x000003, 0x80000, CRC(dcfc3860) SHA1(8443b455ae8de656adab57f3b7e68919f22d3b9d) ) /* Plane 3 */ - ROM_LOAD32_BYTE( "024_c5_dd03.bin", 0x200000, 0x80000, CRC(50322397) SHA1(3308fbe48ad165b9894a52fc3a8d9898bbbc0c0e) ) /* Plane 0 */ - ROM_LOAD32_BYTE( "024_c6_c81a.bin", 0x200002, 0x80000, CRC(c3c93894) SHA1(f23b9d7e2b54d44c96370dde282bdf45cebd9cba) ) /* Plane 2 */ - ROM_LOAD32_BYTE( "024_c7_5edc.bin", 0x200001, 0x80000, CRC(21faf72b) SHA1(00bf257b06180ae6ede57744cea6257b3488d9f0) ) /* Plane 1 */ - ROM_LOAD32_BYTE( "024_c8_0850.bin", 0x200003, 0x80000, CRC(fb57217b) SHA1(607a98da754e8b1dd94a6432b21a36cc38e06a0f) ) /* Plane 3 */ + ROM_LOAD32_BYTE( "024_c1_b764.c1", 0x000000, 0x80000, CRC(677749ec) SHA1(6f94675e037956a380652ab1056e6f1dec605bec) ) /* Plane 0 */ + ROM_LOAD32_BYTE( "024_c2_1951.c2", 0x000002, 0x80000, CRC(104d7b59) SHA1(404e8776ee8df4ca282eb7b747759af8628ddca1) ) /* Plane 2 */ + ROM_LOAD32_BYTE( "024_c3_0f63.c3", 0x000001, 0x80000, CRC(b0965a74) SHA1(e8026dd4f722ccab9c913261d09ab8843ef56a0e) ) /* Plane 1 */ + ROM_LOAD32_BYTE( "024_c4_c5b5.c4", 0x000003, 0x80000, CRC(dcfc3860) SHA1(8443b455ae8de656adab57f3b7e68919f22d3b9d) ) /* Plane 3 */ + ROM_LOAD32_BYTE( "024_c5_dd03.c5", 0x200000, 0x80000, CRC(50322397) SHA1(3308fbe48ad165b9894a52fc3a8d9898bbbc0c0e) ) /* Plane 0 */ + ROM_LOAD32_BYTE( "024_c6_c81a.c6", 0x200002, 0x80000, CRC(c3c93894) SHA1(f23b9d7e2b54d44c96370dde282bdf45cebd9cba) ) /* Plane 2 */ + ROM_LOAD32_BYTE( "024_c7_5edc.c7", 0x200001, 0x80000, CRC(21faf72b) SHA1(00bf257b06180ae6ede57744cea6257b3488d9f0) ) /* Plane 1 */ + ROM_LOAD32_BYTE( "024_c8_0850.c8", 0x200003, 0x80000, CRC(fb57217b) SHA1(607a98da754e8b1dd94a6432b21a36cc38e06a0f) ) /* Plane 3 */ ROM_END From 8a497bb025fcd0ec36666e9dfabd59e16d53cca2 Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 17 Mar 2016 13:06:58 +0100 Subject: [PATCH 42/48] sync neogeo.xml --- hash/neogeo.xml | 121 ++++++++++++++++++++--------- src/mame/drivers/neogeo_noslot.cpp | 15 ++-- 2 files changed, 95 insertions(+), 41 deletions(-) diff --git a/hash/neogeo.xml b/hash/neogeo.xml index 43092413118..bb7a067c9d7 100644 --- a/hash/neogeo.xml +++ b/hash/neogeo.xml @@ -536,6 +536,9 @@ NEO-MVS PROG42G / NEO-MVS CHA42G . NGH-007 NEO-AEG PROG42G / NEO-AEG CHA42G + NEO-AEG PROG42G / NEO-AEG CHA-8M + . prototype + NEO-AEG PROG-EP / NEO-AEG CHA-EP ***************************************--> @@ -580,6 +583,7 @@ + Alpha Mission II / ASO II - Last Guardian (prototype) 1991 SNK @@ -587,33 +591,33 @@ - - + + - + - + - - - + + + - + - - - - - - - - - + + + + + + + + + @@ -1091,6 +1095,8 @@ NEO-MVS PROG42G / NEO-MVS CHA42G . NGH-018 NEO-AEG PROG42G / NEO-AEG CHA42G + . prototype + NEO-AEG PROG-EP / NEO-AEG CHA-EP ***************************************--> @@ -1172,40 +1178,41 @@ + Burning Fight (prototype) 1991 SNK - + - - + + - + - + - - + + - + - - - - - - - - - + + + + + + + + + @@ -1525,6 +1532,9 @@ . NGM-024 NEO-MVS PROG42G-1 / NEO-MVS CHA42G-1 . NGH-024 + + . prototype + NEO-MVS PROG-EP / NEO-MVS CHA-EPG ***************************************--> @@ -1565,6 +1575,45 @@ + + + Last Resort (prototype) + 1992 + SNK + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + King of the Monsters 2 - The Next Thing (prototype) 1992 SNK @@ -2298,7 +2347,7 @@ - + diff --git a/src/mame/drivers/neogeo_noslot.cpp b/src/mame/drivers/neogeo_noslot.cpp index 1a7a3c53c4c..8fc68f9edcf 100644 --- a/src/mame/drivers/neogeo_noslot.cpp +++ b/src/mame/drivers/neogeo_noslot.cpp @@ -683,6 +683,8 @@ ROM_END . NGH-007 NEO-AEG PROG42G / NEO-AEG CHA42G NEO-AEG PROG42G / NEO-AEG CHA-8M + . prototype + NEO-AEG PROG-EP / NEO-AEG CHA-EP ****************************************/ ROM_START( alpham2 ) /* MVS AND AES VERSION */ @@ -727,11 +729,11 @@ ROM_START( alpham2p ) /* early prototype - all roms were hand labeled with CRCs, ROM_REGION( 0x400000, "sprites", 0 ) // note, ROM_LOAD32_BYTE ROM_LOAD32_BYTE( "007_c1_210e.c11", 0x000000, 0x80000, CRC(24841639) SHA1(fcc2a349121dad86ffefc44b9f0e8ba616ce0d30) ) /* Plane 0 */ - ROM_LOAD32_BYTE( "007-c2_29ae.c12", 0x000002, 0x80000, CRC(912763ab) SHA1(cedf26d7d85ad140399ee62813c71f35e65498d6) ) /* Plane 2 */ + ROM_LOAD32_BYTE( "007_c2_29ae.c12", 0x000002, 0x80000, CRC(912763ab) SHA1(cedf26d7d85ad140399ee62813c71f35e65498d6) ) /* Plane 2 */ ROM_LOAD32_BYTE( "007_c3_c873.c13", 0x000001, 0x80000, CRC(0743bde2) SHA1(0d13ad6333909ad3cf10f9ac360f9abf191318de) ) /* Plane 1 */ ROM_LOAD32_BYTE( "007_c4_2462.c14", 0x000003, 0x80000, CRC(61240212) SHA1(dee36f6604adaeb96e0d761a7256241c066b1cd2) ) /* Plane 3 */ ROM_LOAD32_BYTE( "007_c5_5f16.c15", 0x200000, 0x80000, CRC(cf9f4c53) SHA1(f979c85f83d9f76e554c2617f85f6d4efca6799c) ) /* Plane 0 */ - ROM_LOAD32_BYTE( "007-c6_8abc.c16", 0x200002, 0x80000, CRC(3d903b19) SHA1(001a8c762336b855fe1df69fe2e605d30a3f00a1) ) /* Plane 2 */ + ROM_LOAD32_BYTE( "007_c6_8abc.c16", 0x200002, 0x80000, CRC(3d903b19) SHA1(001a8c762336b855fe1df69fe2e605d30a3f00a1) ) /* Plane 2 */ ROM_LOAD32_BYTE( "007_c7_c983.c17", 0x200001, 0x80000, CRC(e41e3875) SHA1(730aceb8a66cb33d0194b096568f053ad7dc000a) ) /* Plane 1 */ ROM_LOAD32_BYTE( "007_c8_b599.c18", 0x200003, 0x80000, CRC(4483e2cf) SHA1(47c3364f5c36ae9dc3a49fe37ca60bcee0e73314) ) /* Plane 3 */ ROM_END @@ -1023,6 +1025,8 @@ ROM_END NEO-MVS PROG42G / NEO-MVS CHA42G . NGH-018 NEO-AEG PROG42G / NEO-AEG CHA42G + . prototype + NEO-AEG PROG-EP / NEO-AEG CHA-EP ****************************************/ ROM_START( burningf ) /* MVS AND AES VERSION */ @@ -1067,8 +1071,7 @@ ROM_START( burningfh ) /* AES VERSION (US) */ ROM_LOAD16_BYTE( "018-c4.c4", 0x200001, 0x100000, CRC(e2e0aff7) SHA1(1c691c092a6e2787de4f433b0eb9252bfdaa7e16) ) /* Plane 2,3 */ /* HN62408 */ ROM_END -ROM_START( burningfp ) /* early prototype - all roms were hand labeled with CRCs, dumps verified against them */ /*AES VERSION */ - /* NEO-AEG PROG-EP / NEO-AEG CHA-EP */ +ROM_START( burningfp ) /* early prototype - all roms were hand labeled with CRCs, dumps verified against them */ /* AES VERSION */ ROM_REGION( 0x100000, "maincpu", 0 ) ROM_LOAD16_BYTE( "018_p1_9397.p1", 0x000001, 0x080000, CRC(5b4032e7) SHA1(55df91dad6f484d3d49c28ab5972700bf71a8662) ) ROM_LOAD16_BYTE( "018_p2_e335.p2", 0x000000, 0x080000, CRC(78762f68) SHA1(12170fc6efe75cb5d32624033d3d341032c97548) ) @@ -1288,6 +1291,9 @@ ROM_END . NGM-024 NEO-MVS PROG42G-1 / NEO-MVS CHA42G-1 . NGH-024 + + . prototype + NEO-MVS PROG-EP / NEO-MVS CHA-EPG ****************************************/ ROM_START( lresort ) @@ -1312,7 +1318,6 @@ ROM_START( lresort ) ROM_END ROM_START( lresortp ) /* prototype - all roms were hand labeled with CRCs */ /* MVS VERSION */ - /* NEO-MVS PROG-EP / NEO-MVS CHA-EPG */ ROM_REGION( 0x100000, "maincpu", 0 ) ROM_LOAD16_BYTE( "024_p1_5937.podd", 0x000001, 0x080000, CRC(8e6008ee) SHA1(6779663118782207156dc9fa9e24e81e30c6391c) ) ROM_LOAD16_BYTE( "024_p2_8d37.peven", 0x000000, 0x080000, CRC(6d9ee90f) SHA1(ecd42182988092417bc96db8301ea408e47735f2) ) From ffc2e670b1568b4f866dc61ede29dd51e2ff3d11 Mon Sep 17 00:00:00 2001 From: Katsuhiko Kagami Date: Thu, 17 Mar 2016 21:21:53 +0900 Subject: [PATCH 43/48] Update for Japanese --- language/Japanese/strings.po | 198 +++++++++++++++++++---------------- 1 file changed, 108 insertions(+), 90 deletions(-) diff --git a/language/Japanese/strings.po b/language/Japanese/strings.po index ad06243c659..3c2bf2270ef 100644 --- a/language/Japanese/strings.po +++ b/language/Japanese/strings.po @@ -594,11 +594,11 @@ msgstr "ビデオモード" #: src/emu/ui/dsplmenu.cpp:40 msgid "Hardware Stretch" -msgstr "" +msgstr "ハードウェアによる拡大" #: src/emu/ui/dsplmenu.cpp:41 msgid "Triple Buffering" -msgstr "" +msgstr "トリプルバッファ" #: src/emu/ui/dsplmenu.cpp:42 msgid "HLSL" @@ -614,11 +614,11 @@ msgstr "バイリニアフィルタリング" #: src/emu/ui/dsplmenu.cpp:46 msgid "Bitmap Prescaling" -msgstr "" +msgstr "ビットマッププレスケール" #: src/emu/ui/dsplmenu.cpp:47 msgid "Multi-Threaded Rendering" -msgstr "" +msgstr "マルチスレッド描画" #: src/emu/ui/dsplmenu.cpp:48 msgid "Window Mode" @@ -626,19 +626,19 @@ msgstr "ウィンドウモード" #: src/emu/ui/dsplmenu.cpp:49 msgid "Enforce Aspect Ratio" -msgstr "" +msgstr "アスペクト比を維持する" #: src/emu/ui/dsplmenu.cpp:50 msgid "Start Out Maximized" -msgstr "" +msgstr "開始時に最大化する" #: src/emu/ui/dsplmenu.cpp:51 msgid "Synchronized Refresh" -msgstr "" +msgstr "リフレッシュを同期" #: src/emu/ui/dsplmenu.cpp:52 msgid "Wait Vertical Sync" -msgstr "" +msgstr "V-Syncを待つ" #: src/emu/ui/dsplmenu.cpp:204 src/emu/ui/dsplmenu.cpp:224 #: src/emu/ui/optsmenu.cpp:265 @@ -647,7 +647,7 @@ msgstr "表示オプション" #: src/emu/ui/filesel.cpp:159 msgid "File Already Exists - Override?" -msgstr "" +msgstr "ファイルが存在します-上書きしますか?" #: src/emu/ui/filesel.cpp:161 src/emu/ui/selgame.cpp:1598 #: src/emu/ui/selgame.cpp:1599 src/emu/ui/selgame.cpp:1600 @@ -655,7 +655,7 @@ msgstr "" #: src/emu/ui/selgame.cpp:1603 src/emu/ui/selgame.cpp:1604 #: src/emu/ui/selgame.cpp:1613 msgid "No" -msgstr "" +msgstr "いいえ" #: src/emu/ui/filesel.cpp:162 src/emu/ui/selgame.cpp:1598 #: src/emu/ui/selgame.cpp:1599 src/emu/ui/selgame.cpp:1600 @@ -663,7 +663,7 @@ msgstr "" #: src/emu/ui/selgame.cpp:1603 src/emu/ui/selgame.cpp:1604 #: src/emu/ui/selgame.cpp:1613 msgid "Yes" -msgstr "" +msgstr "はい" #: src/emu/ui/filesel.cpp:271 msgid "New Image Name:" @@ -679,7 +679,7 @@ msgstr "作成" #: src/emu/ui/filesel.cpp:314 msgid "Please enter a file extension too" -msgstr "" +msgstr "ファイルの拡張子を入力してください" #: src/emu/ui/filesel.cpp:502 src/emu/ui/swlist.cpp:65 msgid "[empty slot]" @@ -711,29 +711,31 @@ msgstr "読み取り/書き込み" #: src/emu/ui/filesel.cpp:866 msgid "Read this image, write to another image" -msgstr "" +msgstr "このイメージから読み取り、別のイメージに書き込む" #: src/emu/ui/filesel.cpp:867 msgid "Read this image, write to diff" -msgstr "" +msgstr "このイメージから読み取り、差分(diff)に書き込む" #: src/emu/ui/imgcntrl.cpp:115 msgid "Cannot save over directory" -msgstr "" +msgstr "別のフォルダには保存できません" #: src/emu/ui/imgcntrl.cpp:149 msgid "" "The software selected is missing one or more required ROM or CHD images. " "Please select a different one." msgstr "" +"選択したソフトウェアに必要な1つ以上のROMまたはCHDが不足しています。" +"別の物を選択してください。" #: src/emu/ui/info.cpp:98 msgid "Not supported" -msgstr "" +msgstr "対応していません" #: src/emu/ui/info.cpp:101 msgid "Partially supported" -msgstr "" +msgstr "部分的に対応" #: src/emu/ui/info.cpp:109 msgid "[empty]" @@ -753,7 +755,7 @@ msgstr "ユーザーインターフェイス" #: src/emu/ui/inputmap.cpp:59 msgid "Other Controls" -msgstr "" +msgstr "その他のコントロール" #: src/emu/ui/inputmap.cpp:625 src/emu/ui/miscmenu.cpp:90 #: src/emu/ui/slotopt.cpp:172 @@ -870,7 +872,7 @@ msgstr "お気に入りに追加または削除" #: src/emu/ui/menu.cpp:64 msgid "Export displayed list to file" -msgstr "" +msgstr "表示されているリストをファイルに出力" #: src/emu/ui/menu.cpp:65 msgid "Show DATs view" @@ -936,6 +938,8 @@ msgid "" "Tickets dispensed: %1$d\n" "\n" msgstr "" +"チケット発行: %1$d\n" +"\n" #: src/emu/ui/miscmenu.cpp:256 msgid "Coin %1$c: NA%3$s\n" @@ -952,7 +956,7 @@ msgstr "(ロック)" #: src/emu/ui/miscmenu.cpp:518 msgid "Visible Delay" -msgstr "目に見えるディレイ" +msgstr "表示する長さ" #: src/emu/ui/miscmenu.cpp:557 msgid "Re-select last machine played" @@ -1006,7 +1010,7 @@ msgstr "%s.xmlをuiフォルダーに保存しました。" #: src/emu/ui/miscmenu.cpp:765 msgid "Name: Description:\n" -msgstr "" +msgstr "名前: 詳細:\n" #: src/emu/ui/miscmenu.cpp:777 #, c-format @@ -1015,15 +1019,15 @@ msgstr "%s.txtをuiフォルダーに保存しました。" #: src/emu/ui/miscmenu.cpp:795 msgid "Export XML format (like -listxml)" -msgstr "" +msgstr "XML形式で出力(-listxml同様)" #: src/emu/ui/miscmenu.cpp:796 msgid "Export TXT format (like -listfull)" -msgstr "" +msgstr "TXT形式で出力(-listfull同様)" #: src/emu/ui/miscmenu.cpp:854 msgid "Dummy" -msgstr "" +msgstr "ダミー" #: src/emu/ui/miscmenu.cpp:856 msgid "Save machine configuration" @@ -1043,7 +1047,7 @@ msgstr " ^!カテゴリ" #: src/emu/ui/optsmenu.cpp:254 msgid "^!Setup custom filter" -msgstr "" +msgstr "^!カスタムフィルタを設定する" #: src/emu/ui/optsmenu.cpp:262 msgid "Customize UI" @@ -1128,6 +1132,10 @@ msgid "" "\n" "Press any key (except ESC) to continue." msgstr "" +"選択したマシンに必要な1つ以上のROMまたはCHDが不足しています。" +"別のマシンを選択してください。\n" +"\n" +"進めるには、何かキー(ESC以外)を押してください。" #: src/emu/ui/selgame.cpp:647 src/emu/ui/simpleselgame.cpp:262 msgid "Configure Options" @@ -1140,7 +1148,7 @@ msgstr "マシンの設定" #: src/emu/ui/selgame.cpp:804 #, c-format msgid "%1$s %2$s ( %3$d / %4$d machines (%5$d BIOS) )" -msgstr "" +msgstr "%1$s %2$s ( %3$d / %4$d マシン (%5$d BIOS) )" #: src/emu/ui/selgame.cpp:814 #, c-format @@ -1160,7 +1168,7 @@ msgstr "%1$s検索:%2$s_" #: src/emu/ui/selgame.cpp:884 #, c-format msgid "Romset: %1$-.100s" -msgstr "" +msgstr "ROMセット: %1$-.100s" #: src/emu/ui/selgame.cpp:887 src/emu/ui/selgame.cpp:936 #: src/emu/ui/selsoft.cpp:742 src/emu/ui/selsoft.cpp:792 @@ -1172,77 +1180,77 @@ msgstr "" #: src/emu/ui/selgame.cpp:893 src/emu/ui/selsoft.cpp:748 #, c-format msgid "Driver is clone of: %1$-.100s" -msgstr "" +msgstr "次のクローンのドライバ: %1$-.100s" #: src/emu/ui/selgame.cpp:895 src/emu/ui/selsoft.cpp:750 msgid "Driver is parent" -msgstr "" +msgstr "親セットのドライバ" #: src/emu/ui/selgame.cpp:899 src/emu/ui/selsoft.cpp:754 #: src/emu/ui/simpleselgame.cpp:332 msgid "Overall: NOT WORKING" -msgstr "" +msgstr "概略: 動作不可" #: src/emu/ui/selgame.cpp:901 src/emu/ui/selsoft.cpp:756 #: src/emu/ui/simpleselgame.cpp:334 msgid "Overall: Unemulated Protection" -msgstr "" +msgstr "概略: プロテクトが未エミュレート" #: src/emu/ui/selgame.cpp:903 src/emu/ui/selsoft.cpp:758 #: src/emu/ui/simpleselgame.cpp:336 msgid "Overall: Working" -msgstr "" +msgstr "概略: 動作可" #: src/emu/ui/selgame.cpp:907 src/emu/ui/selsoft.cpp:762 msgid "Graphics: Imperfect, " -msgstr "" +msgstr "グラフィック: 不完全、 " #: src/emu/ui/selgame.cpp:909 src/emu/ui/selsoft.cpp:764 msgid "Graphics: OK, " -msgstr "" +msgstr "グラフィック: 正常、 " #: src/emu/ui/selgame.cpp:912 src/emu/ui/selsoft.cpp:767 msgid "Sound: Unimplemented" -msgstr "サウンド:未実装" +msgstr "サウンド: 未実装" #: src/emu/ui/selgame.cpp:914 src/emu/ui/selsoft.cpp:769 msgid "Sound: Imperfect" -msgstr "" +msgstr "サウンド: 不完全" #: src/emu/ui/selgame.cpp:916 src/emu/ui/selsoft.cpp:771 msgid "Sound: OK" -msgstr "" +msgstr "サウンド: 正常" #: src/emu/ui/selgame.cpp:933 #, c-format msgid "System: %1$-.100s" -msgstr "" +msgstr "システム: %1$-.100s" #: src/emu/ui/selgame.cpp:940 src/emu/ui/selsoft.cpp:796 #, c-format msgid "Software is clone of: %1$-.100s" -msgstr "" +msgstr "次のクローンのソフトウェア: %1$-.100s" #: src/emu/ui/selgame.cpp:942 src/emu/ui/selsoft.cpp:798 msgid "Software is parent" -msgstr "" +msgstr "親セットのソフトウェア" #: src/emu/ui/selgame.cpp:947 src/emu/ui/selsoft.cpp:803 msgid "Supported: No" -msgstr "" +msgstr "対応状況: いいえ" #: src/emu/ui/selgame.cpp:952 src/emu/ui/selsoft.cpp:808 msgid "Supported: Partial" -msgstr "" +msgstr "対応状況: 部分的" #: src/emu/ui/selgame.cpp:957 src/emu/ui/selsoft.cpp:813 msgid "Supported: Yes" -msgstr "" +msgstr "対応状況: はい" #: src/emu/ui/selgame.cpp:962 src/emu/ui/selsoft.cpp:818 #, c-format msgid "romset: %1$-.100s" -msgstr "" +msgstr "ROMセット: %1$-.100s" #: src/emu/ui/selgame.cpp:969 #, c-format @@ -1252,7 +1260,7 @@ msgstr "" #: src/emu/ui/selgame.cpp:1565 #, c-format msgid "Romset: %1$-.100s\n" -msgstr "" +msgstr "ROMセット: %1$-.100s\n" #: src/emu/ui/selgame.cpp:1566 #, c-format @@ -1267,35 +1275,35 @@ msgstr "製造元: %1$-.100s\n" #: src/emu/ui/selgame.cpp:1571 #, c-format msgid "Driver is Clone of: %1$-.100s\n" -msgstr "" +msgstr "次のクローンのドライバ: %1$-.100s\n" #: src/emu/ui/selgame.cpp:1573 msgid "Driver is Parent\n" -msgstr "" +msgstr "親セットのドライバ\n" #: src/emu/ui/selgame.cpp:1576 msgid "Overall: NOT WORKING\n" -msgstr "" +msgstr "概略: 動作不可\n" #: src/emu/ui/selgame.cpp:1578 msgid "Overall: Unemulated Protection\n" -msgstr "" +msgstr "概略: プロテクトが未エミュレート\n" #: src/emu/ui/selgame.cpp:1580 msgid "Overall: Working\n" -msgstr "" +msgstr "概略: 動作可\n" #: src/emu/ui/selgame.cpp:1583 msgid "Graphics: Imperfect Colors\n" -msgstr "" +msgstr "グラフィック: 色が不完全\n" #: src/emu/ui/selgame.cpp:1587 msgid "Graphics: Imperfect\n" -msgstr "" +msgstr "グラフィック: 不完全\n" #: src/emu/ui/selgame.cpp:1589 msgid "Graphics: OK\n" -msgstr "" +msgstr "グラフィック: 正常\n" #: src/emu/ui/selgame.cpp:1592 msgid "Sound: Unimplemented\n" @@ -1303,46 +1311,46 @@ msgstr "サウンド: 未実装\n" #: src/emu/ui/selgame.cpp:1594 msgid "Sound: Imperfect\n" -msgstr "" +msgstr "サウンド: 不完全\n" #: src/emu/ui/selgame.cpp:1596 msgid "Sound: OK\n" -msgstr "" +msgstr "サウンド: 正常\n" #: src/emu/ui/selgame.cpp:1598 #, c-format msgid "Driver is Skeleton: %1$s\n" -msgstr "" +msgstr "スケルトンドライバ: %1$s\n" #: src/emu/ui/selgame.cpp:1599 #, c-format msgid "Game is Mechanical: %1$s\n" -msgstr "" +msgstr "機械仕掛けのゲーム: %1$s\n" #: src/emu/ui/selgame.cpp:1600 #, c-format msgid "Requires Artwork: %1$s\n" -msgstr "" +msgstr "アートワークが必要: %1$s\n" #: src/emu/ui/selgame.cpp:1601 #, c-format msgid "Requires Clickable Artwork: %1$s\n" -msgstr "" +msgstr "クリック可のアートワークが必要: %1$s\n" #: src/emu/ui/selgame.cpp:1602 #, c-format msgid "Support Cocktail: %1$s\n" -msgstr "" +msgstr "カクテルモード対応: %1$s\n" #: src/emu/ui/selgame.cpp:1603 #, c-format msgid "Driver is Bios: %1$s\n" -msgstr "" +msgstr "BIOSドライバ: %1$s\n" #: src/emu/ui/selgame.cpp:1604 #, c-format msgid "Support Save: %1$s\n" -msgstr "" +msgstr "セーブ対応: %1$s\n" #: src/emu/ui/selgame.cpp:1605 #, c-format @@ -1360,33 +1368,35 @@ msgstr "横" #: src/emu/ui/selgame.cpp:1613 #, c-format msgid "Requires CHD: %1$s\n" -msgstr "" +msgstr "CHDが必要: %1$s\n" #: src/emu/ui/selgame.cpp:1626 msgid "Roms Audit Pass: OK\n" -msgstr "" +msgstr "ROM検証結果: 正常\n" #: src/emu/ui/selgame.cpp:1628 msgid "Roms Audit Pass: BAD\n" -msgstr "" +msgstr "ROM検証結果: 異常\n" #: src/emu/ui/selgame.cpp:1631 msgid "Samples Audit Pass: None Needed\n" -msgstr "" +msgstr "サンプル検証結果: 不要\n" #: src/emu/ui/selgame.cpp:1633 msgid "Samples Audit Pass: OK\n" -msgstr "" +msgstr "サンプル検証結果: 正常\n" #: src/emu/ui/selgame.cpp:1635 msgid "Samples Audit Pass: BAD\n" -msgstr "" +msgstr "サンプル検証結果: 異常\n" #: src/emu/ui/selgame.cpp:1638 msgid "" "Roms Audit Pass: Disabled\n" "Samples Audit Pass: Disabled\n" msgstr "" +"ROM検証結果: 無効\n" +"サンプル検証結果: 無効\n" #: src/emu/ui/selgame.cpp:2070 src/emu/ui/selgame.cpp:2231 #: src/emu/ui/selsoft.cpp:1639 @@ -1408,11 +1418,15 @@ msgid "" "\n" "Press any key (except ESC) to continue." msgstr "" +"選択したソフトウェアに必要な1つ以上のファイルが不足しています。" +"別のソフトウェアを選択してください。\n" +"\n" +"進めるには、何かキー(ESC以外)を押してください。" #: src/emu/ui/selsoft.cpp:681 #, c-format msgid "%1$s %2$s ( %3$d / %4$d softwares )" -msgstr "" +msgstr "%1$s %2$s ( %3$d / %4$d ソフトウェア )" #: src/emu/ui/selsoft.cpp:682 #, c-format @@ -1471,15 +1485,19 @@ msgid "" "If this is your first time using %2$s, please see the config.txt file in the " "docs directory for information on configuring %2$s." msgstr "" +"マシンが見つかりません。%1$s.iniファイルで指定したrompathを確認してください。\n" +"\n" +"もし %2$s の利用が初めてなら、%2$s の設定方法についてdocsフォルダの" +"config.txtファイルをご覧ください。" #: src/emu/ui/simpleselgame.cpp:287 #, c-format msgid "Type name or select: %1$s_" -msgstr "" +msgstr "名前を入力もしくは選択: %1$s_" #: src/emu/ui/simpleselgame.cpp:289 msgid "Type name or select: (random)" -msgstr "" +msgstr "名前を入力もしくは選択: (ランダム)" #: src/emu/ui/simpleselgame.cpp:328 #, c-format @@ -1488,11 +1506,11 @@ msgstr "ドライバ:%1$-.100s" #: src/emu/ui/simpleselgame.cpp:340 src/emu/ui/simpleselgame.cpp:347 msgid "Imperfect" -msgstr "" +msgstr "不完全" #: src/emu/ui/simpleselgame.cpp:342 src/emu/ui/simpleselgame.cpp:349 msgid "OK" -msgstr "" +msgstr "正常" #: src/emu/ui/simpleselgame.cpp:345 msgid "Unimplemented" @@ -1525,12 +1543,12 @@ msgstr "【ファイルマネージャ】" #: src/emu/ui/swlist.cpp:235 msgid "Switch Item Ordering" -msgstr "" +msgstr "項目の並び順の切り替え" #: src/emu/ui/swlist.cpp:268 #, c-format msgid "Switched Order: entries now ordered by %s" -msgstr "" +msgstr "並び順を切り替え: 一覧は現在 %s 順" #: src/emu/ui/swlist.cpp:268 msgid "shortname" @@ -1863,7 +1881,7 @@ msgstr "%1$sの音量" #: src/emu/ui/ui.cpp:1999 #, c-format msgid "Overclock CPU %1$s" -msgstr "" +msgstr "CPU %1$sのオーバークロック" #: src/emu/ui/ui.cpp:2019 #, c-format @@ -1888,42 +1906,42 @@ msgstr "%1$sのガンマ" #: src/emu/ui/ui.cpp:2036 #, c-format msgid "%1$s Horiz Stretch" -msgstr "" +msgstr "%1$s 横方向の拡大" #: src/emu/ui/ui.cpp:2039 #, c-format msgid "%1$s Horiz Position" -msgstr "" +msgstr "%1$s 横方向の位置" #: src/emu/ui/ui.cpp:2042 #, c-format msgid "%1$s Vert Stretch" -msgstr "" +msgstr "%1$s 縦方向の拡大" #: src/emu/ui/ui.cpp:2045 #, c-format msgid "%1$s Vert Position" -msgstr "" +msgstr "%1$s 縦方向の位置" #: src/emu/ui/ui.cpp:2063 #, c-format msgid "Laserdisc '%1$s' Horiz Stretch" -msgstr "" +msgstr "レーザーディスク '%1$s' 横方向の拡大" #: src/emu/ui/ui.cpp:2066 #, c-format msgid "Laserdisc '%1$s' Horiz Position" -msgstr "" +msgstr "レーザーディスク '%1$s' 横方向の位置" #: src/emu/ui/ui.cpp:2069 #, c-format msgid "Laserdisc '%1$s' Vert Stretch" -msgstr "" +msgstr "レーザーディスク '%1$s' 縦方向の拡大" #: src/emu/ui/ui.cpp:2072 #, c-format msgid "Laserdisc '%1$s' Vert Position" -msgstr "" +msgstr "レーザーディスク '%1$s' 縦方向の位置" #: src/emu/ui/ui.cpp:2081 msgid "Vector Flicker" @@ -1944,7 +1962,7 @@ msgstr "ビーム強度比重" #: src/emu/ui/ui.cpp:2099 #, c-format msgid "Crosshair Scale %1$s" -msgstr "" +msgstr "照準の大きさ %1$s" #: src/emu/ui/ui.cpp:2099 src/emu/ui/ui.cpp:2102 msgid "X" @@ -1957,7 +1975,7 @@ msgstr "" #: src/emu/ui/ui.cpp:2102 #, c-format msgid "Crosshair Offset %1$s" -msgstr "" +msgstr "照準のオフセット %1$s" #: src/emu/ui/ui.cpp:2121 #, c-format @@ -2005,22 +2023,22 @@ msgstr "画面" #: src/emu/ui/ui.cpp:2544 #, c-format msgid "Crosshair Scale X %1$1.3f" -msgstr "" +msgstr "照準の大きさ X %1$1.3f" #: src/emu/ui/ui.cpp:2544 #, c-format msgid "Crosshair Scale Y %1$1.3f" -msgstr "" +msgstr "照準の大きさ Y %1$1.3f" #: src/emu/ui/ui.cpp:2563 #, c-format msgid "Crosshair Offset X %1$1.3f" -msgstr "" +msgstr "照準のオフセット X %1$1.3f" #: src/emu/ui/ui.cpp:2563 #, c-format msgid "Crosshair Offset Y %1$1.3f" -msgstr "" +msgstr "照準のオフセット Y %1$1.3f" #: src/emu/ui/videoopt.cpp:55 #, c-format From c7492926e62c1233678056b7937382780efea6e6 Mon Sep 17 00:00:00 2001 From: Scott Stone Date: Thu, 17 Mar 2016 08:29:28 -0400 Subject: [PATCH 44/48] Fixed -validate error and assigned new parent for spkrform (nw) --- src/mame/drivers/igs017.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mame/drivers/igs017.cpp b/src/mame/drivers/igs017.cpp index 1d1d439b3fc..8ab7a8711c2 100644 --- a/src/mame/drivers/igs017.cpp +++ b/src/mame/drivers/igs017.cpp @@ -4245,4 +4245,7 @@ GAME( 1998, slqz2, 0, slqz2, slqz2, igs017_state, slqz2, ROT GAME( 1999?, tarzan, 0, iqblocka, iqblocka, igs017_state, tarzan, ROT0, "IGS", "Tarzan (V109C)", MACHINE_NOT_WORKING ) GAME( 1999?, tarzana, tarzan, iqblocka, iqblocka, igs017_state, tarzana, ROT0, "IGS", "Tarzan (V107)", MACHINE_NOT_WORKING ) GAME( 2000?, starzan, 0, starzan, iqblocka, igs017_state, starzan, ROT0, "IGS / G.F. Gioca", "Super Tarzan (Italy, V100I)", MACHINE_NOT_WORKING ) -GAME( ????, spkrform, spk116it, spkrform, spkrform, igs017_state, spkrform, ROT0, "IGS", "Super Poker (v100xD03) / Formosa", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) + +/* Parent spk306us in driver spoker.cpp. Move this set to that driver? */ +GAME( ????, spkrform, spk306us, spkrform, spkrform, igs017_state, spkrform, ROT0, "IGS", "Super Poker (v100xD03) / Formosa", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) + From 0442b2c2f33fc383f43dc608606343b9c27ad73f Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 17 Mar 2016 13:33:52 +0100 Subject: [PATCH 45/48] neogeo.xml: removed duplicated info that was already in but kept in 'MVS ONLY RELEASE' --- hash/neogeo.xml | 178 +++++++++++------------------------------------- 1 file changed, 38 insertions(+), 140 deletions(-) diff --git a/hash/neogeo.xml b/hash/neogeo.xml index bb7a067c9d7..c351061f2aa 100644 --- a/hash/neogeo.xml +++ b/hash/neogeo.xml @@ -30,7 +30,6 @@ ***************************************--> - NAM-1975 (NGM-001)(NGH-001) 1990 SNK @@ -90,7 +89,6 @@ - Baseball Stars Professional (NGM-002) 1990 SNK @@ -141,7 +139,6 @@ - Baseball Stars Professional (NGH-002) 1990 SNK @@ -200,7 +197,6 @@ ***************************************--> - Top Player's Golf (NGM-003)(NGH-003) 1990 SNK @@ -267,7 +263,6 @@ ***************************************--> - Mahjong Kyo Retsuden (NGM-004)(NGH-004) 1990 SNK @@ -322,7 +317,6 @@ ***************************************--> - Magician Lord (NGM-005) 1990 Alpha Denshi Co. @@ -369,7 +363,6 @@ - Magician Lord (NGH-005) 1990 Alpha Denshi Co. @@ -424,7 +417,6 @@ ***************************************--> - Riding Hero (NGM-006)(NGH-006) 1990 SNK @@ -438,7 +430,7 @@ - + @@ -491,7 +483,7 @@ - + @@ -542,7 +534,6 @@ ***************************************--> - Alpha Mission II / ASO II - Last Guardian (NGM-007)(NGH-007) 1991 SNK @@ -583,11 +574,10 @@ - Alpha Mission II / ASO II - Last Guardian (prototype) 1991 SNK - + @@ -642,7 +632,6 @@ - @@ -691,7 +680,6 @@ - @@ -806,7 +794,6 @@ - @@ -869,7 +856,6 @@ - @@ -922,7 +908,6 @@ - @@ -963,7 +948,6 @@ - @@ -1012,7 +996,6 @@ - @@ -1053,7 +1036,6 @@ - @@ -1106,7 +1088,6 @@ - @@ -1145,7 +1126,6 @@ - @@ -1182,10 +1162,9 @@ Burning Fight (prototype) 1991 SNK - + - @@ -1232,7 +1211,6 @@ - @@ -1283,7 +1261,6 @@ - @@ -1328,7 +1305,6 @@ - @@ -1381,7 +1357,6 @@ - @@ -1426,7 +1401,6 @@ - @@ -1473,7 +1447,6 @@ - @@ -1583,7 +1556,6 @@ - @@ -1629,7 +1601,6 @@ - @@ -1681,7 +1652,6 @@ - @@ -1815,7 +1785,6 @@ - @@ -1901,7 +1870,6 @@ - @@ -1940,7 +1908,6 @@ - @@ -2034,7 +2001,6 @@ - @@ -2085,7 +2051,6 @@ - @@ -2137,7 +2102,6 @@ - @@ -2184,7 +2148,6 @@ - @@ -2229,7 +2192,6 @@ - @@ -2282,7 +2244,6 @@ - @@ -2461,7 +2422,6 @@ - @@ -2508,7 +2468,6 @@ - @@ -2560,7 +2519,6 @@ - @@ -2611,7 +2569,6 @@ - @@ -2656,7 +2613,6 @@ - @@ -2709,7 +2665,6 @@ - @@ -2762,7 +2717,6 @@ - @@ -2823,7 +2777,6 @@ - @@ -2874,7 +2827,6 @@ - @@ -2915,7 +2867,6 @@ - @@ -3089,7 +3040,6 @@ - @@ -3133,7 +3083,6 @@ - @@ -3230,7 +3179,6 @@ - @@ -3288,7 +3236,6 @@ - @@ -3338,7 +3285,6 @@ - @@ -3399,7 +3345,6 @@ - @@ -3451,7 +3396,6 @@ - @@ -3498,7 +3442,6 @@ - @@ -3609,9 +3552,9 @@ 1994 Viccom + - @@ -3648,9 +3591,9 @@ 1994 Viccom + - @@ -3700,7 +3643,6 @@ - @@ -3801,7 +3743,6 @@ - @@ -3917,7 +3858,6 @@ - @@ -4065,9 +4005,9 @@ 1994 Face + - @@ -4104,9 +4044,9 @@ 1994 Video System Co. + - @@ -4159,7 +4099,6 @@ - @@ -4210,10 +4149,10 @@ 2001 SNK + - @@ -4272,9 +4211,9 @@ 1994 Eighting / Hudson + - @@ -4317,7 +4256,6 @@ - @@ -4415,9 +4353,9 @@ 1994 NMK + - @@ -4527,7 +4465,6 @@ - @@ -4575,7 +4512,6 @@ - @@ -4764,11 +4700,11 @@ 1994 Taito + - - + @@ -4830,7 +4766,6 @@ - @@ -4882,7 +4817,6 @@ - @@ -4944,9 +4878,9 @@ 1996 Tecmo + - @@ -4993,7 +4927,6 @@ - @@ -5049,7 +4982,6 @@ - @@ -5363,9 +5295,9 @@ 1997 Hudson + - @@ -5468,7 +5400,6 @@ - @@ -5519,7 +5450,6 @@ - @@ -5854,9 +5784,9 @@ 1995 Taito (Visco license) + - @@ -5987,9 +5917,9 @@ 1996 Visco + - @@ -6026,9 +5956,9 @@ 1996 Technos Japan + - @@ -6070,9 +6000,9 @@ 1995 Visco + - @@ -6172,9 +6102,9 @@ 1996 Visco + - @@ -6217,7 +6147,6 @@ - @@ -6540,9 +6469,9 @@ 1996 Saurus + - @@ -6692,7 +6621,6 @@ - @@ -7141,9 +7069,9 @@ 1997 Face + - @@ -7188,7 +7116,6 @@ - @@ -7235,7 +7162,6 @@ - @@ -7382,7 +7308,6 @@ - @@ -7431,7 +7356,6 @@ - @@ -7534,9 +7458,9 @@ 1997 Taito (Visco license) + - @@ -7579,9 +7503,9 @@ 1997 Video System Co. + - @@ -7618,9 +7542,9 @@ 1997 Saurus + - @@ -7666,9 +7590,9 @@ 1997 Saurus + - @@ -7780,7 +7704,6 @@ - @@ -7829,7 +7752,6 @@ - @@ -7986,7 +7908,6 @@ - @@ -8154,7 +8075,6 @@ - @@ -8215,7 +8135,6 @@ - @@ -8311,9 +8230,9 @@ 1998 Visco + - @@ -8415,9 +8334,9 @@ 1999 Visco + - @@ -8454,9 +8373,9 @@ 1999 Taito (SNK license) + - @@ -8555,9 +8474,9 @@ 1999 Visco + - @@ -8660,7 +8579,6 @@ - @@ -8718,7 +8636,6 @@ - @@ -8937,10 +8854,10 @@ 1999 Visco + - @@ -9140,10 +9057,10 @@ 1999 Psikyo + - @@ -9186,10 +9103,10 @@ 1999 Yumekobo + - @@ -9237,7 +9154,6 @@ - @@ -9297,7 +9213,6 @@ - @@ -9362,7 +9277,6 @@ - @@ -9483,10 +9397,10 @@ 2000 Visco + - @@ -9523,10 +9437,10 @@ 2000 Eleven / Gavaking + - @@ -9618,7 +9532,6 @@ - @@ -9675,7 +9588,6 @@ - @@ -9740,7 +9652,6 @@ - @@ -9791,7 +9702,6 @@ - @@ -9850,7 +9760,6 @@ - @@ -9910,7 +9819,6 @@ - @@ -9972,7 +9880,6 @@ - @@ -10029,10 +9936,10 @@ 2003 Aiky / Taito + - @@ -10077,7 +9984,6 @@ - @@ -10191,7 +10097,6 @@ - @@ -10254,7 +10159,6 @@ - @@ -10308,7 +10212,6 @@ - @@ -10370,7 +10273,6 @@ - @@ -10426,7 +10328,6 @@ - @@ -10490,7 +10391,6 @@ - @@ -10531,8 +10431,7 @@ - - + @@ -10575,7 +10474,6 @@ - From 6cd37a0498b9aa7bc4f910ce5992d6ab1b84ef3f Mon Sep 17 00:00:00 2001 From: Brad Hughes Date: Thu, 17 Mar 2016 09:22:11 -0400 Subject: [PATCH 46/48] DirectWrite font enumeration support --- src/osd/modules/font/font_dwrite.cpp | 146 +++++++++++++++++++++------ 1 file changed, 114 insertions(+), 32 deletions(-) diff --git a/src/osd/modules/font/font_dwrite.cpp b/src/osd/modules/font/font_dwrite.cpp index 0271aeaa249..80a8ba3a810 100644 --- a/src/osd/modules/font/font_dwrite.cpp +++ b/src/osd/modules/font/font_dwrite.cpp @@ -14,7 +14,6 @@ #define WIN32_LEAN_AND_MEAN #include -#include #include @@ -25,7 +24,6 @@ #include // Direct2D -#include #include #include @@ -36,11 +34,8 @@ DEFINE_GUID(GUID_WICPixelFormat8bppAlpha, 0xe6cd0116, 0xeeba, 0x4161, 0xaa, 0x85 #include #undef interface -#include "emu.h" #include "strconv.h" #include "corestr.h" -#include "corealloc.h" -#include "fileio.h" #include "winutil.h" using namespace Microsoft::WRL; @@ -72,6 +67,16 @@ static const float POINTS_PER_DIP = (3.0f / 4.0f); #define HR_RET0( CALL ) HR_RET(CALL, 0) #define HR_RET1( CALL ) HR_RET(CALL, 1) +struct osd_deleter +{ + void operator () (void * osd_pointer) const + { + osd_free(osd_pointer); + } +}; + +typedef std::unique_ptr osd_utf8_ptr; + // Typedefs for dynamically loaded functions typedef lazy_loaded_function_p4 d2d_create_factory_fn; typedef lazy_loaded_function_p3 dwrite_create_factory_fn; @@ -201,32 +206,32 @@ public: m_designUnits = designUnits; } - UINT16 DesignUnitsPerEm() + UINT16 DesignUnitsPerEm() const { return m_designUnitsPerEm; } - float EmSizeInDip() + float EmSizeInDip() const { return m_emSizeInDip; } - float DesignUnits() + float DesignUnits() const { return m_designUnits; } - int Dips() + int Dips() const { - return (int)floor((m_designUnits * m_emSizeInDip) / m_designUnitsPerEm); + return static_cast(floor((m_designUnits * m_emSizeInDip) / m_designUnitsPerEm)); } - float Points() + float Points() const { return Dips() * POINTS_PER_DIP; } - FontDimension operator-(const FontDimension &other) + FontDimension operator-(const FontDimension &other) const { if (m_designUnitsPerEm != other.m_designUnitsPerEm || m_emSizeInDip != other.m_emSizeInDip) { @@ -236,7 +241,7 @@ public: return FontDimension(m_designUnitsPerEm, m_emSizeInDip, m_designUnits - other.m_designUnits); } - FontDimension operator+(const FontDimension &other) + FontDimension operator+(const FontDimension &other) const { if (m_designUnitsPerEm != other.m_designUnitsPerEm || m_emSizeInDip != other.m_emSizeInDip) { @@ -267,12 +272,12 @@ public: { } - FontDimension advanceWidth() { return m_advanceWidth; } - FontDimension abcA() { return m_a; } + FontDimension advanceWidth() const { return m_advanceWidth; } + FontDimension abcA() const { return m_a; } // Relationship between advanceWidth and B is ADV = A + B + C so B = ADV - A - C - FontDimension abcB() { return advanceWidth() - abcA() - abcC(); } - FontDimension abcC() { return m_c; } + FontDimension abcB() const { return advanceWidth() - abcA() - abcC(); } + FontDimension abcC() const { return m_c; } }; //------------------------------------------------- @@ -287,7 +292,7 @@ private: float m_emSizeInDip; public: - float EmSizeInDip() + float EmSizeInDip() const { return m_emSizeInDip; } @@ -298,25 +303,25 @@ public: m_emSizeInDip = emSizeInDip; } - FontDimension FromDip(float dip) + FontDimension FromDip(float dip) const { float sizeInDesignUnits = (dip / m_emSizeInDip) * m_designUnitsPerEm; return FontDimension(m_designUnitsPerEm, m_emSizeInDip, sizeInDesignUnits); } - FontDimension FromDesignUnit(float designUnits) + FontDimension FromDesignUnit(float designUnits) const { return FontDimension(m_designUnitsPerEm, m_emSizeInDip, designUnits); } - FontDimension FromPoint(float pointSize) + FontDimension FromPoint(float pointSize) const { float sizeInDip = pointSize * (4.0f / 3.0f); float sizeInDesignUnits = (sizeInDip / m_emSizeInDip) * m_designUnitsPerEm; return FontDimension(m_designUnitsPerEm, m_emSizeInDip, sizeInDesignUnits); } - FontABCWidths CreateAbcWidths(float advanceWidth, float leftSideBearing, float rightSideBearing) + FontABCWidths CreateAbcWidths(float advanceWidth, float leftSideBearing, float rightSideBearing) const { return FontABCWidths( FromDesignUnit(advanceWidth), @@ -341,7 +346,7 @@ private: public: osd_font_dwrite(ComPtr d2dfactory, ComPtr dwriteFactory, ComPtr wicFactory) - : m_d2dfactory(d2dfactory), m_dwriteFactory(dwriteFactory), m_wicFactory(wicFactory) + : m_d2dfactory(d2dfactory), m_dwriteFactory(dwriteFactory), m_wicFactory(wicFactory), m_fontEmHeightInDips(0) { } @@ -373,7 +378,7 @@ public: m_font->GetMetrics(&metrics); m_fontEmHeightInDips = DEFAULT_EM_HEIGHT; - height = (int)round(m_fontEmHeightInDips * DIPS_PER_POINT); + height = static_cast(round(m_fontEmHeightInDips * DIPS_PER_POINT)); return true; } @@ -493,7 +498,7 @@ public: target->Clear(D2D1::ColorF(0.0f, 0.0f, 0.0f, 0.0f)); // now draw the character - DWRITE_GLYPH_RUN run = { 0 }; + DWRITE_GLYPH_RUN run = { nullptr }; DWRITE_GLYPH_OFFSET offsets; offsets.advanceOffset = 0; offsets.ascenderOffset = 0; @@ -528,7 +533,7 @@ public: // Lock the bitmap and get the data pointer WICRect rect = { 0, 0, bmwidth, bmheight }; HR_RET0(wicBitmap->Lock(&rect, WICBitmapLockRead, lock.GetAddressOf())); - HR_RET0(lock->GetDataPointer(&cbData, (BYTE**)&pixels)); + HR_RET0(lock->GetDataPointer(&cbData, static_cast(&pixels))); // determine the actual left of the character for (actbounds.min_x = 0; actbounds.min_x < bmwidth; actbounds.min_x++) @@ -610,9 +615,9 @@ private: // find_font - finds a font, given attributes //------------------------------------------------- - HRESULT find_font(std::wstring familyName, DWRITE_FONT_WEIGHT weight, DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STYLE style, IDWriteFont ** ppfont) + HRESULT find_font(std::wstring familyName, DWRITE_FONT_WEIGHT weight, DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STYLE style, IDWriteFont ** ppfont) const { - HRESULT result = S_OK; + HRESULT result; ComPtr fonts; HR_RETHR(m_dwriteFactory->GetSystemFontCollection(fonts.GetAddressOf())); @@ -695,7 +700,7 @@ public: reinterpret_cast(this->m_d2dfactory.GetAddressOf()))); // Initialize COM - CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); // Create a DirectWrite factory. HR_RET1(m_pfnDWriteCreateFactory( @@ -708,7 +713,7 @@ public: NULL, CLSCTX_INPROC_SERVER, __uuidof(IWICImagingFactory), - (void**)&m_wicFactory)); + static_cast(&m_wicFactory))); osd_printf_verbose("FontProvider: DirectWrite initialized successfully.\n"); return 0; @@ -719,9 +724,86 @@ public: return std::make_unique(m_d2dfactory, m_dwriteFactory, m_wicFactory); } - virtual bool get_font_families(std::string const &font_path, std::vector > &result) override + virtual bool get_font_families(std::string const &font_path, std::vector > &fontresult) override { - return false; + HRESULT result; + ComPtr family; + ComPtr names; + + // For now, we're just enumerating system fonts, if we want to support custom font + // collections, there's more work that neeeds to be done + ComPtr fonts; + HR_RET0(m_dwriteFactory->GetSystemFontCollection(fonts.GetAddressOf())); + + int family_count = fonts->GetFontFamilyCount(); + for (int i = 0; i < family_count; i++) + { + HR_RET0(fonts->GetFontFamily(i, family.ReleaseAndGetAddressOf())); + + HR_RET0(family->GetFamilyNames(names.ReleaseAndGetAddressOf())); + + std::unique_ptr name = nullptr; + HR_RET0(get_localized_familyname(names, name)); + + auto utf8_name = osd_utf8_ptr(utf8_from_wstring(name.get())); + name.reset(); + + // Review: should the config name, be unlocalized? + // maybe the english name? + fontresult.push_back( + make_pair( + std::string(utf8_name.get()), + std::string(utf8_name.get()))); + + utf8_name.reset(); + } + + std::stable_sort(fontresult.begin(), fontresult.end()); + return true; + } + +private: + HRESULT get_family_for_locale(ComPtr family_names, const WCHAR* locale, std::unique_ptr &family_name) const + { + HRESULT result; + UINT32 index; + BOOL exists = false; + + result = family_names->FindLocaleName(locale, &index, &exists); + + // if the above find did not find a match, retry with US English + if (SUCCEEDED(result) && !exists) + family_names->FindLocaleName(L"en-us", &index, &exists); + + // If the specified locale doesn't exist, select the first on the list. + if (!exists) + index = 0; + + // Get the length and allocate our buffer + UINT32 name_length = 0; + HR_RETHR(family_names->GetStringLength(index, &name_length)); + auto name_buffer = std::make_unique(name_length + 1); + + // Get the name + HR_RETHR(family_names->GetString(index, name_buffer.get(), name_length + 1)); + + family_name = std::move(name_buffer); + return S_OK; + } + + HRESULT get_localized_familyname(ComPtr family_names, std::unique_ptr &family_name) const + { + wchar_t localeName[LOCALE_NAME_MAX_LENGTH]; + + // Get the default locale for this user. + int defaultLocaleSuccess = GetUserDefaultLocaleName(localeName, LOCALE_NAME_MAX_LENGTH); + + // If the default locale is returned, find that locale name, otherwise use "en-us". + if (defaultLocaleSuccess) + return get_family_for_locale(family_names, localeName, family_name); + + // If locale can't be determined, fall back to US English + return get_family_for_locale(family_names, L"en-us", family_name); } }; From 8ba95a2fba5e45f774010a53188780f596d99b72 Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 17 Mar 2016 14:39:33 +0100 Subject: [PATCH 47/48] neogeo: don't load unibios 1.2 and older anyway for AES --- src/mame/includes/neogeo.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mame/includes/neogeo.h b/src/mame/includes/neogeo.h index 714d9a1c4ee..2cd9c2efc86 100644 --- a/src/mame/includes/neogeo.h +++ b/src/mame/includes/neogeo.h @@ -365,6 +365,7 @@ ADDRESS_MAP_EXTERN(neogeo_main_map,16); Some may be missing, there have been multiple CRCs reported for the same revision in some cases (the Universe bios has an option for entering / displaying a serial number; these should be noted as such if they're added). + Universe bios prior to version 1.3 was incompatible with AES. The 'japan-hotel' BIOS is a dump of an MVS which could be found in some japanese hotels. it is a custom MVS mobo which uses MVS carts but it hasn't jamma @@ -404,7 +405,8 @@ ADDRESS_MAP_EXTERN(neogeo_main_map,16); ROM_SYSTEM_BIOS( x+ 7, "unibios20", "Universe Bios (Hack, Ver. 2.0)" ) \ ROM_LOAD16_WORD_SWAP_BIOS( x+ 7, "uni-bios_2_0.rom", 0x00000, 0x020000, CRC(0c12c2ad) SHA1(37bcd4d30f3892078b46841d895a6eff16dc921e) ) /* Universe Bios v2.0 (hack) */ \ ROM_SYSTEM_BIOS( x+ 8, "unibios13", "Universe Bios (Hack, Ver. 1.3)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS( x+ 8, "uni-bios_1_3.rom", 0x00000, 0x020000, CRC(b24b44a0) SHA1(eca8851d30557b97c309a0d9f4a9d20e5b14af4e) ) /* Universe Bios v1.3 (hack) */ \ + ROM_LOAD16_WORD_SWAP_BIOS( x+ 8, "uni-bios_1_3.rom", 0x00000, 0x020000, CRC(b24b44a0) SHA1(eca8851d30557b97c309a0d9f4a9d20e5b14af4e) ) /* Universe Bios v1.3 (hack) */ +#define NEOGEO_UNIBIOS_1_2_AND_OLDER(x) \ ROM_SYSTEM_BIOS( x+ 9, "unibios12", "Universe Bios (Hack, Ver. 1.2)" ) \ ROM_LOAD16_WORD_SWAP_BIOS( x+ 9, "uni-bios_1_2.rom", 0x00000, 0x020000, CRC(4fa698e9) SHA1(682e13ec1c42beaa2d04473967840c88fd52c75a) ) /* Universe Bios v1.2 (hack) */ \ ROM_SYSTEM_BIOS( x+10, "unibios12o", "Universe Bios (Hack, Ver. 1.2, older)" ) \ @@ -426,7 +428,7 @@ ADDRESS_MAP_EXTERN(neogeo_main_map,16); ROM_SYSTEM_BIOS( 3, "us-e", "US MVS (Ver. 1)" ) \ ROM_LOAD16_WORD_SWAP_BIOS( 3, "sp-e.sp1", 0x00000, 0x020000, CRC(2723a5b5) SHA1(5dbff7531cf04886cde3ef022fb5ca687573dcb8) ) /* US, 6 Slot (V5?) */ \ ROM_SYSTEM_BIOS( 4, "us-v2", "US MVS (4 slot, Ver 2)" ) \ - ROM_LOAD16_WORD_SWAP_BIOS( 4, "v2.bin", 0x00000, 0x020000, CRC(62f021f4) SHA1(62d372269e1b3161c64ae21123655a0a22ffd1bb) ) /* US, 4 slot */ \ + ROM_LOAD16_WORD_SWAP_BIOS( 4, "v2.bin", 0x00000, 0x020000, CRC(62f021f4) SHA1(62d372269e1b3161c64ae21123655a0a22ffd1bb) ) /* US, 4 slot */ \ \ ROM_SYSTEM_BIOS( 5, "asia", "Asia MVS (Ver. 3)" ) \ ROM_LOAD16_WORD_SWAP_BIOS( 5, "asia-s3.rom", 0x00000, 0x020000, CRC(91b64be3) SHA1(720a3e20d26818632aedf2c2fd16c54f213543e1) ) /* Asia */ \ @@ -444,7 +446,8 @@ ADDRESS_MAP_EXTERN(neogeo_main_map,16); ROM_SYSTEM_BIOS( 11, "japan-hotel", "Custom Japanese Hotel" ) \ ROM_LOAD16_WORD_SWAP_BIOS( 11, "sp-1v1_3db8c.bin", 0x00000, 0x020000, CRC(162f0ebe) SHA1(fe1c6dd3dfcf97d960065b1bb46c1e11cb7bf271) ) /* 'rare MVS found in japanese hotels' shows v1.3 in test mode */ \ \ - NEOGEO_UNIBIOS(12) + NEOGEO_UNIBIOS(12) \ + NEOGEO_UNIBIOS_1_2_AND_OLDER(12) #define NEO_BIOS_AUDIO_64K(name, hash) \ From 78ef0f037617e074692f687d13d111af9855cf2d Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 17 Mar 2016 21:41:21 +0100 Subject: [PATCH 48/48] layouts: added button panel to cnsector and lostreas --- src/mame/drivers/hh_tms1k.cpp | 10 +- src/mame/layout/cnsector.lay | 235 ++++++++++++++++++++++++++++------ src/mame/layout/lostreas.lay | 206 ++++++++++++++++++++++++++++- 3 files changed, 402 insertions(+), 49 deletions(-) diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp index 62bacd72ecd..ea51b449120 100644 --- a/src/mame/drivers/hh_tms1k.cpp +++ b/src/mame/drivers/hh_tms1k.cpp @@ -122,7 +122,7 @@ #include "bigtrak.lh" #include "cnfball.lh" #include "cnfball2.lh" -#include "cnsector.lh" +#include "cnsector.lh" // clickable #include "comp4.lh" // clickable #include "cqback.lh" #include "ebball.lh" @@ -137,7 +137,7 @@ #include "gpoker.lh" #include "h2hbaseb.lh" #include "h2hfootb.lh" -#include "lostreas.lh" +#include "lostreas.lh" // clickable #include "mathmagi.lh" #include "mdndclab.lh" // clickable #include "merlin.lh" // clickable @@ -4748,7 +4748,7 @@ static INPUT_PORTS_START( lostreas ) PORT_START("IN.2") // O2 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DEL) PORT_NAME("Clear") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_DEL) PORT_NAME("Clear") PORT_BIT( 0x04, 0x04, IPT_SPECIAL ) PORT_CONDITION("FAKE", 0x03, NOTEQUALS, 0x00) // air/up PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_V) PORT_NAME("$ Value") @@ -5769,14 +5769,14 @@ CONS( 1978, simon, 0, 0, simon, simon, driver_device, 0, "Mil CONS( 1979, ssimon, 0, 0, ssimon, ssimon, driver_device, 0, "Milton Bradley", "Super Simon", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1979, bigtrak, 0, 0, bigtrak, bigtrak, driver_device, 0, "Milton Bradley", "Big Trak", MACHINE_SUPPORTS_SAVE | MACHINE_MECHANICAL ) // *** -CONS( 1977, cnsector, 0, 0, cnsector, cnsector, driver_device, 0, "Parker Brothers", "Code Name: Sector", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) // *** +CONS( 1977, cnsector, 0, 0, cnsector, cnsector, driver_device, 0, "Parker Brothers", "Code Name: Sector", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_NO_SOUND_HW ) // *** CONS( 1978, merlin, 0, 0, merlin, merlin, driver_device, 0, "Parker Brothers", "Merlin - The Electronic Wizard", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1979, stopthie, 0, 0, stopthief, stopthief, driver_device, 0, "Parker Brothers", "Stop Thief (Electronic Crime Scanner)", MACHINE_SUPPORTS_SAVE ) // *** CONS( 1979, stopthiep, stopthie, 0, stopthief, stopthief, driver_device, 0, "Parker Brothers", "Stop Thief (Electronic Crime Scanner) (patent)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // *** CONS( 1980, bankshot, 0, 0, bankshot, bankshot, driver_device, 0, "Parker Brothers", "Bank Shot - Electronic Pool", MACHINE_SUPPORTS_SAVE ) CONS( 1980, splitsec, 0, 0, splitsec, splitsec, driver_device, 0, "Parker Brothers", "Split Second", MACHINE_SUPPORTS_SAVE ) CONS( 1982, mmerlin, 0, 0, mmerlin, mmerlin, driver_device, 0, "Parker Brothers", "Master Merlin", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1982, lostreas, 0, 0, lostreas, lostreas, driver_device, 0, "Parker Brothers", "Lost Treasure - The Electronic Deep-Sea Diving Game (Electronic Dive-Control Center)", MACHINE_SUPPORTS_SAVE ) // *** +CONS( 1982, lostreas, 0, 0, lostreas, lostreas, driver_device, 0, "Parker Brothers", "Lost Treasure - The Electronic Deep-Sea Diving Game (Electronic Dive-Control Center)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // *** CONS( 1981, tandy12, 0, 0, tandy12, tandy12, driver_device, 0, "Tandy Radio Shack", "Tandy-12: Computerized Arcade", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // some of the minigames: *** diff --git a/src/mame/layout/cnsector.lay b/src/mame/layout/cnsector.lay index 730e02c3d06..8bca9c3ab7a 100644 --- a/src/mame/layout/cnsector.lay +++ b/src/mame/layout/cnsector.lay @@ -5,7 +5,9 @@ - + + + @@ -17,20 +19,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - @@ -54,79 +148,146 @@ + + + + + + + + + + + + + + + + - - - - + - - - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + diff --git a/src/mame/layout/lostreas.lay b/src/mame/layout/lostreas.lay index ac967ce00f2..b837830fd10 100644 --- a/src/mame/layout/lostreas.lay +++ b/src/mame/layout/lostreas.lay @@ -3,16 +3,109 @@ + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -96,6 +189,15 @@ + + + + + + + + + @@ -117,10 +219,12 @@ - + - + + + @@ -152,7 +256,6 @@ - @@ -163,8 +266,16 @@ - - + + + + + + + + + + @@ -177,5 +288,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +