trunk/src/mame/drivers/harddriv.c
| r26020 | r26021 | |
| 4030 | 4030 | *************************************/ |
| 4031 | 4031 | |
| 4032 | 4032 | /* COMMON INIT: initialize the original "driver" main board */ |
| 4033 | | static void init_driver(running_machine &machine) |
| 4033 | void harddriv_state::init_driver() |
| 4034 | 4034 | { |
| 4035 | | harddriv_state *state = machine.driver_data<harddriv_state>(); |
| 4036 | | |
| 4037 | 4035 | /* note that we're not multisync */ |
| 4038 | | state->m_gsp_multisync = FALSE; |
| 4036 | m_gsp_multisync = FALSE; |
| 4039 | 4037 | } |
| 4040 | 4038 | |
| 4041 | 4039 | |
| 4042 | 4040 | /* COMMON INIT: initialize the later "multisync" main board */ |
| 4043 | | static void init_multisync(running_machine &machine, int compact_inputs) |
| 4041 | void harddriv_state::init_multisync(int compact_inputs) |
| 4044 | 4042 | { |
| 4045 | | harddriv_state *state = machine.driver_data<harddriv_state>(); |
| 4046 | | |
| 4047 | 4043 | /* note that we're multisync */ |
| 4048 | | state->m_gsp_multisync = TRUE; |
| 4044 | m_gsp_multisync = TRUE; |
| 4049 | 4045 | |
| 4050 | 4046 | // if we have a JSA board, install the read/write handlers |
| 4051 | | if (state->m_jsa != NULL) |
| 4052 | | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x600000, 0x603fff, read8_delegate(FUNC(atari_jsa_base_device::main_response_r),state->m_jsa.target()), write8_delegate(FUNC(atari_jsa_base_device::main_command_w),state->m_jsa.target()), 0xff00); |
| 4047 | if (m_jsa != NULL) |
| 4048 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x600000, 0x603fff, read8_delegate(FUNC(atari_jsa_base_device::main_response_r),m_jsa.target()), write8_delegate(FUNC(atari_jsa_base_device::main_command_w),m_jsa.target()), 0xff00); |
| 4053 | 4049 | |
| 4054 | 4050 | /* install handlers for the compact driving games' inputs */ |
| 4055 | 4051 | if (compact_inputs) |
| 4056 | 4052 | { |
| 4057 | | state->m_maincpu->space(AS_PROGRAM).install_read_handler(0x400000, 0x400001, read16_delegate(FUNC(harddriv_state::hdc68k_wheel_r), state)); |
| 4058 | | state->m_maincpu->space(AS_PROGRAM).install_write_handler(0x408000, 0x408001, write16_delegate(FUNC(harddriv_state::hdc68k_wheel_edge_reset_w), state)); |
| 4059 | | state->m_maincpu->space(AS_PROGRAM).install_read_handler(0xa80000, 0xafffff, read16_delegate(FUNC(harddriv_state::hdc68k_port1_r), state)); |
| 4053 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x400000, 0x400001, read16_delegate(FUNC(harddriv_state::hdc68k_wheel_r), this)); |
| 4054 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x408000, 0x408001, write16_delegate(FUNC(harddriv_state::hdc68k_wheel_edge_reset_w), this)); |
| 4055 | m_maincpu->space(AS_PROGRAM).install_read_handler(0xa80000, 0xafffff, read16_delegate(FUNC(harddriv_state::hdc68k_port1_r), this)); |
| 4060 | 4056 | } |
| 4061 | 4057 | } |
| 4062 | 4058 | |
| 4063 | 4059 | |
| 4064 | 4060 | /* COMMON INIT: initialize the ADSP/ADSP2 board */ |
| 4065 | | static void init_adsp(running_machine &machine) |
| 4061 | void harddriv_state::init_adsp() |
| 4066 | 4062 | { |
| 4067 | | harddriv_state *state = machine.driver_data<harddriv_state>(); |
| 4068 | | |
| 4069 | 4063 | /* install ADSP program RAM */ |
| 4070 | | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0x807fff, read16_delegate(FUNC(harddriv_state::hd68k_adsp_program_r), state), write16_delegate(FUNC(harddriv_state::hd68k_adsp_program_w), state)); |
| 4064 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0x807fff, read16_delegate(FUNC(harddriv_state::hd68k_adsp_program_r), this), write16_delegate(FUNC(harddriv_state::hd68k_adsp_program_w), this)); |
| 4071 | 4065 | |
| 4072 | 4066 | /* install ADSP data RAM */ |
| 4073 | | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x808000, 0x80bfff, read16_delegate(FUNC(harddriv_state::hd68k_adsp_data_r), state), write16_delegate(FUNC(harddriv_state::hd68k_adsp_data_w), state)); |
| 4067 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x808000, 0x80bfff, read16_delegate(FUNC(harddriv_state::hd68k_adsp_data_r), this), write16_delegate(FUNC(harddriv_state::hd68k_adsp_data_w), this)); |
| 4074 | 4068 | |
| 4075 | 4069 | /* install ADSP serial buffer RAM */ |
| 4076 | | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x810000, 0x813fff, read16_delegate(FUNC(harddriv_state::hd68k_adsp_buffer_r), state), write16_delegate(FUNC(harddriv_state::hd68k_adsp_buffer_w), state)); |
| 4070 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x810000, 0x813fff, read16_delegate(FUNC(harddriv_state::hd68k_adsp_buffer_r), this), write16_delegate(FUNC(harddriv_state::hd68k_adsp_buffer_w), this)); |
| 4077 | 4071 | |
| 4078 | 4072 | /* install ADSP control locations */ |
| 4079 | | state->m_maincpu->space(AS_PROGRAM).install_write_handler(0x818000, 0x81801f, write16_delegate(FUNC(harddriv_state::hd68k_adsp_control_w), state)); |
| 4080 | | state->m_maincpu->space(AS_PROGRAM).install_write_handler(0x818060, 0x81807f, write16_delegate(FUNC(harddriv_state::hd68k_adsp_irq_clear_w), state)); |
| 4081 | | state->m_maincpu->space(AS_PROGRAM).install_read_handler(0x838000, 0x83ffff, read16_delegate(FUNC(harddriv_state::hd68k_adsp_irq_state_r), state)); |
| 4073 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x818000, 0x81801f, write16_delegate(FUNC(harddriv_state::hd68k_adsp_control_w), this)); |
| 4074 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x818060, 0x81807f, write16_delegate(FUNC(harddriv_state::hd68k_adsp_irq_clear_w), this)); |
| 4075 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x838000, 0x83ffff, read16_delegate(FUNC(harddriv_state::hd68k_adsp_irq_state_r), this)); |
| 4082 | 4076 | } |
| 4083 | 4077 | |
| 4084 | 4078 | |
| 4085 | 4079 | /* COMMON INIT: initialize the DS3 board */ |
| 4086 | | static void init_ds3(running_machine &machine) |
| 4080 | void harddriv_state::init_ds3() |
| 4087 | 4081 | { |
| 4088 | | harddriv_state *state = machine.driver_data<harddriv_state>(); |
| 4089 | | |
| 4090 | 4082 | /* install ADSP program RAM */ |
| 4091 | | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0x807fff, read16_delegate(FUNC(harddriv_state::hd68k_ds3_program_r), state), write16_delegate(FUNC(harddriv_state::hd68k_ds3_program_w), state)); |
| 4083 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0x807fff, read16_delegate(FUNC(harddriv_state::hd68k_ds3_program_r), this), write16_delegate(FUNC(harddriv_state::hd68k_ds3_program_w), this)); |
| 4092 | 4084 | |
| 4093 | 4085 | /* install ADSP data RAM */ |
| 4094 | | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x808000, 0x80bfff, read16_delegate(FUNC(harddriv_state::hd68k_adsp_data_r), state), write16_delegate(FUNC(harddriv_state::hd68k_adsp_data_w), state)); |
| 4095 | | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x80c000, 0x80dfff, read16_delegate(FUNC(harddriv_state::hdds3_special_r), state), write16_delegate(FUNC(harddriv_state::hdds3_special_w), state)); |
| 4086 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x808000, 0x80bfff, read16_delegate(FUNC(harddriv_state::hd68k_adsp_data_r), this), write16_delegate(FUNC(harddriv_state::hd68k_adsp_data_w), this)); |
| 4087 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x80c000, 0x80dfff, read16_delegate(FUNC(harddriv_state::hdds3_special_r), this), write16_delegate(FUNC(harddriv_state::hdds3_special_w), this)); |
| 4096 | 4088 | |
| 4097 | 4089 | /* install ADSP control locations */ |
| 4098 | | state->m_maincpu->space(AS_PROGRAM).install_read_handler(0x820000, 0x8207ff, read16_delegate(FUNC(harddriv_state::hd68k_ds3_gdata_r), state)); |
| 4099 | | state->m_maincpu->space(AS_PROGRAM).install_read_handler(0x820800, 0x820fff, read16_delegate(FUNC(harddriv_state::hd68k_ds3_girq_state_r), state)); |
| 4100 | | state->m_maincpu->space(AS_PROGRAM).install_write_handler(0x820000, 0x8207ff, write16_delegate(FUNC(harddriv_state::hd68k_ds3_gdata_w), state)); |
| 4101 | | state->m_maincpu->space(AS_PROGRAM).install_write_handler(0x821000, 0x8217ff, write16_delegate(FUNC(harddriv_state::hd68k_adsp_irq_clear_w), state)); |
| 4090 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x820000, 0x8207ff, read16_delegate(FUNC(harddriv_state::hd68k_ds3_gdata_r), this)); |
| 4091 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x820800, 0x820fff, read16_delegate(FUNC(harddriv_state::hd68k_ds3_girq_state_r), this)); |
| 4092 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x820000, 0x8207ff, write16_delegate(FUNC(harddriv_state::hd68k_ds3_gdata_w), this)); |
| 4093 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x821000, 0x8217ff, write16_delegate(FUNC(harddriv_state::hd68k_adsp_irq_clear_w), this)); |
| 4102 | 4094 | |
| 4103 | | state->m_maincpu->space(AS_PROGRAM).install_read_handler(0x822000, 0x8227ff, read16_delegate(FUNC(harddriv_state::hd68k_ds3_sdata_r), state)); |
| 4104 | | state->m_maincpu->space(AS_PROGRAM).install_read_handler(0x822800, 0x822fff, read16_delegate(FUNC(harddriv_state::hd68k_ds3_sirq_state_r), state)); |
| 4105 | | state->m_maincpu->space(AS_PROGRAM).install_write_handler(0x822000, 0x8227ff, write16_delegate(FUNC(harddriv_state::hd68k_ds3_sdata_w), state)); |
| 4106 | | state->m_maincpu->space(AS_PROGRAM).install_write_handler(0x823000, 0x8237ff, write16_delegate(FUNC(harddriv_state::hd68k_ds3_sirq_clear_w), state)); |
| 4107 | | state->m_maincpu->space(AS_PROGRAM).install_write_handler(0x823800, 0x823fff, write16_delegate(FUNC(harddriv_state::hd68k_ds3_control_w), state)); |
| 4095 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x822000, 0x8227ff, read16_delegate(FUNC(harddriv_state::hd68k_ds3_sdata_r), this)); |
| 4096 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x822800, 0x822fff, read16_delegate(FUNC(harddriv_state::hd68k_ds3_sirq_state_r), this)); |
| 4097 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x822000, 0x8227ff, write16_delegate(FUNC(harddriv_state::hd68k_ds3_sdata_w), this)); |
| 4098 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x823000, 0x8237ff, write16_delegate(FUNC(harddriv_state::hd68k_ds3_sirq_clear_w), this)); |
| 4099 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x823800, 0x823fff, write16_delegate(FUNC(harddriv_state::hd68k_ds3_control_w), this)); |
| 4108 | 4100 | |
| 4109 | 4101 | /* predetermine memory regions */ |
| 4110 | | state->m_ds3_sdata_memory = (UINT16 *)state->memregion("ds3sdsp_data")->base(); |
| 4111 | | state->m_ds3_sdata_memory_size = state->memregion("ds3sdsp_data")->bytes() / 2; |
| 4102 | m_ds3_sdata_memory = (UINT16 *)memregion("ds3sdsp_data")->base(); |
| 4103 | m_ds3_sdata_memory_size = memregion("ds3sdsp_data")->bytes() / 2; |
| 4112 | 4104 | |
| 4113 | 4105 | /* |
| 4114 | 4106 | |
| r26020 | r26021 | |
| 4180 | 4172 | |
| 4181 | 4173 | |
| 4182 | 4174 | /* COMMON INIT: initialize the DSK add-on board */ |
| 4183 | | static void init_dsk(running_machine &machine) |
| 4175 | void harddriv_state::init_dsk() |
| 4184 | 4176 | { |
| 4185 | | harddriv_state *state = machine.driver_data<harddriv_state>(); |
| 4186 | | UINT8 *usr3 = state->memregion("user3")->base(); |
| 4177 | UINT8 *usr3 = memregion("user3")->base(); |
| 4187 | 4178 | |
| 4188 | 4179 | /* install ASIC61 */ |
| 4189 | | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x85c000, 0x85c7ff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_dsp32_r), state), write16_delegate(FUNC(harddriv_state::hd68k_dsk_dsp32_w), state)); |
| 4180 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x85c000, 0x85c7ff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_dsp32_r), this), write16_delegate(FUNC(harddriv_state::hd68k_dsk_dsp32_w), this)); |
| 4190 | 4181 | |
| 4191 | 4182 | /* install control registers */ |
| 4192 | | state->m_maincpu->space(AS_PROGRAM).install_write_handler(0x85c800, 0x85c81f, write16_delegate(FUNC(harddriv_state::hd68k_dsk_control_w), state)); |
| 4183 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x85c800, 0x85c81f, write16_delegate(FUNC(harddriv_state::hd68k_dsk_control_w), this)); |
| 4193 | 4184 | |
| 4194 | 4185 | /* install extra RAM */ |
| 4195 | | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x900000, 0x90ffff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_ram_r), state), write16_delegate(FUNC(harddriv_state::hd68k_dsk_ram_w), state)); |
| 4196 | | state->m_dsk_ram = (UINT16 *)(usr3 + 0x40000); |
| 4186 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x900000, 0x90ffff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_ram_r), this), write16_delegate(FUNC(harddriv_state::hd68k_dsk_ram_w), this)); |
| 4187 | m_dsk_ram = (UINT16 *)(usr3 + 0x40000); |
| 4197 | 4188 | |
| 4198 | 4189 | /* install extra ZRAM */ |
| 4199 | | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x910000, 0x910fff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_zram_r), state), write16_delegate(FUNC(harddriv_state::hd68k_dsk_zram_w), state)); |
| 4200 | | state->m_dsk_zram = (UINT16 *)(usr3 + 0x50000); |
| 4190 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x910000, 0x910fff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_zram_r), this), write16_delegate(FUNC(harddriv_state::hd68k_dsk_zram_w), this)); |
| 4191 | m_dsk_zram = (UINT16 *)(usr3 + 0x50000); |
| 4201 | 4192 | |
| 4202 | 4193 | /* install ASIC65 */ |
| 4203 | | state->m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x914000, 0x917fff, FUNC(asic65_data_w)); |
| 4204 | | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x914000, 0x917fff, FUNC(asic65_r)); |
| 4205 | | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x918000, 0x91bfff, FUNC(asic65_io_r)); |
| 4194 | m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x914000, 0x917fff, FUNC(asic65_data_w)); |
| 4195 | m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x914000, 0x917fff, FUNC(asic65_r)); |
| 4196 | m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x918000, 0x91bfff, FUNC(asic65_io_r)); |
| 4206 | 4197 | |
| 4207 | 4198 | /* install extra ROM */ |
| 4208 | | state->m_maincpu->space(AS_PROGRAM).install_read_handler(0x940000, 0x9fffff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_small_rom_r), state)); |
| 4209 | | state->m_dsk_rom = (UINT16 *)(usr3 + 0x00000); |
| 4199 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x940000, 0x9fffff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_small_rom_r), this)); |
| 4200 | m_dsk_rom = (UINT16 *)(usr3 + 0x00000); |
| 4210 | 4201 | |
| 4211 | 4202 | /* set up the ASIC65 */ |
| 4212 | | asic65_config(machine, ASIC65_STANDARD); |
| 4203 | asic65_config(machine(), ASIC65_STANDARD); |
| 4213 | 4204 | } |
| 4214 | 4205 | |
| 4215 | 4206 | |
| 4216 | 4207 | /* COMMON INIT: initialize the DSK II add-on board */ |
| 4217 | | static void init_dsk2(running_machine &machine) |
| 4208 | void harddriv_state::init_dsk2() |
| 4218 | 4209 | { |
| 4219 | | harddriv_state *state = machine.driver_data<harddriv_state>(); |
| 4220 | | UINT8 *usr3 = state->memregion("user3")->base(); |
| 4210 | UINT8 *usr3 = memregion("user3")->base(); |
| 4221 | 4211 | |
| 4222 | 4212 | /* install ASIC65 */ |
| 4223 | | state->m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x824000, 0x824003, FUNC(asic65_data_w)); |
| 4224 | | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x824000, 0x824003, FUNC(asic65_r)); |
| 4225 | | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x825000, 0x825001, FUNC(asic65_io_r)); |
| 4213 | m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x824000, 0x824003, FUNC(asic65_data_w)); |
| 4214 | m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x824000, 0x824003, FUNC(asic65_r)); |
| 4215 | m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x825000, 0x825001, FUNC(asic65_io_r)); |
| 4226 | 4216 | |
| 4227 | 4217 | /* install ASIC61 */ |
| 4228 | | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x827000, 0x8277ff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_dsp32_r), state), write16_delegate(FUNC(harddriv_state::hd68k_dsk_dsp32_w), state)); |
| 4218 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x827000, 0x8277ff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_dsp32_r), this), write16_delegate(FUNC(harddriv_state::hd68k_dsk_dsp32_w), this)); |
| 4229 | 4219 | |
| 4230 | 4220 | /* install control registers */ |
| 4231 | | state->m_maincpu->space(AS_PROGRAM).install_write_handler(0x827800, 0x82781f, write16_delegate(FUNC(harddriv_state::hd68k_dsk_control_w), state)); |
| 4221 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x827800, 0x82781f, write16_delegate(FUNC(harddriv_state::hd68k_dsk_control_w), this)); |
| 4232 | 4222 | |
| 4233 | 4223 | /* install extra RAM */ |
| 4234 | | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x880000, 0x8bffff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_ram_r), state), write16_delegate(FUNC(harddriv_state::hd68k_dsk_ram_w), state)); |
| 4235 | | state->m_dsk_ram = (UINT16 *)(usr3 + 0x100000); |
| 4224 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x880000, 0x8bffff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_ram_r), this), write16_delegate(FUNC(harddriv_state::hd68k_dsk_ram_w), this)); |
| 4225 | m_dsk_ram = (UINT16 *)(usr3 + 0x100000); |
| 4236 | 4226 | |
| 4237 | 4227 | /* install extra ROM */ |
| 4238 | | state->m_maincpu->space(AS_PROGRAM).install_read_handler(0x900000, 0x9fffff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_rom_r), state)); |
| 4239 | | state->m_dsk_rom = (UINT16 *)(usr3 + 0x000000); |
| 4228 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x900000, 0x9fffff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_rom_r), this)); |
| 4229 | m_dsk_rom = (UINT16 *)(usr3 + 0x000000); |
| 4240 | 4230 | |
| 4241 | 4231 | /* set up the ASIC65 */ |
| 4242 | | asic65_config(machine, ASIC65_STANDARD); |
| 4232 | asic65_config(machine(), ASIC65_STANDARD); |
| 4243 | 4233 | } |
| 4244 | 4234 | |
| 4245 | 4235 | |
| 4246 | 4236 | /* COMMON INIT: initialize the DSPCOM add-on board */ |
| 4247 | | static void init_dspcom(running_machine &machine) |
| 4237 | void harddriv_state::init_dspcom() |
| 4248 | 4238 | { |
| 4249 | | harddriv_state *state = machine.driver_data<harddriv_state>(); |
| 4239 | /* install ASIC65 */ |
| 4240 | m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x900000, 0x900003, FUNC(asic65_data_w)); |
| 4241 | m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x900000, 0x900003, FUNC(asic65_r)); |
| 4242 | m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x901000, 0x910001, FUNC(asic65_io_r)); |
| 4250 | 4243 | |
| 4251 | | /* install ASIC65 */ |
| 4252 | | state->m_maincpu->space(AS_PROGRAM).install_legacy_write_handler(0x900000, 0x900003, FUNC(asic65_data_w)); |
| 4253 | | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x900000, 0x900003, FUNC(asic65_r)); |
| 4254 | | state->m_maincpu->space(AS_PROGRAM).install_legacy_read_handler(0x901000, 0x910001, FUNC(asic65_io_r)); |
| 4255 | | |
| 4256 | 4244 | /* set up the ASIC65 */ |
| 4257 | | asic65_config(machine, ASIC65_STEELTAL); |
| 4245 | asic65_config(machine(), ASIC65_STEELTAL); |
| 4258 | 4246 | |
| 4259 | 4247 | /* install DSPCOM control */ |
| 4260 | | state->m_maincpu->space(AS_PROGRAM).install_write_handler(0x904000, 0x90401f, write16_delegate(FUNC(harddriv_state::hddspcom_control_w), state)); |
| 4248 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x904000, 0x90401f, write16_delegate(FUNC(harddriv_state::hddspcom_control_w), this)); |
| 4261 | 4249 | } |
| 4262 | 4250 | |
| 4263 | 4251 | |
| 4264 | 4252 | /* COMMON INIT: initialize the original "driver" sound board */ |
| 4265 | | static void init_driver_sound(running_machine &machine) |
| 4253 | void harddriv_state::init_driver_sound() |
| 4266 | 4254 | { |
| 4267 | | harddriv_state *state = machine.driver_data<harddriv_state>(); |
| 4255 | hdsnd_init(); |
| 4268 | 4256 | |
| 4269 | | hdsnd_init(machine); |
| 4270 | | |
| 4271 | 4257 | /* install sound handlers */ |
| 4272 | | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x840000, 0x840001, read16_delegate(FUNC(harddriv_state::hd68k_snd_data_r),state), write16_delegate(FUNC(harddriv_state::hd68k_snd_data_w),state)); |
| 4273 | | state->m_maincpu->space(AS_PROGRAM).install_read_handler(0x844000, 0x844001, read16_delegate(FUNC(harddriv_state::hd68k_snd_status_r),state)); |
| 4274 | | state->m_maincpu->space(AS_PROGRAM).install_write_handler(0x84c000, 0x84c001, write16_delegate(FUNC(harddriv_state::hd68k_snd_reset_w),state)); |
| 4258 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x840000, 0x840001, read16_delegate(FUNC(harddriv_state::hd68k_snd_data_r), this), write16_delegate(FUNC(harddriv_state::hd68k_snd_data_w), this)); |
| 4259 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x844000, 0x844001, read16_delegate(FUNC(harddriv_state::hd68k_snd_status_r), this)); |
| 4260 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x84c000, 0x84c001, write16_delegate(FUNC(harddriv_state::hd68k_snd_reset_w), this)); |
| 4275 | 4261 | } |
| 4276 | 4262 | |
| 4277 | 4263 | |
| r26020 | r26021 | |
| 4286 | 4272 | DRIVER_INIT_MEMBER(harddriv_state,harddriv) |
| 4287 | 4273 | { |
| 4288 | 4274 | /* initialize the boards */ |
| 4289 | | init_driver(machine()); |
| 4290 | | init_adsp(machine()); |
| 4291 | | init_driver_sound(machine()); |
| 4275 | init_driver(); |
| 4276 | init_adsp(); |
| 4277 | init_driver_sound(); |
| 4292 | 4278 | |
| 4293 | 4279 | /* set up gsp speedup handler */ |
| 4294 | 4280 | m_gsp_speedup_addr[0] = m_gsp->space(AS_PROGRAM).install_write_handler(0xfff9fc00, 0xfff9fc0f, write16_delegate(FUNC(harddriv_state::hdgsp_speedup1_w), this)); |
| r26020 | r26021 | |
| 4309 | 4295 | DRIVER_INIT_MEMBER(harddriv_state,harddrivc) |
| 4310 | 4296 | { |
| 4311 | 4297 | /* initialize the boards */ |
| 4312 | | init_multisync(machine(), 1); |
| 4313 | | init_adsp(machine()); |
| 4314 | | init_driver_sound(machine()); |
| 4298 | init_multisync(1); |
| 4299 | init_adsp(); |
| 4300 | init_driver_sound(); |
| 4315 | 4301 | |
| 4316 | 4302 | /* set up gsp speedup handler */ |
| 4317 | 4303 | m_gsp_speedup_addr[0] = m_gsp->space(AS_PROGRAM).install_write_handler(0xfff9fc00, 0xfff9fc0f, write16_delegate(FUNC(harddriv_state::hdgsp_speedup1_w), this)); |
| r26020 | r26021 | |
| 4332 | 4318 | DRIVER_INIT_MEMBER(harddriv_state,stunrun) |
| 4333 | 4319 | { |
| 4334 | 4320 | /* initialize the boards */ |
| 4335 | | init_multisync(machine(), 0); |
| 4336 | | init_adsp(machine()); |
| 4321 | init_multisync(0); |
| 4322 | init_adsp(); |
| 4337 | 4323 | |
| 4338 | 4324 | /* set up gsp speedup handler */ |
| 4339 | 4325 | m_gsp_speedup_addr[0] = m_gsp->space(AS_PROGRAM).install_write_handler(0xfff9fc00, 0xfff9fc0f, write16_delegate(FUNC(harddriv_state::hdgsp_speedup1_w), this)); |
| r26020 | r26021 | |
| 4349 | 4335 | DRIVER_INIT_MEMBER(harddriv_state,racedriv) |
| 4350 | 4336 | { |
| 4351 | 4337 | /* initialize the boards */ |
| 4352 | | init_driver(machine()); |
| 4353 | | init_adsp(machine()); |
| 4354 | | init_dsk(machine()); |
| 4355 | | init_driver_sound(machine()); |
| 4338 | init_driver(); |
| 4339 | init_adsp(); |
| 4340 | init_dsk(); |
| 4341 | init_driver_sound(); |
| 4356 | 4342 | |
| 4357 | 4343 | /* set up the slapstic */ |
| 4358 | 4344 | slapstic_init(machine(), 117); |
| r26020 | r26021 | |
| 4367 | 4353 | } |
| 4368 | 4354 | |
| 4369 | 4355 | |
| 4370 | | static void racedrivc_init_common(running_machine &machine, offs_t gsp_protection) |
| 4356 | void harddriv_state::racedrivc_init_common(offs_t gsp_protection) |
| 4371 | 4357 | { |
| 4372 | | harddriv_state *state = machine.driver_data<harddriv_state>(); |
| 4373 | | |
| 4374 | 4358 | /* initialize the boards */ |
| 4375 | | init_multisync(machine, 1); |
| 4376 | | init_adsp(machine); |
| 4377 | | init_dsk(machine); |
| 4378 | | init_driver_sound(machine); |
| 4359 | init_multisync(1); |
| 4360 | init_adsp(); |
| 4361 | init_dsk(); |
| 4362 | init_driver_sound(); |
| 4379 | 4363 | |
| 4380 | 4364 | /* set up the slapstic */ |
| 4381 | | slapstic_init(machine, 117); |
| 4382 | | state->m_m68k_slapstic_base = state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xe0000, 0xfffff, read16_delegate(FUNC(harddriv_state::rd68k_slapstic_r), state), write16_delegate(FUNC(harddriv_state::rd68k_slapstic_w), state)); |
| 4365 | slapstic_init(machine(), 117); |
| 4366 | m_m68k_slapstic_base = m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xe0000, 0xfffff, read16_delegate(FUNC(harddriv_state::rd68k_slapstic_r), this), write16_delegate(FUNC(harddriv_state::rd68k_slapstic_w), this)); |
| 4383 | 4367 | |
| 4384 | 4368 | /* synchronization */ |
| 4385 | | state->m_rddsp32_sync[0] = state->m_dsp32->space(AS_PROGRAM).install_write_handler(0x613c00, 0x613c03, write32_delegate(FUNC(harddriv_state::rddsp32_sync0_w), state)); |
| 4386 | | state->m_rddsp32_sync[1] = state->m_dsp32->space(AS_PROGRAM).install_write_handler(0x613e00, 0x613e03, write32_delegate(FUNC(harddriv_state::rddsp32_sync1_w), state)); |
| 4369 | m_rddsp32_sync[0] = m_dsp32->space(AS_PROGRAM).install_write_handler(0x613c00, 0x613c03, write32_delegate(FUNC(harddriv_state::rddsp32_sync0_w), this)); |
| 4370 | m_rddsp32_sync[1] = m_dsp32->space(AS_PROGRAM).install_write_handler(0x613e00, 0x613e03, write32_delegate(FUNC(harddriv_state::rddsp32_sync1_w), this)); |
| 4387 | 4371 | |
| 4388 | 4372 | /* set up protection hacks */ |
| 4389 | | state->m_gsp_protection = state->m_gsp->space(AS_PROGRAM).install_write_handler(gsp_protection, gsp_protection + 0x0f, write16_delegate(FUNC(harddriv_state::hdgsp_protection_w), state)); |
| 4373 | m_gsp_protection = m_gsp->space(AS_PROGRAM).install_write_handler(gsp_protection, gsp_protection + 0x0f, write16_delegate(FUNC(harddriv_state::hdgsp_protection_w), this)); |
| 4390 | 4374 | |
| 4391 | 4375 | /* set up gsp speedup handler */ |
| 4392 | | state->m_gsp_speedup_addr[0] = state->m_gsp->space(AS_PROGRAM).install_write_handler(0xfff76f60, 0xfff76f6f, write16_delegate(FUNC(harddriv_state::rdgsp_speedup1_w), state)); |
| 4393 | | state->m_gsp->space(AS_PROGRAM).install_read_handler(0xfff76f60, 0xfff76f6f, read16_delegate(FUNC(harddriv_state::rdgsp_speedup1_r), state)); |
| 4394 | | state->m_gsp_speedup_pc = 0xfff43a00; |
| 4376 | m_gsp_speedup_addr[0] = m_gsp->space(AS_PROGRAM).install_write_handler(0xfff76f60, 0xfff76f6f, write16_delegate(FUNC(harddriv_state::rdgsp_speedup1_w), this)); |
| 4377 | m_gsp->space(AS_PROGRAM).install_read_handler(0xfff76f60, 0xfff76f6f, read16_delegate(FUNC(harddriv_state::rdgsp_speedup1_r), this)); |
| 4378 | m_gsp_speedup_pc = 0xfff43a00; |
| 4395 | 4379 | |
| 4396 | 4380 | /* set up adsp speedup handlers */ |
| 4397 | | state->m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16_delegate(FUNC(harddriv_state::hdadsp_speedup_r), state)); |
| 4381 | m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16_delegate(FUNC(harddriv_state::hdadsp_speedup_r), this)); |
| 4398 | 4382 | } |
| 4399 | 4383 | |
| 4400 | | DRIVER_INIT_MEMBER(harddriv_state,racedrivc) { racedrivc_init_common(machine(), 0xfff95cd0); } |
| 4401 | | DRIVER_INIT_MEMBER(harddriv_state,racedrivc1) { racedrivc_init_common(machine(), 0xfff7ecd0); } |
| 4384 | DRIVER_INIT_MEMBER(harddriv_state,racedrivc) { racedrivc_init_common(0xfff95cd0); } |
| 4385 | DRIVER_INIT_MEMBER(harddriv_state,racedrivc1) { racedrivc_init_common(0xfff7ecd0); } |
| 4402 | 4386 | |
| 4403 | 4387 | DRIVER_INIT_MEMBER(harddriv_state,racedrivb1) |
| 4404 | 4388 | { |
| r26020 | r26021 | |
| 4423 | 4407 | } |
| 4424 | 4408 | |
| 4425 | 4409 | |
| 4426 | | static void steeltal_init_common(running_machine &machine, offs_t ds3_transfer_pc, int proto_sloop) |
| 4410 | void harddriv_state::steeltal_init_common(offs_t ds3_transfer_pc, int proto_sloop) |
| 4427 | 4411 | { |
| 4428 | | harddriv_state *state = machine.driver_data<harddriv_state>(); |
| 4429 | | |
| 4430 | 4412 | /* initialize the boards */ |
| 4431 | | init_multisync(machine, 0); |
| 4432 | | init_ds3(machine); |
| 4433 | | init_dspcom(machine); |
| 4413 | init_multisync(0); |
| 4414 | init_ds3(); |
| 4415 | init_dspcom(); |
| 4434 | 4416 | |
| 4435 | | state->m_maincpu->space(AS_PROGRAM).install_read_handler(0x908000, 0x908001, read16_delegate(FUNC(harddriv_state::steeltal_dummy_r),state)); |
| 4417 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x908000, 0x908001, read16_delegate(FUNC(harddriv_state::steeltal_dummy_r), this)); |
| 4436 | 4418 | |
| 4437 | 4419 | /* set up the SLOOP */ |
| 4438 | 4420 | if (!proto_sloop) |
| 4439 | 4421 | { |
| 4440 | | state->m_m68k_slapstic_base = state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xe0000, 0xfffff, read16_delegate(FUNC(harddriv_state::st68k_sloop_r), state), write16_delegate(FUNC(harddriv_state::st68k_sloop_w), state)); |
| 4441 | | state->m_m68k_sloop_alt_base = state->m_maincpu->space(AS_PROGRAM).install_read_handler(0x4e000, 0x4ffff, read16_delegate(FUNC(harddriv_state::st68k_sloop_alt_r), state)); |
| 4422 | m_m68k_slapstic_base = m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xe0000, 0xfffff, read16_delegate(FUNC(harddriv_state::st68k_sloop_r), this), write16_delegate(FUNC(harddriv_state::st68k_sloop_w), this)); |
| 4423 | m_m68k_sloop_alt_base = m_maincpu->space(AS_PROGRAM).install_read_handler(0x4e000, 0x4ffff, read16_delegate(FUNC(harddriv_state::st68k_sloop_alt_r), this)); |
| 4442 | 4424 | } |
| 4443 | 4425 | else |
| 4444 | | state->m_m68k_slapstic_base = state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xe0000, 0xfffff, read16_delegate(FUNC(harddriv_state::st68k_protosloop_r), state), write16_delegate(FUNC(harddriv_state::st68k_protosloop_w), state)); |
| 4426 | m_m68k_slapstic_base = m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xe0000, 0xfffff, read16_delegate(FUNC(harddriv_state::st68k_protosloop_r), this), write16_delegate(FUNC(harddriv_state::st68k_protosloop_w), this)); |
| 4445 | 4427 | |
| 4446 | 4428 | /* set up protection hacks */ |
| 4447 | | state->m_gsp_protection = state->m_gsp->space(AS_PROGRAM).install_write_handler(0xfff965d0, 0xfff965df, write16_delegate(FUNC(harddriv_state::hdgsp_protection_w), state)); |
| 4429 | m_gsp_protection = m_gsp->space(AS_PROGRAM).install_write_handler(0xfff965d0, 0xfff965df, write16_delegate(FUNC(harddriv_state::hdgsp_protection_w), this)); |
| 4448 | 4430 | |
| 4449 | 4431 | /* set up adsp speedup handlers */ |
| 4450 | | state->m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16_delegate(FUNC(harddriv_state::hdadsp_speedup_r), state)); |
| 4451 | | state->m_adsp->space(AS_DATA).install_read_handler(0x1f99, 0x1f99, read16_delegate(FUNC(harddriv_state::hdds3_speedup_r), state)); |
| 4452 | | state->m_ds3_speedup_addr = &state->m_adsp_data_memory[0x1f99]; |
| 4453 | | state->m_ds3_speedup_pc = 0xff; |
| 4454 | | state->m_ds3_transfer_pc = ds3_transfer_pc; |
| 4432 | m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16_delegate(FUNC(harddriv_state::hdadsp_speedup_r), this)); |
| 4433 | m_adsp->space(AS_DATA).install_read_handler(0x1f99, 0x1f99, read16_delegate(FUNC(harddriv_state::hdds3_speedup_r), this)); |
| 4434 | m_ds3_speedup_addr = &m_adsp_data_memory[0x1f99]; |
| 4435 | m_ds3_speedup_pc = 0xff; |
| 4436 | m_ds3_transfer_pc = ds3_transfer_pc; |
| 4455 | 4437 | } |
| 4456 | 4438 | |
| 4457 | 4439 | |
| 4458 | 4440 | DRIVER_INIT_MEMBER(harddriv_state,steeltal) |
| 4459 | 4441 | { |
| 4460 | | steeltal_init_common(machine(), 0x4fc18, 0); |
| 4442 | steeltal_init_common(0x4fc18, 0); |
| 4461 | 4443 | } |
| 4462 | 4444 | |
| 4463 | 4445 | DRIVER_INIT_MEMBER(harddriv_state,steeltal1) |
| 4464 | 4446 | { |
| 4465 | | steeltal_init_common(machine(), 0x4f9c6, 0); |
| 4447 | steeltal_init_common(0x4f9c6, 0); |
| 4466 | 4448 | } |
| 4467 | 4449 | |
| 4468 | 4450 | DRIVER_INIT_MEMBER(harddriv_state,steeltalp) |
| 4469 | 4451 | { |
| 4470 | | steeltal_init_common(machine(), 0x52290, 1); |
| 4452 | steeltal_init_common(0x52290, 1); |
| 4471 | 4453 | } |
| 4472 | 4454 | |
| 4473 | 4455 | |
| 4474 | 4456 | DRIVER_INIT_MEMBER(harddriv_state,strtdriv) |
| 4475 | 4457 | { |
| 4476 | 4458 | /* initialize the boards */ |
| 4477 | | init_multisync(machine(), 1); |
| 4478 | | init_ds3(machine()); |
| 4479 | | init_dsk(machine()); |
| 4459 | init_multisync(1); |
| 4460 | init_ds3(); |
| 4461 | init_dsk(); |
| 4480 | 4462 | |
| 4481 | 4463 | /* set up the slapstic */ |
| 4482 | 4464 | slapstic_init(machine(), 117); |
| r26020 | r26021 | |
| 4503 | 4485 | DRIVER_INIT_MEMBER(harddriv_state,hdrivair) |
| 4504 | 4486 | { |
| 4505 | 4487 | /* initialize the boards */ |
| 4506 | | init_multisync(machine(), 1); |
| 4507 | | init_ds3(machine()); |
| 4508 | | init_dsk2(machine()); |
| 4488 | init_multisync(1); |
| 4489 | init_ds3(); |
| 4490 | init_dsk2(); |
| 4509 | 4491 | |
| 4510 | 4492 | m_maincpu->space(AS_PROGRAM).install_read_handler(0xa80000, 0xafffff, read16_delegate(FUNC(harddriv_state::hda68k_port1_r), this)); |
| 4511 | 4493 | |
| r26020 | r26021 | |
| 4528 | 4510 | DRIVER_INIT_MEMBER(harddriv_state,hdrivairp) |
| 4529 | 4511 | { |
| 4530 | 4512 | /* initialize the boards */ |
| 4531 | | init_multisync(machine(), 1); |
| 4532 | | init_ds3(machine()); |
| 4533 | | init_dsk2(machine()); |
| 4513 | init_multisync(1); |
| 4514 | init_ds3(); |
| 4515 | init_dsk2(); |
| 4534 | 4516 | |
| 4535 | 4517 | m_maincpu->space(AS_PROGRAM).install_read_handler(0xa80000, 0xafffff, read16_delegate(FUNC(harddriv_state::hda68k_port1_r), this)); |
| 4536 | 4518 | |