From 22611466308fa621035f0572c5dbf0ed30ee8b8f Mon Sep 17 00:00:00 2001 From: Bavarese Date: Thu, 24 Nov 2016 14:21:53 +0100 Subject: [PATCH 1/9] DEC Rainbow 100: make port 50 readable Make port 50 readable (undocumented) and revert WRITE_MASK change from last commit. Test case: freeware game SCRAM shows bitmapped intro. R-M-W 'synchronization' (which involves reset port $50 of external logic) still needs to be investigated. --- src/mame/drivers/rainbow.cpp | 51 ++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/src/mame/drivers/rainbow.cpp b/src/mame/drivers/rainbow.cpp index aa14bcda1ee..40b29d3c3d1 100644 --- a/src/mame/drivers/rainbow.cpp +++ b/src/mame/drivers/rainbow.cpp @@ -692,11 +692,13 @@ private: // FULL RANGE video levels for 100-B model, taken from page 46 of PDF const uint8_t video_levels[16] = { 255, 217, 201,186, 171, 156, 140, 125, 110, 97, 79, 66, 54, 31, 18, 0 }; + uint8_t m_PORT50; }; // GDC RESET MACRO - used in "machine_reset" & GDC_EXTRA_REGISTER_w ! #define GDC_RESET_MACRO \ +m_PORT50 = 0; \ \ m_GDC_INDIRECT_REGISTER = 0; \ m_GDC_MODE_REGISTER = 0; \ m_GDC_WRITE_MASK = 0; \ @@ -2234,7 +2236,7 @@ WRITE8_MEMBER(rainbow_state::z80_diskcontrol_w) m_floppy = con->get_device(); if (m_floppy) selected_drive = drive; - printf("%i <- SELECTED DRIVE...\n", m_unit); +// printf("%i <- SELECTED DRIVE...\n", m_unit); } if (selected_drive == INVALID_DRIVE) @@ -2766,7 +2768,7 @@ WRITE16_MEMBER(rainbow_state::vram_w) } if(!(m_GDC_MODE_REGISTER & GDC_MODE_VECTOR)) // 0 : (NOT VECTOR MODE) Text Mode and Write Mask Batch - out = (out & m_GDC_WRITE_MASK) | (mem & ~m_GDC_WRITE_MASK); // // M_MASK (1st use) + out = (out & ~m_GDC_WRITE_MASK) | (mem & m_GDC_WRITE_MASK); // // M_MASK (1st use) else out = (out & ~data) | (mem & data); // VECTOR MODE ! @@ -2789,17 +2791,21 @@ READ8_MEMBER(rainbow_state::GDC_EXTRA_REGISTER_r) uint8_t out = 0; switch(offset) { + case 0: + out = m_PORT50; + break; + case 1: - if(m_GDC_INDIRECT_REGISTER & GDC_SELECT_SCROLL_MAP ) // 0x80 - { - // Documentation says it is always incremented, no matter if read or write: - out = m_GDC_SCROLL_BUFFER_PRELOAD[m_GDC_scroll_index++]; // // * READ * SCROLL_MAP ( 256 x 8 ) - m_GDC_scroll_index &= 0xFF; // 0...255 (CPU accesses 256 bytes) - break; - } - else - printf("\n * UNEXPECTED CASE: READ REGISTER 50..55 with INDIRECT_REGISTER $%02x and OFFSET $%02x *", m_GDC_INDIRECT_REGISTER, offset); + if(m_GDC_INDIRECT_REGISTER & GDC_SELECT_SCROLL_MAP ) // 0x80 + { + // Documentation says it is always incremented (read and write): + out = m_GDC_SCROLL_BUFFER_PRELOAD[m_GDC_scroll_index++]; // // * READ * SCROLL_MAP ( 256 x 8 ) + m_GDC_scroll_index &= 0xFF; // 0...255 (CPU accesses 256 bytes) break; + } + else + printf("\n * UNEXPECTED CASE: READ REGISTER 50..55 with INDIRECT_REGISTER $%02x and OFFSET $%02x *", m_GDC_INDIRECT_REGISTER, offset); + break; default: printf("\n * UNHANDLED CASE: READ REGISTER 50..55 with INDIRECT_REGISTER $%02x and OFFSET $%02x *", m_GDC_INDIRECT_REGISTER, offset); @@ -2826,10 +2832,15 @@ WRITE8_MEMBER(rainbow_state::GDC_EXTRA_REGISTER_w) switch(offset) { - case 0: // Mode Register must be reloaded following any write to port 50 (software reset). - // Graphics option software reset. Any write to this port also resynchronizes the - // read/modify/write memory cycles of the Graphics Option to those of the GDC. - GDC_RESET_MACRO + case 0: // Mode register must be reloaded following any write to port 50 (software reset). + // FIXME: "Any write to this port also resynchronizes the + // read/modify/write memory cycles of the Graphics Option to those of the GDC." (?) + if( data & 1 ) // PDF QV069 suggests 1 -> 0 -> 1; most programs just set bit 0. + { + GDC_RESET_MACRO // Graphics option software reset (separate from GDC reset...) + printf("(PC=%x)\n", machine().device("maincpu")->safe_pc()); + } + m_PORT50 = data; break; case 1: // 51h - DATA loaded into register previously written to 53h. @@ -2993,13 +3004,13 @@ WRITE8_MEMBER(rainbow_state::GDC_EXTRA_REGISTER_w) break; // --------- WRITE MASK (2 x 8 = 16 bits) USED IN WORD MODE ONLY ! - // NOTE: there is NO specific order for the WRITE_MASK (according to txt/code samples in PDF)! - // !! NEW: LOW... HI JUXTAPOSITION...!! + // There is no specific order for the WRITE_MASK (according to txt/code samples in DEC's PDF). + // NOTE: LOW <-> HI JUXTAPOSITION! case 4: // 54h Write Mask LOW - m_GDC_WRITE_MASK = ( BITSWAP8(~data, 0, 1, 2, 3, 4, 5, 6, 7) << 8 ) | ( m_GDC_WRITE_MASK & 0x00FF ); + m_GDC_WRITE_MASK = ( BITSWAP8(data, 0, 1, 2, 3, 4, 5, 6, 7) << 8 ) | ( m_GDC_WRITE_MASK & 0x00FF ); break; case 5: // 55h Write Mask HIGH - m_GDC_WRITE_MASK = ( m_GDC_WRITE_MASK & 0xFF00 ) | BITSWAP8(~data, 0, 1, 2, 3, 4, 5, 6, 7); + m_GDC_WRITE_MASK = ( m_GDC_WRITE_MASK & 0xFF00 ) | BITSWAP8(data, 0, 1, 2, 3, 4, 5, 6, 7); break; } } @@ -3060,7 +3071,7 @@ MCFG_VT_VIDEO_RAM_CALLBACK(READ8(rainbow_state, read_video_ram_r)) MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(WRITELINE(rainbow_state, clear_video_interrupt)) // *************************** COLOR GRAPHICS (OPTION) ************************************** -MCFG_DEVICE_ADD("upd7220", UPD7220, XTAL_32MHz / 4) // WAR: 31188000 / 4 TO BE VERIFIED. Duell schematics shows 31.188 (?) Mhz (/ 4 = 7.797 Mhz) +MCFG_DEVICE_ADD("upd7220", UPD7220, 31188000 / 4) // Duell schematics shows a 31.188 Mhz clock (confirmed by RFKA; not in XTAL) MCFG_UPD7220_VSYNC_CALLBACK(WRITELINE(rainbow_state, GDC_vblank_irq)) // "The vsync callback line needs to be below the 7220 DEVICE_ADD line." MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_map) From aee15107876b7ce7f9b298931b4c4710f38a12ee Mon Sep 17 00:00:00 2001 From: Happy Date: Thu, 24 Nov 2016 07:21:22 -0700 Subject: [PATCH 2/9] n64: AI, add delayed carry signal. The AI address register is split into a low half and a high half. A hardware bug allows the carry signal from low to high to persist through a reload of this register. --- src/mame/includes/n64.h | 1 + src/mame/machine/n64.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/mame/includes/n64.h b/src/mame/includes/n64.h index c06938ad3a7..6ad867b2c6f 100644 --- a/src/mame/includes/n64.h +++ b/src/mame/includes/n64.h @@ -189,6 +189,7 @@ private: AUDIO_DMA *ai_fifo_get_top(); void ai_fifo_push(uint32_t address, uint32_t length); void ai_fifo_pop(); + bool ai_delayed_carry; dmadac_sound_device *ai_dac[2]; uint32_t ai_dram_addr; diff --git a/src/mame/machine/n64.cpp b/src/mame/machine/n64.cpp index 17eb1b6f8e2..4043a1594e8 100644 --- a/src/mame/machine/n64.cpp +++ b/src/mame/machine/n64.cpp @@ -170,6 +170,7 @@ void n64_periphs::device_reset() ai_dacrate = 0; ai_bitrate = 0; ai_status = 0; + ai_delayed_carry = false; pi_dma_timer->adjust(attotime::never); pi_rd_len = 0; @@ -1255,6 +1256,9 @@ void n64_periphs::ai_dma() // //fwrite(&ram[current->address/2],current->length,1,audio_dump); + if (ai_delayed_carry) + current->address += 0x2000; + ram = &ram[current->address/2]; //osd_printf_debug("DACDMA: %x for %x bytes\n", current->address, current->length); @@ -1266,6 +1270,11 @@ void n64_periphs::ai_dma() // adjust the timer period = attotime::from_hz(DACRATE_NTSC) * (ai_dacrate + 1) * (current->length / 4); ai_timer->adjust(period); + + if (((current->address + current->length) & 0x1FFF) == 0) + ai_delayed_carry = true; + else + ai_delayed_carry = false; } TIMER_CALLBACK_MEMBER(n64_periphs::ai_timer_callback) @@ -1286,6 +1295,7 @@ void n64_periphs::ai_timer_tick() else { ai_status &= ~0x40000000; + ai_delayed_carry = false; } } From 9252d572189c5880716d0a113804815857757b1a Mon Sep 17 00:00:00 2001 From: Reagan Roush Date: Thu, 24 Nov 2016 10:30:23 -0500 Subject: [PATCH 3/9] zorba: Added software list for floppy disks as well as some documentation to the driver file --- hash/zorba.xml | 869 +++++++++++++++++++++++++++++++++++++ src/mame/drivers/zorba.cpp | 34 +- 2 files changed, 900 insertions(+), 3 deletions(-) create mode 100644 hash/zorba.xml diff --git a/hash/zorba.xml b/hash/zorba.xml new file mode 100644 index 00000000000..0e7355890f6 --- /dev/null +++ b/hash/zorba.xml @@ -0,0 +1,869 @@ + + + + + + + + + Compat (v3.2) + 1985 + Mycroft Labs + + + + + + + + + + 58K CP/M (v2.2, BIOS v1.7A) + 1984? + Telcon + + + + + + + + + + + + + + + + + + + + + 58K CP/M (v2.2, BIOS v1.7) + 1984 + Telcon + + + + + + + + + + + + + + + + + + + + 58K CP/M (v2.2, BIOS v1.6) + 1984 + Telcon + + + + + + + + + + + + + + + 58K CP/M (v2.2, BIOS v1.6, Alt) + 1984 + Telcon + + + + + + + + + + + + + + + + + + + + DataStar (Release 1.41) + 1982 + MicroPro International + + + + + + + + + + DataStar (Release 1.4) + 1982 + MicroPro International + + + + + + + + + + dBase II (v2.41) + 1982 + Ashton-Tate + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Mite (v3.0) + 1985 + Mycroft Labs + + + + + + + + + + WordStar (Release 3.0) and CalcStar (Release 1.45) + 198? + <unknown> + + + + + + + + + + WordStar (Release 3.0) and CalcStar (Release 1.2) + 198? + <unknown> + + + + + + + + + + + Zeus Public Domain Software Disk 1 + 1983 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 2 + 1984 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 3 + 1984 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 4 + 1984 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 5 + 1984 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 6 + 1984 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 7 + 1984 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 8 + 1984 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 9 + 1984 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 10 + 1984 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 11 + 1984 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 12 + 1984 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 13 + 1984 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 14 + 1985 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 15 + 1985 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 16 + 1985 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 17 + 1985 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 18 + 1985 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 19 + 1985 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 20 + 1985 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 21 + 1985 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + Zeus Public Domain Software Disk 22 + 1985 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + Zorba BIOS (v1.8Z) + 1986 + Zorba Equipment Users' Society (Zeus) + + + + + + + + + + + + Co-Power-88 for Telcon Zorba + 1985 + SWP + + + + + + + + + + + CP/M-86 (v1.1) + 1983 + SWP? + + + + + + + + + + + PC-DOS (v3.30) + 1987 + SWP? + + + + + + + + + + + PC-DOS (v2.11) + 1983 + SWP? + + + + + + + + + + + + + + + diff --git a/src/mame/drivers/zorba.cpp b/src/mame/drivers/zorba.cpp index 47a996d9e03..4d5e640cf4f 100644 --- a/src/mame/drivers/zorba.cpp +++ b/src/mame/drivers/zorba.cpp @@ -2,13 +2,15 @@ // copyright-holders:Robbbert /************************************************************************************************************ -Telcon Zorba +Telcon Industries/Modular Micros/Gemini Electronics Zorba +http://www.zorba.z80.de 2013-08-25 Skeleton +2015-02-20 Boots from floppy, is now usable. This was one of the last CP/M-based systems, already out of date when it was released. Because it doesn't use the standard Z80 peripherals, it uses a homebrew interrupt controller to make use - of the Z80's IM2. +of the Z80's IM2. The keyboard is an intelligent serial device like the Kaypro's keyboard. They even have the same plug, and might be swappable. Need a schematic. @@ -17,6 +19,23 @@ Instead of using a daisy chain, the IM2 vectors are calculated by a prom (u77). contents make no sense at all (mostly FF), so the vectors for IRQ0 and IRQ2 are hard-coded. Other IRQ vectors are not used as yet. +Three companies are known to have sold the Zorba over its lifetime: Telcon Industries, Modular Micros +(a subsidiary of Modular Computers (ModComp)), and Gemini Electronics. 7-inch and 9-inch models were +available from Telcon and Modular Micros, while Gemini exclusively sold the 9-inch version. The ROM dumps +currently used in this emulation originate from a Modular Micros Zorba. + +The two versions of the Zorba were sold by Modular Micros were: +- Zorba 7: 7" CRT, 2 410K floppies, 22 lbs, $1595 +- Zorba 2000: 9" CRT, 2 820K floppies, 10M HD optional, 25 lbs, ~$2000 + +The 7-inch version has the screen on the left, the floppy drives on the right, and a Zorba logo on the +far right; on the 9-inch version this arrangement is reversed and the logo is removed. + +The startup screen varies across each company: +- Telcon: "TELCON ZORBA" graphical logo +- Modular Micros: "ZORBA" graphical logo with "MODULAR MICROS, INC." below in normal text +- Gemini: "GEMINI ZORBA" graphical logo + Status: - Boots up, and the keyboard works @@ -27,6 +46,8 @@ ToDo: - Fix the display - Connect the PIT to the UARTs - Replace the ascii keyboard with the real one, if possible +- Dump Telcon and Gemini BIOSes +- Emulate the Co-Power-88 expansion (allows PC-DOS, CP/M-86, etc. to be used) - Probably lots of other things @@ -44,6 +65,7 @@ ToDo: #include "sound/beep.h" #include "machine/keyboard.h" #include "machine/wd_fdc.h" +#include "softlist.h" class zorba_state : public driver_device @@ -410,6 +432,8 @@ static MACHINE_CONFIG_START( zorba, zorba_state ) /* Keyboard */ MCFG_DEVICE_ADD("keyboard", GENERIC_KEYBOARD, 0) MCFG_GENERIC_KEYBOARD_CB(WRITE8(zorba_state, kbd_put)) + + MCFG_SOFTWARE_LIST_ADD("flop_list", "zorba") MACHINE_CONFIG_END ROM_START( zorba ) @@ -428,4 +452,8 @@ ROM_START( zorba ) ROM_LOAD( "74ls288.u77", 0x0040, 0x0020, CRC(946e03b0) SHA1(24240bdd7bdf507a5b51628fb36ad1266fc53a28) ) // suspected bad dump ROM_END -COMP( 1982, zorba, 0, 0, zorba, zorba, zorba_state, zorba, "Telcon Industries", "Zorba", MACHINE_NOT_WORKING ) +COMP( 1984?, zorba, 0, 0, zorba, zorba, zorba_state, zorba, "Modular Micros", "Zorba (Modular Micros)", MACHINE_NOT_WORKING ) + +// Undumped versions (see startup screen notes at top of file) +// COMP( 1983, zorbat, zorba, 0, zorba, zorba, zorba_state, zorba, "Telcon Industries", "Zorba (Telcon Industries)", MACHINE_NOT_WORKING ) +// COMP( 1984, zorbag, zorba, 0, zorba, zorba, zorba_state, zorba, "Gemini Electronics", "Zorba (Gemini Electronics)", MACHINE_NOT_WORKING ) From 361f0a7691f67c513b538754ddb1cf2ab4abed2a Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Fri, 25 Nov 2016 04:09:04 +1100 Subject: [PATCH 4/9] clean up tabulation, fix some things (nw) --- src/devices/cpu/alph8201/8201dasm.cpp | 2 +- src/devices/cpu/alph8201/alph8201.cpp | 34 +++--- src/devices/cpu/alph8201/alph8201.h | 144 +++++++++++++------------- src/devices/video/mc6847.h | 2 +- src/mame/drivers/lordgun.cpp | 2 +- src/mame/video/stic.h | 2 +- src/osd/modules/render/drawd3d.cpp | 2 +- 7 files changed, 94 insertions(+), 94 deletions(-) diff --git a/src/devices/cpu/alph8201/8201dasm.cpp b/src/devices/cpu/alph8201/8201dasm.cpp index 307456f0633..8e5e99ffd37 100644 --- a/src/devices/cpu/alph8201/8201dasm.cpp +++ b/src/devices/cpu/alph8201/8201dasm.cpp @@ -334,7 +334,7 @@ static void InitDasm8201(void) Op[i].type = type; /* 2 byte code ? */ - while (isspace((uint8_t)*p)) p++; + while (isspace(u8(*p))) p++; if( (*p) ) Op[i].type |= 0x10; /* number of param */ diff --git a/src/devices/cpu/alph8201/alph8201.cpp b/src/devices/cpu/alph8201/alph8201.cpp index eb4390e251f..e06b05f39a2 100644 --- a/src/devices/cpu/alph8201/alph8201.cpp +++ b/src/devices/cpu/alph8201/alph8201.cpp @@ -184,7 +184,7 @@ const device_type ALPHA8301L = &device_creator; #define FN(x) &alpha8201_cpu_device::x -alpha8201_cpu_device::alpha8201_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +alpha8201_cpu_device::alpha8201_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : cpu_device(mconfig, ALPHA8201L, "ALPHA-8201L", tag, owner, clock, "alpha8201l", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 8, 10, 0) , m_io_config("io", ENDIANNESS_LITTLE, 8, 6, 0) @@ -193,7 +193,7 @@ alpha8201_cpu_device::alpha8201_cpu_device(const machine_config &mconfig, const } -alpha8201_cpu_device::alpha8201_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) +alpha8201_cpu_device::alpha8201_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 8, 10, 0) , m_io_config("io", ENDIANNESS_LITTLE, 8, 6, 0) @@ -201,7 +201,7 @@ alpha8201_cpu_device::alpha8201_cpu_device(const machine_config &mconfig, device { } -alpha8301_cpu_device::alpha8301_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +alpha8301_cpu_device::alpha8301_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : alpha8201_cpu_device(mconfig, ALPHA8301L, "ALPHA-8301L", tag, owner, clock, "alpha8301l", __FILE__) { m_opmap = opcode_8301; @@ -217,49 +217,49 @@ unsigned alpha8201_cpu_device::M_RDMEM_OPCODE() return retval; } -void alpha8201_cpu_device::M_ADD(uint8_t dat) +void alpha8201_cpu_device::M_ADD(u8 dat) { - uint16_t temp = m_A + dat; + u16 temp = m_A + dat; m_A = temp & 0xff; m_zf = (m_A==0); m_cf = temp>>8; } -void alpha8201_cpu_device::M_ADDB(uint8_t dat) +void alpha8201_cpu_device::M_ADDB(u8 dat) { - uint16_t temp = m_B + dat; + u16 temp = m_B + dat; m_B = temp & 0xff; m_zf = (m_B==0); m_cf = temp>>8; } -void alpha8201_cpu_device::M_SUB(uint8_t dat) +void alpha8201_cpu_device::M_SUB(u8 dat) { m_cf = (m_A>=dat); // m_cf is No Borrow m_A -= dat; m_zf = (m_A==0); } -void alpha8201_cpu_device::M_AND(uint8_t dat) +void alpha8201_cpu_device::M_AND(u8 dat) { m_A &= dat; m_zf = (m_A==0); } -void alpha8201_cpu_device::M_OR(uint8_t dat) +void alpha8201_cpu_device::M_OR(u8 dat) { m_A |= dat; m_zf = (m_A==0); } -void alpha8201_cpu_device::M_XOR(uint8_t dat) +void alpha8201_cpu_device::M_XOR(u8 dat) { m_A ^= dat; m_zf = (m_A==0); m_cf = 0; } -void alpha8201_cpu_device::M_JMP(uint8_t dat) +void alpha8201_cpu_device::M_JMP(u8 dat) { m_pc.b.l = dat; /* update pc page */ @@ -279,8 +279,8 @@ void alpha8201_cpu_device::M_UNDEFINED() void alpha8201_cpu_device::M_UNDEFINED2() { - uint8_t op = M_RDOP(m_pc.w.l-1); - uint8_t imm = M_RDMEM_OPCODE(); + u8 op = M_RDOP(m_pc.w.l-1); + u8 imm = M_RDMEM_OPCODE(); logerror("alpha8201: PC = %03x, Unimplemented opcode = %02x,%02x\n", m_pc.w.l-2, op,imm); #if SHOW_MESSAGE_CONSOLE osd_printf_debug("alpha8201: PC = %03x, Unimplemented opcode = %02x,%02x\n", m_pc.w.l-2, op,imm); @@ -293,7 +293,7 @@ void alpha8201_cpu_device::M_UNDEFINED2() void alpha8201_cpu_device::stop() { - uint8_t pcptr = M_RDMEM(0x001) & 0x1f; + u8 pcptr = M_RDMEM(0x001) & 0x1f; M_WRMEM(pcptr,(M_RDMEM(pcptr)&0xf)+0x08); /* mark entry point ODD to HALT */ m_mb |= 0x08; /* mark internal HALT state */ } @@ -600,7 +600,7 @@ void alpha8201_cpu_device::device_reset() void alpha8201_cpu_device::execute_run() { unsigned opcode; - uint8_t pcptr; + u8 pcptr; if(m_halt) { @@ -688,7 +688,7 @@ void alpha8201_cpu_device::execute_set_input(int inputnum, int state) } -offs_t alpha8201_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) +offs_t alpha8201_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) { extern CPU_DISASSEMBLE( alpha8201 ); return CPU_DISASSEMBLE_NAME(alpha8201)(this, stream, pc, oprom, opram, options); diff --git a/src/devices/cpu/alph8201/alph8201.h b/src/devices/cpu/alph8201/alph8201.h index 2366ba3c474..2f098b4d779 100644 --- a/src/devices/cpu/alph8201/alph8201.h +++ b/src/devices/cpu/alph8201/alph8201.h @@ -20,11 +20,11 @@ cpu/alph8201/ will be removed when the alpha 8304 has been dumped. * * \**************************************************************************/ -#pragma once - #ifndef __ALPH8201_H__ #define __ALPH8201_H__ +#pragma once + enum { ALPHA8201_PC = STATE_GENPC, @@ -50,8 +50,8 @@ class alpha8201_cpu_device : public cpu_device { public: // construction/destruction - alpha8201_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - alpha8201_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); + alpha8201_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + alpha8201_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, const char *shortname, const char *source); protected: // device-level overrides @@ -59,9 +59,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual uint32_t execute_min_cycles() const override { return 1; } - virtual uint32_t execute_max_cycles() const override { return 16; } - virtual uint32_t execute_input_lines() const override { return 1; } + virtual u32 execute_min_cycles() const override { return 1; } + virtual u32 execute_max_cycles() const override { return 16; } + virtual u32 execute_input_lines() const override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -74,25 +74,25 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } - virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; + virtual u32 disasm_min_opcode_bytes() const override { return 1; } + virtual u32 disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) override; - uint8_t M_RDMEM(uint16_t A) { return m_program->read_byte(A); } - void M_WRMEM(uint16_t A,uint8_t V) { m_program->write_byte(A, V); } - uint8_t M_RDOP(uint16_t A) { return m_direct->read_byte(A); } - uint8_t M_RDOP_ARG(uint16_t A) { return m_direct->read_byte(A); } - uint8_t RD_REG(uint8_t x) { return m_RAM[(m_regPtr<<3)+(x)]; } - void WR_REG(uint8_t x, uint8_t d) { m_RAM[(m_regPtr<<3)+(x)]=(d); } + u8 M_RDMEM(u16 A) { return m_program->read_byte(A); } + void M_WRMEM(u16 A, u8 V) { m_program->write_byte(A, V); } + u8 M_RDOP(u16 A) { return m_direct->read_byte(A); } + u8 M_RDOP_ARG(u16 A) { return m_direct->read_byte(A); } + u8 RD_REG(u8 x) { return m_RAM[(m_regPtr<<3)+(x)]; } + void WR_REG(u8 x, u8 d) { m_RAM[(m_regPtr<<3)+(x)]=(d); } unsigned M_RDMEM_OPCODE(); - void M_ADD(uint8_t dat); - void M_ADDB(uint8_t dat); - void M_SUB(uint8_t dat); - void M_AND(uint8_t dat); - void M_OR(uint8_t dat); - void M_XOR(uint8_t dat); - void M_JMP(uint8_t dat); + void M_ADD(u8 dat); + void M_ADDB(u8 dat); + void M_SUB(u8 dat); + void M_AND(u8 dat); + void M_OR(u8 dat); + void M_XOR(u8 dat); + void M_JMP(u8 dat); void M_UNDEFINED(); void M_UNDEFINED2(); @@ -102,10 +102,10 @@ protected: void nop() { } void rora() { m_cf = m_A &1; m_A = (m_A>>1) | (m_A<<7); } void rola() { m_cf = (m_A>>7)&1; m_A = (m_A<<1) | (m_A>>7); } - void inc_b() { M_ADDB(0x02); } - void dec_b() { M_ADDB(0xfe); } - void inc_a() { M_ADD(0x01); } - void dec_a() { M_ADD(0xff); } + void inc_b() { M_ADDB(0x02); } + void dec_b() { M_ADDB(0xfe); } + void inc_a() { M_ADD(0x01); } + void dec_a() { M_ADD(0xff); } void cpl() { m_A ^= 0xff; }; void ld_a_ix0_0() { m_A = M_RDMEM(m_ix0.w.l+0); } @@ -290,26 +290,26 @@ protected: void ld_lp2_n() { m_lp2 = M_RDMEM_OPCODE(); } void ld_b_n() { m_B = M_RDMEM_OPCODE(); } - void djnz_lp0() { uint8_t i=M_RDMEM_OPCODE(); m_lp0--; if (m_lp0 != 0) M_JMP(i); } - void djnz_lp1() { uint8_t i=M_RDMEM_OPCODE(); m_lp1--; if (m_lp1 != 0) M_JMP(i); } - void djnz_lp2() { uint8_t i=M_RDMEM_OPCODE(); m_lp2--; if (m_lp2 != 0) M_JMP(i); } - void jnz() { uint8_t i=M_RDMEM_OPCODE(); if (!m_zf) M_JMP(i); } - void jnc() { uint8_t i=M_RDMEM_OPCODE(); if (!m_cf) M_JMP(i);} - void jz() { uint8_t i=M_RDMEM_OPCODE(); if ( m_zf) M_JMP(i); } - void jc() { uint8_t i=M_RDMEM_OPCODE(); if ( m_cf) M_JMP(i);} - void jmp() { M_JMP(M_RDMEM_OPCODE() ); } + void djnz_lp0() { u8 i=M_RDMEM_OPCODE(); m_lp0--; if (m_lp0 != 0) M_JMP(i); } + void djnz_lp1() { u8 i=M_RDMEM_OPCODE(); m_lp1--; if (m_lp1 != 0) M_JMP(i); } + void djnz_lp2() { u8 i=M_RDMEM_OPCODE(); m_lp2--; if (m_lp2 != 0) M_JMP(i); } + void jnz() { u8 i=M_RDMEM_OPCODE(); if (!m_zf) M_JMP(i); } + void jnc() { u8 i=M_RDMEM_OPCODE(); if (!m_cf) M_JMP(i);} + void jz() { u8 i=M_RDMEM_OPCODE(); if ( m_zf) M_JMP(i); } + void jc() { u8 i=M_RDMEM_OPCODE(); if ( m_cf) M_JMP(i);} + void jmp() { M_JMP(M_RDMEM_OPCODE() ); } void stop(); /* ALPHA 8301 : added instruction */ - void exg_a_ix0() { uint8_t t=m_A; m_A = m_ix0.b.l; m_ix0.b.l = t; } - void exg_a_ix1() { uint8_t t=m_A; m_A = m_ix1.b.l; m_ix1.b.l = t; } - void exg_a_ix2() { uint8_t t=m_A; m_A = m_ix2.b.l; m_ix2.b.l = t; } - void exg_a_lp0() { uint8_t t=m_A; m_A = m_lp0; m_lp0 = t; } - void exg_a_lp1() { uint8_t t=m_A; m_A = m_lp1; m_lp1 = t; } - void exg_a_lp2() { uint8_t t=m_A; m_A = m_lp2; m_lp2 = t; } - void exg_a_b() { uint8_t t=m_A; m_A = m_B; m_B = t; } - void exg_a_rb() { uint8_t t=m_A; m_A = m_regPtr; m_regPtr = t; } + void exg_a_ix0() { u8 t=m_A; m_A = m_ix0.b.l; m_ix0.b.l = t; } + void exg_a_ix1() { u8 t=m_A; m_A = m_ix1.b.l; m_ix1.b.l = t; } + void exg_a_ix2() { u8 t=m_A; m_A = m_ix2.b.l; m_ix2.b.l = t; } + void exg_a_lp0() { u8 t=m_A; m_A = m_lp0; m_lp0 = t; } + void exg_a_lp1() { u8 t=m_A; m_A = m_lp1; m_lp1 = t; } + void exg_a_lp2() { u8 t=m_A; m_A = m_lp2; m_lp2 = t; } + void exg_a_b() { u8 t=m_A; m_A = m_B; m_B = t; } + void exg_a_rb() { u8 t=m_A; m_A = m_regPtr; m_regPtr = t; } void ld_ix0_a() { m_ix0.b.l = m_A; } void ld_ix1_a() { m_ix1.b.l = m_A; } @@ -320,8 +320,8 @@ protected: void ld_b_a() { m_B = m_A; } void ld_rb_a() { m_regPtr = m_A; } - void exg_ix0_ix1() { uint8_t t=m_ix1.b.l; m_ix1.b.l = m_ix0.b.l; m_ix0.b.l = t; } - void exg_ix0_ix2() { uint8_t t=m_ix2.b.l; m_ix2.b.l = m_ix0.b.l; m_ix0.b.l = t; } + void exg_ix0_ix1() { u8 t=m_ix1.b.l; m_ix1.b.l = m_ix0.b.l; m_ix0.b.l = t; } + void exg_ix0_ix2() { u8 t=m_ix2.b.l; m_ix2.b.l = m_ix0.b.l; m_ix0.b.l = t; } void op_d4() { m_A = M_RDMEM( ((m_RAM[(7<<3)+7] & 3) << 8) | M_RDMEM_OPCODE() ); } void op_d5() { M_WRMEM( ((m_RAM[(7<<3)+7] & 3) << 8) | M_RDMEM_OPCODE(), m_A ); } @@ -337,16 +337,16 @@ protected: void op_rep_ld_b_ix0() { do { m_RAM[(m_B>>1)&0x3f] = M_RDMEM(m_ix0.w.l); m_ix0.b.l++; m_B+=2; m_lp0--; } while (m_lp0 != 0); } void ld_rxb_a() { m_RAM[(m_B>>1)&0x3f] = m_A; } void ld_a_rxb() { m_A = m_RAM[(m_B>>1)&0x3f]; } - void cmp_a_rxb() { uint8_t i=m_RAM[(m_B>>1)&0x3f]; m_zf = (m_A==i); m_cf = (m_A>=i); } + void cmp_a_rxb() { u8 i=m_RAM[(m_B>>1)&0x3f]; m_zf = (m_A==i); m_cf = (m_A>=i); } void xor_a_rxb() { M_XOR(m_RAM[(m_B>>1)&0x3f] ); } void add_a_cf() { if (m_cf) inc_a(); } void sub_a_cf() { if (m_cf) dec_a(); } - void tst_a() { m_zf = (m_A==0); } - void clr_a() { m_A = 0; m_zf = (m_A==0); } - void cmp_a_n() { uint8_t i=M_RDMEM_OPCODE(); m_zf = (m_A==i); m_cf = (m_A>=i); } + void tst_a() { m_zf = (m_A==0); } + void clr_a() { m_A = 0; m_zf = (m_A==0); } + void cmp_a_n() { u8 i=M_RDMEM_OPCODE(); m_zf = (m_A==i); m_cf = (m_A>=i); } void xor_a_n() { M_XOR(M_RDMEM_OPCODE() ); } - void call() { uint8_t i=M_RDMEM_OPCODE(); m_retptr.w.l = m_pc.w.l; M_JMP(i); }; + void call() { u8 i=M_RDMEM_OPCODE(); m_retptr.w.l = m_pc.w.l; M_JMP(i); }; void ld_a_ix0_a() { m_A = M_RDMEM(m_ix0.w.l+m_A); } void ret() { m_mb = m_retptr.b.h; M_JMP( m_retptr.b.l ); }; void save_zc() { m_savez = m_zf; m_savec = m_cf; }; @@ -366,27 +366,27 @@ protected: address_space_config m_program_config; address_space_config m_io_config; - uint8_t m_RAM[8*8]; /* internal GP register 8 * 8bank */ + u8 m_RAM[8*8]; /* internal GP register 8 * 8bank */ unsigned m_PREVPC; PAIR m_retptr; /* for 8301, return address of CALL */ PAIR m_pc; /* 2bit+8bit program counter */ - uint8_t m_regPtr; /* RB register base */ - uint8_t m_mb; /* MB memory bank reg. latch after Branch */ - uint8_t m_cf; /* C flag */ - uint8_t m_zf; /* Z flag */ - uint8_t m_savec; /* for 8301, save flags */ - uint8_t m_savez; /* for 8301, save flags */ -// - PAIR m_ix0; /* 8bit memory read index reg. */ - PAIR m_ix1; /* 8bitmemory read index reg. */ - PAIR m_ix2; /* 8bitmemory write index reg. */ - uint8_t m_lp0; /* 8bit loop reg. */ - uint8_t m_lp1; /* 8bit loop reg. */ - uint8_t m_lp2; /* 8bit loop reg. */ - uint8_t m_A; /* 8bit accumulator */ - uint8_t m_B; /* 8bit register */ -// - uint8_t m_halt; /* halt input line */ + u8 m_regPtr; /* RB register base */ + u8 m_mb; /* MB memory bank reg. latch after Branch */ + u8 m_cf; /* C flag */ + u8 m_zf; /* Z flag */ + u8 m_savec; /* for 8301, save flags */ + u8 m_savez; /* for 8301, save flags */ + + PAIR m_ix0; /* 8bit memory read index reg. */ + PAIR m_ix1; /* 8bitmemory read index reg. */ + PAIR m_ix2; /* 8bitmemory write index reg. */ + u8 m_lp0; /* 8bit loop reg. */ + u8 m_lp1; /* 8bit loop reg. */ + u8 m_lp2; /* 8bit loop reg. */ + u8 m_A; /* 8bit accumulator */ + u8 m_B; /* 8bit register */ + + u8 m_halt; /* halt input line */ address_space *m_program; direct_read_data *m_direct; @@ -396,9 +396,9 @@ protected: const s_opcode *m_opmap; // Used for import/export only - uint8_t m_sp; - uint8_t m_R[8]; - uint8_t m_flags; + u8 m_sp; + u8 m_R[8]; + u8 m_flags; }; @@ -406,7 +406,7 @@ class alpha8301_cpu_device : public alpha8201_cpu_device { public: // construction/destruction - alpha8301_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + alpha8301_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); }; diff --git a/src/devices/video/mc6847.h b/src/devices/video/mc6847.h index 996fddbce13..1d408c5f560 100644 --- a/src/devices/video/mc6847.h +++ b/src/devices/video/mc6847.h @@ -202,7 +202,7 @@ protected: } }; - // artificator internal class + // artificater internal class class artifacter { public: diff --git a/src/mame/drivers/lordgun.cpp b/src/mame/drivers/lordgun.cpp index caa9c2b3036..d80dfc1d1b8 100644 --- a/src/mame/drivers/lordgun.cpp +++ b/src/mame/drivers/lordgun.cpp @@ -900,7 +900,7 @@ Game modes explained: NOTE: Speakers should be connected serially to Speaker (+) and Speaker (-). - You must avoid connecting speakers parallely or connecting speakers + You must avoid connecting speakers parallelly or connecting speakers to Speaker (+) and GND, to keep the amplifier from being damaged or from malfunctioning. diff --git a/src/mame/video/stic.h b/src/mame/video/stic.h index f80c91955cb..14b1bf1999e 100644 --- a/src/mame/video/stic.h +++ b/src/mame/video/stic.h @@ -177,7 +177,7 @@ enum * +-+-+-+-+-+-+----+----+----+----+----+----+----+----+----+----+ * * * * SPRn 1=collision with sprite #n * - * BKGD 1=collision with set background bit * + * BKGD 1=collision with set background bit * * BRDR 1=collision with screen border * * * **************************************************************************** diff --git a/src/osd/modules/render/drawd3d.cpp b/src/osd/modules/render/drawd3d.cpp index ec1a8af0898..d0a1ce6c9d1 100644 --- a/src/osd/modules/render/drawd3d.cpp +++ b/src/osd/modules/render/drawd3d.cpp @@ -852,7 +852,7 @@ try_again: m_adapter, D3DDEVTYPE_HAL, device_hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, &m_presentation, &m_device); if (FAILED(result)) { - // if we got a "DEVICELOST" error, it may be transistory; count it and only fail if + // if we got a "DEVICELOST" error, it may be transitory; count it and only fail if // we exceed a threshold if (result == D3DERR_DEVICELOST) { From a8e953c4746138bfae4bb867402f87359ff6cee5 Mon Sep 17 00:00:00 2001 From: MetalliC <0vetal0@gmail.com> Date: Thu, 24 Nov 2016 20:32:51 +0200 Subject: [PATCH 5/9] namcos12: add Namco Cyber Lead cabinet JVS IO and LED controller PCB dumps [PascalP, Team Europe] typically was used with System12 games, put it to Tekken 3 for now --- src/mame/drivers/namcos12.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/mame/drivers/namcos12.cpp b/src/mame/drivers/namcos12.cpp index c35f594f6c8..3e847b5fae3 100644 --- a/src/mame/drivers/namcos12.cpp +++ b/src/mame/drivers/namcos12.cpp @@ -2695,6 +2695,17 @@ ROM_START( tekken3 ) ROM_REGION( 0x1000000, "c352", 0 ) /* samples */ ROM_LOAD( "tet1wave0.5", 0x0000000, 0x400000, CRC(77ba7975) SHA1(fe9434dcf0fb232c85efaaae1b4b13d36099620a) ) ROM_LOAD( "tet1wave1.4", 0x0400000, 0x400000, CRC(ffeba79f) SHA1(941412bbe9d0305d9a23c224c1bb774c4321f6df) ) + + // Namco Cyber Lead cabinet JVS I/O and LED display controller + ROM_REGION(0x40000, "cabinet_io", 0) + // JVS I/O board (namco ltd.;I/O CYBER LEAD;Ver1.03;JPN,LED-0100) + // labels: CL1 I/OB, I/O LED (I/O) PCB + // ICs: Namco C77 H8/???? MCU, Atmel AT29C020 256k x8 FlashROM, NEC N341256 32k x8 SRAM, 14.7MHz Xtal, Altera EPM7064 labeled I/OLEDM1 + ROM_LOAD("cl1-iob.ic5", 0x0000, 0x40000, CRC(abb90360) SHA1(d938b1e1ae596d0ab1007352f61b0b800363c762) ) + // LED display controller, connected to above I/O + // labels: CL1 LEDA, I/O LED (LED) PCB + // ICs: same as above plus EPSON SED1351F LCD controller, 12MHz Xtal + ROM_LOAD("cl1-leda.ic5", 0x0000, 0x40000, CRC(43602a58) SHA1(64156ded8c43dbbe84b5d6ae13a068c8b18e8aed) ) ROM_END ROM_START( tekken3ae ) From e5bb4a97c0174a3bbb69b840d8cea23c18057c76 Mon Sep 17 00:00:00 2001 From: cracyc Date: Thu, 24 Nov 2016 13:34:47 -0600 Subject: [PATCH 6/9] Promote to working ---------- Intel iSBC 286/10 [Carl] isbc: new isbc 286 rom version v1.0 [Carl, Al Kossow] --- src/mame/drivers/isbc.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/mame/drivers/isbc.cpp b/src/mame/drivers/isbc.cpp index 299d117ed72..7e9ec555414 100644 --- a/src/mame/drivers/isbc.cpp +++ b/src/mame/drivers/isbc.cpp @@ -356,10 +356,16 @@ ROM_END ROM_START( isbc2861 ) ROM_REGION( 0x10000, "user1", ROMREGION_ERASEFF ) - ROM_LOAD16_BYTE( "174894-001.bin", 0x0000, 0x4000, CRC(79e4f7af) SHA1(911a4595d35e6e82b1149e75bb027927cd1c1658)) - ROM_LOAD16_BYTE( "174894-002.bin", 0x0001, 0x4000, CRC(66747d21) SHA1(4094b1f10a8bc7db8d6dd48d7128e14e875776c7)) - ROM_LOAD16_BYTE( "174894-003.bin", 0x8000, 0x4000, CRC(c98c7f17) SHA1(6e9a14aedd630824dccc5eb6052867e73b1d7db6)) - ROM_LOAD16_BYTE( "174894-004.bin", 0x8001, 0x4000, CRC(61bc1dc9) SHA1(feed5a5f0bb4630c8f6fa0d5cca30654a80b4ee5)) + ROM_SYSTEM_BIOS( 0, "v11", "iSDM Monitor V1.1" ) + ROMX_LOAD( "174894-001.bin", 0x0000, 0x4000, CRC(79e4f7af) SHA1(911a4595d35e6e82b1149e75bb027927cd1c1658), ROM_SKIP(1) | ROM_BIOS(1)) + ROMX_LOAD( "174894-002.bin", 0x0001, 0x4000, CRC(66747d21) SHA1(4094b1f10a8bc7db8d6dd48d7128e14e875776c7), ROM_SKIP(1) | ROM_BIOS(1)) + ROMX_LOAD( "174894-003.bin", 0x8000, 0x4000, CRC(c98c7f17) SHA1(6e9a14aedd630824dccc5eb6052867e73b1d7db6), ROM_SKIP(1) | ROM_BIOS(1)) + ROMX_LOAD( "174894-004.bin", 0x8001, 0x4000, CRC(61bc1dc9) SHA1(feed5a5f0bb4630c8f6fa0d5cca30654a80b4ee5), ROM_SKIP(1) | ROM_BIOS(1)) + ROM_SYSTEM_BIOS( 1, "v10", "iSDM Monitor V1.0" ) + ROMX_LOAD( "rmx286-_in_socket_u41_on_isbc_286-10.bin.u41", 0x0000, 0x4000, CRC(00996834) SHA1(a17a0f8909be642d89199660b24574b71a9d0c13), ROM_SKIP(1) | ROM_BIOS(2)) + ROMX_LOAD( "rmx286-_in_socket_u76_on_isbc_286-10.bin.u76", 0x0001, 0x4000, CRC(90c9c7e8) SHA1(b5f961ab236976713266fe7a378e8750825fd5dc), ROM_SKIP(1) | ROM_BIOS(2)) + ROMX_LOAD( "rmx286-_in_socket_u40_on_isbc_286-10.bin.u40", 0x8000, 0x4000, CRC(35716c9b) SHA1(5b717b4c2f6c59ec140635df7448294a22123a16), ROM_SKIP(1) | ROM_BIOS(2)) + ROMX_LOAD( "rmx286-_in_socket_u75_on_isbc_286-10.bin.u75", 0x8001, 0x4000, CRC(68c3eb50) SHA1(3eeef2676e4fb187adb8ab50645f4bd172426c15), ROM_SKIP(1) | ROM_BIOS(2)) ROM_END ROM_START( rpc86 ) @@ -375,4 +381,4 @@ ROM_END COMP( 19??, rpc86, 0, 0, rpc86, isbc, driver_device, 0, "Intel", "RPC 86",MACHINE_NOT_WORKING | MACHINE_NO_SOUND) COMP( 1978, isbc86, 0, 0, isbc86, isbc, driver_device, 0, "Intel", "iSBC 86/12A",MACHINE_NOT_WORKING | MACHINE_NO_SOUND) COMP( 19??, isbc286, 0, 0, isbc286, isbc, driver_device, 0, "Intel", "iSBC 286",MACHINE_NOT_WORKING | MACHINE_NO_SOUND) -COMP( 1983, isbc2861, 0, 0, isbc2861, isbc, driver_device, 0, "Intel", "iSBC 286/10",MACHINE_NOT_WORKING | MACHINE_NO_SOUND) +COMP( 1983, isbc2861, 0, 0, isbc2861, isbc, driver_device, 0, "Intel", "iSBC 286/10", MACHINE_NO_SOUND) From 33e73876b76d96213a469c2643825f7f54cc8c79 Mon Sep 17 00:00:00 2001 From: MetalliC <0vetal0@gmail.com> Date: Thu, 24 Nov 2016 23:13:43 +0200 Subject: [PATCH 7/9] aristmk6: hook IRQ registers, actual sources still unknown --- src/mame/drivers/aristmk6.cpp | 88 ++++++++++++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/aristmk6.cpp b/src/mame/drivers/aristmk6.cpp index 75e9eade880..9887fc59f2a 100644 --- a/src/mame/drivers/aristmk6.cpp +++ b/src/mame/drivers/aristmk6.cpp @@ -41,12 +41,23 @@ public: m_vram(*this, "vram") { } - uint32_t m_test_x,m_test_y,m_start_offs; - uint8_t m_type; + u32 m_test_x,m_test_y,m_start_offs; + u8 m_type; + + u8 irl0pend, irl0en; + u8 irl1pend, irl1en; + u8 irl2pend, irl2en; // UARTs ? + u8 irl3pend0, irl3en0; + u8 irl3pend1, irl3en1; + void testIrq(); + + DECLARE_READ8_MEMBER(irqpend_r); + DECLARE_WRITE8_MEMBER(irqen_w); DECLARE_READ8_MEMBER(test_r); DECLARE_WRITE64_MEMBER(eeprom_w); DECLARE_READ64_MEMBER(hwver_r); virtual void video_start() override; + virtual void machine_reset() override; uint32_t screen_update_aristmk6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_uart0; @@ -60,6 +71,10 @@ public: void aristmk6_state::video_start() { } +void aristmk6_state::machine_reset() +{ + irl0pend = irl0en = irl1pend = irl1en = irl2pend = irl2en = irl3pend0 = irl3en0 = irl3pend1 = irl3en1 = 0; +} uint32_t aristmk6_state::screen_update_aristmk6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { @@ -67,6 +82,11 @@ uint32_t aristmk6_state::screen_update_aristmk6(screen_device &screen, bitmap_rg int x,y,count; const uint8_t *blit_ram = memregion("maincpu")->base(); + if (machine().input().code_pressed(KEYCODE_U)) { + irl2pend |= 2; + testIrq(); + } + if(machine().input().code_pressed(KEYCODE_Z)) m_test_x++; @@ -168,6 +188,68 @@ uint32_t aristmk6_state::screen_update_aristmk6(screen_device &screen, bitmap_rg return 0; } +void aristmk6_state::testIrq() +{ + m_maincpu->set_input_line(SH4_IRL0, (irl0pend & irl0en) ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(SH4_IRL1, (irl1pend & irl1en) ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(SH4_IRL2, (irl2pend & irl2en) ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(SH4_IRL3, ((irl3pend0 & irl3en0) || (irl3pend1 & irl3en1)) ? ASSERT_LINE : CLEAR_LINE); +} + +READ8_MEMBER(aristmk6_state::irqpend_r) +{ + switch (offset) + { + case 0x00e8 - 0x00e8: + return irl0pend; + case 0x00f0 - 0x00e8: + return irl1pend; + case 0x00f8 - 0x00e8: + return irl2pend; + case 0x0100 - 0x00e8: + return irl3pend0; + case 0x0101 - 0x00e8: + return irl3pend1; + default: + logerror("Unhandled read %08x\n", 0x120000e8 + offset); + return 0; + } +} + +WRITE8_MEMBER(aristmk6_state::irqen_w) +{ + switch (offset) + { + case 0x0108 - 0x0108: + irl0en = data; + irl0pend &= ~data; + testIrq(); + break; + case 0x0110 - 0x0108: + irl1en = data; + irl1pend &= ~data; + testIrq(); + break; + case 0x0118 - 0x0108: + irl2en = data; + irl2pend &= ~data; + testIrq(); + break; + case 0x0120 - 0x0108: + irl3en0 = data; + irl3pend0 &= ~data; + testIrq(); + break; + case 0x0121 - 0x0108: + irl3en1 = data; + irl3pend1 &= ~data; + testIrq(); + break; + default: + logerror("Unhandled write %08x %02x\n", 0x12000108 + offset, data); + } +} + READ8_MEMBER(aristmk6_state::test_r) { static int flip; @@ -216,6 +298,8 @@ static ADDRESS_MAP_START( aristmk6_map, AS_PROGRAM, 64, aristmk6_state ) AM_RANGE(0x12000078, 0x1200007f) AM_WRITENOP // watchdog ?? AM_RANGE(0x12000080, 0x12000087) AM_WRITENOP // 0-1-2 written here repeatedly, diag LED or smth ? AM_RANGE(0x120000E0, 0x120000E7) AM_READ(hwver_r) + AM_RANGE(0x120000E8, 0x12000107) AM_READ8(irqpend_r, 0xffffffffffffffffU) + AM_RANGE(0x12000108, 0x12000127) AM_WRITE8(irqen_w, 0xffffffffffffffffU) AM_RANGE(0x12400010, 0x12400017) AM_DEVREADWRITE8("uart1", ns16550_device, ins8250_r, ins8250_w, 0xffffffffffffffffU) AM_RANGE(0x12400018, 0x1240001f) AM_DEVREADWRITE8("uart0", ns16550_device, ins8250_r, ins8250_w, 0xffffffffffffffffU) AM_RANGE(0x13800000, 0x13800007) AM_READ8(test_r, 0xffffffffffffffffU) From cb23c819330fe921c53962bc831bfa87c620163f Mon Sep 17 00:00:00 2001 From: Scott Stone Date: Thu, 24 Nov 2016 17:23:39 -0500 Subject: [PATCH 8/9] Format fixes for recent hash file additions (nw) --- hash/pico.xml | 2 +- hash/sawatte.xml | 74 ++++++++++++++++++++++++------------------------ hash/sms.xml | 2 +- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/hash/pico.xml b/hash/pico.xml index 00922ecae17..b45b3e4588e 100644 --- a/hash/pico.xml +++ b/hash/pico.xml @@ -651,7 +651,7 @@ Published by Others (T-yyy*** serial codes, for yyy depending on the publisher) - + Cooking Pico (Jpn) 1999 Sega Toys diff --git a/hash/sawatte.xml b/hash/sawatte.xml index 2d6478edba7..ecb9d48af11 100644 --- a/hash/sawatte.xml +++ b/hash/sawatte.xml @@ -17,18 +17,18 @@ - - Doraemon Nobita no Dou Butsu Land - 1996 - Sega - - - - - - - - + + Doraemon Nobita no Dou Butsu Land + 1996 + Sega + + + + + + + + Mickey no Kudamonoya-san @@ -90,20 +90,20 @@ - - Soreike! Anpanman Onamae Na~ni - 1996 - Sega - - - - - - - - + + Soreike! Anpanman Onamae Na~ni + 1996 + Sega + + + + + + + + - + Tokyo Disneyland - Mickey no Nakayoshi Tankentai 1998 Sega? @@ -148,17 +148,17 @@ - - Ultra Hero Touch - 1997 - Bandai - - - - - - - - + + Ultra Hero Touch + 1997 + Bandai + + + + + + + + diff --git a/hash/sms.xml b/hash/sms.xml index b1754d3ccf4..26bc45410b8 100644 --- a/hash/sms.xml +++ b/hash/sms.xml @@ -7595,7 +7595,7 @@ 1990 Seo Jin - + From 0d13c7115e7c5811614364acb4b88d1acf12ec0c Mon Sep 17 00:00:00 2001 From: mahlemiut Date: Fri, 25 Nov 2016 11:50:24 +1300 Subject: [PATCH 9/9] fmtowns: add support for IC Memory Card images. Limited to 16MB in size for now, until I can find software that supports more. --- scripts/target/mame/mess.lua | 2 + src/mame/drivers/fmtowns.cpp | 19 +++- src/mame/includes/fmtowns.h | 5 + src/mame/machine/fmt_icmem.cpp | 184 +++++++++++++++++++++++++++++++++ src/mame/machine/fmt_icmem.h | 77 ++++++++++++++ 5 files changed, 282 insertions(+), 5 deletions(-) create mode 100644 src/mame/machine/fmt_icmem.cpp create mode 100644 src/mame/machine/fmt_icmem.h diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 1e515009c4d..9f141d72234 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -1894,6 +1894,8 @@ files { MAME_DIR .. "src/mame/video/fmtowns.cpp", MAME_DIR .. "src/mame/machine/fm_scsi.cpp", MAME_DIR .. "src/mame/machine/fm_scsi.h", + MAME_DIR .. "src/mame/machine/fmt_icmem.cpp", + MAME_DIR .. "src/mame/machine/fmt_icmem.h", MAME_DIR .. "src/mame/drivers/fm7.cpp", MAME_DIR .. "src/mame/includes/fm7.h", MAME_DIR .. "src/mame/video/fm7.cpp", diff --git a/src/mame/drivers/fmtowns.cpp b/src/mame/drivers/fmtowns.cpp index 425169915c3..e434afa7888 100644 --- a/src/mame/drivers/fmtowns.cpp +++ b/src/mame/drivers/fmtowns.cpp @@ -181,6 +181,7 @@ Notes: #include "bus/scsi/scsihd.h" #include "softlist.h" + // CD controller IRQ types #define TOWNS_CD_IRQ_MPU 1 #define TOWNS_CD_IRQ_DMA 2 @@ -2143,8 +2144,8 @@ static ADDRESS_MAP_START(towns_mem, AS_PROGRAM, 32, towns_state) // AM_RANGE(0x00100000, 0x005fffff) AM_RAM // some extra RAM AM_RANGE(0x80000000, 0x8007ffff) AM_READWRITE8(towns_gfx_high_r,towns_gfx_high_w,0xffffffff) AM_MIRROR(0x180000) // VRAM AM_RANGE(0x81000000, 0x8101ffff) AM_READWRITE8(towns_spriteram_r,towns_spriteram_w,0xffffffff) // Sprite RAM - // 0xc0000000 - 0xc0ffffff // IC Memory Card (static, first 16MB only) - // 0xc1000000 - 0xc1ffffff // IC Memory Card (banked, can show any of 4 banks), JEIDA v4 only (UX and later) + AM_RANGE(0xc0000000, 0xc0ffffff) AM_DEVREADWRITE8("icmemcard", fmt_icmem_device, static_mem_read, static_mem_write, 0xffffffff) + AM_RANGE(0xc1000000, 0xc1ffffff) AM_DEVREADWRITE8("icmemcard", fmt_icmem_device, mem_read, mem_write, 0xffffffff) AM_RANGE(0xc2000000, 0xc207ffff) AM_ROM AM_REGION("user",0x000000) // OS ROM AM_RANGE(0xc2080000, 0xc20fffff) AM_ROM AM_REGION("user",0x100000) // DIC ROM AM_RANGE(0xc2100000, 0xc213ffff) AM_ROM AM_REGION("user",0x180000) // FONT ROM @@ -2172,7 +2173,7 @@ static ADDRESS_MAP_START(marty_mem, AS_PROGRAM, 16, towns_state) AM_RANGE(0x00a00000, 0x00a7ffff) AM_READWRITE8(towns_gfx_high_r,towns_gfx_high_w,0xffff) AM_MIRROR(0x180000) // VRAM AM_RANGE(0x00b00000, 0x00b7ffff) AM_ROM AM_REGION("user",0x180000) // FONT AM_RANGE(0x00c00000, 0x00c1ffff) AM_READWRITE8(towns_spriteram_r,towns_spriteram_w,0xffff) // Sprite RAM - AM_RANGE(0x00d00000, 0x00dfffff) AM_RAM // IC Memory Card (is this usable on the Marty?) + AM_RANGE(0x00d00000, 0x00dfffff) AM_DEVREADWRITE8("icmemcard", fmt_icmem_device, mem_read, mem_write, 0xffff) AM_RANGE(0x00e80000, 0x00efffff) AM_ROM AM_REGION("user",0x100000) // DIC ROM AM_RANGE(0x00f00000, 0x00f7ffff) AM_ROM AM_REGION("user",0x180000) // FONT AM_RANGE(0x00f80000, 0x00f8ffff) AM_DEVREADWRITE8("pcm", rf5c68_device, rf5c68_mem_r, rf5c68_mem_w, 0xffff) // WAVE RAM @@ -2195,7 +2196,7 @@ static ADDRESS_MAP_START(ux_mem, AS_PROGRAM, 16, towns_state) AM_RANGE(0x00a00000, 0x00a7ffff) AM_READWRITE8(towns_gfx_high_r,towns_gfx_high_w,0xffff) AM_MIRROR(0x180000) // VRAM AM_RANGE(0x00b00000, 0x00b7ffff) AM_ROM AM_REGION("user",0x180000) // FONT AM_RANGE(0x00c00000, 0x00c1ffff) AM_READWRITE8(towns_spriteram_r,towns_spriteram_w,0xffff) // Sprite RAM - AM_RANGE(0x00d00000, 0x00dfffff) AM_RAM // IC Memory Card + AM_RANGE(0x00d00000, 0x00dfffff) AM_DEVREADWRITE8("icmemcard", fmt_icmem_device, mem_read, mem_write, 0xffff) AM_RANGE(0x00e00000, 0x00e7ffff) AM_ROM AM_REGION("user",0x000000) // OS AM_RANGE(0x00e80000, 0x00efffff) AM_ROM AM_REGION("user",0x100000) // DIC ROM AM_RANGE(0x00f00000, 0x00f7ffff) AM_ROM AM_REGION("user",0x180000) // FONT @@ -2229,6 +2230,9 @@ static ADDRESS_MAP_START( towns_io , AS_IO, 32, towns_state) AM_RANGE(0x0440,0x045f) AM_READWRITE8(towns_video_440_r, towns_video_440_w, 0xffffffff) // System port AM_RANGE(0x0480,0x0483) AM_READWRITE8(towns_sys480_r,towns_sys480_w,0x000000ff) // R/W (0x480) + // IC Memory Card + AM_RANGE(0x0488,0x048b) AM_DEVREAD8("icmemcard",fmt_icmem_device,status_r,0x00ff0000) + AM_RANGE(0x0490,0x0493) AM_DEVREADWRITE8("icmemcard",fmt_icmem_device,bank_r,bank_w,0x0000ffff) // CD-ROM AM_RANGE(0x04c0,0x04cf) AM_READWRITE8(towns_cdrom_r,towns_cdrom_w,0x00ff00ff) // Joystick / Mouse ports @@ -2281,6 +2285,9 @@ static ADDRESS_MAP_START( towns16_io , AS_IO, 16, towns_state) // for the 386SX AM_RANGE(0x0440,0x045f) AM_READWRITE8(towns_video_440_r, towns_video_440_w, 0xffff) // System port AM_RANGE(0x0480,0x0481) AM_READWRITE8(towns_sys480_r,towns_sys480_w,0x00ff) // R/W (0x480) + // IC Memory Card + AM_RANGE(0x048a,0x048b) AM_DEVREAD8("icmemcard",fmt_icmem_device,status_r,0x00ff) + AM_RANGE(0x0490,0x0491) AM_DEVREADWRITE8("icmemcard",fmt_icmem_device,bank_r,bank_w,0xffff) // CD-ROM AM_RANGE(0x04c0,0x04cf) AM_READWRITE8(towns_cdrom_r,towns_cdrom_w,0x00ff) // Joystick / Mouse ports @@ -2322,7 +2329,7 @@ static INPUT_PORTS_START( towns ) PORT_CONFSETTING(0x20, "Mouse") PORT_CONFSETTING(0x40, "6-button joystick") -// Keyboard + // Keyboard PORT_START( "key1" ) // scancodes 0x00-0x1f PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_UNUSED) PORT_BIT(0x00000002,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("ESC") PORT_CODE(KEYCODE_TILDE) PORT_CHAR(27) @@ -2768,6 +2775,8 @@ static MACHINE_CONFIG_FRAGMENT( towns_base ) //MCFG_VIDEO_START_OVERRIDE(towns_state,towns) + MCFG_FMT_ICMEMCARD_ADD("icmemcard") + /* internal ram */ MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_DEFAULT_SIZE("6M") diff --git a/src/mame/includes/fmtowns.h b/src/mame/includes/fmtowns.h index b973b9655e0..e761dc2c4ee 100644 --- a/src/mame/includes/fmtowns.h +++ b/src/mame/includes/fmtowns.h @@ -20,6 +20,9 @@ #include "machine/ram.h" #include "machine/nvram.h" #include "machine/fm_scsi.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" +#include "machine/fmt_icmem.h" #define IRQ_LOG 0 // set to 1 to log IRQ line activity @@ -92,6 +95,7 @@ class towns_state : public driver_device m_fdc(*this, "fdc"), m_flop0(*this, "fdc:0"), m_flop1(*this, "fdc:1"), + m_icmemcard(*this, "icmemcard"), m_nvram(*this, "nvram"), m_nvram16(*this, "nvram16"), m_ctrltype(*this, "ctrltype"), @@ -124,6 +128,7 @@ class towns_state : public driver_device required_device m_fdc; required_device m_flop0; required_device m_flop1; + required_device m_icmemcard; ram_device* m_messram; cdrom_image_device* m_cdrom; cdda_device* m_cdda; diff --git a/src/mame/machine/fmt_icmem.cpp b/src/mame/machine/fmt_icmem.cpp new file mode 100644 index 00000000000..da2679a211e --- /dev/null +++ b/src/mame/machine/fmt_icmem.cpp @@ -0,0 +1,184 @@ +// license:BSD-3-Clause +// copyright-holders:Barry Rodewald +/********************************************************************* + + fmt_icmem.cpp + + FM Towns IC Memory Card + PCMCIA SRAM Memory Cards, up to 64MB supported + +*********************************************************************/ + +#include "emu.h" +#include "emuopts.h" +#include "fmt_icmem.h" + +// device type definition +const device_type FMT_ICMEM = &device_creator; + +//------------------------------------------------- +// fmt_icmem_device - constructor +//------------------------------------------------- + +fmt_icmem_device::fmt_icmem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, FMT_ICMEM, "FM Towns IC Memory Card", tag, owner, clock, "fmt_icmem", __FILE__), + device_image_interface(mconfig, *this), + m_writeprotect(*this,"icmem"), + m_change(false), + m_attr_select(false), + m_detect(false), + m_bank(0) +{ +} + + +static INPUT_PORTS_START( fmt_icmem ) + PORT_START("icmem") + PORT_CONFNAME(0x01, 0x00, "IC Memory Card Write Protect") + PORT_CONFSETTING(0x00, DEF_STR( Off )) + PORT_CONFSETTING(0x01, DEF_STR( On )) +INPUT_PORTS_END + + +//------------------------------------------------- +// device_config_complete - perform any +// operations now that the configuration is +// complete +//------------------------------------------------- + +void fmt_icmem_device::device_config_complete() +{ + // set brief and instance name + update_names(); +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void fmt_icmem_device::device_start() +{ + m_memcard_ram = std::make_unique(0x1000000); + m_bank = 0; + m_detect = false; + m_change = false; + save_item(NAME(m_change)); + save_item(NAME(m_detect)); + save_item(NAME(m_bank)); +} + +ioport_constructor fmt_icmem_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(fmt_icmem); +} + +image_init_result fmt_icmem_device::call_load() +{ + memset(m_memcard_ram.get(), 0xff, 0x1000000); + fseek(0, SEEK_SET); + size_t ret = fread(m_memcard_ram.get(), 0x1000000); + + if(ret != length()) + return image_init_result::FAIL; + + m_change = true; + m_detect = true; + return image_init_result::PASS; +} + +void fmt_icmem_device::call_unload() +{ + fseek(0, SEEK_SET); + if(!m_writeprotect->read()) + fwrite(m_memcard_ram.get(), 0x1000000); + m_change = true; + m_detect = false; +} + +image_init_result fmt_icmem_device::call_create(int format_type, util::option_resolution *format_options) +{ + memset(m_memcard_ram.get(), 0xff, 0x1000000); + + size_t ret = fwrite(m_memcard_ram.get(), 0x1000000); + if(ret != 0x1000000) + return image_init_result::FAIL; + + m_change = true; + m_detect = true; + return image_init_result::PASS; +} + + +READ8_MEMBER(fmt_icmem_device::static_mem_read) +{ + return m_memcard_ram[offset]; +} + +WRITE8_MEMBER(fmt_icmem_device::static_mem_write) +{ + m_memcard_ram[offset] = data; +} + +READ8_MEMBER(fmt_icmem_device::mem_read) +{ + return m_memcard_ram[(m_bank*0x100000) + offset]; +} + +WRITE8_MEMBER(fmt_icmem_device::mem_write) +{ + m_memcard_ram[(m_bank*0x100000) + offset] = data; +} + +// Memory Card status: +// bit 0 - 0 = Write Enable, 1 = Write Protect +// bit 1,2 - Card Detect - 00 = Card Inserted, 11 = No card inserted, 10 or 01 = Card error? +// bit 3,4,5 - not memory card related (EEPROM and backup battery level) +// bit 6 - unknown +// bit 7 - 1 = card changed, flips back to 0 when read +READ8_MEMBER(fmt_icmem_device::status_r) +{ + uint8_t ret = 0x00; + + ret |= (m_writeprotect->read() & 0x01); + if(is_readonly()) // if image is read-only, then set write protect. + ret |= 0x01; + if(!m_detect) + ret |= 0x06; + if(m_change) + ret |= 0x80; + m_change = false; + + return ret; +} + +// Memory Card bank select (0x490) +// bit 0-5: bank select (bits 0-3 not used in non-386SX systems?) +// Attribute/Common memory select (0x491) +// bit 0: 0 = common memory, 1 = attribute memory (TODO) +// bit 7: 0 indicates that card is JEIDA v4 compliant +READ8_MEMBER(fmt_icmem_device::bank_r) +{ + switch(offset) + { + case 0: + return m_bank & 0x0f; + case 1: + return m_attr_select ? 1 : 0; + } + return 0xff; +} + +WRITE8_MEMBER(fmt_icmem_device::bank_w) +{ + switch(offset) + { + case 0: + m_bank = data & 0x0f; + break; + case 1: + m_attr_select = data & 0x01; + break; + } +} + diff --git a/src/mame/machine/fmt_icmem.h b/src/mame/machine/fmt_icmem.h new file mode 100644 index 00000000000..d9eb85cbd30 --- /dev/null +++ b/src/mame/machine/fmt_icmem.h @@ -0,0 +1,77 @@ +// license:BSD-3-Clause +// copyright-holders:Barry Rodewald +/********************************************************************* + + fmt_icmem.h + + FM Towns IC Memory Card + +*********************************************************************/ + +#pragma once + +#ifndef __FMT_ICMEM_H__ +#define __FMT_ICMEM_H__ + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_FMT_ICMEMCARD_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, FMT_ICMEM, 0) + +/*************************************************************************** + FUNCTION PROTOTYPES +***************************************************************************/ + +class fmt_icmem_device : public device_t, + public device_image_interface +{ +public: + // construction/destruction + fmt_icmem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + virtual iodevice_t image_type() const override { return IO_MEMCARD; } + + virtual bool is_readable() const override { return true; } + virtual bool is_writeable() const override { return true; } + virtual bool is_creatable() const override { return true; } + virtual bool must_be_loaded() const override { return false; } + virtual bool is_reset_on_load() const override { return false; } + virtual const char *file_extensions() const override { return "icm"; } + + virtual image_init_result call_load() override; + virtual void call_unload() override; + virtual image_init_result call_create(int format_type, util::option_resolution *format_options) override; + + // device-level overrides + virtual void device_start() override; + virtual void device_config_complete() override; + + DECLARE_READ8_MEMBER(static_mem_read); + DECLARE_WRITE8_MEMBER(static_mem_write); + DECLARE_READ8_MEMBER(mem_read); + DECLARE_WRITE8_MEMBER(mem_write); + DECLARE_READ8_MEMBER(status_r); + DECLARE_READ8_MEMBER(bank_r); + DECLARE_WRITE8_MEMBER(bank_w); + + +protected: + virtual ioport_constructor device_input_ports() const override; + +private: + required_ioport m_writeprotect; + std::unique_ptr m_memcard_ram; + bool m_change; + bool m_attr_select; + uint8_t m_detect; + uint8_t m_bank; +}; + + +// device type definition +extern const device_type FMT_ICMEM; + + +#endif /* __FMT_ICMEM_H__ */