src/mess/devices/ti99cart.c
| r6474 | r6475 | |
| 164 | 164 | Interestingly, cartridge subroutines are found nevertheless, even when |
| 165 | 165 | the cartridge is plugged into a higher slot. |
| 166 | 166 | */ |
| 167 | | void cartridge_slot_set(const device_config *cartsys, int slotnumber) |
| 167 | void ti99_cartridge_slot_set(const device_config *cartsys, int slotnumber) |
| 168 | 168 | { |
| 169 | 169 | ti99_multicart_t *cartslots = (ti99_multicart_t *)cartsys->token; |
| 170 | 170 | assert(slotnumber>=0 && slotnumber<=255); |
| r6474 | r6475 | |
| 180 | 180 | Called from the machine driver, taking the dipswitch setting. |
| 181 | 181 | We take slot numbers from 0 (automatic mode) to the maximum. |
| 182 | 182 | */ |
| 183 | | void lock_cartridge_slot(const device_config *cartsys, int slotnumber) |
| 183 | void ti99_lock_cartridge_slot(const device_config *cartsys, int slotnumber) |
| 184 | 184 | { |
| 185 | 185 | ti99_multicart_t *cartslots = (ti99_multicart_t *)cartsys->token; |
| 186 | 186 | assert(slotnumber>=0 && slotnumber<=255); |
| r6474 | r6475 | |
| 227 | 227 | Note that the GROM access mechanism is identical for all cartridge |
| 228 | 228 | types. |
| 229 | 229 | */ |
| 230 | | UINT8 cartridge_grom_read(const device_config *device, int cart_offset) |
| 230 | UINT8 ti99_cartridge_grom_read(const device_config *device, int cart_offset) |
| 231 | 231 | { |
| 232 | 232 | UINT8 value; |
| 233 | 233 | int slot; |
| r6474 | r6475 | |
| 340 | 340 | { |
| 341 | 341 | cartridge->rom_ptr = socketcont; |
| 342 | 342 | cartridge->rom_size = reslength; |
| 343 | | if (!is_99_8()) |
| 343 | if (!ti99_is_99_8()) |
| 344 | 344 | { |
| 345 | 345 | /* Big-endianize it for 16 bit access. */ |
| 346 | 346 | UINT16 *cont16b = (UINT16 *)socketcont; |
| r6474 | r6475 | |
| 355 | 355 | { |
| 356 | 356 | cartridge->rom2_ptr = (UINT16 *)socketcont; |
| 357 | 357 | assert(cartridge->rom2_ptr != NULL); |
| 358 | | if (!is_99_8()) |
| 358 | if (!ti99_is_99_8()) |
| 359 | 359 | { |
| 360 | 360 | /* Big-endianize it for 16 bit access. */ |
| 361 | 361 | UINT16 *cont16b = (UINT16 *)socketcont; |
| r6474 | r6475 | |
| 370 | 370 | { |
| 371 | 371 | cartridge->ram_ptr = socketcont; |
| 372 | 372 | cartridge->ram_size = reslength; |
| 373 | | if (!is_99_8()) |
| 373 | if (!ti99_is_99_8()) |
| 374 | 374 | { |
| 375 | 375 | /* Big-endianize it for 16 bit access. */ |
| 376 | 376 | UINT16 *cont16b = (UINT16 *)socketcont; |
| r6474 | r6475 | |
| 533 | 533 | |
| 534 | 534 | /* Do we have RAM? If so, swap the bytes (undo the BIG_ENDIANIZE) */ |
| 535 | 535 | cart = &cartslots->cartridge[slotnumber]; |
| 536 | | if (!is_99_8()) |
| 536 | if (!ti99_is_99_8()) |
| 537 | 537 | { |
| 538 | 538 | for (i = 0; i < cart->ram_size/2; i++) |
| 539 | 539 | ((UINT16 *)cart->ram_ptr)[i] = BIG_ENDIANIZE_INT16(((UINT16 *)cart->ram_ptr)[i]); |
| r6474 | r6475 | |
| 1898 | 1898 | if (me == MCERR_NONE) |
| 1899 | 1899 | result = pcb->assemble(image); |
| 1900 | 1900 | else |
| 1901 | | fatalerror("Error loading multicart: %s\n", mc_error_text(me)); |
| 1901 | fatalerror("Error loading multicart: %s\n", multicart_error_text(me)); |
| 1902 | 1902 | |
| 1903 | 1903 | /* This is for legacy support. If we have no multicart left |
| 1904 | 1904 | but there are still legacy dumps, we switch to legacy mode. */ |
| r6474 | r6475 | |
| 2327 | 2327 | savembx = TRUE; |
| 2328 | 2328 | } |
| 2329 | 2329 | |
| 2330 | | if (is_99_8()) |
| 2330 | if (ti99_is_99_8()) |
| 2331 | 2331 | { |
| 2332 | 2332 | // printf("** is 99/8\n"); |
| 2333 | 2333 | if (savembx==TRUE) |
| r6474 | r6475 | |
| 2367 | 2367 | case SLOTC_MINIMEM: |
| 2368 | 2368 | /* Load the NVRAM. Need to BIG_ENDIANIZE it. |
| 2369 | 2369 | MiniMemory has only one cartridge page. */ |
| 2370 | | if (is_99_8()) |
| 2370 | if (ti99_is_99_8()) |
| 2371 | 2371 | { |
| 2372 | 2372 | // printf("** is 99/8\n"); |
| 2373 | 2373 | image_battery_load(image, cart8rom+0x1000,0x1000); |
| r6474 | r6475 | |
| 2386 | 2386 | |
| 2387 | 2387 | case SLOTC_MBX: |
| 2388 | 2388 | /* Load the NVRAM. Need to BIG_ENDIANIZE it. */ |
| 2389 | | if (is_99_8()) |
| 2389 | if (ti99_is_99_8()) |
| 2390 | 2390 | { |
| 2391 | 2391 | // printf("** is 99/8\n"); |
| 2392 | 2392 | image_battery_load(image, cart8rom+0x0c00, 0x0400); |
| r6474 | r6475 | |
| 2405 | 2405 | |
| 2406 | 2406 | case SLOTC_DROM: |
| 2407 | 2407 | maxrom = 0x2000; |
| 2408 | | if (is_99_8()) |
| 2408 | if (ti99_is_99_8()) |
| 2409 | 2409 | { |
| 2410 | 2410 | // printf("** is 99/8\n"); |
| 2411 | 2411 | filesize = image_fread(image, cart8rom2, maxrom); |
| r6474 | r6475 | |
| 2456 | 2456 | break; |
| 2457 | 2457 | |
| 2458 | 2458 | case SLOTC_MINIMEM: |
| 2459 | | if (is_99_8()) |
| 2459 | if (ti99_is_99_8()) |
| 2460 | 2460 | { |
| 2461 | 2461 | // printf("** is 99/8\n"); |
| 2462 | 2462 | image_battery_save(image, cartslots->cartridge[slot].ram_ptr, 0x1000); |
| r6474 | r6475 | |
| 2474 | 2474 | } |
| 2475 | 2475 | break; |
| 2476 | 2476 | case SLOTC_MBX: |
| 2477 | | if (is_99_8()) |
| 2477 | if (ti99_is_99_8()) |
| 2478 | 2478 | { |
| 2479 | 2479 | // printf("** is 99/8\n"); |
| 2480 | 2480 | image_battery_save(image, cartslots->cartridge[slot].ram_ptr, 0x0400); |
src/mess/devices/messram.c
| r6474 | r6475 | |
| 52 | 52 | *****************************************************************************/ |
| 53 | 53 | |
| 54 | 54 | /*------------------------------------------------- |
| 55 | | parse_string - convert a ram string to an |
| 55 | messram_parse_string - convert a ram string to an |
| 56 | 56 | integer value |
| 57 | 57 | -------------------------------------------------*/ |
| 58 | 58 | |
| 59 | | UINT32 ram_parse_string(const char *s) |
| 59 | UINT32 messram_parse_string(const char *s) |
| 60 | 60 | { |
| 61 | 61 | UINT32 ram; |
| 62 | 62 | char suffix = '\0'; |
| r6474 | r6475 | |
| 88 | 88 | return ram; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | | const char *ram_string(char *buffer, UINT32 ram) |
| 91 | #ifdef UNUSED_FUNCTION |
| 92 | const char *messram_string(char *buffer, UINT32 ram) |
| 92 | 93 | { |
| 93 | 94 | const char *suffix; |
| 94 | 95 | |
| r6474 | r6475 | |
| 109 | 110 | sprintf(buffer, "%u%s", ram, suffix); |
| 110 | 111 | return buffer; |
| 111 | 112 | } |
| 113 | #endif |
| 112 | 114 | |
| 113 | 115 | |
| 114 | 116 | /***************************************************************************** |
| r6474 | r6475 | |
| 126 | 128 | const char *ramsize_string = options_get_string(mame_options(), OPTION_RAMSIZE); |
| 127 | 129 | |
| 128 | 130 | if ((ramsize_string != NULL) && (ramsize_string[0] != '\0')) |
| 129 | | messram->size = ram_parse_string(ramsize_string); |
| 131 | messram->size = messram_parse_string(ramsize_string); |
| 130 | 132 | } |
| 131 | 133 | |
| 132 | 134 | /* if we didn't get a size yet, use the default */ |
| 133 | 135 | if (messram->size == 0) |
| 134 | | messram->size = ram_parse_string(config->default_size); |
| 136 | messram->size = messram_parse_string(config->default_size); |
| 135 | 137 | |
| 136 | 138 | /* allocate space for the ram */ |
| 137 | 139 | messram->ram = auto_alloc_array(device->machine, UINT8, messram->size); |
| r6474 | r6475 | |
| 154 | 156 | const char *gamename_option = NULL; |
| 155 | 157 | |
| 156 | 158 | /* verify default ram value */ |
| 157 | | if (config!=NULL && ram_parse_string(config->default_size) == 0) |
| 159 | if (config!=NULL && messram_parse_string(config->default_size) == 0) |
| 158 | 160 | { |
| 159 | 161 | mame_printf_error("%s: '%s' has an invalid default RAM option: %s\n", driver->source_file, driver->name, config->default_size); |
| 160 | 162 | error = TRUE; |
| r6474 | r6475 | |
| 170 | 172 | |
| 171 | 173 | if ((ramsize_string != NULL) && (ramsize_string[0] != '\0')) |
| 172 | 174 | { |
| 173 | | specified_ram = ram_parse_string(ramsize_string); |
| 175 | specified_ram = messram_parse_string(ramsize_string); |
| 174 | 176 | |
| 175 | 177 | if (specified_ram == 0) |
| 176 | 178 | { |
| r6474 | r6475 | |
| 180 | 182 | if (gamename_option!=NULL && strlen(gamename_option) > 0 && strcmp(gamename_option, driver->name) == 0) |
| 181 | 183 | { |
| 182 | 184 | /* compare command line option to default value */ |
| 183 | | if (ram_parse_string(config->default_size) == specified_ram) |
| 185 | if (messram_parse_string(config->default_size) == specified_ram) |
| 184 | 186 | is_valid = TRUE; |
| 185 | 187 | |
| 186 | 188 | /* verify extra ram options */ |
| r6474 | r6475 | |
| 197 | 199 | /* try to parse each option */ |
| 198 | 200 | while(*s != '\0') |
| 199 | 201 | { |
| 200 | | UINT32 option_ram_size = ram_parse_string(s); |
| 202 | UINT32 option_ram_size = messram_parse_string(s); |
| 201 | 203 | |
| 202 | 204 | if (option_ram_size == 0) |
| 203 | 205 | { |
| r6474 | r6475 | |
| 289 | 291 | } |
| 290 | 292 | |
| 291 | 293 | |
| 294 | #ifdef UNUSED_FUNCTION |
| 292 | 295 | void messram_dump(const device_config *device, const char *filename) |
| 293 | 296 | { |
| 294 | 297 | messram_state *messram = get_safe_token(device); |
| r6474 | r6475 | |
| 310 | 313 | mame_fclose(file); |
| 311 | 314 | } |
| 312 | 315 | } |
| 316 | #endif |
src/mess/video/vectrex.c
| r6474 | r6475 | |
| 64 | 64 | |
| 65 | 65 | const via6522_interface vectrex_via6522_interface = |
| 66 | 66 | { |
| 67 | | DEVCB_HANDLER(v_via_pa_r), DEVCB_HANDLER(v_via_pb_r), /* read PA/B */ |
| 67 | DEVCB_HANDLER(vectrex_via_pa_r), DEVCB_HANDLER(vectrex_via_pb_r), /* read PA/B */ |
| 68 | 68 | DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, /* read ca1, cb1, ca2, cb2 */ |
| 69 | 69 | DEVCB_HANDLER(v_via_pa_w), DEVCB_HANDLER(v_via_pb_w), /* write PA/B */ |
| 70 | 70 | DEVCB_NULL, DEVCB_NULL, DEVCB_HANDLER(v_via_ca2_w), DEVCB_HANDLER(v_via_cb2_w), /* write ca1, cb1, ca2, cb2 */ |
| 71 | | DEVCB_LINE(v_via_irq), /* IRQ */ |
| 71 | DEVCB_LINE(vectrex_via_irq), /* IRQ */ |
| 72 | 72 | }; |
| 73 | 73 | |
| 74 | 74 | static int x_center, y_center, x_max, y_max; |
| r6474 | r6475 | |
| 474 | 474 | |
| 475 | 475 | const via6522_interface spectrum1_via6522_interface = |
| 476 | 476 | { |
| 477 | | /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_HANDLER(v_via_pa_r), DEVCB_HANDLER(s1_via_pb_r), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, |
| 477 | /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_HANDLER(vectrex_via_pa_r), DEVCB_HANDLER(vectrex_s1_via_pb_r), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, |
| 478 | 478 | /*outputs: A/B,CA/B1,CA/B2 */ DEVCB_HANDLER(v_via_pa_w), DEVCB_HANDLER(v_via_pb_w), DEVCB_NULL, DEVCB_NULL, DEVCB_HANDLER(v_via_ca2_w), DEVCB_HANDLER(v_via_cb2_w), |
| 479 | | /*irq */ DEVCB_LINE(v_via_irq), |
| 479 | /*irq */ DEVCB_LINE(vectrex_via_irq), |
| 480 | 480 | }; |
| 481 | 481 | |
| 482 | 482 | |
src/mess/video/timex.c
| r6474 | r6475 | |
| 43 | 43 | if (NumItems) |
| 44 | 44 | { |
| 45 | 45 | pItem = EventList_GetFirstItem(); |
| 46 | | set_last_border_color ( pItem[NumItems-1].Event_Data ); |
| 46 | border_set_last_color ( pItem[NumItems-1].Event_Data ); |
| 47 | 47 | EventList_Reset(); |
| 48 | 48 | EventList_SetOffsetStartTime ( cpu_attotime_to_clocks(machine->firstcpu, attotime_mul(video_screen_get_scan_period(machine->primary_screen), video_screen_get_vpos(machine->primary_screen))) ); |
| 49 | 49 | logerror ("Event log reset in callback fn.\n"); |
| r6474 | r6475 | |
| 229 | 229 | ts2068_lores_scanline(screen->machine,bitmap, count, TS2068_TOP_BORDER, 0); |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | | draw_border(screen->machine, bitmap, full_refresh, |
| 232 | border_draw(screen->machine, bitmap, full_refresh, |
| 233 | 233 | TS2068_TOP_BORDER, SPEC_DISPLAY_YSIZE, TS2068_BOTTOM_BORDER, |
| 234 | 234 | TS2068_LEFT_BORDER, TS2068_DISPLAY_XSIZE, TS2068_RIGHT_BORDER, |
| 235 | 235 | SPEC_LEFT_BORDER_CYCLES, SPEC_DISPLAY_XSIZE_CYCLES, |
| r6474 | r6475 | |
| 269 | 269 | ts2068_lores_scanline(screen->machine,bitmap, count, SPEC_TOP_BORDER, 0); |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | | draw_border(screen->machine, bitmap, full_refresh, |
| 272 | border_draw(screen->machine, bitmap, full_refresh, |
| 273 | 273 | SPEC_TOP_BORDER, SPEC_DISPLAY_YSIZE, SPEC_BOTTOM_BORDER, |
| 274 | 274 | TS2068_LEFT_BORDER, TS2068_DISPLAY_XSIZE, TS2068_RIGHT_BORDER, |
| 275 | 275 | SPEC_LEFT_BORDER_CYCLES, SPEC_DISPLAY_XSIZE_CYCLES, |
src/mess/machine/3do.c
| r6474 | r6475 | |
| 18 | 18 | static CLIO clio; |
| 19 | 19 | |
| 20 | 20 | |
| 21 | | READ32_HANDLER( nvarea_r ) { |
| 21 | READ32_HANDLER( _3do_nvarea_r ) { |
| 22 | 22 | logerror( "%08X: NVRAM read offset = %08X\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), offset ); |
| 23 | 23 | return 0; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | | WRITE32_HANDLER( nvarea_w ) { |
| 26 | WRITE32_HANDLER( _3do_nvarea_w ) { |
| 27 | 27 | logerror( "%08X: NVRAM write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), offset, data, mem_mask ); |
| 28 | 28 | } |
| 29 | 29 | |
| r6474 | r6475 | |
| 70 | 70 | write 00002000 to 03180000 |
| 71 | 71 | several groups of 16 write actions or 16 read actions |
| 72 | 72 | */ |
| 73 | | READ32_HANDLER( unk_318_r ) { |
| 73 | READ32_HANDLER( _3do_unk_318_r ) { |
| 74 | 74 | logerror( "%08X: UNK_318 read offset = %08X\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), offset ); |
| 75 | 75 | #if 0 |
| 76 | 76 | switch( offset ) { |
| r6474 | r6475 | |
| 82 | 82 | return 0; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | | WRITE32_HANDLER( unk_318_w ) |
| 85 | WRITE32_HANDLER( _3do_unk_318_w ) |
| 86 | 86 | { |
| 87 | 87 | logerror( "%08X: UNK_318 write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), offset, data, mem_mask ); |
| 88 | 88 | |
| r6474 | r6475 | |
| 99 | 99 | |
| 100 | 100 | |
| 101 | 101 | |
| 102 | | READ32_HANDLER( vram_sport_r ) { |
| 102 | READ32_HANDLER( _3do_vram_sport_r ) { |
| 103 | 103 | logerror( "%08X: VRAM SPORT read offset = %08X\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), offset ); |
| 104 | 104 | switch( offset ) { |
| 105 | 105 | case 0x1840: /* 03206100 - ?? */ |
| r6474 | r6475 | |
| 110 | 110 | return 0; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | | WRITE32_HANDLER( vram_sport_w ) { |
| 113 | WRITE32_HANDLER( _3do_vram_sport_w ) { |
| 114 | 114 | logerror( "%08X: VRAM SPORT write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), offset, data, mem_mask ); |
| 115 | 115 | switch( offset ) { |
| 116 | 116 | case 0x0800: /* 03202000 - ?? during boot 00190019 gets written */ |
| r6474 | r6475 | |
| 122 | 122 | |
| 123 | 123 | |
| 124 | 124 | |
| 125 | | READ32_HANDLER( madam_r ) { |
| 125 | READ32_HANDLER( _3do_madam_r ) { |
| 126 | 126 | logerror( "%08X: MADAM read offset = %08X\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), offset ); |
| 127 | 127 | switch( offset ) { |
| 128 | 128 | case 0: /* 03300000 - Revision */ |
| r6474 | r6475 | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | |
| 137 | | WRITE32_HANDLER( madam_w ) { |
| 137 | WRITE32_HANDLER( _3do_madam_w ) { |
| 138 | 138 | logerror( "%08X: MADAM write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), offset, data, mem_mask ); |
| 139 | 139 | switch( offset ) { |
| 140 | 140 | case 0x01: /* 03300004 - Memory configuration 29 = 2MB DRAM, 1MB VRAM */ |
| r6474 | r6475 | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | |
| 151 | | void madam_init( void ) |
| 151 | void _3do_madam_init( void ) |
| 152 | 152 | { |
| 153 | 153 | memset( &madam, 0, sizeof(MADAM) ); |
| 154 | 154 | madam.revision = 0x00000001; |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | |
| 158 | | READ32_HANDLER( clio_r ) |
| 158 | READ32_HANDLER( _3do_clio_r ) |
| 159 | 159 | { |
| 160 | 160 | logerror( "%08X: CLIO read offset = %08X\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), offset ); |
| 161 | 161 | |
| r6474 | r6475 | |
| 174 | 174 | return 0; |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | | WRITE32_HANDLER( clio_w ) |
| 177 | WRITE32_HANDLER( _3do_clio_w ) |
| 178 | 178 | { |
| 179 | 179 | logerror( "%08X: CLIO write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), offset, data, mem_mask ); |
| 180 | 180 | |
| r6474 | r6475 | |
| 194 | 194 | } |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | | void clio_init( void ) |
| 197 | void _3do_clio_init( void ) |
| 198 | 198 | { |
| 199 | 199 | memset( &clio, 0, sizeof(CLIO) ); |
| 200 | 200 | } |
src/mess/machine/coco.c
| r6474 | r6475 | |
| 641 | 641 | * access that bit or or whether it is something else. So that is why |
| 642 | 642 | * I am specifying 0x7fff instead of 0xffff here |
| 643 | 643 | */ |
| 644 | | sam_set_state(state->sam, trailer->sam, 0x7fff); |
| 644 | sam6883_set_state(state->sam, trailer->sam, 0x7fff); |
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | static int generic_pak_load(const device_config *image, int rambase_index, int rombase_index, int pakbase_index) |
| r6474 | r6475 | |
| 1763 | 1763 | } |
| 1764 | 1764 | |
| 1765 | 1765 | /* The Dragon Alpha hardware reverses the order of the WD2797 registers */ |
| 1766 | | READ8_HANDLER(wd2797_r) |
| 1766 | READ8_HANDLER(dgnalpha_wd2797_r) |
| 1767 | 1767 | { |
| 1768 | 1768 | const device_config *fdc = devtag_get_device(space->machine, "wd2797"); |
| 1769 | 1769 | int result = 0; |
| r6474 | r6475 | |
| 1789 | 1789 | return result; |
| 1790 | 1790 | } |
| 1791 | 1791 | |
| 1792 | | WRITE8_HANDLER(wd2797_w) |
| 1792 | WRITE8_HANDLER(dgnalpha_wd2797_w) |
| 1793 | 1793 | { |
| 1794 | 1794 | const device_config *fdc = devtag_get_device(space->machine, "wd2797"); |
| 1795 | 1795 | switch(offset & 0x3) |
| r6474 | r6475 | |
| 1812 | 1812 | }; |
| 1813 | 1813 | } |
| 1814 | 1814 | |
| 1815 | | READ8_HANDLER(alpha_modem_r) |
| 1815 | READ8_HANDLER(dgnalpha_modem_r) |
| 1816 | 1816 | { |
| 1817 | 1817 | return 0xFF; |
| 1818 | 1818 | } |
| 1819 | 1819 | |
| 1820 | | WRITE8_HANDLER(alpha_modem_w) |
| 1820 | WRITE8_HANDLER(dgnalpha_modem_w) |
| 1821 | 1821 | { |
| 1822 | 1822 | } |
| 1823 | 1823 | |
| r6474 | r6475 | |
| 1906 | 1906 | */ |
| 1907 | 1907 | |
| 1908 | 1908 | /* The read handler will eventually return the 6845 status */ |
| 1909 | | READ8_HANDLER ( plus_reg_r ) |
| 1909 | READ8_HANDLER ( dgnplus_reg_r ) |
| 1910 | 1910 | { |
| 1911 | 1911 | return 0; |
| 1912 | 1912 | } |
| r6474 | r6475 | |
| 1924 | 1924 | 1,1 Undefined. I will assume that it's the same as 00. |
| 1925 | 1925 | 3-7 Unused. |
| 1926 | 1926 | */ |
| 1927 | | WRITE8_HANDLER ( plus_reg_w ) |
| 1927 | WRITE8_HANDLER ( dgnplus_reg_w ) |
| 1928 | 1928 | { |
| 1929 | 1929 | int map; |
| 1930 | 1930 | |
| r6474 | r6475 | |
| 1977 | 1977 | cpu_set_clockscale(cputag_get_cpu(device->machine, "maincpu"), val ? 2 : 1); |
| 1978 | 1978 | } |
| 1979 | 1979 | |
| 1980 | | READ8_HANDLER(dragon_alpha_mapped_irq_r) |
| 1980 | READ8_HANDLER(dgnalpha_mapped_irq_r) |
| 1981 | 1981 | { |
| 1982 | 1982 | return bas_rom_bank[0x3ff0 + offset]; |
| 1983 | 1983 | } |
| r6474 | r6475 | |
| 2036 | 2036 | /* We need to init these vars from the sam, as this may be called from outside the sam callbacks */ |
| 2037 | 2037 | const address_space *space = cputag_get_address_space( machine, "maincpu", ADDRESS_SPACE_PROGRAM ); |
| 2038 | 2038 | coco_state *state = machine->driver_data; |
| 2039 | | UINT8 memsize = get_sam_memorysize(state->sam); |
| 2040 | | UINT8 maptype = get_sam_maptype(state->sam); |
| 2041 | | // UINT8 pagemode = get_sam_pagemode(machine); |
| 2039 | UINT8 memsize = sam6883_memorysize(state->sam); |
| 2040 | UINT8 maptype = sam6883_maptype(state->sam); |
| 2041 | //UINT8 pagemode = sam6883_pagemode(machine); |
| 2042 | 2042 | int last_ram_block; /* Last block that will be RAM, dependent on maptype */ |
| 2043 | 2043 | int block_index; /* Index of block being processed */ |
| 2044 | 2044 | int wbank; /* bank no to go in this block */ |
| r6474 | r6475 | |
| 2116 | 2116 | * this (it probably ignored it) |
| 2117 | 2117 | */ |
| 2118 | 2118 | |
| 2119 | | if (!get_sam_maptype(device)) // Ignored in maptype 1 |
| 2119 | if (!sam6883_maptype(device)) // Ignored in maptype 1 |
| 2120 | 2120 | { |
| 2121 | 2121 | if((messram_get_size(devtag_get_device(device->machine, "messram"))>0x8000) && val) |
| 2122 | 2122 | bottom_32k=&messram_get_ptr(devtag_get_device(device->machine, "messram"))[0x8000]; |
src/mess/machine/8530scc.c
| r6474 | r6475 | |
| 74 | 74 | scc_set_status |
| 75 | 75 | -------------------------------------------------*/ |
| 76 | 76 | |
| 77 | | void scc_set_status(const device_config *device, int status) |
| 77 | void scc8530_set_status(const device_config *device, int status) |
| 78 | 78 | { |
| 79 | 79 | scc8530_t *scc = get_token(device); |
| 80 | 80 | scc->status = status; |
| r6474 | r6475 | |
| 172 | 172 | |
| 173 | 173 | |
| 174 | 174 | /*------------------------------------------------- |
| 175 | | scc_get_reg_a |
| 175 | scc8530_get_reg_a |
| 176 | 176 | -------------------------------------------------*/ |
| 177 | 177 | |
| 178 | | UINT8 scc_get_reg_a(const device_config *device, int reg) |
| 178 | UINT8 scc8530_get_reg_a(const device_config *device, int reg) |
| 179 | 179 | { |
| 180 | 180 | scc8530_t *scc = get_token(device); |
| 181 | 181 | return scc->reg_val_a[reg]; |
| r6474 | r6475 | |
| 184 | 184 | |
| 185 | 185 | |
| 186 | 186 | /*------------------------------------------------- |
| 187 | | scc_get_reg_b |
| 187 | scc8530_get_reg_b |
| 188 | 188 | -------------------------------------------------*/ |
| 189 | 189 | |
| 190 | | UINT8 scc_get_reg_b(const device_config *device, int reg) |
| 190 | UINT8 scc8530_get_reg_b(const device_config *device, int reg) |
| 191 | 191 | { |
| 192 | 192 | scc8530_t *scc = get_token(device); |
| 193 | 193 | return scc->reg_val_b[reg]; |
| r6474 | r6475 | |
| 196 | 196 | |
| 197 | 197 | |
| 198 | 198 | /*------------------------------------------------- |
| 199 | | scc_set_reg_a |
| 199 | scc8530_set_reg_a |
| 200 | 200 | -------------------------------------------------*/ |
| 201 | 201 | |
| 202 | | void scc_set_reg_a(const device_config *device, int reg, UINT8 data) |
| 202 | void scc8530_set_reg_a(const device_config *device, int reg, UINT8 data) |
| 203 | 203 | { |
| 204 | 204 | scc8530_t *scc = get_token(device); |
| 205 | 205 | scc->reg_val_a[reg] = data; |
| r6474 | r6475 | |
| 208 | 208 | |
| 209 | 209 | |
| 210 | 210 | /*------------------------------------------------- |
| 211 | | scc_set_reg_a |
| 211 | scc8530_set_reg_a |
| 212 | 212 | -------------------------------------------------*/ |
| 213 | 213 | |
| 214 | | void scc_set_reg_b(const device_config *device, int reg, UINT8 data) |
| 214 | void scc8530_set_reg_b(const device_config *device, int reg, UINT8 data) |
| 215 | 215 | { |
| 216 | 216 | scc8530_t *scc = get_token(device); |
| 217 | 217 | scc->reg_val_b[reg] = data; |
| r6474 | r6475 | |
| 220 | 220 | |
| 221 | 221 | |
| 222 | 222 | /*------------------------------------------------- |
| 223 | | scc_r |
| 223 | scc8530_r |
| 224 | 224 | -------------------------------------------------*/ |
| 225 | 225 | |
| 226 | | READ8_DEVICE_HANDLER(scc_r) |
| 226 | READ8_DEVICE_HANDLER(scc8530_r) |
| 227 | 227 | { |
| 228 | 228 | scc8530_t *scc = get_token(device); |
| 229 | 229 | UINT8 result = 0; |
| r6474 | r6475 | |
| 271 | 271 | |
| 272 | 272 | |
| 273 | 273 | /*------------------------------------------------- |
| 274 | | scc_w |
| 274 | scc8530_w |
| 275 | 275 | -------------------------------------------------*/ |
| 276 | 276 | |
| 277 | | WRITE8_DEVICE_HANDLER(scc_w) |
| 277 | WRITE8_DEVICE_HANDLER(scc8530_w) |
| 278 | 278 | { |
| 279 | 279 | scc8530_t *scc = get_token(device); |
| 280 | 280 | |
src/mess/machine/8530scc.h
| r6474 | r6475 | |
| 46 | 46 | FUNCTION PROTOTYPES |
| 47 | 47 | ***************************************************************************/ |
| 48 | 48 | |
| 49 | | void scc_set_status(const device_config *device, int status); |
| 49 | void scc8530_set_status(const device_config *device, int status); |
| 50 | 50 | |
| 51 | | UINT8 scc_get_reg_a(const device_config *device, int reg); |
| 52 | | UINT8 scc_get_reg_b(const device_config *device, int reg); |
| 53 | | void scc_set_reg_a(const device_config *device, int reg, UINT8 data); |
| 54 | | void scc_set_reg_b(const device_config *device, int reg, UINT8 data); |
| 51 | UINT8 scc8530_get_reg_a(const device_config *device, int reg); |
| 52 | UINT8 scc8530_get_reg_b(const device_config *device, int reg); |
| 53 | void scc8530_set_reg_a(const device_config *device, int reg, UINT8 data); |
| 54 | void scc8530_set_reg_b(const device_config *device, int reg, UINT8 data); |
| 55 | 55 | |
| 56 | 56 | DEVICE_GET_INFO(scc8530); |
| 57 | 57 | |
| 58 | | READ8_DEVICE_HANDLER(scc_r); |
| 59 | | WRITE8_DEVICE_HANDLER(scc_w); |
| 58 | READ8_DEVICE_HANDLER(scc8530_r); |
| 59 | WRITE8_DEVICE_HANDLER(scc8530_w); |
| 60 | 60 | |
| 61 | 61 | #endif /* __8530SCC_H__ */ |
src/mess/machine/vector06.c
| r6474 | r6475 | |
| 16 | 16 | #include "devices/messram.h" |
| 17 | 17 | |
| 18 | 18 | UINT8 vector06_keyboard_mask; |
| 19 | | UINT8 vector_color_index; |
| 20 | | UINT8 vector_video_mode; |
| 19 | UINT8 vector06_color_index; |
| 20 | UINT8 vector06_video_mode; |
| 21 | 21 | |
| 22 | 22 | /* Driver initialization */ |
| 23 | 23 | DRIVER_INIT(vector06) |
| r6474 | r6475 | |
| 54 | 54 | vector06_keyboard_mask = data ^ 0xff; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | | static void vector_set_video_mode(running_machine *machine, int width) { |
| 57 | static void vector06_set_video_mode(running_machine *machine, int width) { |
| 58 | 58 | rectangle visarea; |
| 59 | 59 | |
| 60 | 60 | visarea.min_x = 0; |
| r6474 | r6475 | |
| 66 | 66 | |
| 67 | 67 | static WRITE8_DEVICE_HANDLER (vector06_8255_portb_w ) |
| 68 | 68 | { |
| 69 | | vector_color_index = data & 0x0f; |
| 70 | | if ((data & 0x10) != vector_video_mode) |
| 69 | vector06_color_index = data & 0x0f; |
| 70 | if ((data & 0x10) != vector06_video_mode) |
| 71 | 71 | { |
| 72 | | vector_video_mode = data & 0x10; |
| 73 | | vector_set_video_mode(device->machine,(vector_video_mode==0x10) ? 512 : 256); |
| 72 | vector06_video_mode = data & 0x10; |
| 73 | vector06_set_video_mode(device->machine,(vector06_video_mode==0x10) ? 512 : 256); |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
| r6474 | r6475 | |
| 79 | 79 | UINT8 r = (data & 7) << 5; |
| 80 | 80 | UINT8 g = ((data >> 3) & 7) << 5; |
| 81 | 81 | UINT8 b = ((data >>6) & 3) << 6; |
| 82 | | palette_set_color( space->machine, vector_color_index, MAKE_RGB(r,g,b) ); |
| 82 | palette_set_color( space->machine, vector06_color_index, MAKE_RGB(r,g,b) ); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | static UINT8 romdisk_msb; |
| r6474 | r6475 | |
| 123 | 123 | DEVCB_NULL |
| 124 | 124 | }; |
| 125 | 125 | |
| 126 | | READ8_HANDLER(vector_8255_1_r) { |
| 126 | READ8_HANDLER(vector06_8255_1_r) { |
| 127 | 127 | return i8255a_r(devtag_get_device(space->machine, "ppi8255"), (offset ^ 0x03)); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | | WRITE8_HANDLER(vector_8255_1_w) { |
| 130 | WRITE8_HANDLER(vector06_8255_1_w) { |
| 131 | 131 | i8255a_w(devtag_get_device(space->machine, "ppi8255"), (offset ^0x03) , data ); |
| 132 | 132 | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | | READ8_HANDLER(vector_8255_2_r) { |
| 135 | READ8_HANDLER(vector06_8255_2_r) { |
| 136 | 136 | return i8255a_r(devtag_get_device(space->machine, "ppi8255_2"), (offset ^ 0x03)); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | | WRITE8_HANDLER(vector_8255_2_w) { |
| 139 | WRITE8_HANDLER(vector06_8255_2_w) { |
| 140 | 140 | i8255a_w(devtag_get_device(space->machine, "ppi8255_2"), (offset ^0x03) , data ); |
| 141 | 141 | |
| 142 | 142 | } |
| r6474 | r6475 | |
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | | WRITE8_HANDLER(vector_disc_w) |
| 172 | WRITE8_HANDLER(vector06_disc_w) |
| 173 | 173 | { |
| 174 | 174 | const device_config *fdc = devtag_get_device(space->machine, "wd1793"); |
| 175 | 175 | wd17xx_set_side (fdc,((data & 4) >> 2) ^ 1); |
| r6474 | r6475 | |
| 198 | 198 | memory_set_bankptr(machine, 4, messram_get_ptr(devtag_get_device(machine, "messram")) + 0x8000); |
| 199 | 199 | |
| 200 | 200 | vector06_keyboard_mask = 0; |
| 201 | | vector_color_index = 0; |
| 202 | | vector_video_mode = 0; |
| 201 | vector06_color_index = 0; |
| 202 | vector06_video_mode = 0; |
| 203 | 203 | timer_pulse(machine, ATTOTIME_IN_HZ(50), NULL, 0, reset_check_callback); |
| 204 | 204 | } |
src/mess/machine/sms.c
| r6474 | r6475 | |
| 1445 | 1445 | } |
| 1446 | 1446 | |
| 1447 | 1447 | if (sms_state.cartridge[sms_state.current_cartridge].features & CF_GG_SMS_MODE) |
| 1448 | | sms_set_ggsmsmode(smsvdp, 1); |
| 1448 | sms_vdp_set_ggsmsmode(smsvdp, 1); |
| 1449 | 1449 | |
| 1450 | 1450 | /* Initialize SIO stuff for GG */ |
| 1451 | 1451 | sms_state.gg_sio[0] = 0x7f; |
| r6474 | r6475 | |
| 1633 | 1633 | |
| 1634 | 1634 | if (screen == main_scr) |
| 1635 | 1635 | { |
| 1636 | | smsvdp_update(smsvdp, bitmap, cliprect); |
| 1636 | sms_vdp_update(smsvdp, bitmap, cliprect); |
| 1637 | 1637 | } |
| 1638 | 1638 | else if (screen == left_lcd) |
| 1639 | 1639 | { |
| r6474 | r6475 | |
| 1644 | 1644 | if (segascope) |
| 1645 | 1645 | { |
| 1646 | 1646 | if (sms_state.sscope_state & 0x01) /* 1 = left screen ON, right screen OFF */ |
| 1647 | | smsvdp_update(smsvdp, bitmap, cliprect); |
| 1647 | sms_vdp_update(smsvdp, bitmap, cliprect); |
| 1648 | 1648 | else /* 0 = left screen OFF, right screen ON */ |
| 1649 | 1649 | { |
| 1650 | 1650 | for (y = 0; y < height; y++) |
| r6474 | r6475 | |
| 1674 | 1674 | *BITMAP_ADDR32(bitmap, y, x) = MAKE_RGB(0,0,0); |
| 1675 | 1675 | } |
| 1676 | 1676 | else /* 0 = left screen OFF, right screen ON */ |
| 1677 | | smsvdp_update(smsvdp, bitmap, cliprect); |
| 1677 | sms_vdp_update(smsvdp, bitmap, cliprect); |
| 1678 | 1678 | } |
| 1679 | 1679 | else /* We only use the third screen for SegaScope, if it not selected return a black screen */ |
| 1680 | 1680 | { |
| r6474 | r6475 | |
| 1690 | 1690 | VIDEO_UPDATE( sms ) |
| 1691 | 1691 | { |
| 1692 | 1692 | const device_config *smsvdp = devtag_get_device(screen->machine, "sms_vdp"); |
| 1693 | | smsvdp_update(smsvdp, bitmap, cliprect); |
| 1693 | sms_vdp_update(smsvdp, bitmap, cliprect); |
| 1694 | 1694 | |
| 1695 | 1695 | return 0; |
| 1696 | 1696 | } |
src/mess/machine/galaxy.c
| r6474 | r6475 | |
| 55 | 55 | |
| 56 | 56 | static IRQ_CALLBACK ( galaxy_irq_callback ) |
| 57 | 57 | { |
| 58 | | gal_cnt = 0; |
| 58 | galaxy_set_timer(); |
| 59 | 59 | galaxy_interrupts_enabled = TRUE; |
| 60 | | timer_adjust_periodic(gal_video_timer, attotime_zero, 0, ATTOTIME_IN_HZ(6144000 / 8)); |
| 61 | 60 | return 0xff; |
| 62 | 61 | } |
| 63 | 62 | |
| r6474 | r6475 | |
| 185 | 184 | |
| 186 | 185 | cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), galaxy_irq_callback); |
| 187 | 186 | galaxy_interrupts_enabled = TRUE; |
| 188 | | |
| 189 | | gal_video_timer = timer_alloc(machine, gal_video, NULL); |
| 190 | | timer_adjust_periodic(gal_video_timer, attotime_zero, 0,attotime_never); |
| 191 | 187 | } |
| 192 | 188 | |
| 193 | 189 | DRIVER_INIT( galaxyp ) |
| r6474 | r6475 | |
| 211 | 207 | memory_install_write8_handler(space, 0xe000, 0xefff, 0, 0, SMH_NOP); |
| 212 | 208 | memory_set_bankptr(machine,11, memory_region(machine, "maincpu") + 0xe000); |
| 213 | 209 | galaxy_interrupts_enabled = TRUE; |
| 214 | | |
| 215 | | gal_video_timer = timer_alloc(machine, gal_video, NULL); |
| 216 | | timer_adjust_periodic(gal_video_timer, attotime_zero, 0, attotime_never); |
| 217 | | |
| 218 | 210 | } |
src/mess/machine/compis.c
| r6474 | r6475 | |
| 981 | 981 | *************************************/ |
| 982 | 982 | |
| 983 | 983 | |
| 984 | | READ16_HANDLER( i186_internal_port_r ) |
| 984 | READ16_HANDLER( compis_i186_internal_port_r ) |
| 985 | 985 | { |
| 986 | 986 | int temp, which; |
| 987 | 987 | |
| r6474 | r6475 | |
| 1163 | 1163 | * |
| 1164 | 1164 | *************************************/ |
| 1165 | 1165 | |
| 1166 | | WRITE16_HANDLER( i186_internal_port_w ) |
| 1166 | WRITE16_HANDLER( compis_i186_internal_port_w ) |
| 1167 | 1167 | { |
| 1168 | 1168 | int temp, which, data16 = data; |
| 1169 | 1169 | |
| r6474 | r6475 | |
| 1385 | 1385 | temp = (data16 & 0x0fff) << 8; |
| 1386 | 1386 | if (data16 & 0x1000) |
| 1387 | 1387 | { |
| 1388 | | memory_install_read16_handler(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM), temp, temp + 0xff, 0, 0, i186_internal_port_r); |
| 1389 | | memory_install_write16_handler(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM), temp, temp + 0xff, 0, 0, i186_internal_port_w); |
| 1388 | memory_install_read16_handler(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM), temp, temp + 0xff, 0, 0, compis_i186_internal_port_r); |
| 1389 | memory_install_write16_handler(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM), temp, temp + 0xff, 0, 0, compis_i186_internal_port_w); |
| 1390 | 1390 | } |
| 1391 | 1391 | else |
| 1392 | 1392 | { |
| 1393 | 1393 | temp &= 0xffff; |
| 1394 | | memory_install_read16_handler(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_IO), temp, temp + 0xff, 0, 0, i186_internal_port_r); |
| 1395 | | memory_install_write16_handler(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_IO), temp, temp + 0xff, 0, 0, i186_internal_port_w); |
| 1394 | memory_install_read16_handler(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_IO), temp, temp + 0xff, 0, 0, compis_i186_internal_port_r); |
| 1395 | memory_install_write16_handler(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_IO), temp, temp + 0xff, 0, 0, compis_i186_internal_port_w); |
| 1396 | 1396 | } |
| 1397 | 1397 | /* popmessage("Sound CPU reset");*/ |
| 1398 | 1398 | break; |
src/mess/machine/mac.c
| r6474 | r6475 | |
| 995 | 995 | if (x && y) |
| 996 | 996 | { |
| 997 | 997 | if (last_was_x) |
| 998 | | scc_set_status(scc, 0x0a); |
| 998 | scc8530_set_status(scc, 0x0a); |
| 999 | 999 | else |
| 1000 | | scc_set_status(scc, 0x02); |
| 1000 | scc8530_set_status(scc, 0x02); |
| 1001 | 1001 | |
| 1002 | 1002 | last_was_x ^= 1; |
| 1003 | 1003 | } |
| 1004 | 1004 | else |
| 1005 | 1005 | { |
| 1006 | 1006 | if (x) |
| 1007 | | scc_set_status(scc, 0x0a); |
| 1007 | scc8530_set_status(scc, 0x0a); |
| 1008 | 1008 | else |
| 1009 | | scc_set_status(scc, 0x02); |
| 1009 | scc8530_set_status(scc, 0x02); |
| 1010 | 1010 | } |
| 1011 | 1011 | |
| 1012 | 1012 | //cputag_set_input_line(machine, "maincpu", 2, ASSERT_LINE); |
| r6474 | r6475 | |
| 1020 | 1020 | const device_config *scc = devtag_get_device(space->machine, "scc"); |
| 1021 | 1021 | UINT16 result; |
| 1022 | 1022 | |
| 1023 | | result = scc_r(scc, offset); |
| 1023 | result = scc8530_r(scc, offset); |
| 1024 | 1024 | return (result << 8) | result; |
| 1025 | 1025 | } |
| 1026 | 1026 | |
| r6474 | r6475 | |
| 1029 | 1029 | WRITE16_HANDLER ( mac_scc_w ) |
| 1030 | 1030 | { |
| 1031 | 1031 | const device_config *scc = devtag_get_device(space->machine, "scc"); |
| 1032 | | scc_w(scc, offset, (UINT8) data); |
| 1032 | scc8530_w(scc, offset, (UINT8) data); |
| 1033 | 1033 | } |
| 1034 | 1034 | |
| 1035 | 1035 | WRITE16_HANDLER ( mac_scc_2_w ) |
| r6474 | r6475 | |
| 1037 | 1037 | const device_config *scc = devtag_get_device(space->machine, "scc"); |
| 1038 | 1038 | UINT8 wdata = data>>8; |
| 1039 | 1039 | |
| 1040 | | scc_w(scc, offset, wdata); |
| 1040 | scc8530_w(scc, offset, wdata); |
| 1041 | 1041 | } |
| 1042 | 1042 | |
| 1043 | 1043 | |
src/mess/machine/nes.c
| r6474 | r6475 | |
| 96 | 96 | memory for the bank 2 pointer */ |
| 97 | 97 | if (nes_fds.data == NULL) |
| 98 | 98 | nes_fds.data = auto_alloc_array(machine, UINT8, 0x8000 ); |
| 99 | | memory_install_read8_handler(space, 0x4030, 0x403f, 0, 0, fds_r); |
| 99 | memory_install_read8_handler(space, 0x4030, 0x403f, 0, 0, nes_fds_r); |
| 100 | 100 | memory_install_read8_handler(space, 0x6000, 0xdfff, 0, 0, SMH_BANK(2)); |
| 101 | 101 | memory_install_read8_handler(space, 0xe000, 0xffff, 0, 0, SMH_BANK(1)); |
| 102 | 102 | |
| 103 | | memory_install_write8_handler(space, 0x4020, 0x402f, 0, 0, fds_w); |
| 103 | memory_install_write8_handler(space, 0x4020, 0x402f, 0, 0, nes_fds_w); |
| 104 | 104 | memory_install_write8_handler(space, 0x6000, 0xdfff, 0, 0, SMH_BANK(2)); |
| 105 | 105 | |
| 106 | 106 | memory_set_bankptr(machine, 1, &nes.rom[0xe000]); |
| 107 | 107 | memory_set_bankptr(machine, 2, nes_fds.data ); |
| 108 | 108 | break; |
| 109 | 109 | case 50: |
| 110 | | memory_install_write8_handler(space, 0x4020, 0x403f, 0, 0, mapper50_add_w); |
| 111 | | memory_install_write8_handler(space, 0x40a0, 0x40bf, 0, 0, mapper50_add_w); |
| 110 | memory_install_write8_handler(space, 0x4020, 0x403f, 0, 0, nes_mapper50_add_w); |
| 111 | memory_install_write8_handler(space, 0x40a0, 0x40bf, 0, 0, nes_mapper50_add_w); |
| 112 | 112 | default: |
| 113 | 113 | nes.slow_banking = 0; |
| 114 | 114 | memory_install_read8_handler(space, 0x6000, 0x7fff, 0, 0, SMH_BANK(5)); |
| r6474 | r6475 | |
| 130 | 130 | /* Set up the mapper callbacks */ |
| 131 | 131 | if (nes.format == 1) |
| 132 | 132 | { |
| 133 | mmc_intf intf = { 0 }; |
| 133 | 134 | const mmc *mapper; |
| 134 | 135 | |
| 135 | 136 | mapper = nes_mapper_lookup(nes.mapper); |
| 136 | 137 | if (mapper) |
| 137 | 138 | { |
| 138 | | mmc_write_low = mapper->mmc_write_low; |
| 139 | | mmc_read_low = mapper->mmc_read_low; |
| 140 | | mmc_write_mid = mapper->mmc_write_mid; |
| 141 | | mmc_write = mapper->mmc_write; |
| 139 | intf.mmc_write_low = mapper->mmc_write_low; |
| 140 | intf.mmc_read_low = mapper->mmc_read_low; |
| 141 | intf.mmc_write_mid = mapper->mmc_write_mid; |
| 142 | intf.mmc_write = mapper->mmc_write; |
| 143 | nes_mapper_init(&intf); |
| 142 | 144 | ppu_latch = mapper->ppu_latch; |
| 143 | 145 | } |
| 144 | 146 | else |
| 145 | 147 | { |
| 146 | 148 | logerror("Mapper %d is not yet supported, defaulting to no mapper.\n",nes.mapper); |
| 147 | | mmc_write_low = mmc_write_mid = mmc_write = NULL; |
| 148 | | mmc_read_low = NULL; |
| 149 | | ppu_latch = NULL; |
| 149 | nes_mapper_init(&intf); |
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | else if (nes.format == 2) |
| 153 | 153 | { |
| 154 | mmc_intf intf = { 0 }; |
| 154 | 155 | const unif *board; |
| 155 | 156 | |
| 156 | 157 | board = nes_unif_lookup(nes.board); |
| 157 | 158 | if (board) |
| 158 | 159 | { |
| 159 | | mmc_write_low = board->mmc_write_low; |
| 160 | | mmc_read_low = board->mmc_read_low; |
| 161 | | mmc_write_mid = board->mmc_write_mid; |
| 162 | | mmc_write = board->mmc_write; |
| 160 | intf.mmc_write_low = board->mmc_write_low; |
| 161 | intf.mmc_read_low = board->mmc_read_low; |
| 162 | intf.mmc_write_mid = board->mmc_write_mid; |
| 163 | intf.mmc_write = board->mmc_write; |
| 164 | nes_mapper_init(&intf); |
| 163 | 165 | ppu_latch = board->ppu_latch; |
| 164 | 166 | } |
| 165 | 167 | else |
| 166 | 168 | { |
| 167 | 169 | logerror("Board %s is not yet supported, defaulting to no mapper.\n", nes.board); |
| 168 | | mmc_write_low = mmc_write_mid = mmc_write = NULL; |
| 169 | | mmc_read_low = NULL; |
| 170 | nes_mapper_init(&intf); |
| 170 | 171 | ppu_latch = NULL; |
| 171 | 172 | } |
| 172 | 173 | } |
| r6474 | r6475 | |
| 209 | 210 | |
| 210 | 211 | /* Reset the mapper variables. Will also mark the char-gen ram as dirty */ |
| 211 | 212 | if (nes.format == 1) |
| 212 | | mapper_reset(machine, nes.mapper); |
| 213 | nes_mapper_reset(machine, nes.mapper); |
| 213 | 214 | |
| 214 | 215 | if (nes.format == 2) |
| 215 | | unif_reset(machine, nes.board); |
| 216 | nes_unif_reset(machine, nes.board); |
| 216 | 217 | |
| 217 | 218 | /* Reset the serial input ports */ |
| 218 | 219 | in_0.shift = 0; |
src/mess/machine/mz700.c
| r6474 | r6475 | |
| 115 | 115 | mz->ppi = devtag_get_device(machine, "ppi8255"); |
| 116 | 116 | |
| 117 | 117 | /* reset memory map to defaults */ |
| 118 | | mz_bank_4_w(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0, 0); |
| 118 | mz700_bank_4_w(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0, 0); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | |
| r6474 | r6475 | |
| 221 | 221 | return 0xff; |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | | WRITE8_HANDLER( mz_bank_1_w ) |
| 224 | WRITE8_HANDLER( mz700_bank_1_w ) |
| 225 | 225 | { |
| 226 | 226 | const address_space *spc = cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 227 | 227 | mz_state *mz = space->machine->driver_data; |
| r6474 | r6475 | |
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | | WRITE8_HANDLER( mz_bank_2_w ) |
| 251 | WRITE8_HANDLER( mz700_bank_2_w ) |
| 252 | 252 | { |
| 253 | 253 | const address_space *spc = cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 254 | 254 | |
| r6474 | r6475 | |
| 256 | 256 | memory_set_bankptr(space->machine, 1, memory_region(space->machine, "monitor")); |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | | WRITE8_HANDLER( mz_bank_3_w ) |
| 259 | WRITE8_HANDLER( mz700_bank_3_w ) |
| 260 | 260 | { |
| 261 | 261 | const address_space *spc = cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 262 | 262 | mz_state *mz = space->machine->driver_data; |
| r6474 | r6475 | |
| 304 | 304 | } |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | | WRITE8_HANDLER( mz_bank_4_w ) |
| 307 | WRITE8_HANDLER( mz700_bank_4_w ) |
| 308 | 308 | { |
| 309 | 309 | const address_space *spc = cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 310 | 310 | mz_state *mz = space->machine->driver_data; |
| r6474 | r6475 | |
| 312 | 312 | if (mz->mz700_mode) |
| 313 | 313 | { |
| 314 | 314 | mz->mz700_ram_lock = FALSE; /* reset lock */ |
| 315 | | mz_bank_2_w(space, 0, 0); /* switch in monitor rom */ |
| 316 | | mz_bank_3_w(space, 0, 0); /* switch in videoram, colorram, and mmio */ |
| 315 | mz700_bank_2_w(space, 0, 0); /* switch in monitor rom */ |
| 316 | mz700_bank_3_w(space, 0, 0); /* switch in videoram, colorram, and mmio */ |
| 317 | 317 | |
| 318 | 318 | /* rest is ram is always ram in mz700 mode */ |
| 319 | 319 | memory_install_readwrite8_handler(spc, 0x1000, 0xcfff, 0, 0, SMH_BANK(2), SMH_BANK(2)); |
| r6474 | r6475 | |
| 359 | 359 | } |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | | WRITE8_HANDLER( mz_bank_5_w ) |
| 362 | WRITE8_HANDLER( mz700_bank_5_w ) |
| 363 | 363 | { |
| 364 | 364 | const address_space *spc = cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 365 | 365 | mz_state *mz = space->machine->driver_data; |
| r6474 | r6475 | |
| 378 | 378 | } |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | | WRITE8_HANDLER( mz_bank_6_w ) |
| 381 | WRITE8_HANDLER( mz700_bank_6_w ) |
| 382 | 382 | { |
| 383 | 383 | mz_state *mz = space->machine->driver_data; |
| 384 | 384 | |
| r6474 | r6475 | |
| 388 | 388 | |
| 389 | 389 | /* restore access */ |
| 390 | 390 | if (mz->mz700_ram_vram) |
| 391 | | mz_bank_3_w(space, 0, 0); |
| 391 | mz700_bank_3_w(space, 0, 0); |
| 392 | 392 | else |
| 393 | | mz_bank_1_w(space, 0, 0); |
| 393 | mz700_bank_1_w(space, 0, 0); |
| 394 | 394 | } |
| 395 | 395 | else |
| 396 | 396 | { |
| r6474 | r6475 | |
| 398 | 398 | |
| 399 | 399 | /* restore access from 0xe000 to 0xffff */ |
| 400 | 400 | if (mz->mz800_ram_monitor) |
| 401 | | mz_bank_3_w(space, 0, 0); |
| 401 | mz700_bank_3_w(space, 0, 0); |
| 402 | 402 | else |
| 403 | | mz_bank_1_w(space, 0, 0); |
| 403 | mz700_bank_1_w(space, 0, 0); |
| 404 | 404 | } |
| 405 | 405 | } |
| 406 | 406 | |
| r6474 | r6475 | |
| 654 | 654 | // { |
| 655 | 655 | // logerror("mz800_display_mode_w: switching mode to %s\n", (BIT(data, 3) ? "mz700" : "mz800")); |
| 656 | 656 | // mz->mz700_mode = BIT(data, 3); |
| 657 | | // mz_bank_4_w(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0, 0); |
| 657 | // mz700_bank_4_w(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0, 0); |
| 658 | 658 | // } |
| 659 | 659 | } |
| 660 | 660 | |
src/mess/machine/nes_mmc.c
| r6474 | r6475 | |
| 176 | 176 | static UINT8 IRQ_status; |
| 177 | 177 | static UINT8 IRQ_mode; |
| 178 | 178 | |
| 179 | | int MMC1_extended; /* 0 = normal MMC1 cart, 1 = 512k MMC1, 2 = 1024k MMC1 */ |
| 179 | //int MMC1_extended; /* 0 = normal MMC1 cart, 1 = 512k MMC1, 2 = 1024k MMC1 */ |
| 180 | 180 | |
| 181 | | write8_space_func mmc_write_low; |
| 182 | | read8_space_func mmc_read_low; |
| 183 | | write8_space_func mmc_write_mid; |
| 184 | | read8_space_func mmc_read_mid; |
| 185 | | write8_space_func mmc_write; |
| 181 | static write8_space_func mmc_write_low; |
| 182 | static read8_space_func mmc_read_low; |
| 183 | static write8_space_func mmc_write_mid; |
| 184 | static write8_space_func mmc_write; |
| 186 | 185 | |
| 187 | 186 | static int mult1, mult2; |
| 188 | 187 | |
| r6474 | r6475 | |
| 216 | 215 | static int MMC5_scanline; |
| 217 | 216 | static int MMC5_floodtile; |
| 218 | 217 | static int MMC5_floodattr; |
| 219 | | UINT8 MMC5_vram[0x400]; |
| 220 | | int MMC5_vram_control; |
| 218 | UINT8 nes_mmc5_vram[0x400]; |
| 219 | int nes_mmc5_vram_control; |
| 221 | 220 | |
| 222 | 221 | // these might be unified in single mmc_reg[] array, together with mmc_cmd1 & mmc_cmd2 |
| 223 | 222 | // but be careful that MMC3 clones often use mmc_cmd1/mmc_cmd2 (from base MMC3) AND additional regs below! |
| r6474 | r6475 | |
| 657 | 656 | base_ptr = nes.vrom; |
| 658 | 657 | break; |
| 659 | 658 | case EXRAM: |
| 660 | | base_ptr = MMC5_vram; |
| 659 | base_ptr = nes_mmc5_vram; |
| 661 | 660 | break; |
| 662 | 661 | case CIRAM: |
| 663 | 662 | default: |
| r6474 | r6475 | |
| 1551 | 1550 | |
| 1552 | 1551 | /************************************************************* |
| 1553 | 1552 | |
| 1554 | | mapper_reset |
| 1553 | nes_mapper_reset |
| 1555 | 1554 | |
| 1556 | 1555 | Resets the mapper bankswitch areas to their defaults. |
| 1557 | 1556 | It returns a value "err" that indicates if it was |
| r6474 | r6475 | |
| 1563 | 1562 | |
| 1564 | 1563 | *************************************************************/ |
| 1565 | 1564 | |
| 1566 | | int mapper_reset( running_machine *machine, int mmc_num ) |
| 1565 | int nes_mapper_reset( running_machine *machine, int mmc_num ) |
| 1567 | 1566 | { |
| 1568 | 1567 | nes_state *state = machine->driver_data; |
| 1569 | 1568 | int err = 0, i; |
| r6474 | r6475 | |
| 1590 | 1589 | |
| 1591 | 1590 | mapper_warning = 0; |
| 1592 | 1591 | |
| 1593 | | MMC5_vram_control = 0; |
| 1592 | nes_mmc5_vram_control = 0; |
| 1594 | 1593 | |
| 1595 | 1594 | /* Point the WRAM/battery area to the first RAM bank */ |
| 1596 | 1595 | if (mmc_num != 20) |
| r6474 | r6475 | |
| 1614 | 1613 | return err; |
| 1615 | 1614 | } |
| 1616 | 1615 | |
| 1616 | void nes_mapper_init(const mmc_intf *intf) |
| 1617 | { |
| 1618 | mmc_write_low = intf->mmc_write_low; |
| 1619 | mmc_read_low = intf->mmc_read_low; |
| 1620 | mmc_write_mid = intf->mmc_write_mid; |
| 1621 | mmc_write = intf->mmc_write; |
| 1622 | } |
| 1623 | |
| 1617 | 1624 | /************************************************************* |
| 1618 | 1625 | |
| 1619 | 1626 | Support for .unf Files |
| r6474 | r6475 | |
| 1624 | 1631 | #include "machine/nes_unif.c" |
| 1625 | 1632 | |
| 1626 | 1633 | // WIP code |
| 1627 | | int unif_reset( running_machine *machine, const char *board ) |
| 1634 | int nes_unif_reset( running_machine *machine, const char *board ) |
| 1628 | 1635 | { |
| 1629 | 1636 | nes_state *state = machine->driver_data; |
| 1630 | 1637 | int err = 0; |
src/mess/machine/nes_mmc.h
| r6474 | r6475 | |
| 1 | 1 | #ifndef __MMC_H |
| 2 | 2 | #define __MMC_H |
| 3 | 3 | |
| 4 | typedef struct __mmc_intf |
| 5 | { |
| 6 | write8_space_func mmc_write_low; /* $4100-$5fff write routine */ |
| 7 | read8_space_func mmc_read_low; /* $4100-$5fff read routine */ |
| 8 | write8_space_func mmc_write_mid; /* $6000-$7fff write routine */ |
| 9 | write8_space_func mmc_write; /* $8000-$ffff write routine */ |
| 10 | } mmc_intf; |
| 11 | |
| 4 | 12 | typedef struct __mmc |
| 5 | 13 | { |
| 6 | 14 | int iNesMapper; /* iNES Mapper # */ |
| r6474 | r6475 | |
| 40 | 48 | |
| 41 | 49 | const unif *nes_unif_lookup(const char *board); |
| 42 | 50 | |
| 43 | | extern int MMC1_extended; /* 0 = normal MMC1 cart, 1 = 512k MMC1, 2 = 1024k MMC1 */ |
| 51 | //extern int MMC1_extended; /* 0 = normal MMC1 cart, 1 = 512k MMC1, 2 = 1024k MMC1 */ |
| 44 | 52 | |
| 45 | 53 | #define MMC5_VRAM |
| 46 | 54 | |
| 47 | | extern UINT8 MMC5_vram[0x400]; |
| 48 | | extern int MMC5_vram_control; |
| 55 | extern UINT8 nes_mmc5_vram[0x400]; |
| 56 | extern int nes_mmc5_vram_control; |
| 49 | 57 | |
| 50 | | extern write8_space_func mmc_write_low; |
| 51 | | extern read8_space_func mmc_read_low; |
| 52 | | extern write8_space_func mmc_write_mid; |
| 53 | | extern read8_space_func mmc_read_mid; |
| 54 | | extern write8_space_func mmc_write; |
| 58 | void nes_mapper_init( const mmc_intf *intf ); |
| 59 | int nes_mapper_reset( running_machine *machine, int mapperNum ); |
| 60 | int nes_unif_reset( running_machine *machine, const char *board ); |
| 55 | 61 | |
| 56 | | int mapper_reset( running_machine *machine, int mapperNum ); |
| 57 | | int unif_reset( running_machine *machine, const char *board ); |
| 58 | | |
| 59 | 62 | WRITE8_HANDLER( nes_low_mapper_w ); |
| 60 | 63 | READ8_HANDLER( nes_low_mapper_r ); |
| 61 | 64 | READ8_HANDLER( nes_mid_mapper_r ); |
| r6474 | r6475 | |
| 66 | 69 | WRITE8_HANDLER( nes_nt_w ); |
| 67 | 70 | READ8_HANDLER( nes_nt_r ); |
| 68 | 71 | |
| 69 | | READ8_HANDLER( fds_r ); |
| 70 | | WRITE8_HANDLER( fds_w ); |
| 71 | | WRITE8_HANDLER( mapper50_add_w ); |
| 72 | READ8_HANDLER( nes_fds_r ); |
| 73 | WRITE8_HANDLER( nes_fds_w ); |
| 74 | WRITE8_HANDLER( nes_mapper50_add_w ); |
| 72 | 75 | |
| 73 | 76 | //TEMPORARY PPU STUFF |
| 74 | 77 | |
src/mess/machine/nes_ines.c
| r6474 | r6475 | |
| 386 | 386 | /* $5c00 - $5fff: extended videoram attributes */ |
| 387 | 387 | if ((offset >= 0x1b00) && (offset <= 0x1eff)) |
| 388 | 388 | { |
| 389 | | return MMC5_vram[offset - 0x1b00]; |
| 389 | return nes_mmc5_vram[offset - 0x1b00]; |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | switch (offset) |
| r6474 | r6475 | |
| 442 | 442 | if ((offset >= 0x1b00) && (offset <= 0x1eff)) |
| 443 | 443 | { |
| 444 | 444 | if (MMC5_vram_protect == 0x03) |
| 445 | | MMC5_vram[offset - 0x1b00] = data; |
| 445 | nes_mmc5_vram[offset - 0x1b00] = data; |
| 446 | 446 | return; |
| 447 | 447 | } |
| 448 | 448 | |
| r6474 | r6475 | |
| 474 | 474 | break; |
| 475 | 475 | |
| 476 | 476 | case 0x1004: /* $5104 - Extra VRAM (EXRAM) control */ |
| 477 | | MMC5_vram_control = data; |
| 477 | nes_mmc5_vram_control = data; |
| 478 | 478 | LOG_MMC(("MMC5 exram control: %02x\n", data)); |
| 479 | 479 | break; |
| 480 | 480 | |
| r6474 | r6475 | |
| 1862 | 1862 | } |
| 1863 | 1863 | } |
| 1864 | 1864 | |
| 1865 | | READ8_HANDLER( fds_r ) |
| 1865 | READ8_HANDLER( nes_fds_r ) |
| 1866 | 1866 | { |
| 1867 | 1867 | UINT8 ret = 0x00; |
| 1868 | 1868 | LOG_MMC(("fds_r, offset: %04x\n", offset)); |
| r6474 | r6475 | |
| 1914 | 1914 | return ret; |
| 1915 | 1915 | } |
| 1916 | 1916 | |
| 1917 | | WRITE8_HANDLER( fds_w ) |
| 1917 | WRITE8_HANDLER( nes_fds_w ) |
| 1918 | 1918 | { |
| 1919 | 1919 | LOG_MMC(("fds_w, offset: %04x, data: %02x\n", offset, data)); |
| 1920 | 1920 | |
| r6474 | r6475 | |
| 3207 | 3207 | } |
| 3208 | 3208 | |
| 3209 | 3209 | /* This goes to 0x4020-0x403f */ |
| 3210 | | WRITE8_HANDLER( mapper50_add_w ) |
| 3210 | WRITE8_HANDLER( nes_mapper50_add_w ) |
| 3211 | 3211 | { |
| 3212 | 3212 | UINT8 prg; |
| 3213 | | LOG_MMC(("mapper50_add_w, offset: %04x, data: %02x\n", offset, data)); |
| 3213 | LOG_MMC(("nes_mapper50_add_w, offset: %04x, data: %02x\n", offset, data)); |
| 3214 | 3214 | |
| 3215 | 3215 | prg = (data & 0x08) | ((data & 0x06) >> 1) | ((data & 0x01) << 2); |
| 3216 | 3216 | prg8_cd(space->machine, prg); |
src/mess/machine/ti99_4x.c
| r6474 | r6475 | |
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | | int is_99_8() |
| 290 | int ti99_is_99_8() |
| 291 | 291 | { |
| 292 | 292 | return ti99_model == model_99_8; |
| 293 | 293 | } |
| r6474 | r6475 | |
| 540 | 540 | } |
| 541 | 541 | /* Check whether we have locked the cartslot. This uses GROM, which the 4p doesn't have. */ |
| 542 | 542 | if (ti99_model != model_99_4p) |
| 543 | | lock_cartridge_slot(cartslots, (input_port_read(machine, "CFG") >> config_cartslot_bit) & config_cartslot_mask); |
| 543 | ti99_lock_cartridge_slot(cartslots, (input_port_read(machine, "CFG") >> config_cartslot_bit) & config_cartslot_mask); |
| 544 | 544 | |
| 545 | 545 | switch (xRAM_kind) |
| 546 | 546 | { |
| r6474 | r6475 | |
| 675 | 675 | Backdoor function that is called by hsgpl, so that the machine code knows |
| 676 | 676 | whether hsgpl or console GROMs are active |
| 677 | 677 | */ |
| 678 | | void set_hsgpl_crdena(int data) |
| 678 | void ti99_set_hsgpl_crdena(int data) |
| 679 | 679 | { |
| 680 | 680 | hsgpl_crdena = (data != 0); |
| 681 | 681 | } |
| r6474 | r6475 | |
| 928 | 928 | { |
| 929 | 929 | /* Pass the (one and only) program counter for GROMs. The |
| 930 | 930 | buffer is set and used in the cartridge chip. */ |
| 931 | | reply = cartridge_grom_read(cartslots, console_GROMs.addr-0x6000); |
| 931 | reply = ti99_cartridge_grom_read(cartslots, console_GROMs.addr-0x6000); |
| 932 | 932 | } |
| 933 | 933 | else |
| 934 | 934 | { |
| r6474 | r6475 | |
| 984 | 984 | */ |
| 985 | 985 | |
| 986 | 986 | /* Activates a slot in the multi-cartridge extender. */ |
| 987 | | cartridge_slot_set(cartslots, (offset & 0x01fe)/2); |
| 987 | ti99_cartridge_slot_set(cartslots, (offset & 0x01fe)/2); |
| 988 | 988 | |
| 989 | 989 | if (offset & 1) |
| 990 | 990 | { /* Read GROM address |
| r6474 | r6475 | |
| 1035 | 1035 | // cpu_spinuntil_time(space->machine->firstcpu, ATTOTIME_IN_USEC(6)); |
| 1036 | 1036 | |
| 1037 | 1037 | /* Activates a slot in the multi-cartridge extender. */ |
| 1038 | | cartridge_slot_set(cartslots, (offset & 0x01fe)/2); |
| 1038 | ti99_cartridge_slot_set(cartslots, (offset & 0x01fe)/2); |
| 1039 | 1039 | |
| 1040 | 1040 | // 1001 1wbb bbbb bbr0 |
| 1041 | 1041 | |
| r6474 | r6475 | |
| 1096 | 1096 | |
| 1097 | 1097 | /* Activates a slot in the multi-cartridge extender. */ |
| 1098 | 1098 | // 1001 1wbb bbbb bbr0 |
| 1099 | | cartridge_slot_set(cartslots, (offset & 0x03fc)/4); |
| 1099 | ti99_cartridge_slot_set(cartslots, (offset & 0x03fc)/4); |
| 1100 | 1100 | |
| 1101 | 1101 | if (offset & 2) |
| 1102 | 1102 | { |
| r6474 | r6475 | |
| 1128 | 1128 | cpu_adjust_icount(space->machine->firstcpu,-4/*20+3*/); /* from 4 to 23? */ |
| 1129 | 1129 | |
| 1130 | 1130 | /* Activates a slot in the multi-cartridge extender. */ |
| 1131 | | cartridge_slot_set(cartslots, (offset & 0x03fc)/4); |
| 1131 | ti99_cartridge_slot_set(cartslots, (offset & 0x03fc)/4); |
| 1132 | 1132 | |
| 1133 | 1133 | if (offset & 2) |
| 1134 | 1134 | { |
src/mess/machine/bbc.c
| r6474 | r6475 | |
| 614 | 614 | const device_config *via_1 = devtag_get_device(space->machine, "via6522_1"); |
| 615 | 615 | |
| 616 | 616 | myo=offset-0x200; |
| 617 | | if ((myo>=0x00) && (myo<=0x07)) return BBC_6845_r(space, myo-0x00); /* Video Controller */ |
| 617 | if ((myo>=0x00) && (myo<=0x07)) return bbc_6845_r(space, myo-0x00); /* Video Controller */ |
| 618 | 618 | if ((myo>=0x08) && (myo<=0x0f)) |
| 619 | 619 | { |
| 620 | 620 | const device_config *acia = devtag_get_device(space->machine, "acia6850"); |
| r6474 | r6475 | |
| 653 | 653 | const device_config *via_1 = devtag_get_device(space->machine, "via6522_1"); |
| 654 | 654 | |
| 655 | 655 | myo=offset-0x200; |
| 656 | | if ((myo>=0x00) && (myo<=0x07)) BBC_6845_w(space, myo-0x00,data); /* Video Controller */ |
| 656 | if ((myo>=0x00) && (myo<=0x07)) bbc_6845_w(space, myo-0x00,data); /* Video Controller */ |
| 657 | 657 | if ((myo>=0x08) && (myo<=0x0f)) |
| 658 | 658 | { |
| 659 | 659 | const device_config *acia = devtag_get_device(space->machine, "acia6850"); |
| r6474 | r6475 | |
| 663 | 663 | else |
| 664 | 664 | acia6850_data_w(acia, 0, data); |
| 665 | 665 | } |
| 666 | | if ((myo>=0x10) && (myo<=0x17)) BBC_SerialULA_w(space, myo-0x10,data); /* Serial System Chip */ |
| 666 | if ((myo>=0x10) && (myo<=0x17)) bbc_SerialULA_w(space, myo-0x10,data); /* Serial System Chip */ |
| 667 | 667 | if ((myo>=0x18) && (myo<=0x1f)) uPD7002_w(devtag_get_device(space->machine, "upd7002"),myo-0x18,data); /* A to D converter */ |
| 668 | 668 | if ((myo>=0x20) && (myo<=0x23)) bbc_videoULA_w(space, myo-0x20,data); /* VideoULA */ |
| 669 | 669 | if ((myo>=0x24) && (myo<=0x27)) bbcm_wd1770l_write(space, myo-0x24,data); /* 1770 */ |
| r6474 | r6475 | |
| 1340 | 1340 | via_cb1_w(via_0, 0,data); |
| 1341 | 1341 | } |
| 1342 | 1342 | |
| 1343 | | const uPD7002_interface BBC_uPD7002 = |
| 1343 | const uPD7002_interface bbc_uPD7002 = |
| 1344 | 1344 | { |
| 1345 | 1345 | BBC_get_analogue_input, |
| 1346 | 1346 | BBC_uPD7002_EOC |
| r6474 | r6475 | |
| 1454 | 1454 | |
| 1455 | 1455 | |
| 1456 | 1456 | |
| 1457 | | WRITE8_HANDLER ( BBC_SerialULA_w ) |
| 1457 | WRITE8_HANDLER ( bbc_SerialULA_w ) |
| 1458 | 1458 | { |
| 1459 | 1459 | BBC_Cassette_motor(space->machine, (data & 0x80) >> 7); |
| 1460 | 1460 | } |
src/mess/drivers/3do.c
| r6474 | r6475 | |
| 116 | 116 | AM_RANGE(0x00000000, 0x001FFFFF) AM_RAMBANK(1) AM_BASE(&dram) /* DRAM */ |
| 117 | 117 | AM_RANGE(0x00200000, 0x002FFFFF) AM_RAM AM_BASE(&vram) /* VRAM */ |
| 118 | 118 | AM_RANGE(0x03000000, 0x030FFFFF) AM_ROMBANK(2) /* BIOS */ |
| 119 | | AM_RANGE(0x03140000, 0x0315FFFF) AM_READWRITE(nvarea_r, nvarea_w) /* NVRAM */ |
| 120 | | AM_RANGE(0x03180000, 0x031FFFFF) AM_READWRITE(unk_318_r, unk_318_w) /* ???? */ |
| 121 | | AM_RANGE(0x03200000, 0x032FFFFF) AM_READWRITE(vram_sport_r, vram_sport_w) /* special vram access1 */ |
| 122 | | AM_RANGE(0x03300000, 0x033FFFFF) AM_READWRITE(madam_r, madam_w) /* address decoder */ |
| 123 | | AM_RANGE(0x03400000, 0x034FFFFF) AM_READWRITE(clio_r, clio_w) /* io controller */ |
| 119 | AM_RANGE(0x03140000, 0x0315FFFF) AM_READWRITE(_3do_nvarea_r, _3do_nvarea_w) /* NVRAM */ |
| 120 | AM_RANGE(0x03180000, 0x031FFFFF) AM_READWRITE(_3do_unk_318_r, _3do_unk_318_w) /* ???? */ |
| 121 | AM_RANGE(0x03200000, 0x032FFFFF) AM_READWRITE(_3do_vram_sport_r, _3do_vram_sport_w) /* special vram access1 */ |
| 122 | AM_RANGE(0x03300000, 0x033FFFFF) AM_READWRITE(_3do_madam_r, _3do_madam_w) /* address decoder */ |
| 123 | AM_RANGE(0x03400000, 0x034FFFFF) AM_READWRITE(_3do_clio_r, _3do_clio_w) /* io controller */ |
| 124 | 124 | ADDRESS_MAP_END |
| 125 | 125 | |
| 126 | 126 | |
| r6474 | r6475 | |
| 135 | 135 | /* start with overlay enabled */ |
| 136 | 136 | memory_set_bank(machine, 1, 1); |
| 137 | 137 | |
| 138 | | madam_init(); |
| 139 | | clio_init(); |
| 138 | _3do_madam_init(); |
| 139 | _3do_clio_init(); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | |
src/mess/drivers/coco.c
| r6474 | r6475 | |
| 196 | 196 | AM_RANGE(0xff90, 0xffbf) AM_NOP |
| 197 | 197 | AM_RANGE(0xffc0, 0xffdf) AM_DEVWRITE("sam", sam6883_w) |
| 198 | 198 | AM_RANGE(0xffe0, 0xffe1) AM_NOP |
| 199 | | AM_RANGE(0xffe2, 0xffe2) AM_READWRITE(plus_reg_r,plus_reg_w) /* Dragon plus control / status reg */ |
| 199 | AM_RANGE(0xffe2, 0xffe2) AM_READWRITE(dgnplus_reg_r,dgnplus_reg_w) /* Dragon plus control / status reg */ |
| 200 | 200 | AM_RANGE(0xffe3, 0xffef) AM_NOP |
| 201 | 201 | AM_RANGE(0xfff0, 0xffff) AM_ROM AM_REGION("maincpu", 0x3ff0) |
| 202 | 202 | ADDRESS_MAP_END |
| r6474 | r6475 | |
| 271 | 271 | AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE("acia", acia_6551_r, acia_6551_w) |
| 272 | 272 | AM_RANGE(0xff20, 0xff23) AM_DEVREADWRITE("pia_1", pia6821_r, coco_pia_1_w) |
| 273 | 273 | AM_RANGE(0xff24, 0xff27) AM_DEVREADWRITE("pia_2", pia6821_r, pia6821_w) /* Third PIA on Dragon Alpha */ |
| 274 | | AM_RANGE(0Xff28, 0xff2b) AM_READWRITE(alpha_modem_r, alpha_modem_w) /* Modem, dummy to stop eror log ! */ |
| 275 | | AM_RANGE(0xff2c, 0xff2f) AM_READWRITE(wd2797_r, wd2797_w) /* Alpha onboard disk interface */ |
| 274 | AM_RANGE(0Xff28, 0xff2b) AM_READWRITE(dgnalpha_modem_r, dgnalpha_modem_w) /* Modem, dummy to stop eror log ! */ |
| 275 | AM_RANGE(0xff2c, 0xff2f) AM_READWRITE(dgnalpha_wd2797_r, dgnalpha_wd2797_w) /* Alpha onboard disk interface */ |
| 276 | 276 | AM_RANGE(0xff40, 0xff7f) AM_DEVREADWRITE("coco_cartslot", coco_cartridge_r, coco_cartridge_w) |
| 277 | 277 | AM_RANGE(0xff90, 0xffbf) AM_NOP |
| 278 | 278 | AM_RANGE(0xffc0, 0xffdf) AM_DEVWRITE("sam", sam6883_w) |
| 279 | 279 | AM_RANGE(0xffe0, 0xffef) AM_NOP |
| 280 | | AM_RANGE(0xfff0, 0xffff) AM_READ(dragon_alpha_mapped_irq_r) |
| 280 | AM_RANGE(0xfff0, 0xffff) AM_READ(dgnalpha_mapped_irq_r) |
| 281 | 281 | ADDRESS_MAP_END |
| 282 | 282 | |
| 283 | 283 | |
src/mess/drivers/vector06.c
| r6474 | r6475 | |
| 29 | 29 | static ADDRESS_MAP_START( vector06_io , ADDRESS_SPACE_IO, 8) |
| 30 | 30 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 31 | 31 | ADDRESS_MAP_UNMAP_HIGH |
| 32 | | AM_RANGE( 0x00, 0x03) AM_READWRITE(vector_8255_1_r, vector_8255_1_w ) |
| 33 | | AM_RANGE( 0x04, 0x07) AM_READWRITE(vector_8255_2_r, vector_8255_2_w ) |
| 32 | AM_RANGE( 0x00, 0x03) AM_READWRITE(vector06_8255_1_r, vector06_8255_1_w ) |
| 33 | AM_RANGE( 0x04, 0x07) AM_READWRITE(vector06_8255_2_r, vector06_8255_2_w ) |
| 34 | 34 | AM_RANGE( 0x0C, 0x0C) AM_WRITE ( vector06_color_set ) |
| 35 | 35 | AM_RANGE( 0x18, 0x18) AM_DEVREADWRITE("wd1793", wd17xx_data_r,wd17xx_data_w) |
| 36 | 36 | AM_RANGE( 0x19, 0x19) AM_DEVREADWRITE("wd1793", wd17xx_sector_r,wd17xx_sector_w) |
| 37 | 37 | AM_RANGE( 0x1A, 0x1A) AM_DEVREADWRITE("wd1793", wd17xx_track_r,wd17xx_track_w) |
| 38 | 38 | AM_RANGE( 0x1B, 0x1B) AM_DEVREADWRITE("wd1793", wd17xx_status_r,wd17xx_command_w) |
| 39 | | AM_RANGE( 0x1C, 0x1C) AM_WRITE(vector_disc_w) |
| 39 | AM_RANGE( 0x1C, 0x1C) AM_WRITE(vector06_disc_w) |
| 40 | 40 | ADDRESS_MAP_END |
| 41 | 41 | |
| 42 | 42 | /* Input ports */ |
src/mess/drivers/amstrad.c
| r6474 | r6475 | |
| 889 | 889 | MDRV_PALETTE_LENGTH(32) |
| 890 | 890 | MDRV_PALETTE_INIT(amstrad_cpc) |
| 891 | 891 | |
| 892 | | MDRV_MC6845_ADD( "mc6845", MC6845, XTAL_16MHz / 16, mc6845_amstrad_intf ) |
| 892 | MDRV_MC6845_ADD( "mc6845", MC6845, XTAL_16MHz / 16, amstrad_mc6845_intf ) |
| 893 | 893 | |
| 894 | 894 | MDRV_VIDEO_START(amstrad) |
| 895 | 895 | MDRV_VIDEO_UPDATE(amstrad) |
| r6474 | r6475 | |
| 951 | 951 | MDRV_PALETTE_LENGTH(4096) |
| 952 | 952 | MDRV_PALETTE_INIT(amstrad_plus) |
| 953 | 953 | |
| 954 | | MDRV_MC6845_ADD( "mc6845", MC6845, XTAL_40MHz / 40, mc6845_amstrad_plus_intf ) |
| 954 | MDRV_MC6845_ADD( "mc6845", MC6845, XTAL_40MHz / 40, amstrad_plus_mc6845_intf ) |
| 955 | 955 | |
| 956 | 956 | MDRV_VIDEO_START(amstrad) |
| 957 | 957 | MDRV_VIDEO_UPDATE(amstrad) |
| r6474 | r6475 | |
| 1007 | 1007 | MDRV_PALETTE_LENGTH(4096) |
| 1008 | 1008 | MDRV_PALETTE_INIT(amstrad_plus) |
| 1009 | 1009 | |
| 1010 | | MDRV_MC6845_ADD( "mc6845", MC6845, XTAL_40MHz / 40, mc6845_amstrad_plus_intf ) |
| 1010 | MDRV_MC6845_ADD( "mc6845", MC6845, XTAL_40MHz / 40, amstrad_plus_mc6845_intf ) |
| 1011 | 1011 | |
| 1012 | 1012 | MDRV_VIDEO_START(amstrad) |
| 1013 | 1013 | MDRV_VIDEO_UPDATE(amstrad) |
src/mess/drivers/poly88.c
| r6474 | r6475 | |
| 20 | 20 | AM_RANGE(0x1000, 0x1fff) AM_ROM // System Expansion area |
| 21 | 21 | AM_RANGE(0x2000, 0x3fff) AM_RAM // Minimal user RAM area |
| 22 | 22 | AM_RANGE(0x4000, 0xf7ff) AM_RAM |
| 23 | | AM_RANGE(0xf800, 0xfbff) AM_RAM AM_BASE(&poly_video_ram) // Video RAM |
| 23 | AM_RANGE(0xf800, 0xfbff) AM_RAM AM_BASE(&poly88_video_ram) // Video RAM |
| 24 | 24 | ADDRESS_MAP_END |
| 25 | 25 | |
| 26 | 26 | static ADDRESS_MAP_START( poly88_io , ADDRESS_SPACE_IO, 8) |
| 27 | 27 | ADDRESS_MAP_UNMAP_HIGH |
| 28 | 28 | AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("uart", msm8251_data_r,msm8251_data_w) |
| 29 | 29 | AM_RANGE(0x01, 0x01) AM_DEVREADWRITE("uart", msm8251_status_r,msm8251_control_w) |
| 30 | | AM_RANGE(0x04, 0x04) AM_WRITE(poly_baud_rate_w) |
| 31 | | AM_RANGE(0x08, 0x08) AM_WRITE(poly_intr_w) |
| 32 | | AM_RANGE(0xf8, 0xf8) AM_READ(poly_keyboard_r) |
| 30 | AM_RANGE(0x04, 0x04) AM_WRITE(poly88_baud_rate_w) |
| 31 | AM_RANGE(0x08, 0x08) AM_WRITE(poly88_intr_w) |
| 32 | AM_RANGE(0xf8, 0xf8) AM_READ(poly88_keyboard_r) |
| 33 | 33 | ADDRESS_MAP_END |
| 34 | 34 | |
| 35 | 35 | static ADDRESS_MAP_START(poly8813_mem, ADDRESS_SPACE_PROGRAM, 8) |
| r6474 | r6475 | |
| 37 | 37 | AM_RANGE(0x0000, 0x03ff) AM_ROM // Monitor ROM |
| 38 | 38 | AM_RANGE(0x0400, 0x0bff) AM_ROM // Disk System ROM |
| 39 | 39 | AM_RANGE(0x0c00, 0x0fff) AM_RAM // System RAM |
| 40 | | AM_RANGE(0x1800, 0x1bff) AM_RAM AM_BASE(&poly_video_ram) // Video RAM |
| 40 | AM_RANGE(0x1800, 0x1bff) AM_RAM AM_BASE(&poly88_video_ram) // Video RAM |
| 41 | 41 | AM_RANGE(0x2000, 0xffff) AM_RAM // RAM |
| 42 | 42 | ADDRESS_MAP_END |
| 43 | 43 | |
src/mess/drivers/mz700.c
| r6474 | r6475 | |
| 106 | 106 | static ADDRESS_MAP_START( mz700_io, ADDRESS_SPACE_IO, 8 ) |
| 107 | 107 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 108 | 108 | AM_RANGE(0xe0, 0xe0) AM_WRITE(mz700_bank_0_w) |
| 109 | | AM_RANGE(0xe1, 0xe1) AM_WRITE(mz_bank_1_w) |
| 110 | | AM_RANGE(0xe2, 0xe2) AM_WRITE(mz_bank_2_w) |
| 111 | | AM_RANGE(0xe3, 0xe3) AM_WRITE(mz_bank_3_w) |
| 112 | | AM_RANGE(0xe4, 0xe4) AM_WRITE(mz_bank_4_w) |
| 113 | | AM_RANGE(0xe5, 0xe5) AM_WRITE(mz_bank_5_w) |
| 114 | | AM_RANGE(0xe6, 0xe6) AM_WRITE(mz_bank_6_w) |
| 109 | AM_RANGE(0xe1, 0xe1) AM_WRITE(mz700_bank_1_w) |
| 110 | AM_RANGE(0xe2, 0xe2) AM_WRITE(mz700_bank_2_w) |
| 111 | AM_RANGE(0xe3, 0xe3) AM_WRITE(mz700_bank_3_w) |
| 112 | AM_RANGE(0xe4, 0xe4) AM_WRITE(mz700_bank_4_w) |
| 113 | AM_RANGE(0xe5, 0xe5) AM_WRITE(mz700_bank_5_w) |
| 114 | AM_RANGE(0xe6, 0xe6) AM_WRITE(mz700_bank_6_w) |
| 115 | 115 | ADDRESS_MAP_END |
| 116 | 116 | |
| 117 | 117 | static ADDRESS_MAP_START( mz800_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r6474 | r6475 | |
| 126 | 126 | AM_RANGE(0xd0, 0xd3) AM_DEVREADWRITE("ppi8255", i8255a_r, i8255a_w) |
| 127 | 127 | AM_RANGE(0xd4, 0xd7) AM_DEVREADWRITE("pit8253", pit8253_r, pit8253_w) |
| 128 | 128 | AM_RANGE(0xe0, 0xe0) AM_READWRITE(mz800_bank_0_r, mz800_bank_0_w) |
| 129 | | AM_RANGE(0xe1, 0xe1) AM_READWRITE(mz800_bank_1_r, mz_bank_1_w) |
| 130 | | AM_RANGE(0xe2, 0xe2) AM_WRITE(mz_bank_2_w) |
| 131 | | AM_RANGE(0xe3, 0xe3) AM_WRITE(mz_bank_3_w) |
| 132 | | AM_RANGE(0xe4, 0xe4) AM_WRITE(mz_bank_4_w) |
| 133 | | AM_RANGE(0xe5, 0xe5) AM_WRITE(mz_bank_5_w) |
| 134 | | AM_RANGE(0xe6, 0xe6) AM_WRITE(mz_bank_6_w) |
| 129 | AM_RANGE(0xe1, 0xe1) AM_READWRITE(mz800_bank_1_r, mz700_bank_1_w) |
| 130 | AM_RANGE(0xe2, 0xe2) AM_WRITE(mz700_bank_2_w) |
| 131 | AM_RANGE(0xe3, 0xe3) AM_WRITE(mz700_bank_3_w) |
| 132 | AM_RANGE(0xe4, 0xe4) AM_WRITE(mz700_bank_4_w) |
| 133 | AM_RANGE(0xe5, 0xe5) AM_WRITE(mz700_bank_5_w) |
| 134 | AM_RANGE(0xe6, 0xe6) AM_WRITE(mz700_bank_6_w) |
| 135 | 135 | AM_RANGE(0xea, 0xea) AM_READWRITE( mz800_ramdisk_r, mz800_ramdisk_w ) |
| 136 | 136 | AM_RANGE(0xeb, 0xeb) AM_WRITE( mz800_ramaddr_w ) |
| 137 | 137 | AM_RANGE(0xf0, 0xf0) AM_READ_PORT("atari_joy1") AM_WRITE(mz800_palette_w) |
src/mess/drivers/x68k.c
| r6474 | r6475 | |
| 540 | 540 | char val = 0; |
| 541 | 541 | char ipt = 0; |
| 542 | 542 | |
| 543 | | if(!(scc_get_reg_b(scc,5) & 0x02)) |
| 543 | if(!(scc8530_get_reg_b(scc,5) & 0x02)) |
| 544 | 544 | return 0xff; |
| 545 | 545 | |
| 546 | 546 | switch(x68k_sys.mouse.inputtype) |
| r6474 | r6475 | |
| 562 | 562 | x68k_sys.mouse.inputtype++; |
| 563 | 563 | if(x68k_sys.mouse.inputtype > 2) |
| 564 | 564 | { |
| 565 | | int val = scc_get_reg_b(scc, 0); |
| 565 | int val = scc8530_get_reg_b(scc, 0); |
| 566 | 566 | x68k_sys.mouse.inputtype = 0; |
| 567 | 567 | x68k_sys.mouse.bufferempty = 1; |
| 568 | 568 | val &= ~0x01; |
| 569 | | scc_set_reg_b(scc, 0, val); |
| 569 | scc8530_set_reg_b(scc, 0, val); |
| 570 | 570 | logerror("SCC: mouse buffer empty\n"); |
| 571 | 571 | } |
| 572 | 572 | |
| r6474 | r6475 | |
| 586 | 586 | switch(offset) |
| 587 | 587 | { |
| 588 | 588 | case 0: |
| 589 | | return scc_r(scc, 0); |
| 589 | return scc8530_r(scc, 0); |
| 590 | 590 | case 1: |
| 591 | 591 | return x68k_read_mouse(space->machine); |
| 592 | 592 | case 2: |
| 593 | | return scc_r(scc, 1); |
| 593 | return scc8530_r(scc, 1); |
| 594 | 594 | case 3: |
| 595 | | return scc_r(scc, 3); |
| 595 | return scc8530_r(scc, 3); |
| 596 | 596 | default: |
| 597 | 597 | return 0xff; |
| 598 | 598 | } |
| r6474 | r6475 | |
| 607 | 607 | switch(offset) |
| 608 | 608 | { |
| 609 | 609 | case 0: |
| 610 | | scc_w(scc, 0,(UINT8)data); |
| 611 | | if((scc_get_reg_b(scc, 5) & 0x02) != prev) |
| 610 | scc8530_w(scc, 0,(UINT8)data); |
| 611 | if((scc8530_get_reg_b(scc, 5) & 0x02) != prev) |
| 612 | 612 | { |
| 613 | | if(scc_get_reg_b(scc, 5) & 0x02) // Request to Send |
| 613 | if(scc8530_get_reg_b(scc, 5) & 0x02) // Request to Send |
| 614 | 614 | { |
| 615 | | int val = scc_get_reg_b(scc, 0); |
| 615 | int val = scc8530_get_reg_b(scc, 0); |
| 616 | 616 | x68k_sys.mouse.bufferempty = 0; |
| 617 | 617 | val |= 0x01; |
| 618 | | scc_set_reg_b(scc, 0,val); |
| 618 | scc8530_set_reg_b(scc, 0,val); |
| 619 | 619 | } |
| 620 | 620 | } |
| 621 | 621 | break; |
| 622 | 622 | case 1: |
| 623 | | scc_w(scc, 2,(UINT8)data); |
| 623 | scc8530_w(scc, 2,(UINT8)data); |
| 624 | 624 | break; |
| 625 | 625 | case 2: |
| 626 | | scc_w(scc, 1,(UINT8)data); |
| 626 | scc8530_w(scc, 1,(UINT8)data); |
| 627 | 627 | break; |
| 628 | 628 | case 3: |
| 629 | | scc_w(scc, 3,(UINT8)data); |
| 629 | scc8530_w(scc, 3,(UINT8)data); |
| 630 | 630 | break; |
| 631 | 631 | } |
| 632 | | prev = scc_get_reg_b(scc, 5) & 0x02; |
| 632 | prev = scc8530_get_reg_b(scc, 5) & 0x02; |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | static TIMER_CALLBACK(x68k_scc_ack) |
| r6474 | r6475 | |
| 642 | 642 | // return; |
| 643 | 643 | |
| 644 | 644 | // hard-code the IRQ vector for now, until the SCC code is more complete |
| 645 | | if((scc_get_reg_a(scc, 9) & 0x08) || (scc_get_reg_b(scc, 9) & 0x08)) // SCC reg WR9 is the same for both channels |
| 645 | if((scc8530_get_reg_a(scc, 9) & 0x08) || (scc8530_get_reg_b(scc, 9) & 0x08)) // SCC reg WR9 is the same for both channels |
| 646 | 646 | { |
| 647 | | if((scc_get_reg_b(scc, 1) & 0x18) != 0) // if bits 3 and 4 of WR1 are 0, then Rx IRQs are disabled on this channel |
| 647 | if((scc8530_get_reg_b(scc, 1) & 0x18) != 0) // if bits 3 and 4 of WR1 are 0, then Rx IRQs are disabled on this channel |
| 648 | 648 | { |
| 649 | | if(scc_get_reg_b(scc, 5) & 0x02) // RTS signal |
| 649 | if(scc8530_get_reg_b(scc, 5) & 0x02) // RTS signal |
| 650 | 650 | { |
| 651 | 651 | x68k_sys.mouse.irqactive = 1; |
| 652 | 652 | current_vector[5] = 0x54; |
src/mess/drivers/intv.c
| r6474 | r6475 | |
| 34 | 34 | #include "driver.h" |
| 35 | 35 | #include "cpu/m6502/m6502.h" |
| 36 | 36 | #include "cpu/cp1610/cp1610.h" |
| 37 | | #include "video/stic.h" |
| 38 | 37 | #include "includes/intv.h" |
| 39 | 38 | #include "devices/cartslot.h" |
| 40 | 39 | #include "sound/ay8910.h" |
| r6474 | r6475 | |
| 342 | 341 | INPUT_PORTS_END |
| 343 | 342 | |
| 344 | 343 | static ADDRESS_MAP_START( intv_mem , ADDRESS_SPACE_PROGRAM, 16) |
| 345 | | AM_RANGE(0x0000, 0x003f) AM_READWRITE( stic_r, stic_w ) |
| 344 | AM_RANGE(0x0000, 0x003f) AM_READWRITE( intv_stic_r, intv_stic_w ) |
| 346 | 345 | AM_RANGE(0x0100, 0x01ef) AM_READWRITE( intv_ram8_r, intv_ram8_w ) |
| 347 | 346 | AM_RANGE(0x01f0, 0x01ff) AM_DEVREADWRITE("ay8910", AY8914_directread_port_0_lsb_r, AY8914_directwrite_port_0_lsb_w ) |
| 348 | 347 | AM_RANGE(0x0200, 0x035f) AM_READWRITE( intv_ram16_r, intv_ram16_w ) |
| r6474 | r6475 | |
| 353 | 352 | ADDRESS_MAP_END |
| 354 | 353 | |
| 355 | 354 | static ADDRESS_MAP_START( intvkbd_mem , ADDRESS_SPACE_PROGRAM, 16) |
| 356 | | AM_RANGE(0x0000, 0x003f) AM_READWRITE( stic_r, stic_w ) |
| 355 | AM_RANGE(0x0000, 0x003f) AM_READWRITE( intv_stic_r, intv_stic_w ) |
| 357 | 356 | AM_RANGE(0x0100, 0x01ef) AM_READWRITE( intv_ram8_r, intv_ram8_w ) |
| 358 | 357 | AM_RANGE(0x01f0, 0x01ff) AM_DEVREADWRITE("ay8910", AY8914_directread_port_0_lsb_r, AY8914_directwrite_port_0_lsb_w ) |
| 359 | 358 | AM_RANGE(0x0200, 0x035f) AM_READWRITE( intv_ram16_r, intv_ram16_w ) |
src/mess/drivers/ip20.c
| r6474 | r6475 | |
| 168 | 168 | case 0x0d00: |
| 169 | 169 | verboselog(machine, 2, "HPC DUART0 Channel B Control Read\n" ); |
| 170 | 170 | // return 0x00000004; |
| 171 | | return 0x7c; //scc_r(machine, 0); |
| 171 | return 0x7c; //scc8530_r(machine, 0); |
| 172 | 172 | case 0x0d04: |
| 173 | 173 | verboselog(machine, 2, "HPC DUART0 Channel B Data Read\n" ); |
| 174 | 174 | // return 0; |
| 175 | 175 | scc = devtag_get_device(space->machine, "scc"); |
| 176 | | return scc_r(scc, 2); |
| 176 | return scc8530_r(scc, 2); |
| 177 | 177 | case 0x0d08: |
| 178 | 178 | verboselog(machine, 2, "HPC DUART0 Channel A Control Read (%08x)\n", mem_mask ); |
| 179 | 179 | // return 0x40; |
| 180 | | return 0x7c; //scc_r(machine, 1); |
| 180 | return 0x7c; //scc8530_r(machine, 1); |
| 181 | 181 | case 0x0d0c: |
| 182 | 182 | verboselog(machine, 2, "HPC DUART0 Channel A Data Read\n" ); |
| 183 | 183 | // return 0; |
| 184 | 184 | scc = devtag_get_device(space->machine, "scc"); |
| 185 | | return scc_r(scc, 3); |
| 185 | return scc8530_r(scc, 3); |
| 186 | 186 | case 0x0d10: |
| 187 | 187 | // verboselog(machine, 2, "HPC DUART1 Channel B Control Read\n" ); |
| 188 | 188 | return 0x00000004; |
| r6474 | r6475 | |
| 364 | 364 | case 0x0d00: |
| 365 | 365 | verboselog(machine, 2, "HPC DUART0 Channel B Control Write: %08x (%08x)\n", data, mem_mask ); |
| 366 | 366 | scc = devtag_get_device(space->machine, "scc"); |
| 367 | | scc_w(scc, 0, data); |
| 367 | scc8530_w(scc, 0, data); |
| 368 | 368 | break; |
| 369 | 369 | case 0x0d04: |
| 370 | 370 | verboselog(machine, 2, "HPC DUART0 Channel B Data Write: %08x (%08x)\n", data, mem_mask ); |
| 371 | 371 | scc = devtag_get_device(space->machine, "scc"); |
| 372 | | scc_w(scc, 2, data); |
| 372 | scc8530_w(scc, 2, data); |
| 373 | 373 | break; |
| 374 | 374 | case 0x0d08: |
| 375 | 375 | verboselog(machine, 2, "HPC DUART0 Channel A Control Write: %08x (%08x)\n", data, mem_mask ); |
| 376 | 376 | scc = devtag_get_device(space->machine, "scc"); |
| 377 | | scc_w(scc, 1, data); |
| 377 | scc8530_w(scc, 1, data); |
| 378 | 378 | break; |
| 379 | 379 | case 0x0d0c: |
| 380 | 380 | verboselog(machine, 2, "HPC DUART0 Channel A Data Write: %08x (%08x)\n", data, mem_mask ); |
| 381 | 381 | scc = devtag_get_device(space->machine, "scc"); |
| 382 | | scc_w(scc, 3, data); |
| 382 | scc8530_w(scc, 3, data); |
| 383 | 383 | break; |
| 384 | 384 | case 0x0d10: |
| 385 | 385 | if( ( data & 0x000000ff ) >= 0x00000020 ) |
src/mess/drivers/bbc.c
| r6474 | r6475 | |
| 108 | 108 | AM_RANGE(0xfc00, 0xfdff) AM_NOP /* fc00-fdff FRED & JIM Pages */ |
| 109 | 109 | |
| 110 | 110 | /* fe00-feff Shiela Address Page */ |
| 111 | | AM_RANGE(0xfe00, 0xfe07) AM_READWRITE(BBC_6845_r , BBC_6845_w ) /* fe00-fe07 6845 CRTA Video controller */ |
| 111 | AM_RANGE(0xfe00, 0xfe07) AM_READWRITE(bbc_6845_r , bbc_6845_w ) /* fe00-fe07 6845 CRTA Video controller */ |
| 112 | 112 | AM_RANGE(0xfe08, 0xfe08) AM_MIRROR(0x06) AM_DEVREADWRITE("acia6850", acia6850_stat_r, acia6850_ctrl_w) |
| 113 | 113 | AM_RANGE(0xfe09, 0xfe09) AM_MIRROR(0x06) AM_DEVREADWRITE("acia6850", acia6850_data_r, acia6850_data_w) |
| 114 | | AM_RANGE(0xfe10, 0xfe17) AM_READWRITE(bbc_fe_r , BBC_SerialULA_w ) /* fe10-fe17 Serial ULA Serial system chip */ |
| 114 | AM_RANGE(0xfe10, 0xfe17) AM_READWRITE(bbc_fe_r , bbc_SerialULA_w ) /* fe10-fe17 Serial ULA Serial system chip */ |
| 115 | 115 | AM_RANGE(0xfe18, 0xfe1f) AM_NOP /* fe18-fe1f INTOFF/STATID 1 ECONET Interrupt Off / ID No. */ |
| 116 | 116 | AM_RANGE(0xfe20, 0xfe2f) AM_WRITE ( bbc_videoULA_w ) /* R: fe20-fe2f INTON 1 ECONET Interrupt On */ |
| 117 | 117 | /* W: fe20-fe2f Video ULA Video system chip */ |
| r6474 | r6475 | |
| 142 | 142 | AM_RANGE(0xfc00, 0xfdff) AM_READWRITE(bbc_opus_read , bbc_opus_write ) /* fc00-fdff OPUS Disc Controller */ |
| 143 | 143 | |
| 144 | 144 | /* fe00-feff Shiela Address Page */ |
| 145 | | AM_RANGE(0xfe00, 0xfe07) AM_READWRITE(BBC_6845_r , BBC_6845_w ) /* fe00-fe07 6845 CRTC Video controller */ |
| 145 | AM_RANGE(0xfe00, 0xfe07) AM_READWRITE(bbc_6845_r , bbc_6845_w ) /* fe00-fe07 6845 CRTC Video controller */ |
| 146 | 146 | AM_RANGE(0xfe08, 0xfe08) AM_MIRROR(0x06) AM_DEVREADWRITE("acia6850", acia6850_stat_r, acia6850_ctrl_w) |
| 147 | 147 | AM_RANGE(0xfe09, 0xfe09) AM_MIRROR(0x06) AM_DEVREADWRITE("acia6850", acia6850_data_r, acia6850_data_w) |
| 148 | | AM_RANGE(0xfe10, 0xfe17) AM_READWRITE(bbc_fe_r , BBC_SerialULA_w ) /* fe10-fe17 Serial ULA Serial system chip */ |
| 148 | AM_RANGE(0xfe10, 0xfe17) AM_READWRITE(bbc_fe_r , bbc_SerialULA_w ) /* fe10-fe17 Serial ULA Serial system chip */ |
| 149 | 149 | AM_RANGE(0xfe18, 0xfe1f) AM_NOP /* fe18-fe1f INTOFF/STATID ECONET Interrupt Off / ID No. */ |
| 150 | 150 | AM_RANGE(0xfe20, 0xfe2f) AM_WRITE ( bbc_videoULA_w ) /* R: fe20-fe2f INTON ECONET Interrupt On */ |
| 151 | 151 | /* W: fe20-fe2f Video ULA Video system chip */ |
| r6474 | r6475 | |
| 177 | 177 | AM_RANGE(0xfc00, 0xfdff) AM_NOP /* fc00-fdff FRED & JIM Pages */ |
| 178 | 178 | |
| 179 | 179 | /* fe00-feff Shiela Address Page */ |
| 180 | | AM_RANGE(0xfe00, 0xfe07) AM_READWRITE(BBC_6845_r , BBC_6845_w ) /* fe00-fe07 6845 CRTC Video controller */ |
| 180 | AM_RANGE(0xfe00, 0xfe07) AM_READWRITE(bbc_6845_r , bbc_6845_w ) /* fe00-fe07 6845 CRTC Video controller */ |
| 181 | 181 | AM_RANGE(0xfe08, 0xfe08) AM_MIRROR(0x06) AM_DEVREADWRITE("acia6850", acia6850_stat_r, acia6850_ctrl_w) |
| 182 | 182 | AM_RANGE(0xfe09, 0xfe09) AM_MIRROR(0x06) AM_DEVREADWRITE("acia6850", acia6850_data_r, acia6850_data_w) |
| 183 | | AM_RANGE(0xfe10, 0xfe17) AM_READWRITE(bbc_fe_r , BBC_SerialULA_w ) /* fe10-fe17 Serial ULA Serial system chip */ |
| 183 | AM_RANGE(0xfe10, 0xfe17) AM_READWRITE(bbc_fe_r , bbc_SerialULA_w ) /* fe10-fe17 Serial ULA Serial system chip */ |
| 184 | 184 | AM_RANGE(0xfe18, 0xfe1f) AM_NOP /* fe18-fe1f INTOFF/STATID ECONET Interrupt Off / ID No. */ |
| 185 | 185 | AM_RANGE(0xfe20, 0xfe2f) AM_WRITE (bbc_videoULA_w ) /* R: fe20-fe2f INTON ECONET Interrupt On */ |
| 186 | 186 | /* W: fe20-fe2f Video ULA Video system chip */ |
| r6474 | r6475 | |
| 213 | 213 | AM_RANGE(0xfc00, 0xfdff) AM_NOP /* fc00-fdff FRED & JIM Pages */ |
| 214 | 214 | |
| 215 | 215 | /* fe00-feff Shiela Address Page */ |
| 216 | | AM_RANGE(0xfe00, 0xfe07) AM_READWRITE(BBC_6845_r , BBC_6845_w ) /* fe00-fe07 6845 CRTC Video controller */ |
| 216 | AM_RANGE(0xfe00, 0xfe07) AM_READWRITE(bbc_6845_r , bbc_6845_w ) /* fe00-fe07 6845 CRTC Video controller */ |
| 217 | 217 | AM_RANGE(0xfe08, 0xfe08) AM_MIRROR(0x06) AM_DEVREADWRITE("acia6850", acia6850_stat_r, acia6850_ctrl_w) |
| 218 | 218 | AM_RANGE(0xfe09, 0xfe09) AM_MIRROR(0x06) AM_DEVREADWRITE("acia6850", acia6850_data_r, acia6850_data_w) |
| 219 | | AM_RANGE(0xfe10, 0xfe17) AM_READWRITE(bbc_fe_r , BBC_SerialULA_w ) /* fe10-fe17 Serial ULA Serial system chip */ |
| 219 | AM_RANGE(0xfe10, 0xfe17) AM_READWRITE(bbc_fe_r , bbc_SerialULA_w ) /* fe10-fe17 Serial ULA Serial system chip */ |
| 220 | 220 | AM_RANGE(0xfe10, 0xfe17) AM_NOP /* fe10-fe17 Serial ULA Serial system chip */ |
| 221 | 221 | AM_RANGE(0xfe18, 0xfe1f) AM_NOP /* fe18-fe1f INTOFF/STATID ECONET Interrupt Off / ID No. */ |
| 222 | 222 | AM_RANGE(0xfe20, 0xfe2f) AM_WRITE (bbc_videoULA_w ) /* R: fe20-fe2f INTON ECONET Interrupt On */ |
| r6474 | r6475 | |
| 278 | 278 | AM_RANGE(0xfc00, 0xfdff) AM_READWRITE(SMH_BANK(2) , SMH_ROM ) fc00-fdff FRED & JIM Pages |
| 279 | 279 | |
| 280 | 280 | fe00-feff Shiela Address Page |
| 281 | | AM_RANGE(0xfe00, 0xfe07) AM_READWRITE(BBC_6845_r , BBC_6845_w ) fe00-fe07 6845 CRTC Video controller |
| 281 | AM_RANGE(0xfe00, 0xfe07) AM_READWRITE(bbc_6845_r , bbc_6845_w ) fe00-fe07 6845 CRTC Video controller |
| 282 | 282 | AM_RANGE(0xfe08, 0xfe08) AM_MIRROR(0x06) AM_DEVREADWRITE("acia6850", acia6850_stat_r, acia6850_ctrl_w) |
| 283 | 283 | AM_RANGE(0xfe09, 0xfe09) AM_MIRROR(0x06) AM_DEVREADWRITE("acia6850", acia6850_data_r, acia6850_data_w) |
| 284 | 284 | AM_RANGE(0xfe10, 0xfe17) AM_NOP fe10-fe17 Serial ULA Serial system chip |
| r6474 | r6475 | |
| 835 | 835 | MDRV_ACIA6850_ADD("acia6850", bbc_acia6850_interface) |
| 836 | 836 | |
| 837 | 837 | /* devices */ |
| 838 | | MDRV_UPD7002_ADD("upd7002",BBC_uPD7002) |
| 838 | MDRV_UPD7002_ADD("upd7002", bbc_uPD7002) |
| 839 | 839 | MDRV_VIA6522_ADD("via6522_0", 1000000, bbcb_system_via) |
| 840 | 840 | |
| 841 | 841 | MDRV_I8271_ADD("i8271", bbc_i8271_interface) |
| r6474 | r6475 | |
| 933 | 933 | MDRV_ACIA6850_ADD("acia6850", bbc_acia6850_interface) |
| 934 | 934 | |
| 935 | 935 | /* devices */ |
| 936 | | MDRV_UPD7002_ADD("upd7002",BBC_uPD7002) |
| 936 | MDRV_UPD7002_ADD("upd7002", bbc_uPD7002) |
| 937 | 937 | MDRV_VIA6522_ADD("via6522_0", 1000000, bbcb_system_via) |
| 938 | 938 | MDRV_VIA6522_ADD("via6522_1", 1000000, bbcb_user_via) |
| 939 | 939 | |