Previous | 199869 Revisions | Next |
r17593 Sunday 2nd September, 2012 at 13:46:14 UTC by Curt Coder |
---|
(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) |
[src/emu/sound] | mos6560.c mos6560.h sid.c sid.h sid6581.c sid6581.h |
[src/mess] | mess.lst mess.mak |
[src/mess/audio] | mos7360.c mos7360.h |
[src/mess/drivers] | c128.c c64.c c65.c compis.c huebler.c plus4.c vic10.c vic20.c |
[src/mess/includes] | c128.h c64.h c65.h compis.h huebler.h plus4.h vic10.h vic20.h |
[src/mess/machine] | c128_comal80.c c128_comal80.h c1551.c c1551.h c2n.c* c2n.h* c64_16kb.c c64_16kb.h c64_comal80.c c64_comal80.h c64_currah_speech.c c64_currah_speech.h c64_dela_ep256.c c64_dela_ep256.h c64_dela_ep64.c c64_dela_ep64.h c64_dela_ep7x8.c c64_dela_ep7x8.h c64_dinamic.c c64_dinamic.h c64_dqbb.c c64_dqbb.h c64_easy_calc_result.c c64_easy_calc_result.h c64_easyflash.c c64_easyflash.h c64_epyx_fast_load.c c64_epyx_fast_load.h c64_exos.c c64_exos.h c64_final.c c64_final.h c64_final3.c c64_final3.h c64_fun_play.c c64_fun_play.h c64_georam.c c64_georam.h c64_ide64.c c64_ide64.h c64_ieee488.c c64_ieee488.h c64_kingsoft.c c64_kingsoft.h c64_mach5.c c64_mach5.h c64_magic_desk.c c64_magic_desk.h c64_magic_formel.c c64_magic_formel.h c64_mikro_assembler.c c64_mikro_assembler.h c64_multiscreen.c c64_multiscreen.h c64_neoram.c c64_neoram.h c64_ocean.c c64_ocean.h c64_pagefox.c c64_pagefox.h c64_prophet64.c c64_prophet64.h c64_ps64.c c64_ps64.h c64_rex.c c64_rex.h c64_rex_ep256.c c64_rex_ep256.h c64_ross.c c64_ross.h c64_sfx_sound_expander.c c64_sfx_sound_expander.h c64_silverrock.c c64_silverrock.h c64_simons_basic.c c64_simons_basic.h c64_stardos.c c64_stardos.h c64_std.c c64_std.h c64_structured_basic.c c64_structured_basic.h c64_super_explode.c c64_super_explode.h c64_super_games.c c64_super_games.h c64_sw8k.c c64_sw8k.h c64_system3.c c64_system3.h c64_tdos.c c64_tdos.h c64_vw64.c c64_vw64.h c64_warp_speed.c c64_warp_speed.h c64_westermann.c c64_westermann.h c64_xl80.c c64_xl80.h c64_zaxxon.c c64_zaxxon.h c64exp.c c64exp.h cbmipt.c cbmipt.h compiskb.c* compiskb.h* diag264_lb_iec.c* diag264_lb_iec.h* diag264_lb_tape.c* diag264_lb_tape.h* diag264_lb_user.c* diag264_lb_user.h* petcass.c* petcass.h* plus4_sid.c plus4_sid.h plus4_std.c plus4_std.h plus4exp.c plus4exp.h plus4user.h vcsctrl.c vcsctrl.h vic1010.c vic1010.h vic10exp.c vic10exp.h vic10std.c vic10std.h vic1110.c vic1110.h vic1111.c vic1111.h vic1112.c vic1112.h vic1210.c vic1210.h vic20_megacart.c vic20_megacart.h vic20exp.c vic20exp.h vic20std.c vic20std.h |
[src/mess/video] | mos6566.c mos6566.h |
r17592 | r17593 | |
---|---|---|
94 | 94 | /* DMA */ |
95 | 95 | mos6560_dma_read dma_read; |
96 | 96 | mos6560_dma_read_color dma_read_color; |
97 | UINT8 last_data; | |
97 | 98 | |
98 | 99 | /* lightpen */ |
99 | 100 | mos6560_lightpen_button_callback lightpen_button_cb; |
r17592 | r17593 | |
215 | 216 | for (y = ybegin; y <= yend; y++) |
216 | 217 | { |
217 | 218 | code = mos6560->dma_read(device->machine(), (mos6560->chargenaddr + ch * mos6560->charheight + y) & 0x3fff); |
219 | mos6560->last_data = code; | |
218 | 220 | mos6560->bitmap->pix16(y + yoff, xoff + 0) = color[code >> 7]; |
219 | 221 | mos6560->bitmap->pix16(y + yoff, xoff + 1) = color[(code >> 6) & 1]; |
220 | 222 | mos6560->bitmap->pix16(y + yoff, xoff + 2) = color[(code >> 5) & 1]; |
r17592 | r17593 | |
239 | 241 | for (y = ybegin; y <= yend; y++) |
240 | 242 | { |
241 | 243 | code = mos6560->dma_read(device->machine(), (mos6560->chargenaddr + ch * mos6560->charheight + y) & 0x3fff); |
244 | mos6560->last_data = code; | |
242 | 245 | mos6560->bitmap->pix16(y + yoff, xoff + 0) = |
243 | 246 | mos6560->bitmap->pix16(y + yoff, xoff + 1) = color[code >> 6]; |
244 | 247 | mos6560->bitmap->pix16(y + yoff, xoff + 2) = |
r17592 | r17593 | |
299 | 302 | for (xoff = mos6560->xpos; (xoff < mos6560->xpos + mos6560->xsize) && (xoff < mos6560->total_xsize); xoff += 8, offs++) |
300 | 303 | { |
301 | 304 | ch = mos6560->dma_read(device->machine(), (mos6560->videoaddr + offs) & 0x3fff); |
305 | mos6560->last_data = ch; | |
302 | 306 | attr = (mos6560->dma_read_color(device->machine(), (mos6560->videoaddr + offs) & 0x3fff)) & 0xf; |
303 | 307 | |
304 | 308 | if (mos6560->type == MOS6560_ATTACKUFO) |
r17592 | r17593 | |
485 | 489 | return val; |
486 | 490 | } |
487 | 491 | |
492 | UINT8 mos6560_bus_r( device_t *device ) | |
493 | { | |
494 | mos6560_state *mos6560 = get_safe_token(device); | |
488 | 495 | |
496 | return mos6560->last_data; | |
497 | } | |
498 | ||
489 | 499 | /*------------------------------------------------- |
490 | 500 | mos6560_raster_interrupt_gen |
491 | 501 | -------------------------------------------------*/ |
r17592 | r17593 | |
874 | 884 | device->save_item(NAME(mos6560->multi)); |
875 | 885 | device->save_item(NAME(mos6560->multiinverted)); |
876 | 886 | |
887 | device->save_item(NAME(mos6560->last_data)); | |
888 | ||
877 | 889 | device->save_item(NAME(*mos6560->bitmap)); |
878 | 890 | |
879 | 891 | device->save_item(NAME(mos6560->tone1pos)); |
r17592 | r17593 | |
---|---|---|
106 | 106 | WRITE8_DEVICE_HANDLER( mos6560_port_w ); |
107 | 107 | READ8_DEVICE_HANDLER( mos6560_port_r ); |
108 | 108 | |
109 | UINT8 mos6560_bus_r( device_t *device ); | |
109 | 110 | void mos6560_raster_interrupt_gen( device_t *device ); |
110 | 111 | UINT32 mos6560_video_update( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect ); |
111 | 112 |
r17592 | r17593 | |
---|---|---|
336 | 336 | data=0xff; |
337 | 337 | break; |
338 | 338 | case 0x19: /* paddle 1 */ |
339 | if (This->ad_read != NULL) | |
340 | data=This->ad_read (This->device, 0); | |
339 | if (!This->in_potx_func.isnull()) | |
340 | data = This->in_potx_func(offset); | |
341 | 341 | else |
342 | 342 | data=0; |
343 | 343 | break; |
344 | 344 | case 0x1a: /* paddle 2 */ |
345 | if (This->ad_read != NULL) | |
346 | data=This->ad_read (This->device, 1); | |
345 | if (!This->in_poty_func.isnull()) | |
346 | data = This->in_poty_func(offset); | |
347 | 347 | else |
348 | 348 | data=0; |
349 | 349 | break; |
r17592 | r17593 | |
---|---|---|
17 | 17 | device_t *device; |
18 | 18 | sound_stream *mixer_channel; // mame stream/ mixer channel |
19 | 19 | |
20 | int (*ad_read) (device_t *device, int which); | |
20 | devcb_resolved_read8 in_potx_func; | |
21 | devcb_resolved_read8 in_poty_func; | |
22 | ||
21 | 23 | SIDTYPE type; |
22 | 24 | UINT32 clock; |
23 | 25 |
r17592 | r17593 | |
---|---|---|
34 | 34 | _SID6581 *sid = get_sid(device); |
35 | 35 | const sid6581_interface *iface = (const sid6581_interface*) device->static_config(); |
36 | 36 | |
37 | // resolve callbacks | |
38 | sid->in_potx_func.resolve(iface->in_potx_cb, *device); | |
39 | sid->in_poty_func.resolve(iface->in_poty_cb, *device); | |
40 | ||
37 | 41 | sid->device = device; |
38 | 42 | sid->mixer_channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), (void *) sid, sid_update); |
39 | 43 | sid->PCMfreq = device->machine().sample_rate(); |
40 | 44 | sid->clock = device->clock(); |
41 | sid->ad_read = iface ? iface->ad_read : NULL; | |
42 | 45 | sid->type = sidtype; |
43 | 46 | |
44 | 47 | sid6581_init(sid); |
r17592 | r17593 | |
---|---|---|
20 | 20 | MOS8580 |
21 | 21 | } SIDTYPE; |
22 | 22 | |
23 | #define MOS6581_INTERFACE(name) \ | |
24 | const sid6581_interface (name) = | |
23 | 25 | |
24 | 26 | typedef struct _sid6581_interface sid6581_interface; |
25 | 27 | struct _sid6581_interface |
26 | 28 | { |
27 | int (*ad_read)(device_t *device, int channel); | |
28 | } ; | |
29 | devcb_read8 in_potx_cb; | |
30 | devcb_read8 in_poty_cb; | |
31 | }; | |
29 | 32 | |
30 | 33 | |
31 | 34 | READ8_DEVICE_HANDLER ( sid6581_r ); |
r17592 | r17593 | |
---|---|---|
483 | 483 | else |
484 | 484 | code = m_in_ram_func(m_chargenaddr + ch * 8 + y); |
485 | 485 | |
486 | m_last_data = code; | |
487 | ||
486 | 488 | m_bitmap.pix16(y + yoff, 0 + xoff) = color[code >> 7]; |
487 | 489 | m_bitmap.pix16(y + yoff, 1 + xoff) = color[(code >> 6) & 1]; |
488 | 490 | m_bitmap.pix16(y + yoff, 2 + xoff) = color[(code >> 5) & 1]; |
r17592 | r17593 | |
505 | 507 | else |
506 | 508 | code = m_in_ram_func(m_chargenaddr + ch * 8 + y); |
507 | 509 | |
510 | m_last_data = code; | |
511 | ||
508 | 512 | m_bitmap.pix16(y + yoff, 0 + xoff) = |
509 | 513 | m_bitmap.pix16(y + yoff, 1 + xoff) = m_multi[code >> 6]; |
510 | 514 | m_bitmap.pix16(y + yoff, 2 + xoff) = |
r17592 | r17593 | |
523 | 527 | for (y = ybegin; y <= yend; y++) |
524 | 528 | { |
525 | 529 | code = m_in_ram_func(m_bitmapaddr + ch * 8 + y); |
530 | ||
531 | m_last_data = code; | |
532 | ||
526 | 533 | m_bitmap.pix16(y + yoff, 0 + xoff) = m_c16_bitmap[code >> 7]; |
527 | 534 | m_bitmap.pix16(y + yoff, 1 + xoff) = m_c16_bitmap[(code >> 6) & 1]; |
528 | 535 | m_bitmap.pix16(y + yoff, 2 + xoff) = m_c16_bitmap[(code >> 5) & 1]; |
r17592 | r17593 | |
541 | 548 | for (y = ybegin; y <= yend; y++) |
542 | 549 | { |
543 | 550 | code = m_in_ram_func(m_bitmapaddr + ch * 8 + y); |
551 | ||
552 | m_last_data = code; | |
544 | 553 | |
545 | 554 | m_bitmap.pix16(y + yoff, 0 + xoff) = |
546 | 555 | m_bitmap.pix16(y + yoff, 1 + xoff) = m_bitmapmulti[code >> 6]; |
r17592 | r17593 | |
1141 | 1150 | set_interrupt(2); |
1142 | 1151 | } |
1143 | 1152 | } |
1153 | ||
1154 | ||
1155 | //------------------------------------------------- | |
1156 | // bus_r - data bus read | |
1157 | //------------------------------------------------- | |
1158 | ||
1159 | UINT8 mos7360_device::bus_r() | |
1160 | { | |
1161 | return m_last_data; | |
1162 | } |
r17592 | r17593 | |
---|---|---|
118 | 118 | DECLARE_READ8_MEMBER( read ); |
119 | 119 | DECLARE_WRITE8_MEMBER( write ); |
120 | 120 | |
121 | UINT8 bus_r(); | |
122 | ||
121 | 123 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
122 | 124 | |
123 | 125 | // horrible crap code |
r17592 | r17593 | |
171 | 173 | sound_stream *m_stream; |
172 | 174 | |
173 | 175 | UINT8 m_reg[0x20]; |
176 | UINT8 m_last_data; | |
174 | 177 | |
175 | 178 | bitmap_ind16 m_bitmap; |
176 | 179 |
r17592 | r17593 | |
---|---|---|
39 | 39 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
40 | 40 | |
41 | 41 | // device_c64_expansion_card_interface overrides |
42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
43 | 43 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
44 | 44 | |
45 | 45 | private: |
r0 | r17593 | |
---|---|---|
1 | /********************************************************************** | |
2 | ||
3 | Diag264 Cassette Loop Back Connector emulation | |
4 | ||
5 | Copyright MESS Team. | |
6 | Visit http://mamedev.org for licensing and usage restrictions. | |
7 | ||
8 | **********************************************************************/ | |
9 | ||
10 | #include "diag264_lb_tape.h" | |
11 | ||
12 | ||
13 | ||
14 | //************************************************************************** | |
15 | // DEVICE DEFINITIONS | |
16 | //************************************************************************** | |
17 | ||
18 | const device_type DIAG264_CASSETTE_LOOPBACK = &device_creator<diag264_cassette_loopback_device>; | |
19 | ||
20 | ||
21 | ||
22 | //************************************************************************** | |
23 | // LIVE DEVICE | |
24 | //************************************************************************** | |
25 | ||
26 | //------------------------------------------------- | |
27 | // diag264_cassette_loopback_device - constructor | |
28 | //------------------------------------------------- | |
29 | ||
30 | diag264_cassette_loopback_device::diag264_cassette_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
31 | : device_t(mconfig, DIAG264_CASSETTE_LOOPBACK, "Diag264 Cassette Loopback", tag, owner, clock), | |
32 | device_pet_datassette_port_interface(mconfig, *this), | |
33 | m_read(1), | |
34 | m_sense(0) | |
35 | { } | |
36 | ||
37 | ||
38 | //------------------------------------------------- | |
39 | // device_start - device-specific startup | |
40 | //------------------------------------------------- | |
41 | ||
42 | void diag264_cassette_loopback_device::device_start() | |
43 | { | |
44 | } | |
45 | ||
46 | ||
47 | //------------------------------------------------- | |
48 | // datassette_read - read data | |
49 | //------------------------------------------------- | |
50 | ||
51 | int diag264_cassette_loopback_device::datassette_read() | |
52 | { | |
53 | return m_read; | |
54 | } | |
55 | ||
56 | ||
57 | //------------------------------------------------- | |
58 | // datassette_write - write data | |
59 | //------------------------------------------------- | |
60 | ||
61 | void diag264_cassette_loopback_device::datassette_write(int state) | |
62 | { | |
63 | m_read = state; | |
64 | } | |
65 | ||
66 | ||
67 | //------------------------------------------------- | |
68 | // datassette_sense - switch sense | |
69 | //------------------------------------------------- | |
70 | ||
71 | int diag264_cassette_loopback_device::datassette_sense() | |
72 | { | |
73 | return m_sense; | |
74 | } | |
75 | ||
76 | ||
77 | //------------------------------------------------- | |
78 | // datassette_motor - motor | |
79 | //------------------------------------------------- | |
80 | ||
81 | void diag264_cassette_loopback_device::datassette_motor(int state) | |
82 | { | |
83 | m_sense = !state; | |
84 | } |
r0 | r17593 | |
---|---|---|
1 | /********************************************************************** | |
2 | ||
3 | Diag264 Cassette Loop Back Connector emulation | |
4 | ||
5 | Copyright MESS Team. | |
6 | Visit http://mamedev.org for licensing and usage restrictions. | |
7 | ||
8 | **********************************************************************/ | |
9 | ||
10 | #pragma once | |
11 | ||
12 | #ifndef __DIAG264_CASSETTE_LOOPBACK__ | |
13 | #define __DIAG264_CASSETTE_LOOPBACK__ | |
14 | ||
15 | ||
16 | #include "emu.h" | |
17 | #include "machine/petcass.h" | |
18 | ||
19 | ||
20 | ||
21 | //************************************************************************** | |
22 | // TYPE DEFINITIONS | |
23 | //************************************************************************** | |
24 | ||
25 | // ======================> diag264_cassette_loopback_device | |
26 | ||
27 | class diag264_cassette_loopback_device : public device_t, | |
28 | public device_pet_datassette_port_interface | |
29 | { | |
30 | ||
31 | public: | |
32 | // construction/destruction | |
33 | diag264_cassette_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
34 | ||
35 | protected: | |
36 | // device-level overrides | |
37 | virtual void device_config_complete() { m_shortname = "diag264_loopback_cassette"; } | |
38 | virtual void device_start(); | |
39 | ||
40 | // device_pet_datassette_port_interface overrides | |
41 | virtual int datassette_read(); | |
42 | virtual void datassette_write(int state); | |
43 | virtual int datassette_sense(); | |
44 | virtual void datassette_motor(int state); | |
45 | ||
46 | private: | |
47 | int m_read; | |
48 | int m_sense; | |
49 | }; | |
50 | ||
51 | ||
52 | // device type definition | |
53 | extern const device_type DIAG264_CASSETTE_LOOPBACK; | |
54 | ||
55 | ||
56 | ||
57 | #endif |
r17592 | r17593 | |
---|---|---|
322 | 322 | // cd_r - cartridge data read |
323 | 323 | //------------------------------------------------- |
324 | 324 | |
325 | 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) | |
325 | 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) | |
326 | 326 | { |
327 | UINT8 data = 0; | |
328 | ||
329 | 327 | if (m_cart != NULL) |
330 | 328 | { |
331 | data = m_cart->plus4_cd_r(space, offset, ba, cs0, c1l, c1h, cs1, c2l, c2h); | |
329 | data = m_cart->plus4_cd_r(space, offset, data, ba, cs0, c1l, c1h, cs1, c2l, c2h); | |
332 | 330 | } |
333 | 331 | |
334 | 332 | return data; |
r17592 | r17593 | |
---|---|---|
215 | 215 | // c64_cd_r - cartridge data read |
216 | 216 | //------------------------------------------------- |
217 | 217 | |
218 | UINT8 c64_tdos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
218 | 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) | |
219 | 219 | { |
220 | | |
220 | | |
221 | 221 | |
222 | 222 | // TODO |
223 | 223 |
r17592 | r17593 | |
---|---|---|
97 | 97 | virtual ~plus4_expansion_slot_device(); |
98 | 98 | |
99 | 99 | // computer interface |
100 | UINT8 cd_r(address_space &space, offs_t offset, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h); | |
100 | 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); | |
101 | 101 | 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); |
102 | 102 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
103 | 103 | DECLARE_WRITE_LINE_MEMBER( breset_w ); |
r17592 | r17593 | |
163 | 163 | virtual UINT8* plus4_nvram_pointer(running_machine &machine, size_t size); |
164 | 164 | |
165 | 165 | // runtime |
166 | 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 | |
166 | 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; }; | |
167 | 167 | 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) { }; |
168 | 168 | virtual UINT32 plus4_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } |
169 | 169 | virtual void plus4_breset_w(int state) { }; |
r17592 | r17593 | |
---|---|---|
52 | 52 | virtual void device_reset(); |
53 | 53 | |
54 | 54 | // device_c64_expansion_card_interface overrides |
55 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
55 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
56 | 56 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
57 | 57 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); |
58 | 58 | virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram); |
r17592 | r17593 | |
---|---|---|
92 | 92 | // c64_cd_r - cartridge data read |
93 | 93 | //------------------------------------------------- |
94 | 94 | |
95 | UINT8 c64_silverrock_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
95 | 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) | |
96 | 96 | { |
97 | UINT8 data = 0; | |
98 | ||
99 | 97 | if (!roml) |
100 | 98 | { |
101 | 99 | offs_t addr = (m_bank << 13) | (offset & 0x1fff); |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_reset(); |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
43 | 43 | |
44 | 44 | private: |
r17592 | r17593 | |
---|---|---|
57 | 57 | // c64_cd_r - cartridge data read |
58 | 58 | //------------------------------------------------- |
59 | 59 | |
60 | UINT8 c64_kingsoft_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
60 | 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) | |
61 | 61 | { |
62 | UINT8 data = 0; | |
63 | ||
64 | 62 | if (!roml) |
65 | 63 | { |
66 | 64 | data = m_roml[offset & 0x1fff]; |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_reset(); |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
43 | 43 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); |
44 | 44 | }; |
r17592 | r17593 | |
---|---|---|
235 | 235 | // c64_cd_r - cartridge data read |
236 | 236 | //------------------------------------------------- |
237 | 237 | |
238 | 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) | |
238 | 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) | |
239 | 239 | { |
240 | | |
240 | | |
241 | 241 | |
242 | 242 | if (!io2) |
243 | 243 | { |
r17592 | r17593 | |
245 | 245 | { |
246 | 246 | switch (offset & 0x07) |
247 | 247 | { |
248 | case 0: data |= ioport("KB0")->read(); break; | |
249 | case 1: data |= ioport("KB1")->read(); break; | |
250 | case 2: data |= ioport("KB2")->read(); break; | |
251 | case 3: data |= ioport("KB3")->read(); break; | |
252 | case 4: data |= ioport("KB4")->read(); break; | |
253 | case 5: data |= ioport("KB5")->read(); break; | |
254 | case 6: data |= ioport("KB6")->read(); break; | |
255 | case 7: data |= ioport("KB7")->read(); break; | |
248 | case 0: data = ioport("KB0")->read(); break; | |
249 | case 1: data = ioport("KB1")->read(); break; | |
250 | case 2: data = ioport("KB2")->read(); break; | |
251 | case 3: data = ioport("KB3")->read(); break; | |
252 | case 4: data = ioport("KB4")->read(); break; | |
253 | case 5: data = ioport("KB5")->read(); break; | |
254 | case 6: data = ioport("KB6")->read(); break; | |
255 | case 7: data = ioport("KB7")->read(); break; | |
256 | 256 | } |
257 | 257 | } |
258 | 258 | else if (BIT(offset, 5)) |
259 | 259 | { |
260 | data | |
260 | data | |
261 | 261 | } |
262 | 262 | } |
263 | 263 |
r17592 | r17593 | |
---|---|---|
1095 | 1095 | 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) |
1096 | 1096 | INPUT_PORTS_END |
1097 | 1097 | |
1098 | SLOT_INTERFACE_START( cbm_datassette_devices ) | |
1099 | SLOT_INTERFACE("c1530", C1530) | |
1100 | SLOT_INTERFACE_END | |
1101 | ||
1098 | 1102 | SLOT_INTERFACE_START( cbm_iec_devices ) |
1099 | 1103 | SLOT_INTERFACE("c1540", C1540) |
1100 | 1104 | SLOT_INTERFACE("c1541", C1541) |
r17592 | r17593 | |
1112 | 1116 | SLOT_INTERFACE("interpod", INTERPOD) |
1113 | 1117 | SLOT_INTERFACE("minichief", MINI_CHIEF) |
1114 | 1118 | SLOT_INTERFACE("serialbox", SERIAL_BOX) |
1119 | SLOT_INTERFACE("diag264", DIAG264_SERIAL_LOOPBACK) | |
1115 | 1120 | SLOT_INTERFACE_END |
1116 | 1121 | |
1117 | 1122 | SLOT_INTERFACE_START( sx1541_iec_devices ) |
1118 | 1123 | SLOT_INTERFACE("sx1541", SX1541) |
1119 | 1124 | SLOT_INTERFACE_END |
1120 | 1125 | |
1126 | SLOT_INTERFACE_START( c128dcr_iec_devices ) | |
1127 | SLOT_INTERFACE("c1571cr", C1571CR) | |
1128 | SLOT_INTERFACE_END | |
1129 | ||
1130 | SLOT_INTERFACE_START( c128d81_iec_devices ) | |
1131 | SLOT_INTERFACE("c1563", C1563) | |
1132 | SLOT_INTERFACE_END | |
1133 | ||
1121 | 1134 | SLOT_INTERFACE_START( cbm_ieee488_devices ) |
1122 | 1135 | SLOT_INTERFACE("c2040", C2040) |
1123 | 1136 | SLOT_INTERFACE("c3040", C3040) |
r17592 | r17593 | |
1225 | 1238 | SLOT_INTERFACE_INTERNAL("c128_comal80", C128_COMAL80) |
1226 | 1239 | SLOT_INTERFACE_END |
1227 | 1240 | |
1241 | SLOT_INTERFACE_START( plus4_datassette_devices ) | |
1242 | SLOT_INTERFACE("c1531", C1531) | |
1243 | SLOT_INTERFACE("diag264", DIAG264_CASSETTE_LOOPBACK) | |
1244 | SLOT_INTERFACE_END | |
1245 | ||
1228 | 1246 | SLOT_INTERFACE_START( plus4_expansion_cards ) |
1229 | 1247 | SLOT_INTERFACE("c1551", C1551) |
1230 | 1248 | SLOT_INTERFACE("sid", PLUS4_SID) |
r17592 | r17593 | |
1234 | 1252 | SLOT_INTERFACE_END |
1235 | 1253 | |
1236 | 1254 | SLOT_INTERFACE_START( plus4_user_port_cards ) |
1255 | SLOT_INTERFACE("diag264", DIAG264_USER_PORT_LOOPBACK) | |
1237 | 1256 | SLOT_INTERFACE_END |
r17592 | r17593 | |
---|---|---|
52 | 52 | virtual void device_reset(); |
53 | 53 | |
54 | 54 | // device_c64_expansion_card_interface overrides |
55 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
55 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
56 | 56 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
57 | 57 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); |
58 | 58 | virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram); |
r17592 | r17593 | |
---|---|---|
3 | 3 | #ifndef CBMIPT_H_ |
4 | 4 | #define CBMIPT_H_ |
5 | 5 | |
6 | #include "machine/c2n.h" | |
6 | 7 | #include "machine/c64_4cga.h" |
7 | 8 | #include "machine/c64_4dxh.h" |
8 | 9 | #include "machine/c64_4ksa.h" |
r17592 | r17593 | |
68 | 69 | #include "machine/c8280.h" |
69 | 70 | #include "machine/d9060.h" |
70 | 71 | #include "machine/cmdhd.h" |
72 | #include "machine/diag264_lb_iec.h" | |
73 | #include "machine/diag264_lb_tape.h" | |
74 | #include "machine/diag264_lb_user.h" | |
71 | 75 | #include "machine/fd2000.h" |
72 | 76 | #include "machine/interpod.h" |
73 | 77 | #include "machine/plus4_sid.h" |
r17592 | r17593 | |
147 | 151 | |
148 | 152 | |
149 | 153 | |
154 | SLOT_INTERFACE_EXTERN( cbm_datassette_devices ); | |
150 | 155 | SLOT_INTERFACE_EXTERN( cbm_iec_devices ); |
151 | 156 | SLOT_INTERFACE_EXTERN( sx1541_iec_devices ); |
157 | SLOT_INTERFACE_EXTERN( c128dcr_iec_devices ); | |
158 | SLOT_INTERFACE_EXTERN( c128d81_iec_devices ); | |
152 | 159 | SLOT_INTERFACE_EXTERN( cbm_ieee488_devices ); |
153 | 160 | SLOT_INTERFACE_EXTERN( vic20_control_port_devices ); |
154 | 161 | SLOT_INTERFACE_EXTERN( vic20_expansion_cards ); |
r17592 | r17593 | |
157 | 164 | SLOT_INTERFACE_EXTERN( c64_expansion_cards ); |
158 | 165 | SLOT_INTERFACE_EXTERN( c64_user_port_cards ); |
159 | 166 | SLOT_INTERFACE_EXTERN( c128_expansion_cards ); |
167 | SLOT_INTERFACE_EXTERN( plus4_datassette_devices ); | |
160 | 168 | SLOT_INTERFACE_EXTERN( plus4_expansion_cards ); |
161 | 169 | SLOT_INTERFACE_EXTERN( plus4_user_port_cards ); |
162 | 170 |
r17592 | r17593 | |
---|---|---|
334 | 334 | // cd_r - cartridge data read |
335 | 335 | //------------------------------------------------- |
336 | 336 | |
337 | 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) | |
337 | 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) | |
338 | 338 | { |
339 | UINT8 data = 0; | |
340 | ||
341 | 339 | if (m_cart != NULL) |
342 | 340 | { |
343 | data = m_cart->vic20_cd_r(space, offset, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3); | |
341 | data = m_cart->vic20_cd_r(space, offset, data, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3); | |
344 | 342 | } |
345 | 343 | |
346 | 344 | return data; |
r17592 | r17593 | |
---|---|---|
81 | 81 | // c64_cd_r - cartridge data read |
82 | 82 | //------------------------------------------------- |
83 | 83 | |
84 | UINT8 c64_ocean_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
84 | 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) | |
85 | 85 | { |
86 | UINT8 data = 0; | |
87 | ||
88 | 86 | if (!roml) |
89 | 87 | { |
90 | 88 | offs_t addr = (m_bank << 13) | (offset & 0x1fff); |
r17592 | r17593 | |
---|---|---|
93 | 93 | virtual ~vic20_expansion_slot_device(); |
94 | 94 | |
95 | 95 | // computer interface |
96 | 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); | |
96 | 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); | |
97 | 97 | 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); |
98 | 98 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
99 | 99 | DECLARE_WRITE_LINE_MEMBER( port_res_w ); |
r17592 | r17593 | |
157 | 157 | virtual UINT8* vic20_nvram_pointer(running_machine &machine, size_t size); |
158 | 158 | |
159 | 159 | // runtime |
160 | 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 | |
160 | 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; }; | |
161 | 161 | 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) { }; |
162 | 162 | virtual UINT32 vic20_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } |
163 | 163 | virtual void vic20_res_w(int state) { }; |
r17592 | r17593 | |
---|---|---|
127 | 127 | // c64_cd_r - cartridge data read |
128 | 128 | //------------------------------------------------- |
129 | 129 | |
130 | 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) | |
130 | 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) | |
131 | 131 | { |
132 | UINT8 data = 0; | |
133 | ||
134 | 132 | if (!roml || !romh || !io1 || !io2) |
135 | 133 | { |
136 | 134 | offs_t addr = UNSCRAMBLE_ADDRESS(offset & 0x3fff); |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_reset(); |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
43 | 43 | |
44 | 44 | private: |
r17592 | r17593 | |
---|---|---|
43 | 43 | virtual void device_reset(); |
44 | 44 | |
45 | 45 | // device_c64_expansion_card_interface overrides |
46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
47 | 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
48 | 48 | |
49 | 49 | private: |
r17592 | r17593 | |
---|---|---|
59 | 59 | // c64_cd_r - cartridge data read |
60 | 60 | //------------------------------------------------- |
61 | 61 | |
62 | UINT8 c64_system3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
62 | 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) | |
63 | 63 | { |
64 | UINT8 data = 0; | |
65 | ||
66 | 64 | if (!roml) |
67 | 65 | { |
68 | 66 | offs_t addr = (m_bank << 13) | (offset & 0x1fff); |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_reset(); |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
43 | 43 | |
44 | 44 | private: |
r17592 | r17593 | |
---|---|---|
59 | 59 | // c64_cd_r - cartridge data read |
60 | 60 | //------------------------------------------------- |
61 | 61 | |
62 | 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) | |
62 | 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) | |
63 | 63 | { |
64 | UINT8 data = 0; | |
65 | ||
66 | 64 | if (!roml) |
67 | 65 | { |
68 | 66 | offs_t addr = (m_bank << 13) | (offset & 0x1fff); |
r17592 | r17593 | |
---|---|---|
47 | 47 | // c64_cd_r - cartridge data read |
48 | 48 | //------------------------------------------------- |
49 | 49 | |
50 | UINT8 c64_exos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
50 | 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) | |
51 | 51 | { |
52 | UINT8 data = 0; | |
53 | ||
54 | 52 | if (!romh) |
55 | 53 | { |
56 | 54 | data = m_romh[offset & 0x1fff]; |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_reset(); |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
43 | 43 | |
44 | 44 | private: |
r17592 | r17593 | |
---|---|---|
37 | 37 | virtual void device_start(); |
38 | 38 | |
39 | 39 | // device_c64_expansion_card_interface overrides |
40 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
40 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
41 | 41 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); |
42 | 42 | }; |
43 | 43 |
r17592 | r17593 | |
---|---|---|
81 | 81 | // c64_cd_r - cartridge data read |
82 | 82 | //------------------------------------------------- |
83 | 83 | |
84 | UINT8 c64_pagefox_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
84 | 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) | |
85 | 85 | { |
86 | UINT8 data = 0; | |
87 | ||
88 | 86 | if (!roml || !romh) |
89 | 87 | { |
90 | 88 | if (BIT(m_bank, 3)) |
r17592 | r17593 | |
---|---|---|
209 | 209 | // c64_cd_r - cartridge data read |
210 | 210 | //------------------------------------------------- |
211 | 211 | |
212 | UINT8 c64_xl80_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
212 | 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) | |
213 | 213 | { |
214 | UINT8 data = 0; | |
215 | ||
216 | 214 | if (!io2 && BIT(offset, 2)) |
217 | 215 | { |
218 | 216 | if (offset & 0x01) |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_reset(); |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
43 | 43 | |
44 | 44 | private: |
r0 | r17593 | |
---|---|---|
1 | /********************************************************************** | |
2 | ||
3 | Diag264 User Port Loop Back Connector emulation | |
4 | ||
5 | Copyright MESS Team. | |
6 | Visit http://mamedev.org for licensing and usage restrictions. | |
7 | ||
8 | **********************************************************************/ | |
9 | ||
10 | #include "diag264_lb_user.h" | |
11 | ||
12 | ||
13 | ||
14 | //************************************************************************** | |
15 | // DEVICE DEFINITIONS | |
16 | //************************************************************************** | |
17 | ||
18 | const device_type DIAG264_USER_PORT_LOOPBACK = &device_creator<diag264_user_port_loopback_device>; | |
19 | ||
20 | ||
21 | ||
22 | //************************************************************************** | |
23 | // LIVE DEVICE | |
24 | //************************************************************************** | |
25 | ||
26 | //------------------------------------------------- | |
27 | // diag264_user_port_loopback_device - constructor | |
28 | //------------------------------------------------- | |
29 | ||
30 | diag264_user_port_loopback_device::diag264_user_port_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
31 | : device_t(mconfig, DIAG264_USER_PORT_LOOPBACK, "Diag264 User Port Loopback", tag, owner, clock), | |
32 | device_plus4_user_port_interface(mconfig, *this), | |
33 | m_p(0), | |
34 | m_txd(0), | |
35 | m_rts(0), | |
36 | m_dtr(0) | |
37 | { | |
38 | } | |
39 | ||
40 | ||
41 | //------------------------------------------------- | |
42 | // device_start - device-specific startup | |
43 | //------------------------------------------------- | |
44 | ||
45 | void diag264_user_port_loopback_device::device_start() | |
46 | { | |
47 | } |
r17592 | r17593 | |
---|---|---|
46 | 46 | virtual void device_reset(); |
47 | 47 | |
48 | 48 | // device_c64_expansion_card_interface overrides |
49 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
49 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
50 | 50 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
51 | 51 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram) { return 1; } |
52 | 52 | virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram) { return 0; } |
r0 | r17593 | |
---|---|---|
1 | /********************************************************************** | |
2 | ||
3 | Diag264 User Port Loop Back Connector emulation | |
4 | ||
5 | Copyright MESS Team. | |
6 | Visit http://mamedev.org for licensing and usage restrictions. | |
7 | ||
8 | **********************************************************************/ | |
9 | ||
10 | #pragma once | |
11 | ||
12 | #ifndef __DIAG264_USER_PORT_LOOPBACK__ | |
13 | #define __DIAG264_USER_PORT_LOOPBACK__ | |
14 | ||
15 | ||
16 | #include "emu.h" | |
17 | #include "machine/plus4user.h" | |
18 | ||
19 | ||
20 | ||
21 | //************************************************************************** | |
22 | // TYPE DEFINITIONS | |
23 | //************************************************************************** | |
24 | ||
25 | // ======================> diag264_user_port_loopback_device | |
26 | ||
27 | class diag264_user_port_loopback_device : public device_t, | |
28 | public device_plus4_user_port_interface | |
29 | { | |
30 | public: | |
31 | // construction/destruction | |
32 | diag264_user_port_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
33 | ||
34 | protected: | |
35 | // device-level overrides | |
36 | virtual void device_config_complete() { m_shortname = "diag264_user_port_loopback"; } | |
37 | virtual void device_start(); | |
38 | ||
39 | // device_plus4_user_port_interface overrides | |
40 | 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); } | |
41 | virtual void plus4_p_w(UINT8 data) { logerror("P write %02x\n", data); m_p = data; } | |
42 | virtual int plus4_rxd_r() { return m_txd; } | |
43 | virtual int plus4_dcd_r() { return m_dtr; } | |
44 | virtual int plus4_dsr_r() { return m_rts; } | |
45 | virtual void plus4_txd_w(int state) { m_txd = state; } | |
46 | virtual void plus4_dtr_w(int state) { m_dtr = state; } | |
47 | virtual void plus4_rts_w(int state) { m_rts = state; } | |
48 | ||
49 | private: | |
50 | UINT8 m_p; | |
51 | ||
52 | int m_txd; | |
53 | int m_rts; | |
54 | int m_dtr; | |
55 | }; | |
56 | ||
57 | ||
58 | // device type definition | |
59 | extern const device_type DIAG264_USER_PORT_LOOPBACK; | |
60 | ||
61 | ||
62 | ||
63 | #endif |
r17592 | r17593 | |
---|---|---|
57 | 57 | // c64_cd_r - cartridge data read |
58 | 58 | //------------------------------------------------- |
59 | 59 | |
60 | UINT8 c64_mach5_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
60 | 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) | |
61 | 61 | { |
62 | UINT8 data = 0; | |
63 | ||
64 | 62 | if (!roml || !io1 || !io2) |
65 | 63 | { |
66 | 64 | data = m_roml[offset & 0x1fff]; |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_reset(); |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
43 | 43 | }; |
44 | 44 |
r17592 | r17593 | |
---|---|---|
132 | 132 | // c64_cd_r - cartridge data read |
133 | 133 | //------------------------------------------------- |
134 | 134 | |
135 | UINT8 c64_16kb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
135 | 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) | |
136 | 136 | { |
137 | UINT8 data = 0; | |
138 | ||
139 | 137 | if (!roml) |
140 | 138 | { |
141 | 139 | data = m_roml[offset & 0x1fff]; |
r17592 | r17593 | |
---|---|---|
44 | 44 | virtual void device_reset(); |
45 | 45 | |
46 | 46 | // device_c64_expansion_card_interface overrides |
47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
48 | 48 | }; |
49 | 49 | |
50 | 50 |
r17592 | r17593 | |
---|---|---|
63 | 63 | // c64_cd_r - cartridge data read |
64 | 64 | //------------------------------------------------- |
65 | 65 | |
66 | UINT8 c64_neoram_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
66 | 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) | |
67 | 67 | { |
68 | UINT8 data = 0; | |
69 | ||
70 | 68 | if (!io1) |
71 | 69 | { |
72 | 70 | offs_t addr = (m_bank << 8) | (offset & 0xff); |
r17592 | r17593 | |
---|---|---|
44 | 44 | virtual void nvram_write(emu_file &file) { if (m_nvram != NULL) { file.write(m_nvram, m_nvram_size); } } |
45 | 45 | |
46 | 46 | // device_c64_expansion_card_interface overrides |
47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
48 | 48 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
49 | 49 | |
50 | 50 | private: |
r17592 | r17593 | |
---|---|---|
104 | 104 | virtual int plus4_rxd_r() { return 1; }; |
105 | 105 | virtual int plus4_dcd_r() { return 0; }; |
106 | 106 | virtual int plus4_dsr_r() { return 0; }; |
107 | virtual void plus4_txd_w(int level) { }; | |
108 | virtual void plus4_dtr_w(int level) { }; | |
109 | virtual void plus4_rts_w(int level) { }; | |
110 | virtual void plus4_rxc_w(int level) { }; | |
111 | virtual void plus4_atn_w(int level) { }; | |
107 | virtual void plus4_txd_w(int state) { }; | |
108 | virtual void plus4_dtr_w(int state) { }; | |
109 | virtual void plus4_rts_w(int state) { }; | |
110 | virtual void plus4_rxc_w(int state) { }; | |
111 | virtual void plus4_atn_w(int state) { }; | |
112 | 112 | |
113 | 113 | // reset |
114 | virtual void plus4_breset_w(int | |
114 | virtual void plus4_breset_w(int state | |
115 | 115 | |
116 | 116 | protected: |
117 | 117 | plus4_user_port_device *m_slot; |
r17592 | r17593 | |
---|---|---|
57 | 57 | // c64_cd_r - cartridge data read |
58 | 58 | //------------------------------------------------- |
59 | 59 | |
60 | 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) | |
60 | 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) | |
61 | 61 | { |
62 | UINT8 data = 0; | |
63 | ||
64 | 62 | if (!roml) |
65 | 63 | { |
66 | 64 | data = m_roml[offset & 0x1fff]; |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_reset(); |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
43 | 43 | }; |
44 | 44 |
r17592 | r17593 | |
---|---|---|
62 | 62 | // sid6581_interface sid_intf |
63 | 63 | //------------------------------------------------- |
64 | 64 | |
65 | static | |
65 | static MOS6581 | |
66 | 66 | { |
67 | return 0; | |
68 | } | |
69 | ||
70 | static const sid6581_interface sid_intf = | |
71 | { | |
72 | paddle_read | |
67 | DEVCB_NULL, | |
68 | DEVCB_NULL | |
73 | 69 | }; |
74 | 70 | |
75 | 71 | |
r17592 | r17593 | |
141 | 137 | // plus4_cd_r - cartridge data read |
142 | 138 | //------------------------------------------------- |
143 | 139 | |
144 | 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) | |
140 | 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) | |
145 | 141 | { |
146 | UINT8 data = 0; | |
147 | ||
148 | 142 | if ((offset >= 0xfe80 && offset < 0xfea0) || (offset >= 0xfd40 && offset < 0xfd60)) |
149 | 143 | { |
150 | 144 | data = sid6581_r(m_sid, offset & 0x1f); |
r17592 | r17593 | |
---|---|---|
46 | 46 | virtual void device_reset(); |
47 | 47 | |
48 | 48 | // device_plus4_expansion_card_interface overrides |
49 | 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); | |
49 | 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); | |
50 | 50 | 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); |
51 | 51 | virtual void plus4_breset_w(int state); |
52 | 52 |
r17592 | r17593 | |
---|---|---|
105 | 105 | // c64_cd_r - cartridge data read |
106 | 106 | //------------------------------------------------- |
107 | 107 | |
108 | UINT8 c64_final3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
108 | 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) | |
109 | 109 | { |
110 | UINT8 data = 0; | |
111 | ||
112 | 110 | if (!roml || !romh || !io1 || !io2) |
113 | 111 | { |
114 | 112 | offs_t addr = (m_bank << 14) | (offset & 0x3fff); |
r17592 | r17593 | |
---|---|---|
44 | 44 | virtual void device_reset(); |
45 | 45 | |
46 | 46 | // device_c64_expansion_card_interface overrides |
47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
48 | 48 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
49 | 49 | |
50 | 50 | private: |
r17592 | r17593 | |
---|---|---|
57 | 57 | // c64_cd_r - cartridge data read |
58 | 58 | //------------------------------------------------- |
59 | 59 | |
60 | UINT8 c64_westermann_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
60 | 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) | |
61 | 61 | { |
62 | UINT8 data = 0; | |
63 | ||
64 | 62 | if (!roml) |
65 | 63 | { |
66 | 64 | data = m_roml[offset & 0x1fff]; |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_reset(); |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | }; |
43 | 43 | |
44 | 44 |
r17592 | r17593 | |
---|---|---|
47 | 47 | // plus4_cd_r - cartridge data read |
48 | 48 | //------------------------------------------------- |
49 | 49 | |
50 | 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) | |
50 | 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) | |
51 | 51 | { |
52 | UINT8 data = 0; | |
53 | ||
54 | 52 | if (!c1l && m_c1l_mask) |
55 | 53 | { |
56 | 54 | data = m_c1l[offset & m_c1l_mask]; |
r17592 | r17593 | |
---|---|---|
111 | 111 | // c64_cd_r - cartridge data read |
112 | 112 | //------------------------------------------------- |
113 | 113 | |
114 | UINT8 c64_vizawrite_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
114 | 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) | |
115 | 115 | { |
116 | UINT8 data = 0; | |
117 | ||
118 | 116 | if (!roml) |
119 | 117 | { |
120 | 118 | offs_t addr = (m_game << 13) | (offset & 0x1fff); |
r17592 | r17593 | |
---|---|---|
106 | 106 | // vic20_cd_r - cartridge data read |
107 | 107 | //------------------------------------------------- |
108 | 108 | |
109 | 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) | |
109 | 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) | |
110 | 110 | { |
111 | UINT8 data = 0; | |
112 | ||
113 | 111 | for (int i = 0; i < MAX_SLOTS; i++) |
114 | 112 | { |
115 | data |= m_expansion_slot[i]->cd_r(space, offset, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3); | |
113 | UINT8 slot_data = m_expansion_slot[i]->cd_r(space, offset, data, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3); | |
114 | ||
115 | if (data != slot_data) | |
116 | { | |
117 | data = slot_data; | |
118 | } | |
116 | 119 | } |
117 | 120 | |
118 | 121 | return data; |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_start(); |
39 | 39 | |
40 | 40 | // device_plus4_expansion_card_interface overrides |
41 | 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); | |
41 | 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); | |
42 | 42 | }; |
43 | 43 | |
44 | 44 |
r17592 | r17593 | |
---|---|---|
39 | 39 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
40 | 40 | |
41 | 41 | // device_c64_expansion_card_interface overrides |
42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
43 | 43 | virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram) { return 0; } |
44 | 44 | |
45 | 45 | private: |
r17592 | r17593 | |
---|---|---|
54 | 54 | virtual machine_config_constructor device_mconfig_additions() const; |
55 | 55 | |
56 | 56 | // device_vic20_expansion_card_interface overrides |
57 | 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); | |
57 | 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); | |
58 | 58 | 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); |
59 | 59 | virtual UINT32 vic20_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
60 | 60 | virtual void vic20_res_w(int state); |
r17592 | r17593 | |
---|---|---|
277 | 277 | // c64_cd_r - cartridge data read |
278 | 278 | //------------------------------------------------- |
279 | 279 | |
280 | UINT8 c64_ieee488_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
280 | 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) | |
281 | 281 | { |
282 | | |
282 | | |
283 | 283 | |
284 | 284 | if (!roml) |
285 | 285 | { |
r17592 | r17593 | |
---|---|---|
57 | 57 | virtual void device_reset(); |
58 | 58 | |
59 | 59 | // device_c64_expansion_card_interface overrides |
60 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
60 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
61 | 61 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
62 | 62 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); |
63 | 63 |
r17592 | r17593 | |
---|---|---|
95 | 95 | // c64_cd_r - cartridge data read |
96 | 96 | //------------------------------------------------- |
97 | 97 | |
98 | UINT8 c64_final_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
98 | 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) | |
99 | 99 | { |
100 | UINT8 data = 0; | |
101 | ||
102 | 100 | if (!roml || !romh || !io1 || !io2) |
103 | 101 | { |
104 | 102 | data = m_roml[offset & 0x3fff]; |
r17592 | r17593 | |
---|---|---|
208 | 208 | // c64_cd_r - cartridge data read |
209 | 209 | //------------------------------------------------- |
210 | 210 | |
211 | UINT8 c64_multiscreen_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
211 | 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) | |
212 | 212 | { |
213 | UINT8 data = 0; | |
214 | ||
215 | 213 | if (!roml) |
216 | 214 | { |
217 | 215 | int bank = m_bank & 0x0f; |
r17592 | r17593 | |
---|---|---|
44 | 44 | virtual void device_reset(); |
45 | 45 | |
46 | 46 | // device_c64_expansion_card_interface overrides |
47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
48 | 48 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
49 | 49 | }; |
50 | 50 |
r17592 | r17593 | |
---|---|---|
44 | 44 | virtual void device_reset(); |
45 | 45 | |
46 | 46 | // device_c64_expansion_card_interface overrides |
47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
48 | 48 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
49 | 49 | |
50 | 50 | private: |
r17592 | r17593 | |
---|---|---|
149 | 149 | // c64_cd_r - cartridge data read |
150 | 150 | //------------------------------------------------- |
151 | 151 | |
152 | UINT8 c64_ide64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
152 | 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) | |
153 | 153 | { |
154 | if (!m_enable) return | |
154 | if (!m_enable) return data; | |
155 | 155 | |
156 | UINT8 data = 0; | |
157 | 156 | int rom_oe = 1, ram_oe = 1; |
158 | 157 | |
159 | 158 | if (!m_game && m_exrom && ba) |
r17592 | r17593 | |
---|---|---|
46 | 46 | virtual void device_reset(); |
47 | 47 | |
48 | 48 | // device_c64_expansion_card_interface overrides |
49 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
49 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
50 | 50 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
51 | 51 | |
52 | 52 | private: |
r17592 | r17593 | |
---|---|---|
79 | 79 | |
80 | 80 | |
81 | 81 | READ8_MEMBER( vcs_control_port_device::joy_r ) { UINT8 data = 0xff; if (m_device != NULL) data = m_device->vcs_joy_r(); return data; } |
82 | 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; } | |
83 | 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; } | |
82 | UINT8 vcs_control_port_device::pot_x_r() { UINT8 data = 0xff; if (m_device != NULL) data = m_device->vcs_pot_x_r(); return data; } | |
83 | READ8_MEMBER( vcs_control_port_device::pot_x_r ) { return pot_x_r(); } | |
84 | UINT8 vcs_control_port_device::pot_y_r() { UINT8 data = 0xff; if (m_device != NULL) data = m_device->vcs_pot_y_r(); return data; } | |
85 | READ8_MEMBER( vcs_control_port_device::pot_y_r ) { return pot_y_r(); } |
r17592 | r17593 | |
---|---|---|
47 | 47 | |
48 | 48 | // computer interface |
49 | 49 | DECLARE_READ8_MEMBER( joy_r ); |
50 | UINT8 pot_x_r(); | |
50 | 51 | DECLARE_READ8_MEMBER( pot_x_r ); |
52 | UINT8 pot_y_r(); | |
51 | 53 | DECLARE_READ8_MEMBER( pot_y_r ); |
52 | 54 | |
53 | 55 | protected: |
r17592 | r17593 | |
---|---|---|
80 | 80 | // vic20_cd_r - cartridge data read |
81 | 81 | //------------------------------------------------- |
82 | 82 | |
83 | 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) | |
83 | 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) | |
84 | 84 | { |
85 | UINT8 data = 0; | |
86 | ||
87 | 85 | if (!ram1 || !ram2 || !ram3 || !io2 || !io3) |
88 | 86 | { |
89 | 87 | if (m_nvram_en) |
r17592 | r17593 | |
---|---|---|
47 | 47 | virtual void nvram_write(emu_file &file) { if (m_nvram != NULL) { file.write(m_nvram, m_nvram_size); } } |
48 | 48 | |
49 | 49 | // device_vic20_expansion_card_interface overrides |
50 | 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); | |
50 | 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); | |
51 | 51 | 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); |
52 | 52 | |
53 | 53 | private: |
r17592 | r17593 | |
---|---|---|
88 | 88 | // vic20_cd_r - cartridge data read |
89 | 89 | //------------------------------------------------- |
90 | 90 | |
91 | 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) | |
91 | 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) | |
92 | 92 | { |
93 | UINT8 data = 0; | |
94 | 93 | UINT8 sw = ioport("SW")->read(); |
95 | 94 | |
96 | 95 | if ((!blk1 && (sw == BLK1)) || (!blk2 && (sw == BLK2)) || (!blk3 && (sw == BLK3)) || (!blk5 && (sw == BLK5))) |
r17592 | r17593 | |
---|---|---|
40 | 40 | virtual void device_config_complete() { m_shortname = "vic1110"; } |
41 | 41 | |
42 | 42 | // device_vic20_expansion_card_interface overrides |
43 | 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); | |
43 | 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); | |
44 | 44 | 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); |
45 | 45 | }; |
46 | 46 |
r17592 | r17593 | |
---|---|---|
148 | 148 | // c64_cd_r - cartridge data read |
149 | 149 | //------------------------------------------------- |
150 | 150 | |
151 | UINT8 c64_stardos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
151 | 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) | |
152 | 152 | { |
153 | UINT8 data = 0; | |
154 | ||
155 | 153 | if (!roml || !romh) |
156 | 154 | { |
157 | 155 | // TODO BITSWAP8(7,6,5,4,3,1,2,0) ? |
r17592 | r17593 | |
---|---|---|
43 | 43 | virtual void device_start(); |
44 | 44 | |
45 | 45 | // device_c64_expansion_card_interface overrides |
46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
47 | 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
48 | 48 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); |
49 | 49 |
r17592 | r17593 | |
---|---|---|
62 | 62 | // c64_cd_r - cartridge data read |
63 | 63 | //------------------------------------------------- |
64 | 64 | |
65 | UINT8 c64_ross_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
65 | 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) | |
66 | 66 | { |
67 | UINT8 data = 0; | |
68 | ||
69 | 67 | if (!roml || !romh) |
70 | 68 | { |
71 | 69 | offs_t addr = (m_bank << 14) | (offset & 0x3fff); |
r17592 | r17593 | |
---|---|---|
39 | 39 | virtual void device_reset(); |
40 | 40 | |
41 | 41 | // device_c64_expansion_card_interface overrides |
42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
43 | 43 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
44 | 44 | |
45 | 45 | private: |
r17592 | r17593 | |
---|---|---|
59 | 59 | // c64_cd_r - cartridge data read |
60 | 60 | //------------------------------------------------- |
61 | 61 | |
62 | UINT8 c64_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
62 | 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) | |
63 | 63 | { |
64 | UINT8 data = 0; | |
65 | ||
66 | 64 | if (!roml || !romh) |
67 | 65 | { |
68 | 66 | offs_t addr = (m_bank << 14) | (offset & 0x3fff); |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_config_complete() { m_shortname = "c64_comal80"; } |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
43 | 43 | |
44 | 44 | private: |
r17592 | r17593 | |
---|---|---|
59 | 59 | // c64_cd_r - cartridge data read |
60 | 60 | //------------------------------------------------- |
61 | 61 | |
62 | UINT8 c64_prophet64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
62 | 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) | |
63 | 63 | { |
64 | UINT8 data = 0; | |
65 | ||
66 | 64 | if (!roml) |
67 | 65 | { |
68 | 66 | offs_t addr = (m_bank << 13) | (offset & 0x1fff); |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_reset(); |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
43 | 43 | |
44 | 44 | private: |
r17592 | r17593 | |
---|---|---|
49 | 49 | // vic20_cd_r - cartridge data read |
50 | 50 | //------------------------------------------------- |
51 | 51 | |
52 | 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) | |
52 | 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) | |
53 | 53 | { |
54 | UINT8 data = 0; | |
55 | ||
56 | 54 | if (!blk1 || !blk2) |
57 | 55 | { |
58 | 56 | data = m_ram[offset & 0x3fff]; |
r17592 | r17593 | |
---|---|---|
200 | 200 | // c64_cd_r - cartridge data read |
201 | 201 | //------------------------------------------------- |
202 | 202 | |
203 | 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) | |
203 | 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) | |
204 | 204 | { |
205 | UINT8 data = 0; | |
206 | ||
207 | 205 | if (!romh) |
208 | 206 | { |
209 | 207 | data = m_romh[offset & 0x1fff]; |
r17592 | r17593 | |
---|---|---|
37 | 37 | virtual void device_config_complete() { m_shortname = "vic1111"; } |
38 | 38 | |
39 | 39 | // device_vic20_expansion_card_interface overrides |
40 | 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); | |
40 | 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); | |
41 | 41 | 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); |
42 | 42 | }; |
43 | 43 |
r17592 | r17593 | |
---|---|---|
47 | 47 | // c64_cd_r - cartridge data read |
48 | 48 | //------------------------------------------------- |
49 | 49 | |
50 | 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) | |
50 | 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) | |
51 | 51 | { |
52 | UINT8 data = 0; | |
53 | ||
54 | 52 | if (!roml || !romh || !io1 || !io2) |
55 | 53 | { |
56 | 54 | data = m_roml[offset & 0x1fff]; |
r17592 | r17593 | |
---|---|---|
43 | 43 | virtual void device_reset(); |
44 | 44 | |
45 | 45 | // device_c64_expansion_card_interface overrides |
46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
47 | 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
48 | 48 | |
49 | 49 | private: |
r17592 | r17593 | |
---|---|---|
37 | 37 | virtual void device_start(); |
38 | 38 | |
39 | 39 | // device_c64_expansion_card_interface overrides |
40 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
40 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
41 | 41 | }; |
42 | 42 | |
43 | 43 |
r17592 | r17593 | |
---|---|---|
102 | 102 | // c64_cd_r - cartridge data read |
103 | 103 | //------------------------------------------------- |
104 | 104 | |
105 | 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) | |
105 | 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) | |
106 | 106 | { |
107 | UINT8 data = 0; | |
108 | ||
109 | 107 | if (!roml) |
110 | 108 | { |
111 | 109 | offs_t addr = (m_bank << 13) | (offset & 0x1fff); |
r17592 | r17593 | |
---|---|---|
57 | 57 | // c64_cd_r - cartridge data read |
58 | 58 | //------------------------------------------------- |
59 | 59 | |
60 | UINT8 c64_rex_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
60 | 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) | |
61 | 61 | { |
62 | UINT8 data = 0; | |
63 | ||
64 | 62 | if (!roml) |
65 | 63 | { |
66 | 64 | data = m_roml[offset & 0x1fff]; |
r17592 | r17593 | |
---|---|---|
41 | 41 | virtual void device_reset(); |
42 | 42 | |
43 | 43 | // device_c64_expansion_card_interface overrides |
44 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
44 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
45 | 45 | |
46 | 46 | private: |
47 | 47 | int m_bank; |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_reset(); |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | }; |
43 | 43 | |
44 | 44 |
r17592 | r17593 | |
---|---|---|
47 | 47 | // vic10_cd_r - cartridge data read |
48 | 48 | //------------------------------------------------- |
49 | 49 | |
50 | UINT8 vic10_standard_cartridge_device::vic10_cd_r(address_space &space, offs_t offset, int lorom, int uprom, int exram) | |
50 | UINT8 vic10_standard_cartridge_device::vic10_cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram) | |
51 | 51 | { |
52 | UINT8 data = 0; | |
53 | ||
54 | 52 | if (!lorom && (m_lorom != NULL)) |
55 | 53 | { |
56 | 54 | data = m_lorom[offset & 0x1fff]; |
r17592 | r17593 | |
---|---|---|
37 | 37 | virtual void device_config_complete() { m_shortname = "vic10_standard"; } |
38 | 38 | |
39 | 39 | // device_vic10_expansion_card_interface overrides |
40 | virtual UINT8 vic10_cd_r(address_space &space, offs_t offset, int lorom, int uprom, int exram); | |
40 | virtual UINT8 vic10_cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram); | |
41 | 41 | virtual void vic10_cd_w(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram); |
42 | 42 | }; |
43 | 43 |
r17592 | r17593 | |
---|---|---|
50 | 50 | // vic20_cd_r - cartridge data read |
51 | 51 | //------------------------------------------------- |
52 | 52 | |
53 | 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) | |
53 | 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) | |
54 | 54 | { |
55 | UINT8 data = 0; | |
56 | ||
57 | 55 | if (!ram1 || !ram2 || !ram3) |
58 | 56 | { |
59 | 57 | data = m_ram[offset & 0xbff]; |
r17592 | r17593 | |
---|---|---|
225 | 225 | // vic20_cd_r - cartridge data read |
226 | 226 | //------------------------------------------------- |
227 | 227 | |
228 | 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) | |
228 | 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) | |
229 | 229 | { |
230 | UINT8 data = 0; | |
231 | ||
232 | 230 | if (!io2) |
233 | 231 | { |
234 | 232 | if (offset & 0x10) |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_config_complete() { m_shortname = "vic1210"; } |
39 | 39 | |
40 | 40 | // device_vic20_expansion_card_interface overrides |
41 | 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); | |
41 | 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); | |
42 | 42 | 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); |
43 | 43 | }; |
44 | 44 |
r17592 | r17593 | |
---|---|---|
53 | 53 | virtual void device_config_complete() { m_shortname = "vic1112"; } |
54 | 54 | |
55 | 55 | // device_vic20_expansion_card_interface overrides |
56 | 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); | |
56 | 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); | |
57 | 57 | 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); |
58 | 58 | |
59 | 59 | private: |
r17592 | r17593 | |
---|---|---|
59 | 59 | // c64_cd_r - cartridge data read |
60 | 60 | //------------------------------------------------- |
61 | 61 | |
62 | UINT8 c64_dinamic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
62 | 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) | |
63 | 63 | { |
64 | UINT8 data = 0; | |
65 | ||
66 | 64 | if (!roml) |
67 | 65 | { |
68 | 66 | offs_t addr = (m_bank << 13) | (offset & 0x1fff); |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_config_complete() { m_shortname = "c64_dinamic"; } |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | |
43 | 43 | private: |
44 | 44 | UINT8 m_bank; |
r17592 | r17593 | |
---|---|---|
132 | 132 | // c64_cd_r - cartridge data read |
133 | 133 | //------------------------------------------------- |
134 | 134 | |
135 | UINT8 c64_easyflash_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
135 | 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) | |
136 | 136 | { |
137 | UINT8 data = 0; | |
138 | ||
139 | 137 | if (!roml) |
140 | 138 | { |
141 | 139 | offs_t addr = (m_bank << 13) | (offset & 0x1fff); |
r17592 | r17593 | |
---|---|---|
45 | 45 | virtual void device_reset(); |
46 | 46 | |
47 | 47 | // device_c64_expansion_card_interface overrides |
48 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
48 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
49 | 49 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
50 | 50 | virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram); |
51 | 51 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); |
r0 | r17593 | |
---|---|---|
1 | /********************************************************************** | |
2 | ||
3 | Diag264 Serial Loop Back Connector emulation | |
4 | ||
5 | Copyright MESS Team. | |
6 | Visit http://mamedev.org for licensing and usage restrictions. | |
7 | ||
8 | **********************************************************************/ | |
9 | ||
10 | #include "diag264_lb_iec.h" | |
11 | ||
12 | ||
13 | ||
14 | //************************************************************************** | |
15 | // DEVICE DEFINITIONS | |
16 | //************************************************************************** | |
17 | ||
18 | const device_type DIAG264_SERIAL_LOOPBACK = &device_creator<diag264_serial_loopback_device>; | |
19 | ||
20 | ||
21 | ||
22 | //************************************************************************** | |
23 | // LIVE DEVICE | |
24 | //************************************************************************** | |
25 | ||
26 | //------------------------------------------------- | |
27 | // diag264_serial_loopback_device - constructor | |
28 | //------------------------------------------------- | |
29 | ||
30 | diag264_serial_loopback_device::diag264_serial_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
31 | : device_t(mconfig, DIAG264_SERIAL_LOOPBACK, "Diag264 Serial Loopback", tag, owner, clock), | |
32 | device_cbm_iec_interface(mconfig, *this) | |
33 | { | |
34 | } | |
35 | ||
36 | ||
37 | //------------------------------------------------- | |
38 | // device_start - device-specific startup | |
39 | //------------------------------------------------- | |
40 | ||
41 | void diag264_serial_loopback_device::device_start() | |
42 | { | |
43 | } | |
44 | ||
45 | ||
46 | //------------------------------------------------- | |
47 | // cbm_iec_atn - | |
48 | //------------------------------------------------- | |
49 | ||
50 | void diag264_serial_loopback_device::cbm_iec_atn(int state) | |
51 | { | |
52 | m_bus->clk_w(state); | |
53 | } |
r0 | r17593 | |
---|---|---|
1 | /********************************************************************** | |
2 | ||
3 | Commodore PET/VIC-20/C64/Plus-4 Datassette Port emulation | |
4 | ||
5 | Copyright MESS Team. | |
6 | Visit http://mamedev.org for licensing and usage restrictions. | |
7 | ||
8 | **********************************************************************/ | |
9 | ||
10 | #include "machine/petcass.h" | |
11 | ||
12 | ||
13 | ||
14 | //************************************************************************** | |
15 | // GLOBAL VARIABLES | |
16 | //************************************************************************** | |
17 | ||
18 | const device_type PET_DATASSETTE_PORT = &device_creator<pet_datassette_port_device>; | |
19 | ||
20 | ||
21 | ||
22 | //************************************************************************** | |
23 | // CARD INTERFACE | |
24 | //************************************************************************** | |
25 | ||
26 | //------------------------------------------------- | |
27 | // device_pet_datassette_port_interface - constructor | |
28 | //------------------------------------------------- | |
29 | ||
30 | device_pet_datassette_port_interface::device_pet_datassette_port_interface(const machine_config &mconfig, device_t &device) | |
31 | : device_slot_card_interface(mconfig,device) | |
32 | { | |
33 | m_slot = dynamic_cast<pet_datassette_port_device *>(device.owner()); | |
34 | } | |
35 | ||
36 | ||
37 | //------------------------------------------------- | |
38 | // ~device_pet_datassette_port_interface - destructor | |
39 | //------------------------------------------------- | |
40 | ||
41 | device_pet_datassette_port_interface::~device_pet_datassette_port_interface() | |
42 | { | |
43 | } | |
44 | ||
45 | ||
46 | ||
47 | //************************************************************************** | |
48 | // LIVE DEVICE | |
49 | //************************************************************************** | |
50 | ||
51 | //------------------------------------------------- | |
52 | // pet_datassette_port_device - constructor | |
53 | //------------------------------------------------- | |
54 | ||
55 | pet_datassette_port_device::pet_datassette_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
56 | device_t(mconfig, PET_DATASSETTE_PORT, "Datassette Port", tag, owner, clock), | |
57 | device_slot_interface(mconfig, *this) | |
58 | { | |
59 | } | |
60 | ||
61 | ||
62 | //------------------------------------------------- | |
63 | // pet_datassette_port_device - destructor | |
64 | //------------------------------------------------- | |
65 | ||
66 | pet_datassette_port_device::~pet_datassette_port_device() | |
67 | { | |
68 | } | |
69 | ||
70 | ||
71 | //------------------------------------------------- | |
72 | // device_config_complete - perform any | |
73 | // operations now that the configuration is | |
74 | // complete | |
75 | //------------------------------------------------- | |
76 | ||
77 | void pet_datassette_port_device::device_config_complete() | |
78 | { | |
79 | // inherit a copy of the static data | |
80 | const pet_datassette_port_interface *intf = reinterpret_cast<const pet_datassette_port_interface *>(static_config()); | |
81 | if (intf != NULL) | |
82 | { | |
83 | *static_cast<pet_datassette_port_interface *>(this) = *intf; | |
84 | } | |
85 | ||
86 | // or initialize to defaults if none provided | |
87 | else | |
88 | { | |
89 | memset(&m_out_read_cb, 0, sizeof(m_out_read_cb)); | |
90 | } | |
91 | } | |
92 | ||
93 | ||
94 | //------------------------------------------------- | |
95 | // device_start - device-specific startup | |
96 | //------------------------------------------------- | |
97 | ||
98 | void pet_datassette_port_device::device_start() | |
99 | { | |
100 | m_cart = dynamic_cast<device_pet_datassette_port_interface *>(get_card_device()); | |
101 | ||
102 | // resolve callbacks | |
103 | m_out_read_func.resolve(m_out_read_cb, *this); | |
104 | } | |
105 | ||
106 | ||
107 | READ_LINE_MEMBER( pet_datassette_port_device::read ) { int state = 1; if (m_cart != NULL) state = m_cart->datassette_read(); return state; } | |
108 | WRITE_LINE_MEMBER( pet_datassette_port_device::write ) { if (m_cart != NULL) m_cart->datassette_write(state); } | |
109 | READ_LINE_MEMBER( pet_datassette_port_device::sense_r ) { int state = 1; if (m_cart != NULL) state = m_cart->datassette_sense(); return state; } | |
110 | WRITE_LINE_MEMBER( pet_datassette_port_device::motor_w ) { if (m_cart != NULL) m_cart->datassette_motor(state); } | |
111 | ||
112 | WRITE_LINE_MEMBER( pet_datassette_port_device::read_w ) { m_out_read_func(state); } |
r0 | r17593 | |
---|---|---|
1 | /********************************************************************** | |
2 | ||
3 | Diag264 Serial Loop Back Connector emulation | |
4 | ||
5 | Copyright MESS Team. | |
6 | Visit http://mamedev.org for licensing and usage restrictions. | |
7 | ||
8 | **********************************************************************/ | |
9 | ||
10 | #pragma once | |
11 | ||
12 | #ifndef __DIAG264_SERIAL_LOOPBACK__ | |
13 | #define __DIAG264_SERIAL_LOOPBACK__ | |
14 | ||
15 | ||
16 | #include "emu.h" | |
17 | #include "machine/cbmiec.h" | |
18 | ||
19 | ||
20 | ||
21 | //************************************************************************** | |
22 | // TYPE DEFINITIONS | |
23 | //************************************************************************** | |
24 | ||
25 | // ======================> diag264_serial_loopback_device | |
26 | ||
27 | class diag264_serial_loopback_device : public device_t, | |
28 | public device_cbm_iec_interface | |
29 | { | |
30 | public: | |
31 | // construction/destruction | |
32 | diag264_serial_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
33 | ||
34 | protected: | |
35 | // device-level overrides | |
36 | virtual void device_config_complete() { m_shortname = "diag264_serial_loopback"; } | |
37 | virtual void device_start(); | |
38 | ||
39 | // device_cbm_iec_interface overrides | |
40 | virtual void cbm_iec_atn(int state); | |
41 | }; | |
42 | ||
43 | ||
44 | // device type definition | |
45 | extern const device_type DIAG264_SERIAL_LOOPBACK; | |
46 | ||
47 | ||
48 | ||
49 | #endif |
r17592 | r17593 | |
---|---|---|
49 | 49 | // c64_cd_r - cartridge data read |
50 | 50 | //------------------------------------------------- |
51 | 51 | |
52 | UINT8 c64_zaxxon_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
52 | 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) | |
53 | 53 | { |
54 | UINT8 data = 0; | |
55 | ||
56 | 54 | if (!roml) |
57 | 55 | { |
58 | 56 | data = m_roml[offset & 0xfff]; |
r0 | r17593 | |
---|---|---|
1 | /********************************************************************** | |
2 | ||
3 | Commodore PET/VIC-20/C64/Plus-4 Datassette Port emulation | |
4 | ||
5 | Copyright MESS Team. | |
6 | Visit http://mamedev.org for licensing and usage restrictions. | |
7 | ||
8 | ********************************************************************** | |
9 | ||
10 | GND 1 A GND | |
11 | +5V 2 B +5V | |
12 | MOTOR 3 C MOTOR | |
13 | READ 4 D READ | |
14 | WRITE 5 E WRITE | |
15 | SENSE 6 F SENSE | |
16 | ||
17 | **********************************************************************/ | |
18 | ||
19 | #pragma once | |
20 | ||
21 | #ifndef __PET_DATASSETTE_PORT__ | |
22 | #define __PET_DATASSETTE_PORT__ | |
23 | ||
24 | #include "emu.h" | |
25 | ||
26 | ||
27 | ||
28 | //************************************************************************** | |
29 | // CONSTANTS | |
30 | //************************************************************************** | |
31 | ||
32 | #define PET_DATASSETTE_PORT_TAG "tape" | |
33 | ||
34 | ||
35 | ||
36 | //************************************************************************** | |
37 | // INTERFACE CONFIGURATION MACROS | |
38 | //************************************************************************** | |
39 | ||
40 | #define PET_DATASSETTE_PORT_INTERFACE(_name) \ | |
41 | const pet_datassette_port_interface (_name) = | |
42 | ||
43 | ||
44 | #define MCFG_PET_DATASSETTE_PORT_ADD(_tag, _config, _slot_intf, _def_slot, _def_inp) \ | |
45 | MCFG_DEVICE_ADD(_tag, PET_DATASSETTE_PORT, 0) \ | |
46 | MCFG_DEVICE_CONFIG(_config) \ | |
47 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) | |
48 | ||
49 | ||
50 | ||
51 | //************************************************************************** | |
52 | // TYPE DEFINITIONS | |
53 | //************************************************************************** | |
54 | ||
55 | // ======================> pet_datassette_port_interface | |
56 | ||
57 | struct pet_datassette_port_interface | |
58 | { | |
59 | devcb_write_line m_out_read_cb; | |
60 | }; | |
61 | ||
62 | ||
63 | // ======================> pet_datassette_port_device | |
64 | ||
65 | class device_pet_datassette_port_interface; | |
66 | ||
67 | class pet_datassette_port_device : public device_t, | |
68 | public pet_datassette_port_interface, | |
69 | public device_slot_interface | |
70 | { | |
71 | public: | |
72 | // construction/destruction | |
73 | pet_datassette_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
74 | virtual ~pet_datassette_port_device(); | |
75 | ||
76 | // computer interface | |
77 | DECLARE_READ_LINE_MEMBER( read ); | |
78 | DECLARE_WRITE_LINE_MEMBER( write ); | |
79 | DECLARE_READ_LINE_MEMBER( sense_r ); | |
80 | DECLARE_WRITE_LINE_MEMBER( motor_w ); | |
81 | ||
82 | // device interface | |
83 | DECLARE_WRITE_LINE_MEMBER( read_w ); | |
84 | ||
85 | protected: | |
86 | // device-level overrides | |
87 | virtual void device_config_complete(); | |
88 | virtual void device_start(); | |
89 | ||
90 | devcb_resolved_write_line m_out_read_func; | |
91 | ||
92 | device_pet_datassette_port_interface *m_cart; | |
93 | }; | |
94 | ||
95 | ||
96 | // ======================> device_pet_datassette_port_interface | |
97 | ||
98 | // class representing interface-specific live c64_expansion card | |
99 | class device_pet_datassette_port_interface : public device_slot_card_interface | |
100 | { | |
101 | public: | |
102 | // construction/destruction | |
103 | device_pet_datassette_port_interface(const machine_config &mconfig, device_t &device); | |
104 | virtual ~device_pet_datassette_port_interface(); | |
105 | ||
106 | virtual int datassette_read() { return 1; }; | |
107 | virtual void datassette_write(int state) { }; | |
108 | virtual int datassette_sense() { return 1; }; | |
109 | virtual void datassette_motor(int state) { }; | |
110 | ||
111 | protected: | |
112 | pet_datassette_port_device *m_slot; | |
113 | }; | |
114 | ||
115 | ||
116 | // device type definition | |
117 | extern const device_type PET_DATASSETTE_PORT; | |
118 | ||
119 | ||
120 | ||
121 | #endif |
r17592 | r17593 | |
---|---|---|
37 | 37 | virtual void device_start(); |
38 | 38 | |
39 | 39 | // device_c64_expansion_card_interface overrides |
40 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
40 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
41 | 41 | |
42 | 42 | private: |
43 | 43 | int m_bank; |
r17592 | r17593 | |
---|---|---|
62 | 62 | // c64_cd_r - cartridge data read |
63 | 63 | //------------------------------------------------- |
64 | 64 | |
65 | UINT8 c64_georam_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
65 | 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) | |
66 | 66 | { |
67 | UINT8 data = 0; | |
68 | ||
69 | 67 | if (!io1) |
70 | 68 | { |
71 | 69 | offs_t addr = (m_bank << 8) | (offset & 0xff); |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_reset(); |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
43 | 43 | |
44 | 44 | private: |
r17592 | r17593 | |
---|---|---|
571 | 571 | // plus4_cd_r - cartridge data read |
572 | 572 | //------------------------------------------------- |
573 | 573 | |
574 | 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) | |
574 | 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) | |
575 | 575 | { |
576 | | |
576 | | |
577 | 577 | |
578 | 578 | if (tpi1_selected(offset)) |
579 | 579 | { |
r17592 | r17593 | |
---|---|---|
77 | 77 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
78 | 78 | |
79 | 79 | // device_plus4_expansion_card_interface overrides |
80 | 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); | |
80 | 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); | |
81 | 81 | 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); |
82 | 82 | virtual UINT32 plus4_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
83 | 83 | virtual void plus4_breset_w(int state); |
r0 | r17593 | |
---|---|---|
1 | /********************************************************************** | |
2 | ||
3 | Commodore C2N/1530/1531 Datassette emulation | |
4 | ||
5 | Copyright MESS Team. | |
6 | Visit http://mamedev.org for licensing and usage restrictions. | |
7 | ||
8 | **********************************************************************/ | |
9 | ||
10 | #include "c2n.h" | |
11 | ||
12 | ||
13 | ||
14 | //************************************************************************** | |
15 | // MACROS / CONSTANTS | |
16 | //************************************************************************** | |
17 | ||
18 | #define CASSETTE_TAG "cassette" | |
19 | ||
20 | ||
21 | ||
22 | //************************************************************************** | |
23 | // DEVICE DEFINITIONS | |
24 | //************************************************************************** | |
25 | ||
26 | const device_type C1530 = &device_creator<c1530_device>; | |
27 | const device_type C1531 = &device_creator<c1531_device>; | |
28 | ||
29 | ||
30 | //------------------------------------------------- | |
31 | // MACHINE_CONFIG( c2n ) | |
32 | //------------------------------------------------- | |
33 | ||
34 | static MACHINE_CONFIG_FRAGMENT( c2n ) | |
35 | MCFG_CASSETTE_ADD(CASSETTE_TAG, cbm_cassette_interface ) | |
36 | MACHINE_CONFIG_END | |
37 | ||
38 | ||
39 | //------------------------------------------------- | |
40 | // machine_config_additions - device-specific | |
41 | // machine configurations | |
42 | //------------------------------------------------- | |
43 | ||
44 | machine_config_constructor c2n_device::device_mconfig_additions() const | |
45 | { | |
46 | return MACHINE_CONFIG_NAME( c2n ); | |
47 | } | |
48 | ||
49 | ||
50 | ||
51 | //************************************************************************** | |
52 | // LIVE DEVICE | |
53 | //************************************************************************** | |
54 | ||
55 | //------------------------------------------------- | |
56 | // c2n_device - constructor | |
57 | //------------------------------------------------- | |
58 | ||
59 | c2n_device::c2n_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
60 | : device_t(mconfig, type, name, tag, owner, clock), | |
61 | device_pet_datassette_port_interface(mconfig, *this), | |
62 | m_cassette(*this, CASSETTE_TAG) | |
63 | { | |
64 | } | |
65 | ||
66 | ||
67 | //------------------------------------------------- | |
68 | // c1530_device - constructor | |
69 | //------------------------------------------------- | |
70 | ||
71 | c1530_device::c1530_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
72 | : c2n_device(mconfig, C1530, "C1530", tag, owner, clock) { } | |
73 | ||
74 | ||
75 | //------------------------------------------------- | |
76 | // c1531_device - constructor | |
77 | //------------------------------------------------- | |
78 | ||
79 | c1531_device::c1531_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
80 | : c2n_device(mconfig, C1531, "C1531", tag, owner, clock) { } | |
81 | ||
82 | ||
83 | //------------------------------------------------- | |
84 | // device_start - device-specific startup | |
85 | //------------------------------------------------- | |
86 | ||
87 | void c2n_device::device_start() | |
88 | { | |
89 | // allocate timers | |
90 | m_read_timer = timer_alloc(); | |
91 | m_read_timer->adjust(attotime::from_hz(44100), 0, attotime::from_hz(44100)); | |
92 | } | |
93 | ||
94 | ||
95 | //------------------------------------------------- | |
96 | // device_timer - handler timer events | |
97 | //------------------------------------------------- | |
98 | ||
99 | void c2n_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) | |
100 | { | |
101 | int input = (m_cassette->input() > +0.0) ? 1 : 0; | |
102 | ||
103 | m_slot->read_w(input); | |
104 | } | |
105 | ||
106 | ||
107 | //------------------------------------------------- | |
108 | // datassette_read - read data | |
109 | //------------------------------------------------- | |
110 | ||
111 | int c2n_device::datassette_read() | |
112 | { | |
113 | return (m_cassette->input() > +0.0) ? 1 : 0; | |
114 | } | |
115 | ||
116 | ||
117 | //------------------------------------------------- | |
118 | // datassette_write - write data | |
119 | //------------------------------------------------- | |
120 | ||
121 | void c2n_device::datassette_write(int state) | |
122 | { | |
123 | m_cassette->output(state ? -(0x5a9e >> 1) : +(0x5a9e >> 1)); | |
124 | } | |
125 | ||
126 | ||
127 | //------------------------------------------------- | |
128 | // datassette_sense - switch sense | |
129 | //------------------------------------------------- | |
130 | ||
131 | int c2n_device::datassette_sense() | |
132 | { | |
133 | return (m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED; | |
134 | } | |
135 | ||
136 | ||
137 | //------------------------------------------------- | |
138 | // datassette_motor - motor | |
139 | //------------------------------------------------- | |
140 | ||
141 | void c2n_device::datassette_motor(int state) | |
142 | { | |
143 | if (!state) | |
144 | { | |
145 | m_cassette->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); | |
146 | m_read_timer->enable(true); | |
147 | } | |
148 | else | |
149 | { | |
150 | m_cassette->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); | |
151 | m_read_timer->enable(false); | |
152 | } | |
153 | } |
r0 | r17593 | |
---|---|---|
1 | /********************************************************************** | |
2 | ||
3 | Commodore C2N/1530/1531 Datassette emulation | |
4 | ||
5 | Copyright MESS Team. | |
6 | Visit http://mamedev.org for licensing and usage restrictions. | |
7 | ||
8 | **********************************************************************/ | |
9 | ||
10 | #pragma once | |
11 | ||
12 | #ifndef __C2N__ | |
13 | #define __C2N__ | |
14 | ||
15 | ||
16 | #include "emu.h" | |
17 | #include "includes/cbm.h" | |
18 | #include "machine/petcass.h" | |
19 | ||
20 | ||
21 | ||
22 | //************************************************************************** | |
23 | // TYPE DEFINITIONS | |
24 | //************************************************************************** | |
25 | ||
26 | // ======================> c2n_device | |
27 | ||
28 | class c2n_device : public device_t, | |
29 | public device_pet_datassette_port_interface | |
30 | { | |
31 | ||
32 | public: | |
33 | // construction/destruction | |
34 | c2n_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
35 | ||
36 | // optional information overrides | |
37 | virtual machine_config_constructor device_mconfig_additions() const; | |
38 | ||
39 | protected: | |
40 | // device-level overrides | |
41 | virtual void device_config_complete() { m_shortname = "c2n"; } | |
42 | virtual void device_start(); | |
43 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); | |
44 | ||
45 | // device_pet_datassette_port_interface overrides | |
46 | virtual int datassette_read(); | |
47 | virtual void datassette_write(int state); | |
48 | virtual int datassette_sense(); | |
49 | virtual void datassette_motor(int state); | |
50 | ||
51 | private: | |
52 | required_device<cassette_image_device> m_cassette; | |
53 | ||
54 | // timers | |
55 | emu_timer *m_read_timer; | |
56 | }; | |
57 | ||
58 | ||
59 | // ======================> c1530_device | |
60 | ||
61 | class c1530_device : public c2n_device | |
62 | { | |
63 | public: | |
64 | // construction/destruction | |
65 | c1530_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
66 | }; | |
67 | ||
68 | ||
69 | // ======================> c1531_device | |
70 | ||
71 | class c1531_device : public c2n_device | |
72 | { | |
73 | public: | |
74 | // construction/destruction | |
75 | c1531_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
76 | }; | |
77 | ||
78 | ||
79 | // device type definition | |
80 | extern const device_type C1530; | |
81 | extern const device_type C1531; | |
82 | ||
83 | ||
84 | ||
85 | #endif |
r17592 | r17593 | |
---|---|---|
47 | 47 | // vic20_cd_r - cartridge data read |
48 | 48 | //------------------------------------------------- |
49 | 49 | |
50 | 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) | |
50 | 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) | |
51 | 51 | { |
52 | UINT8 data = 0; | |
53 | ||
54 | 52 | if (!blk1 && (m_blk1 != NULL)) |
55 | 53 | { |
56 | 54 | data = m_blk1[offset & 0x1fff]; |
r17592 | r17593 | |
---|---|---|
37 | 37 | virtual void device_config_complete() { m_shortname = "vic20_standard"; } |
38 | 38 | |
39 | 39 | // device_vic20_expansion_card_interface overrides |
40 | 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); | |
40 | 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); | |
41 | 41 | }; |
42 | 42 | |
43 | 43 |
r0 | r17593 | |
---|---|---|
1 | /********************************************************************** | |
2 | ||
3 | Telenova Compis keyboard emulation | |
4 | ||
5 | Copyright MESS Team. | |
6 | Visit http://mamedev.org for licensing and usage restrictions. | |
7 | ||
8 | *********************************************************************/ | |
9 | ||
10 | #include "compiskb.h" | |
11 | ||
12 | ||
13 | ||
14 | //************************************************************************** | |
15 | // MACROS / CONSTANTS | |
16 | //************************************************************************** | |
17 | ||
18 | #define I8748_TAG "i8748" | |
19 | ||
20 | ||
21 | ||
22 | //************************************************************************** | |
23 | // DEVICE DEFINITIONS | |
24 | //************************************************************************** | |
25 | ||
26 | const device_type COMPIS_KEYBOARD = &device_creator<compis_keyboard_device>; | |
27 | ||
28 | ||
29 | //------------------------------------------------- | |
30 | // device_config_complete - perform any | |
31 | // operations now that the configuration is | |
32 | // complete | |
33 | //------------------------------------------------- | |
34 | ||
35 | void compis_keyboard_device::device_config_complete() | |
36 | { | |
37 | // inherit a copy of the static data | |
38 | const compis_keyboard_interface *intf = reinterpret_cast<const compis_keyboard_interface *>(static_config()); | |
39 | if (intf != NULL) | |
40 | *static_cast<compis_keyboard_interface *>(this) = *intf; | |
41 | ||
42 | // or initialize to defaults if none provided | |
43 | else | |
44 | { | |
45 | memset(&m_out_int_cb, 0, sizeof(m_out_int_cb)); | |
46 | } | |
47 | ||
48 | m_shortname = "compiskb"; | |
49 | } | |
50 | ||
51 | ||
52 | //------------------------------------------------- | |
53 | // ROM( compis_keyboard ) | |
54 | //------------------------------------------------- | |
55 | ||
56 | ROM_START( compis_keyboard ) | |
57 | ROM_REGION( 0x800, I8748_TAG, 0 ) | |
58 | ROM_LOAD( "cmpkey13.u1", 0x000, 0x800, CRC(3f87d138) SHA1(c04e2d325b9c04818bc7c47c3bf32b13862b11ec) ) | |
59 | ROM_END | |
60 | ||
61 | ||
62 | //------------------------------------------------- | |
63 | // rom_region - device-specific ROM region | |
64 | //------------------------------------------------- | |
65 | ||
66 | const rom_entry *compis_keyboard_device::device_rom_region() const | |
67 | { | |
68 | return ROM_NAME( compis_keyboard ); | |
69 | } | |
70 | ||
71 | ||
72 | //------------------------------------------------- | |
73 | // ADDRESS_MAP( compis_keyboard_io ) | |
74 | //------------------------------------------------- | |
75 | ||
76 | static ADDRESS_MAP_START( compis_keyboard_io, AS_IO, 8, compis_keyboard_device ) | |
77 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_NOP | |
78 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_NOP | |
79 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_NOP | |
80 | AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_NOP | |
81 | ADDRESS_MAP_END | |
82 | ||
83 | ||
84 | //------------------------------------------------- | |
85 | // MACHINE_DRIVER( compis_keyboard ) | |
86 | //------------------------------------------------- | |
87 | ||
88 | static MACHINE_CONFIG_FRAGMENT( compis_keyboard ) | |
89 | MCFG_CPU_ADD(I8748_TAG, I8748, 4000000) | |
90 | MCFG_CPU_IO_MAP(compis_keyboard_io) | |
91 | MACHINE_CONFIG_END | |
92 | ||
93 | ||
94 | //------------------------------------------------- | |
95 | // machine_config_additions - device-specific | |
96 | // machine configurations | |
97 | //------------------------------------------------- | |
98 | ||
99 | machine_config_constructor compis_keyboard_device::device_mconfig_additions() const | |
100 | { | |
101 | return MACHINE_CONFIG_NAME( compis_keyboard ); | |
102 | } | |
103 | ||
104 | ||
105 | //------------------------------------------------- | |
106 | // INPUT_PORTS( compis_keyboard ) | |
107 | //------------------------------------------------- | |
108 | ||
109 | INPUT_PORTS_START( compis_keyboard ) | |
110 | PORT_START("X0") | |
111 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
112 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
113 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
114 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
115 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
116 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
117 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
118 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
119 | ||
120 | PORT_START("X1") | |
121 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
122 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
123 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
124 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
125 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
126 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
127 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
128 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
129 | ||
130 | PORT_START("X2") | |
131 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
132 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
133 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
134 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
135 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
136 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
137 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
138 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
139 | ||
140 | PORT_START("X3") | |
141 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
142 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
143 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
144 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
145 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
146 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
147 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
148 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
149 | ||
150 | PORT_START("X4") | |
151 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
152 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
153 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
154 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
155 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
156 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
157 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
158 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
159 | ||
160 | PORT_START("X5") | |
161 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
162 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
163 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
164 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
165 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
166 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
167 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
168 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
169 | ||
170 | PORT_START("X6") | |
171 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
172 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
173 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
174 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
175 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
176 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
177 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
178 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
179 | ||
180 | PORT_START("X7") | |
181 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
182 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
183 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
184 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
185 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
186 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
187 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
188 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
189 | ||
190 | PORT_START("X8") | |
191 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
192 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
193 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
194 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
195 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
196 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
197 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
198 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
199 | ||
200 | PORT_START("X9") | |
201 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
202 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
203 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
204 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
205 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
206 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
207 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
208 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
209 | ||
210 | PORT_START("XA") | |
211 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
212 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
213 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
214 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
215 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
216 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
217 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
218 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
219 | ||
220 | PORT_START("XB") | |
221 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
222 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
223 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
224 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
225 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
226 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
227 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
228 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
229 | ||
230 | PORT_START("XC") | |
231 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
232 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
233 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
234 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
235 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
236 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
237 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
238 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
239 | ||
240 | PORT_START("XD") | |
241 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
242 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
243 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
244 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
245 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
246 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
247 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
248 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
249 | ||
250 | PORT_START("XE") | |
251 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
252 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
253 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
254 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
255 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
256 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
257 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
258 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
259 | ||
260 | PORT_START("XF") | |
261 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
262 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
263 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
264 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
265 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
266 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
267 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
268 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) | |
269 | INPUT_PORTS_END | |
270 | ||
271 | ||
272 | //------------------------------------------------- | |
273 | // input_ports - device-specific input ports | |
274 | //------------------------------------------------- | |
275 | ||
276 | ioport_constructor compis_keyboard_device::device_input_ports() const | |
277 | { | |
278 | return INPUT_PORTS_NAME( compis_keyboard ); | |
279 | } | |
280 | ||
281 | ||
282 | ||
283 | //************************************************************************** | |
284 | // LIVE DEVICE | |
285 | //************************************************************************** | |
286 | ||
287 | //------------------------------------------------- | |
288 | // compis_keyboard_device - constructor | |
289 | //------------------------------------------------- | |
290 | ||
291 | compis_keyboard_device::compis_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
292 | : device_t(mconfig, COMPIS_KEYBOARD, "Compis Keyboard", tag, owner, clock), | |
293 | m_maincpu(*this, I8748_TAG), | |
294 | m_so(1) | |
295 | { | |
296 | } | |
297 | ||
298 | ||
299 | //------------------------------------------------- | |
300 | // device_start - device-specific startup | |
301 | //------------------------------------------------- | |
302 | ||
303 | void compis_keyboard_device::device_start() | |
304 | { | |
305 | // resolve callbacks | |
306 | m_out_int_func.resolve(m_out_int_cb, *this); | |
307 | } | |
308 | ||
309 | ||
310 | //------------------------------------------------- | |
311 | // device_reset - device-specific reset | |
312 | //------------------------------------------------- | |
313 | ||
314 | void compis_keyboard_device::device_reset() | |
315 | { | |
316 | } | |
317 | ||
318 | ||
319 | //------------------------------------------------- | |
320 | // dtr_w - data terminal ready write | |
321 | //------------------------------------------------- | |
322 | ||
323 | WRITE_LINE_MEMBER( compis_keyboard_device::dtr_w ) | |
324 | { | |
325 | } | |
326 | ||
327 | ||
328 | //------------------------------------------------- | |
329 | // si_w - serial input write | |
330 | //------------------------------------------------- | |
331 | ||
332 | WRITE_LINE_MEMBER( compis_keyboard_device::si_w ) | |
333 | { | |
334 | m_maincpu->set_input_line(MCS48_INPUT_IRQ, state ? CLEAR_LINE : ASSERT_LINE); | |
335 | } | |
336 | ||
337 | ||
338 | //------------------------------------------------- | |
339 | // so_r - serial output read | |
340 | //------------------------------------------------- | |
341 | ||
342 | READ_LINE_MEMBER( compis_keyboard_device::so_r ) | |
343 | { | |
344 | return m_so; | |
345 | } |
r0 | r17593 | |
---|---|---|
1 | /********************************************************************** | |
2 | ||
3 | Telenova Compis keyboard emulation | |
4 | ||
5 | Copyright MESS Team. | |
6 | Visit http://mamedev.org for licensing and usage restrictions. | |
7 | ||
8 | *********************************************************************/ | |
9 | ||
10 | #pragma once | |
11 | ||
12 | #ifndef __COMPIS_KEYBOARD__ | |
13 | #define __COMPIS_KEYBOARD__ | |
14 | ||
15 | #include "emu.h" | |
16 | #include "cpu/mcs48/mcs48.h" | |
17 | ||
18 | ||
19 | ||
20 | //************************************************************************** | |
21 | // MACROS / CONSTANTS | |
22 | //************************************************************************** | |
23 | ||
24 | #define COMPIS_KEYBOARD_TAG "compiskb" | |
25 | ||
26 | ||
27 | ||
28 | //************************************************************************** | |
29 | // INTERFACE CONFIGURATION MACROS | |
30 | //************************************************************************** | |
31 | ||
32 | #define MCFG_COMPIS_KEYBOARD_ADD() \ | |
33 | MCFG_DEVICE_ADD(COMPIS_KEYBOARD_TAG, COMPIS_KEYBOARD, 0) | |
34 | ||
35 | ||
36 | #define COMPIS_KEYBOARD_INTERFACE(_name) \ | |
37 | const COMPIS_keyboard_interface (_name) = | |
38 | ||
39 | ||
40 | ||
41 | //************************************************************************** | |
42 | // TYPE DEFINITIONS | |
43 | //************************************************************************** | |
44 | ||
45 | // ======================> compis_keyboard_interface | |
46 | ||
47 | struct compis_keyboard_interface | |
48 | { | |
49 | devcb_write_line m_out_int_cb; | |
50 | }; | |
51 | ||
52 | ||
53 | // ======================> compis_keyboard_device | |
54 | ||
55 | class compis_keyboard_device : public device_t, | |
56 | public compis_keyboard_interface | |
57 | { | |
58 | public: | |
59 | // construction/destruction | |
60 | compis_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
61 | ||
62 | // optional information overrides | |
63 | virtual const rom_entry *device_rom_region() const; | |
64 | virtual machine_config_constructor device_mconfig_additions() const; | |
65 | virtual ioport_constructor device_input_ports() const; | |
66 | ||
67 | DECLARE_WRITE_LINE_MEMBER( dtr_w ); | |
68 | DECLARE_WRITE_LINE_MEMBER( si_w ); | |
69 | DECLARE_READ_LINE_MEMBER( so_r ); | |
70 | ||
71 | protected: | |
72 | // device-level overrides | |
73 | virtual void device_config_complete(); | |
74 | virtual void device_start(); | |
75 | virtual void device_reset(); | |
76 | ||
77 | private: | |
78 | devcb_resolved_write_line m_out_int_func; | |
79 | ||
80 | required_device<cpu_device> m_maincpu; | |
81 | ||
82 | int m_so; | |
83 | }; | |
84 | ||
85 | ||
86 | // device type definition | |
87 | extern const device_type COMPIS_KEYBOARD; | |
88 | ||
89 | ||
90 | ||
91 | #endif |
r17592 | r17593 | |
---|---|---|
80 | 80 | // c64_cd_r - cartridge data read |
81 | 81 | //------------------------------------------------- |
82 | 82 | |
83 | 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) | |
83 | 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) | |
84 | 84 | { |
85 | UINT8 data = 0; | |
86 | ||
87 | 85 | if (!roml) |
88 | 86 | { |
89 | 87 | data = m_roml[offset & 0x1fff]; |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_config_complete() { m_shortname = "c64_easy_calc_result"; } |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
43 | 43 | |
44 | 44 | private: |
r17592 | r17593 | |
---|---|---|
59 | 59 | // c64_cd_r - cartridge data read |
60 | 60 | //------------------------------------------------- |
61 | 61 | |
62 | 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) | |
62 | 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) | |
63 | 63 | { |
64 | UINT8 data = 0; | |
65 | ||
66 | 64 | if (!roml) |
67 | 65 | { |
68 | 66 | offs_t addr = (m_bank << 13) | (offset & 0x1fff); |
r17592 | r17593 | |
---|---|---|
47 | 47 | // c64_cd_r - cartridge data read |
48 | 48 | //------------------------------------------------- |
49 | 49 | |
50 | UINT8 c64_standard_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
50 | 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) | |
51 | 51 | { |
52 | UINT8 data = 0; | |
53 | ||
54 | 52 | if (!roml && m_roml_mask) |
55 | 53 | { |
56 | 54 | data = m_roml[offset & 0x1fff]; |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_reset(); |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
43 | 43 | |
44 | 44 | private: |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_start(); |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | }; |
43 | 43 | |
44 | 44 |
r17592 | r17593 | |
---|---|---|
110 | 110 | // c64_cd_r - cartridge data read |
111 | 111 | //------------------------------------------------- |
112 | 112 | |
113 | 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) | |
113 | 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) | |
114 | 114 | { |
115 | UINT8 data = 0; | |
116 | ||
117 | 115 | if (!roml) |
118 | 116 | { |
119 | 117 | if (m_reset) |
r17592 | r17593 | |
---|---|---|
43 | 43 | virtual void device_reset(); |
44 | 44 | |
45 | 45 | // device_c64_expansion_card_interface overrides |
46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
47 | 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
48 | 48 | |
49 | 49 | private: |
r17592 | r17593 | |
---|---|---|
76 | 76 | // c64_cd_r - cartridge data read |
77 | 77 | //------------------------------------------------- |
78 | 78 | |
79 | UINT8 c64_dqbb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
79 | 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) | |
80 | 80 | { |
81 | UINT8 data = 0; | |
82 | ||
83 | 81 | if (!m_cs && (!roml || !romh)) |
84 | 82 | { |
85 | 83 | data = m_nvram[offset & 0x3fff]; |
r17592 | r17593 | |
---|---|---|
45 | 45 | virtual void nvram_write(emu_file &file) { if (m_nvram != NULL) { file.write(m_nvram, m_nvram_size); } } |
46 | 46 | |
47 | 47 | // device_c64_expansion_card_interface overrides |
48 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
48 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
49 | 49 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
50 | 50 | |
51 | 51 | private: |
r17592 | r17593 | |
---|---|---|
223 | 223 | // c64_cd_r - cartridge data read |
224 | 224 | //------------------------------------------------- |
225 | 225 | |
226 | 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) | |
226 | 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) | |
227 | 227 | { |
228 | UINT8 data = 0; | |
229 | ||
230 | 228 | if (!romh && !m_rom_oe) |
231 | 229 | { |
232 | 230 | UINT8 bank = m_pb7_ff ? m_rom_bank : 0; |
r17592 | r17593 | |
---|---|---|
126 | 126 | // c64_cd_r - cartridge data read |
127 | 127 | //------------------------------------------------- |
128 | 128 | |
129 | 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) | |
129 | 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) | |
130 | 130 | { |
131 | UINT8 data = 0; | |
132 | ||
133 | 131 | if (!roml) |
134 | 132 | { |
135 | 133 | if (m_reset) |
r17592 | r17593 | |
---|---|---|
50 | 50 | virtual void device_reset(); |
51 | 51 | |
52 | 52 | // device_c64_expansion_card_interface overrides |
53 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
53 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
54 | 54 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
55 | 55 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); |
56 | 56 |
r17592 | r17593 | |
---|---|---|
43 | 43 | virtual void device_reset(); |
44 | 44 | |
45 | 45 | // device_c64_expansion_card_interface overrides |
46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
47 | 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
48 | 48 | |
49 | 49 | private: |
r17592 | r17593 | |
---|---|---|
359 | 359 | // cd_r - cartridge data read |
360 | 360 | //------------------------------------------------- |
361 | 361 | |
362 | UINT8 c64_expansion_slot_device::cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
362 | 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) | |
363 | 363 | { |
364 | UINT8 data = 0; | |
365 | ||
366 | 364 | if (m_cart != NULL) |
367 | 365 | { |
368 | data = m_cart->c64_cd_r(space, offset, ba, roml, romh, io1, io2); | |
366 | data = m_cart->c64_cd_r(space, offset, data, ba, roml, romh, io1, io2); | |
369 | 367 | } |
370 | 368 | |
371 | 369 | return data; |
r17592 | r17593 | |
---|---|---|
97 | 97 | virtual ~c64_expansion_slot_device(); |
98 | 98 | |
99 | 99 | // computer interface |
100 | UINT8 cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
100 | UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
101 | 101 | void cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
102 | 102 | int game_r(offs_t offset, int ba, int rw, int hiram); |
103 | 103 | int exrom_r(offs_t offset, int ba, int rw, int hiram); |
r17592 | r17593 | |
168 | 168 | virtual UINT8* c64_nvram_pointer(running_machine &machine, size_t size); |
169 | 169 | |
170 | 170 | // runtime |
171 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) { return | |
171 | 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; }; | |
172 | 172 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { }; |
173 | 173 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram) { return m_game; } |
174 | 174 | virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram) { return m_exrom; } |
r17592 | r17593 | |
---|---|---|
126 | 126 | // c64_cd_r - cartridge data read |
127 | 127 | //------------------------------------------------- |
128 | 128 | |
129 | 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) | |
129 | 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) | |
130 | 130 | { |
131 | UINT8 data = 0; | |
132 | ||
133 | 131 | if (!roml) |
134 | 132 | { |
135 | 133 | if (m_reset) |
r17592 | r17593 | |
---|---|---|
43 | 43 | virtual void device_reset(); |
44 | 44 | |
45 | 45 | // device_c64_expansion_card_interface overrides |
46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
47 | 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
48 | 48 | |
49 | 49 | private: |
r17592 | r17593 | |
---|---|---|
59 | 59 | // c64_cd_r - cartridge data read |
60 | 60 | //------------------------------------------------- |
61 | 61 | |
62 | UINT8 c128_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
62 | 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) | |
63 | 63 | { |
64 | UINT8 data = 0; | |
65 | ||
66 | 64 | if (!romh) |
67 | 65 | { |
68 | 66 | offs_t addr = (m_bank << 14) | (offset & 0x3fff); |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_config_complete() { m_shortname = "c128_comal80"; } |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
43 | 43 | |
44 | 44 | private: |
r17592 | r17593 | |
---|---|---|
130 | 130 | // c64_cd_r - cartridge data read |
131 | 131 | //------------------------------------------------- |
132 | 132 | |
133 | UINT8 c64_ps64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2) | |
133 | 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) | |
134 | 134 | { |
135 | UINT8 data = 0; | |
136 | ||
137 | 135 | if (!roml) |
138 | 136 | { |
139 | 137 | data = m_roml[offset & 0x1fff]; |
r17592 | r17593 | |
---|---|---|
42 | 42 | virtual void device_reset(); |
43 | 43 | |
44 | 44 | // device_c64_expansion_card_interface overrides |
45 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
45 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
46 | 46 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
47 | 47 | }; |
48 | 48 |
r17592 | r17593 | |
---|---|---|
80 | 80 | // c64_cd_r - cartridge data read |
81 | 81 | //------------------------------------------------- |
82 | 82 | |
83 | 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) | |
83 | 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) | |
84 | 84 | { |
85 | UINT8 data = 0; | |
86 | ||
87 | 85 | if (!roml) |
88 | 86 | { |
89 | 87 | m_exrom = 0; |
r17592 | r17593 | |
---|---|---|
39 | 39 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
40 | 40 | |
41 | 41 | // device_c64_expansion_card_interface overrides |
42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
43 | 43 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
44 | 44 | |
45 | 45 | private: |
r17592 | r17593 | |
---|---|---|
59 | 59 | // c64_cd_r - cartridge data read |
60 | 60 | //------------------------------------------------- |
61 | 61 | |
62 | 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) | |
62 | 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) | |
63 | 63 | { |
64 | UINT8 data = 0; | |
65 | ||
66 | 64 | if (!roml || !romh) |
67 | 65 | { |
68 | 66 | offs_t addr = (m_bank << 14) | (offset & 0x3fff); |
r17592 | r17593 | |
---|---|---|
38 | 38 | virtual void device_reset(); |
39 | 39 | |
40 | 40 | // device_c64_expansion_card_interface overrides |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
42 | 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
43 | 43 | |
44 | 44 | private: |
r17592 | r17593 | |
---|---|---|
299 | 299 | // cd_r - cartridge data read |
300 | 300 | //------------------------------------------------- |
301 | 301 | |
302 | UINT8 vic10_expansion_slot_device::cd_r(address_space &space, offs_t offset, int lorom, int uprom, int exram) | |
302 | UINT8 vic10_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram) | |
303 | 303 | { |
304 | UINT8 data = 0; | |
305 | ||
306 | 304 | if (m_cart != NULL) |
307 | 305 | { |
308 | data = m_cart->vic10_cd_r(space, offset, lorom, uprom, exram); | |
306 | data = m_cart->vic10_cd_r(space, offset, data, lorom, uprom, exram); | |
309 | 307 | } |
310 | 308 | |
311 | 309 | return data; |
r17592 | r17593 | |
---|---|---|
95 | 95 | virtual ~vic10_expansion_slot_device(); |
96 | 96 | |
97 | 97 | // computer interface |
98 | UINT8 cd_r(address_space &space, offs_t offset, int lorom, int uprom, int exram); | |
98 | UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram); | |
99 | 99 | void cd_w(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram); |
100 | 100 | DECLARE_READ_LINE_MEMBER( p0_r ); |
101 | 101 | DECLARE_WRITE_LINE_MEMBER( p0_w ); |
r17592 | r17593 | |
161 | 161 | virtual UINT8* vic10_uprom_pointer(running_machine &machine, size_t size); |
162 | 162 | |
163 | 163 | // runtime |
164 | virtual UINT8 vic10_cd_r(address_space &space, offs_t offset, int lorom, int uprom, int exram) { return | |
164 | virtual UINT8 vic10_cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram) { return data; }; | |
165 | 165 | virtual void vic10_cd_w(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram) { }; |
166 | 166 | virtual int vic10_p0_r() { return 0; }; |
167 | 167 | virtual void vic10_p0_w(int state) { }; |
168 | 168 | virtual void vic10_sp_w(int state) { }; |
169 | 169 | virtual void vic10_cnt_w(int state) { }; |
170 | virtual UINT32 vic10_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return | |
170 | virtual UINT32 vic10_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0 | |
171 | 171 | virtual void vic10_res_w(int state) { }; |
172 | 172 | |
173 | 173 | vic10_expansion_slot_device *m_slot; |
r17592 | r17593 | |
---|---|---|
120 | 120 | // c64_cd_r - cartridge data read |
121 | 121 | //------------------------------------------------- |
122 | 122 | |
123 | 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) | |
123 | 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) | |
124 | 124 | { |
125 | UINT8 data = 0; | |
126 | ||
127 | 125 | if (!roml) |
128 | 126 | { |
129 | 127 | offs_t addr = offset & 0x1fff; |
r17592 | r17593 | |
---|---|---|
43 | 43 | virtual void device_reset(); |
44 | 44 | |
45 | 45 | // device_c64_expansion_card_interface overrides |
46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
47 | 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
48 | 48 | |
49 | 49 | private: |
r17592 | r17593 | |
---|---|---|
61 | 61 | // c64_cd_r - cartridge data read |
62 | 62 | //------------------------------------------------- |
63 | 63 | |
64 | 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) | |
64 | 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) | |
65 | 65 | { |
66 | UINT8 data = 0; | |
67 | ||
68 | 66 | if (!roml) |
69 | 67 | { |
70 | 68 | offs_t addr = (m_bank << 13) | (offset & 0x1fff); |
r17592 | r17593 | |
---|---|---|
39 | 39 | virtual void device_reset(); |
40 | 40 | |
41 | 41 | // device_c64_expansion_card_interface overrides |
42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2); | |
42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
43 | 43 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); |
44 | 44 | |
45 | 45 | private: |
r17592 | r17593 | |
---|---|---|
85 | 85 | // c64_cd_r - cartridge data read |
86 | 86 | //------------------------------------------------- |
87 | 87 | |
88 | 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) | |
88 | 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) | |
89 | 89 | { |
90 | UINT8 data = 0; | |
91 | ||
92 | 90 | if (!roml) |
93 | 91 | { |
94 | 92 | m_exrom = 0; |
r17592 | r17593 | |
---|---|---|
23 | 23 | #include "machine/pic8259.h" |
24 | 24 | #include "machine/mm58274c.h" |
25 | 25 | #include "machine/upd765.h" |
26 | #include "machine/compiskb.h" | |
26 | 27 | #include "imagedev/flopdrv.h" |
27 | 28 | #include "formats/cpis_dsk.h" |
28 | 29 |
r17592 | r17593 | |
---|---|---|
59 | 59 | int m_io_dc00_on; |
60 | 60 | DECLARE_DRIVER_INIT(c65); |
61 | 61 | DECLARE_DRIVER_INIT(c65pal); |
62 | ||
63 | DECLARE_READ8_MEMBER( sid_potx_r ); | |
64 | DECLARE_READ8_MEMBER( sid_poty_r ); | |
62 | 65 | }; |
63 | 66 | |
64 | 67 |
r17592 | r17593 | |
---|---|---|
13 | 13 | #include "machine/cbmiec.h" |
14 | 14 | #include "machine/cbmipt.h" |
15 | 15 | #include "machine/ieee488.h" |
16 | #include "machine/petcass.h" | |
16 | 17 | #include "machine/ram.h" |
17 | 18 | #include "machine/vcsctrl.h" |
18 | 19 | #include "machine/vic20exp.h" |
r17592 | r17593 | |
26 | 27 | #define M6560_TAG "ub7" |
27 | 28 | #define M6561_TAG "ub7" |
28 | 29 | #define IEC_TAG "iec" |
29 | #define TIMER_C1530_TAG "c1530" | |
30 | 30 | #define SCREEN_TAG "screen" |
31 | 31 | #define CONTROL1_TAG "joy1" |
32 | 32 | #define CONTROL2_TAG "joy2" |
r17592 | r17593 | |
45 | 45 | m_joy2(*this, CONTROL2_TAG), |
46 | 46 | m_exp(*this, VIC20_EXPANSION_SLOT_TAG), |
47 | 47 | m_user(*this, VIC20_USER_PORT_TAG), |
48 | m_cassette(*this, CASSETTE_TAG), | |
49 | m_ram(*this, RAM_TAG), | |
50 | m_cassette_timer(*this, TIMER_C1530_TAG) | |
48 | m_cassette(*this, PET_DATASSETTE_PORT_TAG), | |
49 | m_ram(*this, RAM_TAG) | |
51 | 50 | { } |
52 | 51 | |
53 | 52 | required_device<cpu_device> m_maincpu; |
r17592 | r17593 | |
59 | 58 | required_device<vcs_control_port_device> m_joy2; |
60 | 59 | required_device<vic20_expansion_slot_device> m_exp; |
61 | 60 | required_device<vic20_user_port_device> m_user; |
62 | required_device< | |
61 | required_device<pet_datassette_port | |
63 | 62 | required_device<ram_device> m_ram; |
64 | required_device<timer_device> m_cassette_timer; | |
65 | 63 | |
66 | 64 | virtual void machine_start(); |
67 | 65 | virtual void machine_reset(); |
r17592 | r17593 | |
71 | 69 | |
72 | 70 | DECLARE_READ8_MEMBER( via0_pa_r ); |
73 | 71 | DECLARE_WRITE8_MEMBER( via0_pa_w ); |
74 | DECLARE_WRITE_LINE_MEMBER( via0_ca2_w ); | |
75 | 72 | |
76 | 73 | DECLARE_READ8_MEMBER( via1_pa_r ); |
77 | 74 | DECLARE_READ8_MEMBER( via1_pb_r ); |
r17592 | r17593 | |
---|---|---|
14 | 14 | #include "machine/cbmiec.h" |
15 | 15 | #include "machine/cbmipt.h" |
16 | 16 | #include "machine/mos6529.h" |
17 | #include "machine/petcass.h" | |
17 | 18 | #include "machine/pls100.h" |
18 | 19 | #include "machine/ram.h" |
19 | 20 | |
r17592 | r17593 | |
25 | 26 | #define T6721_TAG "t6721" |
26 | 27 | #define PLA_TAG "u19" |
27 | 28 | #define SCREEN_TAG "screen" |
28 | #define CASSETTE_TAG "cassette" | |
29 | 29 | |
30 | 30 | class plus4_state : public driver_device |
31 | 31 | { |
r17592 | r17593 | |
43 | 43 | m_exp(*this, PLUS4_EXPANSION_SLOT_TAG), |
44 | 44 | m_user(*this, PLUS4_USER_PORT_TAG), |
45 | 45 | m_ram(*this, RAM_TAG), |
46 | m_cassette(*this, | |
46 | m_cassette(*this, PET_DATASSETTE_PORT_TAG), | |
47 | 47 | m_function(NULL), |
48 | m_c2(NULL), | |
48 | 49 | m_addr(0), |
49 | 50 | m_rom_en(1), |
50 | 51 | m_ted_irq(CLEAR_LINE), |
r17592 | r17593 | |
63 | 64 | required_device<plus4_expansion_slot_device> m_exp; |
64 | 65 | optional_device<plus4_user_port_device> m_user; |
65 | 66 | required_device<ram_device> m_ram; |
66 | required_device< | |
67 | required_device<pet_datassette_port | |
67 | 68 | |
68 | 69 | virtual void machine_start(); |
69 | 70 | virtual void machine_reset(); |
r17592 | r17593 | |
95 | 96 | // memory state |
96 | 97 | const UINT8 *m_kernal; |
97 | 98 | const UINT8 *m_function; |
99 | const UINT8 *m_c2; | |
98 | 100 | UINT8 m_addr; |
99 | 101 | int m_rom_en; |
100 | 102 |
r17592 | r17593 | |
---|---|---|
32 | 32 | DECLARE_WRITE_LINE_MEMBER( vic_interrupt ); |
33 | 33 | DECLARE_READ8_MEMBER( vic_rdy_cb ); |
34 | 34 | |
35 | DECLARE_READ8_MEMBER( sid_potx_r ); | |
36 | DECLARE_READ8_MEMBER( sid_poty_r ); | |
37 | ||
35 | 38 | UINT8 *m_c128_basic; |
36 | 39 | UINT8 *m_c128_kernal; |
37 | 40 | UINT8 *m_c128_chargen; |
r17592 | r17593 | |
---|---|---|
12 | 12 | #include "machine/c64user.h" |
13 | 13 | #include "machine/cbmiec.h" |
14 | 14 | #include "machine/cbmipt.h" |
15 | #include "machine/petcass.h" | |
15 | 16 | #include "machine/pls100.h" |
16 | 17 | #include "machine/ram.h" |
17 | 18 | #include "machine/vcsctrl.h" |
r17592 | r17593 | |
27 | 28 | #define MOS6526_2_TAG "u2" |
28 | 29 | #define PLA_TAG "u17" |
29 | 30 | #define SCREEN_TAG "screen" |
30 | #define TIMER_C1531_TAG "c1531" | |
31 | 31 | #define CONTROL1_TAG "joy1" |
32 | 32 | #define CONTROL2_TAG "joy2" |
33 | 33 | |
r17592 | r17593 | |
48 | 48 | m_exp(*this, C64_EXPANSION_SLOT_TAG), |
49 | 49 | m_user(*this, C64_USER_PORT_TAG), |
50 | 50 | m_ram(*this, RAM_TAG), |
51 | m_cassette(*this, CASSETTE_TAG), | |
52 | m_cassette_timer(*this, TIMER_C1531_TAG), | |
51 | m_cassette(*this, PET_DATASSETTE_PORT_TAG), | |
53 | 52 | m_loram(1), |
54 | 53 | m_hiram(1), |
55 | 54 | m_charen(1), |
r17592 | r17593 | |
77 | 76 | required_device<c64_expansion_slot_device> m_exp; |
78 | 77 | required_device<c64_user_port_device> m_user; |
79 | 78 | required_device<ram_device> m_ram; |
80 | optional_device<cassette_image_device> m_cassette; | |
81 | optional_device<timer_device> m_cassette_timer; | |
79 | optional_device<pet_datassette_port_device> m_cassette; | |
82 | 80 | |
83 | 81 | virtual void machine_start(); |
84 | 82 | virtual void machine_reset(); |
r17592 | r17593 | |
97 | 95 | DECLARE_READ8_MEMBER( vic_lightpen_button_cb ); |
98 | 96 | DECLARE_READ8_MEMBER( vic_rdy_cb ); |
99 | 97 | |
98 | DECLARE_READ8_MEMBER( sid_potx_r ); | |
99 | DECLARE_READ8_MEMBER( sid_poty_r ); | |
100 | ||
100 | 101 | DECLARE_WRITE_LINE_MEMBER( cia1_irq_w ); |
101 | 102 | DECLARE_READ8_MEMBER( cia1_pa_r ); |
102 | 103 | DECLARE_READ8_MEMBER( cia1_pb_r ); |
r17592 | r17593 | |
109 | 110 | DECLARE_READ8_MEMBER( cpu_r ); |
110 | 111 | DECLARE_WRITE8_MEMBER( cpu_w ); |
111 | 112 | |
113 | DECLARE_WRITE_LINE_MEMBER( tape_read_w ); | |
114 | ||
112 | 115 | DECLARE_WRITE_LINE_MEMBER( iec_srq_w ); |
113 | 116 | |
114 | 117 | DECLARE_READ8_MEMBER( exp_dma_r ); |
r17592 | r17593 | |
179 | 182 | }; |
180 | 183 | |
181 | 184 | |
185 | int c64_paddle_read (device_t *device, int which); | |
182 | 186 | |
187 | ||
183 | 188 | #endif |
r17592 | r17593 | |
---|---|---|
51 | 51 | virtual void machine_reset(); |
52 | 52 | |
53 | 53 | void check_interrupts(); |
54 | UINT8 paddle_read(int which); | |
54 | 55 | |
55 | 56 | DECLARE_READ8_MEMBER( read ); |
56 | 57 | DECLARE_WRITE8_MEMBER( write ); |
r17592 | r17593 | |
62 | 63 | DECLARE_READ8_MEMBER( vic_lightpen_y_cb ); |
63 | 64 | DECLARE_READ8_MEMBER( vic_lightpen_button_cb ); |
64 | 65 | DECLARE_READ8_MEMBER( vic_rdy_cb ); |
66 | ||
67 | DECLARE_READ8_MEMBER( sid_potx_r ); | |
68 | DECLARE_READ8_MEMBER( sid_poty_r ); | |
69 | ||
65 | 70 | DECLARE_WRITE_LINE_MEMBER( cia_irq_w ); |
66 | 71 | DECLARE_READ8_MEMBER( cia_pa_r ); |
67 | 72 | DECLARE_READ8_MEMBER( cia_pb_r ); |
68 | 73 | DECLARE_WRITE8_MEMBER( cia_pb_w ); |
74 | ||
69 | 75 | DECLARE_READ8_MEMBER( cpu_r ); |
70 | 76 | DECLARE_WRITE8_MEMBER( cpu_w ); |
77 | ||
71 | 78 | DECLARE_WRITE_LINE_MEMBER( exp_irq_w ); |
72 | 79 | |
73 | 80 | // video state |
r17592 | r17593 | |
---|---|---|
8 | 8 | #define Z80PIO1_TAG "z80pio1" |
9 | 9 | #define Z80PIO2_TAG "z80pio2" |
10 | 10 | |
11 | #include "emu.h" | |
12 | #include "cpu/z80/z80.h" | |
13 | #include "cpu/z80/z80daisy.h" | |
11 | 14 | #include "imagedev/cassette.h" |
15 | #include "machine/ram.h" | |
16 | #include "machine/z80pio.h" | |
17 | #include "machine/z80dart.h" | |
18 | #include "machine/z80ctc.h" | |
12 | 19 | |
13 | 20 | class amu880_state : public driver_device |
14 | 21 | { |
r17592 | r17593 | |
18 | 25 | m_cassette(*this, CASSETTE_TAG), |
19 | 26 | m_key_d6(0), |
20 | 27 | m_key_d7(0), |
21 | m_key_a8(1) | |
22 | , | |
23 | m_video_ram(*this, "video_ram"){ } | |
28 | m_key_a8(1), | |
29 | m_video_ram(*this, "video_ram") | |
30 | { } | |
24 | 31 | |
25 | 32 | required_device<cassette_image_device> m_cassette; |
26 | 33 |
r17592 | r17593 | |
---|---|---|
22 | 22 | |
23 | 23 | - cleanup |
24 | 24 | - light pen |
25 | - 1:1 sync with CPU | |
26 | 25 | - remove RDY hack |
27 | 26 | - VIC IIe |
28 | 27 | - http://hitmen.c02.at/temp/palstuff/ |
r17592 | r17593 | |
272 | 271 | |
273 | 272 | inline UINT8 mos6566_device::read_videoram(offs_t offset) |
274 | 273 | { |
275 | return space(AS_0)->read_byte(offset & 0x3fff); | |
274 | m_last_data = space(AS_0)->read_byte(offset & 0x3fff); | |
275 | ||
276 | return m_last_data; | |
276 | 277 | } |
277 | 278 | |
278 | 279 | inline UINT8 mos6566_device::read_colorram(offs_t offset) |
r17592 | r17593 | |
683 | 684 | save_item(NAME(m_cycle)); |
684 | 685 | save_item(NAME(m_raster_x)); |
685 | 686 | save_item(NAME(m_graphic_x)); |
687 | save_item(NAME(m_last_data)); | |
686 | 688 | |
687 | 689 | save_item(NAME(m_dy_start)); |
688 | 690 | save_item(NAME(m_dy_stop)); |
r17592 | r17593 | |
2816 | 2818 | WRITE_LINE_MEMBER( mos6566_device::lp_w ) |
2817 | 2819 | { |
2818 | 2820 | } |
2821 | ||
2822 | ||
2823 | //------------------------------------------------- | |
2824 | // bus_r - data bus read | |
2825 | //------------------------------------------------- | |
2826 | ||
2827 | UINT8 mos6566_device::bus_r() | |
2828 | { | |
2829 | return m_last_data; | |
2830 | } |
r17592 | r17593 | |
---|---|---|
295 | 295 | |
296 | 296 | DECLARE_WRITE_LINE_MEMBER( lp_w ); |
297 | 297 | |
298 | UINT8 bus_r(); | |
299 | ||
298 | 300 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
299 | 301 | |
300 | 302 | protected: |
r17592 | r17593 | |
367 | 369 | UINT8 m_cycle; |
368 | 370 | UINT16 m_raster_x; |
369 | 371 | UINT16 m_graphic_x; |
372 | UINT8 m_last_data; | |
370 | 373 | |
371 | 374 | /* convert multicolor byte to background/foreground for sprite collision */ |
372 | 375 | UINT16 m_expandx[256]; |
r17592 | r17593 | |
---|---|---|
624 | 624 | c264 |
625 | 625 | plus4n |
626 | 626 | plus4p |
627 | c16 | |
627 | c16n | |
628 | c16p | |
628 | 629 | c16h |
629 | 630 | c116 |
630 | 631 | c232 |
r17592 | r17593 | |
---|---|---|
189 | 189 | * |
190 | 190 | *************************************/ |
191 | 191 | |
192 | ||
192 | READ8_MEMBER( c | |
193 | 193 | { |
194 | c64_paddle_read | |
194 | device_t *sid = machine().device("sid_r"); | |
195 | ||
196 | return c64_paddle_read(sid, 0); | |
197 | } | |
198 | ||
199 | READ8_MEMBER( c65_state::sid_poty_r ) | |
200 | { | |
201 | device_t *sid = machine().device("sid_r"); | |
202 | ||
203 | return c64_paddle_read(sid, 1); | |
204 | } | |
205 | ||
206 | static MOS6581_INTERFACE( c65_sound_interface ) | |
207 | { | |
208 | DEVCB_DRIVER_MEMBER(c65_state, sid_potx_r), | |
209 | DEVCB_DRIVER_MEMBER(c65_state, sid_poty_r) | |
195 | 210 | }; |
196 | 211 | |
197 | 212 |
r17592 | r17593 | |
---|---|---|
123 | 123 | |
124 | 124 | READ8_MEMBER( vic20_state::read ) |
125 | 125 | { |
126 | UINT8 data = 0; | |
126 | UINT8 data = mos6560_bus_r(m_vic); | |
127 | 127 | |
128 | 128 | int ram1 = 1, ram2 = 1, ram3 = 1; |
129 | 129 | int blk1 = 1, blk2 = 1, blk3 = 1, blk5 = 1; |
r17592 | r17593 | |
194 | 194 | break; |
195 | 195 | } |
196 | 196 | |
197 | data |= m_exp->cd_r(space, offset & 0x1fff, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3); | |
198 | ||
199 | return data; | |
197 | return m_exp->cd_r(space, offset & 0x1fff, data, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3); | |
200 | 198 | } |
201 | 199 | |
202 | 200 | |
r17592 | r17593 | |
450 | 448 | data |= m_user->joy1_r() << 3; |
451 | 449 | data |= m_user->joy2_r() << 4; |
452 | 450 | data |= m_user->light_pen_r() << 5; |
453 | data |= m_user->cassette_switch_r() << 6; | |
454 | 451 | |
452 | // cassette switch | |
453 | data |= (m_user->cassette_switch_r() && m_cassette->sense_r()) << 6; | |
454 | ||
455 | 455 | // joystick |
456 | 456 | data &= ~(ioport("JOY")->read() & 0x3c); |
457 | 457 | |
458 | // cassette switch | |
459 | if ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED) | |
460 | data &= ~0x40; | |
461 | ||
462 | 458 | return data; |
463 | 459 | } |
464 | 460 | |
r17592 | r17593 | |
483 | 479 | m_iec->atn_w(!BIT(data, 7)); |
484 | 480 | } |
485 | 481 | |
486 | WRITE_LINE_MEMBER( vic20_state::via0_ca2_w ) | |
487 | { | |
488 | if (!state) | |
489 | { | |
490 | m_cassette->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); | |
491 | m_cassette_timer->enable(true); | |
492 | } | |
493 | else | |
494 | { | |
495 | m_cassette->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); | |
496 | m_cassette_timer->enable(false); | |
497 | } | |
498 | } | |
499 | ||
500 | 482 | static const via6522_interface via0_intf = |
501 | 483 | { |
502 | 484 | DEVCB_DRIVER_MEMBER(vic20_state, via0_pa_r), |
r17592 | r17593 | |
509 | 491 | DEVCB_DEVICE_MEMBER(VIC20_USER_PORT_TAG, vic20_user_port_device, pb_w), |
510 | 492 | DEVCB_NULL, |
511 | 493 | DEVCB_DEVICE_LINE_MEMBER(VIC20_USER_PORT_TAG, vic20_user_port_device, cb1_w), |
512 | DEVCB_D | |
494 | DEVCB_DE | |
513 | 495 | DEVCB_DEVICE_LINE_MEMBER(VIC20_USER_PORT_TAG, vic20_user_port_device, cb2_w), |
514 | 496 | DEVCB_CPU_INPUT_LINE(M6502_TAG, INPUT_LINE_NMI) |
515 | 497 | }; |
r17592 | r17593 | |
593 | 575 | */ |
594 | 576 | |
595 | 577 | // cassette write |
596 | m_cassette-> | |
578 | m_cassette->write | |
597 | 579 | |
598 | 580 | // keyboard column |
599 | 581 | m_key_col = data; |
r17592 | r17593 | |
615 | 597 | { |
616 | 598 | DEVCB_DRIVER_MEMBER(vic20_state, via1_pa_r), |
617 | 599 | DEVCB_DRIVER_MEMBER(vic20_state, via1_pb_r), |
618 | DEVCB_ | |
600 | DEVCB_DEVI | |
619 | 601 | DEVCB_NULL, |
620 | 602 | DEVCB_NULL, |
621 | 603 | DEVCB_NULL, |
r17592 | r17593 | |
632 | 614 | |
633 | 615 | |
634 | 616 | //------------------------------------------------- |
635 | // | |
617 | // P | |
636 | 618 | //------------------------------------------------- |
637 | 619 | |
638 | static | |
620 | static P | |
639 | 621 | { |
640 | vic20_state *state = timer.machine().driver_data<vic20_state>(); | |
641 | int data = (state->m_cassette->input() > +0.0) ? 1 : 0; | |
622 | DEVCB_DEVICE_LINE_MEMBER(M6522_1_TAG, via6522_device, write_ca1), | |
623 | }; | |
642 | 624 | |
643 | state->m_via1->write_ca1(data); | |
644 | } | |
645 | 625 | |
646 | ||
647 | 626 | //------------------------------------------------- |
648 | 627 | // CBM_IEC_INTERFACE( cbm_iec_intf ) |
649 | 628 | //------------------------------------------------- |
r17592 | r17593 | |
808 | 787 | //------------------------------------------------- |
809 | 788 | |
810 | 789 | static MACHINE_CONFIG_START( vic20_common, vic20_state ) |
811 | MCFG_TIMER_ADD_PERIODIC(TIMER_C1530_TAG, cassette_tick, attotime::from_hz(44100)) | |
812 | ||
813 | 790 | // devices |
814 | 791 | MCFG_VIA6522_ADD(M6522_0_TAG, 0, via0_intf) |
815 | 792 | MCFG_VIA6522_ADD(M6522_1_TAG, 0, via1_intf) |
816 | 793 | |
817 | 794 | MCFG_QUICKLOAD_ADD("quickload", cbm_vc20, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) |
818 | MCFG_CASSETTE_ADD(CASSETTE_TAG, cbm_cassette_interface ) | |
819 | 795 | |
796 | MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, "c1530", NULL) | |
820 | 797 | MCFG_CBM_IEC_ADD(cbm_iec_intf, "c1541") |
821 | 798 | |
822 | 799 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vic20_control_port_devices, NULL, NULL) |
r17592 | r17593 | |
---|---|---|
2 | 2 | |
3 | 3 | TODO: |
4 | 4 | |
5 | - cassette | |
5 | - cassette motor is turned on only for a moment while LOADing | |
6 | - c16 function ROM test fails | |
6 | 7 | - c1551 won't load anything |
7 | 8 | - clean up keyboard handling |
8 | 9 | - clean up TED |
9 | 10 | - dump PLA |
10 | 11 | - T6721 speech chip |
11 | - floating bus read (should return the previous byte read by TED) | |
12 | - SID card (http://solder.dyndns.info/cgi-bin/showdir.pl?dir=files/commodore/plus4/hardware/SID-Card) | |
13 | 12 | |
14 | 13 | */ |
15 | 14 | |
r17592 | r17593 | |
167 | 166 | |
168 | 167 | 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) |
169 | 168 | { |
170 | UINT8 data = | |
169 | UINT8 data = m_ted->bus_r(); | |
171 | 170 | int c1l = 1, c1h = 1, c2l = 1, c2h = 1; |
172 | 171 | |
173 | 172 | //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); |
r17592 | r17593 | |
182 | 181 | { |
183 | 182 | data = m_spi_user->read(space, 0); |
184 | 183 | } |
185 | else | |
186 | { | |
187 | data |= ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED) << 2; | |
188 | } | |
184 | ||
185 | data &= ~0x04; | |
186 | data |= m_cassette->sense_r() << 2; | |
189 | 187 | } |
190 | 188 | else if (!_6551 && m_acia) |
191 | 189 | { |
r17592 | r17593 | |
216 | 214 | |
217 | 215 | case CS0_C2_LOW: |
218 | 216 | c2l = 0; |
217 | ||
218 | if (m_c2 != NULL) | |
219 | { | |
220 | data = m_c2[offset & 0x7fff]; | |
221 | } | |
219 | 222 | break; |
220 | 223 | } |
221 | 224 | } |
r17592 | r17593 | |
246 | 249 | |
247 | 250 | case CS1_C2_HIGH: |
248 | 251 | c2h = 0; |
252 | ||
253 | if (m_c2 != NULL) | |
254 | { | |
255 | data = m_c2[offset & 0x7fff]; | |
256 | } | |
249 | 257 | break; |
250 | 258 | } |
251 | 259 | } |
r17592 | r17593 | |
259 | 267 | data = m_ram->pointer()[offset & m_ram->mask()]; |
260 | 268 | } |
261 | 269 | |
262 | data |= m_exp->cd_r(space, offset, ba, cs0, c1l, c1h, cs1, c2l, c2h); | |
263 | ||
264 | return data; | |
270 | return m_exp->cd_r(space, offset, data, ba, cs0, c1l, c1h, cs1, c2l, c2h); | |
265 | 271 | } |
266 | 272 | |
267 | 273 | |
r17592 | r17593 | |
448 | 454 | 4 CST RD |
449 | 455 | 5 |
450 | 456 | 6 IEC CLK IN |
451 | 7 IEC DATA IN, CST SENSE | |
457 | 7 IEC DATA IN, CST SENSE | |
452 | 458 | |
453 | 459 | */ |
454 | 460 | |
455 | UINT8 data = 0xff; | |
456 | UINT8 c16_port7501 = m6510_get_port(m_maincpu); | |
461 | UINT8 data = 0x2f; | |
457 | 462 | |
458 | if (BIT(c16_port7501, 0) || !m_iec->data_r() || ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED)) | |
459 | data &= ~0x80; | |
463 | // cassette read | |
464 | data |= m_cassette->read() << 4; | |
460 | 465 | |
461 | if (BIT(c16_port7501, 1) || !m_iec->clk_r()) | |
462 | data &= ~0x40; | |
466 | // serial clock | |
467 | data |= m_iec->clk_r() << 6; | |
463 | 468 | |
464 | if (m_cassette->input() > +0.0) | |
465 | data |= 0x10; | |
466 | else | |
467 | data &= ~0x10; | |
469 | // serial data, cassette sense | |
470 | data |= (m_iec->data_r() && m_cassette->sense_r()) << 7; | |
468 | 471 | |
469 | 472 | return data; |
470 | 473 | } |
r17592 | r17593 | |
486 | 489 | |
487 | 490 | */ |
488 | 491 | |
489 | UINT8 data = 0xff; | |
490 | UINT8 c16_port7501 = m6510_get_port(m_maincpu); | |
492 | UINT8 data = 0x2f; | |
491 | 493 | |
492 | if (BIT(c16_port7501, 0) || !m_iec->data_r()) | |
493 | data &= ~0x80; | |
494 | // cassette read | |
495 | data |= m_cassette->read() << 4; | |
494 | 496 | |
495 | if (BIT(c16_port7501, 1) || !m_iec->clk_r()) | |
496 | data &= ~0x40; | |
497 | // serial clock | |
498 | data |= m_iec->clk_r() << 6; | |
497 | 499 | |
498 | if (m_cassette->input() > +0.0) | |
499 | data |= 0x10; | |
500 | else | |
501 | data &= ~0x10; | |
500 | // serial data | |
501 | data |= m_iec->data_r() << 7; | |
502 | 502 | |
503 | 503 | return data; |
504 | 504 | } |
r17592 | r17593 | |
515 | 515 | 3 CST MTR |
516 | 516 | 4 |
517 | 517 | 5 |
518 | 6 | |
518 | 6 (CST WR) | |
519 | 519 | 7 |
520 | 520 | |
521 | 521 | */ |
522 | 522 | |
523 | // serial bus | |
523 | //logerror("%s cpu write %02x\n", machine().describe_context(), data); | |
524 | ||
525 | // serial data | |
524 | 526 | m_iec->data_w(!BIT(data, 0)); |
527 | ||
528 | // serial clock | |
525 | 529 | m_iec->clk_w(!BIT(data, 1)); |
530 | ||
531 | // serial attention | |
526 | 532 | m_iec->atn_w(!BIT(data, 2)); |
527 | 533 | |
534 | // cassette motor | |
535 | m_cassette->motor_w(BIT(data, 3)); | |
536 | ||
528 | 537 | // cassette write |
529 | m_cassette->output(!BIT(data, 1) ? -(0x5a9e >> 1) : +(0x5a9e >> 1)); | |
530 | ||
531 | // cassette motor | |
532 | m_cassette->change_state(BIT(data, 3) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); | |
538 | m_cassette->write(!BIT(data, 1)); | |
533 | 539 | } |
534 | 540 | |
535 | 541 | static const m6502_interface cpu_intf = |
r17592 | r17593 | |
630 | 636 | READ8_MEMBER( plus4_state::ted_ram_r ) |
631 | 637 | { |
632 | 638 | int phi0 = 1, mux = 0, ras = 1, ba = 0; |
633 | int s | |
639 | int s | |
634 | 640 | |
635 | bankswitch(offset, phi0, mux, ras, &s | |
641 | bankswitch(offset, phi0, mux, ras, &s | |
636 | 642 | |
637 | return read_memory(space, offset, ba, s | |
643 | return read_memory(space, offset, ba, s | |
638 | 644 | } |
639 | 645 | |
640 | 646 | READ8_MEMBER( plus4_state::ted_rom_r ) |
641 | 647 | { |
642 | 648 | int phi0 = 1, mux = 0, ras = 1, ba = 0; |
643 | int s | |
649 | int s | |
644 | 650 | |
645 | bankswitch(offset, phi0, mux, ras, &s | |
651 | bankswitch(offset, phi0, mux, ras, &s | |
646 | 652 | |
647 | return read_memory(space, offset, ba, s | |
653 | return read_memory(space, offset, ba, s | |
648 | 654 | } |
649 | 655 | |
650 | 656 | READ8_MEMBER( plus4_state::ted_k_r ) |
r17592 | r17593 | |
767 | 773 | |
768 | 774 | |
769 | 775 | //------------------------------------------------- |
776 | // PET_DATASSETTE_PORT_INTERFACE( datassette_intf ) | |
777 | //------------------------------------------------- | |
778 | ||
779 | static PET_DATASSETTE_PORT_INTERFACE( datassette_intf ) | |
780 | { | |
781 | DEVCB_NULL | |
782 | }; | |
783 | ||
784 | ||
785 | //------------------------------------------------- | |
770 | 786 | // CBM_IEC_INTERFACE( iec_intf ) |
771 | 787 | //------------------------------------------------- |
772 | 788 | |
r17592 | r17593 | |
845 | 861 | m_function = memregion("function")->base(); |
846 | 862 | } |
847 | 863 | |
864 | if (memregion("c2") != NULL) | |
865 | { | |
866 | m_c2 = memregion("c2")->base(); | |
867 | } | |
868 | ||
848 | 869 | // state saving |
849 | 870 | save_item(NAME(m_addr)); |
850 | 871 | save_item(NAME(m_rom_en)); |
r17592 | r17593 | |
915 | 936 | MCFG_MOS6529_ADD(MOS6529_USER_TAG, spi_user_intf) |
916 | 937 | MCFG_MOS6529_ADD(MOS6529_KB_TAG, spi_kb_intf) |
917 | 938 | MCFG_QUICKLOAD_ADD("quickload", cbm_c16, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) |
918 | MCFG_ | |
939 | MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, d | |
919 | 940 | MCFG_CBM_IEC_ADD(iec_intf, NULL) |
920 | 941 | MCFG_PLUS4_EXPANSION_SLOT_ADD(PLUS4_EXPANSION_SLOT_TAG, XTAL_14_31818MHz/16, expansion_intf, plus4_expansion_cards, NULL, NULL) |
921 | 942 | MCFG_PLUS4_USER_PORT_ADD(PLUS4_USER_PORT_TAG, plus4_user_port_cards, NULL, NULL) |
r17592 | r17593 | |
954 | 975 | MCFG_MOS6529_ADD(MOS6529_USER_TAG, spi_user_intf) |
955 | 976 | MCFG_MOS6529_ADD(MOS6529_KB_TAG, spi_kb_intf) |
956 | 977 | MCFG_QUICKLOAD_ADD("quickload", cbm_c16, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS) |
957 | MCFG_ | |
978 | MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, d | |
958 | 979 | MCFG_CBM_IEC_ADD(iec_intf, NULL) |
959 | 980 | MCFG_PLUS4_EXPANSION_SLOT_ADD(PLUS4_EXPANSION_SLOT_TAG, XTAL_17_73447MHz/20, expansion_intf, plus4_expansion_cards, NULL, NULL) |
960 | 981 | MCFG_PLUS4_USER_PORT_ADD(PLUS4_USER_PORT_TAG, plus4_user_port_cards, NULL, NULL) |
r17592 | r17593 | |
970 | 991 | |
971 | 992 | |
972 | 993 | //------------------------------------------------- |
973 | // MACHINE_CONFIG( c16 ) | |
994 | // MACHINE_CONFIG( c16n ) | |
974 | 995 | //------------------------------------------------- |
975 | 996 | |
976 | static MACHINE_CONFIG_DERIVED( c16, | |
997 | static MACHINE_CONFIG_DERIVED( c16n, ntsc ) | |
977 | 998 | MCFG_CPU_MODIFY(MOS7501_TAG) |
978 | 999 | MCFG_CPU_CONFIG(c16_cpu_intf) |
979 | 1000 | |
r17592 | r17593 | |
991 | 1012 | |
992 | 1013 | |
993 | 1014 | //------------------------------------------------- |
1015 | // MACHINE_CONFIG( c16p ) | |
1016 | //------------------------------------------------- | |
1017 | ||
1018 | static MACHINE_CONFIG_DERIVED( c16p, pal ) | |
1019 | MCFG_CPU_MODIFY(MOS7501_TAG) | |
1020 | MCFG_CPU_CONFIG(c16_cpu_intf) | |
1021 | ||
1022 | MCFG_DEVICE_REMOVE(MOS6551_TAG) | |
1023 | MCFG_DEVICE_REMOVE(MOS6529_USER_TAG) | |
1024 | MCFG_DEVICE_REMOVE(PLUS4_USER_PORT_TAG) | |
1025 | ||
1026 | MCFG_DEVICE_MODIFY(CBM_IEC_TAG) | |
1027 | MCFG_DEVICE_CONFIG(c16_iec_intf) | |
1028 | ||
1029 | MCFG_DEVICE_MODIFY(RAM_TAG) | |
1030 | MCFG_RAM_DEFAULT_SIZE("16K") | |
1031 | MCFG_RAM_EXTRA_OPTIONS("64K") | |
1032 | MACHINE_CONFIG_END | |
1033 | ||
1034 | ||
1035 | //------------------------------------------------- | |
994 | 1036 | // MACHINE_CONFIG( c232 ) |
995 | 1037 | //------------------------------------------------- |
996 | 1038 | |
997 | static MACHINE_CONFIG_DERIVED( c232, c16 ) | |
1039 | static MACHINE_CONFIG_DERIVED( c232, c16p ) | |
998 | 1040 | MCFG_DEVICE_MODIFY(RAM_TAG) |
999 | 1041 | MCFG_RAM_DEFAULT_SIZE("32K") |
1000 | 1042 | MACHINE_CONFIG_END |
r17592 | r17593 | |
1024 | 1066 | ROM_LOAD( "basic-264.bin", 0x0000, 0x4000, CRC(6a2fc8e3) SHA1(473fce23afa07000cdca899fbcffd6961b36a8a0) ) |
1025 | 1067 | ROM_LOAD( "kernal-264.bin", 0x4000, 0x4000, CRC(8f32abe7) SHA1(d481faf5fcbb331878dc7851c642d04f26a32873) ) |
1026 | 1068 | |
1027 | ROM_REGION( 0x8000, "function", ROMREGION_ERASE00 ) | |
1069 | ROM_REGION( 0x8000, "function", 0 ) | |
1070 | ROM_CART_LOAD( "lo", 0x0000, 0x0000, ROM_NOMIRROR ) | |
1071 | ROM_CART_LOAD( "hi", 0x4000, 0x0000, ROM_NOMIRROR ) | |
1028 | 1072 | |
1029 | 1073 | ROM_REGION( 0xf5, PLA_TAG, 0 ) |
1030 | 1074 | ROM_LOAD( "251641-02", 0x00, 0xf5, NO_DUMP ) |
r17592 | r17593 | |
1032 | 1076 | |
1033 | 1077 | |
1034 | 1078 | //------------------------------------------------- |
1079 | // ROM( c232 ) | |
1080 | //------------------------------------------------- | |
1081 | ||
1082 | ROM_START( c232 ) | |
1083 | ROM_REGION( 0x8000, "kernal", 0 ) | |
1084 | ROM_LOAD( "318006-01.u4", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) | |
1085 | ROM_LOAD( "318004-01.u5", 0x4000, 0x4000, CRC(dbdc3319) SHA1(3c77caf72914c1c0a0875b3a7f6935cd30c54201) ) | |
1086 | ||
1087 | ROM_REGION( 0x8000, "function", 0 ) | |
1088 | ROM_CART_LOAD( "lo", 0x0000, 0x0000, ROM_NOMIRROR ) | |
1089 | ROM_CART_LOAD( "hi", 0x4000, 0x0000, ROM_NOMIRROR ) | |
1090 | ||
1091 | ROM_REGION( 0xf5, PLA_TAG, 0 ) | |
1092 | ROM_LOAD( "251641-02.u7", 0x00, 0xf5, NO_DUMP ) | |
1093 | ROM_END | |
1094 | ||
1095 | ||
1096 | //------------------------------------------------- | |
1097 | // ROM( v364 ) | |
1098 | //------------------------------------------------- | |
1099 | ||
1100 | ROM_START( v364 ) | |
1101 | ROM_REGION( 0x8000, "kernal", 0 ) | |
1102 | ROM_LOAD( "318006-01", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) | |
1103 | ROM_LOAD( "kern364p", 0x4000, 0x4000, CRC(84fd4f7a) SHA1(b9a5b5dacd57ca117ef0b3af29e91998bf4d7e5f) ) | |
1104 | ||
1105 | ROM_REGION( 0x8000, "function", 0 ) | |
1106 | ROM_LOAD( "317053-01", 0x0000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f) ) | |
1107 | ROM_LOAD( "317054-01", 0x4000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693) ) | |
1108 | ||
1109 | ROM_REGION( 0x8000, "c2", 0 ) | |
1110 | ROM_LOAD( "spk3cc4.bin", 0x0000, 0x4000, CRC(5227c2ee) SHA1(59af401cbb2194f689898271c6e8aafa28a7af11) ) | |
1111 | ||
1112 | ROM_REGION( 0xf5, PLA_TAG, 0 ) | |
1113 | ROM_LOAD( "251641-02", 0x00, 0xf5, NO_DUMP ) | |
1114 | ROM_END | |
1115 | ||
1116 | ||
1117 | //------------------------------------------------- | |
1035 | 1118 | // ROM( plus4n ) |
1036 | 1119 | //------------------------------------------------- |
1037 | 1120 | |
r17592 | r17593 | |
1082 | 1165 | |
1083 | 1166 | |
1084 | 1167 | //------------------------------------------------- |
1085 | // ROM( c16 ) | |
1168 | // ROM( c16n ) | |
1086 | 1169 | //------------------------------------------------- |
1087 | 1170 | |
1088 | ROM_START( c16 ) | |
1171 | ROM_START( c16n ) | |
1089 | 1172 | ROM_REGION( 0x8000, "kernal", 0 ) |
1090 | ROM_LOAD( "318006-01.u3", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) | |
1091 | ||
1092 | 1173 | ROM_DEFAULT_BIOS("r5") |
1093 | ROM_SYSTEM_BIOS( 0, "r3", "Revision 3" ) | |
1094 | ROMX_LOAD( "318004-03.u4", 0x4000, 0x4000, CRC(77bab934) SHA1(97814dab9d757fe5a3a61d357a9a81da588a9783), ROM_BIOS(1) ) | |
1095 | ROM_SYSTEM_BIOS( 1, "r4", "Revision 4" ) | |
1096 | ROMX_LOAD( "318004-04.u4", 0x4000, 0x4000, CRC(be54ed79) SHA1(514ad3c29d01a2c0a3b143d9c1d4143b1912b793), ROM_BIOS(2) ) | |
1097 | ROM_SYSTEM_BIOS( 2, "r5", "Revision 5" ) | |
1098 | ROMX_LOAD( "318004-05.u4", 0x4000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb), ROM_BIOS(3) ) | |
1174 | ROM_SYSTEM_BIOS( 0, "r4", "Revision 4" ) | |
1175 | ROMX_LOAD( "318005-04.u24", 0x4000, 0x4000, CRC(799a633d) SHA1(5df52c693387c0e2b5d682613a3b5a65477311cf), ROM_BIOS(1) ) | |
1176 | ROM_SYSTEM_BIOS( 1, "r5", "Revision 5" ) | |
1177 | ROMX_LOAD( "318005-05.u24", 0x4000, 0x4000, CRC(70295038) SHA1(a3d9e5be091b98de39a046ab167fb7632d053682), ROM_BIOS(2) ) | |
1178 | ROM_SYSTEM_BIOS( 2, "jiffydos", "JiffyDOS v6.01" ) | |
1179 | ROMX_LOAD( "jiffydos plus4.u24", 0x0000, 0x8000, CRC(818d3f45) SHA1(9bc1b1c3da9ca642deae717905f990d8e36e6c3b), ROM_BIOS(3) ) // first half contains R5 kernal | |
1099 | 1180 | |
1181 | ROM_LOAD( "318006-01.u23", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) | |
1182 | ||
1100 | 1183 | ROM_REGION( 0xf5, PLA_TAG, 0 ) |
1101 | ROM_LOAD( "251641-02.u1 | |
1184 | ROM_LOAD( "251641-02.u19", 0x00, 0xf5, NO_DUMP ) | |
1102 | 1185 | ROM_END |
1103 | 1186 | |
1104 | 1187 | |
1105 | 1188 | //------------------------------------------------- |
1106 | // ROM( c1 | |
1189 | // ROM( c1 | |
1107 | 1190 | //------------------------------------------------- |
1108 | 1191 | |
1109 | ROM_START( c1 | |
1192 | ROM_START( c1 | |
1110 | 1193 | ROM_REGION( 0x8000, "kernal", 0 ) |
1111 | 1194 | ROM_LOAD( "318006-01.u3", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) |
1112 | 1195 | |
r17592 | r17593 | |
1119 | 1202 | ROMX_LOAD( "318004-05.u4", 0x4000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb), ROM_BIOS(3) ) |
1120 | 1203 | |
1121 | 1204 | ROM_REGION( 0xf5, PLA_TAG, 0 ) |
1122 | ROM_LOAD( "251641-02.u1 | |
1205 | ROM_LOAD( "251641-02.u16 | |
1123 | 1206 | ROM_END |
1124 | 1207 | |
1125 | 1208 | |
r17592 | r17593 | |
1143 | 1226 | |
1144 | 1227 | |
1145 | 1228 | //------------------------------------------------- |
1146 | // ROM( c | |
1229 | // ROM( c116 ) | |
1147 | 1230 | //------------------------------------------------- |
1148 | 1231 | |
1149 | ROM_START( c | |
1232 | ROM_START( c116 ) | |
1150 | 1233 | ROM_REGION( 0x8000, "kernal", 0 ) |
1151 | ROM_LOAD( "318006-01.u4", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) | |
1152 | ROM_LOAD( "318004-01.u5", 0x4000, 0x4000, CRC(dbdc3319) SHA1(3c77caf72914c1c0a0875b3a7f6935cd30c54201) ) | |
1234 | ROM_LOAD( "318006-01.u3", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) | |
1153 | 1235 | |
1154 | ROM_REGION( 0x8000, "function", ROMREGION_ERASE00 ) | |
1236 | ROM_DEFAULT_BIOS("r5") | |
1237 | ROM_SYSTEM_BIOS( 0, "r3", "Revision 3" ) | |
1238 | ROMX_LOAD( "318004-03.u4", 0x4000, 0x4000, CRC(77bab934) SHA1(97814dab9d757fe5a3a61d357a9a81da588a9783), ROM_BIOS(1) ) | |
1239 | ROM_SYSTEM_BIOS( 1, "r4", "Revision 4" ) | |
1240 | ROMX_LOAD( "318004-04.u4", 0x4000, 0x4000, CRC(be54ed79) SHA1(514ad3c29d01a2c0a3b143d9c1d4143b1912b793), ROM_BIOS(2) ) | |
1241 | ROM_SYSTEM_BIOS( 2, "r5", "Revision 5" ) | |
1242 | ROMX_LOAD( "318004-05.u4", 0x4000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb), ROM_BIOS(3) ) | |
1155 | 1243 | |
1156 | 1244 | ROM_REGION( 0xf5, PLA_TAG, 0 ) |
1157 | ROM_LOAD( "251641-02.u | |
1245 | ROM_LOAD( "251641-02.u101", 0x00, 0xf5, NO_DUMP ) | |
1158 | 1246 | ROM_END |
1159 | 1247 | |
1160 | 1248 | |
1161 | //------------------------------------------------- | |
1162 | // ROM( v364 ) | |
1163 | //------------------------------------------------- | |
1164 | 1249 | |
1165 | ROM_START( v364 ) | |
1166 | ROM_REGION( 0x8000, "kernal", 0 ) | |
1167 | ROM_LOAD( "318006-01", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) | |
1168 | ROM_LOAD( "kern364p", 0x4000, 0x4000, CRC(84fd4f7a) SHA1(b9a5b5dacd57ca117ef0b3af29e91998bf4d7e5f) ) | |
1169 | ||
1170 | ROM_REGION( 0x10000, "function", 0 ) | |
1171 | ROM_LOAD( "317053-01", 0x0000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f) ) | |
1172 | ROM_LOAD( "317054-01", 0x4000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693) ) | |
1173 | ROM_LOAD( "spk3cc4.bin", 0x8000, 0x4000, CRC(5227c2ee) SHA1(59af401cbb2194f689898271c6e8aafa28a7af11) ) | |
1174 | ||
1175 | ROM_REGION( 0xf5, PLA_TAG, 0 ) | |
1176 | ROM_LOAD( "251641-02", 0x00, 0xf5, NO_DUMP ) | |
1177 | ROM_END | |
1178 | ||
1179 | ||
1180 | ||
1181 | 1250 | //************************************************************************** |
1182 | 1251 | // SYSTEM DRIVERS |
1183 | 1252 | //************************************************************************** |
1184 | 1253 | |
1185 | 1254 | // YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS |
1186 | COMP( 1983, c264, 0, 0, ntsc, plus4, driver_device, 0, "Commodore Business Machines", "Commodore 264 (Prototype)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) | |
1255 | COMP( 1984, c264, 0, 0, ntsc, plus4, driver_device, 0, "Commodore Business Machines", "Commodore 264 (Prototype)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) | |
1256 | COMP( 1984, c232, c264, 0, c232, plus4, driver_device, 0, "Commodore Business Machines", "Commodore 232 (Prototype)", GAME_SUPPORTS_SAVE ) | |
1257 | COMP( 1984, v364, c264, 0, v364, plus4, driver_device, 0, "Commodore Business Machines", "Commodore V364 (Prototype)", GAME_SUPPORTS_SAVE ) | |
1187 | 1258 | COMP( 1984, plus4n, c264, 0, ntsc, plus4, driver_device, 0, "Commodore Business Machines", "Plus/4 (NTSC)", GAME_SUPPORTS_SAVE ) |
1188 | 1259 | COMP( 1984, plus4p, c264, 0, pal, plus4, driver_device, 0, "Commodore Business Machines", "Plus/4 (PAL)", GAME_SUPPORTS_SAVE ) |
1189 | COMP( 1984, c16, c264, 0, c16, c16, driver_device, 0, "Commodore Business Machines", "Commodore 16", GAME_SUPPORTS_SAVE ) | |
1190 | COMP( 1984, c16h, c264, 0, c16, c16, driver_device, 0, "Commodore Business Machines", "Commodore 16 (Hungary)", GAME_SUPPORTS_SAVE ) | |
1191 | COMP( 1984, c116, c264, 0, c16, c16, driver_device, 0, "Commodore Business Machines", "Commodore 116", GAME_SUPPORTS_SAVE ) | |
1192 | COMP( 1984, c232, c264, 0, c232, plus4, driver_device, 0, "Commodore Business Machines", "Commodore 232 (Prototype)", GAME_SUPPORTS_SAVE ) | |
1193 | COMP( 1985, v364, c264, 0, v364, plus4, driver_device, 0, "Commodore Business Machines", "Commodore V364 (Prototype)", GAME_SUPPORTS_SAVE ) | |
1260 | COMP( 1984, c16n, c264, 0, c16n, c16, driver_device, 0, "Commodore Business Machines", "Commodore 16 (NTSC)", GAME_SUPPORTS_SAVE ) | |
1261 | COMP( 1984, c16p, c264, 0, c16p, c16, driver_device, 0, "Commodore Business Machines", "Commodore 16 (PAL)", GAME_SUPPORTS_SAVE ) | |
1262 | COMP( 1984, c16h, c264, 0, c16p, c16, driver_device, 0, "Commodore Business Machines", "Commodore 16 (Hungary)", GAME_SUPPORTS_SAVE ) | |
1263 | COMP( 1984, c116, c264, 0, c16p, c16, driver_device, 0, "Commodore Business Machines", "Commodore 116", GAME_SUPPORTS_SAVE ) |
r17592 | r17593 | |
---|---|---|
642 | 642 | *************************************/ |
643 | 643 | |
644 | 644 | |
645 | READ8_MEMBER( c128_state::sid_potx_r ) | |
646 | { | |
647 | device_t *sid = machine().device("sid6581"); | |
648 | ||
649 | return c64_paddle_read(sid, 0); | |
650 | } | |
651 | ||
652 | READ8_MEMBER( c128_state::sid_poty_r ) | |
653 | { | |
654 | device_t *sid = machine().device("sid6581"); | |
655 | ||
656 | return c64_paddle_read(sid, 1); | |
657 | } | |
658 | ||
645 | 659 | static const sid6581_interface c128_sound_interface = |
646 | 660 | { |
647 | c64_paddle_read | |
661 | DEVCB_DRIVER_MEMBER(c128_state, sid_potx_r), | |
662 | DEVCB_DRIVER_MEMBER(c128_state, sid_poty_r) | |
648 | 663 | }; |
649 | 664 | |
650 | 665 | |
r17592 | r17593 | |
656 | 671 | DEVCB_HANDLER(c128_m6510_port_write) /* port_write_func */ |
657 | 672 | }; |
658 | 673 | |
659 | static SLOT_INTERFACE_START( c128dcr_iec_devices ) | |
660 | SLOT_INTERFACE("c1571cr", C1571CR) | |
661 | SLOT_INTERFACE_END | |
662 | ||
663 | static SLOT_INTERFACE_START( c128d81_iec_devices ) | |
664 | SLOT_INTERFACE("c1563", C1563) | |
665 | SLOT_INTERFACE_END | |
666 | ||
667 | 674 | static CBM_IEC_INTERFACE( cbm_iec_intf ) |
668 | 675 | { |
669 | 676 | DEVCB_DEVICE_LINE("cia_0", c128_iec_srq_w), |
r17592 | r17593 | |
---|---|---|
18 | 18 | |
19 | 19 | */ |
20 | 20 | |
21 | ||
22 | #include "emu.h" | |
23 | #include "cpu/z80/z80.h" | |
24 | #include "cpu/z80/z80daisy.h" | |
25 | #include "machine/z80pio.h" | |
26 | #include "machine/z80dart.h" | |
27 | #include "machine/z80ctc.h" | |
28 | #include "machine/ram.h" | |
29 | 21 | #include "includes/huebler.h" |
30 | 22 | |
31 | 23 | /* Keyboard */ |
r17592 | r17593 | |
41 | 33 | if (m_key_a8 && !a8) |
42 | 34 | { |
43 | 35 | m_key_d7 = m_key_d6; |
44 | m_key_a4 = !(BIT(data, 1) & BIT(data, 3)); | |
45 | m_key_a5 = !(BIT(data, 2) & BIT(data, 3)); | |
36 | m_key_a4 = !(BIT(data, 1) && BIT(data, 3)); | |
37 | m_key_a5 = !(BIT(data, 2) && BIT(data, 3)); | |
46 | 38 | } |
47 | 39 | |
48 | 40 | m_key_a8 = a8; |
r17592 | r17593 | |
---|---|---|
188 | 188 | //{ 0xff20, 0xffff, compis_null_r }, /* CPU 80186 */ |
189 | 189 | ADDRESS_MAP_END |
190 | 190 | |
191 | /* TODO */ | |
192 | static ADDRESS_MAP_START( keyboard_io, AS_IO, 8, compis_state ) | |
193 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_NOP | |
194 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_NOP | |
195 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_NOP | |
196 | AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_NOP | |
197 | ADDRESS_MAP_END | |
198 | ||
199 | 191 | /* COMPIS Keyboard */ |
200 | 192 | |
201 | 193 | /* 2008-05 FP: |
r17592 | r17593 | |
369 | 361 | MCFG_CPU_VBLANK_INT("screen", compis_vblank_int) |
370 | 362 | MCFG_CPU_CONFIG(i86_address_mask) |
371 | 363 | |
372 | MCFG_CPU_ADD("i8749", I8749, 1000000) | |
373 | MCFG_CPU_IO_MAP(keyboard_io) | |
374 | ||
375 | 364 | //MCFG_QUANTUM_TIME(attotime::from_hz(60)) |
376 | 365 | |
377 | 366 | MCFG_MACHINE_START(compis) |
r17592 | r17593 | |
404 | 393 | MCFG_MM58274C_ADD("mm58274c", compis_mm58274c_interface) |
405 | 394 | MCFG_UPD765A_ADD("upd765", compis_fdc_interface) |
406 | 395 | MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(compis_floppy_interface) |
396 | MCFG_COMPIS_KEYBOARD_ADD() | |
407 | 397 | |
408 | 398 | /* software lists */ |
409 | 399 | MCFG_SOFTWARE_LIST_ADD("flop_list", "compis") |
r17592 | r17593 | |
417 | 407 | MCFG_CPU_VBLANK_INT("screen", compis_vblank_int) |
418 | 408 | MCFG_CPU_CONFIG(i86_address_mask) |
419 | 409 | |
420 | MCFG_CPU_ADD("i8749", I8749, 1000000) | |
421 | MCFG_CPU_IO_MAP(keyboard_io) | |
422 | ||
423 | 410 | //MCFG_QUANTUM_TIME(attotime::from_hz(60)) |
424 | 411 | |
425 | 412 | MCFG_MACHINE_START(compis) |
r17592 | r17593 | |
448 | 435 | MCFG_MM58274C_ADD("mm58274c", compis_mm58274c_interface) |
449 | 436 | MCFG_UPD765A_ADD("upd765", compis_fdc_interface) |
450 | 437 | MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(compis_floppy_interface) |
438 | MCFG_COMPIS_KEYBOARD_ADD() | |
451 | 439 | |
452 | 440 | /* software lists */ |
453 | 441 | MCFG_SOFTWARE_LIST_ADD("flop_list", "compis") |
r17592 | r17593 | |
467 | 455 | ROM_LOAD16_BYTE( "sa883003.u36", 0x0001, 0x4000, CRC(7c918f56) SHA1(8ba33d206351c52f44f1aa76cc4d7f292dcef761) ) |
468 | 456 | ROM_LOAD16_BYTE( "sa883003.u39", 0x8000, 0x4000, CRC(3cca66db) SHA1(cac36c9caa2f5bb42d7a6d5b84f419318628935f) ) |
469 | 457 | ROM_LOAD16_BYTE( "sa883003.u35", 0x8001, 0x4000, CRC(43c38e76) SHA1(f32e43604107def2c2259898926d090f2ed62104) ) |
470 | ||
471 | ROM_REGION( 0x800, "i8749", 0 ) | |
472 | ROM_LOAD( "cmpkey13.u1", 0x0000, 0x0800, CRC(3f87d138) SHA1(c04e2d325b9c04818bc7c47c3bf32b13862b11ec) ) | |
473 | 458 | ROM_END |
474 | 459 | |
475 | 460 | ROM_START( compis2 ) |
r17592 | r17593 | |
483 | 468 | ROM_SYSTEM_BIOS( 1, "v303", "Compis II v3.03 (1987-03-09)" ) |
484 | 469 | ROMX_LOAD( "rysa094.u39", 0x0000, 0x8000, CRC(e7302bff) SHA1(44ea20ef4008849af036c1a945bc4f27431048fb), ROM_BIOS(2) | ROM_SKIP(1) ) |
485 | 470 | ROMX_LOAD( "rysa094.u35", 0x0001, 0x8000, CRC(b0694026) SHA1(eb6b2e3cb0f42fd5ffdf44f70e652ecb9714ce30), ROM_BIOS(2) | ROM_SKIP(1) ) |
486 | ||
487 | ROM_REGION( 0x800, "i8749", 0 ) | |
488 | ROM_LOAD( "cmpkey13.u1", 0x0000, 0x0800, CRC(3f87d138) SHA1(c04e2d325b9c04818bc7c47c3bf32b13862b11ec) ) | |
489 | 471 | ROM_END |
490 | 472 | |
491 | 473 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ |
r17592 | r17593 | |
---|---|---|
50 | 50 | { |
51 | 51 | int restore = BIT(ioport("SPECIAL")->read(), 7); |
52 | 52 | |
53 | m_maincpu->set_input_line(INPUT_LINE_IRQ0, m_cia1_irq | m_vic_irq | m_exp_irq); | |
54 | m_maincpu->set_input_line(INPUT_LINE_NMI, m_cia2_irq | restore | m_exp_nmi); | |
53 | m_maincpu->set_input_line(INPUT_LINE_IRQ0, m_cia1_irq || m_vic_irq || m_exp_irq); | |
54 | m_maincpu->set_input_line(INPUT_LINE_NMI, m_cia2_irq || restore || m_exp_nmi); | |
55 | 55 | |
56 | mos6526_flag_w(m_cia1, m_cass_rd & m_iec_srq); | |
56 | mos6526_flag_w(m_cia1, m_cass_rd && m_iec_srq); | |
57 | 57 | } |
58 | 58 | |
59 | 59 | |
r17592 | r17593 | |
93 | 93 | { |
94 | 94 | int io1 = 1, io2 = 1; |
95 | 95 | |
96 | UINT8 data = | |
96 | UINT8 data = m_vic->bus_r(); | |
97 | 97 | |
98 | 98 | if (!casram) |
99 | 99 | { |
r17592 | r17593 | |
155 | 155 | } |
156 | 156 | } |
157 | 157 | |
158 | data |= m_exp->cd_r(space, offset, ba, roml, romh, io1, io2); | |
159 | ||
160 | return data; | |
158 | return m_exp->cd_r(space, offset, data, ba, roml, romh, io1, io2); | |
161 | 159 | } |
162 | 160 | |
163 | 161 | |
r17592 | r17593 | |
249 | 247 | int casram, basic, kernal, charom, grw, io, roml, romh; |
250 | 248 | bankswitch(0xffff, offset, rw, aec, ba, cas, &casram, &basic, &kernal, &charom, &grw, &io, &roml, &romh); |
251 | 249 | |
252 | return read_memory(space, offset, | |
250 | return read_memory(space, offset, ba, casram, basic, kernal, charom, io, roml, romh); | |
253 | 251 | } |
254 | 252 | |
255 | 253 | |
r17592 | r17593 | |
437 | 435 | // sid6581_interface sid_intf |
438 | 436 | //------------------------------------------------- |
439 | 437 | |
440 | ||
438 | READ8 | |
441 | 439 | { |
442 | running_machine &machine = device->machine(); | |
443 | c64_state *state = device->machine().driver_data<c64_state>(); | |
440 | UINT8 cia1_pa = mos6526_pa_r(m_cia1, 0); | |
441 | ||
442 | int sela = BIT(cia1_pa, 6); | |
443 | int selb = BIT(cia1_pa, 7); | |
444 | 444 | |
445 | int pot1 = 0xff, pot2 = 0xff, pot3 = 0xff, pot4 = 0xff, temp; | |
446 | UINT8 cia0porta = mos6526_pa_r(state->m_cia1, 0); | |
447 | int controller1 = machine.root_device().ioport("CTRLSEL")->read() & 0x07; | |
448 | int controller2 = machine.root_device().ioport("CTRLSEL")->read() & 0x70; | |
449 | // Notice that only a single input is defined for Mouse & Lightpen in both ports | |
450 | switch (controller1) | |
451 | { | |
452 | case 0x01: | |
453 | if (which) | |
454 | pot2 = machine.root_device().ioport("PADDLE2")->read(); | |
455 | else | |
456 | pot1 = machine.root_device().ioport("PADDLE1")->read(); | |
457 | break; | |
445 | UINT8 data = 0; | |
458 | 446 | |
459 | case 0x02: | |
460 | if (which) | |
461 | pot2 = machine.root_device().ioport("TRACKY")->read(); | |
462 | else | |
463 | pot1 = machine.root_device().ioport("TRACKX")->read(); | |
464 | break; | |
447 | if (sela) data = m_joy1->pot_x_r(); | |
448 | if (selb) data = m_joy2->pot_x_r(); | |
465 | 449 | |
466 | case 0x03: | |
467 | if (which && (machine.root_device().ioport("JOY1_2B")->read() & 0x20)) // Joy1 Button 2 | |
468 | pot1 = 0x00; | |
469 | break; | |
450 | return data; | |
451 | } | |
470 | 452 | |
471 | case 0x04: | |
472 | if (which) | |
473 | pot2 = machine.root_device().ioport("LIGHTY")->read(); | |
474 | else | |
475 | pot1 = machine.root_device().ioport("LIGHTX")->read(); | |
476 | break; | |
453 | READ8_MEMBER( c64_state::sid_poty_r ) | |
454 | { | |
455 | UINT8 cia1_pa = mos6526_pa_r(m_cia1, 0); | |
456 | ||
457 | int sela = BIT(cia1_pa, 6); | |
458 | int selb = BIT(cia1_pa, 7); | |
477 | 459 | |
478 | case 0x06: | |
479 | if (which && (machine.root_device().ioport("OTHER")->read() & 0x04)) // Lightpen Signal | |
480 | pot2 = 0x00; | |
481 | break; | |
460 | UINT8 data = 0; | |
482 | 461 | |
483 | case 0x00: | |
484 | case 0x07: | |
485 | break; | |
462 | if (sela) data = m_joy1->pot_y_r(); | |
463 | if (selb) data = m_joy2->pot_y_r(); | |
486 | 464 | |
487 | default: | |
488 | logerror("Invalid Controller Setting %d\n", controller1); | |
489 | break; | |
490 | } | |
491 | ||
492 | switch (controller2) | |
493 | { | |
494 | case 0x10: | |
495 | if (which) | |
496 | pot4 = machine.root_device().ioport("PADDLE4")->read(); | |
497 | else | |
498 | pot3 = machine.root_device().ioport("PADDLE3")->read(); | |
499 | break; | |
500 | ||
501 | case 0x20: | |
502 | if (which) | |
503 | pot4 = machine.root_device().ioport("TRACKY")->read(); | |
504 | else | |
505 | pot3 = machine.root_device().ioport("TRACKX")->read(); | |
506 | break; | |
507 | ||
508 | case 0x30: | |
509 | if (which && (machine.root_device().ioport("JOY2_2B")->read() & 0x20)) // Joy2 Button 2 | |
510 | pot4 = 0x00; | |
511 | break; | |
512 | ||
513 | case 0x40: | |
514 | if (which) | |
515 | pot4 = machine.root_device().ioport("LIGHTY")->read(); | |
516 | else | |
517 | pot3 = machine.root_device().ioport("LIGHTX")->read(); | |
518 | break; | |
519 | ||
520 | case 0x60: | |
521 | if (which && (machine.root_device().ioport("OTHER")->read() & 0x04)) // Lightpen Signal | |
522 | pot4 = 0x00; | |
523 | break; | |
524 | ||
525 | case 0x00: | |
526 | case 0x70: | |
527 | break; | |
528 | ||
529 | default: | |
530 | logerror("Invalid Controller Setting %d\n", controller1); | |
531 | break; | |
532 | } | |
533 | ||
534 | if (machine.root_device().ioport("CTRLSEL")->read() & 0x80) // Swap | |
535 | { | |
536 | temp = pot1; pot1 = pot3; pot3 = temp; | |
537 | temp = pot2; pot2 = pot4; pot4 = temp; | |
538 | } | |
539 | ||
540 | switch (cia0porta & 0xc0) | |
541 | { | |
542 | case 0x40: | |
543 | return which ? pot2 : pot1; | |
544 | ||
545 | case 0x80: | |
546 | return which ? pot4 : pot3; | |
547 | ||
548 | case 0xc0: | |
549 | return which ? pot2 : pot1; | |
550 | ||
551 | default: | |
552 | return 0; | |
553 | } | |
465 | return data; | |
554 | 466 | } |
555 | 467 | |
556 | static | |
468 | static MOS | |
557 | 469 | { |
558 | paddle_read | |
470 | DEVCB_DRIVER_MEMBER(c64_state, sid_potx_r), | |
471 | DEVCB_DRIVER_MEMBER(c64_state, sid_poty_r) | |
559 | 472 | }; |
560 | 473 | |
561 | 474 | |
r17592 | r17593 | |
753 | 666 | |
754 | 667 | UINT8 data = 0x07; |
755 | 668 | |
756 | data |= | |
669 | data |= | |
757 | 670 | |
758 | 671 | return data; |
759 | 672 | } |
r17592 | r17593 | |
781 | 694 | m_charen = BIT(data, 2); |
782 | 695 | |
783 | 696 | // cassette write |
784 | m_cassette-> | |
697 | m_cassette->write | |
785 | 698 | |
786 | 699 | // cassette motor |
787 | if (!BIT(data, 5)) | |
788 | { | |
789 | m_cassette->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); | |
790 | m_cassette_timer->adjust(attotime::zero, 0, attotime::from_hz(44100)); | |
791 | } | |
792 | else | |
793 | { | |
794 | m_cassette->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); | |
795 | m_cassette_timer->reset(); | |
796 | } | |
700 | m_cassette->motor_w(BIT(data, 5)); | |
797 | 701 | } |
798 | 702 | |
799 | 703 | static const m6502_interface cpu_intf = |
r17592 | r17593 | |
914 | 818 | |
915 | 819 | |
916 | 820 | //------------------------------------------------- |
917 | // | |
821 | // P | |
918 | 822 | //------------------------------------------------- |
919 | 823 | |
920 | ||
824 | WR | |
921 | 825 | { |
922 | | |
826 | m | |
923 | 827 | |
924 | state->m_cass_rd = state->m_cassette->input() > +0.0; | |
925 | ||
926 | state->check_interrupts(); | |
828 | check_interrupts(); | |
927 | 829 | } |
928 | 830 | |
831 | static PET_DATASSETTE_PORT_INTERFACE( datassette_intf ) | |
832 | { | |
833 | DEVCB_DRIVER_LINE_MEMBER(c64_state, tape_read_w), | |
834 | }; | |
929 | 835 | |
836 | ||
930 | 837 | //------------------------------------------------- |
931 | 838 | // CBM_IEC_INTERFACE( iec_intf ) |
932 | 839 | //------------------------------------------------- |
r17592 | r17593 | |
1115 | 1022 | MCFG_MOS6526R1_ADD(MOS6526_1_TAG, VIC6567_CLOCK, cia1_intf) |
1116 | 1023 | MCFG_MOS6526R1_ADD(MOS6526_2_TAG, VIC6567_CLOCK, cia2_intf) |
1117 | 1024 | MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS) |
1118 | MCFG_CASSETTE_ADD(CASSETTE_TAG, cbm_cassette_interface) | |
1119 | MCFG_TIMER_ADD(TIMER_C1531_TAG, cassette_tick) | |
1025 | MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, "c1530", NULL) | |
1120 | 1026 | MCFG_CBM_IEC_ADD(iec_intf, "c1541") |
1121 | 1027 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vic20_control_port_devices, NULL, NULL) |
1122 | 1028 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vic20_control_port_devices, NULL, NULL) |
r17592 | r17593 | |
1212 | 1118 | MCFG_MOS6526R1_ADD(MOS6526_1_TAG, VIC6569_CLOCK, cia1_intf) |
1213 | 1119 | MCFG_MOS6526R1_ADD(MOS6526_2_TAG, VIC6569_CLOCK, cia2_intf) |
1214 | 1120 | MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg,t64", CBM_QUICKLOAD_DELAY_SECONDS) |
1215 | MCFG_CASSETTE_ADD(CASSETTE_TAG, cbm_cassette_interface) | |
1216 | MCFG_TIMER_ADD(TIMER_C1531_TAG, cassette_tick) | |
1121 | MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, "c1530", NULL) | |
1217 | 1122 | MCFG_CBM_IEC_ADD(iec_intf, "c1541") |
1218 | 1123 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vic20_control_port_devices, NULL, NULL) |
1219 | 1124 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vic20_control_port_devices, NULL, NULL) |
r17592 | r17593 | |
---|---|---|
39 | 39 | { |
40 | 40 | // TODO this is really handled by the PLA |
41 | 41 | |
42 | UINT8 data = | |
42 | UINT8 data = m_vic->bus_r(); | |
43 | 43 | int lorom = 1, uprom = 1, exram = 1; |
44 | 44 | |
45 | 45 | if (offset < 0x800) |
r17592 | r17593 | |
75 | 75 | uprom = 0; |
76 | 76 | } |
77 | 77 | |
78 | data |= m_exp->cd_r(space, offset, lorom, uprom, exram); | |
79 | ||
80 | return data; | |
78 | return m_exp->cd_r(space, offset, data, lorom, uprom, exram); | |
81 | 79 | } |
82 | 80 | |
83 | 81 | |
r17592 | r17593 | |
253 | 251 | // sid6581_interface sid_intf |
254 | 252 | //------------------------------------------------- |
255 | 253 | |
256 | ||
254 | UINT8 | |
257 | 255 | { |
258 | running_machine &machine = device->machine(); | |
259 | vic10_state *state = device->machine().driver_data<vic10_state>(); | |
260 | ||
261 | 256 | int pot1 = 0xff, pot2 = 0xff, pot3 = 0xff, pot4 = 0xff, temp; |
262 | UINT8 cia0porta = mos6526_pa_r(state->m_cia, 0); | |
263 | int controller1 = machine.root_device().ioport("CTRLSEL")->read() & 0x07; | |
264 | int controller2 = machine.root_device().ioport("CTRLSEL")->read() & 0x70; | |
257 | UINT8 cia0porta = mos6526_pa_r(m_cia, 0); | |
258 | int controller1 = ioport("CTRLSEL")->read() & 0x07; | |
259 | int controller2 = ioport("CTRLSEL")->read() & 0x70; | |
265 | 260 | // Notice that only a single input is defined for Mouse & Lightpen in both ports |
266 | 261 | switch (controller1) |
267 | 262 | { |
268 | 263 | case 0x01: |
269 | 264 | if (which) |
270 | pot2 = | |
265 | pot2 = | |
271 | 266 | else |
272 | pot1 = | |
267 | pot1 = | |
273 | 268 | break; |
274 | 269 | |
275 | 270 | case 0x02: |
276 | 271 | if (which) |
277 | pot2 = | |
272 | pot2 = | |
278 | 273 | else |
279 | pot1 = | |
274 | pot1 = | |
280 | 275 | break; |
281 | 276 | |
282 | 277 | case 0x03: |
283 | if (which && ( | |
278 | if (which && ( | |
284 | 279 | pot1 = 0x00; |
285 | 280 | break; |
286 | 281 | |
287 | 282 | case 0x04: |
288 | 283 | if (which) |
289 | pot2 = | |
284 | pot2 = | |
290 | 285 | else |
291 | pot1 = | |
286 | pot1 = | |
292 | 287 | break; |
293 | 288 | |
294 | 289 | case 0x06: |
295 | if (which && ( | |
290 | if (which && ( | |
296 | 291 | pot2 = 0x00; |
297 | 292 | break; |
298 | 293 | |
r17592 | r17593 | |
309 | 304 | { |
310 | 305 | case 0x10: |
311 | 306 | if (which) |
312 | pot4 = | |
307 | pot4 = | |
313 | 308 | else |
314 | pot3 = | |
309 | pot3 = | |
315 | 310 | break; |
316 | 311 | |
317 | 312 | case 0x20: |
318 | 313 | if (which) |
319 | pot4 = | |
314 | pot4 = | |
320 | 315 | else |
321 | pot3 = | |
316 | pot3 = | |
322 | 317 | break; |
323 | 318 | |
324 | 319 | case 0x30: |
325 | if (which && ( | |
320 | if (which && ( | |
326 | 321 | pot4 = 0x00; |
327 | 322 | break; |
328 | 323 | |
329 | 324 | case 0x40: |
330 | 325 | if (which) |
331 | pot4 = | |
326 | pot4 = | |
332 | 327 | else |
333 | pot3 = | |
328 | pot3 = | |
334 | 329 | break; |
335 | 330 | |
336 | 331 | case 0x60: |
337 | if (which && ( | |
332 | if (which && ( | |
338 | 333 | pot4 = 0x00; |
339 | 334 | break; |
340 | 335 | |
r17592 | r17593 | |
347 | 342 | break; |
348 | 343 | } |
349 | 344 | |
350 | if ( | |
345 | if ( | |
351 | 346 | { |
352 | 347 | temp = pot1; pot1 = pot3; pot3 = temp; |
353 | 348 | temp = pot2; pot2 = pot4; pot4 = temp; |
r17592 | r17593 | |
369 | 364 | } |
370 | 365 | } |
371 | 366 | |
372 | ||
367 | READ8_MEMBER( v | |
373 | 368 | { |
374 | vic10_paddle_read | |
369 | return paddle_read(0); | |
370 | } | |
371 | ||
372 | READ8_MEMBER( vic10_state::sid_poty_r ) | |
373 | { | |
374 | return paddle_read(1); | |
375 | } | |
376 | ||
377 | static MOS6581_INTERFACE( sid_intf ) | |
378 | { | |
379 | DEVCB_DRIVER_MEMBER(vic10_state, sid_potx_r), | |
380 | DEVCB_DRIVER_MEMBER(vic10_state, sid_poty_r) | |
375 | 381 | }; |
376 | 382 | |
377 | 383 |
r17592 | r17593 | |
---|---|---|
874 | 874 | $(MESS_MACHINE)/plus4user.o \ |
875 | 875 | $(MESS_MACHINE)/plus4_sid.o \ |
876 | 876 | $(MESS_MACHINE)/plus4_std.o \ |
877 | $(MESS_MACHINE)/diag264_lb_iec.o \ | |
878 | $(MESS_MACHINE)/diag264_lb_tape.o \ | |
879 | $(MESS_MACHINE)/diag264_lb_user.o \ | |
877 | 880 | $(MESS_DRIVERS)/cbmb.o \ |
878 | 881 | $(MESS_MACHINE)/cbmb.o \ |
879 | 882 | $(MESS_VIDEO)/cbmb.o \ |
r17592 | r17593 | |
899 | 902 | $(MESS_MACHINE)/cbm.o \ |
900 | 903 | $(MESS_MACHINE)/cbmipt.o \ |
901 | 904 | $(MESS_MACHINE)/64h156.o \ |
905 | $(MESS_MACHINE)/petcass.o \ | |
906 | $(MESS_MACHINE)/c2n.o \ | |
902 | 907 | $(MESS_VIDEO)/vdc8563.o \ |
903 | 908 | $(MESS_VIDEO)/vic6567.o \ |
904 | 909 | $(MESS_VIDEO)/vic4567.o \ |
r17592 | r17593 | |
1687 | 1692 | $(MESSOBJ)/telenova.a: \ |
1688 | 1693 | $(MESS_DRIVERS)/compis.o \ |
1689 | 1694 | $(MESS_MACHINE)/compis.o \ |
1695 | $(MESS_MACHINE)/compiskb.o \ | |
1690 | 1696 | |
1691 | 1697 | $(MESSOBJ)/telercas.a: \ |
1692 | 1698 | $(MESS_DRIVERS)/tmc1800.o \ |
Previous | 199869 Revisions | Next |