src/mess/machine/beta.c
| r4777 | r4778 | |
| 12 | 12 | #include "machine/wd17xx.h" |
| 13 | 13 | #include "machine/beta.h" |
| 14 | 14 | |
| 15 | | static int betadisk_status; |
| 16 | | static int betadisk_active; |
| 17 | 15 | |
| 18 | | int betadisk_is_active(void) |
| 16 | |
| 17 | /*************************************************************************** |
| 18 | TYPE DEFINITIONS |
| 19 | ***************************************************************************/ |
| 20 | |
| 21 | typedef struct _beta_disk_state beta_disk_state; |
| 22 | struct _beta_disk_state |
| 19 | 23 | { |
| 20 | | return betadisk_active; |
| 24 | UINT8 betadisk_status; |
| 25 | UINT8 betadisk_active; |
| 26 | |
| 27 | const device_config *wd179x; |
| 28 | }; |
| 29 | |
| 30 | |
| 31 | /***************************************************************************** |
| 32 | INLINE FUNCTIONS |
| 33 | *****************************************************************************/ |
| 34 | INLINE beta_disk_state *get_safe_token(const device_config *device) |
| 35 | { |
| 36 | assert(device != NULL); |
| 37 | assert(device->token != NULL); |
| 38 | |
| 39 | return (beta_disk_state *)device->token; |
| 21 | 40 | } |
| 22 | 41 | |
| 23 | | void betadisk_enable(void) |
| 42 | |
| 43 | int betadisk_is_active(const device_config *device) |
| 24 | 44 | { |
| 25 | | betadisk_active = 1; |
| 45 | beta_disk_state *beta = get_safe_token(device); |
| 46 | |
| 47 | return beta->betadisk_active; |
| 26 | 48 | } |
| 27 | 49 | |
| 28 | | void betadisk_disable(void) |
| 50 | void betadisk_enable(const device_config *device) |
| 29 | 51 | { |
| 30 | | betadisk_active = 0; |
| 52 | beta_disk_state *beta = get_safe_token(device); |
| 53 | |
| 54 | beta->betadisk_active = 1; |
| 31 | 55 | } |
| 32 | 56 | |
| 33 | | void betadisk_clear_status(void) |
| 57 | void betadisk_disable(const device_config *device) |
| 34 | 58 | { |
| 35 | | betadisk_status = 0; |
| 59 | beta_disk_state *beta = get_safe_token(device); |
| 60 | |
| 61 | beta->betadisk_active = 0; |
| 36 | 62 | } |
| 37 | 63 | |
| 64 | void betadisk_clear_status(const device_config *device) |
| 65 | { |
| 66 | beta_disk_state *beta = get_safe_token(device); |
| 67 | |
| 68 | beta->betadisk_status = 0; |
| 69 | } |
| 70 | |
| 38 | 71 | static WD17XX_CALLBACK( betadisk_wd179x_callback ) |
| 39 | 72 | { |
| 40 | | switch (state) |
| 41 | | { |
| 42 | | case WD17XX_DRQ_SET: |
| 73 | const device_config *wd_device = devtag_get_device(device->machine, BETA_DISK_TAG); |
| 74 | beta_disk_state *beta = get_safe_token(wd_device); |
| 75 | if (wd_device->started) { |
| 76 | switch (state) |
| 43 | 77 | { |
| 44 | | betadisk_status |= (1<<6); |
| 78 | case WD17XX_DRQ_SET: |
| 79 | { |
| 80 | beta->betadisk_status |= (1<<6); |
| 81 | } |
| 82 | break; |
| 83 | |
| 84 | case WD17XX_DRQ_CLR: |
| 85 | { |
| 86 | beta->betadisk_status &=~(1<<6); |
| 87 | } |
| 88 | break; |
| 89 | |
| 90 | case WD17XX_IRQ_SET: |
| 91 | { |
| 92 | beta->betadisk_status |= (1<<7); |
| 93 | } |
| 94 | break; |
| 95 | |
| 96 | case WD17XX_IRQ_CLR: |
| 97 | { |
| 98 | beta->betadisk_status &=~(1<<7); |
| 99 | } |
| 100 | break; |
| 45 | 101 | } |
| 46 | | break; |
| 47 | | |
| 48 | | case WD17XX_DRQ_CLR: |
| 49 | | { |
| 50 | | betadisk_status &=~(1<<6); |
| 51 | | } |
| 52 | | break; |
| 53 | | |
| 54 | | case WD17XX_IRQ_SET: |
| 55 | | { |
| 56 | | betadisk_status |= (1<<7); |
| 57 | | } |
| 58 | | break; |
| 59 | | |
| 60 | | case WD17XX_IRQ_CLR: |
| 61 | | { |
| 62 | | betadisk_status &=~(1<<7); |
| 63 | | } |
| 64 | | break; |
| 65 | 102 | } |
| 66 | 103 | } |
| 67 | 104 | |
| 68 | 105 | const wd17xx_interface beta_wd17xx_interface = { betadisk_wd179x_callback, NULL }; |
| 69 | 106 | |
| 70 | | READ8_HANDLER(betadisk_status_r) |
| 107 | READ8_DEVICE_HANDLER(betadisk_status_r) |
| 71 | 108 | { |
| 72 | | if (betadisk_active==1) { |
| 73 | | return wd17xx_status_r((device_config*)devtag_get_device(space->machine, "wd179x"), offset); |
| 109 | beta_disk_state *beta = get_safe_token(device); |
| 110 | |
| 111 | if (beta->betadisk_active==1) { |
| 112 | return wd17xx_status_r(beta->wd179x, offset); |
| 74 | 113 | } else { |
| 75 | 114 | return 0xff; |
| 76 | 115 | } |
| 77 | 116 | } |
| 78 | 117 | |
| 79 | | READ8_HANDLER(betadisk_track_r) |
| 118 | READ8_DEVICE_HANDLER(betadisk_track_r) |
| 80 | 119 | { |
| 81 | | if (betadisk_active==1) { |
| 82 | | return wd17xx_track_r((device_config*)devtag_get_device(space->machine, "wd179x"), offset); |
| 120 | beta_disk_state *beta = get_safe_token(device); |
| 121 | |
| 122 | if (beta->betadisk_active==1) { |
| 123 | return wd17xx_track_r(beta->wd179x, offset); |
| 83 | 124 | } else { |
| 84 | 125 | return 0xff; |
| 85 | 126 | } |
| 86 | 127 | } |
| 87 | 128 | |
| 88 | | READ8_HANDLER(betadisk_sector_r) |
| 129 | READ8_DEVICE_HANDLER(betadisk_sector_r) |
| 89 | 130 | { |
| 90 | | if (betadisk_active==1) { |
| 91 | | return wd17xx_sector_r((device_config*)devtag_get_device(space->machine, "wd179x"), offset); |
| 131 | beta_disk_state *beta = get_safe_token(device); |
| 132 | |
| 133 | if (beta->betadisk_active==1) { |
| 134 | return wd17xx_sector_r(beta->wd179x, offset); |
| 92 | 135 | } else { |
| 93 | 136 | return 0xff; |
| 94 | 137 | } |
| 95 | 138 | } |
| 96 | 139 | |
| 97 | | READ8_HANDLER(betadisk_data_r) |
| 140 | READ8_DEVICE_HANDLER(betadisk_data_r) |
| 98 | 141 | { |
| 99 | | if (betadisk_active==1) { |
| 100 | | return wd17xx_data_r((device_config*)devtag_get_device(space->machine, "wd179x"), offset); |
| 142 | |
| 143 | beta_disk_state *beta = get_safe_token(device); |
| 144 | |
| 145 | if (beta->betadisk_active==1) { |
| 146 | return wd17xx_data_r(beta->wd179x, offset); |
| 101 | 147 | } else { |
| 102 | 148 | return 0xff; |
| 103 | 149 | } |
| 104 | 150 | } |
| 105 | 151 | |
| 106 | | READ8_HANDLER(betadisk_state_r) |
| 152 | READ8_DEVICE_HANDLER(betadisk_state_r) |
| 107 | 153 | { |
| 108 | | if (betadisk_active==1) { |
| 109 | | return betadisk_status; |
| 154 | beta_disk_state *beta = get_safe_token(device); |
| 155 | |
| 156 | if (beta->betadisk_active==1) { |
| 157 | return beta->betadisk_status; |
| 110 | 158 | } else { |
| 111 | 159 | return 0xff; |
| 112 | 160 | } |
| 113 | 161 | } |
| 114 | 162 | |
| 115 | | WRITE8_HANDLER(betadisk_param_w) |
| 163 | WRITE8_DEVICE_HANDLER(betadisk_param_w) |
| 116 | 164 | { |
| 117 | | const device_config *fdc = devtag_get_device(space->machine, "wd179x"); |
| 118 | | if (betadisk_active==1) { |
| 119 | | wd17xx_set_drive(fdc, data & 3); |
| 120 | | wd17xx_set_side (fdc,(data & 0x10) ? 0 : 1 ); |
| 121 | | wd17xx_set_density(fdc, data & 0x20 ? DEN_MFM_HI : DEN_FM_LO ); |
| 165 | beta_disk_state *beta = get_safe_token(device); |
| 166 | |
| 167 | if (beta->betadisk_active==1) { |
| 168 | wd17xx_set_drive(beta->wd179x, data & 3); |
| 169 | wd17xx_set_side (beta->wd179x,(data & 0x10) ? 0 : 1 ); |
| 170 | wd17xx_set_density(beta->wd179x, data & 0x20 ? DEN_MFM_HI : DEN_FM_LO ); |
| 122 | 171 | if ((data & 0x04) == 0) // reset |
| 123 | 172 | { |
| 124 | | wd17xx_reset(fdc); |
| 173 | wd17xx_reset(beta->wd179x); |
| 125 | 174 | } |
| 126 | | betadisk_status = (data & 0x3f) | betadisk_status; |
| 175 | beta->betadisk_status = (data & 0x3f) | beta->betadisk_status; |
| 127 | 176 | } |
| 128 | 177 | } |
| 129 | 178 | |
| 130 | | WRITE8_HANDLER(betadisk_command_w) |
| 179 | WRITE8_DEVICE_HANDLER(betadisk_command_w) |
| 131 | 180 | { |
| 132 | | if (betadisk_active==1) { |
| 133 | | wd17xx_command_w((device_config*)devtag_get_device(space->machine, "wd179x"), offset, data); |
| 181 | beta_disk_state *beta = get_safe_token(device); |
| 182 | |
| 183 | if (beta->betadisk_active==1) { |
| 184 | wd17xx_command_w(beta->wd179x, offset, data); |
| 134 | 185 | } |
| 135 | 186 | } |
| 136 | 187 | |
| 137 | | WRITE8_HANDLER(betadisk_track_w) |
| 188 | WRITE8_DEVICE_HANDLER(betadisk_track_w) |
| 138 | 189 | { |
| 139 | | if (betadisk_active==1) { |
| 140 | | wd17xx_track_w((device_config*)devtag_get_device(space->machine, "wd179x"), offset, data); |
| 190 | beta_disk_state *beta = get_safe_token(device); |
| 191 | |
| 192 | if (beta->betadisk_active==1) { |
| 193 | wd17xx_track_w(beta->wd179x, offset, data); |
| 141 | 194 | } |
| 142 | 195 | } |
| 143 | 196 | |
| 144 | | WRITE8_HANDLER(betadisk_sector_w) |
| 197 | WRITE8_DEVICE_HANDLER(betadisk_sector_w) |
| 145 | 198 | { |
| 146 | | if (betadisk_active==1) { |
| 147 | | wd17xx_sector_w((device_config*)devtag_get_device(space->machine, "wd179x"), offset, data); |
| 199 | beta_disk_state *beta = get_safe_token(device); |
| 200 | |
| 201 | if (beta->betadisk_active==1) { |
| 202 | wd17xx_sector_w(beta->wd179x, offset, data); |
| 148 | 203 | } |
| 149 | 204 | } |
| 150 | 205 | |
| 151 | | WRITE8_HANDLER(betadisk_data_w) |
| 152 | | { |
| 153 | | if (betadisk_active==1) { |
| 154 | | wd17xx_data_w((device_config*)devtag_get_device(space->machine, "wd179x"), offset, data); |
| 206 | WRITE8_DEVICE_HANDLER(betadisk_data_w) |
| 207 | { |
| 208 | beta_disk_state *beta = get_safe_token(device); |
| 209 | |
| 210 | if (beta->betadisk_active==1) { |
| 211 | wd17xx_data_w(beta->wd179x, offset, data); |
| 155 | 212 | } |
| 156 | 213 | } |
| 157 | 214 | |
| r4777 | r4778 | |
| 198 | 255 | default: legacybasicdsk_device_getinfo(devclass, state, info); break; |
| 199 | 256 | } |
| 200 | 257 | } |
| 258 | |
| 259 | static MACHINE_DRIVER_START( beta_disk ) |
| 260 | MDRV_WD179X_ADD("wd179x", beta_wd17xx_interface ) |
| 261 | MACHINE_DRIVER_END |
| 262 | |
| 263 | ROM_START( beta_disk ) |
| 264 | ROM_REGION( 0x4000, "beta", ROMREGION_LOADBYNAME ) |
| 265 | //ROM_LOAD( "trd501.rom", 0x0000, 0x4000, CRC(3e3cdd4c) ) |
| 266 | ROM_LOAD( "trd503.rom", 0x0000, 0x4000, CRC(10751aba) SHA1(21695e3f2a8f796386ce66eea8a246b0ac44810c)) |
| 267 | /* ROM_LOAD( "trd504.rom", 0x0000, 0x4000, CRC(ba310874) ) |
| 268 | ROM_LOAD( "trd504em.rom", 0x0000, 0x4000, CRC(0d3f8b43) ) |
| 269 | ROM_LOAD( "trd504f.rom", 0x0000, 0x4000, CRC(ab3100d8) ) |
| 270 | ROM_LOAD( "trd504s.rom", 0x0000, 0x4000, CRC(522ebbd6) ) |
| 271 | ROM_LOAD( "trd504t.rom", 0x0000, 0x4000, CRC(e212d1e0) ) |
| 272 | ROM_LOAD( "trd504tm.rom", 0x0000, 0x4000, CRC(2334b8c6) ) |
| 273 | ROM_LOAD( "trd505.rom", 0x0000, 0x4000, CRC(fdff3810) ) |
| 274 | ROM_LOAD( "trd505d.rom", 0x0000, 0x4000, CRC(31e4be08) ) |
| 275 | ROM_LOAD( "trd505h.rom", 0x0000, 0x4000, CRC(9ba15549) ) |
| 276 | ROM_LOAD( "trd512.rom", 0x0000, 0x4000, CRC(b615d6c4) ) |
| 277 | ROM_LOAD( "trd512f.rom", 0x0000, 0x4000, CRC(edb74f8c) ) |
| 278 | ROM_LOAD( "trd513f.rom", 0x0000, 0x4000, CRC(6b1c17f3) ) |
| 279 | ROM_LOAD( "trd513fm.rom", 0x0000, 0x4000, CRC(bad0c0a0) ) |
| 280 | ROM_LOAD( "trd56661.rom", 0x0000, 0x4000, CRC(8528c789) ) |
| 281 | ROM_LOAD( "trd604.rom", 0x0000, 0x4000, CRC(d8882a8c) ) |
| 282 | ROM_LOAD( "trd605e.rom", 0x0000, 0x4000, CRC(56d3c2db) ) |
| 283 | ROM_LOAD( "trd605r.rom", 0x0000, 0x4000, CRC(f8816a47) ) |
| 284 | ROM_LOAD( "trd607m.rom", 0x0000, 0x4000, CRC(5a062f03) ) |
| 285 | ROM_LOAD( "trd608.rom", 0x0000, 0x4000, CRC(5c998d53) ) |
| 286 | ROM_LOAD( "trd609.rom", 0x0000, 0x4000, CRC(91028924) ) |
| 287 | ROM_LOAD( "trd610e.rom", 0x0000, 0x4000, CRC(95395ca4) ) */ |
| 288 | ROM_END |
| 289 | |
| 290 | |
| 291 | /*------------------------------------------------- |
| 292 | DEVICE_START( beta_disk ) |
| 293 | -------------------------------------------------*/ |
| 294 | |
| 295 | static DEVICE_START( beta_disk ) |
| 296 | { |
| 297 | beta_disk_state *beta = get_safe_token(device); |
| 298 | astring *tempstring = astring_alloc(); |
| 299 | |
| 300 | /* validate arguments */ |
| 301 | assert(device->tag != NULL); |
| 302 | |
| 303 | /* find our WD179x */ |
| 304 | astring_printf(tempstring, "%s:%s", device->tag, "wd179x"); |
| 305 | beta->wd179x = devtag_get_device(device->machine, astring_c(tempstring)); |
| 306 | |
| 307 | astring_free(tempstring); |
| 308 | } |
| 309 | |
| 310 | /*------------------------------------------------- |
| 311 | DEVICE_RESET( beta_disk ) |
| 312 | -------------------------------------------------*/ |
| 313 | |
| 314 | static DEVICE_RESET( beta_disk ) |
| 315 | { |
| 316 | } |
| 317 | |
| 318 | /*------------------------------------------------- |
| 319 | DEVICE_GET_INFO( beta_disk ) |
| 320 | -------------------------------------------------*/ |
| 321 | |
| 322 | DEVICE_GET_INFO( beta_disk ) |
| 323 | { |
| 324 | switch (state) |
| 325 | { |
| 326 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 327 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; |
| 328 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(beta_disk_state); break; |
| 329 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 330 | |
| 331 | /* --- the following bits of info are returned as pointers --- */ |
| 332 | case DEVINFO_PTR_ROM_REGION: info->romregion = ROM_NAME(beta_disk); break; |
| 333 | case DEVINFO_PTR_MACHINE_CONFIG: info->machine_config = MACHINE_DRIVER_NAME(beta_disk); break; |
| 334 | |
| 335 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 336 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(beta_disk); break; |
| 337 | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 338 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(beta_disk); break; |
| 339 | |
| 340 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 341 | case DEVINFO_STR_NAME: strcpy(info->s, "Beta Disk Interface"); break; |
| 342 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Beta Disk Interface"); break; |
| 343 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 344 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 345 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; |
| 346 | } |
| 347 | } |
src/mess/drivers/homelab.c
| r4777 | r4778 | |
| 150 | 150 | static MACHINE_DRIVER_START( homelab3 ) |
| 151 | 151 | /* basic machine hardware */ |
| 152 | 152 | MDRV_IMPORT_FROM(homelab) |
| 153 | | MDRV_CPU_MODIFY("maincpu") |
| 153 | MDRV_CPU_MODIFY("maincpu") |
| 154 | 154 | MDRV_CPU_PROGRAM_MAP(homelab3_mem) |
| 155 | 155 | |
| 156 | 156 | MDRV_SCREEN_MODIFY("screen") |
| r4777 | r4778 | |
| 168 | 168 | ROM_LOAD( "hl2_2.rom", 0x0800, 0x0800, CRC(696AF3C1) SHA1(b53bc6ae2b75975618fc90e7181fa5d21409fce1)) |
| 169 | 169 | ROM_LOAD( "hl2_3.rom", 0x1000, 0x0800, CRC(69E57E8C) SHA1(e98510abb715dbf513e1b29fb6b09ab54e9483b7)) |
| 170 | 170 | ROM_LOAD( "hl2_4.rom", 0x1800, 0x0800, CRC(97CBBE74) SHA1(34f0bad41302b059322018abc3d1c2336ecfbea8)) |
| 171 | | ROM_REGION(0x0800, "gfx1",0) |
| 172 | | ROM_LOAD ("hl2.chr", 0x0000, 0x0800, CRC(2E669D40) SHA1(639dd82ed29985dc69830aca3b904b6acc8fe54a)) |
| 171 | ROM_REGION(0x0800, "gfx1",0) |
| 172 | ROM_LOAD ("hl2.chr", 0x0000, 0x0800, CRC(2E669D40) SHA1(639dd82ed29985dc69830aca3b904b6acc8fe54a)) |
| 173 | 173 | ROM_END |
| 174 | 174 | |
| 175 | 175 | ROM_START( homelab3 ) |
| r4777 | r4778 | |
| 178 | 178 | ROM_LOAD( "hl3_2.rom", 0x1000, 0x1000, CRC(BCAC3C24) SHA1(aff371d17f61cb60c464998e092f04d5d85c4d52)) |
| 179 | 179 | ROM_LOAD( "hl3_3.rom", 0x2000, 0x1000, CRC(AB1B4AB0) SHA1(ad74c7793f5dc22061a88ef31d3407267ad08719)) |
| 180 | 180 | ROM_LOAD( "hl3_4.rom", 0x3000, 0x1000, CRC(BF67EFF9) SHA1(2ef5d46f359616e7d0e5a124df528de44f0e850b)) |
| 181 | | ROM_REGION(0x0800, "gfx1",0) |
| 182 | | ROM_LOAD ("hl3.chr", 0x0000, 0x0800, CRC(F58EE39B) SHA1(49399c42d60a11b218a225856da86a9f3975a78a)) |
| 181 | ROM_REGION(0x0800, "gfx1",0) |
| 182 | ROM_LOAD ("hl3.chr", 0x0000, 0x0800, CRC(F58EE39B) SHA1(49399c42d60a11b218a225856da86a9f3975a78a)) |
| 183 | 183 | ROM_END |
| 184 | 184 | |
| 185 | 185 | ROM_START( homelab4 ) |
| r4777 | r4778 | |
| 188 | 188 | ROM_LOAD( "hl4_2.rom", 0x1000, 0x1000, CRC(151D33E8) SHA1(d32004bc1553f802b9d3266709552f7d5315fe44)) |
| 189 | 189 | ROM_LOAD( "hl4_3.rom", 0x2000, 0x1000, CRC(39571AB1) SHA1(8470cff2e3442101e6a0bc655358b3a6fc1ef944)) |
| 190 | 190 | ROM_LOAD( "hl4_4.rom", 0x3000, 0x1000, CRC(F4B77CA2) SHA1(ffbdb3c1819c7357e2a0fc6317c111a8a7ecfcd5)) |
| 191 | | ROM_REGION(0x0800, "gfx1",0) |
| 192 | | ROM_LOAD ("hl4.chr", 0x0000, 0x0800, CRC(F58EE39B) SHA1(49399c42d60a11b218a225856da86a9f3975a78a)) |
| 191 | ROM_REGION(0x0800, "gfx1",0) |
| 192 | ROM_LOAD ("hl4.chr", 0x0000, 0x0800, CRC(F58EE39B) SHA1(49399c42d60a11b218a225856da86a9f3975a78a)) |
| 193 | 193 | ROM_END |
| 194 | 194 | |
| 195 | ROM_START( brailab4 ) |
| 196 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 197 | ROM_LOAD( "brl1.rom", 0x0000, 0x1000, CRC(02323403) SHA1(3a2e853e0a39e05a04a8db58e1a76de1eda579c9)) |
| 198 | ROM_LOAD( "brl2.rom", 0x1000, 0x1000, CRC(36173fbc) SHA1(1c01398e16a1cbe4103e1be769347ceae873e090)) |
| 199 | ROM_LOAD( "brl3.rom", 0x2000, 0x1000, CRC(d3cdd108) SHA1(1a24e6c5f9c370ff6cb25045cb9d95e664467eb5)) |
| 200 | ROM_LOAD( "brl4.rom", 0x3000, 0x1000, CRC(d4047885) SHA1(00fe40c4c2c64a49bb429fb2b27cc7e0d0025a85)) |
| 201 | ROM_LOAD( "brl5.rom", 0x4000, 0x1000, CRC(8a76be04) SHA1(4b683b9be23b47117901fe874072eb7aa481e4ff)) |
| 202 | ROM_REGION(0x0800, "gfx1",0) |
| 203 | ROM_LOAD ("hl4.chr", 0x0000, 0x0800, CRC(F58EE39B) SHA1(49399c42d60a11b218a225856da86a9f3975a78a)) |
| 204 | ROM_END |
| 205 | |
| 195 | 206 | /* Driver */ |
| 196 | 207 | |
| 197 | 208 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 198 | | COMP( 1982, homelab2, 0 ,0, homelab, homelab, homelab, NULL, "", "Homelab 2 / Aircomp 16", GAME_NOT_WORKING) |
| 199 | | COMP( 1983, homelab3, homelab2,0, homelab3, homelab, homelab, NULL, "", "Homelab 3", GAME_NOT_WORKING) |
| 200 | | COMP( 1984, homelab4, homelab2,0, homelab3, homelab, homelab, NULL, "", "Homelab 4", GAME_NOT_WORKING) |
| 209 | COMP( 1982, homelab2, 0 , 0, homelab, homelab, homelab, NULL, "Jozsef and Endre Lukacs", "Homelab 2 / Aircomp 16", GAME_NOT_WORKING) |
| 210 | COMP( 1983, homelab3, homelab2,0, homelab3, homelab, homelab, NULL, "Jozsef and Endre Lukacs", "Homelab 3", GAME_NOT_WORKING) |
| 211 | COMP( 1984, homelab4, homelab2,0, homelab3, homelab, homelab, NULL, "Jozsef and Endre Lukacs", "Homelab 4", GAME_NOT_WORKING) |
| 212 | COMP( 1984, brailab4, homelab2,0, homelab3, homelab, homelab, NULL, "Jozsef and Endre Lukacs", "Brailab 4", GAME_NOT_WORKING) |
src/mess/drivers/pentagon.c
| r4777 | r4778 | |
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | static int ROMSelection; |
| 16 | static device_config* beta; |
| 16 | 17 | |
| 17 | 18 | static DIRECT_UPDATE_HANDLER( pentagon_direct ) |
| 18 | 19 | { |
| 19 | 20 | UINT16 pc = cpu_get_reg(cputag_get_cpu(space->machine, "maincpu"), REG_GENPCBASE); |
| 20 | | if (betadisk_is_active()) |
| 21 | |
| 22 | if (beta->started && betadisk_is_active(beta)) |
| 21 | 23 | { |
| 22 | 24 | if (pc >= 0x4000) |
| 23 | 25 | { |
| 24 | 26 | ROMSelection = ((spectrum_128_port_7ffd_data>>4) & 0x01) ? 1 : 0; |
| 25 | | betadisk_disable(); |
| 27 | betadisk_disable(beta); |
| 26 | 28 | memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); |
| 27 | 29 | memory_set_bankptr(space->machine, 1, memory_region(space->machine, "maincpu") + 0x010000 + (ROMSelection<<14)); |
| 28 | 30 | } |
| 29 | 31 | } else if (((pc & 0xff00) == 0x3d00) && (ROMSelection==1)) |
| 30 | 32 | { |
| 31 | 33 | ROMSelection = 3; |
| 32 | | betadisk_enable(); |
| 34 | if (beta->started) |
| 35 | betadisk_enable(beta); |
| 33 | 36 | |
| 34 | 37 | } |
| 35 | 38 | if((address>=0x0000) && (address<=0x3fff)) |
| 36 | | { |
| 39 | { |
| 37 | 40 | memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); |
| 38 | | direct->raw = direct->decrypted = memory_region(space->machine, "maincpu") + 0x010000 + (ROMSelection<<14); |
| 41 | if (ROMSelection == 3) { |
| 42 | if (beta->started) |
| 43 | direct->raw = direct->decrypted = memory_region(space->machine, "beta:beta"); |
| 44 | } else { |
| 45 | direct->raw = direct->decrypted = memory_region(space->machine, "maincpu") + 0x010000 + (ROMSelection<<14); |
| 46 | } |
| 39 | 47 | memory_set_bankptr(space->machine, 1, direct->raw); |
| 40 | 48 | return ~0; |
| 41 | 49 | } |
| r4777 | r4778 | |
| 48 | 56 | |
| 49 | 57 | memory_set_bankptr(machine, 4, mess_ram + ((spectrum_128_port_7ffd_data & 0x07) * 0x4000)); |
| 50 | 58 | |
| 51 | | if( betadisk_is_active() && !( spectrum_128_port_7ffd_data & 0x10 ) ) |
| 59 | if (beta->started && betadisk_is_active(beta) && !( spectrum_128_port_7ffd_data & 0x10 ) ) |
| 52 | 60 | { |
| 53 | 61 | /* GLUK */ |
| 54 | 62 | ROMSelection = 2; |
| 55 | 63 | } |
| 56 | | else |
| 57 | | { |
| 64 | else { |
| 58 | 65 | /* ROM switching */ |
| 59 | 66 | ROMSelection = ((spectrum_128_port_7ffd_data>>4) & 0x01) ; |
| 60 | 67 | } |
| r4777 | r4778 | |
| 77 | 84 | |
| 78 | 85 | static ADDRESS_MAP_START (pentagon_io, ADDRESS_SPACE_IO, 8) |
| 79 | 86 | ADDRESS_MAP_UNMAP_HIGH |
| 80 | | AM_RANGE(0x001f, 0x001f) AM_READWRITE(betadisk_status_r,betadisk_command_w) AM_MIRROR(0xff00) |
| 81 | | AM_RANGE(0x003f, 0x003f) AM_READWRITE(betadisk_track_r,betadisk_track_w) AM_MIRROR(0xff00) |
| 82 | | AM_RANGE(0x005f, 0x005f) AM_READWRITE(betadisk_sector_r,betadisk_sector_w) AM_MIRROR(0xff00) |
| 83 | | AM_RANGE(0x007f, 0x007f) AM_READWRITE(betadisk_data_r,betadisk_data_w) AM_MIRROR(0xff00) |
| 87 | AM_RANGE(0x001f, 0x001f) AM_DEVREADWRITE(BETA_DISK_TAG, betadisk_status_r,betadisk_command_w) AM_MIRROR(0xff00) |
| 88 | AM_RANGE(0x003f, 0x003f) AM_DEVREADWRITE(BETA_DISK_TAG, betadisk_track_r,betadisk_track_w) AM_MIRROR(0xff00) |
| 89 | AM_RANGE(0x005f, 0x005f) AM_DEVREADWRITE(BETA_DISK_TAG, betadisk_sector_r,betadisk_sector_w) AM_MIRROR(0xff00) |
| 90 | AM_RANGE(0x007f, 0x007f) AM_DEVREADWRITE(BETA_DISK_TAG, betadisk_data_r,betadisk_data_w) AM_MIRROR(0xff00) |
| 84 | 91 | AM_RANGE(0x00fe, 0x00fe) AM_READWRITE(spectrum_port_fe_r,spectrum_port_fe_w) AM_MIRROR(0xff00) AM_MASK(0xffff) |
| 85 | | AM_RANGE(0x00ff, 0x00ff) AM_READWRITE(betadisk_state_r, betadisk_param_w) AM_MIRROR(0xff00) |
| 92 | AM_RANGE(0x00ff, 0x00ff) AM_DEVREADWRITE(BETA_DISK_TAG, betadisk_state_r, betadisk_param_w) AM_MIRROR(0xff00) |
| 86 | 93 | AM_RANGE(0x4000, 0x4000) AM_WRITE(pentagon_port_7ffd_w) AM_MIRROR(0x3ffd) |
| 87 | 94 | AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("ay8912", ay8910_data_w) AM_MIRROR(0x3ffd) |
| 88 | 95 | AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE("ay8912", ay8910_r, ay8910_address_w) AM_MIRROR(0x3ffd) |
| r4777 | r4778 | |
| 91 | 98 | static MACHINE_RESET( pentagon ) |
| 92 | 99 | { |
| 93 | 100 | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 94 | | |
| 101 | beta = (device_config*)devtag_get_device(machine, BETA_DISK_TAG); |
| 102 | |
| 95 | 103 | memory_install_read8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_BANK(1)); |
| 96 | 104 | memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); |
| 97 | 105 | |
| 98 | | betadisk_enable(); |
| 99 | | betadisk_clear_status(); |
| 106 | if (beta->started) { |
| 107 | betadisk_enable(beta); |
| 108 | betadisk_clear_status(beta); |
| 109 | } |
| 100 | 110 | |
| 101 | 111 | memory_set_direct_update_handler( space, pentagon_direct ); |
| 102 | 112 | |
| r4777 | r4778 | |
| 119 | 129 | MDRV_CPU_IO_MAP(pentagon_io) |
| 120 | 130 | MDRV_MACHINE_RESET( pentagon ) |
| 121 | 131 | |
| 122 | | MDRV_WD179X_ADD("wd179x", beta_wd17xx_interface ) |
| 132 | MDRV_BETA_DISK_ADD(BETA_DISK_TAG) |
| 123 | 133 | MACHINE_DRIVER_END |
| 124 | 134 | |
| 125 | 135 | |
| r4777 | r4778 | |
| 131 | 141 | ***************************************************************************/ |
| 132 | 142 | |
| 133 | 143 | ROM_START(pentagon) |
| 134 | | ROM_REGION(0x020000, "maincpu", 0) |
| 144 | ROM_REGION(0x01c000, "maincpu", 0) |
| 135 | 145 | ROM_LOAD("128p-0.rom", 0x010000, 0x4000, CRC(124ad9e0) SHA1(d07fcdeca892ee80494d286ea9ea5bf3928a1aca) ) |
| 136 | 146 | ROM_LOAD("128p-1.rom", 0x014000, 0x4000, CRC(b96a36be) SHA1(80080644289ed93d71a1103992a154cc9802b2fa) ) |
| 137 | 147 | ROM_LOAD("gluck.rom", 0x018000, 0x4000, CRC(ca321d79) SHA1(015eb96dafb273d4f4512c467e9b43c305fd1bc4) ) |
| 138 | | ROM_LOAD("trdos.rom", 0x01c000, 0x4000, CRC(10751aba) SHA1(21695e3f2a8f796386ce66eea8a246b0ac44810c) ) |
| 139 | 148 | ROM_CART_LOAD("cart", 0x0000, 0x4000, ROM_NOCLEAR | ROM_NOMIRROR | ROM_OPTIONAL) |
| 140 | 149 | ROM_END |
| 141 | 150 | |
src/mess/drivers/scorpion.c
| r4777 | r4778 | |
| 189 | 189 | |
| 190 | 190 | static int ROMSelection; |
| 191 | 191 | |
| 192 | static device_config* beta; |
| 193 | |
| 192 | 194 | //static UINT8 *rom_pointer; |
| 193 | 195 | |
| 194 | 196 | static void scorpion_update_memory(running_machine *machine) |
| r4777 | r4778 | |
| 224 | 226 | static DIRECT_UPDATE_HANDLER( scorpion_direct ) |
| 225 | 227 | { |
| 226 | 228 | UINT16 pc = cpu_get_reg(cputag_get_cpu(space->machine, "maincpu"), REG_GENPCBASE); |
| 227 | | if (betadisk_is_active()) |
| 229 | if (betadisk_is_active(beta)) |
| 228 | 230 | { |
| 229 | 231 | if (pc >= 0x4000) |
| 230 | 232 | { |
| 231 | 233 | ROMSelection = ((spectrum_128_port_7ffd_data>>4) & 0x01) ? 1 : 0; |
| 232 | | betadisk_disable(); |
| 234 | betadisk_disable(beta); |
| 233 | 235 | memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); |
| 234 | 236 | memory_set_bankptr(space->machine, 1, memory_region(space->machine, "maincpu") + 0x010000 + (ROMSelection<<14)); |
| 235 | 237 | } |
| 236 | 238 | } else if (((pc & 0xff00) == 0x3d00) && (ROMSelection==1)) |
| 237 | 239 | { |
| 238 | 240 | ROMSelection = 3; |
| 239 | | betadisk_enable(); |
| 241 | betadisk_enable(beta); |
| 240 | 242 | |
| 241 | 243 | } |
| 242 | 244 | if((address>=0x0000) && (address<=0x3fff)) |
| 243 | 245 | { |
| 244 | | memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); |
| 246 | memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); |
| 245 | 247 | direct->raw = direct->decrypted = memory_region(space->machine, "maincpu") + 0x010000 + (ROMSelection<<14); |
| 246 | 248 | memory_set_bankptr(space->machine, 1, direct->raw); |
| 247 | 249 | return ~0; |
| r4777 | r4778 | |
| 284 | 286 | |
| 285 | 287 | static ADDRESS_MAP_START (scorpion_io, ADDRESS_SPACE_IO, 8) |
| 286 | 288 | ADDRESS_MAP_UNMAP_HIGH |
| 287 | | AM_RANGE(0x001f, 0x001f) AM_READWRITE(betadisk_status_r,betadisk_command_w) AM_MIRROR(0xff00) |
| 288 | | AM_RANGE(0x003f, 0x003f) AM_READWRITE(betadisk_track_r,betadisk_track_w) AM_MIRROR(0xff00) |
| 289 | | AM_RANGE(0x005f, 0x005f) AM_READWRITE(betadisk_sector_r,betadisk_sector_w) AM_MIRROR(0xff00) |
| 290 | | AM_RANGE(0x007f, 0x007f) AM_READWRITE(betadisk_data_r,betadisk_data_w) AM_MIRROR(0xff00) |
| 289 | AM_RANGE(0x001f, 0x001f) AM_DEVREADWRITE(BETA_DISK_TAG, betadisk_status_r,betadisk_command_w) AM_MIRROR(0xff00) |
| 290 | AM_RANGE(0x003f, 0x003f) AM_DEVREADWRITE(BETA_DISK_TAG, betadisk_track_r,betadisk_track_w) AM_MIRROR(0xff00) |
| 291 | AM_RANGE(0x005f, 0x005f) AM_DEVREADWRITE(BETA_DISK_TAG, betadisk_sector_r,betadisk_sector_w) AM_MIRROR(0xff00) |
| 292 | AM_RANGE(0x007f, 0x007f) AM_DEVREADWRITE(BETA_DISK_TAG, betadisk_data_r,betadisk_data_w) AM_MIRROR(0xff00) |
| 291 | 293 | AM_RANGE(0x00fe, 0x00fe) AM_READWRITE(spectrum_port_fe_r,spectrum_port_fe_w) AM_MIRROR(0xff00) AM_MASK(0xffff) |
| 292 | | AM_RANGE(0x00ff, 0x00ff) AM_READWRITE(betadisk_state_r, betadisk_param_w) AM_MIRROR(0xff00) |
| 294 | AM_RANGE(0x00ff, 0x00ff) AM_DEVREADWRITE(BETA_DISK_TAG, betadisk_state_r, betadisk_param_w) AM_MIRROR(0xff00) |
| 293 | 295 | AM_RANGE(0x4000, 0x4000) AM_WRITE(scorpion_port_7ffd_w) AM_MIRROR(0x3ffd) |
| 294 | 296 | AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("ay8912", ay8910_data_w) AM_MIRROR(0x3ffd) |
| 295 | 297 | AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE("ay8912", ay8910_r, ay8910_address_w) AM_MIRROR(0x3ffd) |
| r4777 | r4778 | |
| 299 | 301 | |
| 300 | 302 | static MACHINE_RESET( scorpion ) |
| 301 | 303 | { |
| 302 | | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 304 | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 305 | beta = (device_config*)devtag_get_device(machine, BETA_DISK_TAG); |
| 303 | 306 | |
| 304 | 307 | memory_install_read8_handler (space, 0x0000, 0x3fff, 0, 0, SMH_BANK(1)); |
| 305 | 308 | |
| 306 | | betadisk_disable(); |
| 307 | | betadisk_clear_status(); |
| 309 | betadisk_disable(beta); |
| 310 | betadisk_clear_status(beta); |
| 308 | 311 | |
| 309 | 312 | memory_set_direct_update_handler(space, scorpion_direct ); |
| 310 | 313 | |
| r4777 | r4778 | |
| 330 | 333 | MDRV_CPU_IO_MAP(scorpion_io) |
| 331 | 334 | MDRV_MACHINE_RESET( scorpion ) |
| 332 | 335 | |
| 333 | | MDRV_WD179X_ADD("wd179x", beta_wd17xx_interface ) |
| 336 | MDRV_BETA_DISK_ADD(BETA_DISK_TAG) |
| 334 | 337 | MACHINE_DRIVER_END |
| 335 | 338 | |
| 336 | 339 | |