src/mess/devices/cococart.h
| r2198 | r2199 | |
| 98 | 98 | cococart_line_value cococart_get_line(coco_cartridge *cartridge, cococart_line line); |
| 99 | 99 | void cococart_map_memory(coco_cartridge *cartridge, UINT32 offset, UINT32 mask); |
| 100 | 100 | |
| 101 | | coco_cartridge *cococart_init(const char *carttype, const coco_cartridge_config *callbacks); |
| 101 | coco_cartridge *cococart_init(running_machine *machine, const char *carttype, const coco_cartridge_config *callbacks); |
| 102 | 102 | UINT8 cococart_read(coco_cartridge *cartridge, UINT16 address); |
| 103 | 103 | void cococart_write(coco_cartridge *cartridge, UINT16 address, UINT8 data); |
| 104 | 104 | void cococart_enable_sound(coco_cartridge *cartridge, int enable); |
src/mess/devices/coco_fdc.c
| r2198 | r2199 | |
| 142 | 142 | fdc_init - general function to initialize FDC |
| 143 | 143 | -------------------------------------------------*/ |
| 144 | 144 | |
| 145 | | static void fdc_init(coco_cartridge *cartridge, |
| 145 | static void fdc_init(running_machine *machine, |
| 146 | coco_cartridge *cartridge, |
| 146 | 147 | wd17xx_type_t type, |
| 147 | 148 | void (*update_lines)(coco_cartridge *cartridge), |
| 148 | 149 | int initial_drq) |
| r2198 | r2199 | |
| 155 | 156 | info->drq = initial_drq ? 1 : 0; |
| 156 | 157 | |
| 157 | 158 | /* initialize FDC */ |
| 158 | | wd17xx_init(Machine, type, fdc_callback, (void *) cartridge); |
| 159 | wd17xx_init(machine, type, fdc_callback, (void *) cartridge); |
| 159 | 160 | } |
| 160 | 161 | |
| 161 | 162 | |
| r2198 | r2199 | |
| 213 | 214 | |
| 214 | 215 | static void fdc_coco_init(coco_cartridge *cartridge) |
| 215 | 216 | { |
| 216 | | fdc_init(cartridge, WD_TYPE_1773, fdc_coco_update_lines, 1); |
| 217 | fdc_init(Machine, cartridge, WD_TYPE_1773, fdc_coco_update_lines, 1); |
| 217 | 218 | } |
| 218 | 219 | |
| 219 | 220 | |
| r2198 | r2199 | |
| 522 | 523 | |
| 523 | 524 | static void fdc_dragon_init(coco_cartridge *cartridge) |
| 524 | 525 | { |
| 525 | | fdc_init(cartridge, WD_TYPE_179X, fdc_dragon_update_lines, 0); |
| 526 | fdc_init(Machine, cartridge, WD_TYPE_179X, fdc_dragon_update_lines, 0); |
| 526 | 527 | } |
| 527 | 528 | |
| 528 | 529 | |
src/mess/devices/appldriv.c
| r2198 | r2199 | |
| 218 | 218 | |
| 219 | 219 | |
| 220 | 220 | |
| 221 | | static const device_config *apple525_selected_image(void) |
| 221 | static const device_config *apple525_selected_image(running_machine *machine) |
| 222 | 222 | { |
| 223 | 223 | int i, count; |
| 224 | 224 | |
| 225 | | count = device_count_tag_from_machine(Machine, APPLE525TAG); |
| 225 | count = device_count_tag_from_machine(machine, APPLE525TAG); |
| 226 | 226 | |
| 227 | 227 | for (i = 0; i < count; i++) |
| 228 | 228 | { |
| r2198 | r2199 | |
| 237 | 237 | UINT8 apple525_read_data(void) |
| 238 | 238 | { |
| 239 | 239 | const device_config *image; |
| 240 | | image = apple525_selected_image(); |
| 240 | image = apple525_selected_image(Machine); |
| 241 | 241 | return image ? apple525_process_byte(image, -1) : 0xFF; |
| 242 | 242 | } |
| 243 | 243 | |
| r2198 | r2199 | |
| 246 | 246 | void apple525_write_data(UINT8 data) |
| 247 | 247 | { |
| 248 | 248 | const device_config *image; |
| 249 | | image = apple525_selected_image(); |
| 249 | image = apple525_selected_image(Machine); |
| 250 | 250 | if (image) |
| 251 | 251 | apple525_process_byte(image, data); |
| 252 | 252 | } |
src/mess/devices/thomflop.c
| r2198 | r2199 | |
| 7 | 7 | **********************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | | #include "deprecat.h" |
| 11 | 10 | #include "includes/thomson.h" |
| 12 | 11 | #include "machine/wd17xx.h" |
| 13 | 12 | #include "devices/flopdrv.h" |
| r2198 | r2199 | |
| 333 | 332 | |
| 334 | 333 | |
| 335 | 334 | |
| 336 | | static void to7_5p14_reset( void ) |
| 335 | static void to7_5p14_reset( running_machine *machine ) |
| 337 | 336 | { |
| 338 | 337 | int i; |
| 339 | 338 | LOG(( "to7_5p14_reset: CD 90-640 controller\n" )); |
| 340 | 339 | thom_floppy_set_density( DEN_MFM_LO ); |
| 341 | 340 | wd17xx_reset(); |
| 342 | | for ( i = 0; i < device_count( Machine, IO_FLOPPY ); i++ ) |
| 341 | for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ ) |
| 343 | 342 | { |
| 344 | 343 | const device_config * img = image_from_devtype_and_index( IO_FLOPPY, i ); |
| 345 | 344 | floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 ); |
| r2198 | r2199 | |
| 434 | 433 | |
| 435 | 434 | |
| 436 | 435 | |
| 437 | | static void to7_5p14sd_reset( void ) |
| 436 | static void to7_5p14sd_reset( running_machine *machine ) |
| 438 | 437 | { |
| 439 | 438 | int i; |
| 440 | 439 | LOG(( "to7_5p14sd_reset: CD 90-015 controller\n" )); |
| 441 | 440 | thom_floppy_set_density( DEN_FM_LO ); |
| 442 | 441 | mc6843_reset(); |
| 443 | | for ( i = 0; i < device_count( Machine, IO_FLOPPY ); i++ ) |
| 442 | for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ ) |
| 444 | 443 | { |
| 445 | 444 | const device_config * img = image_from_devtype_and_index( IO_FLOPPY, i ); |
| 446 | 445 | floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 ); |
| r2198 | r2199 | |
| 839 | 838 | |
| 840 | 839 | |
| 841 | 840 | |
| 842 | | static void to7_qdd_reset( void ) |
| 841 | static void to7_qdd_reset( running_machine *machine ) |
| 843 | 842 | { |
| 844 | 843 | int i; |
| 845 | 844 | LOG(( "to7_qdd_reset: CQ 90-028 controller\n" )); |
| 846 | 845 | |
| 847 | 846 | thom_floppy_set_density( DEN_MFM_LO ); |
| 848 | 847 | |
| 849 | | for ( i = 0; i < device_count( Machine, IO_FLOPPY ); i++ ) |
| 848 | for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ ) |
| 850 | 849 | { |
| 851 | 850 | const device_config * img = image_from_devtype_and_index( IO_FLOPPY, i ); |
| 852 | 851 | floppy_drive_set_index_pulse_callback( img, to7_qdd_index_pulse_cb ); |
| r2198 | r2199 | |
| 1522 | 1521 | |
| 1523 | 1522 | |
| 1524 | 1523 | |
| 1525 | | void thmfc_floppy_reset( void ) |
| 1524 | void thmfc_floppy_reset( running_machine *machine ) |
| 1526 | 1525 | { |
| 1527 | 1526 | int i; |
| 1528 | 1527 | LOG(( "thmfc_floppy_reset: THMFC1 controller\n" )); |
| 1529 | 1528 | |
| 1530 | | for ( i = 0; i < device_count( Machine, IO_FLOPPY ); i++ ) |
| 1529 | for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ ) |
| 1531 | 1530 | { |
| 1532 | 1531 | const device_config * img = image_from_devtype_and_index( IO_FLOPPY, i ); |
| 1533 | 1532 | floppy_drive_set_index_pulse_callback( img, thmfc_floppy_index_pulse_cb ); |
| r2198 | r2199 | |
| 1773 | 1772 | |
| 1774 | 1773 | |
| 1775 | 1774 | |
| 1776 | | void to7_floppy_reset ( void ) |
| 1775 | void to7_floppy_reset ( running_machine *machine ) |
| 1777 | 1776 | { |
| 1778 | 1777 | to7_controller_type = (readinputport( THOM_INPUT_FCONFIG ) ) & 7; |
| 1779 | 1778 | |
| r2198 | r2199 | |
| 1782 | 1781 | |
| 1783 | 1782 | case 1: |
| 1784 | 1783 | to7_floppy_bank = 1; |
| 1785 | | to7_5p14sd_reset(); |
| 1784 | to7_5p14sd_reset(machine); |
| 1786 | 1785 | break; |
| 1787 | 1786 | |
| 1788 | 1787 | case 2: |
| 1789 | 1788 | to7_floppy_bank = 2; |
| 1790 | | to7_5p14_reset(); |
| 1789 | to7_5p14_reset(machine); |
| 1791 | 1790 | break; |
| 1792 | 1791 | |
| 1793 | 1792 | case 3: |
| 1794 | 1793 | to7_floppy_bank = 3; |
| 1795 | | thmfc_floppy_reset(); |
| 1794 | thmfc_floppy_reset(machine); |
| 1796 | 1795 | break; |
| 1797 | 1796 | |
| 1798 | 1797 | case 4: |
| 1799 | 1798 | to7_floppy_bank = 7; |
| 1800 | | to7_qdd_reset(); |
| 1799 | to7_qdd_reset(machine); |
| 1801 | 1800 | break; |
| 1802 | 1801 | |
| 1803 | 1802 | case 5: |
| r2198 | r2199 | |
| 1893 | 1892 | |
| 1894 | 1893 | |
| 1895 | 1894 | |
| 1896 | | void to9_floppy_reset( void ) |
| 1895 | void to9_floppy_reset( running_machine *machine ) |
| 1897 | 1896 | { |
| 1898 | | to7_floppy_reset(); |
| 1897 | to7_floppy_reset(machine); |
| 1899 | 1898 | if ( THOM_FLOPPY_EXT ) |
| 1900 | 1899 | { |
| 1901 | 1900 | LOG(( "to9_floppy_reset: external controller\n" )); |
| r2198 | r2199 | |
| 1903 | 1902 | else |
| 1904 | 1903 | { |
| 1905 | 1904 | LOG(( "to9_floppy_reset: internal controller\n" )); |
| 1906 | | to7_5p14_reset(); |
| 1905 | to7_5p14_reset(machine); |
| 1907 | 1906 | memory_set_bank( THOM_FLOP_BANK, TO7_NB_FLOP_BANK ); |
| 1908 | 1907 | } |
| 1909 | 1908 | } |
src/mess/devices/cococart.c
| r2198 | r2199 | |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | 10 | #include "cococart.h" |
| 11 | | #include "deprecat.h" |
| 12 | 11 | |
| 13 | 12 | |
| 14 | 13 | struct _coco_cartridge |
| r2198 | r2199 | |
| 58 | 57 | cococart_init |
| 59 | 58 | -------------------------------------------------*/ |
| 60 | 59 | |
| 61 | | coco_cartridge *cococart_init(const char *carttype, const coco_cartridge_config *callbacks) |
| 60 | coco_cartridge *cococart_init(running_machine *machine, const char *carttype, const coco_cartridge_config *callbacks) |
| 62 | 61 | { |
| 63 | 62 | coco_cartridge *cartridge; |
| 64 | 63 | cococart_getinfo cart_proc; |
| r2198 | r2199 | |
| 66 | 65 | void (*init)(coco_cartridge *cartridge); |
| 67 | 66 | |
| 68 | 67 | /* sanity check */ |
| 69 | | assert_always(mame_get_phase(Machine) == MAME_PHASE_INIT, "Can only call cococart_init at init time!"); |
| 68 | assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call cococart_init at init time!"); |
| 70 | 69 | |
| 71 | 70 | /* identify the cartridge type */ |
| 72 | 71 | cart_proc = find_cart(carttype); |
src/mess/devices/thomflop.h
| r2198 | r2199 | |
| 28 | 28 | |
| 29 | 29 | /* external controllers */ |
| 30 | 30 | extern void to7_floppy_init ( running_machine *machine, void* base ); |
| 31 | | extern void to7_floppy_reset ( void ); |
| 31 | extern void to7_floppy_reset ( running_machine *machine ); |
| 32 | 32 | extern READ8_HANDLER ( to7_floppy_r ); |
| 33 | 33 | extern WRITE8_HANDLER ( to7_floppy_w ); |
| 34 | 34 | |
| 35 | 35 | /* TO9 internal (WD2793) & external controllers */ |
| 36 | 36 | extern void to9_floppy_init ( running_machine *machine, void* int_base, void* ext_base ); |
| 37 | | extern void to9_floppy_reset ( void ); |
| 37 | extern void to9_floppy_reset ( running_machine *machine ); |
| 38 | 38 | extern READ8_HANDLER ( to9_floppy_r ); |
| 39 | 39 | extern WRITE8_HANDLER ( to9_floppy_w ); |
| 40 | 40 | |
| 41 | 41 | /* TO8 internal (THMFC1) controller */ |
| 42 | 42 | extern void thmfc_floppy_init ( void ); |
| 43 | | extern void thmfc_floppy_reset ( void ); |
| 43 | extern void thmfc_floppy_reset ( running_machine *machine ); |
| 44 | 44 | extern READ8_HANDLER ( thmfc_floppy_r ); |
| 45 | 45 | extern WRITE8_HANDLER ( thmfc_floppy_w ); |
| 46 | 46 | |
src/mess/machine/coco.c
| r2198 | r2199 | |
| 925 | 925 | #ifdef UNUSED_FUNCTION |
| 926 | 926 | void coco_set_halt_line(running_machine *machine, int halt_line) |
| 927 | 927 | { |
| 928 | | cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, halt_line); |
| 928 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, halt_line); |
| 929 | 929 | if (halt_line == CLEAR_LINE) |
| 930 | 930 | timer_set(ATTOTIME_IN_CYCLES(1,0), NULL, 0, recalc_interrupts); |
| 931 | 931 | } |
| r2198 | r2199 | |
| 1057 | 1057 | return attotime_add(timer_get_time(), attotime_mul(COCO_CPU_SPEED, val)); |
| 1058 | 1058 | } |
| 1059 | 1059 | |
| 1060 | | static void coco_hiresjoy_w(int data) |
| 1060 | static void coco_hiresjoy_w(running_machine *machine, int data) |
| 1061 | 1061 | { |
| 1062 | 1062 | if (!data && coco_hiresjoy_ca) |
| 1063 | 1063 | { |
| r2198 | r2199 | |
| 1072 | 1072 | coco_hiresjoy_ytransitiontime = attotime_zero; |
| 1073 | 1073 | } |
| 1074 | 1074 | coco_hiresjoy_ca = data; |
| 1075 | | (*update_keyboard)(Machine); |
| 1075 | (*update_keyboard)(machine); |
| 1076 | 1076 | } |
| 1077 | 1077 | |
| 1078 | 1078 | static int coco_hiresjoy_readone(attotime transitiontime) |
| r2198 | r2199 | |
| 1402 | 1402 | static WRITE8_HANDLER ( d_pia0_pa_w ) |
| 1403 | 1403 | { |
| 1404 | 1404 | if (get_input_device(INPUTPORT_RIGHT_JOYSTICK) == INPUTDEVICE_HIRES_CC3MAX_INTERFACE) |
| 1405 | | coco_hiresjoy_w(data & 0x04); |
| 1405 | coco_hiresjoy_w(machine, data & 0x04); |
| 1406 | 1406 | } |
| 1407 | 1407 | |
| 1408 | 1408 | |
| r2198 | r2199 | |
| 1514 | 1514 | (*update_keyboard)(machine); |
| 1515 | 1515 | |
| 1516 | 1516 | if (get_input_device(INPUTPORT_RIGHT_JOYSTICK) == INPUTDEVICE_HIRES_INTERFACE) |
| 1517 | | coco_hiresjoy_w(dac >= 0x80); |
| 1517 | coco_hiresjoy_w(machine, dac >= 0x80); |
| 1518 | 1518 | |
| 1519 | 1519 | /* Handle printer output, serial for CoCos, Paralell for Dragons */ |
| 1520 | 1520 | |
| r2198 | r2199 | |
| 2865 | 2865 | memset(&cart_config, 0, sizeof(cart_config)); |
| 2866 | 2866 | cart_config.set_line = coco_setcartline; |
| 2867 | 2867 | cart_config.map_memory = init->map_memory; |
| 2868 | | coco_cart = cococart_init(cart_hardware, &cart_config); |
| 2868 | coco_cart = cococart_init(machine, cart_hardware, &cart_config); |
| 2869 | 2869 | |
| 2870 | 2870 | #ifdef MAME_DEBUG |
| 2871 | 2871 | cpuintrf_set_dasm_override(0, coco_dasm_override); |
src/mess/machine/thomson.c
| r2198 | r2199 | |
| 1254 | 1254 | pia_reset(); |
| 1255 | 1255 | mc6846_reset(); |
| 1256 | 1256 | to7_game_reset(); |
| 1257 | | to7_floppy_reset(); |
| 1257 | to7_floppy_reset(machine); |
| 1258 | 1258 | to7_io_reset(); |
| 1259 | 1259 | to7_modem_reset(); |
| 1260 | 1260 | to7_midi_reset(); |
| r2198 | r2199 | |
| 1486 | 1486 | pia_reset(); |
| 1487 | 1487 | mc6846_reset(); |
| 1488 | 1488 | to7_game_reset(); |
| 1489 | | to7_floppy_reset(); |
| 1489 | to7_floppy_reset(machine); |
| 1490 | 1490 | to7_io_reset(); |
| 1491 | 1491 | to7_modem_reset(); |
| 1492 | 1492 | to7_midi_reset(); |
| r2198 | r2199 | |
| 1834 | 1834 | pia_reset(); |
| 1835 | 1835 | pia_set_port_a_z_mask( THOM_PIA_SYS, 0x5f ); |
| 1836 | 1836 | to7_game_reset(); |
| 1837 | | to7_floppy_reset(); |
| 1837 | to7_floppy_reset(machine); |
| 1838 | 1838 | to7_io_reset(); |
| 1839 | 1839 | to7_modem_reset(); |
| 1840 | 1840 | to7_midi_reset(); |
| r2198 | r2199 | |
| 2772 | 2772 | pia_set_port_a_z_mask( THOM_PIA_SYS, 0xfe ); |
| 2773 | 2773 | mc6846_reset(); |
| 2774 | 2774 | to7_game_reset(); |
| 2775 | | to9_floppy_reset(); |
| 2775 | to9_floppy_reset(machine); |
| 2776 | 2776 | to9_kbd_reset(); |
| 2777 | 2777 | thom_centronics_reset(); |
| 2778 | 2778 | to7_modem_reset(); |
| r2198 | r2199 | |
| 3348 | 3348 | |
| 3349 | 3349 | |
| 3350 | 3350 | |
| 3351 | | static void to8_floppy_reset( void ) |
| 3351 | static void to8_floppy_reset( running_machine *machine ) |
| 3352 | 3352 | { |
| 3353 | 3353 | UINT8* mem = memory_region(REGION_CPU1); |
| 3354 | | to7_floppy_reset(); |
| 3354 | to7_floppy_reset(machine); |
| 3355 | 3355 | if ( THOM_FLOPPY_INT ) |
| 3356 | | thmfc_floppy_reset(); |
| 3356 | thmfc_floppy_reset(machine); |
| 3357 | 3357 | memory_configure_bank( THOM_FLOP_BANK, TO7_NB_FLOP_BANK, 2, mem + 0x30000, 0x2000 ); |
| 3358 | 3358 | } |
| 3359 | 3359 | |
| r2198 | r2199 | |
| 3697 | 3697 | pia_set_port_a_z_mask( THOM_PIA_SYS, 0xfe ); |
| 3698 | 3698 | mc6846_reset(); |
| 3699 | 3699 | to7_game_reset(); |
| 3700 | | to8_floppy_reset(); |
| 3700 | to8_floppy_reset(machine); |
| 3701 | 3701 | to8_kbd_reset(); |
| 3702 | 3702 | thom_centronics_reset(); |
| 3703 | 3703 | to7_modem_reset(); |
| r2198 | r2199 | |
| 3859 | 3859 | pia_set_port_a_z_mask( THOM_PIA_SYS, 0xfe ); |
| 3860 | 3860 | mc6846_reset(); |
| 3861 | 3861 | to7_game_reset(); |
| 3862 | | to8_floppy_reset(); |
| 3862 | to8_floppy_reset(machine); |
| 3863 | 3863 | to9_kbd_reset(); |
| 3864 | 3864 | thom_centronics_reset(); |
| 3865 | 3865 | to7_modem_reset(); |
| r2198 | r2199 | |
| 4431 | 4431 | pia_reset(); |
| 4432 | 4432 | pia_set_port_a_z_mask( THOM_PIA_SYS, 0x75 ); |
| 4433 | 4433 | mo6_game_reset(); |
| 4434 | | to7_floppy_reset(); |
| 4434 | to7_floppy_reset(machine); |
| 4435 | 4435 | thom_centronics_reset(); |
| 4436 | 4436 | to7_modem_reset(); |
| 4437 | 4437 | to7_midi_reset(); |
| r2198 | r2199 | |
| 4698 | 4698 | pia_reset(); |
| 4699 | 4699 | pia_set_port_a_z_mask( THOM_PIA_SYS, 0x65 ); |
| 4700 | 4700 | mo5nr_game_reset(); |
| 4701 | | to7_floppy_reset(); |
| 4701 | to7_floppy_reset(machine); |
| 4702 | 4702 | thom_centronics_reset(); |
| 4703 | 4703 | to7_modem_reset(); |
| 4704 | 4704 | to7_midi_reset(); |
src/mess/mscommon.c
| r2198 | r2199 | |
| 8 | 8 | |
| 9 | 9 | #include <assert.h> |
| 10 | 10 | #include "driver.h" |
| 11 | | #include "deprecat.h" |
| 12 | 11 | #include "mscommon.h" |
| 13 | 12 | |
| 14 | 13 | /*************************************************************************** |
| r2198 | r2199 | |
| 55 | 54 | } |
| 56 | 55 | |
| 57 | 56 | struct terminal *terminal_create( |
| 57 | running_machine *machine, |
| 58 | 58 | int gfx, int blank_char, int char_bits, |
| 59 | 59 | int (*getcursorcode)(int original_code), |
| 60 | 60 | int num_cols, int num_rows) |
| r2198 | r2199 | |
| 62 | 62 | struct terminal *term; |
| 63 | 63 | int char_width, char_height; |
| 64 | 64 | |
| 65 | | char_width = Machine->gfx[gfx]->width; |
| 66 | | char_height = Machine->gfx[gfx]->height; |
| 65 | char_width = machine->gfx[gfx]->width; |
| 66 | char_height = machine->gfx[gfx]->height; |
| 67 | 67 | |
| 68 | 68 | term = (struct terminal *) auto_malloc(sizeof(struct terminal) - sizeof(term->mem) |
| 69 | 69 | + (num_cols * num_rows * sizeof(termchar_t))); |