diff options
author | Curt Coder <curtcoder@mail.com> | 2012-09-02 13:46:14 +0000 |
---|---|---|
committer | Curt Coder <curtcoder@mail.com> | 2012-09-02 13:46:14 +0000 |
commit | 08b42aabaadb7d4027139c43ae1968438a3d2c57 (patch) | |
tree | 95b5c80594fee524fbdac511d5486ded98cb80bb | |
parent | c77db05c7343938e745a01ee8ab830084fd24e11 (diff) |
(MESS) Added PET cassette port slot interface to vic20, c64, and plus4. Implemented 1530/1531 datassette as slot devices. Converted MOS6581 interface to devcb. [Curt Coder]
(MESS) vic20: Added floating bus read support to VIC and cartridge interface.
(MESS) vic10: Added floating bus read support to VIC-II and cartridge interface.
(MESS) c64: Added floating bus read support to cartridge interface. [Curt Coder]
(MESS) plus4: Added floating bus read support to TED and cartridge interface. Implemented some Diag264 test cartridge loopback connectors. [Curt Coder]
(MESS) c16: Added PAL/NTSC variants. (nw)
(MESS) v364: Fixed speech ROM mapping. (nw)
(MESS) compis: Separated keyboard to its own file. (nw)
(MESS) huebler: Cleanup. (nw)
174 files changed, 1884 insertions, 654 deletions
diff --git a/.gitattributes b/.gitattributes index 07af03e05d4..82f1824aa09 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6468,6 +6468,8 @@ src/mess/machine/c2031.c svneol=native#text/plain src/mess/machine/c2031.h svneol=native#text/plain src/mess/machine/c2040.c svneol=native#text/plain src/mess/machine/c2040.h svneol=native#text/plain +src/mess/machine/c2n.c svneol=native#text/plain +src/mess/machine/c2n.h svneol=native#text/plain src/mess/machine/c64.c svneol=native#text/plain src/mess/machine/c64_16kb.c svneol=native#text/plain src/mess/machine/c64_16kb.h svneol=native#text/plain @@ -6617,6 +6619,8 @@ src/mess/machine/cococart.h svneol=native#text/plain src/mess/machine/coleco.c svneol=native#text/plain src/mess/machine/coleco.h svneol=native#text/plain src/mess/machine/compis.c svneol=native#text/plain +src/mess/machine/compiskb.c svneol=native#text/plain +src/mess/machine/compiskb.h svneol=native#text/plain src/mess/machine/comx_clm.c svneol=native#text/plain src/mess/machine/comx_clm.h svneol=native#text/plain src/mess/machine/comx_eb.c svneol=native#text/plain @@ -6660,6 +6664,12 @@ src/mess/machine/dec_lk201.c svneol=native#text/plain src/mess/machine/dec_lk201.h svneol=native#text/plain src/mess/machine/dgn_beta.c svneol=native#text/plain src/mess/machine/dgnalpha.c svneol=native#text/plain +src/mess/machine/diag264_lb_iec.c svneol=native#text/plain +src/mess/machine/diag264_lb_iec.h svneol=native#text/plain +src/mess/machine/diag264_lb_tape.c svneol=native#text/plain +src/mess/machine/diag264_lb_tape.h svneol=native#text/plain +src/mess/machine/diag264_lb_user.c svneol=native#text/plain +src/mess/machine/diag264_lb_user.h svneol=native#text/plain src/mess/machine/docg3.c svneol=native#text/plain src/mess/machine/docg3.h svneol=native#text/plain src/mess/machine/dp8390.c svneol=native#text/plain @@ -6907,6 +6917,8 @@ src/mess/machine/pcf8593.c svneol=native#text/plain src/mess/machine/pcf8593.h svneol=native#text/plain src/mess/machine/pecom.c svneol=native#text/plain src/mess/machine/pet.c svneol=native#text/plain +src/mess/machine/petcass.c svneol=native#text/plain +src/mess/machine/petcass.h svneol=native#text/plain src/mess/machine/pf10.c svneol=native#text/plain src/mess/machine/pf10.h svneol=native#text/plain src/mess/machine/pk8020.c svneol=native#text/plain diff --git a/src/emu/sound/mos6560.c b/src/emu/sound/mos6560.c index 073ef0e6e59..3cc30c4b18c 100644 --- a/src/emu/sound/mos6560.c +++ b/src/emu/sound/mos6560.c @@ -94,6 +94,7 @@ struct _mos6560_state /* DMA */ mos6560_dma_read dma_read; mos6560_dma_read_color dma_read_color; + UINT8 last_data; /* lightpen */ mos6560_lightpen_button_callback lightpen_button_cb; @@ -215,6 +216,7 @@ static void mos6560_draw_character( device_t *device, int ybegin, int yend, int for (y = ybegin; y <= yend; y++) { code = mos6560->dma_read(device->machine(), (mos6560->chargenaddr + ch * mos6560->charheight + y) & 0x3fff); + mos6560->last_data = code; mos6560->bitmap->pix16(y + yoff, xoff + 0) = color[code >> 7]; mos6560->bitmap->pix16(y + yoff, xoff + 1) = color[(code >> 6) & 1]; mos6560->bitmap->pix16(y + yoff, xoff + 2) = color[(code >> 5) & 1]; @@ -239,6 +241,7 @@ static void mos6560_draw_character_multi( device_t *device, int ybegin, int yend for (y = ybegin; y <= yend; y++) { code = mos6560->dma_read(device->machine(), (mos6560->chargenaddr + ch * mos6560->charheight + y) & 0x3fff); + mos6560->last_data = code; mos6560->bitmap->pix16(y + yoff, xoff + 0) = mos6560->bitmap->pix16(y + yoff, xoff + 1) = color[code >> 6]; mos6560->bitmap->pix16(y + yoff, xoff + 2) = @@ -299,6 +302,7 @@ static void mos6560_drawlines( device_t *device, int first, int last ) for (xoff = mos6560->xpos; (xoff < mos6560->xpos + mos6560->xsize) && (xoff < mos6560->total_xsize); xoff += 8, offs++) { ch = mos6560->dma_read(device->machine(), (mos6560->videoaddr + offs) & 0x3fff); + mos6560->last_data = ch; attr = (mos6560->dma_read_color(device->machine(), (mos6560->videoaddr + offs) & 0x3fff)) & 0xf; if (mos6560->type == MOS6560_ATTACKUFO) @@ -485,6 +489,12 @@ READ8_DEVICE_HANDLER( mos6560_port_r ) return val; } +UINT8 mos6560_bus_r( device_t *device ) +{ + mos6560_state *mos6560 = get_safe_token(device); + + return mos6560->last_data; +} /*------------------------------------------------- mos6560_raster_interrupt_gen @@ -874,6 +884,8 @@ static DEVICE_START( mos6560 ) device->save_item(NAME(mos6560->multi)); device->save_item(NAME(mos6560->multiinverted)); + device->save_item(NAME(mos6560->last_data)); + device->save_item(NAME(*mos6560->bitmap)); device->save_item(NAME(mos6560->tone1pos)); diff --git a/src/emu/sound/mos6560.h b/src/emu/sound/mos6560.h index f320a4efe0a..9892b4805a3 100644 --- a/src/emu/sound/mos6560.h +++ b/src/emu/sound/mos6560.h @@ -106,6 +106,7 @@ DECLARE_LEGACY_SOUND_DEVICE(MOS656X, mos6560); WRITE8_DEVICE_HANDLER( mos6560_port_w ); READ8_DEVICE_HANDLER( mos6560_port_r ); +UINT8 mos6560_bus_r( device_t *device ); void mos6560_raster_interrupt_gen( device_t *device ); UINT32 mos6560_video_update( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/emu/sound/sid.c b/src/emu/sound/sid.c index 5f35e04d8ba..8b081f5dbf0 100644 --- a/src/emu/sound/sid.c +++ b/src/emu/sound/sid.c @@ -336,14 +336,14 @@ int sid6581_port_r (running_machine &machine, _SID6581 *This, int offset) data=0xff; break; case 0x19: /* paddle 1 */ - if (This->ad_read != NULL) - data=This->ad_read (This->device, 0); + if (!This->in_potx_func.isnull()) + data = This->in_potx_func(offset); else data=0; break; case 0x1a: /* paddle 2 */ - if (This->ad_read != NULL) - data=This->ad_read (This->device, 1); + if (!This->in_poty_func.isnull()) + data = This->in_poty_func(offset); else data=0; break; diff --git a/src/emu/sound/sid.h b/src/emu/sound/sid.h index e8c4e1bfe04..8b8f338fda8 100644 --- a/src/emu/sound/sid.h +++ b/src/emu/sound/sid.h @@ -17,7 +17,9 @@ typedef struct __SID6581 device_t *device; sound_stream *mixer_channel; // mame stream/ mixer channel - int (*ad_read) (device_t *device, int which); + devcb_resolved_read8 in_potx_func; + devcb_resolved_read8 in_poty_func; + SIDTYPE type; UINT32 clock; diff --git a/src/emu/sound/sid6581.c b/src/emu/sound/sid6581.c index 9e7732755c0..86089282321 100644 --- a/src/emu/sound/sid6581.c +++ b/src/emu/sound/sid6581.c @@ -34,11 +34,14 @@ static void sid_start(device_t *device, SIDTYPE sidtype) _SID6581 *sid = get_sid(device); const sid6581_interface *iface = (const sid6581_interface*) device->static_config(); + // resolve callbacks + sid->in_potx_func.resolve(iface->in_potx_cb, *device); + sid->in_poty_func.resolve(iface->in_poty_cb, *device); + sid->device = device; sid->mixer_channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), (void *) sid, sid_update); sid->PCMfreq = device->machine().sample_rate(); sid->clock = device->clock(); - sid->ad_read = iface ? iface->ad_read : NULL; sid->type = sidtype; sid6581_init(sid); diff --git a/src/emu/sound/sid6581.h b/src/emu/sound/sid6581.h index 4b389e39674..d73b2a43f57 100644 --- a/src/emu/sound/sid6581.h +++ b/src/emu/sound/sid6581.h @@ -20,12 +20,15 @@ typedef enum MOS8580 } SIDTYPE; +#define MOS6581_INTERFACE(name) \ + const sid6581_interface (name) = typedef struct _sid6581_interface sid6581_interface; struct _sid6581_interface { - int (*ad_read)(device_t *device, int channel); -} ; + devcb_read8 in_potx_cb; + devcb_read8 in_poty_cb; +}; READ8_DEVICE_HANDLER ( sid6581_r ); diff --git a/src/mess/audio/mos7360.c b/src/mess/audio/mos7360.c index 17deda8535f..77734310af7 100644 --- a/src/mess/audio/mos7360.c +++ b/src/mess/audio/mos7360.c @@ -483,6 +483,8 @@ void mos7360_device::draw_character(int ybegin, int yend, int ch, int yoff, int else code = m_in_ram_func(m_chargenaddr + ch * 8 + y); + m_last_data = code; + m_bitmap.pix16(y + yoff, 0 + xoff) = color[code >> 7]; m_bitmap.pix16(y + yoff, 1 + xoff) = color[(code >> 6) & 1]; m_bitmap.pix16(y + yoff, 2 + xoff) = color[(code >> 5) & 1]; @@ -505,6 +507,8 @@ void mos7360_device::draw_character_multi(int ybegin, int yend, int ch, int yoff else code = m_in_ram_func(m_chargenaddr + ch * 8 + y); + m_last_data = code; + m_bitmap.pix16(y + yoff, 0 + xoff) = m_bitmap.pix16(y + yoff, 1 + xoff) = m_multi[code >> 6]; m_bitmap.pix16(y + yoff, 2 + xoff) = @@ -523,6 +527,9 @@ void mos7360_device::draw_bitmap(int ybegin, int yend, int ch, int yoff, int xof for (y = ybegin; y <= yend; y++) { code = m_in_ram_func(m_bitmapaddr + ch * 8 + y); + + m_last_data = code; + m_bitmap.pix16(y + yoff, 0 + xoff) = m_c16_bitmap[code >> 7]; m_bitmap.pix16(y + yoff, 1 + xoff) = m_c16_bitmap[(code >> 6) & 1]; m_bitmap.pix16(y + yoff, 2 + xoff) = m_c16_bitmap[(code >> 5) & 1]; @@ -541,6 +548,8 @@ void mos7360_device::draw_bitmap_multi(int ybegin, int yend, int ch, int yoff, i for (y = ybegin; y <= yend; y++) { code = m_in_ram_func(m_bitmapaddr + ch * 8 + y); + + m_last_data = code; m_bitmap.pix16(y + yoff, 0 + xoff) = m_bitmap.pix16(y + yoff, 1 + xoff) = m_bitmapmulti[code >> 6]; @@ -1141,3 +1150,13 @@ void mos7360_device::raster_interrupt_gen() set_interrupt(2); } } + + +//------------------------------------------------- +// bus_r - data bus read +//------------------------------------------------- + +UINT8 mos7360_device::bus_r() +{ + return m_last_data; +} diff --git a/src/mess/audio/mos7360.h b/src/mess/audio/mos7360.h index f3b57143048..b424048e2ff 100644 --- a/src/mess/audio/mos7360.h +++ b/src/mess/audio/mos7360.h @@ -118,6 +118,8 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); + UINT8 bus_r(); + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); // horrible crap code @@ -171,6 +173,7 @@ protected: sound_stream *m_stream; UINT8 m_reg[0x20]; + UINT8 m_last_data; bitmap_ind16 m_bitmap; diff --git a/src/mess/drivers/c128.c b/src/mess/drivers/c128.c index 1d3ca9bd50a..150ca7acb45 100644 --- a/src/mess/drivers/c128.c +++ b/src/mess/drivers/c128.c @@ -642,9 +642,24 @@ GFXDECODE_END *************************************/ +READ8_MEMBER( c128_state::sid_potx_r ) +{ + device_t *sid = machine().device("sid6581"); + + return c64_paddle_read(sid, 0); +} + +READ8_MEMBER( c128_state::sid_poty_r ) +{ + device_t *sid = machine().device("sid6581"); + + return c64_paddle_read(sid, 1); +} + static const sid6581_interface c128_sound_interface = { - c64_paddle_read + DEVCB_DRIVER_MEMBER(c128_state, sid_potx_r), + DEVCB_DRIVER_MEMBER(c128_state, sid_poty_r) }; @@ -656,14 +671,6 @@ static const m6502_interface c128_m8502_interface = DEVCB_HANDLER(c128_m6510_port_write) /* port_write_func */ }; -static SLOT_INTERFACE_START( c128dcr_iec_devices ) - SLOT_INTERFACE("c1571cr", C1571CR) -SLOT_INTERFACE_END - -static SLOT_INTERFACE_START( c128d81_iec_devices ) - SLOT_INTERFACE("c1563", C1563) -SLOT_INTERFACE_END - static CBM_IEC_INTERFACE( cbm_iec_intf ) { DEVCB_DEVICE_LINE("cia_0", c128_iec_srq_w), diff --git a/src/mess/drivers/c64.c b/src/mess/drivers/c64.c index be6feb129c7..983995480f9 100644 --- a/src/mess/drivers/c64.c +++ b/src/mess/drivers/c64.c @@ -50,10 +50,10 @@ void c64_state::check_interrupts() { int restore = BIT(ioport("SPECIAL")->read(), 7); - m_maincpu->set_input_line(INPUT_LINE_IRQ0, m_cia1_irq | m_vic_irq | m_exp_irq); - m_maincpu->set_input_line(INPUT_LINE_NMI, m_cia2_irq | restore | m_exp_nmi); + m_maincpu->set_input_line(INPUT_LINE_IRQ0, m_cia1_irq || m_vic_irq || m_exp_irq); + m_maincpu->set_input_line(INPUT_LINE_NMI, m_cia2_irq || restore || m_exp_nmi); - mos6526_flag_w(m_cia1, m_cass_rd & m_iec_srq); + mos6526_flag_w(m_cia1, m_cass_rd && m_iec_srq); } @@ -93,7 +93,7 @@ UINT8 c64_state::read_memory(address_space &space, offs_t offset, int ba, int ca { int io1 = 1, io2 = 1; - UINT8 data = 0; + UINT8 data = m_vic->bus_r(); if (!casram) { @@ -155,9 +155,7 @@ UINT8 c64_state::read_memory(address_space &space, offs_t offset, int ba, int ca } } - data |= m_exp->cd_r(space, offset, ba, roml, romh, io1, io2); - - return data; + return m_exp->cd_r(space, offset, data, ba, roml, romh, io1, io2); } @@ -249,7 +247,7 @@ READ8_MEMBER( c64_state::vic_videoram_r ) int casram, basic, kernal, charom, grw, io, roml, romh; bankswitch(0xffff, offset, rw, aec, ba, cas, &casram, &basic, &kernal, &charom, &grw, &io, &roml, &romh); - return read_memory(space, offset, 0, casram, basic, kernal, charom, io, roml, romh); + return read_memory(space, offset, ba, casram, basic, kernal, charom, io, roml, romh); } @@ -437,125 +435,40 @@ static MOS6567_INTERFACE( vic_intf ) // sid6581_interface sid_intf //------------------------------------------------- -static int paddle_read( device_t *device, int which ) +READ8_MEMBER( c64_state::sid_potx_r ) { - running_machine &machine = device->machine(); - c64_state *state = device->machine().driver_data<c64_state>(); - - int pot1 = 0xff, pot2 = 0xff, pot3 = 0xff, pot4 = 0xff, temp; - UINT8 cia0porta = mos6526_pa_r(state->m_cia1, 0); - int controller1 = machine.root_device().ioport("CTRLSEL")->read() & 0x07; - int controller2 = machine.root_device().ioport("CTRLSEL")->read() & 0x70; - // Notice that only a single input is defined for Mouse & Lightpen in both ports - switch (controller1) - { - case 0x01: - if (which) - pot2 = machine.root_device().ioport("PADDLE2")->read(); - else - pot1 = machine.root_device().ioport("PADDLE1")->read(); - break; - - case 0x02: - if (which) - pot2 = machine.root_device().ioport("TRACKY")->read(); - else - pot1 = machine.root_device().ioport("TRACKX")->read(); - break; - - case 0x03: - if (which && (machine.root_device().ioport("JOY1_2B")->read() & 0x20)) // Joy1 Button 2 - pot1 = 0x00; - break; - - case 0x04: - if (which) - pot2 = machine.root_device().ioport("LIGHTY")->read(); - else - pot1 = machine.root_device().ioport("LIGHTX")->read(); - break; - - case 0x06: - if (which && (machine.root_device().ioport("OTHER")->read() & 0x04)) // Lightpen Signal - pot2 = 0x00; - break; - - case 0x00: - case 0x07: - break; - - default: - logerror("Invalid Controller Setting %d\n", controller1); - break; - } - - switch (controller2) - { - case 0x10: - if (which) - pot4 = machine.root_device().ioport("PADDLE4")->read(); - else - pot3 = machine.root_device().ioport("PADDLE3")->read(); - break; - - case 0x20: - if (which) - pot4 = machine.root_device().ioport("TRACKY")->read(); - else - pot3 = machine.root_device().ioport("TRACKX")->read(); - break; - - case 0x30: - if (which && (machine.root_device().ioport("JOY2_2B")->read() & 0x20)) // Joy2 Button 2 - pot4 = 0x00; - break; + UINT8 cia1_pa = mos6526_pa_r(m_cia1, 0); + + int sela = BIT(cia1_pa, 6); + int selb = BIT(cia1_pa, 7); - case 0x40: - if (which) - pot4 = machine.root_device().ioport("LIGHTY")->read(); - else - pot3 = machine.root_device().ioport("LIGHTX")->read(); - break; - - case 0x60: - if (which && (machine.root_device().ioport("OTHER")->read() & 0x04)) // Lightpen Signal - pot4 = 0x00; - break; - - case 0x00: - case 0x70: - break; + UINT8 data = 0; - default: - logerror("Invalid Controller Setting %d\n", controller1); - break; - } + if (sela) data = m_joy1->pot_x_r(); + if (selb) data = m_joy2->pot_x_r(); - if (machine.root_device().ioport("CTRLSEL")->read() & 0x80) // Swap - { - temp = pot1; pot1 = pot3; pot3 = temp; - temp = pot2; pot2 = pot4; pot4 = temp; - } + return data; +} - switch (cia0porta & 0xc0) - { - case 0x40: - return which ? pot2 : pot1; +READ8_MEMBER( c64_state::sid_poty_r ) +{ + UINT8 cia1_pa = mos6526_pa_r(m_cia1, 0); + + int sela = BIT(cia1_pa, 6); + int selb = BIT(cia1_pa, 7); - case 0x80: - return which ? pot4 : pot3; + UINT8 data = 0; - case 0xc0: - return which ? pot2 : pot1; + if (sela) data = m_joy1->pot_y_r(); + if (selb) data = m_joy2->pot_y_r(); - default: - return 0; - } + return data; } -static const sid6581_interface sid_intf = +static MOS6581_INTERFACE( sid_intf ) { - paddle_read + DEVCB_DRIVER_MEMBER(c64_state, sid_potx_r), + DEVCB_DRIVER_MEMBER(c64_state, sid_poty_r) }; @@ -753,7 +666,7 @@ READ8_MEMBER( c64_state::cpu_r ) UINT8 data = 0x07; - data |= ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED) << 4; + data |= m_cassette->sense_r() << 4; return data; } @@ -781,19 +694,10 @@ WRITE8_MEMBER( c64_state::cpu_w ) m_charen = BIT(data, 2); // cassette write - m_cassette->output(BIT(data, 3) ? -(0x5a9e >> 1) : +(0x5a9e >> 1)); + m_cassette->write(BIT(data, 3)); // cassette motor - if (!BIT(data, 5)) - { - m_cassette->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); - m_cassette_timer->adjust(attotime::zero, 0, attotime::from_hz(44100)); - } - else - { - m_cassette->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); - m_cassette_timer->reset(); - } + m_cassette->motor_w(BIT(data, 5)); } static const m6502_interface cpu_intf = @@ -914,18 +818,21 @@ static const m6502_interface c64gs_cpu_intf = //------------------------------------------------- -// TIMER_DEVICE_CALLBACK( cassette_tick ) +// PET_DATASSETTE_PORT_INTERFACE( datassette_intf ) //------------------------------------------------- -static TIMER_DEVICE_CALLBACK( cassette_tick ) +WRITE_LINE_MEMBER( c64_state::tape_read_w ) { - c64_state *state = timer.machine().driver_data<c64_state>(); + m_cass_rd = state; - state->m_cass_rd = state->m_cassette->input() > +0.0; - - state->check_interrupts(); + check_interrupts(); } +static PET_DATASSETTE_PORT_INTERFACE( datassette_intf ) +{ + DEVCB_DRIVER_LINE_MEMBER(c64_state, tape_read_w), +}; + //------------------------------------------------- // CBM_IEC_INTERFACE( iec_intf ) @@ -1115,8 +1022,7 @@ static MACHINE_CONFIG_START( ntsc, c64_state ) MCFG_MOS6526R1_ADD(MOS6526_1_TAG, VIC6567_CLOCK, cia1_intf) MCFG_MOS6526R1_ADD(MOS6526_2_TAG, VIC6567_CLOCK, cia2_intf) MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS) - MCFG_CASSETTE_ADD(CASSETTE_TAG, cbm_cassette_interface) - MCFG_TIMER_ADD(TIMER_C1531_TAG, cassette_tick) + MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, "c1530", NULL) MCFG_CBM_IEC_ADD(iec_intf, "c1541") MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vic20_control_port_devices, NULL, NULL) MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vic20_control_port_devices, NULL, NULL) @@ -1212,8 +1118,7 @@ static MACHINE_CONFIG_START( pal, c64_state ) MCFG_MOS6526R1_ADD(MOS6526_1_TAG, VIC6569_CLOCK, cia1_intf) MCFG_MOS6526R1_ADD(MOS6526_2_TAG, VIC6569_CLOCK, cia2_intf) MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS) - MCFG_CASSETTE_ADD(CASSETTE_TAG, cbm_cassette_interface) - MCFG_TIMER_ADD(TIMER_C1531_TAG, cassette_tick) + MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, "c1530", NULL) MCFG_CBM_IEC_ADD(iec_intf, "c1541") MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vic20_control_port_devices, NULL, NULL) MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vic20_control_port_devices, NULL, NULL) diff --git a/src/mess/drivers/c65.c b/src/mess/drivers/c65.c index 26b10592e95..307ae64642d 100644 --- a/src/mess/drivers/c65.c +++ b/src/mess/drivers/c65.c @@ -189,9 +189,24 @@ static PALETTE_INIT( c65 ) * *************************************/ -static const sid6581_interface c65_sound_interface = +READ8_MEMBER( c65_state::sid_potx_r ) { - c64_paddle_read + device_t *sid = machine().device("sid_r"); + + return c64_paddle_read(sid, 0); +} + +READ8_MEMBER( c65_state::sid_poty_r ) +{ + device_t *sid = machine().device("sid_r"); + + return c64_paddle_read(sid, 1); +} + +static MOS6581_INTERFACE( c65_sound_interface ) +{ + DEVCB_DRIVER_MEMBER(c65_state, sid_potx_r), + DEVCB_DRIVER_MEMBER(c65_state, sid_poty_r) }; diff --git a/src/mess/drivers/compis.c b/src/mess/drivers/compis.c index 4284fcfaab1..d46483feda4 100644 --- a/src/mess/drivers/compis.c +++ b/src/mess/drivers/compis.c @@ -188,14 +188,6 @@ static ADDRESS_MAP_START( compis_io, AS_IO, 16, compis_state ) //{ 0xff20, 0xffff, compis_null_r }, /* CPU 80186 */ ADDRESS_MAP_END -/* TODO */ -static ADDRESS_MAP_START( keyboard_io, AS_IO, 8, compis_state ) - AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_NOP - AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_NOP - AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_NOP - AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_NOP -ADDRESS_MAP_END - /* COMPIS Keyboard */ /* 2008-05 FP: @@ -369,9 +361,6 @@ static MACHINE_CONFIG_START( compis, compis_state ) MCFG_CPU_VBLANK_INT("screen", compis_vblank_int) MCFG_CPU_CONFIG(i86_address_mask) - MCFG_CPU_ADD("i8749", I8749, 1000000) - MCFG_CPU_IO_MAP(keyboard_io) - //MCFG_QUANTUM_TIME(attotime::from_hz(60)) MCFG_MACHINE_START(compis) @@ -404,6 +393,7 @@ static MACHINE_CONFIG_START( compis, compis_state ) MCFG_MM58274C_ADD("mm58274c", compis_mm58274c_interface) MCFG_UPD765A_ADD("upd765", compis_fdc_interface) MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(compis_floppy_interface) + MCFG_COMPIS_KEYBOARD_ADD() /* software lists */ MCFG_SOFTWARE_LIST_ADD("flop_list", "compis") @@ -417,9 +407,6 @@ static MACHINE_CONFIG_START( compis2, compis_state ) MCFG_CPU_VBLANK_INT("screen", compis_vblank_int) MCFG_CPU_CONFIG(i86_address_mask) - MCFG_CPU_ADD("i8749", I8749, 1000000) - MCFG_CPU_IO_MAP(keyboard_io) - //MCFG_QUANTUM_TIME(attotime::from_hz(60)) MCFG_MACHINE_START(compis) @@ -448,6 +435,7 @@ static MACHINE_CONFIG_START( compis2, compis_state ) MCFG_MM58274C_ADD("mm58274c", compis_mm58274c_interface) MCFG_UPD765A_ADD("upd765", compis_fdc_interface) MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(compis_floppy_interface) + MCFG_COMPIS_KEYBOARD_ADD() /* software lists */ MCFG_SOFTWARE_LIST_ADD("flop_list", "compis") @@ -467,9 +455,6 @@ ROM_START( compis ) ROM_LOAD16_BYTE( "sa883003.u36", 0x0001, 0x4000, CRC(7c918f56) SHA1(8ba33d206351c52f44f1aa76cc4d7f292dcef761) ) ROM_LOAD16_BYTE( "sa883003.u39", 0x8000, 0x4000, CRC(3cca66db) SHA1(cac36c9caa2f5bb42d7a6d5b84f419318628935f) ) ROM_LOAD16_BYTE( "sa883003.u35", 0x8001, 0x4000, CRC(43c38e76) SHA1(f32e43604107def2c2259898926d090f2ed62104) ) - - ROM_REGION( 0x800, "i8749", 0 ) - ROM_LOAD( "cmpkey13.u1", 0x0000, 0x0800, CRC(3f87d138) SHA1(c04e2d325b9c04818bc7c47c3bf32b13862b11ec) ) ROM_END ROM_START( compis2 ) @@ -483,9 +468,6 @@ ROM_START( compis2 ) ROM_SYSTEM_BIOS( 1, "v303", "Compis II v3.03 (1987-03-09)" ) ROMX_LOAD( "rysa094.u39", 0x0000, 0x8000, CRC(e7302bff) SHA1(44ea20ef4008849af036c1a945bc4f27431048fb), ROM_BIOS(2) | ROM_SKIP(1) ) ROMX_LOAD( "rysa094.u35", 0x0001, 0x8000, CRC(b0694026) SHA1(eb6b2e3cb0f42fd5ffdf44f70e652ecb9714ce30), ROM_BIOS(2) | ROM_SKIP(1) ) - - ROM_REGION( 0x800, "i8749", 0 ) - ROM_LOAD( "cmpkey13.u1", 0x0000, 0x0800, CRC(3f87d138) SHA1(c04e2d325b9c04818bc7c47c3bf32b13862b11ec) ) ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ diff --git a/src/mess/drivers/huebler.c b/src/mess/drivers/huebler.c index f29e72849d5..25e83481911 100644 --- a/src/mess/drivers/huebler.c +++ b/src/mess/drivers/huebler.c @@ -18,14 +18,6 @@ */ - -#include "emu.h" -#include "cpu/z80/z80.h" -#include "cpu/z80/z80daisy.h" -#include "machine/z80pio.h" -#include "machine/z80dart.h" -#include "machine/z80ctc.h" -#include "machine/ram.h" #include "includes/huebler.h" /* Keyboard */ @@ -41,8 +33,8 @@ void amu880_state::scan_keyboard() if (m_key_a8 && !a8) { m_key_d7 = m_key_d6; - m_key_a4 = !(BIT(data, 1) & BIT(data, 3)); - m_key_a5 = !(BIT(data, 2) & BIT(data, 3)); + m_key_a4 = !(BIT(data, 1) && BIT(data, 3)); + m_key_a5 = !(BIT(data, 2) && BIT(data, 3)); } m_key_a8 = a8; diff --git a/src/mess/drivers/plus4.c b/src/mess/drivers/plus4.c index 9dbb40fb959..a54f2bc8287 100644 --- a/src/mess/drivers/plus4.c +++ b/src/mess/drivers/plus4.c @@ -2,14 +2,13 @@ TODO: - - cassette + - cassette motor is turned on only for a moment while LOADing + - c16 function ROM test fails - c1551 won't load anything - clean up keyboard handling - clean up TED - dump PLA - T6721 speech chip - - floating bus read (should return the previous byte read by TED) - - SID card (http://solder.dyndns.info/cgi-bin/showdir.pl?dir=files/commodore/plus4/hardware/SID-Card) */ @@ -167,7 +166,7 @@ void plus4_state::bankswitch(offs_t offset, int phi0, int mux, int ras, int *scs UINT8 plus4_state::read_memory(address_space &space, offs_t offset, int ba, int scs, int phi2, int user, int _6551, int addr_clk, int keyport, int kernal, int cs0, int cs1) { - UINT8 data = 0; + UINT8 data = m_ted->bus_r(); int c1l = 1, c1h = 1, c2l = 1, c2h = 1; //logerror("offset %04x user %u 6551 %u addr_clk %u keyport %u kernal %u cs0 %u cs1 %u m_rom_en %u\n", offset,user,_6551,addr_clk,keyport,kernal,cs0,cs1,m_rom_en); @@ -182,10 +181,9 @@ UINT8 plus4_state::read_memory(address_space &space, offs_t offset, int ba, int { data = m_spi_user->read(space, 0); } - else - { - data |= ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED) << 2; - } + + data &= ~0x04; + data |= m_cassette->sense_r() << 2; } else if (!_6551 && m_acia) { @@ -216,6 +214,11 @@ UINT8 plus4_state::read_memory(address_space &space, offs_t offset, int ba, int case CS0_C2_LOW: c2l = 0; + + if (m_c2 != NULL) + { + data = m_c2[offset & 0x7fff]; + } break; } } @@ -246,6 +249,11 @@ UINT8 plus4_state::read_memory(address_space &space, offs_t offset, int ba, int case CS1_C2_HIGH: c2h = 0; + + if (m_c2 != NULL) + { + data = m_c2[offset & 0x7fff]; + } break; } } @@ -259,9 +267,7 @@ UINT8 plus4_state::read_memory(address_space &space, offs_t offset, int ba, int data = m_ram->pointer()[offset & m_ram->mask()]; } - data |= m_exp->cd_r(space, offset, ba, cs0, c1l, c1h, cs1, c2l, c2h); - - return data; + return m_exp->cd_r(space, offset, data, ba, cs0, c1l, c1h, cs1, c2l, c2h); } @@ -448,23 +454,20 @@ READ8_MEMBER( plus4_state::cpu_r ) 4 CST RD 5 6 IEC CLK IN - 7 IEC DATA IN, CST SENSE (Plus/4) + 7 IEC DATA IN, CST SENSE */ - UINT8 data = 0xff; - UINT8 c16_port7501 = m6510_get_port(m_maincpu); + UINT8 data = 0x2f; - if (BIT(c16_port7501, 0) || !m_iec->data_r() || ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED)) - data &= ~0x80; + // cassette read + data |= m_cassette->read() << 4; - if (BIT(c16_port7501, 1) || !m_iec->clk_r()) - data &= ~0x40; + // serial clock + data |= m_iec->clk_r() << 6; - if (m_cassette->input() > +0.0) - data |= 0x10; - else - data &= ~0x10; + // serial data, cassette sense + data |= (m_iec->data_r() && m_cassette->sense_r()) << 7; return data; } @@ -486,19 +489,16 @@ READ8_MEMBER( plus4_state::c16_cpu_r ) */ - UINT8 data = 0xff; - UINT8 c16_port7501 = m6510_get_port(m_maincpu); + UINT8 data = 0x2f; - if (BIT(c16_port7501, 0) || !m_iec->data_r()) - data &= ~0x80; + // cassette read + data |= m_cassette->read() << 4; - if (BIT(c16_port7501, 1) || !m_iec->clk_r()) - data &= ~0x40; + // serial clock + data |= m_iec->clk_r() << 6; - if (m_cassette->input() > +0.0) - data |= 0x10; - else - data &= ~0x10; + // serial data + data |= m_iec->data_r() << 7; return data; } @@ -515,21 +515,27 @@ WRITE8_MEMBER( plus4_state::cpu_w ) 3 CST MTR 4 5 - 6 + 6 (CST WR) 7 */ - // serial bus + //logerror("%s cpu write %02x\n", machine().describe_context(), data); + + // serial data m_iec->data_w(!BIT(data, 0)); + + // serial clock m_iec->clk_w(!BIT(data, 1)); - m_iec->atn_w(!BIT(data, 2)); - // cassette write - m_cassette->output(!BIT(data, 1) ? -(0x5a9e >> 1) : +(0x5a9e >> 1)); + // serial attention + m_iec->atn_w(!BIT(data, 2)); // cassette motor - m_cassette->change_state(BIT(data, 3) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); + m_cassette->motor_w(BIT(data, 3)); + + // cassette write + m_cassette->write(!BIT(data, 1)); } static const m6502_interface cpu_intf = @@ -630,21 +636,21 @@ WRITE_LINE_MEMBER( plus4_state::ted_irq_w ) READ8_MEMBER( plus4_state::ted_ram_r ) { int phi0 = 1, mux = 0, ras = 1, ba = 0; - int speech, phi2, user, _6551, addr_clk, keyport, kernal, cs0, cs1; + int scs, phi2, user, _6551, addr_clk, keyport, kernal, cs0, cs1; - bankswitch(offset, phi0, mux, ras, &speech, &phi2, &user, &_6551, &addr_clk, &keyport, &kernal, &cs0, &cs1); + bankswitch(offset, phi0, mux, ras, &scs, &phi2, &user, &_6551, &addr_clk, &keyport, &kernal, &cs0, &cs1); - return read_memory(space, offset, ba, speech, phi2, user, _6551, addr_clk, keyport, kernal, 1, 1); + return read_memory(space, offset, ba, scs, phi2, user, _6551, addr_clk, keyport, kernal, 1, 1); } READ8_MEMBER( plus4_state::ted_rom_r ) { int phi0 = 1, mux = 0, ras = 1, ba = 0; - int speech, phi2, user, _6551, addr_clk, keyport, kernal, cs0, cs1; + int scs, phi2, user, _6551, addr_clk, keyport, kernal, cs0, cs1; - bankswitch(offset, phi0, mux, ras, &speech, &phi2, &user, &_6551, &addr_clk, &keyport, &kernal, &cs0, &cs1); + bankswitch(offset, phi0, mux, ras, &scs, &phi2, &user, &_6551, &addr_clk, &keyport, &kernal, &cs0, &cs1); - return read_memory(space, offset, ba, speech, phi2, user, _6551, addr_clk, keyport, kernal, cs0, cs1); + return read_memory(space, offset, ba, scs, phi2, user, _6551, addr_clk, keyport, kernal, cs0, cs1); } READ8_MEMBER( plus4_state::ted_k_r ) @@ -767,6 +773,16 @@ static MOS6529_INTERFACE( spi_kb_intf ) //------------------------------------------------- +// PET_DATASSETTE_PORT_INTERFACE( datassette_intf ) +//------------------------------------------------- + +static PET_DATASSETTE_PORT_INTERFACE( datassette_intf ) +{ + DEVCB_NULL +}; + + +//------------------------------------------------- // CBM_IEC_INTERFACE( iec_intf ) //------------------------------------------------- @@ -845,6 +861,11 @@ void plus4_state::machine_start() m_function = memregion("function")->base(); } + if (memregion("c2") != NULL) + { + m_c2 = memregion("c2")->base(); + } + // state saving save_item(NAME(m_addr)); save_item(NAME(m_rom_en)); @@ -915,7 +936,7 @@ static MACHINE_CONFIG_START( ntsc, plus4_state ) MCFG_MOS6529_ADD(MOS6529_USER_TAG, spi_user_intf) MCFG_MOS6529_ADD(MOS6529_KB_TAG, spi_kb_intf) MCFG_QUICKLOAD_ADD("quickload", cbm_c16, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) - MCFG_CASSETTE_ADD( CASSETTE_TAG, cbm_cassette_interface ) + MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, plus4_datassette_devices, "c1531", NULL) MCFG_CBM_IEC_ADD(iec_intf, NULL) MCFG_PLUS4_EXPANSION_SLOT_ADD(PLUS4_EXPANSION_SLOT_TAG, XTAL_14_31818MHz/16, expansion_intf, plus4_expansion_cards, NULL, NULL) MCFG_PLUS4_USER_PORT_ADD(PLUS4_USER_PORT_TAG, plus4_user_port_cards, NULL, NULL) @@ -954,7 +975,7 @@ static MACHINE_CONFIG_START( pal, plus4_state ) MCFG_MOS6529_ADD(MOS6529_USER_TAG, spi_user_intf) MCFG_MOS6529_ADD(MOS6529_KB_TAG, spi_kb_intf) MCFG_QUICKLOAD_ADD("quickload", cbm_c16, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) - MCFG_CASSETTE_ADD( CASSETTE_TAG, cbm_cassette_interface ) + MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, plus4_datassette_devices, "c1531", NULL) MCFG_CBM_IEC_ADD(iec_intf, NULL) MCFG_PLUS4_EXPANSION_SLOT_ADD(PLUS4_EXPANSION_SLOT_TAG, XTAL_17_73447MHz/20, expansion_intf, plus4_expansion_cards, NULL, NULL) MCFG_PLUS4_USER_PORT_ADD(PLUS4_USER_PORT_TAG, plus4_user_port_cards, NULL, NULL) @@ -970,10 +991,31 @@ MACHINE_CONFIG_END //------------------------------------------------- -// MACHINE_CONFIG( c16 ) +// MACHINE_CONFIG( c16n ) +//------------------------------------------------- + +static MACHINE_CONFIG_DERIVED( c16n, ntsc ) + MCFG_CPU_MODIFY(MOS7501_TAG) + MCFG_CPU_CONFIG(c16_cpu_intf) + + MCFG_DEVICE_REMOVE(MOS6551_TAG) + MCFG_DEVICE_REMOVE(MOS6529_USER_TAG) + MCFG_DEVICE_REMOVE(PLUS4_USER_PORT_TAG) + + MCFG_DEVICE_MODIFY(CBM_IEC_TAG) + MCFG_DEVICE_CONFIG(c16_iec_intf) + + MCFG_DEVICE_MODIFY(RAM_TAG) + MCFG_RAM_DEFAULT_SIZE("16K") + MCFG_RAM_EXTRA_OPTIONS("64K") +MACHINE_CONFIG_END + + +//------------------------------------------------- +// MACHINE_CONFIG( c16p ) //------------------------------------------------- -static MACHINE_CONFIG_DERIVED( c16, pal ) +static MACHINE_CONFIG_DERIVED( c16p, pal ) MCFG_CPU_MODIFY(MOS7501_TAG) MCFG_CPU_CONFIG(c16_cpu_intf) @@ -994,7 +1036,7 @@ MACHINE_CONFIG_END // MACHINE_CONFIG( c232 ) //------------------------------------------------- -static MACHINE_CONFIG_DERIVED( c232, c16 ) +static MACHINE_CONFIG_DERIVED( c232, c16p ) MCFG_DEVICE_MODIFY(RAM_TAG) MCFG_RAM_DEFAULT_SIZE("32K") MACHINE_CONFIG_END @@ -1024,7 +1066,48 @@ ROM_START( c264 ) ROM_LOAD( "basic-264.bin", 0x0000, 0x4000, CRC(6a2fc8e3) SHA1(473fce23afa07000cdca899fbcffd6961b36a8a0) ) ROM_LOAD( "kernal-264.bin", 0x4000, 0x4000, CRC(8f32abe7) SHA1(d481faf5fcbb331878dc7851c642d04f26a32873) ) - ROM_REGION( 0x8000, "function", ROMREGION_ERASE00 ) + ROM_REGION( 0x8000, "function", 0 ) + ROM_CART_LOAD( "lo", 0x0000, 0x0000, ROM_NOMIRROR ) + ROM_CART_LOAD( "hi", 0x4000, 0x0000, ROM_NOMIRROR ) + + ROM_REGION( 0xf5, PLA_TAG, 0 ) + ROM_LOAD( "251641-02", 0x00, 0xf5, NO_DUMP ) +ROM_END + + +//------------------------------------------------- +// ROM( c232 ) +//------------------------------------------------- + +ROM_START( c232 ) + ROM_REGION( 0x8000, "kernal", 0 ) + ROM_LOAD( "318006-01.u4", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) + ROM_LOAD( "318004-01.u5", 0x4000, 0x4000, CRC(dbdc3319) SHA1(3c77caf72914c1c0a0875b3a7f6935cd30c54201) ) + + ROM_REGION( 0x8000, "function", 0 ) + ROM_CART_LOAD( "lo", 0x0000, 0x0000, ROM_NOMIRROR ) + ROM_CART_LOAD( "hi", 0x4000, 0x0000, ROM_NOMIRROR ) + + ROM_REGION( 0xf5, PLA_TAG, 0 ) + ROM_LOAD( "251641-02.u7", 0x00, 0xf5, NO_DUMP ) +ROM_END + + +//------------------------------------------------- +// ROM( v364 ) +//------------------------------------------------- + +ROM_START( v364 ) + ROM_REGION( 0x8000, "kernal", 0 ) + ROM_LOAD( "318006-01", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) + ROM_LOAD( "kern364p", 0x4000, 0x4000, CRC(84fd4f7a) SHA1(b9a5b5dacd57ca117ef0b3af29e91998bf4d7e5f) ) + + ROM_REGION( 0x8000, "function", 0 ) + ROM_LOAD( "317053-01", 0x0000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f) ) + ROM_LOAD( "317054-01", 0x4000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693) ) + + ROM_REGION( 0x8000, "c2", 0 ) + ROM_LOAD( "spk3cc4.bin", 0x0000, 0x4000, CRC(5227c2ee) SHA1(59af401cbb2194f689898271c6e8aafa28a7af11) ) ROM_REGION( 0xf5, PLA_TAG, 0 ) ROM_LOAD( "251641-02", 0x00, 0xf5, NO_DUMP ) @@ -1082,31 +1165,31 @@ ROM_END //------------------------------------------------- -// ROM( c16 ) +// ROM( c16n ) //------------------------------------------------- -ROM_START( c16 ) +ROM_START( c16n ) ROM_REGION( 0x8000, "kernal", 0 ) - ROM_LOAD( "318006-01.u3", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) - ROM_DEFAULT_BIOS("r5") - ROM_SYSTEM_BIOS( 0, "r3", "Revision 3" ) - ROMX_LOAD( "318004-03.u4", 0x4000, 0x4000, CRC(77bab934) SHA1(97814dab9d757fe5a3a61d357a9a81da588a9783), ROM_BIOS(1) ) - ROM_SYSTEM_BIOS( 1, "r4", "Revision 4" ) - ROMX_LOAD( "318004-04.u4", 0x4000, 0x4000, CRC(be54ed79) SHA1(514ad3c29d01a2c0a3b143d9c1d4143b1912b793), ROM_BIOS(2) ) - ROM_SYSTEM_BIOS( 2, "r5", "Revision 5" ) - ROMX_LOAD( "318004-05.u4", 0x4000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb), ROM_BIOS(3) ) + ROM_SYSTEM_BIOS( 0, "r4", "Revision 4" ) + ROMX_LOAD( "318005-04.u24", 0x4000, 0x4000, CRC(799a633d) SHA1(5df52c693387c0e2b5d682613a3b5a65477311cf), ROM_BIOS(1) ) + ROM_SYSTEM_BIOS( 1, "r5", "Revision 5" ) + ROMX_LOAD( "318005-05.u24", 0x4000, 0x4000, CRC(70295038) SHA1(a3d9e5be091b98de39a046ab167fb7632d053682), ROM_BIOS(2) ) + ROM_SYSTEM_BIOS( 2, "jiffydos", "JiffyDOS v6.01" ) + ROMX_LOAD( "jiffydos plus4.u24", 0x0000, 0x8000, CRC(818d3f45) SHA1(9bc1b1c3da9ca642deae717905f990d8e36e6c3b), ROM_BIOS(3) ) // first half contains R5 kernal + + ROM_LOAD( "318006-01.u23", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) ROM_REGION( 0xf5, PLA_TAG, 0 ) - ROM_LOAD( "251641-02.u16", 0x00, 0xf5, NO_DUMP ) + ROM_LOAD( "251641-02.u19", 0x00, 0xf5, NO_DUMP ) ROM_END //------------------------------------------------- -// ROM( c116 ) +// ROM( c16p ) //------------------------------------------------- -ROM_START( c116 ) +ROM_START( c16p ) ROM_REGION( 0x8000, "kernal", 0 ) ROM_LOAD( "318006-01.u3", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) @@ -1119,7 +1202,7 @@ ROM_START( c116 ) ROMX_LOAD( "318004-05.u4", 0x4000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb), ROM_BIOS(3) ) ROM_REGION( 0xf5, PLA_TAG, 0 ) - ROM_LOAD( "251641-02.u101", 0x00, 0xf5, NO_DUMP ) + ROM_LOAD( "251641-02.u16", 0x00, 0xf5, NO_DUMP ) ROM_END @@ -1143,37 +1226,23 @@ ROM_END //------------------------------------------------- -// ROM( c232 ) -//------------------------------------------------- - -ROM_START( c232 ) - ROM_REGION( 0x8000, "kernal", 0 ) - ROM_LOAD( "318006-01.u4", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) - ROM_LOAD( "318004-01.u5", 0x4000, 0x4000, CRC(dbdc3319) SHA1(3c77caf72914c1c0a0875b3a7f6935cd30c54201) ) - - ROM_REGION( 0x8000, "function", ROMREGION_ERASE00 ) - - ROM_REGION( 0xf5, PLA_TAG, 0 ) - ROM_LOAD( "251641-02.u7", 0x00, 0xf5, NO_DUMP ) -ROM_END - - -//------------------------------------------------- -// ROM( v364 ) +// ROM( c116 ) //------------------------------------------------- -ROM_START( v364 ) +ROM_START( c116 ) ROM_REGION( 0x8000, "kernal", 0 ) - ROM_LOAD( "318006-01", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) - ROM_LOAD( "kern364p", 0x4000, 0x4000, CRC(84fd4f7a) SHA1(b9a5b5dacd57ca117ef0b3af29e91998bf4d7e5f) ) + ROM_LOAD( "318006-01.u3", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) - ROM_REGION( 0x10000, "function", 0 ) - ROM_LOAD( "317053-01", 0x0000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f) ) - ROM_LOAD( "317054-01", 0x4000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693) ) - ROM_LOAD( "spk3cc4.bin", 0x8000, 0x4000, CRC(5227c2ee) SHA1(59af401cbb2194f689898271c6e8aafa28a7af11) ) + ROM_DEFAULT_BIOS("r5") + ROM_SYSTEM_BIOS( 0, "r3", "Revision 3" ) + ROMX_LOAD( "318004-03.u4", 0x4000, 0x4000, CRC(77bab934) SHA1(97814dab9d757fe5a3a61d357a9a81da588a9783), ROM_BIOS(1) ) + ROM_SYSTEM_BIOS( 1, "r4", "Revision 4" ) + ROMX_LOAD( "318004-04.u4", 0x4000, 0x4000, CRC(be54ed79) SHA1(514ad3c29d01a2c0a3b143d9c1d4143b1912b793), ROM_BIOS(2) ) + ROM_SYSTEM_BIOS( 2, "r5", "Revision 5" ) + ROMX_LOAD( "318004-05.u4", 0x4000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb), ROM_BIOS(3) ) ROM_REGION( 0xf5, PLA_TAG, 0 ) - ROM_LOAD( "251641-02", 0x00, 0xf5, NO_DUMP ) + ROM_LOAD( "251641-02.u101", 0x00, 0xf5, NO_DUMP ) ROM_END @@ -1183,11 +1252,12 @@ ROM_END //************************************************************************** // YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS -COMP( 1983, c264, 0, 0, ntsc, plus4, driver_device, 0, "Commodore Business Machines", "Commodore 264 (Prototype)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) +COMP( 1984, c264, 0, 0, ntsc, plus4, driver_device, 0, "Commodore Business Machines", "Commodore 264 (Prototype)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) +COMP( 1984, c232, c264, 0, c232, plus4, driver_device, 0, "Commodore Business Machines", "Commodore 232 (Prototype)", GAME_SUPPORTS_SAVE ) +COMP( 1984, v364, c264, 0, v364, plus4, driver_device, 0, "Commodore Business Machines", "Commodore V364 (Prototype)", GAME_SUPPORTS_SAVE ) COMP( 1984, plus4n, c264, 0, ntsc, plus4, driver_device, 0, "Commodore Business Machines", "Plus/4 (NTSC)", GAME_SUPPORTS_SAVE ) COMP( 1984, plus4p, c264, 0, pal, plus4, driver_device, 0, "Commodore Business Machines", "Plus/4 (PAL)", GAME_SUPPORTS_SAVE ) -COMP( 1984, c16, c264, 0, c16, c16, driver_device, 0, "Commodore Business Machines", "Commodore 16", GAME_SUPPORTS_SAVE ) -COMP( 1984, c16h, c264, 0, c16, c16, driver_device, 0, "Commodore Business Machines", "Commodore 16 (Hungary)", GAME_SUPPORTS_SAVE ) -COMP( 1984, c116, c264, 0, c16, c16, driver_device, 0, "Commodore Business Machines", "Commodore 116", GAME_SUPPORTS_SAVE ) -COMP( 1984, c232, c264, 0, c232, plus4, driver_device, 0, "Commodore Business Machines", "Commodore 232 (Prototype)", GAME_SUPPORTS_SAVE ) -COMP( 1985, v364, c264, 0, v364, plus4, driver_device, 0, "Commodore Business Machines", "Commodore V364 (Prototype)", GAME_SUPPORTS_SAVE ) +COMP( 1984, c16n, c264, 0, c16n, c16, driver_device, 0, "Commodore Business Machines", "Commodore 16 (NTSC)", GAME_SUPPORTS_SAVE ) +COMP( 1984, c16p, c264, 0, c16p, c16, driver_device, 0, "Commodore Business Machines", "Commodore 16 (PAL)", GAME_SUPPORTS_SAVE ) +COMP( 1984, c16h, c264, 0, c16p, c16, driver_device, 0, "Commodore Business Machines", "Commodore 16 (Hungary)", GAME_SUPPORTS_SAVE ) +COMP( 1984, c116, c264, 0, c16p, c16, driver_device, 0, "Commodore Business Machines", "Commodore 116", GAME_SUPPORTS_SAVE ) diff --git a/src/mess/drivers/vic10.c b/src/mess/drivers/vic10.c index 10ac12e7b6e..763ae93dc83 100644 --- a/src/mess/drivers/vic10.c +++ b/src/mess/drivers/vic10.c @@ -39,7 +39,7 @@ READ8_MEMBER( vic10_state::read ) { // TODO this is really handled by the PLA - UINT8 data = 0; + UINT8 data = m_vic->bus_r(); int lorom = 1, uprom = 1, exram = 1; if (offset < 0x800) @@ -75,9 +75,7 @@ READ8_MEMBER( vic10_state::read ) uprom = 0; } - data |= m_exp->cd_r(space, offset, lorom, uprom, exram); - - return data; + return m_exp->cd_r(space, offset, data, lorom, uprom, exram); } @@ -253,46 +251,43 @@ static MOS6566_INTERFACE( vic_intf ) // sid6581_interface sid_intf //------------------------------------------------- -static int vic10_paddle_read( device_t *device, int which ) +UINT8 vic10_state::paddle_read(int which) { - running_machine &machine = device->machine(); - vic10_state *state = device->machine().driver_data<vic10_state>(); - int pot1 = 0xff, pot2 = 0xff, pot3 = 0xff, pot4 = 0xff, temp; - UINT8 cia0porta = mos6526_pa_r(state->m_cia, 0); - int controller1 = machine.root_device().ioport("CTRLSEL")->read() & 0x07; - int controller2 = machine.root_device().ioport("CTRLSEL")->read() & 0x70; + UINT8 cia0porta = mos6526_pa_r(m_cia, 0); + int controller1 = ioport("CTRLSEL")->read() & 0x07; + int controller2 = ioport("CTRLSEL")->read() & 0x70; // Notice that only a single input is defined for Mouse & Lightpen in both ports switch (controller1) { case 0x01: if (which) - pot2 = machine.root_device().ioport("PADDLE2")->read(); + pot2 = ioport("PADDLE2")->read(); else - pot1 = machine.root_device().ioport("PADDLE1")->read(); + pot1 = ioport("PADDLE1")->read(); break; case 0x02: if (which) - pot2 = machine.root_device().ioport("TRACKY")->read(); + pot2 = ioport("TRACKY")->read(); else - pot1 = machine.root_device().ioport("TRACKX")->read(); + pot1 = ioport("TRACKX")->read(); break; case 0x03: - if (which && (machine.root_device().ioport("JOY1_2B")->read() & 0x20)) // Joy1 Button 2 + if (which && (ioport("JOY1_2B")->read() & 0x20)) // Joy1 Button 2 pot1 = 0x00; break; case 0x04: if (which) - pot2 = machine.root_device().ioport("LIGHTY")->read(); + pot2 = ioport("LIGHTY")->read(); else - pot1 = machine.root_device().ioport("LIGHTX")->read(); + pot1 = ioport("LIGHTX")->read(); break; case 0x06: - if (which && (machine.root_device().ioport("OTHER")->read() & 0x04)) // Lightpen Signal + if (which && (ioport("OTHER")->read() & 0x04)) // Lightpen Signal pot2 = 0x00; break; @@ -309,32 +304,32 @@ static int vic10_paddle_read( device_t *device, int which ) { case 0x10: if (which) - pot4 = machine.root_device().ioport("PADDLE4")->read(); + pot4 = ioport("PADDLE4")->read(); else - pot3 = machine.root_device().ioport("PADDLE3")->read(); + pot3 = ioport("PADDLE3")->read(); break; case 0x20: if (which) - pot4 = machine.root_device().ioport("TRACKY")->read(); + pot4 = ioport("TRACKY")->read(); else - pot3 = machine.root_device().ioport("TRACKX")->read(); + pot3 = ioport("TRACKX")->read(); break; case 0x30: - if (which && (machine.root_device().ioport("JOY2_2B")->read() & 0x20)) // Joy2 Button 2 + if (which && (ioport("JOY2_2B")->read() & 0x20)) // Joy2 Button 2 pot4 = 0x00; break; case 0x40: if (which) - pot4 = machine.root_device().ioport("LIGHTY")->read(); + pot4 = ioport("LIGHTY")->read(); else - pot3 = machine.root_device().ioport("LIGHTX")->read(); + pot3 = ioport("LIGHTX")->read(); break; case 0x60: - if (which && (machine.root_device().ioport("OTHER")->read() & 0x04)) // Lightpen Signal + if (which && (ioport("OTHER")->read() & 0x04)) // Lightpen Signal pot4 = 0x00; break; @@ -347,7 +342,7 @@ static int vic10_paddle_read( device_t *device, int which ) break; } - if (machine.root_device().ioport("CTRLSEL")->read() & 0x80) // Swap + if (ioport("CTRLSEL")->read() & 0x80) // Swap { temp = pot1; pot1 = pot3; pot3 = temp; temp = pot2; pot2 = pot4; pot4 = temp; @@ -369,9 +364,20 @@ static int vic10_paddle_read( device_t *device, int which ) } } -static const sid6581_interface sid_intf = +READ8_MEMBER( vic10_state::sid_potx_r ) +{ + return paddle_read(0); +} + +READ8_MEMBER( vic10_state::sid_poty_r ) +{ + return paddle_read(1); +} + +static MOS6581_INTERFACE( sid_intf ) { - vic10_paddle_read + DEVCB_DRIVER_MEMBER(vic10_state, sid_potx_r), + DEVCB_DRIVER_MEMBER(vic10_state, sid_poty_r) }; diff --git a/src/mess/drivers/vic20.c b/src/mess/drivers/vic20.c index b1b2832a5df..6486ad8f403 100644 --- a/src/mess/drivers/vic20.c +++ b/src/mess/drivers/vic20.c @@ -123,7 +123,7 @@ enum READ8_MEMBER( vic20_state::read ) { - UINT8 data = 0; + UINT8 data = mos6560_bus_r(m_vic); int ram1 = 1, ram2 = 1, ram3 = 1; int blk1 = 1, blk2 = 1, blk3 = 1, blk5 = 1; @@ -194,9 +194,7 @@ READ8_MEMBER( vic20_state::read ) break; } - data |= m_exp->cd_r(space, offset & 0x1fff, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3); - - return data; + return m_exp->cd_r(space, offset & 0x1fff, data, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3); } @@ -450,15 +448,13 @@ READ8_MEMBER( vic20_state::via0_pa_r ) data |= m_user->joy1_r() << 3; data |= m_user->joy2_r() << 4; data |= m_user->light_pen_r() << 5; - data |= m_user->cassette_switch_r() << 6; + + // cassette switch + data |= (m_user->cassette_switch_r() && m_cassette->sense_r()) << 6; // joystick data &= ~(ioport("JOY")->read() & 0x3c); - // cassette switch - if ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED) - data &= ~0x40; - return data; } @@ -483,20 +479,6 @@ WRITE8_MEMBER( vic20_state::via0_pa_w ) m_iec->atn_w(!BIT(data, 7)); } -WRITE_LINE_MEMBER( vic20_state::via0_ca2_w ) -{ - if (!state) - { - m_cassette->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); - m_cassette_timer->enable(true); - } - else - { - m_cassette->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); - m_cassette_timer->enable(false); - } -} - static const via6522_interface via0_intf = { DEVCB_DRIVER_MEMBER(vic20_state, via0_pa_r), @@ -509,7 +491,7 @@ static const via6522_interface via0_intf = DEVCB_DEVICE_MEMBER(VIC20_USER_PORT_TAG, vic20_user_port_device, pb_w), DEVCB_NULL, DEVCB_DEVICE_LINE_MEMBER(VIC20_USER_PORT_TAG, vic20_user_port_device, cb1_w), - DEVCB_DRIVER_LINE_MEMBER(vic20_state, via0_ca2_w), // CASS MOTOR + DEVCB_DEVICE_LINE_MEMBER(PET_DATASSETTE_PORT_TAG, pet_datassette_port_device, motor_w), DEVCB_DEVICE_LINE_MEMBER(VIC20_USER_PORT_TAG, vic20_user_port_device, cb2_w), DEVCB_CPU_INPUT_LINE(M6502_TAG, INPUT_LINE_NMI) }; @@ -593,7 +575,7 @@ WRITE8_MEMBER( vic20_state::via1_pb_w ) */ // cassette write - m_cassette->output(BIT(data, 3) ? -(0x5a9e >> 1) : +(0x5a9e >> 1)); + m_cassette->write(BIT(data, 3)); // keyboard column m_key_col = data; @@ -615,7 +597,7 @@ static const via6522_interface via1_intf = { DEVCB_DRIVER_MEMBER(vic20_state, via1_pa_r), DEVCB_DRIVER_MEMBER(vic20_state, via1_pb_r), - DEVCB_NULL, // CASS READ + DEVCB_DEVICE_LINE_MEMBER(PET_DATASSETTE_PORT_TAG, pet_datassette_port_device, read), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, @@ -632,16 +614,13 @@ static const via6522_interface via1_intf = //------------------------------------------------- -// TIMER_DEVICE_CALLBACK( cassette_tick ) +// PET_DATASSETTE_PORT_INTERFACE( datassette_intf ) //------------------------------------------------- -static TIMER_DEVICE_CALLBACK( cassette_tick ) +static PET_DATASSETTE_PORT_INTERFACE( datassette_intf ) { - vic20_state *state = timer.machine().driver_data<vic20_state>(); - int data = (state->m_cassette->input() > +0.0) ? 1 : 0; - - state->m_via1->write_ca1(data); -} + DEVCB_DEVICE_LINE_MEMBER(M6522_1_TAG, via6522_device, write_ca1), +}; //------------------------------------------------- @@ -808,15 +787,13 @@ void vic20_state::machine_reset() //------------------------------------------------- static MACHINE_CONFIG_START( vic20_common, vic20_state ) - MCFG_TIMER_ADD_PERIODIC(TIMER_C1530_TAG, cassette_tick, attotime::from_hz(44100)) - // devices MCFG_VIA6522_ADD(M6522_0_TAG, 0, via0_intf) MCFG_VIA6522_ADD(M6522_1_TAG, 0, via1_intf) MCFG_QUICKLOAD_ADD("quickload", cbm_vc20, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) - MCFG_CASSETTE_ADD(CASSETTE_TAG, cbm_cassette_interface ) + MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, "c1530", NULL) MCFG_CBM_IEC_ADD(cbm_iec_intf, "c1541") MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vic20_control_port_devices, NULL, NULL) diff --git a/src/mess/includes/c128.h b/src/mess/includes/c128.h index 8f64d42563c..b87fef21fc1 100644 --- a/src/mess/includes/c128.h +++ b/src/mess/includes/c128.h @@ -32,6 +32,9 @@ public: DECLARE_WRITE_LINE_MEMBER( vic_interrupt ); DECLARE_READ8_MEMBER( vic_rdy_cb ); + DECLARE_READ8_MEMBER( sid_potx_r ); + DECLARE_READ8_MEMBER( sid_poty_r ); + UINT8 *m_c128_basic; UINT8 *m_c128_kernal; UINT8 *m_c128_chargen; diff --git a/src/mess/includes/c64.h b/src/mess/includes/c64.h index b7b776e1145..b212220df61 100644 --- a/src/mess/includes/c64.h +++ b/src/mess/includes/c64.h @@ -12,6 +12,7 @@ #include "machine/c64user.h" #include "machine/cbmiec.h" #include "machine/cbmipt.h" +#include "machine/petcass.h" #include "machine/pls100.h" #include "machine/ram.h" #include "machine/vcsctrl.h" @@ -27,7 +28,6 @@ #define MOS6526_2_TAG "u2" #define PLA_TAG "u17" #define SCREEN_TAG "screen" -#define TIMER_C1531_TAG "c1531" #define CONTROL1_TAG "joy1" #define CONTROL2_TAG "joy2" @@ -48,8 +48,7 @@ public: m_exp(*this, C64_EXPANSION_SLOT_TAG), m_user(*this, C64_USER_PORT_TAG), m_ram(*this, RAM_TAG), - m_cassette(*this, CASSETTE_TAG), - m_cassette_timer(*this, TIMER_C1531_TAG), + m_cassette(*this, PET_DATASSETTE_PORT_TAG), m_loram(1), m_hiram(1), m_charen(1), @@ -77,8 +76,7 @@ public: required_device<c64_expansion_slot_device> m_exp; required_device<c64_user_port_device> m_user; required_device<ram_device> m_ram; - optional_device<cassette_image_device> m_cassette; - optional_device<timer_device> m_cassette_timer; + optional_device<pet_datassette_port_device> m_cassette; virtual void machine_start(); virtual void machine_reset(); @@ -97,6 +95,9 @@ public: DECLARE_READ8_MEMBER( vic_lightpen_button_cb ); DECLARE_READ8_MEMBER( vic_rdy_cb ); + DECLARE_READ8_MEMBER( sid_potx_r ); + DECLARE_READ8_MEMBER( sid_poty_r ); + DECLARE_WRITE_LINE_MEMBER( cia1_irq_w ); DECLARE_READ8_MEMBER( cia1_pa_r ); DECLARE_READ8_MEMBER( cia1_pb_r ); @@ -109,6 +110,8 @@ public: DECLARE_READ8_MEMBER( cpu_r ); DECLARE_WRITE8_MEMBER( cpu_w ); + DECLARE_WRITE_LINE_MEMBER( tape_read_w ); + DECLARE_WRITE_LINE_MEMBER( iec_srq_w ); DECLARE_READ8_MEMBER( exp_dma_r ); @@ -179,5 +182,7 @@ public: }; +int c64_paddle_read (device_t *device, int which); + #endif diff --git a/src/mess/includes/c65.h b/src/mess/includes/c65.h index 8fe7dbdee99..424aa226c16 100644 --- a/src/mess/includes/c65.h +++ b/src/mess/includes/c65.h @@ -59,6 +59,9 @@ public: int m_io_dc00_on; DECLARE_DRIVER_INIT(c65); DECLARE_DRIVER_INIT(c65pal); + + DECLARE_READ8_MEMBER( sid_potx_r ); + DECLARE_READ8_MEMBER( sid_poty_r ); }; diff --git a/src/mess/includes/compis.h b/src/mess/includes/compis.h index 0c8c35551ea..01816c631ad 100644 --- a/src/mess/includes/compis.h +++ b/src/mess/includes/compis.h @@ -23,6 +23,7 @@ #include "machine/pic8259.h" #include "machine/mm58274c.h" #include "machine/upd765.h" +#include "machine/compiskb.h" #include "imagedev/flopdrv.h" #include "formats/cpis_dsk.h" diff --git a/src/mess/includes/huebler.h b/src/mess/includes/huebler.h index 1ea6b69586d..30db07b0771 100644 --- a/src/mess/includes/huebler.h +++ b/src/mess/includes/huebler.h @@ -8,7 +8,14 @@ #define Z80PIO1_TAG "z80pio1" #define Z80PIO2_TAG "z80pio2" +#include "emu.h" +#include "cpu/z80/z80.h" +#include "cpu/z80/z80daisy.h" #include "imagedev/cassette.h" +#include "machine/ram.h" +#include "machine/z80pio.h" +#include "machine/z80dart.h" +#include "machine/z80ctc.h" class amu880_state : public driver_device { @@ -18,9 +25,9 @@ public: m_cassette(*this, CASSETTE_TAG), m_key_d6(0), m_key_d7(0), - m_key_a8(1) - , - m_video_ram(*this, "video_ram"){ } + m_key_a8(1), + m_video_ram(*this, "video_ram") + { } required_device<cassette_image_device> m_cassette; diff --git a/src/mess/includes/plus4.h b/src/mess/includes/plus4.h index 85b724b2073..6bea2a69a3a 100644 --- a/src/mess/includes/plus4.h +++ b/src/mess/includes/plus4.h @@ -14,6 +14,7 @@ #include "machine/cbmiec.h" #include "machine/cbmipt.h" #include "machine/mos6529.h" +#include "machine/petcass.h" #include "machine/pls100.h" #include "machine/ram.h" @@ -25,7 +26,6 @@ #define T6721_TAG "t6721" #define PLA_TAG "u19" #define SCREEN_TAG "screen" -#define CASSETTE_TAG "cassette" class plus4_state : public driver_device { @@ -43,8 +43,9 @@ public: m_exp(*this, PLUS4_EXPANSION_SLOT_TAG), m_user(*this, PLUS4_USER_PORT_TAG), m_ram(*this, RAM_TAG), - m_cassette(*this, CASSETTE_TAG), + m_cassette(*this, PET_DATASSETTE_PORT_TAG), m_function(NULL), + m_c2(NULL), m_addr(0), m_rom_en(1), m_ted_irq(CLEAR_LINE), @@ -63,7 +64,7 @@ public: required_device<plus4_expansion_slot_device> m_exp; optional_device<plus4_user_port_device> m_user; required_device<ram_device> m_ram; - required_device<cassette_image_device> m_cassette; + required_device<pet_datassette_port_device> m_cassette; virtual void machine_start(); virtual void machine_reset(); @@ -95,6 +96,7 @@ public: // memory state const UINT8 *m_kernal; const UINT8 *m_function; + const UINT8 *m_c2; UINT8 m_addr; int m_rom_en; diff --git a/src/mess/includes/vic10.h b/src/mess/includes/vic10.h index d20ddcb2d0b..8c7b658fe24 100644 --- a/src/mess/includes/vic10.h +++ b/src/mess/includes/vic10.h @@ -51,6 +51,7 @@ public: virtual void machine_reset(); void check_interrupts(); + UINT8 paddle_read(int which); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -62,12 +63,18 @@ public: DECLARE_READ8_MEMBER( vic_lightpen_y_cb ); DECLARE_READ8_MEMBER( vic_lightpen_button_cb ); DECLARE_READ8_MEMBER( vic_rdy_cb ); + + DECLARE_READ8_MEMBER( sid_potx_r ); + DECLARE_READ8_MEMBER( sid_poty_r ); + DECLARE_WRITE_LINE_MEMBER( cia_irq_w ); DECLARE_READ8_MEMBER( cia_pa_r ); DECLARE_READ8_MEMBER( cia_pb_r ); DECLARE_WRITE8_MEMBER( cia_pb_w ); + DECLARE_READ8_MEMBER( cpu_r ); DECLARE_WRITE8_MEMBER( cpu_w ); + DECLARE_WRITE_LINE_MEMBER( exp_irq_w ); // video state diff --git a/src/mess/includes/vic20.h b/src/mess/includes/vic20.h index 15ea8953593..10f71146eb6 100644 --- a/src/mess/includes/vic20.h +++ b/src/mess/includes/vic20.h @@ -13,6 +13,7 @@ #include "machine/cbmiec.h" #include "machine/cbmipt.h" #include "machine/ieee488.h" +#include "machine/petcass.h" #include "machine/ram.h" #include "machine/vcsctrl.h" #include "machine/vic20exp.h" @@ -26,7 +27,6 @@ #define M6560_TAG "ub7" #define M6561_TAG "ub7" #define IEC_TAG "iec" -#define TIMER_C1530_TAG "c1530" #define SCREEN_TAG "screen" #define CONTROL1_TAG "joy1" #define CONTROL2_TAG "joy2" @@ -45,9 +45,8 @@ public: m_joy2(*this, CONTROL2_TAG), m_exp(*this, VIC20_EXPANSION_SLOT_TAG), m_user(*this, VIC20_USER_PORT_TAG), - m_cassette(*this, CASSETTE_TAG), - m_ram(*this, RAM_TAG), - m_cassette_timer(*this, TIMER_C1530_TAG) + m_cassette(*this, PET_DATASSETTE_PORT_TAG), + m_ram(*this, RAM_TAG) { } required_device<cpu_device> m_maincpu; @@ -59,9 +58,8 @@ public: required_device<vcs_control_port_device> m_joy2; required_device<vic20_expansion_slot_device> m_exp; required_device<vic20_user_port_device> m_user; - required_device<cassette_image_device> m_cassette; + required_device<pet_datassette_port_device> m_cassette; required_device<ram_device> m_ram; - required_device<timer_device> m_cassette_timer; virtual void machine_start(); virtual void machine_reset(); @@ -71,7 +69,6 @@ public: DECLARE_READ8_MEMBER( via0_pa_r ); DECLARE_WRITE8_MEMBER( via0_pa_w ); - DECLARE_WRITE_LINE_MEMBER( via0_ca2_w ); DECLARE_READ8_MEMBER( via1_pa_r ); DECLARE_READ8_MEMBER( via1_pb_r ); diff --git a/src/mess/machine/c128_comal80.c b/src/mess/machine/c128_comal80.c index 77e1c51970f..97e22ce6f08 100644 --- a/src/mess/machine/c128_comal80.c +++ b/src/mess/machine/c128_comal80.c @@ -59,10 +59,8 @@ void c128_comal80_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c128_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c128_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!romh) { offs_t addr = (m_bank << 14) | (offset & 0x3fff); diff --git a/src/mess/machine/c128_comal80.h b/src/mess/machine/c128_comal80.h index e9120b54d06..a509167aa4d 100644 --- a/src/mess/machine/c128_comal80.h +++ b/src/mess/machine/c128_comal80.h @@ -38,7 +38,7 @@ protected: virtual void device_config_complete() { m_shortname = "c128_comal80"; } // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c1551.c b/src/mess/machine/c1551.c index 00d83145fab..54de372df92 100644 --- a/src/mess/machine/c1551.c +++ b/src/mess/machine/c1551.c @@ -571,9 +571,9 @@ bool c1551_device::tpi1_selected(offs_t offset) // plus4_cd_r - cartridge data read //------------------------------------------------- -UINT8 c1551_device::plus4_cd_r(address_space &space, offs_t offset, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) +UINT8 c1551_device::plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { - UINT8 data = m_exp->cd_r(space, offset, ba, cs0, c1l, c2l, cs1, c1h, c2h); + data = m_exp->cd_r(space, offset, data, ba, cs0, c1l, c2l, cs1, c1h, c2h); if (tpi1_selected(offset)) { diff --git a/src/mess/machine/c1551.h b/src/mess/machine/c1551.h index 12bade8cbff..d4c49f7891a 100644 --- a/src/mess/machine/c1551.h +++ b/src/mess/machine/c1551.h @@ -77,7 +77,7 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); // device_plus4_expansion_card_interface overrides - virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h); + virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h); virtual void plus4_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h); virtual UINT32 plus4_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); virtual void plus4_breset_w(int state); diff --git a/src/mess/machine/c2n.c b/src/mess/machine/c2n.c new file mode 100644 index 00000000000..d954b70f02e --- /dev/null +++ b/src/mess/machine/c2n.c @@ -0,0 +1,153 @@ +/********************************************************************** + + Commodore C2N/1530/1531 Datassette emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#include "c2n.h" + + + +//************************************************************************** +// MACROS / CONSTANTS +//************************************************************************** + +#define CASSETTE_TAG "cassette" + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type C1530 = &device_creator<c1530_device>; +const device_type C1531 = &device_creator<c1531_device>; + + +//------------------------------------------------- +// MACHINE_CONFIG( c2n ) +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( c2n ) + MCFG_CASSETTE_ADD(CASSETTE_TAG, cbm_cassette_interface ) +MACHINE_CONFIG_END + + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor c2n_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( c2n ); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// c2n_device - constructor +//------------------------------------------------- + +c2n_device::c2n_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, type, name, tag, owner, clock), + device_pet_datassette_port_interface(mconfig, *this), + m_cassette(*this, CASSETTE_TAG) +{ +} + + +//------------------------------------------------- +// c1530_device - constructor +//------------------------------------------------- + +c1530_device::c1530_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : c2n_device(mconfig, C1530, "C1530", tag, owner, clock) { } + + +//------------------------------------------------- +// c1531_device - constructor +//------------------------------------------------- + +c1531_device::c1531_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : c2n_device(mconfig, C1531, "C1531", tag, owner, clock) { } + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void c2n_device::device_start() +{ + // allocate timers + m_read_timer = timer_alloc(); + m_read_timer->adjust(attotime::from_hz(44100), 0, attotime::from_hz(44100)); +} + + +//------------------------------------------------- +// device_timer - handler timer events +//------------------------------------------------- + +void c2n_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + int input = (m_cassette->input() > +0.0) ? 1 : 0; + + m_slot->read_w(input); +} + + +//------------------------------------------------- +// datassette_read - read data +//------------------------------------------------- + +int c2n_device::datassette_read() +{ + return (m_cassette->input() > +0.0) ? 1 : 0; +} + + +//------------------------------------------------- +// datassette_write - write data +//------------------------------------------------- + +void c2n_device::datassette_write(int state) +{ + m_cassette->output(state ? -(0x5a9e >> 1) : +(0x5a9e >> 1)); +} + + +//------------------------------------------------- +// datassette_sense - switch sense +//------------------------------------------------- + +int c2n_device::datassette_sense() +{ + return (m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED; +} + + +//------------------------------------------------- +// datassette_motor - motor +//------------------------------------------------- + +void c2n_device::datassette_motor(int state) +{ + if (!state) + { + m_cassette->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); + m_read_timer->enable(true); + } + else + { + m_cassette->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); + m_read_timer->enable(false); + } +} diff --git a/src/mess/machine/c2n.h b/src/mess/machine/c2n.h new file mode 100644 index 00000000000..7de4c281aa4 --- /dev/null +++ b/src/mess/machine/c2n.h @@ -0,0 +1,85 @@ +/********************************************************************** + + Commodore C2N/1530/1531 Datassette emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#pragma once + +#ifndef __C2N__ +#define __C2N__ + + +#include "emu.h" +#include "includes/cbm.h" +#include "machine/petcass.h" + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> c2n_device + +class c2n_device : public device_t, + public device_pet_datassette_port_interface +{ + +public: + // construction/destruction + c2n_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + +protected: + // device-level overrides + virtual void device_config_complete() { m_shortname = "c2n"; } + virtual void device_start(); + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); + + // device_pet_datassette_port_interface overrides + virtual int datassette_read(); + virtual void datassette_write(int state); + virtual int datassette_sense(); + virtual void datassette_motor(int state); + +private: + required_device<cassette_image_device> m_cassette; + + // timers + emu_timer *m_read_timer; +}; + + +// ======================> c1530_device + +class c1530_device : public c2n_device +{ +public: + // construction/destruction + c1530_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + +// ======================> c1531_device + +class c1531_device : public c2n_device +{ +public: + // construction/destruction + c1531_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + +// device type definition +extern const device_type C1530; +extern const device_type C1531; + + + +#endif diff --git a/src/mess/machine/c64_16kb.c b/src/mess/machine/c64_16kb.c index b8945ef8b25..6887e9494ef 100644 --- a/src/mess/machine/c64_16kb.c +++ b/src/mess/machine/c64_16kb.c @@ -132,10 +132,8 @@ void c64_16kb_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_16kb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_16kb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { data = m_roml[offset & 0x1fff]; diff --git a/src/mess/machine/c64_16kb.h b/src/mess/machine/c64_16kb.h index 7b68a740bac..b0e2e17fa2c 100644 --- a/src/mess/machine/c64_16kb.h +++ b/src/mess/machine/c64_16kb.h @@ -44,7 +44,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); }; diff --git a/src/mess/machine/c64_comal80.c b/src/mess/machine/c64_comal80.c index 74c1f3b437e..b362036df06 100644 --- a/src/mess/machine/c64_comal80.c +++ b/src/mess/machine/c64_comal80.c @@ -59,10 +59,8 @@ void c64_comal80_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml || !romh) { offs_t addr = (m_bank << 14) | (offset & 0x3fff); diff --git a/src/mess/machine/c64_comal80.h b/src/mess/machine/c64_comal80.h index c61bfce950e..eda53a7ca98 100644 --- a/src/mess/machine/c64_comal80.h +++ b/src/mess/machine/c64_comal80.h @@ -38,7 +38,7 @@ protected: virtual void device_config_complete() { m_shortname = "c64_comal80"; } // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_currah_speech.c b/src/mess/machine/c64_currah_speech.c index ef3a9ed883f..fb22143ffda 100644 --- a/src/mess/machine/c64_currah_speech.c +++ b/src/mess/machine/c64_currah_speech.c @@ -200,10 +200,8 @@ void c64_currah_speech_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_currah_speech_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_currah_speech_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!romh) { data = m_romh[offset & 0x1fff]; diff --git a/src/mess/machine/c64_currah_speech.h b/src/mess/machine/c64_currah_speech.h index 2be0299b624..f4e2ccf3463 100644 --- a/src/mess/machine/c64_currah_speech.h +++ b/src/mess/machine/c64_currah_speech.h @@ -43,7 +43,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_dela_ep256.c b/src/mess/machine/c64_dela_ep256.c index 76966889aa4..71a3b7bca48 100644 --- a/src/mess/machine/c64_dela_ep256.c +++ b/src/mess/machine/c64_dela_ep256.c @@ -126,10 +126,8 @@ void c64_dela_ep256_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_dela_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_dela_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { if (m_reset) diff --git a/src/mess/machine/c64_dela_ep256.h b/src/mess/machine/c64_dela_ep256.h index 878162278f8..83659a34a61 100644 --- a/src/mess/machine/c64_dela_ep256.h +++ b/src/mess/machine/c64_dela_ep256.h @@ -43,7 +43,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_dela_ep64.c b/src/mess/machine/c64_dela_ep64.c index 61202d6eb92..56a6b71fd04 100644 --- a/src/mess/machine/c64_dela_ep64.c +++ b/src/mess/machine/c64_dela_ep64.c @@ -110,10 +110,8 @@ void c64_dela_ep64_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_dela_ep64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_dela_ep64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { if (m_reset) diff --git a/src/mess/machine/c64_dela_ep64.h b/src/mess/machine/c64_dela_ep64.h index a1b5f806c22..285336e8322 100644 --- a/src/mess/machine/c64_dela_ep64.h +++ b/src/mess/machine/c64_dela_ep64.h @@ -43,7 +43,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_dela_ep7x8.c b/src/mess/machine/c64_dela_ep7x8.c index 30e6c10fa32..b7a87a04042 100644 --- a/src/mess/machine/c64_dela_ep7x8.c +++ b/src/mess/machine/c64_dela_ep7x8.c @@ -120,10 +120,8 @@ void c64_dela_ep7x8_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_dela_ep7x8_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_dela_ep7x8_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { offs_t addr = offset & 0x1fff; diff --git a/src/mess/machine/c64_dela_ep7x8.h b/src/mess/machine/c64_dela_ep7x8.h index 0799d630a2a..ef48600c4ac 100644 --- a/src/mess/machine/c64_dela_ep7x8.h +++ b/src/mess/machine/c64_dela_ep7x8.h @@ -43,7 +43,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_dinamic.c b/src/mess/machine/c64_dinamic.c index 3da700c5ffc..8bbfd09de52 100644 --- a/src/mess/machine/c64_dinamic.c +++ b/src/mess/machine/c64_dinamic.c @@ -59,10 +59,8 @@ void c64_dinamic_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_dinamic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_dinamic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { offs_t addr = (m_bank << 13) | (offset & 0x1fff); diff --git a/src/mess/machine/c64_dinamic.h b/src/mess/machine/c64_dinamic.h index d35fdb3ee12..495b1db67b7 100644 --- a/src/mess/machine/c64_dinamic.h +++ b/src/mess/machine/c64_dinamic.h @@ -38,7 +38,7 @@ protected: virtual void device_config_complete() { m_shortname = "c64_dinamic"; } // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: UINT8 m_bank; diff --git a/src/mess/machine/c64_dqbb.c b/src/mess/machine/c64_dqbb.c index caa59fb425f..300b57df197 100644 --- a/src/mess/machine/c64_dqbb.c +++ b/src/mess/machine/c64_dqbb.c @@ -76,10 +76,8 @@ void c64_dqbb_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_dqbb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_dqbb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!m_cs && (!roml || !romh)) { data = m_nvram[offset & 0x3fff]; diff --git a/src/mess/machine/c64_dqbb.h b/src/mess/machine/c64_dqbb.h index fdaea3e82dd..acb4dbaf6bc 100644 --- a/src/mess/machine/c64_dqbb.h +++ b/src/mess/machine/c64_dqbb.h @@ -45,7 +45,7 @@ protected: virtual void nvram_write(emu_file &file) { if (m_nvram != NULL) { file.write(m_nvram, m_nvram_size); } } // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_easy_calc_result.c b/src/mess/machine/c64_easy_calc_result.c index d5856a4ca90..fb66318bf87 100644 --- a/src/mess/machine/c64_easy_calc_result.c +++ b/src/mess/machine/c64_easy_calc_result.c @@ -80,10 +80,8 @@ void c64_easy_calc_result_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_easy_calc_result_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_easy_calc_result_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { data = m_roml[offset & 0x1fff]; diff --git a/src/mess/machine/c64_easy_calc_result.h b/src/mess/machine/c64_easy_calc_result.h index 93b6631da9d..23b6347c3c2 100644 --- a/src/mess/machine/c64_easy_calc_result.h +++ b/src/mess/machine/c64_easy_calc_result.h @@ -38,7 +38,7 @@ protected: virtual void device_config_complete() { m_shortname = "c64_easy_calc_result"; } // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_easyflash.c b/src/mess/machine/c64_easyflash.c index b73d6e0c864..1118c517dde 100644 --- a/src/mess/machine/c64_easyflash.c +++ b/src/mess/machine/c64_easyflash.c @@ -132,10 +132,8 @@ void c64_easyflash_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_easyflash_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_easyflash_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { offs_t addr = (m_bank << 13) | (offset & 0x1fff); diff --git a/src/mess/machine/c64_easyflash.h b/src/mess/machine/c64_easyflash.h index 7ec6958a35a..a06a0824294 100644 --- a/src/mess/machine/c64_easyflash.h +++ b/src/mess/machine/c64_easyflash.h @@ -45,7 +45,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram); virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); diff --git a/src/mess/machine/c64_epyx_fast_load.c b/src/mess/machine/c64_epyx_fast_load.c index b27126536f6..81098b4779d 100644 --- a/src/mess/machine/c64_epyx_fast_load.c +++ b/src/mess/machine/c64_epyx_fast_load.c @@ -80,10 +80,8 @@ void c64_epyx_fast_load_cartridge_device::device_timer(emu_timer &timer, device_ // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_epyx_fast_load_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_epyx_fast_load_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { m_exrom = 0; diff --git a/src/mess/machine/c64_epyx_fast_load.h b/src/mess/machine/c64_epyx_fast_load.h index 7818481432b..f8e51cf21df 100644 --- a/src/mess/machine/c64_epyx_fast_load.h +++ b/src/mess/machine/c64_epyx_fast_load.h @@ -39,7 +39,7 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_exos.c b/src/mess/machine/c64_exos.c index c287f235752..d592978e5ba 100644 --- a/src/mess/machine/c64_exos.c +++ b/src/mess/machine/c64_exos.c @@ -47,10 +47,8 @@ void c64_exos_cartridge_device::device_start() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_exos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_exos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!romh) { data = m_romh[offset & 0x1fff]; diff --git a/src/mess/machine/c64_exos.h b/src/mess/machine/c64_exos.h index eaaa46be427..553b1f3df05 100644 --- a/src/mess/machine/c64_exos.h +++ b/src/mess/machine/c64_exos.h @@ -37,7 +37,7 @@ protected: virtual void device_start(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); }; diff --git a/src/mess/machine/c64_final.c b/src/mess/machine/c64_final.c index 26d104576d6..4c6f9e68f0e 100644 --- a/src/mess/machine/c64_final.c +++ b/src/mess/machine/c64_final.c @@ -95,10 +95,8 @@ void c64_final_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_final_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_final_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml || !romh || !io1 || !io2) { data = m_roml[offset & 0x3fff]; diff --git a/src/mess/machine/c64_final.h b/src/mess/machine/c64_final.h index e419bfabfd4..6e1a74f8b29 100644 --- a/src/mess/machine/c64_final.h +++ b/src/mess/machine/c64_final.h @@ -44,7 +44,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); }; diff --git a/src/mess/machine/c64_final3.c b/src/mess/machine/c64_final3.c index 5a0398d1358..c4c6caaf180 100644 --- a/src/mess/machine/c64_final3.c +++ b/src/mess/machine/c64_final3.c @@ -105,10 +105,8 @@ void c64_final3_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_final3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_final3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml || !romh || !io1 || !io2) { offs_t addr = (m_bank << 14) | (offset & 0x3fff); diff --git a/src/mess/machine/c64_final3.h b/src/mess/machine/c64_final3.h index 9cb3bedd487..5bb4f3ac384 100644 --- a/src/mess/machine/c64_final3.h +++ b/src/mess/machine/c64_final3.h @@ -44,7 +44,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_fun_play.c b/src/mess/machine/c64_fun_play.c index 1adf36f7252..fd385952e03 100644 --- a/src/mess/machine/c64_fun_play.c +++ b/src/mess/machine/c64_fun_play.c @@ -59,10 +59,8 @@ void c64_fun_play_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_fun_play_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_fun_play_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { offs_t addr = (m_bank << 13) | (offset & 0x1fff); diff --git a/src/mess/machine/c64_fun_play.h b/src/mess/machine/c64_fun_play.h index 5a2701bbcf6..c6a187d7326 100644 --- a/src/mess/machine/c64_fun_play.h +++ b/src/mess/machine/c64_fun_play.h @@ -38,7 +38,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_georam.c b/src/mess/machine/c64_georam.c index 34d7bd016b7..b03ed940088 100644 --- a/src/mess/machine/c64_georam.c +++ b/src/mess/machine/c64_georam.c @@ -62,10 +62,8 @@ void c64_georam_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_georam_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_georam_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!io1) { offs_t addr = (m_bank << 8) | (offset & 0xff); diff --git a/src/mess/machine/c64_georam.h b/src/mess/machine/c64_georam.h index 0a758e3acf1..fd250adb137 100644 --- a/src/mess/machine/c64_georam.h +++ b/src/mess/machine/c64_georam.h @@ -38,7 +38,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_ide64.c b/src/mess/machine/c64_ide64.c index 48157a8ee7e..0ad5bee4052 100644 --- a/src/mess/machine/c64_ide64.c +++ b/src/mess/machine/c64_ide64.c @@ -149,11 +149,10 @@ void c64_ide64_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_ide64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_ide64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - if (!m_enable) return 0; + if (!m_enable) return data; - UINT8 data = 0; int rom_oe = 1, ram_oe = 1; if (!m_game && m_exrom && ba) diff --git a/src/mess/machine/c64_ide64.h b/src/mess/machine/c64_ide64.h index 9fd4b052c16..14b6562e041 100644 --- a/src/mess/machine/c64_ide64.h +++ b/src/mess/machine/c64_ide64.h @@ -46,7 +46,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_ieee488.c b/src/mess/machine/c64_ieee488.c index 9013c44a040..d5fef41b183 100644 --- a/src/mess/machine/c64_ieee488.c +++ b/src/mess/machine/c64_ieee488.c @@ -277,9 +277,9 @@ void c64_ieee488_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_ieee488_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_ieee488_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = m_exp->cd_r(space, offset, ba, roml, romh, io1, io2); + data = m_exp->cd_r(space, offset, data, ba, roml, romh, io1, io2); if (!roml) { diff --git a/src/mess/machine/c64_ieee488.h b/src/mess/machine/c64_ieee488.h index 386d918e2c3..b3f5fd6cc86 100644 --- a/src/mess/machine/c64_ieee488.h +++ b/src/mess/machine/c64_ieee488.h @@ -57,7 +57,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); diff --git a/src/mess/machine/c64_kingsoft.c b/src/mess/machine/c64_kingsoft.c index 4c17578e38e..3c5b83cac38 100644 --- a/src/mess/machine/c64_kingsoft.c +++ b/src/mess/machine/c64_kingsoft.c @@ -57,10 +57,8 @@ void c64_kingsoft_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_kingsoft_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_kingsoft_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { data = m_roml[offset & 0x1fff]; diff --git a/src/mess/machine/c64_kingsoft.h b/src/mess/machine/c64_kingsoft.h index 9bc86380803..6bd68e49be9 100644 --- a/src/mess/machine/c64_kingsoft.h +++ b/src/mess/machine/c64_kingsoft.h @@ -38,7 +38,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); }; diff --git a/src/mess/machine/c64_mach5.c b/src/mess/machine/c64_mach5.c index df3601b8258..944a8d09fde 100644 --- a/src/mess/machine/c64_mach5.c +++ b/src/mess/machine/c64_mach5.c @@ -57,10 +57,8 @@ void c64_mach5_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_mach5_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_mach5_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml || !io1 || !io2) { data = m_roml[offset & 0x1fff]; diff --git a/src/mess/machine/c64_mach5.h b/src/mess/machine/c64_mach5.h index 1339d40977b..00f1e5c78d3 100644 --- a/src/mess/machine/c64_mach5.h +++ b/src/mess/machine/c64_mach5.h @@ -38,7 +38,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); }; diff --git a/src/mess/machine/c64_magic_desk.c b/src/mess/machine/c64_magic_desk.c index e7cbad1e052..d21e7600230 100644 --- a/src/mess/machine/c64_magic_desk.c +++ b/src/mess/machine/c64_magic_desk.c @@ -59,10 +59,8 @@ void c64_magic_desk_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_magic_desk_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_magic_desk_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { offs_t addr = (m_bank << 13) | (offset & 0x1fff); diff --git a/src/mess/machine/c64_magic_desk.h b/src/mess/machine/c64_magic_desk.h index 1ba1754e8ef..3f4d6f4e703 100644 --- a/src/mess/machine/c64_magic_desk.h +++ b/src/mess/machine/c64_magic_desk.h @@ -38,7 +38,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_magic_formel.c b/src/mess/machine/c64_magic_formel.c index cb6c78ed5b8..6cee1f88d97 100644 --- a/src/mess/machine/c64_magic_formel.c +++ b/src/mess/machine/c64_magic_formel.c @@ -223,10 +223,8 @@ void c64_magic_formel_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_magic_formel_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_magic_formel_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!romh && !m_rom_oe) { UINT8 bank = m_pb7_ff ? m_rom_bank : 0; diff --git a/src/mess/machine/c64_magic_formel.h b/src/mess/machine/c64_magic_formel.h index 643b31a6702..9c8a2c9f1e0 100644 --- a/src/mess/machine/c64_magic_formel.h +++ b/src/mess/machine/c64_magic_formel.h @@ -50,7 +50,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); diff --git a/src/mess/machine/c64_mikro_assembler.c b/src/mess/machine/c64_mikro_assembler.c index b1a0dfab01e..9d00e47cc1a 100644 --- a/src/mess/machine/c64_mikro_assembler.c +++ b/src/mess/machine/c64_mikro_assembler.c @@ -47,10 +47,8 @@ void c64_mikro_assembler_cartridge_device::device_start() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_mikro_assembler_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_mikro_assembler_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml || !romh || !io1 || !io2) { data = m_roml[offset & 0x1fff]; diff --git a/src/mess/machine/c64_mikro_assembler.h b/src/mess/machine/c64_mikro_assembler.h index 0477fc0eca0..8655ef7b67f 100644 --- a/src/mess/machine/c64_mikro_assembler.h +++ b/src/mess/machine/c64_mikro_assembler.h @@ -37,7 +37,7 @@ protected: virtual void device_start(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); }; diff --git a/src/mess/machine/c64_multiscreen.c b/src/mess/machine/c64_multiscreen.c index c14e88de127..79498766682 100644 --- a/src/mess/machine/c64_multiscreen.c +++ b/src/mess/machine/c64_multiscreen.c @@ -208,10 +208,8 @@ void c64_multiscreen_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_multiscreen_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_multiscreen_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { int bank = m_bank & 0x0f; diff --git a/src/mess/machine/c64_multiscreen.h b/src/mess/machine/c64_multiscreen.h index dacc6b829e7..506f7e178cd 100644 --- a/src/mess/machine/c64_multiscreen.h +++ b/src/mess/machine/c64_multiscreen.h @@ -44,7 +44,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_neoram.c b/src/mess/machine/c64_neoram.c index 07433551707..40cc44f7157 100644 --- a/src/mess/machine/c64_neoram.c +++ b/src/mess/machine/c64_neoram.c @@ -63,10 +63,8 @@ void c64_neoram_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_neoram_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_neoram_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!io1) { offs_t addr = (m_bank << 8) | (offset & 0xff); diff --git a/src/mess/machine/c64_neoram.h b/src/mess/machine/c64_neoram.h index d22a73d9d9b..5ab7a2fe2d4 100644 --- a/src/mess/machine/c64_neoram.h +++ b/src/mess/machine/c64_neoram.h @@ -44,7 +44,7 @@ protected: virtual void nvram_write(emu_file &file) { if (m_nvram != NULL) { file.write(m_nvram, m_nvram_size); } } // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_ocean.c b/src/mess/machine/c64_ocean.c index ffe7ddd8471..9222e17df47 100644 --- a/src/mess/machine/c64_ocean.c +++ b/src/mess/machine/c64_ocean.c @@ -81,10 +81,8 @@ void c64_ocean_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_ocean_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_ocean_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { offs_t addr = (m_bank << 13) | (offset & 0x1fff); diff --git a/src/mess/machine/c64_ocean.h b/src/mess/machine/c64_ocean.h index a8d6969faae..d3901926f23 100644 --- a/src/mess/machine/c64_ocean.h +++ b/src/mess/machine/c64_ocean.h @@ -38,7 +38,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_pagefox.c b/src/mess/machine/c64_pagefox.c index 19b4fcc1fa0..bb346488990 100644 --- a/src/mess/machine/c64_pagefox.c +++ b/src/mess/machine/c64_pagefox.c @@ -81,10 +81,8 @@ void c64_pagefox_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_pagefox_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_pagefox_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml || !romh) { if (BIT(m_bank, 3)) diff --git a/src/mess/machine/c64_pagefox.h b/src/mess/machine/c64_pagefox.h index 8c9546e2385..5e5874920b6 100644 --- a/src/mess/machine/c64_pagefox.h +++ b/src/mess/machine/c64_pagefox.h @@ -38,7 +38,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_prophet64.c b/src/mess/machine/c64_prophet64.c index 4fc0e7fb8ea..90c3d95291f 100644 --- a/src/mess/machine/c64_prophet64.c +++ b/src/mess/machine/c64_prophet64.c @@ -59,10 +59,8 @@ void c64_prophet64_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_prophet64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_prophet64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { offs_t addr = (m_bank << 13) | (offset & 0x1fff); diff --git a/src/mess/machine/c64_prophet64.h b/src/mess/machine/c64_prophet64.h index b9c15570c87..7fde56aaca5 100644 --- a/src/mess/machine/c64_prophet64.h +++ b/src/mess/machine/c64_prophet64.h @@ -38,7 +38,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_ps64.c b/src/mess/machine/c64_ps64.c index fc1e70d4eb4..ef902857e8e 100644 --- a/src/mess/machine/c64_ps64.c +++ b/src/mess/machine/c64_ps64.c @@ -130,10 +130,8 @@ void c64_ps64_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_ps64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_ps64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { data = m_roml[offset & 0x1fff]; diff --git a/src/mess/machine/c64_ps64.h b/src/mess/machine/c64_ps64.h index 4bc03de3d33..cc267e2cf18 100644 --- a/src/mess/machine/c64_ps64.h +++ b/src/mess/machine/c64_ps64.h @@ -42,7 +42,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); }; diff --git a/src/mess/machine/c64_rex.c b/src/mess/machine/c64_rex.c index 011a6404ed9..ea8db49f472 100644 --- a/src/mess/machine/c64_rex.c +++ b/src/mess/machine/c64_rex.c @@ -57,10 +57,8 @@ void c64_rex_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_rex_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_rex_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { data = m_roml[offset & 0x1fff]; diff --git a/src/mess/machine/c64_rex.h b/src/mess/machine/c64_rex.h index b5b5619509f..79f93eadac7 100644 --- a/src/mess/machine/c64_rex.h +++ b/src/mess/machine/c64_rex.h @@ -38,7 +38,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); }; diff --git a/src/mess/machine/c64_rex_ep256.c b/src/mess/machine/c64_rex_ep256.c index 26bc354a959..da00a74bcb4 100644 --- a/src/mess/machine/c64_rex_ep256.c +++ b/src/mess/machine/c64_rex_ep256.c @@ -126,10 +126,8 @@ void c64_rex_ep256_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_rex_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_rex_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { if (m_reset) diff --git a/src/mess/machine/c64_rex_ep256.h b/src/mess/machine/c64_rex_ep256.h index 49b99d6f487..ac69c7347e5 100644 --- a/src/mess/machine/c64_rex_ep256.h +++ b/src/mess/machine/c64_rex_ep256.h @@ -43,7 +43,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_ross.c b/src/mess/machine/c64_ross.c index 7fda625761f..09928923e6d 100644 --- a/src/mess/machine/c64_ross.c +++ b/src/mess/machine/c64_ross.c @@ -62,10 +62,8 @@ void c64_ross_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_ross_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_ross_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml || !romh) { offs_t addr = (m_bank << 14) | (offset & 0x3fff); diff --git a/src/mess/machine/c64_ross.h b/src/mess/machine/c64_ross.h index c1d5afb03ed..b2de7a7ea7a 100644 --- a/src/mess/machine/c64_ross.h +++ b/src/mess/machine/c64_ross.h @@ -39,7 +39,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_sfx_sound_expander.c b/src/mess/machine/c64_sfx_sound_expander.c index 1439d72d865..2b9b79e65f7 100644 --- a/src/mess/machine/c64_sfx_sound_expander.c +++ b/src/mess/machine/c64_sfx_sound_expander.c @@ -235,9 +235,9 @@ void c64_sfx_sound_expander_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_sfx_sound_expander_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_sfx_sound_expander_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = m_exp->cd_r(space, offset, ba, roml, romh, io1, io2); + data = m_exp->cd_r(space, offset, data, ba, roml, romh, io1, io2); if (!io2) { @@ -245,19 +245,19 @@ UINT8 c64_sfx_sound_expander_cartridge_device::c64_cd_r(address_space &space, of { switch (offset & 0x07) { - case 0: data |= ioport("KB0")->read(); break; - case 1: data |= ioport("KB1")->read(); break; - case 2: data |= ioport("KB2")->read(); break; - case 3: data |= ioport("KB3")->read(); break; - case 4: data |= ioport("KB4")->read(); break; - case 5: data |= ioport("KB5")->read(); break; - case 6: data |= ioport("KB6")->read(); break; - case 7: data |= ioport("KB7")->read(); break; + case 0: data = ioport("KB0")->read(); break; + case 1: data = ioport("KB1")->read(); break; + case 2: data = ioport("KB2")->read(); break; + case 3: data = ioport("KB3")->read(); break; + case 4: data = ioport("KB4")->read(); break; + case 5: data = ioport("KB5")->read(); break; + case 6: data = ioport("KB6")->read(); break; + case 7: data = ioport("KB7")->read(); break; } } else if (BIT(offset, 5)) { - data |= ym3526_r(m_opl, BIT(offset, 4)); + data = ym3526_r(m_opl, BIT(offset, 4)); } } diff --git a/src/mess/machine/c64_sfx_sound_expander.h b/src/mess/machine/c64_sfx_sound_expander.h index 94184853121..3aab328f499 100644 --- a/src/mess/machine/c64_sfx_sound_expander.h +++ b/src/mess/machine/c64_sfx_sound_expander.h @@ -52,7 +52,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram); diff --git a/src/mess/machine/c64_silverrock.c b/src/mess/machine/c64_silverrock.c index 3138e4bebcb..16925896a0a 100644 --- a/src/mess/machine/c64_silverrock.c +++ b/src/mess/machine/c64_silverrock.c @@ -92,10 +92,8 @@ void c64_silverrock_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_silverrock_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_silverrock_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { offs_t addr = (m_bank << 13) | (offset & 0x1fff); diff --git a/src/mess/machine/c64_silverrock.h b/src/mess/machine/c64_silverrock.h index ef5677613a3..9f841ef518f 100644 --- a/src/mess/machine/c64_silverrock.h +++ b/src/mess/machine/c64_silverrock.h @@ -38,7 +38,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_simons_basic.c b/src/mess/machine/c64_simons_basic.c index c71b9cf141d..53a5847face 100644 --- a/src/mess/machine/c64_simons_basic.c +++ b/src/mess/machine/c64_simons_basic.c @@ -57,10 +57,8 @@ void c64_simons_basic_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_simons_basic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_simons_basic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { data = m_roml[offset & 0x1fff]; diff --git a/src/mess/machine/c64_simons_basic.h b/src/mess/machine/c64_simons_basic.h index 20e87141fd0..441565dc4eb 100644 --- a/src/mess/machine/c64_simons_basic.h +++ b/src/mess/machine/c64_simons_basic.h @@ -38,7 +38,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); }; diff --git a/src/mess/machine/c64_stardos.c b/src/mess/machine/c64_stardos.c index c02fbe71295..157e55ba201 100644 --- a/src/mess/machine/c64_stardos.c +++ b/src/mess/machine/c64_stardos.c @@ -148,10 +148,8 @@ void c64_stardos_cartridge_device::device_start() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_stardos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_stardos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml || !romh) { // TODO BITSWAP8(7,6,5,4,3,1,2,0) ? diff --git a/src/mess/machine/c64_stardos.h b/src/mess/machine/c64_stardos.h index 236d4c11203..468a5afb29d 100644 --- a/src/mess/machine/c64_stardos.h +++ b/src/mess/machine/c64_stardos.h @@ -43,7 +43,7 @@ protected: virtual void device_start(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); diff --git a/src/mess/machine/c64_std.c b/src/mess/machine/c64_std.c index 2ee85a9bfc5..5dd7582d6bf 100644 --- a/src/mess/machine/c64_std.c +++ b/src/mess/machine/c64_std.c @@ -47,10 +47,8 @@ void c64_standard_cartridge_device::device_start() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_standard_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_standard_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml && m_roml_mask) { data = m_roml[offset & 0x1fff]; diff --git a/src/mess/machine/c64_std.h b/src/mess/machine/c64_std.h index 74343ec5c86..82139736a38 100644 --- a/src/mess/machine/c64_std.h +++ b/src/mess/machine/c64_std.h @@ -38,7 +38,7 @@ protected: virtual void device_start(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); }; diff --git a/src/mess/machine/c64_structured_basic.c b/src/mess/machine/c64_structured_basic.c index 75b102c231d..1b45de5bf4a 100644 --- a/src/mess/machine/c64_structured_basic.c +++ b/src/mess/machine/c64_structured_basic.c @@ -61,10 +61,8 @@ void c64_structured_basic_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_structured_basic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_structured_basic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { offs_t addr = (m_bank << 13) | (offset & 0x1fff); diff --git a/src/mess/machine/c64_structured_basic.h b/src/mess/machine/c64_structured_basic.h index 46451bff063..897148a4607 100644 --- a/src/mess/machine/c64_structured_basic.h +++ b/src/mess/machine/c64_structured_basic.h @@ -39,7 +39,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_super_explode.c b/src/mess/machine/c64_super_explode.c index 11706e4f4f7..d0858501660 100644 --- a/src/mess/machine/c64_super_explode.c +++ b/src/mess/machine/c64_super_explode.c @@ -85,10 +85,8 @@ void c64_super_explode_cartridge_device::device_timer(emu_timer &timer, device_t // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_super_explode_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_super_explode_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { m_exrom = 0; diff --git a/src/mess/machine/c64_super_explode.h b/src/mess/machine/c64_super_explode.h index 499673fccd0..5377dafe80f 100644 --- a/src/mess/machine/c64_super_explode.h +++ b/src/mess/machine/c64_super_explode.h @@ -39,7 +39,7 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_super_games.c b/src/mess/machine/c64_super_games.c index 3b8d99a9f3a..9769c22a420 100644 --- a/src/mess/machine/c64_super_games.c +++ b/src/mess/machine/c64_super_games.c @@ -59,10 +59,8 @@ void c64_super_games_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_super_games_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_super_games_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml || !romh) { offs_t addr = (m_bank << 14) | (offset & 0x3fff); diff --git a/src/mess/machine/c64_super_games.h b/src/mess/machine/c64_super_games.h index 49a63f4bfe4..9d9cff97c51 100644 --- a/src/mess/machine/c64_super_games.h +++ b/src/mess/machine/c64_super_games.h @@ -38,7 +38,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_sw8k.c b/src/mess/machine/c64_sw8k.c index 848a78d229e..54f0755bfbf 100644 --- a/src/mess/machine/c64_sw8k.c +++ b/src/mess/machine/c64_sw8k.c @@ -102,10 +102,8 @@ void c64_switchable_8k_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_switchable_8k_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_switchable_8k_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { offs_t addr = (m_bank << 13) | (offset & 0x1fff); diff --git a/src/mess/machine/c64_sw8k.h b/src/mess/machine/c64_sw8k.h index 24cb8019431..fe45d36e2bb 100644 --- a/src/mess/machine/c64_sw8k.h +++ b/src/mess/machine/c64_sw8k.h @@ -41,7 +41,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: int m_bank; diff --git a/src/mess/machine/c64_system3.c b/src/mess/machine/c64_system3.c index 7d419a96f7d..2e10a125b03 100644 --- a/src/mess/machine/c64_system3.c +++ b/src/mess/machine/c64_system3.c @@ -59,10 +59,8 @@ void c64_system3_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_system3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_system3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { offs_t addr = (m_bank << 13) | (offset & 0x1fff); diff --git a/src/mess/machine/c64_system3.h b/src/mess/machine/c64_system3.h index 3c56d2a5249..fc0fd56d151 100644 --- a/src/mess/machine/c64_system3.h +++ b/src/mess/machine/c64_system3.h @@ -38,7 +38,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_tdos.c b/src/mess/machine/c64_tdos.c index 00f9bf9b849..8a82404db33 100644 --- a/src/mess/machine/c64_tdos.c +++ b/src/mess/machine/c64_tdos.c @@ -215,9 +215,9 @@ void c64_tdos_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_tdos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_tdos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = m_exp->cd_r(space, offset, ba, roml, romh, io1, io2); + data = m_exp->cd_r(space, offset, data, ba, roml, romh, io1, io2); // TODO diff --git a/src/mess/machine/c64_tdos.h b/src/mess/machine/c64_tdos.h index 64b5ea3e0ce..56b4e67578a 100644 --- a/src/mess/machine/c64_tdos.h +++ b/src/mess/machine/c64_tdos.h @@ -52,7 +52,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram); diff --git a/src/mess/machine/c64_vw64.c b/src/mess/machine/c64_vw64.c index a96f2924d1a..e7b066e8296 100644 --- a/src/mess/machine/c64_vw64.c +++ b/src/mess/machine/c64_vw64.c @@ -111,10 +111,8 @@ void c64_vizawrite_cartridge_device::device_timer(emu_timer &timer, device_timer // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_vizawrite_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_vizawrite_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { offs_t addr = (m_game << 13) | (offset & 0x1fff); diff --git a/src/mess/machine/c64_vw64.h b/src/mess/machine/c64_vw64.h index c4de74cf11c..8ea4cb4fa36 100644 --- a/src/mess/machine/c64_vw64.h +++ b/src/mess/machine/c64_vw64.h @@ -39,7 +39,7 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram) { return 0; } private: diff --git a/src/mess/machine/c64_warp_speed.c b/src/mess/machine/c64_warp_speed.c index cf04586b413..20eee4fc9ab 100644 --- a/src/mess/machine/c64_warp_speed.c +++ b/src/mess/machine/c64_warp_speed.c @@ -127,10 +127,8 @@ void c64_warp_speed_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_warp_speed_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_warp_speed_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml || !romh || !io1 || !io2) { offs_t addr = UNSCRAMBLE_ADDRESS(offset & 0x3fff); diff --git a/src/mess/machine/c64_warp_speed.h b/src/mess/machine/c64_warp_speed.h index c69e4db996d..d651c20b10c 100644 --- a/src/mess/machine/c64_warp_speed.h +++ b/src/mess/machine/c64_warp_speed.h @@ -43,7 +43,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: diff --git a/src/mess/machine/c64_westermann.c b/src/mess/machine/c64_westermann.c index 1f5658717fb..6956a51035d 100644 --- a/src/mess/machine/c64_westermann.c +++ b/src/mess/machine/c64_westermann.c @@ -57,10 +57,8 @@ void c64_westermann_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_westermann_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_westermann_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { data = m_roml[offset & 0x1fff]; diff --git a/src/mess/machine/c64_westermann.h b/src/mess/machine/c64_westermann.h index eb69bb5ad3a..d979d6274c6 100644 --- a/src/mess/machine/c64_westermann.h +++ b/src/mess/machine/c64_westermann.h @@ -38,7 +38,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); }; diff --git a/src/mess/machine/c64_xl80.c b/src/mess/machine/c64_xl80.c index 83e782cfd2a..2cc6745387f 100644 --- a/src/mess/machine/c64_xl80.c +++ b/src/mess/machine/c64_xl80.c @@ -209,10 +209,8 @@ void c64_xl80_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_xl80_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_xl80_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!io2 && BIT(offset, 2)) { if (offset & 0x01) diff --git a/src/mess/machine/c64_xl80.h b/src/mess/machine/c64_xl80.h index 1ce855c725f..7ca87ba5266 100644 --- a/src/mess/machine/c64_xl80.h +++ b/src/mess/machine/c64_xl80.h @@ -46,7 +46,7 @@ protected: virtual void device_reset(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram) { return 1; } virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram) { return 0; } diff --git a/src/mess/machine/c64_zaxxon.c b/src/mess/machine/c64_zaxxon.c index e1ed4add9fa..545c670e20c 100644 --- a/src/mess/machine/c64_zaxxon.c +++ b/src/mess/machine/c64_zaxxon.c @@ -49,10 +49,8 @@ void c64_zaxxon_cartridge_device::device_start() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_zaxxon_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_zaxxon_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (!roml) { data = m_roml[offset & 0xfff]; diff --git a/src/mess/machine/c64_zaxxon.h b/src/mess/machine/c64_zaxxon.h index b87fca6f41c..5a3e186ae80 100644 --- a/src/mess/machine/c64_zaxxon.h +++ b/src/mess/machine/c64_zaxxon.h @@ -37,7 +37,7 @@ protected: virtual void device_start(); // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); private: int m_bank; diff --git a/src/mess/machine/c64exp.c b/src/mess/machine/c64exp.c index 86be216ee43..3ffcaa210bc 100644 --- a/src/mess/machine/c64exp.c +++ b/src/mess/machine/c64exp.c @@ -359,13 +359,11 @@ const char * c64_expansion_slot_device::get_default_card_software(const machine_ // cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_expansion_slot_device::cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) +UINT8 c64_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { - UINT8 data = 0; - if (m_cart != NULL) { - data = m_cart->c64_cd_r(space, offset, ba, roml, romh, io1, io2); + data = m_cart->c64_cd_r(space, offset, data, ba, roml, romh, io1, io2); } return data; diff --git a/src/mess/machine/c64exp.h b/src/mess/machine/c64exp.h index 32937a81daa..c51cebad00d 100644 --- a/src/mess/machine/c64exp.h +++ b/src/mess/machine/c64exp.h @@ -97,7 +97,7 @@ public: virtual ~c64_expansion_slot_device(); // computer interface - UINT8 cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); + UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); void cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); int game_r(offs_t offset, int ba, int rw, int hiram); int exrom_r(offs_t offset, int ba, int rw, int hiram); @@ -168,7 +168,7 @@ protected: virtual UINT8* c64_nvram_pointer(running_machine &machine, size_t size); // runtime - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) { return 0; }; + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { return data; }; virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { }; virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram) { return m_game; } virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram) { return m_exrom; } diff --git a/src/mess/machine/cbmipt.c b/src/mess/machine/cbmipt.c index cd7787ba784..323560bc1be 100644 --- a/src/mess/machine/cbmipt.c +++ b/src/mess/machine/cbmipt.c @@ -1095,6 +1095,10 @@ INPUT_PORTS_START( vic_controls ) PORT_BIT( 0xff,128,IPT_PADDLE) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0,255) PORT_CODE_DEC(KEYCODE_END) PORT_CODE_INC(KEYCODE_PGDN) PORT_PLAYER(2) PORT_REVERSE PORT_CONDITION("CTRLSEL", 0xf0, EQUALS, 0x10) INPUT_PORTS_END +SLOT_INTERFACE_START( cbm_datassette_devices ) + SLOT_INTERFACE("c1530", C1530) +SLOT_INTERFACE_END + SLOT_INTERFACE_START( cbm_iec_devices ) SLOT_INTERFACE("c1540", C1540) SLOT_INTERFACE("c1541", C1541) @@ -1112,12 +1116,21 @@ SLOT_INTERFACE_START( cbm_iec_devices ) SLOT_INTERFACE("interpod", INTERPOD) SLOT_INTERFACE("minichief", MINI_CHIEF) SLOT_INTERFACE("serialbox", SERIAL_BOX) + SLOT_INTERFACE("diag264", DIAG264_SERIAL_LOOPBACK) SLOT_INTERFACE_END SLOT_INTERFACE_START( sx1541_iec_devices ) SLOT_INTERFACE("sx1541", SX1541) SLOT_INTERFACE_END +SLOT_INTERFACE_START( c128dcr_iec_devices ) + SLOT_INTERFACE("c1571cr", C1571CR) +SLOT_INTERFACE_END + +SLOT_INTERFACE_START( c128d81_iec_devices ) + SLOT_INTERFACE("c1563", C1563) +SLOT_INTERFACE_END + SLOT_INTERFACE_START( cbm_ieee488_devices ) SLOT_INTERFACE("c2040", C2040) SLOT_INTERFACE("c3040", C3040) @@ -1225,6 +1238,11 @@ SLOT_INTERFACE_START( c128_expansion_cards ) SLOT_INTERFACE_INTERNAL("c128_comal80", C128_COMAL80) SLOT_INTERFACE_END +SLOT_INTERFACE_START( plus4_datassette_devices ) + SLOT_INTERFACE("c1531", C1531) + SLOT_INTERFACE("diag264", DIAG264_CASSETTE_LOOPBACK) +SLOT_INTERFACE_END + SLOT_INTERFACE_START( plus4_expansion_cards ) SLOT_INTERFACE("c1551", C1551) SLOT_INTERFACE("sid", PLUS4_SID) @@ -1234,4 +1252,5 @@ SLOT_INTERFACE_START( plus4_expansion_cards ) SLOT_INTERFACE_END SLOT_INTERFACE_START( plus4_user_port_cards ) + SLOT_INTERFACE("diag264", DIAG264_USER_PORT_LOOPBACK) SLOT_INTERFACE_END diff --git a/src/mess/machine/cbmipt.h b/src/mess/machine/cbmipt.h index e0c14f3e9a7..f82c42376c8 100644 --- a/src/mess/machine/cbmipt.h +++ b/src/mess/machine/cbmipt.h @@ -3,6 +3,7 @@ #ifndef CBMIPT_H_ #define CBMIPT_H_ +#include "machine/c2n.h" #include "machine/c64_4cga.h" #include "machine/c64_4dxh.h" #include "machine/c64_4ksa.h" @@ -68,6 +69,9 @@ #include "machine/c8280.h" #include "machine/d9060.h" #include "machine/cmdhd.h" +#include "machine/diag264_lb_iec.h" +#include "machine/diag264_lb_tape.h" +#include "machine/diag264_lb_user.h" #include "machine/fd2000.h" #include "machine/interpod.h" #include "machine/plus4_sid.h" @@ -147,8 +151,11 @@ INPUT_PORTS_EXTERN( vic_controls ); +SLOT_INTERFACE_EXTERN( cbm_datassette_devices ); SLOT_INTERFACE_EXTERN( cbm_iec_devices ); SLOT_INTERFACE_EXTERN( sx1541_iec_devices ); +SLOT_INTERFACE_EXTERN( c128dcr_iec_devices ); +SLOT_INTERFACE_EXTERN( c128d81_iec_devices ); SLOT_INTERFACE_EXTERN( cbm_ieee488_devices ); SLOT_INTERFACE_EXTERN( vic20_control_port_devices ); SLOT_INTERFACE_EXTERN( vic20_expansion_cards ); @@ -157,6 +164,7 @@ SLOT_INTERFACE_EXTERN( vic10_expansion_cards ); SLOT_INTERFACE_EXTERN( c64_expansion_cards ); SLOT_INTERFACE_EXTERN( c64_user_port_cards ); SLOT_INTERFACE_EXTERN( c128_expansion_cards ); +SLOT_INTERFACE_EXTERN( plus4_datassette_devices ); SLOT_INTERFACE_EXTERN( plus4_expansion_cards ); SLOT_INTERFACE_EXTERN( plus4_user_port_cards ); diff --git a/src/mess/machine/compiskb.c b/src/mess/machine/compiskb.c new file mode 100644 index 00000000000..4d8f1c73bf7 --- /dev/null +++ b/src/mess/machine/compiskb.c @@ -0,0 +1,345 @@ +/********************************************************************** + + Telenova Compis keyboard emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +*********************************************************************/ + +#include "compiskb.h" + + + +//************************************************************************** +// MACROS / CONSTANTS +//************************************************************************** + +#define I8748_TAG "i8748" + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type COMPIS_KEYBOARD = &device_creator<compis_keyboard_device>; + + +//------------------------------------------------- +// device_config_complete - perform any +// operations now that the configuration is +// complete +//------------------------------------------------- + +void compis_keyboard_device::device_config_complete() +{ + // inherit a copy of the static data + const compis_keyboard_interface *intf = reinterpret_cast<const compis_keyboard_interface *>(static_config()); + if (intf != NULL) + *static_cast<compis_keyboard_interface *>(this) = *intf; + + // or initialize to defaults if none provided + else + { + memset(&m_out_int_cb, 0, sizeof(m_out_int_cb)); + } + + m_shortname = "compiskb"; +} + + +//------------------------------------------------- +// ROM( compis_keyboard ) +//------------------------------------------------- + +ROM_START( compis_keyboard ) + ROM_REGION( 0x800, I8748_TAG, 0 ) + ROM_LOAD( "cmpkey13.u1", 0x000, 0x800, CRC(3f87d138) SHA1(c04e2d325b9c04818bc7c47c3bf32b13862b11ec) ) +ROM_END + + +//------------------------------------------------- +// rom_region - device-specific ROM region +//------------------------------------------------- + +const rom_entry *compis_keyboard_device::device_rom_region() const +{ + return ROM_NAME( compis_keyboard ); +} + + +//------------------------------------------------- +// ADDRESS_MAP( compis_keyboard_io ) +//------------------------------------------------- + +static ADDRESS_MAP_START( compis_keyboard_io, AS_IO, 8, compis_keyboard_device ) + AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_NOP + AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_NOP + AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_NOP + AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_NOP +ADDRESS_MAP_END + + +//------------------------------------------------- +// MACHINE_DRIVER( compis_keyboard ) +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( compis_keyboard ) + MCFG_CPU_ADD(I8748_TAG, I8748, 4000000) + MCFG_CPU_IO_MAP(compis_keyboard_io) +MACHINE_CONFIG_END + + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor compis_keyboard_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( compis_keyboard ); +} + + +//------------------------------------------------- +// INPUT_PORTS( compis_keyboard ) +//------------------------------------------------- + +INPUT_PORTS_START( compis_keyboard ) + PORT_START("X0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + + PORT_START("X1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + + PORT_START("X2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + + PORT_START("X3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + + PORT_START("X4") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + + PORT_START("X5") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + + PORT_START("X6") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + + PORT_START("X7") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + + PORT_START("X8") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + + PORT_START("X9") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + + PORT_START("XA") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + + PORT_START("XB") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + + PORT_START("XC") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + + PORT_START("XD") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + + PORT_START("XE") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + + PORT_START("XF") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) +INPUT_PORTS_END + + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor compis_keyboard_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( compis_keyboard ); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// compis_keyboard_device - constructor +//------------------------------------------------- + +compis_keyboard_device::compis_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, COMPIS_KEYBOARD, "Compis Keyboard", tag, owner, clock), + m_maincpu(*this, I8748_TAG), + m_so(1) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void compis_keyboard_device::device_start() +{ + // resolve callbacks + m_out_int_func.resolve(m_out_int_cb, *this); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void compis_keyboard_device::device_reset() +{ +} + + +//------------------------------------------------- +// dtr_w - data terminal ready write +//------------------------------------------------- + +WRITE_LINE_MEMBER( compis_keyboard_device::dtr_w ) +{ +} + + +//------------------------------------------------- +// si_w - serial input write +//------------------------------------------------- + +WRITE_LINE_MEMBER( compis_keyboard_device::si_w ) +{ + m_maincpu->set_input_line(MCS48_INPUT_IRQ, state ? CLEAR_LINE : ASSERT_LINE); +} + + +//------------------------------------------------- +// so_r - serial output read +//------------------------------------------------- + +READ_LINE_MEMBER( compis_keyboard_device::so_r ) +{ + return m_so; +} diff --git a/src/mess/machine/compiskb.h b/src/mess/machine/compiskb.h new file mode 100644 index 00000000000..ca8bce2bc22 --- /dev/null +++ b/src/mess/machine/compiskb.h @@ -0,0 +1,91 @@ +/********************************************************************** + + Telenova Compis keyboard emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +*********************************************************************/ + +#pragma once + +#ifndef __COMPIS_KEYBOARD__ +#define __COMPIS_KEYBOARD__ + +#include "emu.h" +#include "cpu/mcs48/mcs48.h" + + + +//************************************************************************** +// MACROS / CONSTANTS +//************************************************************************** + +#define COMPIS_KEYBOARD_TAG "compiskb" + + + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_COMPIS_KEYBOARD_ADD() \ + MCFG_DEVICE_ADD(COMPIS_KEYBOARD_TAG, COMPIS_KEYBOARD, 0) + + +#define COMPIS_KEYBOARD_INTERFACE(_name) \ + const COMPIS_keyboard_interface (_name) = + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> compis_keyboard_interface + +struct compis_keyboard_interface +{ + devcb_write_line m_out_int_cb; +}; + + +// ======================> compis_keyboard_device + +class compis_keyboard_device : public device_t, + public compis_keyboard_interface +{ +public: + // construction/destruction + compis_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual const rom_entry *device_rom_region() const; + virtual machine_config_constructor device_mconfig_additions() const; + virtual ioport_constructor device_input_ports() const; + + DECLARE_WRITE_LINE_MEMBER( dtr_w ); + DECLARE_WRITE_LINE_MEMBER( si_w ); + DECLARE_READ_LINE_MEMBER( so_r ); + +protected: + // device-level overrides + virtual void device_config_complete(); + virtual void device_start(); + virtual void device_reset(); + +private: + devcb_resolved_write_line m_out_int_func; + + required_device<cpu_device> m_maincpu; + + int m_so; +}; + + +// device type definition +extern const device_type COMPIS_KEYBOARD; + + + +#endif diff --git a/src/mess/machine/diag264_lb_iec.c b/src/mess/machine/diag264_lb_iec.c new file mode 100644 index 00000000000..adec3f3026c --- /dev/null +++ b/src/mess/machine/diag264_lb_iec.c @@ -0,0 +1,53 @@ +/********************************************************************** + + Diag264 Serial Loop Back Connector emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#include "diag264_lb_iec.h" + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type DIAG264_SERIAL_LOOPBACK = &device_creator<diag264_serial_loopback_device>; + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// diag264_serial_loopback_device - constructor +//------------------------------------------------- + +diag264_serial_loopback_device::diag264_serial_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, DIAG264_SERIAL_LOOPBACK, "Diag264 Serial Loopback", tag, owner, clock), + device_cbm_iec_interface(mconfig, *this) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void diag264_serial_loopback_device::device_start() +{ +} + + +//------------------------------------------------- +// cbm_iec_atn - +//------------------------------------------------- + +void diag264_serial_loopback_device::cbm_iec_atn(int state) +{ + m_bus->clk_w(state); +} diff --git a/src/mess/machine/diag264_lb_iec.h b/src/mess/machine/diag264_lb_iec.h new file mode 100644 index 00000000000..d9be2dc568b --- /dev/null +++ b/src/mess/machine/diag264_lb_iec.h @@ -0,0 +1,49 @@ +/********************************************************************** + + Diag264 Serial Loop Back Connector emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#pragma once + +#ifndef __DIAG264_SERIAL_LOOPBACK__ +#define __DIAG264_SERIAL_LOOPBACK__ + + +#include "emu.h" +#include "machine/cbmiec.h" + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> diag264_serial_loopback_device + +class diag264_serial_loopback_device : public device_t, + public device_cbm_iec_interface +{ +public: + // construction/destruction + diag264_serial_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + // device-level overrides + virtual void device_config_complete() { m_shortname = "diag264_serial_loopback"; } + virtual void device_start(); + + // device_cbm_iec_interface overrides + virtual void cbm_iec_atn(int state); +}; + + +// device type definition +extern const device_type DIAG264_SERIAL_LOOPBACK; + + + +#endif diff --git a/src/mess/machine/diag264_lb_tape.c b/src/mess/machine/diag264_lb_tape.c new file mode 100644 index 00000000000..83788458da4 --- /dev/null +++ b/src/mess/machine/diag264_lb_tape.c @@ -0,0 +1,84 @@ +/********************************************************************** + + Diag264 Cassette Loop Back Connector emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#include "diag264_lb_tape.h" + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type DIAG264_CASSETTE_LOOPBACK = &device_creator<diag264_cassette_loopback_device>; + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// diag264_cassette_loopback_device - constructor +//------------------------------------------------- + +diag264_cassette_loopback_device::diag264_cassette_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, DIAG264_CASSETTE_LOOPBACK, "Diag264 Cassette Loopback", tag, owner, clock), + device_pet_datassette_port_interface(mconfig, *this), + m_read(1), + m_sense(0) +{ } + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void diag264_cassette_loopback_device::device_start() +{ +} + + +//------------------------------------------------- +// datassette_read - read data +//------------------------------------------------- + +int diag264_cassette_loopback_device::datassette_read() +{ + return m_read; +} + + +//------------------------------------------------- +// datassette_write - write data +//------------------------------------------------- + +void diag264_cassette_loopback_device::datassette_write(int state) +{ + m_read = state; +} + + +//------------------------------------------------- +// datassette_sense - switch sense +//------------------------------------------------- + +int diag264_cassette_loopback_device::datassette_sense() +{ + return m_sense; +} + + +//------------------------------------------------- +// datassette_motor - motor +//------------------------------------------------- + +void diag264_cassette_loopback_device::datassette_motor(int state) +{ + m_sense = !state; +} diff --git a/src/mess/machine/diag264_lb_tape.h b/src/mess/machine/diag264_lb_tape.h new file mode 100644 index 00000000000..2ea68547c8b --- /dev/null +++ b/src/mess/machine/diag264_lb_tape.h @@ -0,0 +1,57 @@ +/********************************************************************** + + Diag264 Cassette Loop Back Connector emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#pragma once + +#ifndef __DIAG264_CASSETTE_LOOPBACK__ +#define __DIAG264_CASSETTE_LOOPBACK__ + + +#include "emu.h" +#include "machine/petcass.h" + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> diag264_cassette_loopback_device + +class diag264_cassette_loopback_device : public device_t, + public device_pet_datassette_port_interface +{ + +public: + // construction/destruction + diag264_cassette_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + // device-level overrides + virtual void device_config_complete() { m_shortname = "diag264_loopback_cassette"; } + virtual void device_start(); + + // device_pet_datassette_port_interface overrides + virtual int datassette_read(); + virtual void datassette_write(int state); + virtual int datassette_sense(); + virtual void datassette_motor(int state); + +private: + int m_read; + int m_sense; +}; + + +// device type definition +extern const device_type DIAG264_CASSETTE_LOOPBACK; + + + +#endif diff --git a/src/mess/machine/diag264_lb_user.c b/src/mess/machine/diag264_lb_user.c new file mode 100644 index 00000000000..4d37bfb14c0 --- /dev/null +++ b/src/mess/machine/diag264_lb_user.c @@ -0,0 +1,47 @@ +/********************************************************************** + + Diag264 User Port Loop Back Connector emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#include "diag264_lb_user.h" + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type DIAG264_USER_PORT_LOOPBACK = &device_creator<diag264_user_port_loopback_device>; + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// diag264_user_port_loopback_device - constructor +//------------------------------------------------- + +diag264_user_port_loopback_device::diag264_user_port_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, DIAG264_USER_PORT_LOOPBACK, "Diag264 User Port Loopback", tag, owner, clock), + device_plus4_user_port_interface(mconfig, *this), + m_p(0), + m_txd(0), + m_rts(0), + m_dtr(0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void diag264_user_port_loopback_device::device_start() +{ +} diff --git a/src/mess/machine/diag264_lb_user.h b/src/mess/machine/diag264_lb_user.h new file mode 100644 index 00000000000..75eae2b04a1 --- /dev/null +++ b/src/mess/machine/diag264_lb_user.h @@ -0,0 +1,63 @@ +/********************************************************************** + + Diag264 User Port Loop Back Connector emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#pragma once + +#ifndef __DIAG264_USER_PORT_LOOPBACK__ +#define __DIAG264_USER_PORT_LOOPBACK__ + + +#include "emu.h" +#include "machine/plus4user.h" + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> diag264_user_port_loopback_device + +class diag264_user_port_loopback_device : public device_t, + public device_plus4_user_port_interface +{ +public: + // construction/destruction + diag264_user_port_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + // device-level overrides + virtual void device_config_complete() { m_shortname = "diag264_user_port_loopback"; } + virtual void device_start(); + + // device_plus4_user_port_interface overrides + virtual UINT8 plus4_p_r() { logerror("P read %02x\n", ((m_p << 4) & 0xf0) | (m_p >> 4)); return ((m_p << 4) & 0xf0) | (m_p >> 4); } + virtual void plus4_p_w(UINT8 data) { logerror("P write %02x\n", data); m_p = data; } + virtual int plus4_rxd_r() { return m_txd; } + virtual int plus4_dcd_r() { return m_dtr; } + virtual int plus4_dsr_r() { return m_rts; } + virtual void plus4_txd_w(int state) { m_txd = state; } + virtual void plus4_dtr_w(int state) { m_dtr = state; } + virtual void plus4_rts_w(int state) { m_rts = state; } + +private: + UINT8 m_p; + + int m_txd; + int m_rts; + int m_dtr; +}; + + +// device type definition +extern const device_type DIAG264_USER_PORT_LOOPBACK; + + + +#endif diff --git a/src/mess/machine/petcass.c b/src/mess/machine/petcass.c new file mode 100644 index 00000000000..c6b825ff044 --- /dev/null +++ b/src/mess/machine/petcass.c @@ -0,0 +1,112 @@ +/********************************************************************** + + Commodore PET/VIC-20/C64/Plus-4 Datassette Port emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#include "machine/petcass.h" + + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +const device_type PET_DATASSETTE_PORT = &device_creator<pet_datassette_port_device>; + + + +//************************************************************************** +// CARD INTERFACE +//************************************************************************** + +//------------------------------------------------- +// device_pet_datassette_port_interface - constructor +//------------------------------------------------- + +device_pet_datassette_port_interface::device_pet_datassette_port_interface(const machine_config &mconfig, device_t &device) + : device_slot_card_interface(mconfig,device) +{ + m_slot = dynamic_cast<pet_datassette_port_device *>(device.owner()); +} + + +//------------------------------------------------- +// ~device_pet_datassette_port_interface - destructor +//------------------------------------------------- + +device_pet_datassette_port_interface::~device_pet_datassette_port_interface() +{ +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// pet_datassette_port_device - constructor +//------------------------------------------------- + +pet_datassette_port_device::pet_datassette_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, PET_DATASSETTE_PORT, "Datassette Port", tag, owner, clock), + device_slot_interface(mconfig, *this) +{ +} + + +//------------------------------------------------- +// pet_datassette_port_device - destructor +//------------------------------------------------- + +pet_datassette_port_device::~pet_datassette_port_device() +{ +} + + +//------------------------------------------------- +// device_config_complete - perform any +// operations now that the configuration is +// complete +//------------------------------------------------- + +void pet_datassette_port_device::device_config_complete() +{ + // inherit a copy of the static data + const pet_datassette_port_interface *intf = reinterpret_cast<const pet_datassette_port_interface *>(static_config()); + if (intf != NULL) + { + *static_cast<pet_datassette_port_interface *>(this) = *intf; + } + + // or initialize to defaults if none provided + else + { + memset(&m_out_read_cb, 0, sizeof(m_out_read_cb)); + } +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void pet_datassette_port_device::device_start() +{ + m_cart = dynamic_cast<device_pet_datassette_port_interface *>(get_card_device()); + + // resolve callbacks + m_out_read_func.resolve(m_out_read_cb, *this); +} + + +READ_LINE_MEMBER( pet_datassette_port_device::read ) { int state = 1; if (m_cart != NULL) state = m_cart->datassette_read(); return state; } +WRITE_LINE_MEMBER( pet_datassette_port_device::write ) { if (m_cart != NULL) m_cart->datassette_write(state); } +READ_LINE_MEMBER( pet_datassette_port_device::sense_r ) { int state = 1; if (m_cart != NULL) state = m_cart->datassette_sense(); return state; } +WRITE_LINE_MEMBER( pet_datassette_port_device::motor_w ) { if (m_cart != NULL) m_cart->datassette_motor(state); } + +WRITE_LINE_MEMBER( pet_datassette_port_device::read_w ) { m_out_read_func(state); } diff --git a/src/mess/machine/petcass.h b/src/mess/machine/petcass.h new file mode 100644 index 00000000000..d915c2c68f1 --- /dev/null +++ b/src/mess/machine/petcass.h @@ -0,0 +1,121 @@ +/********************************************************************** + + Commodore PET/VIC-20/C64/Plus-4 Datassette Port emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +********************************************************************** + + GND 1 A GND + +5V 2 B +5V + MOTOR 3 C MOTOR + READ 4 D READ + WRITE 5 E WRITE + SENSE 6 F SENSE + +**********************************************************************/ + +#pragma once + +#ifndef __PET_DATASSETTE_PORT__ +#define __PET_DATASSETTE_PORT__ + +#include "emu.h" + + + +//************************************************************************** +// CONSTANTS +//************************************************************************** + +#define PET_DATASSETTE_PORT_TAG "tape" + + + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define PET_DATASSETTE_PORT_INTERFACE(_name) \ + const pet_datassette_port_interface (_name) = + + +#define MCFG_PET_DATASSETTE_PORT_ADD(_tag, _config, _slot_intf, _def_slot, _def_inp) \ + MCFG_DEVICE_ADD(_tag, PET_DATASSETTE_PORT, 0) \ + MCFG_DEVICE_CONFIG(_config) \ + MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> pet_datassette_port_interface + +struct pet_datassette_port_interface +{ + devcb_write_line m_out_read_cb; +}; + + +// ======================> pet_datassette_port_device + +class device_pet_datassette_port_interface; + +class pet_datassette_port_device : public device_t, + public pet_datassette_port_interface, + public device_slot_interface +{ +public: + // construction/destruction + pet_datassette_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + virtual ~pet_datassette_port_device(); + + // computer interface + DECLARE_READ_LINE_MEMBER( read ); + DECLARE_WRITE_LINE_MEMBER( write ); + DECLARE_READ_LINE_MEMBER( sense_r ); + DECLARE_WRITE_LINE_MEMBER( motor_w ); + + // device interface + DECLARE_WRITE_LINE_MEMBER( read_w ); + +protected: + // device-level overrides + virtual void device_config_complete(); + virtual void device_start(); + + devcb_resolved_write_line m_out_read_func; + + device_pet_datassette_port_interface *m_cart; +}; + + +// ======================> device_pet_datassette_port_interface + +// class representing interface-specific live c64_expansion card +class device_pet_datassette_port_interface : public device_slot_card_interface +{ +public: + // construction/destruction + device_pet_datassette_port_interface(const machine_config &mconfig, device_t &device); + virtual ~device_pet_datassette_port_interface(); + + virtual int datassette_read() { return 1; }; + virtual void datassette_write(int state) { }; + virtual int datassette_sense() { return 1; }; + virtual void datassette_motor(int state) { }; + +protected: + pet_datassette_port_device *m_slot; +}; + + +// device type definition +extern const device_type PET_DATASSETTE_PORT; + + + +#endif diff --git a/src/mess/machine/plus4_sid.c b/src/mess/machine/plus4_sid.c index 7b821ec58ed..4bd920e1624 100644 --- a/src/mess/machine/plus4_sid.c +++ b/src/mess/machine/plus4_sid.c @@ -62,14 +62,10 @@ const rom_entry *plus4_sid_cartridge_device::device_rom_region() const // sid6581_interface sid_intf //------------------------------------------------- -static int paddle_read( device_t *device, int which ) +static MOS6581_INTERFACE( sid_intf ) { - return 0; -} - -static const sid6581_interface sid_intf = -{ - paddle_read + DEVCB_NULL, + DEVCB_NULL }; @@ -141,10 +137,8 @@ void plus4_sid_cartridge_device::device_reset() // plus4_cd_r - cartridge data read //------------------------------------------------- -UINT8 plus4_sid_cartridge_device::plus4_cd_r(address_space &space, offs_t offset, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) +UINT8 plus4_sid_cartridge_device::plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { - UINT8 data = 0; - if ((offset >= 0xfe80 && offset < 0xfea0) || (offset >= 0xfd40 && offset < 0xfd60)) { data = sid6581_r(m_sid, offset & 0x1f); diff --git a/src/mess/machine/plus4_sid.h b/src/mess/machine/plus4_sid.h index fb3757660f6..b578d0f1de4 100644 --- a/src/mess/machine/plus4_sid.h +++ b/src/mess/machine/plus4_sid.h @@ -46,7 +46,7 @@ protected: virtual void device_reset(); // device_plus4_expansion_card_interface overrides - virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h); + virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h); virtual void plus4_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h); virtual void plus4_breset_w(int state); diff --git a/src/mess/machine/plus4_std.c b/src/mess/machine/plus4_std.c index 6e26b451445..6a060504b92 100644 --- a/src/mess/machine/plus4_std.c +++ b/src/mess/machine/plus4_std.c @@ -47,10 +47,8 @@ void plus4_standard_cartridge_device::device_start() // plus4_cd_r - cartridge data read //------------------------------------------------- -UINT8 plus4_standard_cartridge_device::plus4_cd_r(address_space &space, offs_t offset, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) +UINT8 plus4_standard_cartridge_device::plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { - UINT8 data = 0; - if (!c1l && m_c1l_mask) { data = m_c1l[offset & m_c1l_mask]; diff --git a/src/mess/machine/plus4_std.h b/src/mess/machine/plus4_std.h index 59dee13cf2b..a9480d8266e 100644 --- a/src/mess/machine/plus4_std.h +++ b/src/mess/machine/plus4_std.h @@ -38,7 +38,7 @@ protected: virtual void device_start(); // device_plus4_expansion_card_interface overrides - virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h); + virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h); }; diff --git a/src/mess/machine/plus4exp.c b/src/mess/machine/plus4exp.c index 11bf1a7b55f..320494e9c9b 100644 --- a/src/mess/machine/plus4exp.c +++ b/src/mess/machine/plus4exp.c @@ -322,13 +322,11 @@ const char * plus4_expansion_slot_device::get_default_card_software(const machin // cd_r - cartridge data read //------------------------------------------------- -UINT8 plus4_expansion_slot_device::cd_r(address_space &space, offs_t offset, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) +UINT8 plus4_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { - UINT8 data = 0; - if (m_cart != NULL) { - data = m_cart->plus4_cd_r(space, offset, ba, cs0, c1l, c1h, cs1, c2l, c2h); + data = m_cart->plus4_cd_r(space, offset, data, ba, cs0, c1l, c1h, cs1, c2l, c2h); } return data; diff --git a/src/mess/machine/plus4exp.h b/src/mess/machine/plus4exp.h index 056a0b0516f..0c34ea884c1 100644 --- a/src/mess/machine/plus4exp.h +++ b/src/mess/machine/plus4exp.h @@ -97,7 +97,7 @@ public: virtual ~plus4_expansion_slot_device(); // computer interface - UINT8 cd_r(address_space &space, offs_t offset, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h); + UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h); void cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h); UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER( breset_w ); @@ -163,7 +163,7 @@ public: virtual UINT8* plus4_nvram_pointer(running_machine &machine, size_t size); // runtime - virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { return 0; }; + virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { return data; }; virtual void plus4_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { }; virtual UINT32 plus4_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } virtual void plus4_breset_w(int state) { }; diff --git a/src/mess/machine/plus4user.h b/src/mess/machine/plus4user.h index 9cece222f35..9127f1533d5 100644 --- a/src/mess/machine/plus4user.h +++ b/src/mess/machine/plus4user.h @@ -104,14 +104,14 @@ public: virtual int plus4_rxd_r() { return 1; }; virtual int plus4_dcd_r() { return 0; }; virtual int plus4_dsr_r() { return 0; }; - virtual void plus4_txd_w(int level) { }; - virtual void plus4_dtr_w(int level) { }; - virtual void plus4_rts_w(int level) { }; - virtual void plus4_rxc_w(int level) { }; - virtual void plus4_atn_w(int level) { }; + virtual void plus4_txd_w(int state) { }; + virtual void plus4_dtr_w(int state) { }; + virtual void plus4_rts_w(int state) { }; + virtual void plus4_rxc_w(int state) { }; + virtual void plus4_atn_w(int state) { }; // reset - virtual void plus4_breset_w(int level) { }; + virtual void plus4_breset_w(int state) { }; protected: plus4_user_port_device *m_slot; diff --git a/src/mess/machine/vcsctrl.c b/src/mess/machine/vcsctrl.c index d64fb07bb61..dcc8d7628a7 100644 --- a/src/mess/machine/vcsctrl.c +++ b/src/mess/machine/vcsctrl.c @@ -79,5 +79,7 @@ void vcs_control_port_device::device_start() READ8_MEMBER( vcs_control_port_device::joy_r ) { UINT8 data = 0xff; if (m_device != NULL) data = m_device->vcs_joy_r(); return data; } -READ8_MEMBER( vcs_control_port_device::pot_x_r ) { UINT8 data = 0xff; if (m_device != NULL) data = m_device->vcs_pot_x_r(); return data; } -READ8_MEMBER( vcs_control_port_device::pot_y_r ) { UINT8 data = 0xff; if (m_device != NULL) data = m_device->vcs_pot_y_r(); return data; } +UINT8 vcs_control_port_device::pot_x_r() { UINT8 data = 0xff; if (m_device != NULL) data = m_device->vcs_pot_x_r(); return data; } +READ8_MEMBER( vcs_control_port_device::pot_x_r ) { return pot_x_r(); } +UINT8 vcs_control_port_device::pot_y_r() { UINT8 data = 0xff; if (m_device != NULL) data = m_device->vcs_pot_y_r(); return data; } +READ8_MEMBER( vcs_control_port_device::pot_y_r ) { return pot_y_r(); } diff --git a/src/mess/machine/vcsctrl.h b/src/mess/machine/vcsctrl.h index 7f3ca0c7301..33ac3182681 100644 --- a/src/mess/machine/vcsctrl.h +++ b/src/mess/machine/vcsctrl.h @@ -47,7 +47,9 @@ public: // computer interface DECLARE_READ8_MEMBER( joy_r ); + UINT8 pot_x_r(); DECLARE_READ8_MEMBER( pot_x_r ); + UINT8 pot_y_r(); DECLARE_READ8_MEMBER( pot_y_r ); protected: diff --git a/src/mess/machine/vic1010.c b/src/mess/machine/vic1010.c index dae017858d6..774f7441277 100644 --- a/src/mess/machine/vic1010.c +++ b/src/mess/machine/vic1010.c @@ -106,13 +106,16 @@ void vic1010_device::device_start() // vic20_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic1010_device::vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +UINT8 vic1010_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { - UINT8 data = 0; - for (int i = 0; i < MAX_SLOTS; i++) { - data |= m_expansion_slot[i]->cd_r(space, offset, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3); + UINT8 slot_data = m_expansion_slot[i]->cd_r(space, offset, data, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3); + + if (data != slot_data) + { + data = slot_data; + } } return data; diff --git a/src/mess/machine/vic1010.h b/src/mess/machine/vic1010.h index 2c90e75b4a4..b4c8632d4ae 100644 --- a/src/mess/machine/vic1010.h +++ b/src/mess/machine/vic1010.h @@ -54,7 +54,7 @@ protected: virtual machine_config_constructor device_mconfig_additions() const; // device_vic20_expansion_card_interface overrides - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); + virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); virtual UINT32 vic20_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); virtual void vic20_res_w(int state); diff --git a/src/mess/machine/vic10exp.c b/src/mess/machine/vic10exp.c index afa6831fd47..12c80eaa755 100644 --- a/src/mess/machine/vic10exp.c +++ b/src/mess/machine/vic10exp.c @@ -299,13 +299,11 @@ UINT32 vic10_expansion_slot_device::screen_update(screen_device &screen, bitmap_ // cd_r - cartridge data read //------------------------------------------------- -UINT8 vic10_expansion_slot_device::cd_r(address_space &space, offs_t offset, int lorom, int uprom, int exram) +UINT8 vic10_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram) { - UINT8 data = 0; - if (m_cart != NULL) { - data = m_cart->vic10_cd_r(space, offset, lorom, uprom, exram); + data = m_cart->vic10_cd_r(space, offset, data, lorom, uprom, exram); } return data; diff --git a/src/mess/machine/vic10exp.h b/src/mess/machine/vic10exp.h index 13934b02d4b..880298ac110 100644 --- a/src/mess/machine/vic10exp.h +++ b/src/mess/machine/vic10exp.h @@ -95,7 +95,7 @@ public: virtual ~vic10_expansion_slot_device(); // computer interface - UINT8 cd_r(address_space &space, offs_t offset, int lorom, int uprom, int exram); + UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram); void cd_w(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram); DECLARE_READ_LINE_MEMBER( p0_r ); DECLARE_WRITE_LINE_MEMBER( p0_w ); @@ -161,13 +161,13 @@ protected: virtual UINT8* vic10_uprom_pointer(running_machine &machine, size_t size); // runtime - virtual UINT8 vic10_cd_r(address_space &space, offs_t offset, int lorom, int uprom, int exram) { return 0; }; + virtual UINT8 vic10_cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram) { return data; }; virtual void vic10_cd_w(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram) { }; virtual int vic10_p0_r() { return 0; }; virtual void vic10_p0_w(int state) { }; virtual void vic10_sp_w(int state) { }; virtual void vic10_cnt_w(int state) { }; - virtual UINT32 vic10_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return false; } + virtual UINT32 vic10_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } virtual void vic10_res_w(int state) { }; vic10_expansion_slot_device *m_slot; diff --git a/src/mess/machine/vic10std.c b/src/mess/machine/vic10std.c index 4465e7bf955..4fe0e33e730 100644 --- a/src/mess/machine/vic10std.c +++ b/src/mess/machine/vic10std.c @@ -47,10 +47,8 @@ void vic10_standard_cartridge_device::device_start() // vic10_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic10_standard_cartridge_device::vic10_cd_r(address_space &space, offs_t offset, int lorom, int uprom, int exram) +UINT8 vic10_standard_cartridge_device::vic10_cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram) { - UINT8 data = 0; - if (!lorom && (m_lorom != NULL)) { data = m_lorom[offset & 0x1fff]; diff --git a/src/mess/machine/vic10std.h b/src/mess/machine/vic10std.h index c4c716414af..48a30399adb 100644 --- a/src/mess/machine/vic10std.h +++ b/src/mess/machine/vic10std.h @@ -37,7 +37,7 @@ protected: virtual void device_config_complete() { m_shortname = "vic10_standard"; } // device_vic10_expansion_card_interface overrides - virtual UINT8 vic10_cd_r(address_space &space, offs_t offset, int lorom, int uprom, int exram); + virtual UINT8 vic10_cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram); virtual void vic10_cd_w(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram); }; diff --git a/src/mess/machine/vic1110.c b/src/mess/machine/vic1110.c index f164585528e..0a85cf7110b 100644 --- a/src/mess/machine/vic1110.c +++ b/src/mess/machine/vic1110.c @@ -88,9 +88,8 @@ void vic1110_device::device_start() // vic20_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic1110_device::vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +UINT8 vic1110_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { - UINT8 data = 0; UINT8 sw = ioport("SW")->read(); if ((!blk1 && (sw == BLK1)) || (!blk2 && (sw == BLK2)) || (!blk3 && (sw == BLK3)) || (!blk5 && (sw == BLK5))) diff --git a/src/mess/machine/vic1110.h b/src/mess/machine/vic1110.h index d9315291a79..ea33410425b 100644 --- a/src/mess/machine/vic1110.h +++ b/src/mess/machine/vic1110.h @@ -40,7 +40,7 @@ protected: virtual void device_config_complete() { m_shortname = "vic1110"; } // device_vic20_expansion_card_interface overrides - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); + virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); }; diff --git a/src/mess/machine/vic1111.c b/src/mess/machine/vic1111.c index dcd2d3b56c7..7836c6d8be1 100644 --- a/src/mess/machine/vic1111.c +++ b/src/mess/machine/vic1111.c @@ -49,10 +49,8 @@ void vic1111_device::device_start() // vic20_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic1111_device::vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +UINT8 vic1111_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { - UINT8 data = 0; - if (!blk1 || !blk2) { data = m_ram[offset & 0x3fff]; diff --git a/src/mess/machine/vic1111.h b/src/mess/machine/vic1111.h index 21772433fa4..7dddbde5775 100644 --- a/src/mess/machine/vic1111.h +++ b/src/mess/machine/vic1111.h @@ -37,7 +37,7 @@ protected: virtual void device_config_complete() { m_shortname = "vic1111"; } // device_vic20_expansion_card_interface overrides - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); + virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); }; diff --git a/src/mess/machine/vic1112.c b/src/mess/machine/vic1112.c index ede461171e0..c74c2e01f01 100644 --- a/src/mess/machine/vic1112.c +++ b/src/mess/machine/vic1112.c @@ -225,10 +225,8 @@ void vic1112_device::device_reset() // vic20_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic1112_device::vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +UINT8 vic1112_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { - UINT8 data = 0; - if (!io2) { if (offset & 0x10) diff --git a/src/mess/machine/vic1112.h b/src/mess/machine/vic1112.h index 5abf545b535..cb3e0d83d57 100644 --- a/src/mess/machine/vic1112.h +++ b/src/mess/machine/vic1112.h @@ -53,7 +53,7 @@ protected: virtual void device_config_complete() { m_shortname = "vic1112"; } // device_vic20_expansion_card_interface overrides - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); + virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); private: diff --git a/src/mess/machine/vic1210.c b/src/mess/machine/vic1210.c index d578728c21e..6a7a8cfbfdf 100644 --- a/src/mess/machine/vic1210.c +++ b/src/mess/machine/vic1210.c @@ -50,10 +50,8 @@ void vic1210_device::device_start() // vic20_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic1210_device::vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +UINT8 vic1210_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { - UINT8 data = 0; - if (!ram1 || !ram2 || !ram3) { data = m_ram[offset & 0xbff]; diff --git a/src/mess/machine/vic1210.h b/src/mess/machine/vic1210.h index 2c154835eed..74640853e37 100644 --- a/src/mess/machine/vic1210.h +++ b/src/mess/machine/vic1210.h @@ -38,7 +38,7 @@ protected: virtual void device_config_complete() { m_shortname = "vic1210"; } // device_vic20_expansion_card_interface overrides - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); + virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); }; diff --git a/src/mess/machine/vic20_megacart.c b/src/mess/machine/vic20_megacart.c index 66181262e3e..056e3b59009 100644 --- a/src/mess/machine/vic20_megacart.c +++ b/src/mess/machine/vic20_megacart.c @@ -80,10 +80,8 @@ void vic20_megacart_device::device_reset() // vic20_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic20_megacart_device::vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +UINT8 vic20_megacart_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { - UINT8 data = 0; - if (!ram1 || !ram2 || !ram3 || !io2 || !io3) { if (m_nvram_en) diff --git a/src/mess/machine/vic20_megacart.h b/src/mess/machine/vic20_megacart.h index fbc113c82f2..f27d8a5480c 100644 --- a/src/mess/machine/vic20_megacart.h +++ b/src/mess/machine/vic20_megacart.h @@ -47,7 +47,7 @@ protected: virtual void nvram_write(emu_file &file) { if (m_nvram != NULL) { file.write(m_nvram, m_nvram_size); } } // device_vic20_expansion_card_interface overrides - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); + virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); private: diff --git a/src/mess/machine/vic20exp.c b/src/mess/machine/vic20exp.c index 20997bcc004..66615384bc4 100644 --- a/src/mess/machine/vic20exp.c +++ b/src/mess/machine/vic20exp.c @@ -334,13 +334,11 @@ const char * vic20_expansion_slot_device::get_default_card_software(const machin // cd_r - cartridge data read //------------------------------------------------- -UINT8 vic20_expansion_slot_device::cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +UINT8 vic20_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { - UINT8 data = 0; - if (m_cart != NULL) { - data = m_cart->vic20_cd_r(space, offset, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3); + data = m_cart->vic20_cd_r(space, offset, data, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3); } return data; diff --git a/src/mess/machine/vic20exp.h b/src/mess/machine/vic20exp.h index 7b406935875..80e6a28931e 100644 --- a/src/mess/machine/vic20exp.h +++ b/src/mess/machine/vic20exp.h @@ -93,7 +93,7 @@ public: virtual ~vic20_expansion_slot_device(); // computer interface - UINT8 cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); + UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); void cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER( port_res_w ); @@ -157,7 +157,7 @@ protected: virtual UINT8* vic20_nvram_pointer(running_machine &machine, size_t size); // runtime - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { return 0; }; + virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { return data; }; virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { }; virtual UINT32 vic20_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } virtual void vic20_res_w(int state) { }; diff --git a/src/mess/machine/vic20std.c b/src/mess/machine/vic20std.c index 59f27529b87..023be7e94a2 100644 --- a/src/mess/machine/vic20std.c +++ b/src/mess/machine/vic20std.c @@ -47,10 +47,8 @@ void vic20_standard_cartridge_device::device_start() // vic20_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic20_standard_cartridge_device::vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +UINT8 vic20_standard_cartridge_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { - UINT8 data = 0; - if (!blk1 && (m_blk1 != NULL)) { data = m_blk1[offset & 0x1fff]; diff --git a/src/mess/machine/vic20std.h b/src/mess/machine/vic20std.h index 10ffa985fea..521695d6945 100644 --- a/src/mess/machine/vic20std.h +++ b/src/mess/machine/vic20std.h @@ -37,7 +37,7 @@ protected: virtual void device_config_complete() { m_shortname = "vic20_standard"; } // device_vic20_expansion_card_interface overrides - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); + virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); }; diff --git a/src/mess/mess.lst b/src/mess/mess.lst index 3c21a52c994..2a735a78452 100644 --- a/src/mess/mess.lst +++ b/src/mess/mess.lst @@ -624,7 +624,8 @@ p500 // Commodore P500 (proto, a.k.a. C128-40, PET-II) c264 plus4n plus4p -c16 +c16n +c16p c16h c116 c232 diff --git a/src/mess/mess.mak b/src/mess/mess.mak index dc4e35f9fa5..e9439271b6b 100644 --- a/src/mess/mess.mak +++ b/src/mess/mess.mak @@ -874,6 +874,9 @@ $(MESSOBJ)/cbm.a: \ $(MESS_MACHINE)/plus4user.o \ $(MESS_MACHINE)/plus4_sid.o \ $(MESS_MACHINE)/plus4_std.o \ + $(MESS_MACHINE)/diag264_lb_iec.o \ + $(MESS_MACHINE)/diag264_lb_tape.o \ + $(MESS_MACHINE)/diag264_lb_user.o \ $(MESS_DRIVERS)/cbmb.o \ $(MESS_MACHINE)/cbmb.o \ $(MESS_VIDEO)/cbmb.o \ @@ -899,6 +902,8 @@ $(MESSOBJ)/cbm.a: \ $(MESS_MACHINE)/cbm.o \ $(MESS_MACHINE)/cbmipt.o \ $(MESS_MACHINE)/64h156.o \ + $(MESS_MACHINE)/petcass.o \ + $(MESS_MACHINE)/c2n.o \ $(MESS_VIDEO)/vdc8563.o \ $(MESS_VIDEO)/vic6567.o \ $(MESS_VIDEO)/vic4567.o \ @@ -1687,6 +1692,7 @@ $(MESSOBJ)/tektroni.a: \ $(MESSOBJ)/telenova.a: \ $(MESS_DRIVERS)/compis.o \ $(MESS_MACHINE)/compis.o \ + $(MESS_MACHINE)/compiskb.o \ $(MESSOBJ)/telercas.a: \ $(MESS_DRIVERS)/tmc1800.o \ diff --git a/src/mess/video/mos6566.c b/src/mess/video/mos6566.c index 8da06e7f11e..0d1d4defb0e 100644 --- a/src/mess/video/mos6566.c +++ b/src/mess/video/mos6566.c @@ -22,7 +22,6 @@ - cleanup - light pen - - 1:1 sync with CPU - remove RDY hack - VIC IIe - http://hitmen.c02.at/temp/palstuff/ @@ -272,7 +271,9 @@ inline void mos6566_device::vic2_clear_interrupt( int mask ) inline UINT8 mos6566_device::read_videoram(offs_t offset) { - return space(AS_0)->read_byte(offset & 0x3fff); + m_last_data = space(AS_0)->read_byte(offset & 0x3fff); + + return m_last_data; } inline UINT8 mos6566_device::read_colorram(offs_t offset) @@ -683,6 +684,7 @@ void mos6566_device::device_start() save_item(NAME(m_cycle)); save_item(NAME(m_raster_x)); save_item(NAME(m_graphic_x)); + save_item(NAME(m_last_data)); save_item(NAME(m_dy_start)); save_item(NAME(m_dy_stop)); @@ -2816,3 +2818,13 @@ WRITE8_MEMBER( mos6566_device::write ) WRITE_LINE_MEMBER( mos6566_device::lp_w ) { } + + +//------------------------------------------------- +// bus_r - data bus read +//------------------------------------------------- + +UINT8 mos6566_device::bus_r() +{ + return m_last_data; +} diff --git a/src/mess/video/mos6566.h b/src/mess/video/mos6566.h index da24d87cb5c..0f8957f47b9 100644 --- a/src/mess/video/mos6566.h +++ b/src/mess/video/mos6566.h @@ -295,6 +295,8 @@ public: DECLARE_WRITE_LINE_MEMBER( lp_w ); + UINT8 bus_r(); + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: @@ -367,6 +369,7 @@ protected: UINT8 m_cycle; UINT16 m_raster_x; UINT16 m_graphic_x; + UINT8 m_last_data; /* convert multicolor byte to background/foreground for sprite collision */ UINT16 m_expandx[256]; |