src/mess/machine/rmnimbus.c
| r9617 | r9618 | |
| 31 | 31 | |
| 32 | 32 | #include "includes/rmnimbus.h" |
| 33 | 33 | |
| 34 | static void sio_interrupt(running_device *device, int state); |
| 35 | //static WRITE8_DEVICE_HANDLER( sio_dtr_w ); |
| 36 | static WRITE8_DEVICE_HANDLER( sio_serial_transmit ); |
| 37 | static int sio_serial_receive( running_device *device, int channel ); |
| 38 | |
| 39 | |
| 34 | 40 | /*-------------------------------------------------------------------------*/ |
| 35 | 41 | /* Defines, constants, and global variables */ |
| 36 | 42 | /*-------------------------------------------------------------------------*/ |
| r9617 | r9618 | |
| 107 | 113 | UINT16 timer; |
| 108 | 114 | UINT16 dma[2]; |
| 109 | 115 | UINT16 ext[4]; |
| 110 | | UINT16 ext_vector[2]; // external vectors, when in cascade mode |
| 116 | UINT16 ext_vector[2]; // external vectors, when in cascade mode |
| 111 | 117 | }; |
| 112 | 118 | |
| 113 | 119 | static struct i186_state |
| r9617 | r9618 | |
| 121 | 127 | |
| 122 | 128 | /* Z80 SIO */ |
| 123 | 129 | |
| 124 | | const z80sio_interface sio_intf = |
| 130 | const z80sio_interface nimbus_sio_intf = |
| 125 | 131 | { |
| 126 | 132 | sio_interrupt, /* interrupt handler */ |
| 127 | 133 | 0, //sio_dtr_w, /* DTR changed handler */ |
| r9617 | r9618 | |
| 131 | 137 | sio_serial_receive /* receive handler */ |
| 132 | 138 | }; |
| 133 | 139 | |
| 134 | | struct keybord_state |
| 140 | static struct keyboard_state |
| 135 | 141 | { |
| 136 | | UINT8 keyrows[NIMBUS_KEYROWS]; |
| 137 | | emu_timer *keyscan_timer; |
| 138 | | UINT8 queue[KEYBOARD_QUEUE_SIZE]; |
| 142 | UINT8 keyrows[NIMBUS_KEYROWS]; |
| 143 | emu_timer *keyscan_timer; |
| 144 | UINT8 queue[KEYBOARD_QUEUE_SIZE]; |
| 139 | 145 | UINT8 head; |
| 140 | 146 | UINT8 tail; |
| 141 | 147 | } keyboard; |
| r9617 | r9618 | |
| 147 | 153 | |
| 148 | 154 | const wd17xx_interface nimbus_wd17xx_interface = |
| 149 | 155 | { |
| 150 | | DEVCB_LINE_GND, |
| 156 | DEVCB_LINE_GND, |
| 151 | 157 | DEVCB_LINE(nimbus_fdc_intrq_w), |
| 152 | 158 | DEVCB_LINE(nimbus_fdc_drq_w), |
| 153 | 159 | {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} |
| r9617 | r9618 | |
| 179 | 185 | UINT8 int_8f_pending; |
| 180 | 186 | } ipc_interface; |
| 181 | 187 | |
| 182 | | static UINT16 def_config[16] = |
| 188 | static const UINT16 def_config[16] = |
| 183 | 189 | { |
| 184 | 190 | 0x0280, 0x017F, 0xE822, 0x8129, |
| 185 | 191 | 0x0329, 0x0000, 0x0000, 0x0000, |
| r9617 | r9618 | |
| 188 | 194 | }; |
| 189 | 195 | |
| 190 | 196 | /* Memory controler */ |
| 191 | | UINT8 mcu_reg080; |
| 197 | static UINT8 mcu_reg080; |
| 192 | 198 | |
| 193 | 199 | /* IO Unit */ |
| 194 | | UINT8 iou_reg092; |
| 200 | static UINT8 iou_reg092; |
| 195 | 201 | |
| 196 | 202 | /* Sound */ |
| 197 | | UINT8 last_playmode; |
| 203 | static UINT8 last_playmode; |
| 198 | 204 | |
| 199 | 205 | /* Mouse/Joystick */ |
| 200 | 206 | |
| r9617 | r9618 | |
| 218 | 224 | } _mouse_joy_state; |
| 219 | 225 | |
| 220 | 226 | static _mouse_joy_state nimbus_mouse; |
| 221 | | UINT8 ay8910_a; |
| 227 | static UINT8 ay8910_a; |
| 222 | 228 | |
| 223 | 229 | static void drq_callback(running_machine *machine, int which); |
| 224 | 230 | static void nimbus_recalculate_ints(running_machine *machine); |
| r9617 | r9618 | |
| 237 | 243 | |
| 238 | 244 | static void nimbus_bank_memory(running_machine *machine); |
| 239 | 245 | static void memory_reset(running_machine *machine); |
| 240 | | static void fdc_reset(void); |
| 246 | static void fdc_reset(running_machine *machine); |
| 241 | 247 | static void set_disk_int(running_machine *machine, int state); |
| 242 | 248 | static void hdc_reset(running_machine *machine); |
| 243 | 249 | static void hdc_ctrl_write(running_machine *machine, UINT8 data); |
| 244 | 250 | static void hdc_post_rw(running_machine *machine); |
| 245 | 251 | static void hdc_drq(running_machine *machine); |
| 246 | 252 | |
| 247 | | static void keyboard_reset(void); |
| 253 | static void keyboard_reset(running_machine *machine); |
| 248 | 254 | static TIMER_CALLBACK(keyscan_callback); |
| 249 | 255 | |
| 250 | 256 | static void pc8031_reset(running_machine *machine); |
| 251 | | static void iou_reset(void); |
| 257 | static void iou_reset(running_machine *machine); |
| 252 | 258 | static void sound_reset(running_machine *machine); |
| 253 | 259 | |
| 254 | 260 | static void mouse_js_reset(running_machine *machine); |
| 255 | 261 | static TIMER_CALLBACK(mouse_callback); |
| 256 | 262 | |
| 257 | 263 | #define num_ioports 0x80 |
| 258 | | static UINT16 IOPorts[num_ioports]; |
| 264 | static UINT16 IOPorts[num_ioports]; |
| 259 | 265 | |
| 260 | | UINT8 nextkey; |
| 261 | | UINT8 sio_int_state; |
| 266 | static UINT8 sio_int_state; |
| 262 | 267 | |
| 263 | 268 | /************************************* |
| 264 | 269 | * |
| r9617 | r9618 | |
| 913 | 918 | logerror("CPU reset done\n"); |
| 914 | 919 | } |
| 915 | 920 | |
| 916 | | READ16_HANDLER( i186_internal_port_r ) |
| 921 | READ16_HANDLER( nimbus_i186_internal_port_r ) |
| 917 | 922 | { |
| 918 | 923 | int temp, which; |
| 919 | 924 | |
| r9617 | r9618 | |
| 1089 | 1094 | * |
| 1090 | 1095 | *************************************/ |
| 1091 | 1096 | |
| 1092 | | WRITE16_HANDLER( i186_internal_port_w ) |
| 1097 | WRITE16_HANDLER( nimbus_i186_internal_port_w ) |
| 1093 | 1098 | { |
| 1094 | 1099 | int temp, which, data16 = data; |
| 1095 | 1100 | |
| r9617 | r9618 | |
| 1292 | 1297 | temp = (data16 & 0x0fff) << 8; |
| 1293 | 1298 | if (data16 & 0x1000) |
| 1294 | 1299 | { |
| 1295 | | memory_install_read16_handler(cputag_get_address_space(space->machine, MAINCPU_TAG, ADDRESS_SPACE_PROGRAM), temp, temp + 0xff, 0, 0, i186_internal_port_r); |
| 1296 | | memory_install_write16_handler(cputag_get_address_space(space->machine, MAINCPU_TAG, ADDRESS_SPACE_PROGRAM), temp, temp + 0xff, 0, 0, i186_internal_port_w); |
| 1300 | memory_install_read16_handler(cputag_get_address_space(space->machine, MAINCPU_TAG, ADDRESS_SPACE_PROGRAM), temp, temp + 0xff, 0, 0, nimbus_i186_internal_port_r); |
| 1301 | memory_install_write16_handler(cputag_get_address_space(space->machine, MAINCPU_TAG, ADDRESS_SPACE_PROGRAM), temp, temp + 0xff, 0, 0, nimbus_i186_internal_port_w); |
| 1297 | 1302 | } |
| 1298 | 1303 | else |
| 1299 | 1304 | { |
| 1300 | 1305 | temp &= 0xffff; |
| 1301 | | memory_install_read16_handler(cputag_get_address_space(space->machine, MAINCPU_TAG, ADDRESS_SPACE_IO), temp, temp + 0xff, 0, 0, i186_internal_port_r); |
| 1302 | | memory_install_write16_handler(cputag_get_address_space(space->machine, MAINCPU_TAG, ADDRESS_SPACE_IO), temp, temp + 0xff, 0, 0, i186_internal_port_w); |
| 1306 | memory_install_read16_handler(cputag_get_address_space(space->machine, MAINCPU_TAG, ADDRESS_SPACE_IO), temp, temp + 0xff, 0, 0, nimbus_i186_internal_port_r); |
| 1307 | memory_install_write16_handler(cputag_get_address_space(space->machine, MAINCPU_TAG, ADDRESS_SPACE_IO), temp, temp + 0xff, 0, 0, nimbus_i186_internal_port_w); |
| 1303 | 1308 | } |
| 1304 | 1309 | break; |
| 1305 | 1310 | |
| r9617 | r9618 | |
| 1313 | 1318 | { |
| 1314 | 1319 | /* CPU */ |
| 1315 | 1320 | nimbus_cpu_reset(machine); |
| 1316 | | iou_reset(); |
| 1317 | | fdc_reset(); |
| 1318 | | hdc_reset(machine); |
| 1319 | | keyboard_reset(); |
| 1320 | | pc8031_reset(machine); |
| 1321 | | sound_reset(machine); |
| 1322 | | memory_reset(machine); |
| 1323 | | mouse_js_reset(machine); |
| 1321 | iou_reset(machine); |
| 1322 | fdc_reset(machine); |
| 1323 | hdc_reset(machine); |
| 1324 | keyboard_reset(machine); |
| 1325 | pc8031_reset(machine); |
| 1326 | sound_reset(machine); |
| 1327 | memory_reset(machine); |
| 1328 | mouse_js_reset(machine); |
| 1324 | 1329 | } |
| 1325 | 1330 | |
| 1326 | 1331 | DRIVER_INIT(nimbus) |
| r9617 | r9618 | |
| 1746 | 1751 | logerror("=======================================================================\n"); |
| 1747 | 1752 | } |
| 1748 | 1753 | |
| 1749 | | void *get_dssi_ptr(address_space *space, UINT16 ds, UINT16 si) |
| 1754 | static void *get_dssi_ptr(address_space *space, UINT16 ds, UINT16 si) |
| 1750 | 1755 | { |
| 1751 | 1756 | int addr; |
| 1752 | 1757 | |
| r9617 | r9618 | |
| 1905 | 1910 | |
| 1906 | 1911 | struct nimbus_meminfo |
| 1907 | 1912 | { |
| 1908 | | offs_t start; /* start address of bank */ |
| 1909 | | offs_t end; /* End address of bank */ |
| 1913 | offs_t start; /* start address of bank */ |
| 1914 | offs_t end; /* End address of bank */ |
| 1910 | 1915 | }; |
| 1911 | 1916 | |
| 1912 | 1917 | static const struct nimbus_meminfo memmap[] = |
| r9617 | r9618 | |
| 1927 | 1932 | int blocksize; |
| 1928 | 1933 | } nimbus_block ; |
| 1929 | 1934 | |
| 1930 | | typedef nimbus_block nimbus_blocks[3]; |
| 1935 | typedef nimbus_block nimbus_blocks[3]; |
| 1931 | 1936 | |
| 1932 | 1937 | static const nimbus_blocks ramblocks[] = |
| 1933 | 1938 | { |
| r9617 | r9618 | |
| 2010 | 2015 | } |
| 2011 | 2016 | } |
| 2012 | 2017 | |
| 2013 | | READ8_HANDLER( mcu_r ) |
| 2018 | READ8_HANDLER( nimbus_mcu_r ) |
| 2014 | 2019 | { |
| 2015 | 2020 | return mcu_reg080; |
| 2016 | 2021 | } |
| 2017 | 2022 | |
| 2018 | | WRITE8_HANDLER( mcu_w ) |
| 2023 | WRITE8_HANDLER( nimbus_mcu_w ) |
| 2019 | 2024 | { |
| 2020 | 2025 | mcu_reg080=data; |
| 2021 | 2026 | |
| r9617 | r9618 | |
| 2059 | 2064 | |
| 2060 | 2065 | */ |
| 2061 | 2066 | |
| 2062 | | static void keyboard_reset(void) |
| 2067 | static void keyboard_reset(running_machine *machine) |
| 2063 | 2068 | { |
| 2064 | 2069 | memset(keyboard.keyrows,0xFF,NIMBUS_KEYROWS); |
| 2065 | 2070 | |
| r9617 | r9618 | |
| 2139 | 2144 | |
| 2140 | 2145 | /* Z80 SIO/2 */ |
| 2141 | 2146 | |
| 2142 | | void sio_interrupt(running_device *device, int state) |
| 2147 | static void sio_interrupt(running_device *device, int state) |
| 2143 | 2148 | { |
| 2144 | 2149 | if(LOG_SIO) |
| 2145 | 2150 | logerror("SIO Interrupt state=%02X\n",state); |
| r9617 | r9618 | |
| 2154 | 2159 | } |
| 2155 | 2160 | } |
| 2156 | 2161 | |
| 2162 | #ifdef UNUSED_FUNCTION |
| 2157 | 2163 | WRITE8_DEVICE_HANDLER( sio_dtr_w ) |
| 2158 | 2164 | { |
| 2159 | 2165 | if (offset == 1) |
| 2160 | 2166 | { |
| 2161 | 2167 | } |
| 2162 | 2168 | } |
| 2169 | #endif |
| 2163 | 2170 | |
| 2164 | | WRITE8_DEVICE_HANDLER( sio_serial_transmit ) |
| 2171 | static WRITE8_DEVICE_HANDLER( sio_serial_transmit ) |
| 2165 | 2172 | { |
| 2166 | 2173 | } |
| 2167 | 2174 | |
| 2168 | | int sio_serial_receive( running_device *device, int channel ) |
| 2175 | static int sio_serial_receive( running_device *device, int channel ) |
| 2169 | 2176 | { |
| 2170 | 2177 | if(channel==0) |
| 2171 | 2178 | { |
| r9617 | r9618 | |
| 2177 | 2184 | |
| 2178 | 2185 | /* Floppy disk */ |
| 2179 | 2186 | |
| 2180 | | static void fdc_reset(void) |
| 2187 | static void fdc_reset(running_machine *machine) |
| 2181 | 2188 | { |
| 2182 | 2189 | nimbus_drives.reg400=0; |
| 2183 | 2190 | nimbus_drives.reg410_in=0; |
| r9617 | r9618 | |
| 2449 | 2456 | |
| 2450 | 2457 | memset(&ipc_interface,0,sizeof(ipc_interface)); |
| 2451 | 2458 | |
| 2452 | | if(!data_loaded(er59256)) |
| 2453 | | preload_rom(er59256,def_config,ARRAY_LENGTH(def_config)); |
| 2459 | if(!er59256_data_loaded(er59256)) |
| 2460 | er59256_preload_rom(er59256,def_config,ARRAY_LENGTH(def_config)); |
| 2454 | 2461 | } |
| 2455 | 2462 | |
| 2456 | 2463 | |
| r9617 | r9618 | |
| 2464 | 2471 | } |
| 2465 | 2472 | #endif |
| 2466 | 2473 | |
| 2467 | | READ8_HANDLER( pc8031_r ) |
| 2474 | READ8_HANDLER( nimbus_pc8031_r ) |
| 2468 | 2475 | { |
| 2469 | 2476 | int pc=cpu_get_pc(space->cpu); |
| 2470 | 2477 | UINT8 result; |
| r9617 | r9618 | |
| 2488 | 2495 | return result; |
| 2489 | 2496 | } |
| 2490 | 2497 | |
| 2491 | | WRITE8_HANDLER( pc8031_w ) |
| 2498 | WRITE8_HANDLER( nimbus_pc8031_w ) |
| 2492 | 2499 | { |
| 2493 | 2500 | int pc=cpu_get_pc(space->cpu); |
| 2494 | 2501 | |
| r9617 | r9618 | |
| 2514 | 2521 | |
| 2515 | 2522 | /* 8031/8051 Peripheral controler 8031/8051 side */ |
| 2516 | 2523 | |
| 2517 | | READ8_HANDLER( pc8031_iou_r ) |
| 2524 | READ8_HANDLER( nimbus_pc8031_iou_r ) |
| 2518 | 2525 | { |
| 2519 | 2526 | int pc=cpu_get_pc(space->cpu); |
| 2520 | 2527 | UINT8 result = 0; |
| r9617 | r9618 | |
| 2539 | 2546 | return result; |
| 2540 | 2547 | } |
| 2541 | 2548 | |
| 2542 | | WRITE8_HANDLER( pc8031_iou_w ) |
| 2549 | WRITE8_HANDLER( nimbus_pc8031_iou_w ) |
| 2543 | 2550 | { |
| 2544 | 2551 | int pc=cpu_get_pc(space->cpu); |
| 2545 | 2552 | |
| r9617 | r9618 | |
| 2578 | 2585 | } |
| 2579 | 2586 | } |
| 2580 | 2587 | |
| 2581 | | READ8_HANDLER( pc8031_port_r ) |
| 2588 | READ8_HANDLER( nimbus_pc8031_port_r ) |
| 2582 | 2589 | { |
| 2583 | 2590 | running_device *er59256 = space->machine->device(ER59256_TAG); |
| 2584 | 2591 | int pc=cpu_get_pc(space->cpu); |
| r9617 | r9618 | |
| 2595 | 2602 | return result; |
| 2596 | 2603 | } |
| 2597 | 2604 | |
| 2598 | | WRITE8_HANDLER( pc8031_port_w ) |
| 2605 | WRITE8_HANDLER( nimbus_pc8031_port_w ) |
| 2599 | 2606 | { |
| 2600 | 2607 | running_device *er59256 = space->machine->device(ER59256_TAG); |
| 2601 | 2608 | int pc=cpu_get_pc(space->cpu); |
| r9617 | r9618 | |
| 2612 | 2619 | |
| 2613 | 2620 | |
| 2614 | 2621 | /* IO Unit */ |
| 2615 | | READ8_HANDLER( iou_r ) |
| 2622 | READ8_HANDLER( nimbus_iou_r ) |
| 2616 | 2623 | { |
| 2617 | 2624 | int pc=cpu_get_pc(space->cpu); |
| 2618 | 2625 | UINT8 result=0; |
| r9617 | r9618 | |
| 2628 | 2635 | return result; |
| 2629 | 2636 | } |
| 2630 | 2637 | |
| 2631 | | WRITE8_HANDLER( iou_w ) |
| 2638 | WRITE8_HANDLER( nimbus_iou_w ) |
| 2632 | 2639 | { |
| 2633 | 2640 | int pc=cpu_get_pc(space->cpu); |
| 2634 | 2641 | running_device *msm5205 = space->machine->device(MSM5205_TAG); |
| r9617 | r9618 | |
| 2643 | 2650 | } |
| 2644 | 2651 | } |
| 2645 | 2652 | |
| 2646 | | static void iou_reset(void) |
| 2653 | static void iou_reset(running_machine *machine) |
| 2647 | 2654 | { |
| 2648 | 2655 | iou_reg092=0x00; |
| 2649 | 2656 | } |
| r9617 | r9618 | |
| 2676 | 2683 | ay8910_a=0; |
| 2677 | 2684 | } |
| 2678 | 2685 | |
| 2679 | | READ8_HANDLER( sound_ay8910_r ) |
| 2686 | READ8_HANDLER( nimbus_sound_ay8910_r ) |
| 2680 | 2687 | { |
| 2681 | 2688 | running_device *ay8910 = space->machine->device(AY8910_TAG); |
| 2682 | 2689 | UINT8 result=0; |
| r9617 | r9618 | |
| 2687 | 2694 | return result; |
| 2688 | 2695 | } |
| 2689 | 2696 | |
| 2690 | | WRITE8_HANDLER( sound_ay8910_w ) |
| 2697 | WRITE8_HANDLER( nimbus_sound_ay8910_w ) |
| 2691 | 2698 | { |
| 2692 | 2699 | int pc=cpu_get_pc(space->cpu); |
| 2693 | 2700 | running_device *ay8910 = space->machine->device(AY8910_TAG); |
| r9617 | r9618 | |
| 2703 | 2710 | |
| 2704 | 2711 | } |
| 2705 | 2712 | |
| 2706 | | WRITE8_HANDLER( sound_ay8910_porta_w ) |
| 2713 | WRITE8_HANDLER( nimbus_sound_ay8910_porta_w ) |
| 2707 | 2714 | { |
| 2708 | 2715 | running_device *msm5205 = space->machine->device(MSM5205_TAG); |
| 2709 | 2716 | |
| r9617 | r9618 | |
| 2713 | 2720 | ay8910_a=data; |
| 2714 | 2721 | } |
| 2715 | 2722 | |
| 2716 | | WRITE8_HANDLER( sound_ay8910_portb_w ) |
| 2723 | WRITE8_HANDLER( nimbus_sound_ay8910_portb_w ) |
| 2717 | 2724 | { |
| 2718 | 2725 | running_device *msm5205 = space->machine->device(MSM5205_TAG); |
| 2719 | 2726 | |
| r9617 | r9618 | |
| 2887 | 2894 | state->intstate_y=intstate_y; |
| 2888 | 2895 | } |
| 2889 | 2896 | |
| 2890 | | READ8_HANDLER( mouse_js_r ) |
| 2897 | READ8_HANDLER( nimbus_mouse_js_r ) |
| 2891 | 2898 | { |
| 2892 | 2899 | /* |
| 2893 | 2900 | |
| r9617 | r9618 | |
| 2903 | 2910 | 7 ?? always reads 1 |
| 2904 | 2911 | |
| 2905 | 2912 | */ |
| 2906 | | UINT8 result; |
| 2913 | UINT8 result; |
| 2907 | 2914 | // int pc=cpu_get_pc(space->machine->device(MAINCPU_TAG)); |
| 2908 | 2915 | |
| 2909 | | _mouse_joy_state *state = &nimbus_mouse; |
| 2916 | _mouse_joy_state *state = &nimbus_mouse; |
| 2910 | 2917 | |
| 2911 | 2918 | if (input_port_read(space->machine, "config") & 0x01) |
| 2912 | 2919 | { |
| 2913 | | result=state->reg0a4; |
| 2914 | | //logerror("mouse_js_r: pc=%05X, result=%02X\n",pc,result); |
| 2915 | | } |
| 2920 | result=state->reg0a4; |
| 2921 | //logerror("mouse_js_r: pc=%05X, result=%02X\n",pc,result); |
| 2922 | } |
| 2916 | 2923 | else |
| 2917 | 2924 | { |
| 2918 | 2925 | result=input_port_read_safe(space->machine, JOYSTICK0_TAG, 0xff); |
| 2919 | 2926 | } |
| 2920 | 2927 | |
| 2921 | | return result; |
| 2928 | return result; |
| 2922 | 2929 | } |
| 2923 | 2930 | |
| 2924 | | WRITE8_HANDLER( mouse_js_w ) |
| 2931 | WRITE8_HANDLER( nimbus_mouse_js_w ) |
| 2925 | 2932 | { |
| 2926 | 2933 | } |
| 2927 | 2934 | |
src/mess/video/dgn_beta.c
| r9617 | r9618 | |
| 120 | 120 | //static BETA_VID_MODES VIDMODE = TEXT_40x25; |
| 121 | 121 | |
| 122 | 122 | /* Debugging variables */ |
| 123 | | static int LogRegWrites = 1; // Log register writes to debug console. |
| 124 | | static int BoxColour = 1; |
| 125 | | static int BoxMinX = 100; |
| 126 | | static int BoxMinY = 100; |
| 127 | | static int BoxMaxX = 500; |
| 128 | | static int BoxMaxY = 500; |
| 123 | static int LogRegWrites; // Log register writes to debug console. |
| 124 | static int BoxColour; |
| 125 | static int BoxMinX; |
| 126 | static int BoxMinY; |
| 127 | static int BoxMaxX; |
| 128 | static int BoxMaxY; |
| 129 | 129 | static int HSyncMin = 0; |
| 130 | 130 | static int VSyncMin = 0; |
| 131 | 131 | static int DEPos = 0; |
| r9617 | r9618 | |
| 141 | 141 | static void execute_beta_vid_clkmax(running_machine *machine, int ref, int params, const char *param[]); |
| 142 | 142 | |
| 143 | 143 | static bitmap_t *bit; |
| 144 | | static int MinAddr = 0xFFFF; |
| 145 | | static int MaxAddr = 0x0000; |
| 146 | | static int MinX = 0xFFFF; |
| 147 | | static int MaxX = 0x0000; |
| 148 | | static int MinY = 0xFFFF; |
| 149 | | static int MaxY = 0x0000; |
| 144 | static int MinAddr; |
| 145 | static int MaxAddr; |
| 146 | static int MinX; |
| 147 | static int MaxX; |
| 148 | static int MinY; |
| 149 | static int MaxY; |
| 150 | 150 | |
| 151 | 151 | static int VidAddr = 0; // Last address reg written |
| 152 | 152 | |
| 153 | | static void beta_Set_RA(int offset, int data); |
| 153 | static void beta_Set_RA(running_machine *machine, int offset, int data); |
| 154 | 154 | static void beta_Set_HSync(running_machine *machine, int offset, int data); |
| 155 | 155 | static void beta_Set_VSync(running_machine *machine, int offset, int data); |
| 156 | | static void beta_Set_DE(int offset, int data); |
| 156 | static void beta_Set_DE(running_machine *machine, int offset, int data); |
| 157 | 157 | |
| 158 | 158 | static const struct m6845_interface beta_m6845_interface = { |
| 159 | 159 | 0, // Memory Address register |
| r9617 | r9618 | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | // called when the 6845 changes the character row |
| 237 | | static void beta_Set_RA(int offset, int data) |
| 237 | static void beta_Set_RA(running_machine *machine, int offset, int data) |
| 238 | 238 | { |
| 239 | 239 | beta_6845_RA=data; |
| 240 | 240 | } |
| r9617 | r9618 | |
| 297 | 297 | dgn_beta_frame_interrupt(machine, data); |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | | static void beta_Set_DE(int offset, int data) |
| 300 | static void beta_Set_DE(running_machine *machine, int offset, int data) |
| 301 | 301 | { |
| 302 | 302 | beta_DE = data; |
| 303 | 303 | |
| r9617 | r9618 | |
| 336 | 336 | debug_console_register_command(machine, "beta_vid_clkmax", CMDFLAG_NONE, 0, 0, 1, execute_beta_vid_clkmax); |
| 337 | 337 | } |
| 338 | 338 | LogRegWrites=0; |
| 339 | BoxColour=1; |
| 340 | BoxMinX = 100; |
| 341 | BoxMinY = 100; |
| 342 | BoxMaxX = 500; |
| 343 | BoxMaxY = 500; |
| 344 | |
| 345 | MinAddr = 0xFFFF; |
| 346 | MaxAddr = 0x0000; |
| 347 | MinX = 0xFFFF; |
| 348 | MaxX = 0x0000; |
| 349 | MinY = 0xFFFF; |
| 350 | MaxY = 0x0000; |
| 339 | 351 | } |
| 340 | 352 | |
| 341 | 353 | void dgnbeta_video_reset(running_machine *machine) |
| r9617 | r9618 | |
| 720 | 732 | { |
| 721 | 733 | m6845_address_w(offset,data); |
| 722 | 734 | VidAddr=data; /* Record reg being written to */ |
| 723 | | } |
| 735 | } |
| 724 | 736 | if (LogRegWrites) |
| 725 | 737 | RegLog(space->machine, offset,data); |
| 726 | 738 | } |
src/mess/video/fmtowns.c
| r9617 | r9618 | |
| 102 | 102 | |
| 103 | 103 | //static UINT32 pshift; // for debugging |
| 104 | 104 | |
| 105 | | void draw_sprites(running_machine* machine, const rectangle* rect); |
| 105 | static void draw_sprites(running_machine* machine, const rectangle* rect); |
| 106 | 106 | |
| 107 | | void towns_crtc_refresh_mode(running_machine* machine) |
| 107 | static void towns_crtc_refresh_mode(running_machine* machine) |
| 108 | 108 | { |
| 109 | 109 | towns_state* state = machine->driver_data<towns_state>(); |
| 110 | 110 | rectangle scr; |
| r9617 | r9618 | |
| 713 | 713 | * +6: Sprite Colour |
| 714 | 714 | * bit 15: use colour data in located in sprite RAM offset in bits 11-0 (x32) |
| 715 | 715 | */ |
| 716 | | void render_sprite_4(running_machine* machine, UINT32 poffset, UINT32 coffset, UINT16 x, UINT16 y, UINT16 xflip, UINT16 yflip, const rectangle* rect) |
| 716 | static void render_sprite_4(running_machine* machine, UINT32 poffset, UINT32 coffset, UINT16 x, UINT16 y, UINT16 xflip, UINT16 yflip, const rectangle* rect) |
| 717 | 717 | { |
| 718 | 718 | towns_state* state = machine->driver_data<towns_state>(); |
| 719 | 719 | UINT16 xpos,ypos; |
| r9617 | r9618 | |
| 790 | 790 | } |
| 791 | 791 | } |
| 792 | 792 | |
| 793 | | void render_sprite_16(running_machine* machine, UINT32 poffset, UINT16 x, UINT16 y, UINT16 xflip, UINT16 yflip, const rectangle* rect) |
| 793 | static void render_sprite_16(running_machine* machine, UINT32 poffset, UINT16 x, UINT16 y, UINT16 xflip, UINT16 yflip, const rectangle* rect) |
| 794 | 794 | { |
| 795 | 795 | towns_state* state = machine->driver_data<towns_state>(); |
| 796 | 796 | UINT16 xpos,ypos; |
| r9617 | r9618 | |
| 854 | 854 | } |
| 855 | 855 | } |
| 856 | 856 | |
| 857 | | void draw_sprites(running_machine* machine, const rectangle* rect) |
| 857 | static void draw_sprites(running_machine* machine, const rectangle* rect) |
| 858 | 858 | { |
| 859 | 859 | towns_state* state = machine->driver_data<towns_state>(); |
| 860 | 860 | UINT16 sprite_limit = (state->video.towns_sprite_reg[0] | (state->video.towns_sprite_reg[1] << 8)) & 0x3ff; |
| r9617 | r9618 | |
| 920 | 920 | timer_adjust_oneshot(state->video.sprite_timer,machine->device<cpu_device>("maincpu")->cycles_to_attotime(128 * (1025-sprite_limit)),0); |
| 921 | 921 | } |
| 922 | 922 | |
| 923 | | void towns_crtc_draw_scan_layer_hicolour(running_machine* machine, bitmap_t* bitmap,const rectangle* rect,int layer,int line,int scanline) |
| 923 | static void towns_crtc_draw_scan_layer_hicolour(running_machine* machine, bitmap_t* bitmap,const rectangle* rect,int layer,int line,int scanline) |
| 924 | 924 | { |
| 925 | 925 | towns_state* state = machine->driver_data<towns_state>(); |
| 926 | 926 | UINT32 off = 0; |
| r9617 | r9618 | |
| 1112 | 1112 | } |
| 1113 | 1113 | } |
| 1114 | 1114 | |
| 1115 | | void towns_crtc_draw_scan_layer_256(running_machine* machine, bitmap_t* bitmap,const rectangle* rect,int layer,int line,int scanline) |
| 1115 | static void towns_crtc_draw_scan_layer_256(running_machine* machine, bitmap_t* bitmap,const rectangle* rect,int layer,int line,int scanline) |
| 1116 | 1116 | { |
| 1117 | 1117 | towns_state* state = machine->driver_data<towns_state>(); |
| 1118 | 1118 | int off = 0; |
| r9617 | r9618 | |
| 1303 | 1303 | } |
| 1304 | 1304 | } |
| 1305 | 1305 | |
| 1306 | | void towns_crtc_draw_scan_layer_16(running_machine* machine, bitmap_t* bitmap,const rectangle* rect,int layer,int line,int scanline) |
| 1306 | static void towns_crtc_draw_scan_layer_16(running_machine* machine, bitmap_t* bitmap,const rectangle* rect,int layer,int line,int scanline) |
| 1307 | 1307 | { |
| 1308 | 1308 | towns_state* state = machine->driver_data<towns_state>(); |
| 1309 | 1309 | int off = 0; |
| r9617 | r9618 | |
| 1574 | 1574 | } |
| 1575 | 1575 | } |
| 1576 | 1576 | |
| 1577 | | void towns_crtc_draw_layer(running_machine* machine,bitmap_t* bitmap,const rectangle* rect,int layer) |
| 1577 | static void towns_crtc_draw_layer(running_machine* machine,bitmap_t* bitmap,const rectangle* rect,int layer) |
| 1578 | 1578 | { |
| 1579 | 1579 | towns_state* state = machine->driver_data<towns_state>(); |
| 1580 | 1580 | int line; |
| r9617 | r9618 | |
| 1675 | 1675 | } |
| 1676 | 1676 | } |
| 1677 | 1677 | |
| 1678 | | void render_text_char(running_machine* machine, UINT8 x, UINT8 y, UINT8 ascii, UINT16 jis, UINT8 attr) |
| 1678 | static void render_text_char(running_machine* machine, UINT8 x, UINT8 y, UINT8 ascii, UINT16 jis, UINT8 attr) |
| 1679 | 1679 | { |
| 1680 | 1680 | towns_state* state = machine->driver_data<towns_state>(); |
| 1681 | 1681 | UINT32 rom_addr; |
| r9617 | r9618 | |
| 1754 | 1754 | } |
| 1755 | 1755 | } |
| 1756 | 1756 | |
| 1757 | | void draw_text_layer(running_machine* machine) |
| 1757 | static void draw_text_layer(running_machine* machine) |
| 1758 | 1758 | { |
| 1759 | 1759 | /* |
| 1760 | 1760 | * Text format |
src/mess/video/m6845.c
| r9617 | r9618 | |
| 558 | 558 | { |
| 559 | 559 | crtc.Scan_Line_Counter_Reset=True; |
| 560 | 560 | } |
| 561 | | if (crtc.intf->out_RA_func) (crtc.intf->out_RA_func)(0,crtc.Scan_Line_Counter); /* call RA update */ |
| 561 | if (crtc.intf->out_RA_func) (crtc.intf->out_RA_func)(machine,0,crtc.Scan_Line_Counter); /* call RA update */ |
| 562 | 562 | } |
| 563 | 563 | /* end of vertical clock pulse */ |
| 564 | 564 | |
| r9617 | r9618 | |
| 605 | 605 | if (crtc.intf->out_HS_func) (crtc.intf->out_HS_func)(machine, 0,crtc.HSYNC); /* call HS update */ |
| 606 | 606 | } |
| 607 | 607 | } |
| 608 | | if (crtc.intf->out_MA_func) (crtc.intf->out_MA_func)(0,crtc.Memory_Address); /* call MA update */ |
| 608 | if (crtc.intf->out_MA_func) (crtc.intf->out_MA_func)(machine,0,crtc.Memory_Address); /* call MA update */ |
| 609 | 609 | |
| 610 | 610 | |
| 611 | 611 | |
| r9617 | r9618 | |
| 629 | 629 | { |
| 630 | 630 | crtc.Delay_Flags=crtc.Delay_Flags^Cursor_On_Flag; |
| 631 | 631 | crtc.Cursor_Delayed_Status=False; |
| 632 | | if (crtc.intf->out_CR_func) (crtc.intf->out_CR_func)(0,crtc.Cursor_Delayed_Status); /* call CR update */ |
| 633 | | if (crtc.intf->out_CRE_func) (crtc.intf->out_CRE_func)(0,0); /* call CRE update */ |
| 632 | if (crtc.intf->out_CR_func) (crtc.intf->out_CR_func)(machine,0,crtc.Cursor_Delayed_Status); /* call CR update */ |
| 633 | if (crtc.intf->out_CRE_func) (crtc.intf->out_CRE_func)(machine,0,0); /* call CRE update */ |
| 634 | 634 | } |
| 635 | 635 | |
| 636 | 636 | /* cursor enabled delay */ |
| r9617 | r9618 | |
| 643 | 643 | { |
| 644 | 644 | crtc.Delay_Flags=(crtc.Delay_Flags^Cursor_Start_Delay_Flag)|Cursor_On_Flag; |
| 645 | 645 | crtc.Cursor_Delayed_Status=True; |
| 646 | | if ((crtc.intf->out_CR_func)&&(crtc.Cursor_Flash_Count>25)) (crtc.intf->out_CR_func)(0,crtc.Cursor_Delayed_Status); /* call CR update */ |
| 647 | | if (crtc.intf->out_CRE_func) (crtc.intf->out_CRE_func)(0,2|((crtc.Cursor_Flash_Count>25)&1)); /* call CR update */ |
| 646 | if ((crtc.intf->out_CR_func)&&(crtc.Cursor_Flash_Count>25)) (crtc.intf->out_CR_func)(machine,0,crtc.Cursor_Delayed_Status); /* call CR update */ |
| 647 | if (crtc.intf->out_CRE_func) (crtc.intf->out_CRE_func)(machine,0,2|((crtc.Cursor_Flash_Count>25)&1)); /* call CR update */ |
| 648 | 648 | } |
| 649 | 649 | } |
| 650 | 650 | } |
| r9617 | r9618 | |
| 657 | 657 | { |
| 658 | 658 | crtc.Delay_Flags=crtc.Delay_Flags^Display_Enabled_Delay_Flag; |
| 659 | 659 | crtc.Display_Delayed_Enabled=True; |
| 660 | | if (crtc.intf->out_DE_func) (crtc.intf->out_DE_func)(0,crtc.Display_Delayed_Enabled); /* call DE update */ |
| 660 | if (crtc.intf->out_DE_func) (crtc.intf->out_DE_func)(machine,0,crtc.Display_Delayed_Enabled); /* call DE update */ |
| 661 | 661 | } |
| 662 | 662 | } |
| 663 | 663 | |
| r9617 | r9618 | |
| 669 | 669 | { |
| 670 | 670 | crtc.Delay_Flags=crtc.Delay_Flags^Display_Disable_Delay_Flag; |
| 671 | 671 | crtc.Display_Delayed_Enabled=False; |
| 672 | | if (crtc.intf->out_DE_func) (crtc.intf->out_DE_func)(0,crtc.Display_Delayed_Enabled); /* call DE update */ |
| 672 | if (crtc.intf->out_DE_func) (crtc.intf->out_DE_func)(machine,0,crtc.Display_Delayed_Enabled); /* call DE update */ |
| 673 | 673 | } |
| 674 | 674 | } |
| 675 | 675 | } |
src/mess/video/bbc.c
| r9617 | r9618 | |
| 235 | 235 | |
| 236 | 236 | |
| 237 | 237 | static int VideoULA_DE=0; // internal videoULA Display Enabled set by 6845 DE and the scanlines<8 |
| 238 | | static int VideoULA_CR=7; // internal videoULA Cursor Enabled set by 6845 CR and then cleared after a number clock cycles |
| 238 | static int VideoULA_CR; // internal videoULA Cursor Enabled set by 6845 CR and then cleared after a number clock cycles |
| 239 | 239 | static int VideoULA_CR_counter=0; // number of clock cycles left before the CR is disabled |
| 240 | 240 | |
| 241 | 241 | static int videoULA_Reg; |
| r9617 | r9618 | |
| 255 | 255 | static int emulation_pixels_per_byte; |
| 256 | 256 | |
| 257 | 257 | static const int width_of_cursor_set[8]={ 0,0,1,2,1,0,2,4 }; |
| 258 | | static int emulation_cursor_size=1; |
| 258 | static int emulation_cursor_size; |
| 259 | 259 | static int cursor_state=0; |
| 260 | 260 | |
| 261 | 261 | static int videoULA_pallet0[16];// flashing colours A |
| r9617 | r9618 | |
| 264 | 264 | |
| 265 | 265 | // this is the pixel position of the start of a scanline |
| 266 | 266 | // -96 sets the screen display to the middle of emulated screen. |
| 267 | | static int x_screen_offset=-96; |
| 267 | static int x_screen_offset; |
| 268 | 268 | |
| 269 | | static int y_screen_offset=-8; |
| 269 | static int y_screen_offset; |
| 270 | 270 | |
| 271 | 271 | |
| 272 | 272 | |
| r9617 | r9618 | |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | // called when the 6845 changes the character row |
| 456 | | static void BBC_Set_Character_Row(int offset, int data) |
| 456 | static void BBC_Set_Character_Row(running_machine *machine, int offset, int data) |
| 457 | 457 | { |
| 458 | 458 | BBC_Character_Row=data; |
| 459 | 459 | BBC_Set_VideoULA_DE(); |
| r9617 | r9618 | |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | // called when the 6845 changes the Display Enabled |
| 513 | | static void BBC_Set_DE(int offset, int data) |
| 513 | static void BBC_Set_DE(running_machine *machine, int offset, int data) |
| 514 | 514 | { |
| 515 | 515 | BBC_DE=data; |
| 516 | 516 | BBC_Set_VideoULA_DE(); |
| r9617 | r9618 | |
| 520 | 520 | |
| 521 | 521 | |
| 522 | 522 | // called when the 6845 changes the Cursor Enabled |
| 523 | | static void BBC_Set_CRE(int offset, int data) |
| 523 | static void BBC_Set_CRE(running_machine *machine, int offset, int data) |
| 524 | 524 | { |
| 525 | 525 | if (data&2) { |
| 526 | 526 | VideoULA_CR_counter=emulation_cursor_size; |
| r9617 | r9618 | |
| 670 | 670 | * Initialize the BBC video emulation |
| 671 | 671 | ************************************************************************/ |
| 672 | 672 | |
| 673 | | VIDEO_START( bbca ) |
| 673 | static void common_init(running_machine *machine) |
| 674 | 674 | { |
| 675 | emulation_cursor_size = 1; |
| 676 | x_screen_offset = -96; |
| 677 | y_screen_offset = -8; |
| 678 | |
| 679 | VideoULA_DE = 0; |
| 680 | VideoULA_CR = 7; |
| 681 | VideoULA_CR_counter = 0; |
| 682 | |
| 675 | 683 | set_pixel_lookup(); |
| 676 | | bbc_set_video_memory_lookups(16); |
| 677 | 684 | m6845_config(&BBC6845); |
| 678 | 685 | saa505x_config(&BBCsaa5050); |
| 679 | 686 | |
| 680 | | BBC_Video_RAM= memory_region(machine, "maincpu"); |
| 681 | | vidmem_RAM=bbc_vidmem; |
| 682 | | draw_function=*BBC_draw_hi_res; |
| 687 | BBC_Video_RAM = memory_region(machine, "maincpu"); |
| 688 | vidmem_RAM = bbc_vidmem; |
| 689 | draw_function = *BBC_draw_hi_res; |
| 683 | 690 | } |
| 684 | 691 | |
| 685 | | VIDEO_START( bbcb ) |
| 692 | VIDEO_START( bbca ) |
| 686 | 693 | { |
| 687 | | set_pixel_lookup(); |
| 694 | common_init(machine); |
| 695 | bbc_set_video_memory_lookups(16); |
| 696 | } |
| 688 | 697 | |
| 689 | | m6845_config(&BBC6845); |
| 690 | | saa505x_config(&BBCsaa5050); |
| 691 | | |
| 692 | | BBC_Video_RAM= memory_region(machine, "maincpu"); |
| 693 | | vidmem_RAM=bbc_vidmem; |
| 694 | | draw_function=*BBC_draw_hi_res; |
| 698 | VIDEO_START( bbcb ) |
| 699 | { |
| 700 | common_init(machine); |
| 695 | 701 | } |
| 696 | 702 | |
| 697 | 703 | VIDEO_START( bbcbp ) |
| 698 | 704 | { |
| 699 | | /* need to set up the lookups to work with the BBC B plus memory */ |
| 700 | | set_pixel_lookup(); |
| 701 | | |
| 705 | common_init(machine); |
| 702 | 706 | bbc_set_video_memory_lookups(32); |
| 703 | | m6845_config(&BBC6845); |
| 704 | | saa505x_config(&BBCsaa5050); |
| 705 | | |
| 706 | | BBC_Video_RAM= memory_region(machine, "maincpu"); |
| 707 | | vidmem_RAM=bbc_vidmem; |
| 708 | | draw_function=*BBC_draw_hi_res; |
| 709 | 707 | } |
| 710 | 708 | |
| 711 | 709 | VIDEO_START( bbcm ) |
| 712 | 710 | { |
| 713 | | /* need to set up the lookups to work with the BBC B plus memory */ |
| 714 | | set_pixel_lookup(); |
| 711 | common_init(machine); |
| 715 | 712 | bbc_set_video_memory_lookups(32); |
| 716 | | m6845_config(&BBC6845); |
| 717 | | saa505x_config(&BBCsaa5050); |
| 718 | | |
| 719 | | BBC_Video_RAM= memory_region(machine, "maincpu"); |
| 720 | | vidmem_RAM=bbc_vidmem; |
| 721 | | draw_function=*BBC_draw_hi_res; |
| 722 | 713 | } |
src/mess/includes/rmnimbus.h
| r9617 | r9618 | |
| 18 | 18 | #define MAINCPU_TAG "maincpu" |
| 19 | 19 | #define IOCPU_TAG "iocpu" |
| 20 | 20 | |
| 21 | |
| 22 | /*----------- defined in machine/rmnimbus.c -----------*/ |
| 23 | |
| 21 | 24 | DRIVER_INIT(nimbus); |
| 22 | 25 | MACHINE_RESET(nimbus); |
| 23 | 26 | MACHINE_START(nimbus); |
| 24 | 27 | |
| 25 | 28 | /* 80186 Internal */ |
| 26 | | READ16_HANDLER (i186_internal_port_r); |
| 27 | | WRITE16_HANDLER (i186_internal_port_w); |
| 29 | READ16_HANDLER (nimbus_i186_internal_port_r); |
| 30 | WRITE16_HANDLER (nimbus_i186_internal_port_w); |
| 28 | 31 | |
| 29 | 32 | /* external int priority masks */ |
| 30 | 33 | |
| r9617 | r9618 | |
| 87 | 90 | #define HIBLOCK_BASE_MASK 0x08 |
| 88 | 91 | #define HIBLOCK_SELECT_MASK 0x10 |
| 89 | 92 | |
| 90 | | READ8_HANDLER( mcu_r ); |
| 91 | | WRITE8_HANDLER( mcu_w ); |
| 93 | READ8_HANDLER( nimbus_mcu_r ); |
| 94 | WRITE8_HANDLER( nimbus_mcu_w ); |
| 92 | 95 | |
| 93 | 96 | |
| 94 | 97 | /* Z80 SIO for keyboard */ |
| r9617 | r9618 | |
| 97 | 100 | #define NIMBUS_KEYROWS 11 |
| 98 | 101 | #define KEYBOARD_QUEUE_SIZE 32 |
| 99 | 102 | |
| 100 | | extern const z80sio_interface sio_intf; |
| 103 | extern const z80sio_interface nimbus_sio_intf; |
| 101 | 104 | |
| 102 | | void sio_interrupt(running_device *device, int state); |
| 103 | | //WRITE8_DEVICE_HANDLER( sio_dtr_w ); |
| 104 | | WRITE8_DEVICE_HANDLER( sio_serial_transmit ); |
| 105 | | int sio_serial_receive( running_device *device, int channel ); |
| 106 | | |
| 107 | 105 | /* Floppy/Fixed drive interface */ |
| 108 | 106 | |
| 109 | 107 | #define FDC_TAG "wd2793" |
| r9617 | r9618 | |
| 180 | 178 | #define IPC_IN_BYTE_AVAIL 0X02 |
| 181 | 179 | #define IPC_IN_READ_PEND 0X04 |
| 182 | 180 | |
| 183 | | READ8_HANDLER( pc8031_r ); |
| 184 | | WRITE8_HANDLER( pc8031_w ); |
| 181 | READ8_HANDLER( nimbus_pc8031_r ); |
| 182 | WRITE8_HANDLER( nimbus_pc8031_w ); |
| 185 | 183 | |
| 186 | | READ8_HANDLER( pc8031_iou_r ); |
| 187 | | WRITE8_HANDLER( pc8031_iou_w ); |
| 184 | READ8_HANDLER( nimbus_pc8031_iou_r ); |
| 185 | WRITE8_HANDLER( nimbus_pc8031_iou_w ); |
| 188 | 186 | |
| 189 | | READ8_HANDLER( pc8031_port_r ); |
| 190 | | WRITE8_HANDLER( pc8031_port_w ); |
| 187 | READ8_HANDLER( nimbus_pc8031_port_r ); |
| 188 | WRITE8_HANDLER( nimbus_pc8031_port_w ); |
| 191 | 189 | |
| 192 | 190 | #define ER59256_TAG "er59256" |
| 193 | 191 | |
| r9617 | r9618 | |
| 198 | 196 | #define MOUSE_INT_ENABLE 0x08 |
| 199 | 197 | #define PC8031_INT_ENABLE 0x10 |
| 200 | 198 | |
| 201 | | READ8_HANDLER( iou_r ); |
| 202 | | WRITE8_HANDLER( iou_w ); |
| 199 | READ8_HANDLER( nimbus_iou_r ); |
| 200 | WRITE8_HANDLER( nimbus_iou_w ); |
| 203 | 201 | |
| 204 | 202 | |
| 205 | | /* Video stuff */ |
| 203 | /*----------- defined in video/rmnimbus.c -----------*/ |
| 204 | |
| 206 | 205 | READ16_HANDLER (nimbus_video_io_r); |
| 207 | 206 | WRITE16_HANDLER (nimbus_video_io_w); |
| 208 | 207 | |
| r9617 | r9618 | |
| 226 | 225 | #define AY8910_TAG "ay8910" |
| 227 | 226 | #define MONO_TAG "mono" |
| 228 | 227 | |
| 229 | | READ8_HANDLER( sound_ay8910_r ); |
| 230 | | WRITE8_HANDLER( sound_ay8910_w ); |
| 228 | READ8_HANDLER( nimbus_sound_ay8910_r ); |
| 229 | WRITE8_HANDLER( nimbus_sound_ay8910_w ); |
| 231 | 230 | |
| 232 | | WRITE8_HANDLER( sound_ay8910_porta_w ); |
| 233 | | WRITE8_HANDLER( sound_ay8910_portb_w ); |
| 231 | WRITE8_HANDLER( nimbus_sound_ay8910_porta_w ); |
| 232 | WRITE8_HANDLER( nimbus_sound_ay8910_portb_w ); |
| 234 | 233 | |
| 235 | 234 | |
| 236 | 235 | #define MSM5205_TAG "msm5205" |
| r9617 | r9618 | |
| 251 | 250 | MOUSE_PHASE_NEGATIVE |
| 252 | 251 | }; |
| 253 | 252 | |
| 254 | | READ8_HANDLER( mouse_js_r ); |
| 255 | | WRITE8_HANDLER( mouse_js_w ); |
| 253 | READ8_HANDLER( nimbus_mouse_js_r ); |
| 254 | WRITE8_HANDLER( nimbus_mouse_js_w ); |
| 256 | 255 | |
| 257 | 256 | #define MOUSE_INT_ENABLED() ((iou_reg092 & MOUSE_INT_ENABLE) ? 1 : 0) |
| 258 | 257 | |
src/mess/drivers/rmnimbus.c
| r9617 | r9618 | |
| 68 | 68 | AY8910_DEFAULT_LOADS, |
| 69 | 69 | DEVCB_NULL, /* portA read */ |
| 70 | 70 | DEVCB_NULL, /* portB read */ |
| 71 | | DEVCB_MEMORY_HANDLER(MAINCPU_TAG, PROGRAM, sound_ay8910_porta_w), /* portA write */ |
| 72 | | DEVCB_MEMORY_HANDLER(MAINCPU_TAG, PROGRAM, sound_ay8910_portb_w) /* portB write */ |
| 71 | DEVCB_MEMORY_HANDLER(MAINCPU_TAG, PROGRAM, nimbus_sound_ay8910_porta_w), /* portA write */ |
| 72 | DEVCB_MEMORY_HANDLER(MAINCPU_TAG, PROGRAM, nimbus_sound_ay8910_portb_w) /* portB write */ |
| 73 | 73 | }; |
| 74 | 74 | |
| 75 | 75 | static const msm5205_interface msm5205_config = |
| r9617 | r9618 | |
| 111 | 111 | static ADDRESS_MAP_START(nimbus_io, ADDRESS_SPACE_IO, 16) |
| 112 | 112 | AM_RANGE( 0x0000, 0x0031) AM_READWRITE( nimbus_video_io_r, nimbus_video_io_w) |
| 113 | 113 | AM_RANGE( 0x0032, 0x007f) AM_READWRITE( nimbus_io_r, nimbus_io_w) |
| 114 | | AM_RANGE( 0x0080, 0x0081) AM_READWRITE8( mcu_r, mcu_w, 0x00FF) |
| 115 | | AM_RANGE( 0x0092, 0x0093) AM_READWRITE8( iou_r, iou_w, 0x00FF) |
| 116 | | AM_RANGE( 0x00A4, 0x00A5) AM_READWRITE8( mouse_js_r, mouse_js_w, 0x00FF) |
| 117 | | AM_RANGE( 0X00c0, 0X00cf) AM_READWRITE8( pc8031_r, pc8031_w, 0x00FF) |
| 118 | | AM_RANGE( 0X00e0, 0X00ef) AM_READWRITE8( sound_ay8910_r, sound_ay8910_w, 0x00FF) |
| 114 | AM_RANGE( 0x0080, 0x0081) AM_READWRITE8( nimbus_mcu_r, nimbus_mcu_w, 0x00FF) |
| 115 | AM_RANGE( 0x0092, 0x0093) AM_READWRITE8( nimbus_iou_r, nimbus_iou_w, 0x00FF) |
| 116 | AM_RANGE( 0x00A4, 0x00A5) AM_READWRITE8( nimbus_mouse_js_r, nimbus_mouse_js_w, 0x00FF) |
| 117 | AM_RANGE( 0X00c0, 0X00cf) AM_READWRITE8( nimbus_pc8031_r, nimbus_pc8031_w, 0x00FF) |
| 118 | AM_RANGE( 0X00e0, 0X00ef) AM_READWRITE8( nimbus_sound_ay8910_r, nimbus_sound_ay8910_w, 0x00FF) |
| 119 | 119 | AM_RANGE( 0x00f0, 0x00f7) AM_DEVREADWRITE8(Z80SIO_TAG, z80sio_cd_ba_r, z80sio_cd_ba_w, 0x00ff) |
| 120 | 120 | AM_RANGE( 0x0400, 0x041f) AM_READWRITE8( nimbus_disk_r, nimbus_disk_w, 0x00FF) |
| 121 | | AM_RANGE( 0xff00, 0xffff) AM_READWRITE( i186_internal_port_r, i186_internal_port_w)/* CPU 80186 */ |
| 121 | AM_RANGE( 0xff00, 0xffff) AM_READWRITE( nimbus_i186_internal_port_r, nimbus_i186_internal_port_w)/* CPU 80186 */ |
| 122 | 122 | ADDRESS_MAP_END |
| 123 | 123 | |
| 124 | 124 | static INPUT_PORTS_START( nimbus ) |
| r9617 | r9618 | |
| 272 | 272 | |
| 273 | 273 | static ADDRESS_MAP_START( nimbus_iocpu_io , ADDRESS_SPACE_IO, 8) |
| 274 | 274 | ADDRESS_MAP_UNMAP_HIGH |
| 275 | | AM_RANGE(0x00000, 0x000FF) AM_READWRITE(pc8031_iou_r, pc8031_iou_w) |
| 275 | AM_RANGE(0x00000, 0x000FF) AM_READWRITE(nimbus_pc8031_iou_r, nimbus_pc8031_iou_w) |
| 276 | 276 | AM_RANGE(0x00010, 0x07fff) AM_RAM |
| 277 | | AM_RANGE(0x20000, 0x20004) AM_READWRITE(pc8031_port_r, pc8031_port_w) |
| 277 | AM_RANGE(0x20000, 0x20004) AM_READWRITE(nimbus_pc8031_port_r, nimbus_pc8031_port_w) |
| 278 | 278 | ADDRESS_MAP_END |
| 279 | 279 | |
| 280 | 280 | |
| r9617 | r9618 | |
| 337 | 337 | MDRV_RAM_EXTRA_OPTIONS("128K,256K,384K,512K,640K,1024K") |
| 338 | 338 | |
| 339 | 339 | /* Peripheral chips */ |
| 340 | | MDRV_Z80SIO_ADD(Z80SIO_TAG, 4000000, sio_intf) |
| 340 | MDRV_Z80SIO_ADD(Z80SIO_TAG, 4000000, nimbus_sio_intf) |
| 341 | 341 | |
| 342 | 342 | MDRV_ER59256_ADD(ER59256_TAG) |
| 343 | 343 | |
src/mess/drivers/micronic.c
| r9617 | r9618 | |
| 135 | 135 | return data; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | | READ8_HANDLER( kp_r ) |
| 138 | static READ8_HANDLER( kp_r ) |
| 139 | 139 | { |
| 140 | 140 | return keypad_r(space->machine); |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | | READ8_HANDLER( status_flag_r ) |
| 143 | static READ8_HANDLER( status_flag_r ) |
| 144 | 144 | { |
| 145 | 145 | micronic_state *state = space->machine->driver_data<micronic_state>(); |
| 146 | 146 | return state->status_flag; |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | | WRITE8_HANDLER( status_flag_w ) |
| 149 | static WRITE8_HANDLER( status_flag_w ) |
| 150 | 150 | { |
| 151 | 151 | micronic_state *state = space->machine->driver_data<micronic_state>(); |
| 152 | 152 | state->status_flag = data; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | | WRITE8_HANDLER( kp_matrix_w ) |
| 155 | static WRITE8_HANDLER( kp_matrix_w ) |
| 156 | 156 | { |
| 157 | 157 | micronic_state *state = space->machine->driver_data<micronic_state>(); |
| 158 | 158 | state->kp_matrix = data; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | | WRITE8_HANDLER( beep_w ) |
| 161 | static WRITE8_HANDLER( beep_w ) |
| 162 | 162 | { |
| 163 | 163 | micronic_state *state = space->machine->driver_data<micronic_state>(); |
| 164 | 164 | UINT16 frequency = 0; |
| r9617 | r9618 | |
| 188 | 188 | beep_set_frequency(state->speaker, frequency); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | | READ8_HANDLER( irq_flag_r ) |
| 191 | static READ8_HANDLER( irq_flag_r ) |
| 192 | 192 | { |
| 193 | 193 | return (input_port_read(space->machine, "BACKBATTERY")<<4) | (input_port_read(space->machine, "MAINBATTERY")<<3) | (keypad_r(space->machine) ? 0 : 1); |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | | WRITE8_HANDLER( bank_select_w ) |
| 196 | static WRITE8_HANDLER( bank_select_w ) |
| 197 | 197 | { |
| 198 | 198 | if (data < 2) |
| 199 | 199 | { |
| r9617 | r9618 | |
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | | WRITE8_HANDLER( lcd_contrast_w ) |
| 210 | static WRITE8_HANDLER( lcd_contrast_w ) |
| 211 | 211 | { |
| 212 | 212 | micronic_state *state = space->machine->driver_data<micronic_state>(); |
| 213 | 213 | |
| r9617 | r9618 | |
| 219 | 219 | RTC-146818 |
| 220 | 220 | ***************************************************************************/ |
| 221 | 221 | |
| 222 | | void set_146818_periodic_irq(running_machine *machine, UINT8 data) |
| 222 | static void set_146818_periodic_irq(running_machine *machine, UINT8 data) |
| 223 | 223 | { |
| 224 | 224 | micronic_state *state = machine->driver_data<micronic_state>(); |
| 225 | 225 | |
| r9617 | r9618 | |
| 248 | 248 | timer_adjust_periodic(state->rtc_periodic_irq, timer_per, 0, timer_per); |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | | WRITE8_HANDLER( rtc_address_w ) |
| 251 | static WRITE8_HANDLER( rtc_address_w ) |
| 252 | 252 | { |
| 253 | 253 | micronic_state *state = space->machine->driver_data<micronic_state>(); |
| 254 | 254 | state->rtc_address = data; |
| r9617 | r9618 | |
| 256 | 256 | rtc->write(*space, 0, data); |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | | READ8_HANDLER( rtc_data_r ) |
| 259 | static READ8_HANDLER( rtc_data_r ) |
| 260 | 260 | { |
| 261 | 261 | micronic_state *state = space->machine->driver_data<micronic_state>(); |
| 262 | 262 | UINT8 data = 0; |
| r9617 | r9618 | |
| 274 | 274 | return data; |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | | WRITE8_HANDLER( rtc_data_w ) |
| 277 | static WRITE8_HANDLER( rtc_data_w ) |
| 278 | 278 | { |
| 279 | 279 | micronic_state *state = space->machine->driver_data<micronic_state>(); |
| 280 | 280 | mc146818_device *rtc = space->machine->device<mc146818_device>("rtc"); |