trunk/hash/spc1000_cass.xml
r241485 | r241486 | |
506 | 506 | </part> |
507 | 507 | </software> |
508 | 508 | |
| 509 | <software name="gunfrigh"> |
| 510 | <description>Gun Fright</description> |
| 511 | <year>1986</year> |
| 512 | <publisher>Sammi Computer</publisher> |
| 513 | <info name="usage" value="Requires VDP unit in -ext1 expansion" /> |
| 514 | <part name="cass" interface="spc1000_cass"> |
| 515 | <dataarea name="cass" size="614352"> |
| 516 | <rom name="gunfright.tap" size="614352" crc="73cc58ef" sha1="ab09466a1cf2fc12faa2e18252e348b9cc56a7ff" offset="0" /> |
| 517 | </dataarea> |
| 518 | </part> |
| 519 | </software> |
| 520 | |
509 | 521 | <software name="headon"> |
510 | 522 | <description>Head-On</description> |
511 | 523 | <year>198?</year> |
r241485 | r241486 | |
1000 | 1012 | </part> |
1001 | 1013 | </software> |
1002 | 1014 | |
| 1015 | <software name="twinbee"> |
| 1016 | <description>TwinBee</description> |
| 1017 | <year>1986</year> |
| 1018 | <publisher>Static Soft</publisher> |
| 1019 | <info name="usage" value="Requires VDP unit in -ext1 expansion" /> |
| 1020 | <part name="cass" interface="spc1000_cass"> |
| 1021 | <dataarea name="cass" size="55619"> |
| 1022 | <rom name="vdp+twinbee.cas" size="55619" crc="b1882952" sha1="cee9e0e060ce3f17b0bcc1fa1ba5d86590cae4c3" offset="0" /> |
| 1023 | </dataarea> |
| 1024 | </part> |
| 1025 | </software> |
| 1026 | |
1003 | 1027 | <software name="vela"> |
1004 | 1028 | <description>Vela</description> |
1005 | 1029 | <year>198?</year> |
r241485 | r241486 | |
1070 | 1094 | </part> |
1071 | 1095 | </software> |
1072 | 1096 | |
1073 | | <software name="zexas"> |
1074 | | <description>Zexas</description> |
1075 | | <year>198?</year> |
1076 | | <publisher>Aloe?</publisher> |
1077 | | <part name="cass" interface="spc1000_cass"> |
1078 | | <dataarea name="cass" size="702072"> |
1079 | | <rom name="zexas-5461-mayhouse.tap" size="702072" crc="9367b51e" sha1="d6da8e4ae2275dbd3ba1b9c7137944f5674daf26" offset="0" /> |
1080 | | </dataarea> |
1081 | | </part> |
1082 | | </software> |
1083 | | |
1084 | | |
1085 | | <!-- Requires VDP Unit emulation --> |
1086 | | <software name="twinbee" supported="no"> |
1087 | | <description>TwinBee</description> |
1088 | | <year>198?</year> |
1089 | | <publisher><unknown></publisher> |
1090 | | <part name="cass" interface="spc1000_cass"> |
1091 | | <dataarea name="cass" size="55619"> |
1092 | | <rom name="vdp+twinbee.cas" size="55619" crc="b1882952" sha1="cee9e0e060ce3f17b0bcc1fa1ba5d86590cae4c3" offset="0" /> |
1093 | | </dataarea> |
1094 | | </part> |
1095 | | </software> |
1096 | | |
1097 | | <!-- Requires VDP Unit emulation --> |
1098 | | <software name="zanac" supported="no"> |
| 1097 | <software name="zanac"> |
1099 | 1098 | <description>Zanac</description> |
1100 | 1099 | <year>198?</year> |
1101 | | <publisher><unknown></publisher> |
| 1100 | <publisher>A.I.</publisher> |
| 1101 | <info name="usage" value="Requires VDP unit in -ext1 expansion" /> |
1102 | 1102 | <part name="cass" interface="spc1000_cass"> |
1103 | 1103 | <dataarea name="cass" size="774330"> |
1104 | 1104 | <rom name="vdp-zanac-mayhouse.tap" size="774330" crc="c4b6ea48" sha1="c6d85f1e43285d42b00d47cf69d14629520595c7" offset="0" /> |
r241485 | r241486 | |
1106 | 1106 | </part> |
1107 | 1107 | </software> |
1108 | 1108 | |
1109 | | <!-- Requires VDP Unit emulation --> |
1110 | | <software name="gunfrigh" supported="no"> |
1111 | | <description>Gun Fright</description> |
| 1109 | <software name="zexas"> |
| 1110 | <description>Zexas</description> |
1112 | 1111 | <year>198?</year> |
1113 | | <publisher><unknown></publisher> |
| 1112 | <publisher>Aloe?</publisher> |
1114 | 1113 | <part name="cass" interface="spc1000_cass"> |
1115 | | <dataarea name="cass" size="614352"> |
1116 | | <rom name="gunfright.tap" size="614352" crc="73cc58ef" sha1="ab09466a1cf2fc12faa2e18252e348b9cc56a7ff" offset="0" /> |
| 1114 | <dataarea name="cass" size="702072"> |
| 1115 | <rom name="zexas-5461-mayhouse.tap" size="702072" crc="9367b51e" sha1="d6da8e4ae2275dbd3ba1b9c7137944f5674daf26" offset="0" /> |
1117 | 1116 | </dataarea> |
1118 | 1117 | </part> |
1119 | 1118 | </software> |
trunk/src/emu/bus/spc1000/exp.c
r0 | r241486 | |
| 1 | /*********************************************************************************************************** |
| 2 | |
| 3 | Samsung SPC-1000 Expansion port |
| 4 | |
| 5 | ***********************************************************************************************************/ |
| 6 | |
| 7 | |
| 8 | #include "emu.h" |
| 9 | #include "exp.h" |
| 10 | |
| 11 | //************************************************************************** |
| 12 | // GLOBAL VARIABLES |
| 13 | //************************************************************************** |
| 14 | |
| 15 | const device_type SPC1000_EXP_SLOT = &device_creator<spc1000_exp_device>; |
| 16 | |
| 17 | |
| 18 | device_spc1000_card_interface::device_spc1000_card_interface(const machine_config &mconfig, device_t &device) |
| 19 | : device_slot_card_interface(mconfig, device) |
| 20 | { |
| 21 | } |
| 22 | |
| 23 | |
| 24 | device_spc1000_card_interface::~device_spc1000_card_interface() |
| 25 | { |
| 26 | } |
| 27 | |
| 28 | |
| 29 | //************************************************************************** |
| 30 | // LIVE DEVICE |
| 31 | //************************************************************************** |
| 32 | |
| 33 | //------------------------------------------------- |
| 34 | // spc1000_exp_device - constructor |
| 35 | //------------------------------------------------- |
| 36 | spc1000_exp_device::spc1000_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 37 | device_t(mconfig, SPC1000_EXP_SLOT, "Samsung SPC-1000 expansion", tag, owner, clock, "spc1000_exp", __FILE__), |
| 38 | device_slot_interface(mconfig, *this) |
| 39 | { |
| 40 | } |
| 41 | |
| 42 | |
| 43 | //------------------------------------------------- |
| 44 | // spc1000_exp_device - destructor |
| 45 | //------------------------------------------------- |
| 46 | |
| 47 | spc1000_exp_device::~spc1000_exp_device() |
| 48 | { |
| 49 | } |
| 50 | |
| 51 | //------------------------------------------------- |
| 52 | // device_start - device-specific startup |
| 53 | //------------------------------------------------- |
| 54 | |
| 55 | void spc1000_exp_device::device_start() |
| 56 | { |
| 57 | m_card = dynamic_cast<device_spc1000_card_interface *>(get_card_device()); |
| 58 | } |
| 59 | |
| 60 | /*------------------------------------------------- |
| 61 | read |
| 62 | -------------------------------------------------*/ |
| 63 | |
| 64 | READ8_MEMBER(spc1000_exp_device::read) |
| 65 | { |
| 66 | if (m_card) |
| 67 | return m_card->read(space, offset); |
| 68 | else |
| 69 | return 0xff; |
| 70 | } |
| 71 | |
| 72 | /*------------------------------------------------- |
| 73 | write |
| 74 | -------------------------------------------------*/ |
| 75 | |
| 76 | WRITE8_MEMBER(spc1000_exp_device::write) |
| 77 | { |
| 78 | if (m_card) |
| 79 | m_card->write(space, offset, data); |
| 80 | } |
trunk/src/emu/bus/spc1000/fdd.c
r0 | r241486 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | SPC-1000 FDD unit |
| 4 | |
| 5 | ***************************************************************************/ |
| 6 | |
| 7 | #include "emu.h" |
| 8 | #include "fdd.h" |
| 9 | |
| 10 | |
| 11 | /*************************************************************************** |
| 12 | IMPLEMENTATION |
| 13 | ***************************************************************************/ |
| 14 | |
| 15 | READ8_MEMBER(spc1000_fdd_exp_device::i8255_c_r) |
| 16 | { |
| 17 | return m_i8255_0_pc >> 4; |
| 18 | } |
| 19 | |
| 20 | WRITE8_MEMBER(spc1000_fdd_exp_device::i8255_b_w) |
| 21 | { |
| 22 | m_i8255_portb = data; |
| 23 | } |
| 24 | |
| 25 | WRITE8_MEMBER(spc1000_fdd_exp_device::i8255_c_w) |
| 26 | { |
| 27 | m_i8255_1_pc = data; |
| 28 | } |
| 29 | |
| 30 | //------------------------------------------------- |
| 31 | // fdc interrupt |
| 32 | //------------------------------------------------- |
| 33 | |
| 34 | READ8_MEMBER( spc1000_fdd_exp_device::tc_r ) |
| 35 | { |
| 36 | logerror("%s: tc_r\n", space.machine().describe_context()); |
| 37 | |
| 38 | // toggle tc on read |
| 39 | m_fdc->tc_w(true); |
| 40 | m_timer_tc->adjust(attotime::zero); |
| 41 | |
| 42 | return 0xff; |
| 43 | } |
| 44 | |
| 45 | WRITE8_MEMBER( spc1000_fdd_exp_device::control_w ) |
| 46 | { |
| 47 | logerror("%s: control_w(%02x)\n", space.machine().describe_context(), data); |
| 48 | |
| 49 | // bit 0, motor on signal |
| 50 | if (m_fd0) |
| 51 | m_fd0->mon_w(!BIT(data, 0)); |
| 52 | if (m_fd1) |
| 53 | m_fd1->mon_w(!BIT(data, 0)); |
| 54 | } |
| 55 | |
| 56 | static ADDRESS_MAP_START( sd725_mem, AS_PROGRAM, 8, spc1000_fdd_exp_device ) |
| 57 | ADDRESS_MAP_UNMAP_HIGH |
| 58 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 59 | AM_RANGE(0x2000, 0xffff) AM_RAM |
| 60 | ADDRESS_MAP_END |
| 61 | |
| 62 | static ADDRESS_MAP_START( sd725_io, AS_IO, 8, spc1000_fdd_exp_device ) |
| 63 | ADDRESS_MAP_UNMAP_HIGH |
| 64 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 65 | AM_RANGE(0xf8, 0xf8) AM_READWRITE(tc_r, control_w) // (R) Terminal Count Port (W) Motor Control Port |
| 66 | AM_RANGE(0xfa, 0xfb) AM_DEVICE("upd765", upd765a_device, map) |
| 67 | AM_RANGE(0xfc, 0xff) AM_DEVREADWRITE("d8255_master", i8255_device, read, write) |
| 68 | ADDRESS_MAP_END |
| 69 | |
| 70 | static SLOT_INTERFACE_START( sd725_floppies ) |
| 71 | SLOT_INTERFACE("sd320", EPSON_SD_320) |
| 72 | SLOT_INTERFACE_END |
| 73 | |
| 74 | static MACHINE_CONFIG_FRAGMENT(spc1000_fdd) |
| 75 | |
| 76 | /* sub CPU(5 inch floppy drive) */ |
| 77 | MCFG_CPU_ADD("fdccpu", Z80, XTAL_4MHz) /* 4 MHz */ |
| 78 | MCFG_CPU_PROGRAM_MAP(sd725_mem) |
| 79 | MCFG_CPU_IO_MAP(sd725_io) |
| 80 | |
| 81 | MCFG_DEVICE_ADD("d8255_master", I8255, 0) |
| 82 | MCFG_I8255_IN_PORTA_CB(DEVREAD8("d8255_master", i8255_device, pb_r)) |
| 83 | MCFG_I8255_IN_PORTB_CB(DEVREAD8("d8255_master", i8255_device, pa_r)) |
| 84 | MCFG_I8255_OUT_PORTB_CB(WRITE8(spc1000_fdd_exp_device, i8255_b_w)) |
| 85 | MCFG_I8255_IN_PORTC_CB(READ8(spc1000_fdd_exp_device, i8255_c_r)) |
| 86 | MCFG_I8255_OUT_PORTC_CB(WRITE8(spc1000_fdd_exp_device, i8255_c_w)) |
| 87 | |
| 88 | // floppy disk controller |
| 89 | MCFG_UPD765A_ADD("upd765", true, true) |
| 90 | MCFG_UPD765_INTRQ_CALLBACK(INPUTLINE("fdccpu", INPUT_LINE_IRQ0)) |
| 91 | |
| 92 | // floppy drives |
| 93 | MCFG_FLOPPY_DRIVE_ADD("upd765:0", sd725_floppies, "sd320", floppy_image_device::default_floppy_formats) |
| 94 | MCFG_FLOPPY_DRIVE_ADD("upd765:1", sd725_floppies, "sd320", floppy_image_device::default_floppy_formats) |
| 95 | MACHINE_CONFIG_END |
| 96 | |
| 97 | //------------------------------------------------- |
| 98 | // device_mconfig_additions |
| 99 | //------------------------------------------------- |
| 100 | |
| 101 | machine_config_constructor spc1000_fdd_exp_device::device_mconfig_additions() const |
| 102 | { |
| 103 | return MACHINE_CONFIG_NAME( spc1000_fdd ); |
| 104 | } |
| 105 | |
| 106 | ROM_START( spc1000_fdd ) |
| 107 | ROM_REGION(0x10000, "fdccpu", 0) |
| 108 | ROM_LOAD("sd725a.bin", 0x0000, 0x1000, CRC(96ac2eb8) SHA1(8e9d8f63a7fb87af417e95603e71cf537a6e83f1)) |
| 109 | ROM_END |
| 110 | |
| 111 | //------------------------------------------------- |
| 112 | // device_rom_region |
| 113 | //------------------------------------------------- |
| 114 | |
| 115 | const rom_entry *spc1000_fdd_exp_device::device_rom_region() const |
| 116 | { |
| 117 | return ROM_NAME( spc1000_fdd ); |
| 118 | } |
| 119 | |
| 120 | |
| 121 | //************************************************************************** |
| 122 | // GLOBAL VARIABLES |
| 123 | //************************************************************************** |
| 124 | |
| 125 | const device_type SPC1000_FDD_EXP = &device_creator<spc1000_fdd_exp_device>; |
| 126 | |
| 127 | //************************************************************************** |
| 128 | // LIVE DEVICE |
| 129 | //************************************************************************** |
| 130 | |
| 131 | //------------------------------------------------- |
| 132 | // spc1000_fdd_exp_device - constructor |
| 133 | //------------------------------------------------- |
| 134 | |
| 135 | spc1000_fdd_exp_device::spc1000_fdd_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 136 | : device_t(mconfig, SPC1000_FDD_EXP, "SPC1000 FDD expansion", tag, owner, clock, "spc1000_fdd_exp", __FILE__), |
| 137 | device_spc1000_card_interface(mconfig, *this), |
| 138 | m_cpu(*this, "fdccpu"), |
| 139 | m_fdc(*this, "upd765"), |
| 140 | m_pio(*this, "d8255_master") |
| 141 | { |
| 142 | } |
| 143 | |
| 144 | |
| 145 | //------------------------------------------------- |
| 146 | // device_start - device-specific startup |
| 147 | //------------------------------------------------- |
| 148 | |
| 149 | void spc1000_fdd_exp_device::device_start() |
| 150 | { |
| 151 | m_timer_tc = timer_alloc(TIMER_TC); |
| 152 | m_timer_tc->adjust(attotime::never); |
| 153 | |
| 154 | m_fd0 = subdevice<floppy_connector>("upd765:0")->get_device(); |
| 155 | m_fd1 = subdevice<floppy_connector>("upd765:1")->get_device(); |
| 156 | } |
| 157 | |
| 158 | //------------------------------------------------- |
| 159 | // device_reset - device-specific reset |
| 160 | //------------------------------------------------- |
| 161 | |
| 162 | void spc1000_fdd_exp_device::device_reset() |
| 163 | { |
| 164 | m_cpu->set_input_line_vector(0, 0); |
| 165 | |
| 166 | // enable rom (is this really needed? it does not seem necessary for FDD to work) |
| 167 | m_cpu->space(AS_PROGRAM).install_rom(0x0000, 0x0fff, 0, 0x2000, device().machine().root_device().memregion("fdccpu")->base()); |
| 168 | } |
| 169 | |
| 170 | void spc1000_fdd_exp_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 171 | { |
| 172 | switch (id) |
| 173 | { |
| 174 | case TIMER_TC: |
| 175 | m_fdc->tc_w(false); |
| 176 | break; |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | /*------------------------------------------------- |
| 181 | read |
| 182 | -------------------------------------------------*/ |
| 183 | |
| 184 | READ8_MEMBER(spc1000_fdd_exp_device::read) |
| 185 | { |
| 186 | // this should be m_pio->read on the whole 0x00-0x03 range? |
| 187 | if (offset >= 3) |
| 188 | return 0xff; |
| 189 | else |
| 190 | { |
| 191 | UINT8 data = 0; |
| 192 | switch (offset) |
| 193 | { |
| 194 | case 1: |
| 195 | data = m_i8255_portb; |
| 196 | break; |
| 197 | case 2: |
| 198 | data = m_i8255_1_pc >> 4; |
| 199 | break; |
| 200 | } |
| 201 | return data; |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | //------------------------------------------------- |
| 206 | // write |
| 207 | //------------------------------------------------- |
| 208 | |
| 209 | WRITE8_MEMBER(spc1000_fdd_exp_device::write) |
| 210 | { |
| 211 | // this should be m_pio->write on the whole 0x00-0x03 range? |
| 212 | if (offset < 3) |
| 213 | { |
| 214 | switch (offset) |
| 215 | { |
| 216 | case 0: |
| 217 | m_pio->write(space, 1, data); |
| 218 | break; |
| 219 | case 2: |
| 220 | m_i8255_0_pc = data; |
| 221 | break; |
| 222 | } |
| 223 | } |
| 224 | } |
trunk/src/emu/bus/spc1000/vdp.c
r0 | r241486 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | SPC-1000 VDP expansion unit |
| 4 | |
| 5 | ***************************************************************************/ |
| 6 | |
| 7 | #include "emu.h" |
| 8 | #include "vdp.h" |
| 9 | |
| 10 | |
| 11 | /*************************************************************************** |
| 12 | IMPLEMENTATION |
| 13 | ***************************************************************************/ |
| 14 | |
| 15 | WRITE_LINE_MEMBER(spc1000_vdp_exp_device::vdp_interrupt) |
| 16 | { |
| 17 | // nothing here? |
| 18 | } |
| 19 | |
| 20 | static MACHINE_CONFIG_FRAGMENT(scp1000_vdp) |
| 21 | |
| 22 | MCFG_DEVICE_ADD("tms", TMS9928A, XTAL_10_738635MHz / 2) // TODO: which clock? |
| 23 | MCFG_TMS9928A_VRAM_SIZE(0x4000) |
| 24 | MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(spc1000_vdp_exp_device, vdp_interrupt)) |
| 25 | MCFG_TMS9928A_SCREEN_ADD_NTSC("tms_screen") |
| 26 | MCFG_SCREEN_UPDATE_DEVICE("tms", tms9928a_device, screen_update) |
| 27 | MACHINE_CONFIG_END |
| 28 | |
| 29 | //------------------------------------------------- |
| 30 | // device_mconfig_additions |
| 31 | //------------------------------------------------- |
| 32 | |
| 33 | machine_config_constructor spc1000_vdp_exp_device::device_mconfig_additions() const |
| 34 | { |
| 35 | return MACHINE_CONFIG_NAME( scp1000_vdp ); |
| 36 | } |
| 37 | |
| 38 | |
| 39 | //************************************************************************** |
| 40 | // GLOBAL VARIABLES |
| 41 | //************************************************************************** |
| 42 | |
| 43 | const device_type SPC1000_VDP_EXP = &device_creator<spc1000_vdp_exp_device>; |
| 44 | |
| 45 | //************************************************************************** |
| 46 | // LIVE DEVICE |
| 47 | //************************************************************************** |
| 48 | |
| 49 | //------------------------------------------------- |
| 50 | // spc1000_vdp_exp_device - constructor |
| 51 | //------------------------------------------------- |
| 52 | |
| 53 | spc1000_vdp_exp_device::spc1000_vdp_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 54 | : device_t(mconfig, SPC1000_VDP_EXP, "SPC1000 VDP expansion", tag, owner, clock, "spc1000_vdp_exp", __FILE__), |
| 55 | device_spc1000_card_interface(mconfig, *this), |
| 56 | m_vdp(*this, "tms") |
| 57 | { |
| 58 | } |
| 59 | |
| 60 | |
| 61 | //------------------------------------------------- |
| 62 | // device_start - device-specific startup |
| 63 | //------------------------------------------------- |
| 64 | |
| 65 | void spc1000_vdp_exp_device::device_start() |
| 66 | { |
| 67 | } |
| 68 | |
| 69 | //------------------------------------------------- |
| 70 | // device_reset - device-specific reset |
| 71 | //------------------------------------------------- |
| 72 | |
| 73 | void spc1000_vdp_exp_device::device_reset() |
| 74 | { |
| 75 | } |
| 76 | |
| 77 | /*------------------------------------------------- |
| 78 | read |
| 79 | -------------------------------------------------*/ |
| 80 | READ8_MEMBER(spc1000_vdp_exp_device::read) |
| 81 | { |
| 82 | if (!(offset & 0x800)) |
| 83 | return 0xff; |
| 84 | |
| 85 | if (offset & 1) |
| 86 | return m_vdp->register_read(space, offset); |
| 87 | else |
| 88 | return m_vdp->vram_read(space, offset); |
| 89 | } |
| 90 | |
| 91 | //------------------------------------------------- |
| 92 | // write |
| 93 | //------------------------------------------------- |
| 94 | |
| 95 | WRITE8_MEMBER(spc1000_vdp_exp_device::write) |
| 96 | { |
| 97 | if (offset & 0x800) |
| 98 | { |
| 99 | if (offset & 1) |
| 100 | m_vdp->register_write(space, offset, data); |
| 101 | else |
| 102 | m_vdp->vram_write(space, offset, data); |
| 103 | } |
| 104 | } |
trunk/src/mess/drivers/spc1000.c
r241485 | r241486 | |
29 | 29 | |
30 | 30 | #include "emu.h" |
31 | 31 | #include "cpu/z80/z80.h" |
32 | | #include "video/mc6847.h" |
| 32 | #include "machine/ram.h" |
33 | 33 | #include "sound/ay8910.h" |
34 | 34 | #include "sound/wave.h" |
| 35 | #include "video/mc6847.h" |
35 | 36 | #include "imagedev/cassette.h" |
36 | | #include "machine/ram.h" |
37 | 37 | #include "formats/spc1000_cas.h" |
38 | | #include "machine/i8255.h" |
39 | | #include "machine/upd765.h" |
40 | 38 | |
| 39 | #include "bus/spc1000/exp.h" |
| 40 | #include "bus/spc1000/fdd.h" |
| 41 | #include "bus/spc1000/vdp.h" |
41 | 42 | |
| 43 | |
42 | 44 | class spc1000_state : public driver_device |
43 | 45 | { |
44 | 46 | public: |
45 | 47 | spc1000_state(const machine_config &mconfig, device_type type, const char *tag) |
46 | 48 | : driver_device(mconfig, type, tag) |
47 | | , m_p_videoram(*this, "videoram") |
48 | | , m_vdg(*this, "mc6847") |
49 | 49 | , m_maincpu(*this, "maincpu") |
50 | | , m_fdccpu(*this, "fdccpu") |
51 | | , m_fdc(*this, "upd765") |
52 | | , m_pio(*this, "d8255_master") |
53 | | , m_ram(*this, RAM_TAG) |
| 50 | , m_vdg(*this, "mc6847") |
54 | 51 | , m_cass(*this, "cassette") |
| 52 | , m_ram(*this, RAM_TAG) |
| 53 | , m_p_videoram(*this, "videoram") |
55 | 54 | , m_io_kb(*this, "LINE") |
56 | 55 | , m_io_joy(*this, "JOY") |
57 | 56 | {} |
r241485 | r241486 | |
64 | 63 | DECLARE_READ8_MEMBER(porta_r); |
65 | 64 | DECLARE_READ8_MEMBER(mc6847_videoram_r); |
66 | 65 | DECLARE_WRITE8_MEMBER(cass_w); |
67 | | DECLARE_WRITE8_MEMBER(sd725_w); |
68 | | DECLARE_READ8_MEMBER(sd725_r); |
69 | | DECLARE_WRITE8_MEMBER(fdc_8255_b_w); |
70 | | DECLARE_READ8_MEMBER(fdc_8255_c_r); |
71 | | DECLARE_WRITE8_MEMBER(fdc_8255_c_w); |
72 | | DECLARE_READ8_MEMBER(upd765_tc_r); |
73 | | DECLARE_WRITE8_MEMBER(fdc_control_w); |
74 | 66 | DECLARE_READ8_MEMBER(keyboard_r); |
75 | 67 | MC6847_GET_CHARROM_MEMBER(get_char_rom) |
76 | 68 | { |
77 | 69 | return m_p_videoram[0x1000 + (ch & 0x7f) * 16 + line]; |
78 | 70 | } |
79 | 71 | |
80 | | required_shared_ptr<UINT8> m_p_videoram; |
81 | 72 | private: |
82 | 73 | UINT8 m_IPLK; |
83 | 74 | UINT8 m_GMODE; |
r241485 | r241486 | |
85 | 76 | UINT8 *m_work_ram; |
86 | 77 | virtual void machine_start(); |
87 | 78 | virtual void machine_reset(); |
| 79 | required_device<z80_device> m_maincpu; |
88 | 80 | required_device<mc6847_base_device> m_vdg; |
89 | | required_device<cpu_device> m_maincpu; |
90 | | required_device<cpu_device> m_fdccpu; |
91 | | required_device<upd765a_device> m_fdc; |
92 | | required_device<i8255_device> m_pio; |
93 | | required_device<ram_device> m_ram; |
94 | 81 | required_device<cassette_image_device> m_cass; |
| 82 | required_device<ram_device> m_ram; |
| 83 | required_shared_ptr<UINT8> m_p_videoram; |
95 | 84 | required_ioport_array<10> m_io_kb; |
96 | 85 | required_ioport m_io_joy; |
97 | | |
98 | | floppy_image_device *m_fd0; |
99 | | floppy_image_device *m_fd1; |
100 | | |
101 | | emu_timer *m_timer_tc; |
102 | | |
103 | | UINT8 m_i8255_0_pc; |
104 | | UINT8 m_i8255_1_pc; |
105 | | UINT8 m_i8255_portb; |
106 | | |
107 | | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
108 | 86 | }; |
109 | 87 | |
110 | | void spc1000_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
111 | | { |
112 | | m_fdc->tc_w(false); |
113 | | } |
114 | | |
115 | 88 | static ADDRESS_MAP_START(spc1000_mem, AS_PROGRAM, 8, spc1000_state ) |
116 | 89 | ADDRESS_MAP_UNMAP_HIGH |
117 | 90 | AM_RANGE(0x0000, 0x7fff) AM_READ_BANK("bank1") AM_WRITE_BANK("bank2") |
r241485 | r241486 | |
157 | 130 | return m_GMODE; |
158 | 131 | } |
159 | 132 | |
160 | | READ8_MEMBER(spc1000_state::sd725_r) |
161 | | { |
162 | | UINT8 data = 0; |
163 | | switch (offset) |
164 | | { |
165 | | case 1: |
166 | | data = m_i8255_portb; |
167 | | break; |
168 | | case 2: |
169 | | data = m_i8255_1_pc >> 4; |
170 | | break; |
171 | | } |
172 | | return data; |
173 | | } |
174 | | |
175 | | WRITE8_MEMBER(spc1000_state::sd725_w) |
176 | | { |
177 | | switch (offset) |
178 | | { |
179 | | case 0: |
180 | | m_pio->write(space, offset+1, data); |
181 | | break; |
182 | | case 2: |
183 | | m_i8255_0_pc = data; |
184 | | break; |
185 | | } |
186 | | } |
187 | | |
188 | | READ8_MEMBER(spc1000_state::fdc_8255_c_r) |
189 | | { |
190 | | return m_i8255_0_pc >> 4; |
191 | | } |
192 | | |
193 | | WRITE8_MEMBER(spc1000_state::fdc_8255_b_w) |
194 | | { |
195 | | m_i8255_portb = data; |
196 | | } |
197 | | |
198 | | WRITE8_MEMBER(spc1000_state::fdc_8255_c_w) |
199 | | { |
200 | | m_i8255_1_pc = data; |
201 | | } |
202 | | |
203 | | //------------------------------------------------- |
204 | | // fdc interrupt |
205 | | //------------------------------------------------- |
206 | | |
207 | | READ8_MEMBER( spc1000_state::upd765_tc_r ) |
208 | | { |
209 | | logerror("%s: upd765_tc_r\n", space.machine().describe_context()); |
210 | | |
211 | | // toggle tc on read |
212 | | m_fdc->tc_w(true); |
213 | | m_timer_tc->adjust(attotime::zero); |
214 | | |
215 | | return 0xff; |
216 | | } |
217 | | |
218 | | WRITE8_MEMBER( spc1000_state::fdc_control_w ) |
219 | | { |
220 | | logerror("%s: sd725_fdc_control_w(%02x)\n", space.machine().describe_context(), data); |
221 | | |
222 | | // bit 0, motor on signal |
223 | | if (m_fd0) |
224 | | m_fd0->mon_w(!BIT(data, 0)); |
225 | | if (m_fd1) |
226 | | m_fd1->mon_w(!BIT(data, 0)); |
227 | | } |
228 | | |
229 | 133 | READ8_MEMBER( spc1000_state::keyboard_r ) |
230 | 134 | { |
231 | 135 | // most games just read kb in $8000-$8009 but a few of them |
r241485 | r241486 | |
248 | 152 | AM_RANGE(0x6000, 0x6000) AM_WRITE(cass_w) |
249 | 153 | AM_RANGE(0x8000, 0x9fff) AM_READ(keyboard_r) |
250 | 154 | AM_RANGE(0xa000, 0xa000) AM_READWRITE(iplk_r, iplk_w) |
251 | | AM_RANGE(0xc000, 0xc002) AM_READWRITE(sd725_r, sd725_w) |
252 | | // AM_RANGE(0xc000, 0xc003) AM_DEVREADWRITE("d8255_master", i8255_device, read, write) |
| 155 | AM_RANGE(0xc000, 0xdfff) AM_DEVREADWRITE("ext1", spc1000_exp_device, read, write) |
253 | 156 | ADDRESS_MAP_END |
254 | 157 | |
255 | 158 | /* Input ports */ |
r241485 | r241486 | |
385 | 288 | |
386 | 289 | void spc1000_state::machine_reset() |
387 | 290 | { |
388 | | |
389 | 291 | m_work_ram = auto_alloc_array_clear(machine(), UINT8, 0x10000); |
390 | | m_fdccpu->set_input_line_vector(0, 0); |
391 | | |
392 | | m_fd0 = machine().device<floppy_connector>("upd765:0")->get_device(); |
393 | | m_fd1 = machine().device<floppy_connector>("upd765:1")->get_device(); |
394 | | |
395 | | m_timer_tc = timer_alloc(1, NULL); |
396 | | m_timer_tc->adjust(attotime::never); |
397 | | |
398 | | // enable rom |
399 | | m_fdccpu->space(AS_PROGRAM).install_rom(0x0000, 0xfff, 0, 0x2000, memregion("rom")->base()); |
400 | | |
401 | 292 | m_IPLK = 1; |
402 | 293 | } |
403 | 294 | |
404 | 295 | READ8_MEMBER(spc1000_state::mc6847_videoram_r) |
405 | 296 | { |
406 | | if (offset == ~0) return 0xff; |
| 297 | if (offset == ~0) |
| 298 | return 0xff; |
407 | 299 | |
408 | 300 | // m_GMODE layout: CSS|NA|PS2|PS1|~A/G|GM0|GM1|NA |
409 | | if ( !BIT(m_GMODE, 3) ) |
| 301 | if (!BIT(m_GMODE, 3)) |
410 | 302 | { // text mode (~A/G set to A) |
411 | | UINT8 data = m_p_videoram[offset+m_page+0x800]; |
| 303 | UINT8 data = m_p_videoram[offset + m_page + 0x800]; |
412 | 304 | m_vdg->inv_w(BIT(data, 0)); |
413 | 305 | m_vdg->css_w(BIT(data, 1)); |
414 | 306 | m_vdg->as_w (BIT(data, 2)); |
415 | 307 | m_vdg->intext_w(BIT(data, 3)); |
416 | | return m_p_videoram[offset+m_page]; |
| 308 | return m_p_videoram[offset + m_page]; |
417 | 309 | } |
418 | 310 | else |
419 | 311 | { // graphics mode: uses full 6KB of VRAM |
r241485 | r241486 | |
437 | 329 | m_maincpu->set_input_line(0, state ? CLEAR_LINE : HOLD_LINE); |
438 | 330 | } |
439 | 331 | |
440 | | static SLOT_INTERFACE_START( sd725_floppies ) |
441 | | SLOT_INTERFACE( "sd320", EPSON_SD_320 ) |
442 | | SLOT_INTERFACE_END |
443 | | |
444 | 332 | //------------------------------------------------- |
445 | 333 | // address maps |
446 | 334 | //------------------------------------------------- |
447 | 335 | |
448 | | static ADDRESS_MAP_START( sd725_mem, AS_PROGRAM, 8, spc1000_state ) |
449 | | ADDRESS_MAP_UNMAP_HIGH |
450 | | AM_RANGE(0x0000, 0x1fff) AM_ROM |
451 | | AM_RANGE(0x2000, 0xffff) AM_RAM |
452 | | ADDRESS_MAP_END |
| 336 | extern SLOT_INTERFACE_START(spc1000_exp) |
| 337 | SLOT_INTERFACE("fdd", SPC1000_FDD_EXP) |
| 338 | SLOT_INTERFACE("vdp", SPC1000_VDP_EXP) |
| 339 | SLOT_INTERFACE_END |
453 | 340 | |
454 | | static ADDRESS_MAP_START( sd725_io, AS_IO, 8, spc1000_state ) |
455 | | ADDRESS_MAP_UNMAP_HIGH |
456 | | ADDRESS_MAP_GLOBAL_MASK(0xff) |
457 | | AM_RANGE(0xf8, 0xf8) AM_READWRITE(upd765_tc_r,fdc_control_w) // (R) Terminal Count Port (W) Motor Control Port |
458 | | AM_RANGE(0xfa, 0xfb) AM_DEVICE("upd765", upd765a_device, map ) |
459 | | AM_RANGE(0xfc, 0xff) AM_DEVREADWRITE("d8255_master", i8255_device, read, write) |
460 | | ADDRESS_MAP_END |
461 | | |
462 | 341 | static MACHINE_CONFIG_START( spc1000, spc1000_state ) |
463 | 342 | /* basic machine hardware */ |
464 | 343 | MCFG_CPU_ADD("maincpu",Z80, XTAL_4MHz) |
465 | 344 | MCFG_CPU_PROGRAM_MAP(spc1000_mem) |
466 | 345 | MCFG_CPU_IO_MAP(spc1000_io) |
467 | 346 | |
468 | | /* sub CPU(5 inch floppy drive) */ |
469 | | MCFG_CPU_ADD("fdccpu", Z80, XTAL_4MHz) /* 4 MHz */ |
470 | | MCFG_CPU_PROGRAM_MAP(sd725_mem) |
471 | | MCFG_CPU_IO_MAP(sd725_io) |
472 | | |
473 | | MCFG_DEVICE_ADD("d8255_master", I8255, 0) |
474 | | MCFG_I8255_IN_PORTA_CB(DEVREAD8("d8255_master", i8255_device, pb_r)) |
475 | | MCFG_I8255_IN_PORTB_CB(DEVREAD8("d8255_master", i8255_device, pa_r)) |
476 | | MCFG_I8255_OUT_PORTB_CB(WRITE8(spc1000_state, fdc_8255_b_w)) |
477 | | MCFG_I8255_IN_PORTC_CB(READ8(spc1000_state, fdc_8255_c_r)) |
478 | | MCFG_I8255_OUT_PORTC_CB(WRITE8(spc1000_state, fdc_8255_c_w)) |
479 | | |
480 | | // floppy disk controller |
481 | | MCFG_UPD765A_ADD("upd765", true, true) |
482 | | MCFG_UPD765_INTRQ_CALLBACK(INPUTLINE("fdccpu", INPUT_LINE_IRQ0)) |
483 | | |
484 | | // floppy drives |
485 | | MCFG_FLOPPY_DRIVE_ADD("upd765:0", sd725_floppies, "sd320", floppy_image_device::default_floppy_formats) |
486 | | MCFG_FLOPPY_DRIVE_ADD("upd765:1", sd725_floppies, "sd320", floppy_image_device::default_floppy_formats) |
487 | | //CFG_SOFTWARE_LIST_ADD("disk_list","spc1000_flop") |
488 | | |
489 | 347 | /* video hardware */ |
490 | 348 | MCFG_SCREEN_MC6847_NTSC_ADD("screen", "mc6847") |
491 | 349 | |
r241485 | r241486 | |
504 | 362 | MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") |
505 | 363 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
506 | 364 | |
507 | | MCFG_CASSETTE_ADD( "cassette" ) |
| 365 | MCFG_DEVICE_ADD("ext1", SPC1000_EXP_SLOT, 0) |
| 366 | MCFG_DEVICE_SLOT_INTERFACE(spc1000_exp, NULL, false) |
| 367 | |
| 368 | MCFG_CASSETTE_ADD("cassette") |
508 | 369 | MCFG_CASSETTE_FORMATS(spc1000_cassette_formats) |
509 | 370 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) |
510 | 371 | |
r241485 | r241486 | |
517 | 378 | |
518 | 379 | /* ROM definition */ |
519 | 380 | ROM_START( spc1000 ) |
520 | | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
521 | | ROM_LOAD( "spcall.rom", 0x0000, 0x8000, CRC(19638fc9) SHA1(489f1baa7aebf3c8c660325fb1fd790d84203284)) |
522 | | |
523 | | ROM_REGION( 0x10000, "fdccpu", 0) |
524 | | ROM_LOAD("sd725a.bin", 0x0000, 0x1000, CRC(96ac2eb8) SHA1(8e9d8f63a7fb87af417e95603e71cf537a6e83f1)) |
| 381 | ROM_REGION(0x10000, "maincpu", ROMREGION_ERASEFF) |
| 382 | ROM_LOAD("spcall.rom", 0x0000, 0x8000, CRC(19638fc9) SHA1(489f1baa7aebf3c8c660325fb1fd790d84203284)) |
525 | 383 | ROM_END |
526 | 384 | |
527 | 385 | #if 0 |
528 | 386 | ROM_START( spc1000 ) |
529 | | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
530 | | ROM_LOAD( "spcall.rom", 0x0000, 0x8000, CRC(2FBB6ECA) SHA1(cc9a076b0f00d54b2aec31f1f558b10f43ef61c8)) |
| 387 | ROM_REGION(0x10000, "maincpu", ROMREGION_ERASEFF) |
| 388 | ROM_LOAD("spcall.rom", 0x0000, 0x8000, CRC(2FBB6ECA) SHA1(cc9a076b0f00d54b2aec31f1f558b10f43ef61c8)) |
531 | 389 | /// more roms to come... |
532 | 390 | ROM_END |
533 | 391 | #endif |