src/mess/machine/svi318.c
| r3724 | r3725 | |
| 19 | 19 | #include "formats/svi_cas.h" |
| 20 | 20 | #include "sound/dac.h" |
| 21 | 21 | #include "sound/ay8910.h" |
| 22 | | #include "deprecat.h" |
| 23 | 22 | |
| 24 | 23 | enum { |
| 25 | 24 | SVI_INTERNAL = 0, |
| r3724 | r3725 | |
| 168 | 167 | |
| 169 | 168 | if (cassette_input(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" )) > 0.0038) |
| 170 | 169 | data |= 0x80; |
| 171 | | if (!svi318_cassette_present(0)) |
| 170 | if (!svi318_cassette_present(device->machine, 0)) |
| 172 | 171 | data |= 0x40; |
| 173 | 172 | data |= input_port_read(device->machine, "BUTTONS") & 0x30; |
| 174 | 173 | |
| r3724 | r3725 | |
| 224 | 223 | dac_signed_data_w (0, val); |
| 225 | 224 | |
| 226 | 225 | /* cassette motor on/off */ |
| 227 | | if (svi318_cassette_present(0)) |
| 226 | if (svi318_cassette_present(device->machine, 0)) |
| 228 | 227 | { |
| 229 | 228 | cassette_change_state( |
| 230 | 229 | device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ), |
| r3724 | r3725 | |
| 808 | 807 | |
| 809 | 808 | /* Cassette */ |
| 810 | 809 | |
| 811 | | int svi318_cassette_present(int id) |
| 810 | int svi318_cassette_present(running_machine *machine, int id) |
| 812 | 811 | { |
| 813 | | const device_config *img = device_list_find_by_tag( Machine->config->devicelist, CASSETTE, "cassette" ); |
| 812 | const device_config *img = device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ); |
| 814 | 813 | |
| 815 | 814 | if ( img == NULL ) |
| 816 | 815 | return FALSE; |
src/mess/machine/sym1.c
| r3724 | r3725 | |
| 19 | 19 | #include "machine/6532riot.h" |
| 20 | 20 | #include "machine/74145.h" |
| 21 | 21 | #include "sound/speaker.h" |
| 22 | | #include "deprecat.h" |
| 23 | 22 | |
| 24 | 23 | #define LED_REFRESH_DELAY ATTOTIME_IN_USEC(70) |
| 25 | 24 | |
| r3724 | r3725 | |
| 196 | 195 | */ |
| 197 | 196 | static WRITE8_HANDLER( sym1_via2_a_w ) |
| 198 | 197 | { |
| 198 | const address_space *cpu0space = cpu_get_address_space( space->machine->cpu[0], ADDRESS_SPACE_PROGRAM ); |
| 199 | |
| 199 | 200 | logerror("SYM1 VIA2 W 0x%02x\n", data); |
| 200 | 201 | |
| 201 | | memory_install_write8_handler(cpu_get_address_space( Machine->cpu[0], ADDRESS_SPACE_PROGRAM ), 0xa600, 0xa67f, 0, 0, |
| 202 | memory_install_write8_handler(cpu0space, 0xa600, 0xa67f, 0, 0, |
| 202 | 203 | ((input_port_read(space->machine, "WP") & 0x01) && !(data & 0x01)) ? SMH_NOP : SMH_BANK5); |
| 203 | 204 | |
| 204 | | memory_install_write8_handler(cpu_get_address_space( Machine->cpu[0], ADDRESS_SPACE_PROGRAM ), 0x0400, 0x07ff, 0, 0, |
| 205 | memory_install_write8_handler(cpu0space, 0x0400, 0x07ff, 0, 0, |
| 205 | 206 | ((input_port_read(space->machine, "WP") & 0x02) && !(data & 0x02)) ? SMH_NOP : SMH_BANK2); |
| 206 | 207 | |
| 207 | | memory_install_write8_handler(cpu_get_address_space( Machine->cpu[0], ADDRESS_SPACE_PROGRAM ), 0x0800, 0x0bff, 0, 0, |
| 208 | memory_install_write8_handler(cpu0space, 0x0800, 0x0bff, 0, 0, |
| 208 | 209 | ((input_port_read(space->machine, "WP") & 0x04) && !(data & 0x04)) ? SMH_NOP : SMH_BANK3); |
| 209 | 210 | |
| 210 | | memory_install_write8_handler(cpu_get_address_space( Machine->cpu[0], ADDRESS_SPACE_PROGRAM ), 0x0c00, 0x0fff, 0, 0, |
| 211 | memory_install_write8_handler(cpu0space, 0x0c00, 0x0fff, 0, 0, |
| 211 | 212 | ((input_port_read(space->machine, "WP") & 0x08) && !(data & 0x08)) ? SMH_NOP : SMH_BANK4); |
| 212 | 213 | } |
| 213 | 214 | |
src/mess/devices/z80bin.c
| r3724 | r3725 | |
| 10 | 10 | #include "driver.h" |
| 11 | 11 | #include "z80bin.h" |
| 12 | 12 | #include "snapquik.h" |
| 13 | | #include "deprecat.h" |
| 14 | 13 | |
| 15 | 14 | |
| 16 | 15 | |
| r3724 | r3725 | |
| 85 | 84 | image_seterror(image, IMAGE_ERROR_INVALIDIMAGE, message); |
| 86 | 85 | return INIT_FAIL; |
| 87 | 86 | } |
| 88 | | memory_write_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), j, data); |
| 87 | memory_write_byte(cputag_get_address_space(image->machine,"main",ADDRESS_SPACE_PROGRAM), j, data); |
| 89 | 88 | } |
| 90 | 89 | |
| 91 | 90 | return INIT_PASS; |
| r3724 | r3725 | |
| 118 | 117 | /* start program */ |
| 119 | 118 | if (config->execute != NULL) |
| 120 | 119 | { |
| 121 | | (*config->execute)(start_addr, end_addr, exec_addr, autorun); |
| 120 | (*config->execute)(image->machine, start_addr, end_addr, exec_addr, autorun); |
| 122 | 121 | } |
| 123 | 122 | else |
| 124 | 123 | { |
| 125 | 124 | if (autorun) |
| 126 | | cpu_set_reg(cputag_get_cpu(Machine, "main"), REG_PC, exec_addr); |
| 125 | cpu_set_reg(cputag_get_cpu(image->machine, "main"), REG_PC, exec_addr); |
| 127 | 126 | } |
| 128 | 127 | } |
| 129 | 128 | |
src/mess/devices/z80bin.h
| r3724 | r3725 | |
| 21 | 21 | #define Z80BIN DEVICE_GET_INFO_NAME(z80bin) |
| 22 | 22 | |
| 23 | 23 | #define Z80BIN_EXECUTE_NAME(name) z80bin_execute_##name |
| 24 | | #define Z80BIN_EXECUTE(name) void Z80BIN_EXECUTE_NAME(name)(UINT16 start_address, UINT16 end_address, UINT16 execute_address, int autorun) |
| 24 | #define Z80BIN_EXECUTE(name) void Z80BIN_EXECUTE_NAME(name)(running_machine *machine, UINT16 start_address, UINT16 end_address, UINT16 execute_address, int autorun) |
| 25 | 25 | |
| 26 | 26 | #define z80bin_execute_default NULL |
| 27 | 27 | |
| r3724 | r3725 | |
| 31 | 31 | TYPE DEFINITIONS |
| 32 | 32 | ***************************************************************************/ |
| 33 | 33 | |
| 34 | | typedef void (*z80bin_execute_func)(UINT16 start_address, UINT16 end_address, UINT16 execute_address, int autorun); |
| 34 | typedef void (*z80bin_execute_func)(running_machine *machine, UINT16 start_address, UINT16 end_address, UINT16 execute_address, int autorun); |
| 35 | 35 | |
| 36 | 36 | typedef struct _z80bin_config z80bin_config; |
| 37 | 37 | struct _z80bin_config |
src/mess/drivers/exidy.c
| r3724 | r3725 | |
| 148 | 148 | #include "devices/z80bin.h" |
| 149 | 149 | #include "sound/speaker.h" |
| 150 | 150 | #include "machine/ay31015.h" |
| 151 | | #include "deprecat.h" |
| 152 | 151 | |
| 153 | 152 | |
| 154 | 153 | static const device_config *exidy_ay31015; |
| r3724 | r3725 | |
| 348 | 347 | |
| 349 | 348 | static MACHINE_RESET( exidyd ) |
| 350 | 349 | { |
| 350 | const address_space *space = cputag_get_address_space(machine, "main", ADDRESS_SPACE_PROGRAM); |
| 351 | |
| 351 | 352 | /* Initialize cassette interface */ |
| 352 | 353 | cass_data.output.length = 0; |
| 353 | 354 | cass_data.output.level = 1; |
| r3724 | r3725 | |
| 359 | 360 | centronics_config(0, exidy_cent_config); |
| 360 | 361 | /* assumption: select is tied low */ |
| 361 | 362 | centronics_write_handshake(0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET); |
| 362 | | exidy_fe_port_w(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0, 0); |
| 363 | exidy_fe_port_w(space, 0, 0); |
| 363 | 364 | |
| 364 | 365 | timer_set(ATTOTIME_IN_USEC(10), NULL, 0, exidy_reset); |
| 365 | 366 | memory_set_bank(machine, 1, 1); |
| r3724 | r3725 | |
| 873 | 874 | |
| 874 | 875 | static Z80BIN_EXECUTE( exidy ) |
| 875 | 876 | { |
| 876 | | if ((execute_address >= 0xc000) && (execute_address <= 0xdfff) && (memory_read_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0xdffa) != 0xc3)) |
| 877 | const address_space *space = cputag_get_address_space(machine, "main", ADDRESS_SPACE_PROGRAM); |
| 878 | |
| 879 | if ((execute_address >= 0xc000) && (execute_address <= 0xdfff) && (memory_read_byte(space, 0xdffa) != 0xc3)) |
| 877 | 880 | return; /* can't run a program if the cartridge isn't in */ |
| 878 | 881 | |
| 879 | 882 | /* Since Exidy Basic is by Microsoft, it needs some preprocessing before it can be run. |
| r3724 | r3725 | |
| 893 | 896 | 0xc3, 0x89, 0xc6,}; // JP C689 ;run program |
| 894 | 897 | |
| 895 | 898 | for (i = 0; i < ARRAY_LENGTH(data); i++) |
| 896 | | memory_write_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0xf01f + i, data[i]); |
| 899 | memory_write_byte(space, 0xf01f + i, data[i]); |
| 897 | 900 | |
| 898 | 901 | if (!autorun) |
| 899 | | memory_write_word_16le(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0xf028,0xc3dd); |
| 902 | memory_write_word_16le(space, 0xf028,0xc3dd); |
| 900 | 903 | |
| 901 | 904 | /* tell BASIC where program ends */ |
| 902 | | memory_write_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0x1b7, (end_address >> 0) & 0xff); |
| 903 | | memory_write_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0x1b8, (end_address >> 8) & 0xff); |
| 905 | memory_write_byte(space, 0x1b7, (end_address >> 0) & 0xff); |
| 906 | memory_write_byte(space, 0x1b8, (end_address >> 8) & 0xff); |
| 904 | 907 | |
| 905 | 908 | if ((execute_address != 0xc858) && autorun) |
| 906 | | memory_write_word_16le(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0xf028, execute_address); |
| 909 | memory_write_word_16le(space, 0xf028, execute_address); |
| 907 | 910 | |
| 908 | | cpu_set_reg(cputag_get_cpu(Machine, "main"), REG_PC, 0xf01f); |
| 911 | cpu_set_reg(cputag_get_cpu(machine, "main"), REG_PC, 0xf01f); |
| 909 | 912 | } |
| 910 | 913 | else |
| 911 | 914 | { |
| 912 | 915 | if (autorun) |
| 913 | | cpu_set_reg(cputag_get_cpu(Machine, "main"), REG_PC, execute_address); |
| 916 | cpu_set_reg(cputag_get_cpu(machine, "main"), REG_PC, execute_address); |
| 914 | 917 | } |
| 915 | 918 | } |
| 916 | 919 | |