trunk/src/mame/drivers/fcrash.c
| r20743 | r20744 | |
| 65 | 65 | #include "sound/okim6295.h" |
| 66 | 66 | |
| 67 | 67 | |
| 68 | | static WRITE16_HANDLER( fcrash_soundlatch_w ) |
| 68 | WRITE16_MEMBER( cps_state::fcrash_soundlatch_w ) |
| 69 | 69 | { |
| 70 | | cps_state *state = space.machine().driver_data<cps_state>(); |
| 71 | | |
| 72 | 70 | if (ACCESSING_BITS_0_7) |
| 73 | 71 | { |
| 74 | | state->soundlatch_byte_w(space, 0, data & 0xff); |
| 75 | | state->m_audiocpu->set_input_line(0, HOLD_LINE); |
| 72 | soundlatch_byte_w(space, 0, data & 0xff); |
| 73 | m_audiocpu->set_input_line(0, HOLD_LINE); |
| 76 | 74 | } |
| 77 | 75 | } |
| 78 | 76 | |
| 79 | 77 | WRITE16_MEMBER(cps_state::cawingbl_soundlatch_w) |
| 80 | 78 | { |
| 81 | | cps_state *state = space.machine().driver_data<cps_state>(); |
| 82 | | |
| 83 | 79 | if (ACCESSING_BITS_8_15) |
| 84 | 80 | { |
| 85 | | state->soundlatch_byte_w(space, 0, data >> 8); |
| 86 | | state->m_audiocpu->set_input_line(0, HOLD_LINE); |
| 81 | soundlatch_byte_w(space, 0, data >> 8); |
| 82 | m_audiocpu->set_input_line(0, HOLD_LINE); |
| 87 | 83 | machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); /* boost the interleave or some voices get dropped */ |
| 88 | 84 | } |
| 89 | 85 | } |
| 90 | 86 | |
| 91 | | static WRITE8_HANDLER( fcrash_snd_bankswitch_w ) |
| 87 | WRITE8_MEMBER( cps_state::fcrash_snd_bankswitch_w ) |
| 92 | 88 | { |
| 93 | | cps_state *state = space.machine().driver_data<cps_state>(); |
| 89 | m_msm_1->set_output_gain(0, (data & 0x08) ? 0.0 : 1.0); |
| 90 | m_msm_2->set_output_gain(0, (data & 0x10) ? 0.0 : 1.0); |
| 94 | 91 | |
| 95 | | state->m_msm_1->set_output_gain(0, (data & 0x08) ? 0.0 : 1.0); |
| 96 | | state->m_msm_2->set_output_gain(0, (data & 0x10) ? 0.0 : 1.0); |
| 97 | | |
| 98 | | state->membank("bank1")->set_entry(data & 0x07); |
| 92 | membank("bank1")->set_entry(data & 0x07); |
| 99 | 93 | } |
| 100 | 94 | |
| 101 | | static WRITE8_HANDLER( sf2mdt_snd_bankswitch_w ) |
| 95 | WRITE8_MEMBER( cps_state::sf2mdt_snd_bankswitch_w ) |
| 102 | 96 | { |
| 103 | | cps_state *state = space.machine().driver_data<cps_state>(); |
| 97 | m_msm_1->set_output_gain(0, (data & 0x20) ? 0.0 : 1.0); |
| 98 | m_msm_2->set_output_gain(0, (data & 0x10) ? 0.0 : 1.0); |
| 104 | 99 | |
| 105 | | state->m_msm_1->set_output_gain(0, (data & 0x20) ? 0.0 : 1.0); |
| 106 | | state->m_msm_2->set_output_gain(0, (data & 0x10) ? 0.0 : 1.0); |
| 107 | | |
| 108 | | state->membank("bank1")->set_entry(data & 0x07); |
| 100 | membank("bank1")->set_entry(data & 0x07); |
| 109 | 101 | } |
| 110 | 102 | |
| 111 | 103 | static void m5205_int1( device_t *device ) |
| r20743 | r20744 | |
| 129 | 121 | } |
| 130 | 122 | |
| 131 | 123 | |
| 132 | | static WRITE8_HANDLER( fcrash_msm5205_0_data_w ) |
| 124 | |
| 125 | WRITE8_MEMBER( cps_state::fcrash_msm5205_0_data_w ) |
| 133 | 126 | { |
| 134 | | cps_state *state = space.machine().driver_data<cps_state>(); |
| 135 | | state->m_sample_buffer1 = data; |
| 127 | m_sample_buffer1 = data; |
| 136 | 128 | } |
| 137 | 129 | |
| 138 | | static WRITE8_HANDLER( fcrash_msm5205_1_data_w ) |
| 130 | WRITE8_MEMBER( cps_state::fcrash_msm5205_1_data_w ) |
| 139 | 131 | { |
| 140 | | cps_state *state = space.machine().driver_data<cps_state>(); |
| 141 | | state->m_sample_buffer2 = data; |
| 132 | m_sample_buffer2 = data; |
| 142 | 133 | } |
| 143 | 134 | |
| 144 | 135 | /* not verified */ |
| r20743 | r20744 | |
| 146 | 137 | |
| 147 | 138 | WRITE16_MEMBER(cps_state::kodb_layer_w) |
| 148 | 139 | { |
| 149 | | cps_state *state = space.machine().driver_data<cps_state>(); |
| 150 | | |
| 151 | 140 | /* layer enable and mask 1&2 registers are written here - passing them to m_cps_b_regs for now for drawing routines */ |
| 152 | 141 | if (offset == 0x06) |
| 153 | | state->m_cps_b_regs[m_layer_enable_reg / 2] = data; |
| 142 | m_cps_b_regs[m_layer_enable_reg / 2] = data; |
| 154 | 143 | else |
| 155 | 144 | if (offset == 0x10) |
| 156 | | state->m_cps_b_regs[state->m_layer_mask_reg[1] / 2] = data; |
| 145 | m_cps_b_regs[m_layer_mask_reg[1] / 2] = data; |
| 157 | 146 | else |
| 158 | 147 | if (offset == 0x11) |
| 159 | | state->m_cps_b_regs[state->m_layer_mask_reg[2] / 2] = data; |
| 148 | m_cps_b_regs[m_layer_mask_reg[2] / 2] = data; |
| 160 | 149 | } |
| 161 | 150 | |
| 162 | 151 | WRITE16_MEMBER(cps_state::sf2mdt_layer_w) |
| 163 | 152 | { |
| 164 | | cps_state *state = space.machine().driver_data<cps_state>(); |
| 165 | | |
| 166 | 153 | /* layer enable and scroll registers are written here - passing them to m_cps_b_regs and m_cps_a_regs for now for drawing routines |
| 167 | 154 | the scroll layers aren't buttery smooth, due to the lack of using the row scroll address tables in the rendering code, this is also |
| 168 | 155 | supported by the fact that the game doesn't write the table address anywhere */ |
| 169 | 156 | |
| 170 | 157 | if (offset == 0x0086) |
| 171 | | state->m_cps_a_regs[0x14 / 2] = data + 0xffce; /* scroll 3x */ |
| 158 | m_cps_a_regs[0x14 / 2] = data + 0xffce; /* scroll 3x */ |
| 172 | 159 | else |
| 173 | 160 | if (offset == 0x0087) |
| 174 | | state->m_cps_a_regs[0x16 / 2] = data; /* scroll 3y */ |
| 161 | m_cps_a_regs[0x16 / 2] = data; /* scroll 3y */ |
| 175 | 162 | else |
| 176 | 163 | if (offset == 0x0088) |
| 177 | | state->m_cps_a_regs[0x10 / 2] = data + 0xffce; /* scroll 2x */ |
| 164 | m_cps_a_regs[0x10 / 2] = data + 0xffce; /* scroll 2x */ |
| 178 | 165 | else |
| 179 | 166 | if (offset == 0x0089) |
| 180 | | state->m_cps_a_regs[0x0c / 2] = data + 0xffca; /* scroll 1x */ |
| 167 | m_cps_a_regs[0x0c / 2] = data + 0xffca; /* scroll 1x */ |
| 181 | 168 | else |
| 182 | | if (offset == 0x008a) { |
| 183 | | state->m_cps_a_regs[0x12 / 2] = data; /* scroll 2y */ |
| 184 | | state->m_cps_a_regs[CPS1_ROWSCROLL_OFFS] = data; /* row scroll start */ |
| 185 | | } else |
| 169 | if (offset == 0x008a) |
| 170 | { |
| 171 | m_cps_a_regs[0x12 / 2] = data; /* scroll 2y */ |
| 172 | m_cps_a_regs[CPS1_ROWSCROLL_OFFS] = data; /* row scroll start */ |
| 173 | } |
| 174 | else |
| 186 | 175 | if (offset == 0x008b) |
| 187 | | state->m_cps_a_regs[0x0e / 2] = data; /* scroll 1y */ |
| 176 | m_cps_a_regs[0x0e / 2] = data; /* scroll 1y */ |
| 188 | 177 | else |
| 189 | 178 | if (offset == 0x00a6) |
| 190 | | state->m_cps_b_regs[m_layer_enable_reg / 2] = data; |
| 179 | m_cps_b_regs[m_layer_enable_reg / 2] = data; |
| 191 | 180 | } |
| 192 | 181 | |
| 193 | 182 | WRITE16_MEMBER(cps_state::sf2mdta_layer_w) |
| 194 | 183 | { |
| 195 | | cps_state *state = space.machine().driver_data<cps_state>(); |
| 196 | | |
| 197 | 184 | /* layer enable and scroll registers are written here - passing them to m_cps_b_regs and m_cps_a_regs for now for drawing routines |
| 198 | 185 | the scroll layers aren't buttery smooth, due to the lack of using the row scroll address tables in the rendering code, this is also |
| 199 | 186 | supported by the fact that the game doesn't write the table address anywhere */ |
| 200 | 187 | |
| 201 | 188 | if (offset == 0x0086) |
| 202 | | state->m_cps_a_regs[0x0c / 2] = data + 0xffbe; /* scroll 1x */ |
| 189 | m_cps_a_regs[0x0c / 2] = data + 0xffbe; /* scroll 1x */ |
| 203 | 190 | else |
| 204 | 191 | if (offset == 0x0087) |
| 205 | | state->m_cps_a_regs[0x0e / 2] = data; /* scroll 1y */ |
| 192 | m_cps_a_regs[0x0e / 2] = data; /* scroll 1y */ |
| 206 | 193 | else |
| 207 | 194 | if (offset == 0x0088) |
| 208 | | state->m_cps_a_regs[0x14 / 2] = data + 0xffce; /* scroll 3x */ |
| 195 | m_cps_a_regs[0x14 / 2] = data + 0xffce; /* scroll 3x */ |
| 209 | 196 | else |
| 210 | | if (offset == 0x0089) { |
| 211 | | state->m_cps_a_regs[0x12 / 2] = data; /* scroll 2y */ |
| 212 | | state->m_cps_a_regs[CPS1_ROWSCROLL_OFFS] = data; /* row scroll start */ |
| 213 | | } else |
| 197 | if (offset == 0x0089) |
| 198 | { |
| 199 | m_cps_a_regs[0x12 / 2] = data; /* scroll 2y */ |
| 200 | m_cps_a_regs[CPS1_ROWSCROLL_OFFS] = data; /* row scroll start */ |
| 201 | } |
| 202 | else |
| 214 | 203 | if (offset == 0x008a) |
| 215 | | state->m_cps_a_regs[0x10 / 2] = data + 0xffce; /* scroll 2x */ |
| 204 | m_cps_a_regs[0x10 / 2] = data + 0xffce; /* scroll 2x */ |
| 216 | 205 | else |
| 217 | 206 | if (offset == 0x008b) |
| 218 | | state->m_cps_a_regs[0x16 / 2] = data; /* scroll 3y */ |
| 207 | m_cps_a_regs[0x16 / 2] = data; /* scroll 3y */ |
| 219 | 208 | else |
| 220 | 209 | if (offset == 0x00a6) |
| 221 | | state->m_cps_b_regs[m_layer_enable_reg / 2] = data; |
| 210 | m_cps_b_regs[m_layer_enable_reg / 2] = data; |
| 222 | 211 | } |
| 223 | 212 | |
| 224 | 213 | |
| 225 | | static void fcrash_update_transmasks( running_machine &machine ) |
| 214 | void cps_state::fcrash_update_transmasks() |
| 226 | 215 | { |
| 227 | | cps_state *state = machine.driver_data<cps_state>(); |
| 228 | 216 | int i; |
| 229 | 217 | |
| 230 | 218 | for (i = 0; i < 4; i++) |
| r20743 | r20744 | |
| 232 | 220 | int mask; |
| 233 | 221 | |
| 234 | 222 | /* Get transparency registers */ |
| 235 | | if (state->m_layer_mask_reg[i]) |
| 236 | | mask = state->m_cps_b_regs[state->m_layer_mask_reg[i] / 2] ^ 0xffff; |
| 223 | if (m_layer_mask_reg[i]) |
| 224 | mask = m_cps_b_regs[m_layer_mask_reg[i] / 2] ^ 0xffff; |
| 237 | 225 | else |
| 238 | 226 | mask = 0xffff; /* completely transparent if priority masks not defined (mercs, qad) */ |
| 239 | 227 | |
| 240 | | state->m_bg_tilemap[0]->set_transmask(i, mask, 0x8000); |
| 241 | | state->m_bg_tilemap[1]->set_transmask(i, mask, 0x8000); |
| 242 | | state->m_bg_tilemap[2]->set_transmask(i, mask, 0x8000); |
| 228 | m_bg_tilemap[0]->set_transmask(i, mask, 0x8000); |
| 229 | m_bg_tilemap[1]->set_transmask(i, mask, 0x8000); |
| 230 | m_bg_tilemap[2]->set_transmask(i, mask, 0x8000); |
| 243 | 231 | } |
| 244 | 232 | } |
| 245 | 233 | |
| 246 | | static void fcrash_render_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 234 | void cps_state::fcrash_render_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 247 | 235 | { |
| 248 | | cps_state *state = machine.driver_data<cps_state>(); |
| 249 | 236 | int pos; |
| 250 | | int base = state->m_sprite_base / 2; |
| 251 | | int num_sprites = machine.gfx[2]->elements(); |
| 237 | int base = m_sprite_base / 2; |
| 238 | int num_sprites = machine().gfx[2]->elements(); |
| 252 | 239 | int last_sprite_offset = 0x1ffc; |
| 253 | | UINT16 *sprite_ram = state->m_gfxram; |
| 240 | UINT16 *sprite_ram = m_gfxram; |
| 254 | 241 | |
| 255 | 242 | // sprite base registers need hooking up properly.. on fcrash it is NOT cps1_cps_a_regs[0] |
| 256 | 243 | // on kodb, it might still be, unless that's just a leftover and it writes somewhere else too |
| 257 | | // if (state->m_cps_a_regs[0] & 0x00ff) base = 0x10c8/2; |
| 258 | | // printf("cps1_cps_a_regs %04x\n", state->m_cps_a_regs[0]); |
| 244 | // if (m_cps_a_regs[0] & 0x00ff) base = 0x10c8/2; |
| 245 | // printf("cps1_cps_a_regs %04x\n", m_cps_a_regs[0]); |
| 259 | 246 | |
| 260 | 247 | /* if we have separate sprite ram, use it */ |
| 261 | | if (state->m_bootleg_sprite_ram) sprite_ram = state->m_bootleg_sprite_ram; |
| 248 | if (m_bootleg_sprite_ram) sprite_ram = m_bootleg_sprite_ram; |
| 262 | 249 | |
| 263 | 250 | /* get end of sprite list marker */ |
| 264 | 251 | for (pos = 0x1ffc - base; pos >= 0x0000; pos -= 4) |
| 265 | | { |
| 266 | | if (sprite_ram[base + pos - 1] == state->m_sprite_list_end_marker) last_sprite_offset = pos; |
| 267 | | } |
| 252 | if (sprite_ram[base + pos - 1] == m_sprite_list_end_marker) last_sprite_offset = pos; |
| 268 | 253 | |
| 269 | 254 | for (pos = last_sprite_offset; pos >= 0x0000; pos -= 4) |
| 270 | 255 | { |
| r20743 | r20744 | |
| 282 | 267 | flipy = sprite_ram[base + pos + 1] & 0x40; |
| 283 | 268 | colour = sprite_ram[base + pos + 1] & 0x1f; |
| 284 | 269 | ypos = 256 - ypos; |
| 285 | | xpos += state->m_sprite_x_offset; |
| 270 | xpos += m_sprite_x_offset; |
| 286 | 271 | |
| 287 | | pdrawgfx_transpen(bitmap, cliprect, machine.gfx[2], tileno, colour, flipx, flipy, xpos + 49, ypos - 16, machine.priority_bitmap, 0x02, 15); |
| 288 | | |
| 272 | pdrawgfx_transpen(bitmap, cliprect, machine().gfx[2], tileno, colour, flipx, flipy, xpos + 49, ypos - 16, machine().priority_bitmap, 0x02, 15); |
| 289 | 273 | } |
| 290 | | |
| 291 | 274 | } |
| 292 | 275 | |
| 293 | | static void fcrash_render_layer( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int primask ) |
| 276 | void cps_state::fcrash_render_layer( bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int primask ) |
| 294 | 277 | { |
| 295 | | cps_state *state = machine.driver_data<cps_state>(); |
| 296 | | |
| 297 | 278 | switch (layer) |
| 298 | 279 | { |
| 299 | 280 | case 0: |
| 300 | | fcrash_render_sprites(machine, bitmap, cliprect); |
| 281 | fcrash_render_sprites(bitmap, cliprect); |
| 301 | 282 | break; |
| 302 | 283 | case 1: |
| 303 | 284 | case 2: |
| 304 | 285 | case 3: |
| 305 | | state->m_bg_tilemap[layer - 1]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, primask); |
| 286 | m_bg_tilemap[layer - 1]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, primask); |
| 306 | 287 | break; |
| 307 | 288 | } |
| 308 | 289 | } |
| 309 | 290 | |
| 310 | | static void fcrash_render_high_layer( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer ) |
| 291 | void cps_state::fcrash_render_high_layer( bitmap_ind16 &bitmap, const rectangle &cliprect, int layer ) |
| 311 | 292 | { |
| 312 | | cps_state *state = machine.driver_data<cps_state>(); |
| 313 | 293 | bitmap_ind16 dummy_bitmap; |
| 314 | 294 | |
| 315 | 295 | switch (layer) |
| r20743 | r20744 | |
| 320 | 300 | case 1: |
| 321 | 301 | case 2: |
| 322 | 302 | case 3: |
| 323 | | state->m_bg_tilemap[layer - 1]->draw(dummy_bitmap, cliprect, TILEMAP_DRAW_LAYER0, 1); |
| 303 | m_bg_tilemap[layer - 1]->draw(dummy_bitmap, cliprect, TILEMAP_DRAW_LAYER0, 1); |
| 324 | 304 | break; |
| 325 | 305 | } |
| 326 | 306 | } |
| 327 | 307 | |
| 328 | | static void fcrash_build_palette( running_machine &machine ) |
| 308 | void cps_state::fcrash_build_palette() |
| 329 | 309 | { |
| 330 | | cps_state *state = machine.driver_data<cps_state>(); |
| 331 | 310 | int offset; |
| 332 | 311 | |
| 333 | 312 | // all the bootlegs seem to write the palette offset as usual |
| 334 | | int palettebase = (state->m_cps_a_regs[0x0a / 2] << 8) & 0x1ffff; |
| 313 | int palettebase = (m_cps_a_regs[0x0a / 2] << 8) & 0x1ffff; |
| 335 | 314 | |
| 336 | 315 | for (offset = 0; offset < 32 * 6 * 16; offset++) |
| 337 | 316 | { |
| 338 | | int palette = state->m_gfxram[palettebase / 2 + offset]; |
| 317 | int palette = m_gfxram[palettebase / 2 + offset]; |
| 339 | 318 | int r, g, b, bright; |
| 340 | 319 | |
| 341 | 320 | // from my understanding of the schematics, when the 'brightness' |
| r20743 | r20744 | |
| 347 | 326 | g = ((palette >> 4) & 0x0f) * 0x11 * bright / 0x2d; |
| 348 | 327 | b = ((palette >> 0) & 0x0f) * 0x11 * bright / 0x2d; |
| 349 | 328 | |
| 350 | | palette_set_color (machine, offset, MAKE_RGB(r, g, b)); |
| 329 | palette_set_color (machine(), offset, MAKE_RGB(r, g, b)); |
| 351 | 330 | } |
| 352 | 331 | } |
| 353 | 332 | |
| r20743 | r20744 | |
| 364 | 343 | cps1_get_video_base(); |
| 365 | 344 | |
| 366 | 345 | /* Build palette */ |
| 367 | | fcrash_build_palette(machine()); |
| 346 | fcrash_build_palette(); |
| 368 | 347 | |
| 369 | | fcrash_update_transmasks(machine()); |
| 348 | fcrash_update_transmasks(); |
| 370 | 349 | |
| 371 | 350 | m_bg_tilemap[0]->set_scrollx(0, m_scroll1x - m_layer_scroll1x_offset); |
| 372 | 351 | m_bg_tilemap[0]->set_scrolly(0, m_scroll1y); |
| r20743 | r20744 | |
| 409 | 388 | l2 = (layercontrol >> 0x0a) & 03; |
| 410 | 389 | l3 = (layercontrol >> 0x0c) & 03; |
| 411 | 390 | |
| 412 | | fcrash_render_layer(machine(), bitmap, cliprect, l0, 0); |
| 391 | fcrash_render_layer(bitmap, cliprect, l0, 0); |
| 413 | 392 | |
| 414 | 393 | if (l1 == 0) |
| 415 | | fcrash_render_high_layer(machine(), bitmap, cliprect, l0); |
| 394 | fcrash_render_high_layer(bitmap, cliprect, l0); |
| 416 | 395 | |
| 417 | | fcrash_render_layer(machine(), bitmap, cliprect, l1, 0); |
| 396 | fcrash_render_layer(bitmap, cliprect, l1, 0); |
| 418 | 397 | |
| 419 | 398 | if (l2 == 0) |
| 420 | | fcrash_render_high_layer(machine(), bitmap, cliprect, l1); |
| 399 | fcrash_render_high_layer(bitmap, cliprect, l1); |
| 421 | 400 | |
| 422 | | fcrash_render_layer(machine(), bitmap, cliprect, l2, 0); |
| 401 | fcrash_render_layer(bitmap, cliprect, l2, 0); |
| 423 | 402 | |
| 424 | 403 | if (l3 == 0) |
| 425 | | fcrash_render_high_layer(machine(), bitmap, cliprect, l2); |
| 404 | fcrash_render_high_layer(bitmap, cliprect, l2); |
| 426 | 405 | |
| 427 | | fcrash_render_layer(machine(), bitmap, cliprect, l3, 0); |
| 406 | fcrash_render_layer(bitmap, cliprect, l3, 0); |
| 428 | 407 | |
| 429 | 408 | return 0; |
| 430 | 409 | } |
| r20743 | r20744 | |
| 436 | 415 | AM_RANGE(0x800100, 0x80013f) AM_RAM AM_SHARE("cps_a_regs") /* CPS-A custom */ |
| 437 | 416 | AM_RANGE(0x800140, 0x80017f) AM_RAM AM_SHARE("cps_b_regs") /* CPS-B custom */ |
| 438 | 417 | AM_RANGE(0x880000, 0x880001) AM_READ_PORT("IN1") /* Player input ports */ |
| 439 | | AM_RANGE(0x880006, 0x880007) AM_WRITE_LEGACY(fcrash_soundlatch_w) /* Sound command */ |
| 418 | AM_RANGE(0x880006, 0x880007) AM_WRITE(fcrash_soundlatch_w) /* Sound command */ |
| 440 | 419 | AM_RANGE(0x880008, 0x88000f) AM_READ(cps1_dsw_r) /* System input ports / Dip Switches */ |
| 441 | 420 | AM_RANGE(0x890000, 0x890001) AM_WRITENOP // palette related? |
| 442 | 421 | AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_SHARE("gfxram") |
| r20743 | r20744 | |
| 449 | 428 | AM_RANGE(0xd000, 0xd7ff) AM_RAM |
| 450 | 429 | AM_RANGE(0xd800, 0xd801) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w) |
| 451 | 430 | AM_RANGE(0xdc00, 0xdc01) AM_DEVREADWRITE_LEGACY("ym2", ym2203_r, ym2203_w) |
| 452 | | AM_RANGE(0xe000, 0xe000) AM_WRITE_LEGACY(fcrash_snd_bankswitch_w) |
| 431 | AM_RANGE(0xe000, 0xe000) AM_WRITE(fcrash_snd_bankswitch_w) |
| 453 | 432 | AM_RANGE(0xe400, 0xe400) AM_READ(soundlatch_byte_r) |
| 454 | | AM_RANGE(0xe800, 0xe800) AM_WRITE_LEGACY(fcrash_msm5205_0_data_w) |
| 455 | | AM_RANGE(0xec00, 0xec00) AM_WRITE_LEGACY(fcrash_msm5205_1_data_w) |
| 433 | AM_RANGE(0xe800, 0xe800) AM_WRITE(fcrash_msm5205_0_data_w) |
| 434 | AM_RANGE(0xec00, 0xec00) AM_WRITE(fcrash_msm5205_1_data_w) |
| 456 | 435 | ADDRESS_MAP_END |
| 457 | 436 | |
| 458 | 437 | static ADDRESS_MAP_START( kodb_sound_map, AS_PROGRAM, 8, cps_state ) |
| r20743 | r20744 | |
| 470 | 449 | AM_RANGE(0xd000, 0xd7ff) AM_RAM |
| 471 | 450 | AM_RANGE(0xd800, 0xd801) AM_DEVREADWRITE("2151", ym2151_device, read, write) |
| 472 | 451 | AM_RANGE(0xdc00, 0xdc00) AM_READ(soundlatch_byte_r) |
| 473 | | AM_RANGE(0xe000, 0xe000) AM_WRITE_LEGACY(sf2mdt_snd_bankswitch_w) |
| 474 | | AM_RANGE(0xe400, 0xe400) AM_WRITE_LEGACY(fcrash_msm5205_0_data_w) |
| 475 | | AM_RANGE(0xe800, 0xe800) AM_WRITE_LEGACY(fcrash_msm5205_1_data_w) |
| 452 | AM_RANGE(0xe000, 0xe000) AM_WRITE(sf2mdt_snd_bankswitch_w) |
| 453 | AM_RANGE(0xe400, 0xe400) AM_WRITE(fcrash_msm5205_0_data_w) |
| 454 | AM_RANGE(0xe800, 0xe800) AM_WRITE(fcrash_msm5205_1_data_w) |
| 476 | 455 | ADDRESS_MAP_END |
| 477 | 456 | |
| 478 | 457 | |