src/mess/video/cdp1862.c
| r0 | r3285 | |
| 1 | /*
|
| 2 | |
| 3 | TODO:
|
| 4 | |
| 5 | - NTSC output, currently using RGB
|
| 6 | |
| 7 | */
|
| 8 | |
| 9 | #include "driver.h"
|
| 10 | #include "cdp1862.h"
|
| 11 | |
| 12 | typedef struct _cdp1862_t cdp1862_t;
|
| 13 | struct _cdp1862_t
|
| 14 | {
|
| 15 | const cdp1862_interface *intf;
|
| 16 | |
| 17 | const device_config *screen; /* screen */
|
| 18 | bitmap_t *bitmap; /* bitmap */
|
| 19 | |
| 20 | int bgcolor; /* background color */
|
| 21 | int con; /* color on */
|
| 22 | };
|
| 23 | |
| 24 | static const int CDP1862_BACKGROUND_COLOR_SEQUENCE[] = { 2, 0, 1, 4 };
|
| 25 | |
| 26 | INLINE cdp1862_t *get_safe_token(const device_config *device)
|
| 27 | {
|
| 28 | assert(device != NULL);
|
| 29 | assert(device->token != NULL);
|
| 30 | |
| 31 | return (cdp1862_t *)device->token;
|
| 32 | }
|
| 33 | |
| 34 | /* Palette Initialization */
|
| 35 | |
| 36 | static void cdp1862_init_palette(const device_config *device)
|
| 37 | {
|
| 38 | cdp1862_t *cdp1862 = get_safe_token(device);
|
| 39 | int i;
|
| 40 | |
| 41 | double res_total = cdp1862->intf->res_r + cdp1862->intf->res_g + cdp1862->intf->res_b + cdp1862->intf->res_bkg;
|
| 42 | |
| 43 | int weight_r = (cdp1862->intf->res_r / res_total) * 100;
|
| 44 | int weight_g = (cdp1862->intf->res_g / res_total) * 100;
|
| 45 | int weight_b = (cdp1862->intf->res_b / res_total) * 100;
|
| 46 | int weight_bkg = (cdp1862->intf->res_bkg / res_total) * 100;
|
| 47 | |
| 48 | for (i = 0; i < 16; i++)
|
| 49 | {
|
| 50 | int r, g, b, luma = 0;
|
| 51 | |
| 52 | luma += (i & 4) ? weight_r : 0;
|
| 53 | luma += (i & 1) ? weight_g : 0;
|
| 54 | luma += (i & 2) ? weight_b : 0;
|
| 55 | luma += (i & 8) ? 0 : weight_bkg;
|
| 56 | |
| 57 | luma = (luma * 0xff) / 100;
|
| 58 | |
| 59 | r = (i & 4) ? luma : 0;
|
| 60 | g = (i & 1) ? luma : 0;
|
| 61 | b = (i & 2) ? luma : 0;
|
| 62 | |
| 63 | palette_set_color_rgb( device->machine, i, r, g, b );
|
| 64 | }
|
| 65 | }
|
| 66 | |
| 67 | /* Step Background Color */
|
| 68 | |
| 69 | WRITE8_DEVICE_HANDLER( cdp1862_bkg_w )
|
| 70 | {
|
| 71 | cdp1862_t *cdp1862 = get_safe_token(device);
|
| 72 | |
| 73 | if (++cdp1862->bgcolor > 3) cdp1862->bgcolor = 0;
|
| 74 | }
|
| 75 | |
| 76 | /* DMA write */
|
| 77 | |
| 78 | void cdp1862_dma_w(const device_config *device, UINT8 data, int color_on, int rdata, int gdata, int bdata)
|
| 79 | {
|
| 80 | cdp1862_t *cdp1862 = get_safe_token(device);
|
| 81 | |
| 82 | int sx = video_screen_get_hpos(cdp1862->screen) + 4;
|
| 83 | int y = video_screen_get_vpos(cdp1862->screen);
|
| 84 | int x;
|
| 85 | |
| 86 | if (color_on == ASSERT_LINE)
|
| 87 | {
|
| 88 | /* enable color data input latch */
|
| 89 | cdp1862->con = ASSERT_LINE;
|
| 90 | }
|
| 91 |
|
| 92 | if (cdp1862->con == CLEAR_LINE)
|
| 93 | {
|
| 94 | /* latch white dot color */
|
| 95 | rdata = 1;
|
| 96 | gdata = 1;
|
| 97 | bdata = 1;
|
| 98 | }
|
| 99 | |
| 100 | for (x = 0; x < 8; x++)
|
| 101 | {
|
| 102 | int color = CDP1862_BACKGROUND_COLOR_SEQUENCE[cdp1862->bgcolor] + 8;
|
| 103 | |
| 104 | if (BIT(data, 7))
|
| 105 | {
|
| 106 | color = (gdata << 2) | (bdata << 1) | rdata;
|
| 107 | }
|
| 108 | |
| 109 | *BITMAP_ADDR16(cdp1862->bitmap, y, sx + x) = color;
|
| 110 | |
| 111 | data <<= 1;
|
| 112 | }
|
| 113 | }
|
| 114 | |
| 115 | /* Screen Update */
|
| 116 | |
| 117 | void cdp1862_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect)
|
| 118 | {
|
| 119 | cdp1862_t *cdp1862 = get_safe_token(device);
|
| 120 | |
| 121 | copybitmap(bitmap, cdp1862->bitmap, 0, 0, 0, 0, cliprect);
|
| 122 | fillbitmap(cdp1862->bitmap, CDP1862_BACKGROUND_COLOR_SEQUENCE[cdp1862->bgcolor] + 8, cliprect);
|
| 123 | }
|
| 124 | |
| 125 | /* Device Interface */
|
| 126 | |
| 127 | static DEVICE_START( cdp1862 )
|
| 128 | {
|
| 129 | cdp1862_t *cdp1862 = get_safe_token(device);
|
| 130 | char unique_tag[30];
|
| 131 | |
| 132 | /* validate arguments */
|
| 133 | assert(device != NULL);
|
| 134 | assert(device->tag != NULL);
|
| 135 | assert(strlen(device->tag) < 20);
|
| 136 | |
| 137 | cdp1862->intf = device->static_config;
|
| 138 | |
| 139 | assert(cdp1862->intf != NULL);
|
| 140 | assert(cdp1862->intf->clock > 0);
|
| 141 | |
| 142 | /* get the screen device */
|
| 143 | cdp1862->screen = device_list_find_by_tag(device->machine->config->devicelist, VIDEO_SCREEN, cdp1862->intf->screen_tag);
|
| 144 | assert(cdp1862->screen != NULL);
|
| 145 | |
| 146 | /* allocate the temporary bitmap */
|
| 147 | cdp1862->bitmap = auto_bitmap_alloc(video_screen_get_width(cdp1862->screen), video_screen_get_height(cdp1862->screen), video_screen_get_format(cdp1862->screen));
|
| 148 | |
| 149 | /* initialize the palette */
|
| 150 | cdp1862_init_palette(device);
|
| 151 | |
| 152 | /* register for state saving */
|
| 153 | state_save_combine_module_and_tag(unique_tag, "cdp1862", device->tag);
|
| 154 | |
| 155 | state_save_register_item(unique_tag, 0, cdp1862->bgcolor);
|
| 156 | state_save_register_item(unique_tag, 0, cdp1862->con);
|
| 157 | |
| 158 | state_save_register_bitmap(unique_tag, 0, "cdp1862->bitmap", cdp1862->bitmap);
|
| 159 | |
| 160 | return DEVICE_START_OK;
|
| 161 | }
|
| 162 | |
| 163 | static DEVICE_RESET( cdp1862 )
|
| 164 | {
|
| 165 | cdp1862_t *cdp1862 = get_safe_token(device);
|
| 166 | |
| 167 | cdp1862->bgcolor = 0;
|
| 168 | cdp1862->con = CLEAR_LINE;
|
| 169 | }
|
| 170 | |
| 171 | static DEVICE_SET_INFO( cdp1862 )
|
| 172 | {
|
| 173 | switch (state)
|
| 174 | {
|
| 175 | /* no parameters to set */
|
| 176 | }
|
| 177 | }
|
| 178 | |
| 179 | DEVICE_GET_INFO( cdp1862 )
|
| 180 | {
|
| 181 | switch (state)
|
| 182 | {
|
| 183 | /* --- the following bits of info are returned as 64-bit signed integers --- */
|
| 184 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(cdp1862_t); break;
|
| 185 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break;
|
| 186 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break;
|
| 187 | |
| 188 | /* --- the following bits of info are returned as pointers to data or functions --- */
|
| 189 | case DEVINFO_FCT_SET_INFO: info->set_info = DEVICE_SET_INFO_NAME(cdp1862); break;
|
| 190 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(cdp1862); break;
|
| 191 | case DEVINFO_FCT_STOP: /* Nothing */ break;
|
| 192 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(cdp1862); break;
|
| 193 | |
| 194 | /* --- the following bits of info are returned as NULL-terminated strings --- */
|
| 195 | case DEVINFO_STR_NAME: info->s = "RCA CDP1862"; break;
|
| 196 | case DEVINFO_STR_FAMILY: info->s = "RCA CDP1800"; break;
|
| 197 | case DEVINFO_STR_VERSION: info->s = "1.0"; break;
|
| 198 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break;
|
| 199 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break;
|
| 200 | }
|
| 201 | }
|
src/mess/drivers/vip.c
| r3284 | r3285 | |
| 2 | 2 | |
| 3 | 3 | TODO: |
| 4 | 4 | |
| 5 | - CDP1862 colorram |
| 5 | 6 | - pcb layout guru-style readme |
| 6 | 7 | - artwork for leds |
| 7 | | - VP-550/551 Super Sound Board |
| 8 | | - VP-580 Expansion Keyboard |
| 9 | | - VP-585 Expansion Keyboard Interface |
| 10 | | - VP-590 Color Board |
| 11 | | - VP-595 Simple Sound Board |
| 12 | | - VP-601/611 ASCII Keyboard |
| 13 | | - VP-700 Expanded Tiny Basic Board |
| 8 | - VP-550/551 Super Sound Board (VP-550 2 channel, VP-551 4 channel sound) |
| 9 | - VP-580 Expansion Keyboard (connects to VP-585 or VP-590) |
| 10 | - VP-585 Expansion Keyboard Interface (2 keypad connectors for VP-580) |
| 11 | - VP-590 Color Board (CDP1862, 2 keypad connectors for VP-580) |
| 12 | - VP-595 Simple Sound Board (CDP1863?) |
| 13 | - VP-601/611 ASCII Keyboard (VP-601 58 keys, VP611 58 keys + 16 keys numerical keypad) |
| 14 | - VP-700 Expanded Tiny Basic Board (4 KB ROM expansion) |
| 14 | 15 | |
| 15 | 16 | - VIP Blockout |
| 16 | 17 | |
| r3284 | r3285 | |
| 32 | 33 | #include "sound/beep.h" |
| 33 | 34 | #include "sound/discrete.h" |
| 34 | 35 | #include "video/cdp1861.h" |
| 36 | #include "video/cdp1862.h" |
| 37 | #include "machine/rescap.h" |
| 35 | 38 | |
| 36 | 39 | static QUICKLOAD_LOAD( vip ); |
| 37 | 40 | static MACHINE_RESET( vip ); |
| r3284 | r3285 | |
| 86 | 89 | case 4 * 1024: |
| 87 | 90 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0x7000, SMH_BANK1, SMH_BANK1); |
| 88 | 91 | break; |
| 92 | |
| 93 | case 32 * 1024: |
| 94 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1); |
| 95 | break; |
| 89 | 96 | } |
| 90 | 97 | } |
| 91 | 98 | |
| r3284 | r3285 | |
| 100 | 107 | static ADDRESS_MAP_START( vip_io_map, ADDRESS_SPACE_IO, 8 ) |
| 101 | 108 | AM_RANGE(0x01, 0x01) AM_DEVREADWRITE(CDP1861, CDP1861_TAG, cdp1861_dispon_r, cdp1861_dispoff_w) |
| 102 | 109 | AM_RANGE(0x02, 0x02) AM_WRITE(keylatch_w) |
| 103 | | // AM_RANGE(0x03, 0x03) AM_READWRITE(io_r, io_w) |
| 104 | 110 | AM_RANGE(0x04, 0x04) AM_WRITE(bankswitch_w) |
| 111 | // AM_RANGE(0x05, 0x05) AM_DEVWRITE(CDP1862, CDP1862_TAG, cdp1862_bkg_w) |
| 105 | 112 | ADDRESS_MAP_END |
| 106 | 113 | |
| 107 | 114 | /* Input Ports */ |
| 108 | 115 | |
| 109 | 116 | static INPUT_PORTS_START( vip ) |
| 110 | | PORT_START("KEYPAD") |
| 117 | PORT_START("KEYPAD1") |
| 111 | 118 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0 MW") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) |
| 112 | 119 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) |
| 113 | 120 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) |
| r3284 | r3285 | |
| 127 | 134 | |
| 128 | 135 | PORT_START("RUN") |
| 129 | 136 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Run/Reset") PORT_CODE(KEYCODE_R) PORT_TOGGLE |
| 137 | |
| 138 | PORT_START("KEYBOARD") |
| 139 | PORT_CONFNAME( 0x07, 0x00, "Keyboard") |
| 140 | PORT_CONFSETTING( 0x00, "Standard" ) |
| 141 | PORT_CONFSETTING( 0x01, "VP-580 Expansion Keyboard" ) |
| 142 | PORT_CONFSETTING( 0x02, "2x VP-580 Expansion Keyboard" ) |
| 143 | PORT_CONFSETTING( 0x03, "VP-601 ASCII Keyboard" ) |
| 144 | PORT_CONFSETTING( 0x04, "VP-611 ASCII Keyboard" ) |
| 145 | |
| 146 | PORT_START("VIDEO") |
| 147 | PORT_CONFNAME( 0x01, 0x00, "Video") |
| 148 | PORT_CONFSETTING( 0x00, "Standard" ) |
| 149 | PORT_CONFSETTING( 0x01, "VP-590 Color Board" ) |
| 150 | |
| 151 | PORT_START("SOUND") |
| 152 | PORT_CONFNAME( 0x03, 0x00, "Sound") |
| 153 | PORT_CONFSETTING( 0x00, DEF_STR( None ) ) |
| 154 | PORT_CONFSETTING( 0x01, "VP-595 Simple Sound Board" ) |
| 155 | PORT_CONFSETTING( 0x02, "VP-550 Super Sound Board" ) |
| 156 | PORT_CONFSETTING( 0x03, "VP-551 Super Sound Board" ) |
| 130 | 157 | INPUT_PORTS_END |
| 131 | 158 | |
| 132 | 159 | /* Video */ |
| r3284 | r3285 | |
| 157 | 184 | vip_efx_w |
| 158 | 185 | }; |
| 159 | 186 | |
| 187 | static CDP1862_INTERFACE( vip_cdp1862_intf ) |
| 188 | { |
| 189 | SCREEN_TAG, |
| 190 | CPD1862_CLOCK, |
| 191 | RES_K(1.21), // ??? |
| 192 | RES_K(2.05), // ??? |
| 193 | RES_K(2.26), // ??? |
| 194 | RES_K(3.92) // ??? |
| 195 | }; |
| 196 | |
| 160 | 197 | static VIDEO_UPDATE( vip ) |
| 161 | 198 | { |
| 162 | | const device_config *cdp1861 = device_list_find_by_tag(screen->machine->config->devicelist, CDP1861, CDP1861_TAG); |
| 199 | vip_state *state = screen->machine->driver_data; |
| 163 | 200 | |
| 164 | | cdp1861_update(cdp1861, bitmap, cliprect); |
| 201 | switch (input_port_read(screen->machine, "VIDEO")) |
| 202 | { |
| 203 | case VIP_VIDEO_CDP1861: |
| 204 | { |
| 205 | cdp1861_update(state->cdp1861, bitmap, cliprect); |
| 206 | } |
| 207 | break; |
| 165 | 208 | |
| 209 | case VIP_VIDEO_CDP1862: |
| 210 | { |
| 211 | cdp1862_update(state->cdp1862, bitmap, cliprect); |
| 212 | } |
| 213 | break; |
| 214 | } |
| 215 | |
| 166 | 216 | return 0; |
| 167 | 217 | } |
| 168 | 218 | |
| r3284 | r3285 | |
| 204 | 254 | EF1 CDP1861 |
| 205 | 255 | EF2 tape in |
| 206 | 256 | EF3 keyboard |
| 207 | | EF4 ? |
| 257 | EF4 extended keyboard |
| 208 | 258 | */ |
| 209 | 259 | |
| 210 | 260 | /* CDP1861 */ |
| r3284 | r3285 | |
| 214 | 264 | if (cassette_input(cassette_device_image(machine)) < 0) flags -= EF2; |
| 215 | 265 | |
| 216 | 266 | /* keyboard */ |
| 217 | | if (input_port_read(machine, "KEYPAD") & (1 << state->keylatch)) flags -= EF3; |
| 267 | if (input_port_read(machine, "KEYPAD1") & (1 << state->keylatch)) flags -= EF3; |
| 218 | 268 | |
| 269 | /* extended keyboard */ |
| 270 | // if (input_port_read(machine, "KEYPAD2") & (1 << state->keylatch)) flags -= EF4; |
| 271 | |
| 219 | 272 | return flags; |
| 220 | 273 | } |
| 221 | 274 | |
| r3284 | r3285 | |
| 233 | 286 | |
| 234 | 287 | static CDP1802_DMA_WRITE( vip_dma_w ) |
| 235 | 288 | { |
| 236 | | const device_config *cdp1861 = device_list_find_by_tag(machine->config->devicelist, CDP1861, CDP1861_TAG); |
| 289 | vip_state *state = machine->driver_data; |
| 237 | 290 | |
| 238 | | cdp1861_dma_w(cdp1861, data); |
| 291 | switch (input_port_read(machine, "VIDEO")) |
| 292 | { |
| 293 | case VIP_VIDEO_CDP1861: |
| 294 | { |
| 295 | cdp1861_dma_w(state->cdp1861, data); |
| 296 | } |
| 297 | break; |
| 298 | |
| 299 | case VIP_VIDEO_CDP1862: |
| 300 | { |
| 301 | cdp1862_dma_w(state->cdp1862, data, ASSERT_LINE, 1, 1, 1); |
| 302 | } |
| 303 | break; |
| 304 | } |
| 239 | 305 | } |
| 240 | 306 | |
| 241 | 307 | static CDP1802_INTERFACE( vip_config ) |
| r3284 | r3285 | |
| 274 | 340 | ram[addr] = mame_rand(machine) & 0xff; |
| 275 | 341 | } |
| 276 | 342 | |
| 343 | /* allocate color RAM */ |
| 344 | |
| 345 | state->colorram = auto_malloc(VP590_COLOR_RAM_SIZE); |
| 346 | |
| 277 | 347 | /* enable power LED */ |
| 278 | 348 | |
| 279 | 349 | set_led_status(0, 1); |
| 280 | 350 | |
| 351 | /* look up devices */ |
| 352 | |
| 353 | state->cdp1861 = device_list_find_by_tag(machine->config->devicelist, CDP1861, CDP1861_TAG); |
| 354 | state->cdp1862 = device_list_find_by_tag(machine->config->devicelist, CDP1862, CDP1862_TAG); |
| 355 | |
| 281 | 356 | /* register for state saving */ |
| 282 | 357 | |
| 358 | state_save_register_global_pointer(state->colorram, VP590_COLOR_RAM_SIZE); |
| 359 | |
| 283 | 360 | state_save_register_global(state->cdp1861_efx); |
| 284 | 361 | state_save_register_global(state->keylatch); |
| 285 | 362 | state_save_register_global(state->reset); |
| r3284 | r3285 | |
| 287 | 364 | |
| 288 | 365 | static MACHINE_RESET( vip ) |
| 289 | 366 | { |
| 290 | | /* reset CDP1861 */ |
| 367 | vip_state *state = machine->driver_data; |
| 291 | 368 | |
| 292 | | const device_config *cdp1861 = device_list_find_by_tag(machine->config->devicelist, CDP1861, CDP1861_TAG); |
| 293 | | cdp1861->reset(cdp1861); |
| 369 | /* reset video chips */ |
| 294 | 370 | |
| 371 | state->cdp1861->reset(state->cdp1861); |
| 372 | state->cdp1862->reset(state->cdp1862); |
| 373 | |
| 374 | /* map CDP1862 memory */ |
| 375 | |
| 376 | switch (input_port_read(machine, "VIDEO")) |
| 377 | { |
| 378 | case VIP_VIDEO_CDP1861: |
| 379 | memory_install_write8_device_handler(state->cdp1862, 0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, SMH_UNMAP); |
| 380 | break; |
| 381 | |
| 382 | case VIP_VIDEO_CDP1862: |
| 383 | memory_install_write8_device_handler(state->cdp1862, 0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, cdp1862_bkg_w); |
| 384 | break; |
| 385 | } |
| 386 | |
| 295 | 387 | /* enable ROM mirror at 0x0000 */ |
| 296 | 388 | |
| 297 | 389 | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x01ff, 0, 0x7e00, SMH_BANK1, SMH_UNMAP); |
| r3284 | r3285 | |
| 324 | 416 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 325 | 417 | MDRV_SCREEN_RAW_PARAMS(XTAL_3_52128MHz/2, CDP1861_SCREEN_WIDTH, CDP1861_HBLANK_END, CDP1861_HBLANK_START, CDP1861_TOTAL_SCANLINES, CDP1861_SCANLINE_VBLANK_END, CDP1861_SCANLINE_VBLANK_START) |
| 326 | 418 | |
| 327 | | MDRV_PALETTE_LENGTH(2) |
| 419 | MDRV_PALETTE_LENGTH(16) |
| 328 | 420 | MDRV_PALETTE_INIT(black_and_white) |
| 329 | 421 | MDRV_VIDEO_UPDATE(vip) |
| 330 | 422 | |
| 331 | 423 | MDRV_DEVICE_ADD(CDP1861_TAG, CDP1861) |
| 332 | 424 | MDRV_DEVICE_CONFIG(vip_cdp1861_intf) |
| 333 | 425 | |
| 426 | MDRV_DEVICE_ADD(CDP1862_TAG, CDP1862) |
| 427 | MDRV_DEVICE_CONFIG(vip_cdp1862_intf) |
| 428 | |
| 334 | 429 | /* sound hardware */ |
| 335 | 430 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 336 | 431 | MDRV_SOUND_ADD("discrete", DISCRETE, 0) |
| r3284 | r3285 | |
| 338 | 433 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 339 | 434 | |
| 340 | 435 | /* devices */ |
| 341 | | MDRV_QUICKLOAD_ADD(vip, "bin,c8", 0) |
| 436 | MDRV_QUICKLOAD_ADD(vip, "bin,c8,c8x", 0) |
| 342 | 437 | |
| 343 | 438 | MDRV_CASSETTE_ADD( "cassette", vip_cassette_config ) |
| 344 | 439 | MACHINE_DRIVER_END |
| r3284 | r3285 | |
| 348 | 443 | ROM_START( vip ) |
| 349 | 444 | ROM_REGION( 0x10000, CDP1802_TAG, 0 ) |
| 350 | 445 | ROM_LOAD( "cdpr566.u10", 0x8000, 0x0200, CRC(5be0a51f) SHA1(40266e6d13e3340607f8b3dcc4e91d7584287c06) ) |
| 446 | ROM_SYSTEM_BIOS( 0, "vp711", "VP-711" ) |
| 447 | ROMX_LOAD( "vp711.bin", 0x9000, 0x1000, NO_DUMP, ROM_BIOS(1) ) |
| 448 | ROM_SYSTEM_BIOS( 1, "vp700", "VP-700 Tiny BASIC" ) |
| 449 | ROMX_LOAD( "vp700.bin", 0x9000, 0x1000, NO_DUMP, ROM_BIOS(2) ) |
| 351 | 450 | |
| 352 | 451 | ROM_REGION( 0x200, "chip8", 0 ) |
| 353 | 452 | ROM_LOAD( "chip8.bin", 0x0000, 0x0200, CRC(438ec5d5) SHA1(8aa634c239004ff041c9adbf9144bd315ab5fc77) ) |
| 453 | |
| 454 | ROM_REGION( 0x300, "chip8x", 0 ) |
| 455 | ROM_LOAD( "chip8x.bin", 0x0000, 0x0300, CRC(79c5f6f8) SHA1(ed438747b577399f6ccbf20fe14156f768842898) ) |
| 354 | 456 | ROM_END |
| 355 | 457 | |
| 458 | ROM_START( vp111 ) |
| 459 | ROM_REGION( 0x10000, CDP1802_TAG, 0 ) |
| 460 | ROM_LOAD( "cdpr566.u10", 0x8000, 0x0200, CRC(5be0a51f) SHA1(40266e6d13e3340607f8b3dcc4e91d7584287c06) ) |
| 461 | ROM_SYSTEM_BIOS( 0, "vp111", "VP-111" ) |
| 462 | ROM_SYSTEM_BIOS( 1, "vp700", "VP-700 Tiny BASIC" ) |
| 463 | ROMX_LOAD( "vp700.bin", 0x9000, 0x1000, NO_DUMP, ROM_BIOS(2) ) |
| 464 | |
| 465 | ROM_REGION( 0x200, "chip8", 0 ) |
| 466 | ROM_LOAD( "chip8.bin", 0x000, 0x0200, CRC(438ec5d5) SHA1(8aa634c239004ff041c9adbf9144bd315ab5fc77) ) |
| 467 | |
| 468 | ROM_REGION( 0x300, "chip8x", 0 ) |
| 469 | ROM_LOAD( "chip8x.bin", 0x0000, 0x0300, CRC(79c5f6f8) SHA1(ed438747b577399f6ccbf20fe14156f768842898) ) |
| 470 | ROM_END |
| 471 | |
| 356 | 472 | /* System Configuration */ |
| 357 | 473 | |
| 358 | 474 | static QUICKLOAD_LOAD( vip ) |
| 359 | 475 | { |
| 476 | UINT8 *ptr = memory_region(image->machine, CDP1802_TAG); |
| 477 | UINT8 *chip8_ptr = NULL; |
| 478 | int chip8_size = 0; |
| 360 | 479 | int size = image_length(image); |
| 361 | 480 | |
| 362 | 481 | if (strcmp(image_filetype(image), "c8") == 0) |
| 363 | 482 | { |
| 364 | 483 | /* CHIP-8 program */ |
| 365 | | |
| 366 | | UINT8 *ptr = memory_region(image->machine, CDP1802_TAG); |
| 367 | | UINT8 *chip8 = memory_region(image->machine, "chip8"); |
| 368 | | |
| 369 | | if ((size + 0x200) > mess_ram_size) |
| 370 | | { |
| 371 | | return INIT_FAIL; |
| 372 | | } |
| 373 | | |
| 374 | | /* copy CHIP-8 interpreter to RAM */ |
| 375 | | memcpy(ptr, chip8, 0x200); |
| 376 | | |
| 377 | | /* load image to RAM */ |
| 378 | | image_fread(image, ptr + 0x0200, size); |
| 484 | chip8_ptr = memory_region(image->machine, "chip8"); |
| 485 | chip8_size = memory_region_length(image->machine, "chip8"); |
| 379 | 486 | } |
| 380 | | else |
| 487 | else if (strcmp(image_filetype(image), "c8x") == 0) |
| 381 | 488 | { |
| 382 | | /* normal program */ |
| 489 | /* CHIP-8X program */ |
| 490 | chip8_ptr = memory_region(image->machine, "chip8x"); |
| 491 | chip8_size = memory_region_length(image->machine, "chip8x"); |
| 492 | } |
| 383 | 493 | |
| 384 | | UINT8 *ptr = memory_region(image->machine, CDP1802_TAG); |
| 494 | if ((size + chip8_size) > mess_ram_size) |
| 495 | { |
| 496 | return INIT_FAIL; |
| 497 | } |
| 385 | 498 | |
| 386 | | if (size > mess_ram_size) |
| 387 | | { |
| 388 | | return INIT_FAIL; |
| 389 | | } |
| 390 | | |
| 391 | | image_fread(image, ptr, size); |
| 499 | if (chip8_size > 0) |
| 500 | { |
| 501 | /* copy CHIP-8 interpreter to RAM */ |
| 502 | memcpy(ptr, chip8_ptr, chip8_size); |
| 392 | 503 | } |
| 393 | 504 | |
| 505 | /* load image to RAM */ |
| 506 | image_fread(image, ptr + chip8_size, size); |
| 394 | 507 | |
| 395 | 508 | return INIT_PASS; |
| 396 | 509 | } |
| 397 | 510 | |
| 398 | | static SYSTEM_CONFIG_START( vip ) |
| 399 | | CONFIG_RAM ( 1 * 1024) |
| 400 | | CONFIG_RAM ( 2 * 1024) |
| 511 | static SYSTEM_CONFIG_START( vp711 ) |
| 401 | 512 | CONFIG_RAM_DEFAULT ( 4 * 1024) |
| 513 | CONFIG_RAM (32 * 1024) |
| 402 | 514 | SYSTEM_CONFIG_END |
| 403 | 515 | |
| 516 | static SYSTEM_CONFIG_START( vp111 ) |
| 517 | CONFIG_RAM_DEFAULT ( 1 * 1024) |
| 518 | CONFIG_RAM ( 2 * 1024) |
| 519 | CONFIG_RAM ( 4 * 1024) |
| 520 | SYSTEM_CONFIG_END |
| 521 | |
| 404 | 522 | /* System Drivers */ |
| 405 | 523 | |
| 406 | | // YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME |
| 407 | | COMP( 1977, vip, 0, 0, vip, vip, 0, vip, "RCA", "Cosmac VIP (VP-711)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| 524 | // YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME |
| 525 | COMP( 1977, vip, 0, 0, vip, vip, 0, vp711, "RCA", "Cosmac VIP (VP-711)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| 526 | COMP( 1977, vp111, vip, 0, vip, vip, 0, vp111, "RCA", "Cosmac VIP (VP-111)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
src/mess/drivers/sg1000.c
| r3284 | r3285 | |
| 8 | 8 | 171-5078 (C) SEGA 1983 |
| 9 | 9 | 171-5046 REV. A (C) SEGA 1983 |
| 10 | 10 | |
| 11 | | |---------------------------| |------------------------| |
| 12 | | | SW1 CN2 | |------|---------------| | SW2 CN4 | |
| 13 | | | |---| CN3 |---| | |
| 14 | | | CN1 CN5 | |
| 15 | | | | |
| 16 | | | 10.738635MHz |------------------------------| 7805 | |
| 17 | | | |---| |------------------------------| | |
| 18 | | | | | CN6 | |
| 19 | | | | 9 | | |
| 20 | | | | 9 | LS32 | |
| 21 | | | | 1 | |---------| | |
| 22 | | | | 8 | | TMM2009 | LS139 | |
| 23 | | | | A | |---------| |------------------| | |
| 24 | | | | | | Z80 | | |
| 25 | | | |---| |------------------| | |
| 26 | | | | |
| 27 | | | | |
| 28 | | | MB8118 MB8118 MB8118 MB8118 SN76489A SW3 | |
| 29 | | | MB8118 MB8118 MB8118 MB8118 LS257 LS257 | |
| 30 | | |-----------------------------------------------------------------------------------| |
| 11 | |---------------------------| |----------------------------| |
| 12 | | SW1 CN2 | |------|---------------| | SW2 CN4 | |
| 13 | | |---| CN3 |---| | |
| 14 | | CN1 CN5 | |
| 15 | | | |
| 16 | | 10.738635MHz |------------------------------| 7805 | |
| 17 | | |---| |------------------------------| | |
| 18 | | | | CN6 | |
| 19 | | | 9 | | |
| 20 | | | 9 | LS32 | |
| 21 | | | 1 | |---------| | |
| 22 | | | 8 | | TMM2009 | LS139 | |
| 23 | | | A | |---------| |------------------| | |
| 24 | | | | | Z80 | | |
| 25 | | |---| |------------------| | |
| 26 | | | |
| 27 | | | |
| 28 | | MB8118 MB8118 MB8118 MB8118 SN76489A SW3 | |
| 29 | | MB8118 MB8118 MB8118 MB8118 LS257 LS257 | |
| 30 | |---------------------------------------------------------------------------------------| |
| 31 | 31 | |
| 32 | 32 | Notes: |
| 33 | 33 | All IC's shown. |
| r3284 | r3285 | |
| 43 | 43 | CN4 - power connector (+9VDC) |
| 44 | 44 | CN5 - player 2 joystick connector |
| 45 | 45 | CN6 - cartridge connector |
| 46 | | SW1 - select switch |
| 46 | SW1 - TV channel select switch |
| 47 | 47 | SW2 - power switch |
| 48 | 48 | SW3 - hold switch |
| 49 | 49 | |
| r3284 | r3285 | |
| 53 | 53 | |
| 54 | 54 | TODO: |
| 55 | 55 | |
| 56 | | - fix cartridge loading while running |
| 56 | - OMV keyboard |
| 57 | 57 | - SC-3000 return instruction referenced by R when reading ports 60-7f,e0-ff |
| 58 | 58 | - connect the PSG /READY signal |
| 59 | 59 | - accurate video timing |
| r3284 | r3285 | |
| 397 | 397 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 398 | 398 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 399 | 399 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 400 | /* |
| 401 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 402 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 403 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 404 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 405 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 406 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') |
| 407 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 408 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 409 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 410 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 400 | 411 | |
| 412 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 413 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 414 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 415 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 416 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 417 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 418 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 419 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 420 | |
| 421 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("S-1") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) |
| 422 | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("S-1") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL)) |
| 423 | */ |
| 401 | 424 | PORT_START("NMI") |
| 402 | 425 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("PAUSE") PORT_CODE(KEYCODE_P) PORT_CHANGED(trigger_nmi, 0) |
| 403 | 426 | |
| r3284 | r3285 | |
| 415 | 438 | |
| 416 | 439 | static void sg1000_vdp_interrupt(running_machine *machine, int state) |
| 417 | 440 | { |
| 418 | | cpunum_set_input_line_and_vector(machine, 0, INPUT_LINE_IRQ0, state, 0x38); |
| 441 | cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, state); |
| 419 | 442 | } |
| 420 | 443 | |
| 421 | 444 | static const TMS9928a_interface tms9928a_interface = |
| r3284 | r3285 | |
| 831 | 854 | ROM_REGION( 0x10000, "main", ROMREGION_ERASE00 ) |
| 832 | 855 | ROM_END |
| 833 | 856 | |
| 834 | | ROM_START( omv ) |
| 857 | ROM_START( omv1000 ) |
| 835 | 858 | ROM_REGION( 0x10000, "main", ROMREGION_ERASE00 ) |
| 836 | | ROM_LOAD( "omvbios.bin", 0x0000, 0x2000, NO_DUMP ) |
| 859 | ROM_LOAD( "omvbios.bin", 0x0000, 0x8000, NO_DUMP ) |
| 837 | 860 | ROM_END |
| 838 | 861 | |
| 862 | ROM_START( omv2000 ) |
| 863 | ROM_REGION( 0x10000, "main", ROMREGION_ERASE00 ) |
| 864 | ROM_LOAD( "omvbios.bin", 0x0000, 0x8000, NO_DUMP ) |
| 865 | ROM_END |
| 866 | |
| 839 | 867 | ROM_START( sc3000 ) |
| 840 | 868 | ROM_REGION( 0x10000, "main", ROMREGION_ERASE00 ) |
| 841 | 869 | ROM_END |
| r3284 | r3285 | |
| 907 | 935 | { |
| 908 | 936 | switch( state ) |
| 909 | 937 | { |
| 938 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 910 | 939 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 911 | 940 | case MESS_DEVINFO_INT_MUST_BE_LOADED: info->i = 1; break; |
| 941 | |
| 942 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 912 | 943 | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(sg1000_cart); break; |
| 944 | |
| 945 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 913 | 946 | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "sg,bin"); break; |
| 914 | 947 | |
| 915 | 948 | default: cartslot_device_getinfo( devclass, state, info ); break; |
| r3284 | r3285 | |
| 960 | 993 | { |
| 961 | 994 | switch( state ) |
| 962 | 995 | { |
| 996 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 963 | 997 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 964 | 998 | case MESS_DEVINFO_INT_MUST_BE_LOADED: info->i = 1; break; |
| 999 | |
| 1000 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 965 | 1001 | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(sc3000_cart); break; |
| 1002 | |
| 1003 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 966 | 1004 | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "sg,sc,bin"); break; |
| 967 | 1005 | |
| 968 | 1006 | default: cartslot_device_getinfo( devclass, state, info ); break; |
| 969 | 1007 | } |
| 970 | 1008 | } |
| 971 | 1009 | |
| 1010 | static void omv_cartslot_getinfo( const mess_device_class *devclass, UINT32 state, union devinfo *info ) |
| 1011 | { |
| 1012 | switch( state ) |
| 1013 | { |
| 1014 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1015 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 1016 | |
| 1017 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1018 | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(sg1000_cart); break; |
| 1019 | |
| 1020 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1021 | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "sg,bin"); break; |
| 1022 | |
| 1023 | default: cartslot_device_getinfo( devclass, state, info ); break; |
| 1024 | } |
| 1025 | } |
| 1026 | |
| 972 | 1027 | static DEVICE_IMAGE_LOAD( sf7000_floppy ) |
| 973 | 1028 | { |
| 974 | 1029 | if (image_has_been_created(image)) |
| r3284 | r3285 | |
| 992 | 1047 | { |
| 993 | 1048 | switch(state) |
| 994 | 1049 | { |
| 1050 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 995 | 1051 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 1052 | |
| 1053 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 996 | 1054 | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(sf7000_floppy); break; |
| 1055 | |
| 1056 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 997 | 1057 | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "sf7"); break; |
| 998 | 1058 | |
| 999 | 1059 | default: legacybasicdsk_device_getinfo(devclass, state, info); break; |
| 1000 | 1060 | } |
| 1001 | 1061 | } |
| 1002 | 1062 | |
| 1003 | | static DEVICE_IMAGE_LOAD( sf7000_serial ) |
| 1004 | | { |
| 1005 | | /* filename specified */ |
| 1006 | | if (device_load_serial_device(image) == INIT_PASS) |
| 1007 | | { |
| 1008 | | /* setup transmit parameters */ |
| 1009 | | serial_device_setup(image, 9600 >> input_port_read(image->machine, "BAUD"), 8, 1, SERIAL_PARITY_NONE); |
| 1010 | | |
| 1011 | | /* connect serial chip to serial device */ |
| 1012 | | msm8251_connect_to_serial_device(image); |
| 1013 | | |
| 1014 | | serial_device_set_protocol(image, SERIAL_PROTOCOL_NONE); |
| 1015 | | |
| 1016 | | /* and start transmit */ |
| 1017 | | serial_device_set_transmit_state(image, 1); |
| 1018 | | |
| 1019 | | return INIT_PASS; |
| 1020 | | } |
| 1021 | | |
| 1022 | | return INIT_FAIL; |
| 1023 | | } |
| 1024 | | |
| 1025 | 1063 | static void sf7000_serial_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 1026 | 1064 | { |
| 1027 | 1065 | /* serial */ |
| 1028 | 1066 | switch(state) |
| 1029 | 1067 | { |
| 1030 | 1068 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1031 | | case MESS_DEVINFO_INT_TYPE: info->i = IO_SERIAL; break; |
| 1032 | | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 1069 | case MESS_DEVINFO_INT_TYPE: info->i = IO_SERIAL; break; |
| 1070 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 1033 | 1071 | |
| 1034 | 1072 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1035 | | case MESS_DEVINFO_PTR_START: info->start = DEVICE_START_NAME(serial_device); break; |
| 1036 | | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(sf7000_serial); break; |
| 1037 | | case MESS_DEVINFO_PTR_UNLOAD: info->unload = DEVICE_IMAGE_UNLOAD_NAME(serial_device); break; |
| 1073 | case MESS_DEVINFO_PTR_START: info->start = DEVICE_START_NAME(serial_device); break; |
| 1074 | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(serial_device); break; |
| 1075 | case MESS_DEVINFO_PTR_UNLOAD: info->unload = DEVICE_IMAGE_UNLOAD_NAME(serial_device); break; |
| 1038 | 1076 | |
| 1039 | 1077 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1040 | | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "txt"); break; |
| 1078 | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "txt"); break; |
| 1041 | 1079 | } |
| 1042 | 1080 | } |
| 1043 | 1081 | |
| 1044 | 1082 | static SYSTEM_CONFIG_START( sg1000 ) |
| 1083 | CONFIG_RAM_DEFAULT (1 * 1024) |
| 1045 | 1084 | CONFIG_DEVICE(sg1000_cartslot_getinfo) |
| 1046 | 1085 | SYSTEM_CONFIG_END |
| 1047 | 1086 | |
| 1048 | | static SYSTEM_CONFIG_START( omv ) |
| 1049 | | CONFIG_DEVICE(sg1000_cartslot_getinfo) |
| 1050 | | SYSTEM_CONFIG_END |
| 1051 | | |
| 1052 | 1087 | static SYSTEM_CONFIG_START( sc3000 ) |
| 1088 | CONFIG_RAM_DEFAULT (2 * 1024) |
| 1053 | 1089 | CONFIG_DEVICE(sc3000_cartslot_getinfo) |
| 1054 | 1090 | SYSTEM_CONFIG_END |
| 1055 | 1091 | |
| r3284 | r3285 | |
| 1059 | 1095 | CONFIG_DEVICE(sf7000_serial_getinfo) |
| 1060 | 1096 | SYSTEM_CONFIG_END |
| 1061 | 1097 | |
| 1098 | static SYSTEM_CONFIG_START( omv ) |
| 1099 | CONFIG_DEVICE(omv_cartslot_getinfo) |
| 1100 | SYSTEM_CONFIG_END |
| 1101 | |
| 1062 | 1102 | /* System Drivers */ |
| 1063 | 1103 | |
| 1064 | 1104 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 1065 | 1105 | CONS( 1983, sg1000, 0, 0, sg1000, sg1000, 0, sg1000, "Sega", "SG-1000", GAME_SUPPORTS_SAVE ) |
| 1066 | 1106 | CONS( 1984, sg1000m2, sg1000, 0, sc3000, sc3000, 0, sc3000, "Sega", "SG-1000 II", GAME_SUPPORTS_SAVE ) |
| 1067 | | CONS( 1983, omv, sg1000, 0, omv, omv, 0, omv, "Tsukuda Original", "Othello Multivision", GAME_NOT_WORKING ) |
| 1068 | 1107 | COMP( 1983, sc3000, 0, 0, sc3000, sc3000, 0, sc3000, "Sega", "SC-3000", GAME_SUPPORTS_SAVE ) |
| 1069 | 1108 | COMP( 1983, sc3000h, sc3000, 0, sc3000, sc3000, 0, sc3000, "Sega", "SC-3000H", GAME_SUPPORTS_SAVE ) |
| 1070 | 1109 | COMP( 1983, sf7000, sc3000, 0, sf7000, sf7000, 0, sf7000, "Sega", "SC-3000/Super Control Station SF-7000", GAME_SUPPORTS_SAVE ) |
| 1110 | CONS( 1984, omv1000, sg1000, 0, omv, omv, 0, omv, "Tsukuda Original", "Othello Multivision FG-1000", GAME_NOT_WORKING ) |
| 1111 | CONS( 1984, omv2000, sg1000, 0, omv, omv, 0, omv, "Tsukuda Original", "Othello Multivision FG-2000", GAME_NOT_WORKING ) |
src/mess/drivers/studio2.c
| r3284 | r3285 | |
| 90 | 90 | |
| 91 | 91 | /* |
| 92 | 92 | |
| 93 | RCA Studio II games list |
| 94 | |
| 95 | Title Series Dumped |
| 96 | ---------------------------------------------------------------------------- |
| 97 | Bowling built-in yes |
| 98 | Doodles built-in yes |
| 99 | Freeway built-in yes |
| 100 | Math built-in yes |
| 101 | Patterns built-in yes |
| 102 | Gunfighter/Moonship Battle TV Arcade no, but Guru has one |
| 103 | Space War TV Arcade I yes |
| 104 | Fun with Numbers TV Arcade II no, but Guru has one |
| 105 | Tennis/Squash TV Arcade III yes |
| 106 | Baseball TV Arcade IV yes |
| 107 | Speedway/Tag TV Arcade yes |
| 108 | Blackjack TV Casino I yes |
| 109 | Bingo TV Casino no |
| 110 | Math and Social Studies TV School House I no, but Guru has one |
| 111 | Math Fun TV School House II no, but Guru has one |
| 112 | Biorhythm TV Mystic no, but Guru has one |
| 113 | |
| 114 | |
| 115 | MPT-02 games list |
| 116 | |
| 117 | ID Title Series Dumped |
| 118 | ---------------------------------------------------------------------------- |
| 119 | MG-201 Bingo no |
| 120 | MG-202 Concentration Match no, but Guru has one |
| 121 | MG-203 Star Wars no, but Guru has one |
| 122 | MG-204 Math Fun School House II no, but Guru has one |
| 123 | MG-205 Pinball no, but Guru has one |
| 124 | MG-206 Biorythm no |
| 125 | MG-207 Tennis/Squash no |
| 126 | MG-208 Fun with Numbers no |
| 127 | MG-209 Computer Quiz School House I no |
| 128 | MG-210 Baseball no |
| 129 | MG-211 Speedway/Tag no |
| 130 | MG-212 Spacewar Intercept no |
| 131 | MG-213 Gun Fight/Moon ship no |
| 132 | |
| 133 | */ |
| 134 | |
| 135 | /* |
| 136 | |
| 93 | 137 | TODO: |
| 94 | 138 | |
| 95 | | - figure out real cpu clock from schematics |
| 96 | | - cdp1864 video colors |
| 139 | - rewrite cartridge loading |
| 140 | - cpu clock from schematics |
| 141 | - mpt02/mustang cdp1864 colors |
| 142 | - cdp1862 for Toshiba Visicom |
| 97 | 143 | - discrete sound |
| 98 | | - redump studio2 bios as 4 separate roms |
| 99 | 144 | |
| 100 | 145 | */ |
| 101 | 146 | |
| r3284 | r3285 | |
| 230 | 275 | static CDP1864_INTERFACE( mpt02_cdp1864_intf ) |
| 231 | 276 | { |
| 232 | 277 | SCREEN_TAG, |
| 233 | | CDP1864_CLK_FREQ, |
| 278 | CDP1864_CLOCK, |
| 234 | 279 | CDP1864_INTERLACED, |
| 235 | 280 | mpt02_int_w, |
| 236 | 281 | mpt02_dmao_w, |
| r3284 | r3285 | |
| 391 | 436 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 392 | 437 | MACHINE_DRIVER_END |
| 393 | 438 | |
| 439 | static MACHINE_DRIVER_START( visicom ) |
| 440 | // basic machine hardware |
| 441 | |
| 442 | MDRV_CPU_ADD("main", CDP1802, 3579545/2) // ??? |
| 443 | MDRV_CPU_PROGRAM_MAP(studio2_map, 0) |
| 444 | MDRV_CPU_IO_MAP(studio2_io_map, 0) |
| 445 | MDRV_CPU_CONFIG(studio2_config) |
| 446 | |
| 447 | MDRV_MACHINE_START(studio2) |
| 448 | MDRV_MACHINE_RESET(studio2) |
| 449 | |
| 450 | // video hardware |
| 451 | |
| 452 | MDRV_SCREEN_ADD(SCREEN_TAG, RASTER) |
| 453 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 454 | MDRV_SCREEN_RAW_PARAMS(3579545/2, CDP1861_SCREEN_WIDTH, CDP1861_HBLANK_END, CDP1861_HBLANK_START, CDP1861_TOTAL_SCANLINES, CDP1861_SCANLINE_VBLANK_END, CDP1861_SCANLINE_VBLANK_START) |
| 455 | |
| 456 | MDRV_PALETTE_LENGTH(2) |
| 457 | MDRV_PALETTE_INIT(black_and_white) |
| 458 | MDRV_VIDEO_UPDATE(studio2) |
| 459 | |
| 460 | MDRV_DEVICE_ADD(CDP1861_TAG, CDP1861) |
| 461 | MDRV_DEVICE_CONFIG(studio2_cdp1861_intf) |
| 462 | |
| 463 | // sound hardware |
| 464 | |
| 465 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 466 | MDRV_SOUND_ADD("beep", BEEP, 0) |
| 467 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 468 | MACHINE_DRIVER_END |
| 469 | |
| 394 | 470 | static MACHINE_DRIVER_START( mpt02 ) |
| 395 | 471 | // basic machine hardware |
| 396 | 472 | |
| 397 | | MDRV_CPU_ADD("main", CDP1802, CDP1864_CLK_FREQ) |
| 473 | MDRV_CPU_ADD("main", CDP1802, CDP1864_CLOCK) |
| 398 | 474 | MDRV_CPU_PROGRAM_MAP(mpt02_map, 0) |
| 399 | 475 | MDRV_CPU_IO_MAP(mpt02_io_map, 0) |
| 400 | 476 | MDRV_CPU_CONFIG(mpt02_config) |
| r3284 | r3285 | |
| 406 | 482 | |
| 407 | 483 | MDRV_SCREEN_ADD("main", RASTER) |
| 408 | 484 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 409 | | MDRV_SCREEN_RAW_PARAMS(CDP1864_CLK_FREQ, CDP1864_SCREEN_WIDTH, CDP1864_HBLANK_END, CDP1864_HBLANK_START, CDP1864_TOTAL_SCANLINES, CDP1864_SCANLINE_VBLANK_END, CDP1864_SCANLINE_VBLANK_START) |
| 485 | MDRV_SCREEN_RAW_PARAMS(CDP1864_CLOCK, CDP1864_SCREEN_WIDTH, CDP1864_HBLANK_END, CDP1864_HBLANK_START, CDP1864_TOTAL_SCANLINES, CDP1864_SCANLINE_VBLANK_END, CDP1864_SCANLINE_VBLANK_START) |
| 410 | 486 | |
| 411 | 487 | MDRV_PALETTE_LENGTH(8+8) |
| 412 | 488 | MDRV_VIDEO_UPDATE(mpt02) |
| r3284 | r3285 | |
| 432 | 508 | ROM_LOAD( "studio2.rom", 0x0000, 0x0800, BAD_DUMP CRC(a494b339) SHA1(f2650dacc9daab06b9fdf0e7748e977b2907010c) ) |
| 433 | 509 | ROM_END |
| 434 | 510 | |
| 435 | | ROM_START( m9016tc ) |
| 511 | ROM_START( mtc9016 ) |
| 436 | 512 | ROM_REGION( 0x10000, "main", 0 ) |
| 437 | 513 | ROM_LOAD( "86676.ic13", 0x0000, 0x0400, NO_DUMP ) |
| 438 | 514 | ROM_LOAD( "86677b.ic14", 0x0400, 0x0400, NO_DUMP ) |
| 439 | 515 | ROM_LOAD( "87201.ic12", 0x0a00, 0x0400, NO_DUMP ) |
| 440 | 516 | ROM_END |
| 441 | 517 | |
| 518 | ROM_START( shmc1200 ) |
| 519 | ROM_REGION( 0x10000, "main", 0 ) |
| 520 | ROM_LOAD( "shmc1200.bin", 0x0000, 0x0800, NO_DUMP ) |
| 521 | ROM_END |
| 522 | |
| 523 | ROM_START( mpt02s ) |
| 524 | ROM_REGION( 0x10000, "main", 0 ) |
| 525 | ROM_END |
| 526 | |
| 527 | ROM_START( mpt02h ) |
| 528 | ROM_REGION( 0x10000, "main", 0 ) |
| 529 | ROM_END |
| 530 | |
| 531 | ROM_START( visicom ) |
| 532 | ROM_REGION( 0x10000, "main", 0 ) |
| 533 | ROM_LOAD( "visicom.bin", 0x0000, 0x0800, NO_DUMP ) |
| 534 | ROM_END |
| 535 | |
| 442 | 536 | /* System Configuration */ |
| 443 | 537 | |
| 444 | 538 | #define ST2_HEADER_SIZE 256 |
| r3284 | r3285 | |
| 475 | 569 | { |
| 476 | 570 | switch( state ) |
| 477 | 571 | { |
| 478 | | case MESS_DEVINFO_INT_COUNT: |
| 479 | | info->i = 1; |
| 480 | | break; |
| 481 | | case MESS_DEVINFO_PTR_LOAD: |
| 482 | | info->load = DEVICE_IMAGE_LOAD_NAME(studio2_cart); |
| 483 | | break; |
| 484 | | case MESS_DEVINFO_STR_FILE_EXTENSIONS: |
| 485 | | strcpy(info->s = device_temp_str(), "st2"); |
| 486 | | break; |
| 487 | | default: |
| 488 | | cartslot_device_getinfo( devclass, state, info ); |
| 489 | | break; |
| 572 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 573 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 574 | |
| 575 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 576 | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(studio2_cart); break; |
| 577 | |
| 578 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 579 | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "st2"); break; |
| 580 | |
| 581 | default: cartslot_device_getinfo( devclass, state, info ); break; |
| 490 | 582 | } |
| 491 | 583 | } |
| 492 | 584 | |
| r3284 | r3285 | |
| 522 | 614 | static DRIVER_INIT( mpt02 ) |
| 523 | 615 | { |
| 524 | 616 | timer_set(attotime_zero, NULL, 0, mpt02_setup_beep); |
| 617 | timer_set(ATTOTIME_IN_MSEC(200), NULL, 0, set_cpu_mode); |
| 525 | 618 | } |
| 526 | 619 | |
| 620 | static DRIVER_INIT( visicom ) |
| 621 | { |
| 622 | timer_set(attotime_zero, NULL, 0, setup_beep); |
| 623 | timer_set(ATTOTIME_IN_MSEC(200), NULL, 0, set_cpu_mode); |
| 624 | } |
| 625 | |
| 527 | 626 | /* Game Drivers */ |
| 528 | 627 | |
| 529 | | /* |
| 530 | | |
| 531 | | PAL clones of RCA Studio II using CDP1864C (color display): |
| 532 | | |
| 533 | | "Mustang", "9016 Telespiel Computer (Germany)" |
| 534 | | "Soundic", "MPT-02 Victory Home TV Programmer (Austria)" |
| 535 | | "Hanimex", "MPT-02 (France)" |
| 536 | | "Sheen", "1200 Micro Computer (Australia)" |
| 537 | | |
| 538 | | */ |
| 539 | | |
| 540 | 628 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 541 | 629 | CONS( 1977, studio2, 0, 0, studio2, studio2, studio2, studio2, "RCA", "Studio II", GAME_SUPPORTS_SAVE ) |
| 542 | | CONS( 1978, m9016tc, studio2,0, mpt02, studio2, mpt02, studio2, "Mustang", "9016 Telespiel Computer (Germany)", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) |
| 630 | CONS( 1978, visicom, studio2,0, visicom, studio2, visicom, studio2, "Toshiba", "Visicom (Japan)", GAME_NOT_WORKING ) |
| 631 | CONS( 1978, mpt02s, studio2,0, mpt02, studio2, mpt02, studio2, "Soundic", "MPT-02 Victory Home TV Programmer (Austria)", GAME_NOT_WORKING ) |
| 632 | CONS( 1978, mpt02h, studio2,0, mpt02, studio2, mpt02, studio2, "Hanimex", "MPT-02 Jeu TV Programmable (France)", GAME_NOT_WORKING ) |
| 633 | CONS( 1978, mtc9016, studio2,0, mpt02, studio2, mpt02, studio2, "Mustang", "9016 Telespiel Computer (Germany)", GAME_NOT_WORKING ) |
| 634 | CONS( 1978, shmc1200, studio2,0, mpt02, studio2, mpt02, studio2, "Sheen", "1200 Micro Computer (Australia)", GAME_NOT_WORKING ) |