src/mame/video/segaic24.c
| r11224 | r11225 | |
| 12 | 12 | |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | | /* |
| 16 | | * System 16 color palette formats |
| 17 | | */ |
| 15 | #include "emu.h" |
| 16 | #include "segaic24.h" |
| 18 | 17 | |
| 19 | 18 | |
| 20 | | /* system24temp_ functions / variables are from shared rewrite files, |
| 21 | | once the rest of the rewrite is complete they can be removed, I |
| 22 | | just made a copy & renamed them for now to avoid any conflicts |
| 23 | | */ |
| 19 | const device_type S24TILE = segas24_tile_config::static_alloc_device_config; |
| 20 | const device_type S24SPRITE = segas24_sprite_config::static_alloc_device_config; |
| 21 | const device_type S24MIXER = segas24_mixer_config::static_alloc_device_config; |
| 24 | 22 | |
| 25 | | #include "emu.h" |
| 26 | | #include "segaic24.h" |
| 23 | segas24_tile_config::segas24_tile_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock) |
| 24 | : device_config(mconfig, static_alloc_device_config, "S24TILE", tag, owner, clock) |
| 25 | { |
| 26 | } |
| 27 | 27 | |
| 28 | device_config *segas24_tile_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock) |
| 29 | { |
| 30 | return global_alloc(segas24_tile_config(mconfig, tag, owner, clock)); |
| 31 | } |
| 28 | 32 | |
| 29 | | static void set_color(running_machine &machine, int color, UINT8 r, UINT8 g, UINT8 b, int highlight) |
| 33 | void segas24_tile_config::static_set_tile_mask(device_config *device, UINT16 _tile_mask) |
| 30 | 34 | { |
| 31 | | palette_set_color (machine, color, MAKE_RGB(r, g, b)); |
| 35 | segas24_tile_config *dev = downcast<segas24_tile_config *>(device); |
| 36 | dev->tile_mask = _tile_mask; |
| 37 | } |
| 32 | 38 | |
| 33 | | if(highlight) { |
| 34 | | r = 255-0.6*(255-r); |
| 35 | | g = 255-0.6*(255-g); |
| 36 | | b = 255-0.6*(255-b); |
| 37 | | } else { |
| 38 | | r = 0.6*r; |
| 39 | | g = 0.6*g; |
| 40 | | b = 0.6*b; |
| 41 | | } |
| 42 | | palette_set_color(machine,color+machine.total_colors()/2, MAKE_RGB(r, g, b)); |
| 39 | device_t *segas24_tile_config::alloc_device(running_machine &machine) const |
| 40 | { |
| 41 | return auto_alloc(machine, segas24_tile(machine, *this)); |
| 43 | 42 | } |
| 44 | 43 | |
| 45 | | // 315-5242 |
| 46 | 44 | |
| 47 | | // qgh expects to be able to read the palette shared between CPUs |
| 48 | | READ16_HANDLER( system24temp_sys16_paletteram1_r ) |
| 45 | segas24_sprite_config::segas24_sprite_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock) |
| 46 | : device_config(mconfig, static_alloc_device_config, "S24SPRITE", tag, owner, clock) |
| 49 | 47 | { |
| 50 | | return space->machine().generic.paletteram.u16[offset]; |
| 51 | 48 | } |
| 52 | 49 | |
| 50 | device_config *segas24_sprite_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock) |
| 51 | { |
| 52 | return global_alloc(segas24_sprite_config(mconfig, tag, owner, clock)); |
| 53 | } |
| 53 | 54 | |
| 54 | | WRITE16_HANDLER (system24temp_sys16_paletteram1_w) |
| 55 | device_t *segas24_sprite_config::alloc_device(running_machine &machine) const |
| 55 | 56 | { |
| 56 | | int r, g, b; |
| 57 | | COMBINE_DATA (space->machine().generic.paletteram.u16 + offset); |
| 58 | | data = space->machine().generic.paletteram.u16[offset]; |
| 57 | return auto_alloc(machine, segas24_sprite(machine, *this)); |
| 58 | } |
| 59 | 59 | |
| 60 | | r = (data & 0x00f) << 4; |
| 61 | | if(data & 0x1000) |
| 62 | | r |= 8; |
| 63 | 60 | |
| 64 | | g = data & 0x0f0; |
| 65 | | if(data & 0x2000) |
| 66 | | g |= 8; |
| 61 | segas24_mixer_config::segas24_mixer_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock) |
| 62 | : device_config(mconfig, static_alloc_device_config, "S24MIXER", tag, owner, clock) |
| 63 | { |
| 64 | } |
| 67 | 65 | |
| 68 | | b = (data & 0xf00) >> 4; |
| 69 | | if(data & 0x4000) |
| 70 | | b |= 8; |
| 66 | device_config *segas24_mixer_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock) |
| 67 | { |
| 68 | return global_alloc(segas24_mixer_config(mconfig, tag, owner, clock)); |
| 69 | } |
| 71 | 70 | |
| 72 | | r |= r >> 5; |
| 73 | | g |= g >> 5; |
| 74 | | b |= b >> 5; |
| 75 | | set_color(space->machine(), offset, r, g, b, data & 0x8000); |
| 71 | device_t *segas24_mixer_config::alloc_device(running_machine &machine) const |
| 72 | { |
| 73 | return auto_alloc(machine, segas24_mixer(machine, *this)); |
| 76 | 74 | } |
| 77 | 75 | |
| 78 | | // - System 24 |
| 79 | 76 | |
| 80 | | enum {SYS24_TILES = 0x4000}; |
| 81 | 77 | |
| 82 | | static UINT16 *sys24_char_ram, *sys24_tile_ram; |
| 83 | | static UINT16 sys24_tile_mask; |
| 84 | | static int sys24_char_gfx_index; |
| 85 | | static tilemap_t *sys24_tile_layer[4]; |
| 78 | segas24_tile::segas24_tile(running_machine &_machine, const segas24_tile_config &_config) |
| 79 | : device_t(_machine, _config), |
| 80 | config(_config) |
| 81 | { |
| 82 | } |
| 86 | 83 | |
| 87 | 84 | #define XOR(a) WORD_XOR_BE(a) |
| 88 | 85 | |
| 89 | | static const gfx_layout sys24_char_layout = { |
| 86 | const gfx_layout segas24_tile::char_layout = { |
| 90 | 87 | 8, 8, |
| 91 | 88 | SYS24_TILES, |
| 92 | 89 | 4, |
| r11224 | r11225 | |
| 96 | 93 | 8*32 |
| 97 | 94 | }; |
| 98 | 95 | |
| 99 | | static TILE_GET_INFO( sys24_tile_info_0s ) |
| 96 | void segas24_tile::tile_info(int offset, tile_data *tileinfo, tilemap_memory_index tile_index) |
| 100 | 97 | { |
| 101 | | UINT16 val = sys24_tile_ram[tile_index]; |
| 98 | UINT16 val = tile_ram[tile_index|offset]; |
| 102 | 99 | tileinfo->category = (val & 0x8000) != 0; |
| 103 | | SET_TILE_INFO(sys24_char_gfx_index, val & sys24_tile_mask, (val >> 7) & 0xff, 0); |
| 100 | tileinfo_set(machine(), tileinfo, char_gfx_index, val & config.tile_mask, (val >> 7) & 0xff, 0); |
| 104 | 101 | } |
| 105 | 102 | |
| 106 | | static TILE_GET_INFO( sys24_tile_info_0w ) |
| 103 | TILE_GET_INFO_DEVICE( segas24_tile::tile_info_0s ) |
| 107 | 104 | { |
| 108 | | UINT16 val = sys24_tile_ram[tile_index|0x1000]; |
| 109 | | tileinfo->category = (val & 0x8000) != 0; |
| 110 | | SET_TILE_INFO(sys24_char_gfx_index, val & sys24_tile_mask, (val >> 7) & 0xff, 0); |
| 105 | downcast<segas24_tile *>(device)->tile_info(0x0000, tileinfo, tile_index); |
| 111 | 106 | } |
| 112 | 107 | |
| 113 | | static TILE_GET_INFO( sys24_tile_info_1s ) |
| 108 | TILE_GET_INFO_DEVICE( segas24_tile::tile_info_0w ) |
| 114 | 109 | { |
| 115 | | UINT16 val = sys24_tile_ram[tile_index|0x2000]; |
| 116 | | tileinfo->category = (val & 0x8000) != 0; |
| 117 | | SET_TILE_INFO(sys24_char_gfx_index, val & sys24_tile_mask, (val >> 7) & 0xff, 0); |
| 110 | downcast<segas24_tile *>(device)->tile_info(0x1000, tileinfo, tile_index); |
| 118 | 111 | } |
| 119 | 112 | |
| 120 | | static TILE_GET_INFO( sys24_tile_info_1w ) |
| 113 | TILE_GET_INFO_DEVICE( segas24_tile::tile_info_1s ) |
| 121 | 114 | { |
| 122 | | UINT16 val = sys24_tile_ram[tile_index|0x3000]; |
| 123 | | tileinfo->category = (val & 0x8000) != 0; |
| 124 | | SET_TILE_INFO(sys24_char_gfx_index, val & sys24_tile_mask, (val >> 7) & 0xff, 0); |
| 115 | downcast<segas24_tile *>(device)->tile_info(0x2000, tileinfo, tile_index); |
| 125 | 116 | } |
| 126 | 117 | |
| 127 | | void sys24_tile_vh_start(running_machine &machine, UINT16 tile_mask) |
| 118 | TILE_GET_INFO_DEVICE( segas24_tile::tile_info_1w ) |
| 128 | 119 | { |
| 129 | | sys24_tile_mask = tile_mask; |
| 120 | downcast<segas24_tile *>(device)->tile_info(0x3000, tileinfo, tile_index); |
| 121 | } |
| 130 | 122 | |
| 131 | | for(sys24_char_gfx_index = 0; sys24_char_gfx_index < MAX_GFX_ELEMENTS; sys24_char_gfx_index++) |
| 132 | | if (machine.gfx[sys24_char_gfx_index] == 0) |
| 123 | void segas24_tile::device_start() |
| 124 | { |
| 125 | for(char_gfx_index = 0; char_gfx_index < MAX_GFX_ELEMENTS; char_gfx_index++) |
| 126 | if (machine().gfx[char_gfx_index] == 0) |
| 133 | 127 | break; |
| 134 | | assert(sys24_char_gfx_index != MAX_GFX_ELEMENTS); |
| 128 | assert(char_gfx_index != MAX_GFX_ELEMENTS); |
| 135 | 129 | |
| 136 | | sys24_char_ram = auto_alloc_array(machine, UINT16, 0x80000/2); |
| 130 | char_ram = auto_alloc_array(machine(), UINT16, 0x80000/2); |
| 131 | tile_ram = auto_alloc_array(machine(), UINT16, 0x10000/2); |
| 137 | 132 | |
| 138 | | sys24_tile_ram = auto_alloc_array(machine, UINT16, 0x10000/2); |
| 133 | tile_layer[0] = tilemap_create_device(this, tile_info_0s, tilemap_scan_rows, 8, 8, 64, 64); |
| 134 | tile_layer[1] = tilemap_create_device(this, tile_info_0w, tilemap_scan_rows, 8, 8, 64, 64); |
| 135 | tile_layer[2] = tilemap_create_device(this, tile_info_1s, tilemap_scan_rows, 8, 8, 64, 64); |
| 136 | tile_layer[3] = tilemap_create_device(this, tile_info_1w, tilemap_scan_rows, 8, 8, 64, 64); |
| 139 | 137 | |
| 140 | | sys24_tile_layer[0] = tilemap_create(machine, sys24_tile_info_0s, tilemap_scan_rows, 8, 8, 64, 64); |
| 141 | | sys24_tile_layer[1] = tilemap_create(machine, sys24_tile_info_0w, tilemap_scan_rows, 8, 8, 64, 64); |
| 142 | | sys24_tile_layer[2] = tilemap_create(machine, sys24_tile_info_1s, tilemap_scan_rows, 8, 8, 64, 64); |
| 143 | | sys24_tile_layer[3] = tilemap_create(machine, sys24_tile_info_1w, tilemap_scan_rows, 8, 8, 64, 64); |
| 138 | tilemap_set_transparent_pen(tile_layer[0], 0); |
| 139 | tilemap_set_transparent_pen(tile_layer[1], 0); |
| 140 | tilemap_set_transparent_pen(tile_layer[2], 0); |
| 141 | tilemap_set_transparent_pen(tile_layer[3], 0); |
| 144 | 142 | |
| 145 | | tilemap_set_transparent_pen(sys24_tile_layer[0], 0); |
| 146 | | tilemap_set_transparent_pen(sys24_tile_layer[1], 0); |
| 147 | | tilemap_set_transparent_pen(sys24_tile_layer[2], 0); |
| 148 | | tilemap_set_transparent_pen(sys24_tile_layer[3], 0); |
| 143 | memset(char_ram, 0, 0x80000); |
| 144 | memset(tile_ram, 0, 0x10000); |
| 149 | 145 | |
| 150 | | memset(sys24_char_ram, 0, 0x80000); |
| 151 | | memset(sys24_tile_ram, 0, 0x10000); |
| 146 | machine().gfx[char_gfx_index] = gfx_element_alloc(machine(), &char_layout, (UINT8 *)char_ram, machine().total_colors() / 16, 0); |
| 152 | 147 | |
| 153 | | machine.gfx[sys24_char_gfx_index] = gfx_element_alloc(machine, &sys24_char_layout, (UINT8 *)sys24_char_ram, machine.total_colors() / 16, 0); |
| 154 | | |
| 155 | | state_save_register_global_pointer(machine, sys24_tile_ram, 0x10000/2); |
| 156 | | state_save_register_global_pointer(machine, sys24_char_ram, 0x80000/2); |
| 148 | save_pointer(NAME(tile_ram), 0x10000/2); |
| 149 | save_pointer(NAME(char_ram), 0x80000/2); |
| 157 | 150 | } |
| 158 | 151 | |
| 159 | | static void sys24_tile_draw_rect(running_machine &machine, bitmap_t *bm, bitmap_t *tm, bitmap_t *dm, const UINT16 *mask, |
| 160 | | UINT16 tpri, UINT8 lpri, int win, int sx, int sy, int xx1, int yy1, int xx2, int yy2) |
| 152 | void segas24_tile::draw_rect(bitmap_t *bm, bitmap_t *tm, bitmap_t *dm, const UINT16 *mask, |
| 153 | UINT16 tpri, UINT8 lpri, int win, int sx, int sy, int xx1, int yy1, int xx2, int yy2) |
| 161 | 154 | { |
| 162 | 155 | int y; |
| 163 | 156 | const UINT16 *source = ((UINT16 *)bm->base) + sx + sy*bm->rowpixels; |
| 164 | 157 | const UINT8 *trans = ((UINT8 *) tm->base) + sx + sy*tm->rowpixels; |
| 165 | | UINT8 *prib = (UINT8 *)machine.priority_bitmap->base; |
| 158 | UINT8 *prib = (UINT8 *)machine().priority_bitmap->base; |
| 166 | 159 | UINT16 *dest = (UINT16 *)dm->base; |
| 167 | 160 | |
| 168 | 161 | tpri |= TILEMAP_PIXEL_LAYER0; |
| 169 | 162 | |
| 170 | 163 | dest += yy1*dm->rowpixels + xx1; |
| 171 | | prib += yy1*machine.priority_bitmap->rowpixels + xx1; |
| 164 | prib += yy1*machine().priority_bitmap->rowpixels + xx1; |
| 172 | 165 | mask += yy1*4; |
| 173 | 166 | yy2 -= yy1; |
| 174 | 167 | |
| r11224 | r11225 | |
| 280 | 273 | source += bm->rowpixels; |
| 281 | 274 | trans += tm->rowpixels; |
| 282 | 275 | dest += dm->rowpixels; |
| 283 | | prib += machine.priority_bitmap->rowpixels; |
| 276 | prib += machine().priority_bitmap->rowpixels; |
| 284 | 277 | mask += 4; |
| 285 | 278 | } |
| 286 | 279 | } |
| r11224 | r11225 | |
| 288 | 281 | |
| 289 | 282 | // The rgb version is used by model 1 & 2 which do not need to care |
| 290 | 283 | // about sprite priority hence the lack of support for the |
| 291 | | // machine.priority_bitmap |
| 284 | // priority_bitmap |
| 292 | 285 | |
| 293 | | static void sys24_tile_draw_rect_rgb(running_machine &machine, bitmap_t *bm, bitmap_t *tm, bitmap_t *dm, const UINT16 *mask, |
| 294 | | UINT16 tpri, UINT8 lpri, int win, int sx, int sy, int xx1, int yy1, int xx2, int yy2) |
| 286 | void segas24_tile::draw_rect_rgb(bitmap_t *bm, bitmap_t *tm, bitmap_t *dm, const UINT16 *mask, |
| 287 | UINT16 tpri, UINT8 lpri, int win, int sx, int sy, int xx1, int yy1, int xx2, int yy2) |
| 295 | 288 | { |
| 296 | 289 | int y; |
| 297 | 290 | const UINT16 *source = ((UINT16 *)bm->base) + sx + sy*bm->rowpixels; |
| 298 | 291 | const UINT8 *trans = ((UINT8 *) tm->base) + sx + sy*tm->rowpixels; |
| 299 | 292 | UINT16 *dest = (UINT16 *)dm->base; |
| 300 | | const pen_t *pens = machine.pens; |
| 293 | const pen_t *pens = machine().pens; |
| 301 | 294 | |
| 302 | 295 | tpri |= TILEMAP_PIXEL_LAYER0; |
| 303 | 296 | |
| r11224 | r11225 | |
| 402 | 395 | } |
| 403 | 396 | } |
| 404 | 397 | |
| 405 | | void sys24_tile_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int lpri, int flags) |
| 398 | void segas24_tile::draw(bitmap_t *bitmap, const rectangle *cliprect, int layer, int lpri, int flags) |
| 406 | 399 | { |
| 407 | | UINT16 hscr = sys24_tile_ram[0x5000+(layer >> 1)]; |
| 408 | | UINT16 vscr = sys24_tile_ram[0x5004+(layer >> 1)]; |
| 409 | | UINT16 ctrl = sys24_tile_ram[0x5004+((layer >> 1) & 2)]; |
| 410 | | UINT16 *mask = sys24_tile_ram + (layer & 4 ? 0x6800 : 0x6000); |
| 400 | UINT16 hscr = tile_ram[0x5000+(layer >> 1)]; |
| 401 | UINT16 vscr = tile_ram[0x5004+(layer >> 1)]; |
| 402 | UINT16 ctrl = tile_ram[0x5004+((layer >> 1) & 2)]; |
| 403 | UINT16 *mask = tile_ram + (layer & 4 ? 0x6800 : 0x6000); |
| 411 | 404 | UINT16 tpri = layer & 1; |
| 412 | 405 | |
| 413 | 406 | lpri = 1 << lpri; |
| r11224 | r11225 | |
| 422 | 415 | if(layer & 1) |
| 423 | 416 | return; |
| 424 | 417 | |
| 425 | | tilemap_set_scrolly(sys24_tile_layer[layer], 0, vscr & 0x1ff); |
| 426 | | tilemap_set_scrolly(sys24_tile_layer[layer|1], 0, vscr & 0x1ff); |
| 418 | tilemap_set_scrolly(tile_layer[layer], 0, vscr & 0x1ff); |
| 419 | tilemap_set_scrolly(tile_layer[layer|1], 0, vscr & 0x1ff); |
| 427 | 420 | |
| 428 | 421 | if(hscr & 0x8000) { |
| 429 | | UINT16 *hscrtb = sys24_tile_ram + 0x4000 + 0x200*layer; |
| 422 | UINT16 *hscrtb = tile_ram + 0x4000 + 0x200*layer; |
| 430 | 423 | |
| 431 | 424 | switch((ctrl & 0x6000) >> 13) { |
| 432 | 425 | case 1: { |
| r11224 | r11225 | |
| 446 | 439 | hscr = hscrtb[y]; |
| 447 | 440 | |
| 448 | 441 | h = hscr & 0x1ff; |
| 449 | | tilemap_set_scrollx(sys24_tile_layer[l1], 0, -h); |
| 450 | | tilemap_draw(bitmap, &c, sys24_tile_layer[l1], tpri, lpri); |
| 442 | tilemap_set_scrollx(tile_layer[l1], 0, -h); |
| 443 | tilemap_draw(bitmap, &c, tile_layer[l1], tpri, lpri); |
| 451 | 444 | } |
| 452 | 445 | break; |
| 453 | 446 | } |
| r11224 | r11225 | |
| 462 | 455 | hscr = hscrtb[y]; |
| 463 | 456 | |
| 464 | 457 | h = hscr & 0x1ff; |
| 465 | | tilemap_set_scrollx(sys24_tile_layer[layer], 0, -h); |
| 466 | | tilemap_set_scrollx(sys24_tile_layer[layer|1], 0, -h); |
| 458 | tilemap_set_scrollx(tile_layer[layer], 0, -h); |
| 459 | tilemap_set_scrollx(tile_layer[layer|1], 0, -h); |
| 467 | 460 | |
| 468 | 461 | if(c1.max_x >= h) |
| 469 | 462 | c1.max_x = h-1; |
| r11224 | r11225 | |
| 474 | 467 | |
| 475 | 468 | c1.min_y = c1.max_y = c2.min_y = c2.max_y = y; |
| 476 | 469 | |
| 477 | | tilemap_draw(bitmap, &c1, sys24_tile_layer[l1], tpri, lpri); |
| 478 | | tilemap_draw(bitmap, &c2, sys24_tile_layer[l1^1], tpri, lpri); |
| 470 | tilemap_draw(bitmap, &c1, tile_layer[l1], tpri, lpri); |
| 471 | tilemap_draw(bitmap, &c2, tile_layer[l1^1], tpri, lpri); |
| 479 | 472 | } |
| 480 | 473 | break; |
| 481 | 474 | } |
| 482 | 475 | } |
| 483 | 476 | |
| 484 | 477 | } else { |
| 485 | | tilemap_set_scrollx(sys24_tile_layer[layer], 0, -(hscr & 0x1ff)); |
| 486 | | tilemap_set_scrollx(sys24_tile_layer[layer|1], 0, -(hscr & 0x1ff)); |
| 478 | tilemap_set_scrollx(tile_layer[layer], 0, -(hscr & 0x1ff)); |
| 479 | tilemap_set_scrollx(tile_layer[layer|1], 0, -(hscr & 0x1ff)); |
| 487 | 480 | |
| 488 | 481 | switch((ctrl & 0x6000) >> 13) { |
| 489 | 482 | case 1: { |
| r11224 | r11225 | |
| 498 | 491 | if(!((-vscr) & 0x200)) |
| 499 | 492 | layer ^= 1; |
| 500 | 493 | |
| 501 | | tilemap_draw(bitmap, &c1, sys24_tile_layer[layer], tpri, lpri); |
| 502 | | tilemap_draw(bitmap, &c2, sys24_tile_layer[layer^1], tpri, lpri); |
| 494 | tilemap_draw(bitmap, &c1, tile_layer[layer], tpri, lpri); |
| 495 | tilemap_draw(bitmap, &c2, tile_layer[layer^1], tpri, lpri); |
| 503 | 496 | break; |
| 504 | 497 | } |
| 505 | 498 | case 2: case 3: { |
| r11224 | r11225 | |
| 514 | 507 | if(!((+hscr) & 0x200)) |
| 515 | 508 | layer ^= 1; |
| 516 | 509 | |
| 517 | | tilemap_draw(bitmap, &c1, sys24_tile_layer[layer], tpri, lpri); |
| 518 | | tilemap_draw(bitmap, &c2, sys24_tile_layer[layer^1], tpri, lpri); |
| 510 | tilemap_draw(bitmap, &c1, tile_layer[layer], tpri, lpri); |
| 511 | tilemap_draw(bitmap, &c2, tile_layer[layer^1], tpri, lpri); |
| 519 | 512 | break; |
| 520 | 513 | } |
| 521 | 514 | } |
| r11224 | r11225 | |
| 523 | 516 | |
| 524 | 517 | } else { |
| 525 | 518 | bitmap_t *bm, *tm; |
| 526 | | void (*draw)(running_machine &machine, bitmap_t *, bitmap_t *, bitmap_t *, const UINT16 *, |
| 519 | void (segas24_tile::*draw)(bitmap_t *, bitmap_t *, bitmap_t *, const UINT16 *, |
| 527 | 520 | UINT16, UINT8, int, int, int, int, int, int, int); |
| 528 | 521 | int win = layer & 1; |
| 529 | 522 | |
| 530 | 523 | if(bitmap->format != BITMAP_FORMAT_INDEXED16) |
| 531 | | draw = sys24_tile_draw_rect_rgb; |
| 524 | draw = &segas24_tile::draw_rect_rgb; |
| 532 | 525 | else |
| 533 | | draw = sys24_tile_draw_rect; |
| 526 | draw = &segas24_tile::draw_rect; |
| 534 | 527 | |
| 535 | | bm = tilemap_get_pixmap(sys24_tile_layer[layer]); |
| 536 | | tm = tilemap_get_flagsmap(sys24_tile_layer[layer]); |
| 528 | bm = tilemap_get_pixmap(tile_layer[layer]); |
| 529 | tm = tilemap_get_flagsmap(tile_layer[layer]); |
| 537 | 530 | |
| 538 | 531 | if(hscr & 0x8000) { |
| 539 | 532 | int y; |
| 540 | | UINT16 *hscrtb = sys24_tile_ram + 0x4000 + 0x200*layer; |
| 533 | UINT16 *hscrtb = tile_ram + 0x4000 + 0x200*layer; |
| 541 | 534 | vscr &= 0x1ff; |
| 542 | 535 | |
| 543 | 536 | for(y=0; y<384; y++) { |
| 544 | 537 | hscr = (-hscrtb[y]) & 0x1ff; |
| 545 | 538 | if(hscr + 496 <= 512) { |
| 546 | 539 | // Horizontal split unnecessary |
| 547 | | draw(machine, bm, tm, bitmap, mask, tpri, lpri, win, hscr, vscr, 0, y, 496, y+1); |
| 540 | (this->*draw)(bm, tm, bitmap, mask, tpri, lpri, win, hscr, vscr, 0, y, 496, y+1); |
| 548 | 541 | } else { |
| 549 | 542 | // Horizontal split necessary |
| 550 | | draw(machine, bm, tm, bitmap, mask, tpri, lpri, win, hscr, vscr, 0, y, 512-hscr, y+1); |
| 551 | | draw(machine, bm, tm, bitmap, mask, tpri, lpri, win, 0, vscr, 512-hscr, y, 496, y+1); |
| 543 | (this->*draw)(bm, tm, bitmap, mask, tpri, lpri, win, hscr, vscr, 0, y, 512-hscr, y+1); |
| 544 | (this->*draw)(bm, tm, bitmap, mask, tpri, lpri, win, 0, vscr, 512-hscr, y, 496, y+1); |
| 552 | 545 | } |
| 553 | 546 | vscr = (vscr + 1) & 0x1ff; |
| 554 | 547 | } |
| r11224 | r11225 | |
| 560 | 553 | // Horizontal split unnecessary |
| 561 | 554 | if(vscr + 384 <= 512) { |
| 562 | 555 | // Vertical split unnecessary |
| 563 | | draw(machine, bm, tm, bitmap, mask, tpri, lpri, win, hscr, vscr, 0, 0, 496, 384); |
| 556 | (this->*draw)(bm, tm, bitmap, mask, tpri, lpri, win, hscr, vscr, 0, 0, 496, 384); |
| 564 | 557 | } else { |
| 565 | 558 | // Vertical split necessary |
| 566 | | draw(machine, bm, tm, bitmap, mask, tpri, lpri, win, hscr, vscr, 0, 0, 496, 512-vscr); |
| 567 | | draw(machine, bm, tm, bitmap, mask, tpri, lpri, win, hscr, 0, 0, 512-vscr, 496, 384); |
| 559 | (this->*draw)(bm, tm, bitmap, mask, tpri, lpri, win, hscr, vscr, 0, 0, 496, 512-vscr); |
| 560 | (this->*draw)(bm, tm, bitmap, mask, tpri, lpri, win, hscr, 0, 0, 512-vscr, 496, 384); |
| 568 | 561 | |
| 569 | 562 | } |
| 570 | 563 | } else { |
| 571 | 564 | // Horizontal split necessary |
| 572 | 565 | if(vscr + 384 <= 512) { |
| 573 | 566 | // Vertical split unnecessary |
| 574 | | draw(machine, bm, tm, bitmap, mask, tpri, lpri, win, hscr, vscr, 0, 0, 512-hscr, 384); |
| 575 | | draw(machine, bm, tm, bitmap, mask, tpri, lpri, win, 0, vscr, 512-hscr, 0, 496, 384); |
| 567 | (this->*draw)(bm, tm, bitmap, mask, tpri, lpri, win, hscr, vscr, 0, 0, 512-hscr, 384); |
| 568 | (this->*draw)(bm, tm, bitmap, mask, tpri, lpri, win, 0, vscr, 512-hscr, 0, 496, 384); |
| 576 | 569 | } else { |
| 577 | 570 | // Vertical split necessary |
| 578 | | draw(machine, bm, tm, bitmap, mask, tpri, lpri, win, hscr, vscr, 0, 0, 512-hscr, 512-vscr); |
| 579 | | draw(machine, bm, tm, bitmap, mask, tpri, lpri, win, 0, vscr, 512-hscr, 0, 496, 512-vscr); |
| 580 | | draw(machine, bm, tm, bitmap, mask, tpri, lpri, win, hscr, 0, 0, 512-vscr, 512-hscr, 384); |
| 581 | | draw(machine, bm, tm, bitmap, mask, tpri, lpri, win, 0, 0, 512-hscr, 512-vscr, 496, 384); |
| 571 | (this->*draw)(bm, tm, bitmap, mask, tpri, lpri, win, hscr, vscr, 0, 0, 512-hscr, 512-vscr); |
| 572 | (this->*draw)(bm, tm, bitmap, mask, tpri, lpri, win, 0, vscr, 512-hscr, 0, 496, 512-vscr); |
| 573 | (this->*draw)(bm, tm, bitmap, mask, tpri, lpri, win, hscr, 0, 0, 512-vscr, 512-hscr, 384); |
| 574 | (this->*draw)(bm, tm, bitmap, mask, tpri, lpri, win, 0, 0, 512-hscr, 512-vscr, 496, 384); |
| 582 | 575 | } |
| 583 | 576 | } |
| 584 | 577 | } |
| 585 | 578 | } |
| 586 | 579 | } |
| 587 | 580 | |
| 588 | | READ16_HANDLER(sys24_tile_r) |
| 581 | READ16_MEMBER(segas24_tile::tile_r) |
| 589 | 582 | { |
| 590 | | return sys24_tile_ram[offset]; |
| 583 | return tile_ram[offset]; |
| 591 | 584 | } |
| 592 | 585 | |
| 593 | | READ16_HANDLER(sys24_char_r) |
| 586 | READ16_MEMBER(segas24_tile::char_r) |
| 594 | 587 | { |
| 595 | | return sys24_char_ram[offset]; |
| 588 | return char_ram[offset]; |
| 596 | 589 | } |
| 597 | 590 | |
| 598 | | WRITE16_HANDLER(sys24_tile_w) |
| 591 | WRITE16_MEMBER(segas24_tile::tile_w) |
| 599 | 592 | { |
| 600 | | COMBINE_DATA(sys24_tile_ram + offset); |
| 593 | COMBINE_DATA(tile_ram + offset); |
| 601 | 594 | if(offset < 0x4000) |
| 602 | | tilemap_mark_tile_dirty(sys24_tile_layer[offset >> 12], offset & 0xfff); |
| 595 | tilemap_mark_tile_dirty(tile_layer[offset >> 12], offset & 0xfff); |
| 603 | 596 | } |
| 604 | 597 | |
| 605 | | WRITE16_HANDLER(sys24_char_w) |
| 598 | WRITE16_MEMBER(segas24_tile::char_w) |
| 606 | 599 | { |
| 607 | | UINT16 old = sys24_char_ram[offset]; |
| 608 | | COMBINE_DATA(sys24_char_ram + offset); |
| 609 | | if(old != sys24_char_ram[offset]) { |
| 610 | | gfx_element_mark_dirty(space->machine().gfx[sys24_char_gfx_index], offset / 16); |
| 611 | | } |
| 600 | UINT16 old = char_ram[offset]; |
| 601 | COMBINE_DATA(char_ram + offset); |
| 602 | if(old != char_ram[offset]) |
| 603 | gfx_element_mark_dirty(machine().gfx[char_gfx_index], offset / 16); |
| 612 | 604 | } |
| 613 | 605 | |
| 614 | | READ32_HANDLER(sys24_tile32_r) |
| 606 | READ32_MEMBER(segas24_tile::tile32_r) |
| 615 | 607 | { |
| 616 | | return sys24_tile_r(space, offset*2, mem_mask&0xffff) | sys24_tile_r(space, (offset*2)+1, mem_mask>>16)<<16; |
| 608 | return tile_r(space, offset*2, mem_mask&0xffff) | tile_r(space, (offset*2)+1, mem_mask>>16)<<16; |
| 617 | 609 | } |
| 618 | 610 | |
| 619 | | READ32_HANDLER(sys24_char32_r) |
| 611 | READ32_MEMBER(segas24_tile::char32_r) |
| 620 | 612 | { |
| 621 | | return sys24_char_r(space, offset*2, mem_mask&0xffff) | sys24_char_r(space, (offset*2)+1, mem_mask>>16)<<16; |
| 613 | return char_r(space, offset*2, mem_mask&0xffff) | char_r(space, (offset*2)+1, mem_mask>>16)<<16; |
| 622 | 614 | } |
| 623 | 615 | |
| 624 | | WRITE32_HANDLER(sys24_tile32_w) |
| 616 | WRITE32_MEMBER(segas24_tile::tile32_w) |
| 625 | 617 | { |
| 626 | | sys24_tile_w(space, offset*2, data&0xffff, mem_mask&0xffff); |
| 627 | | sys24_tile_w(space, (offset*2)+1, data>>16, mem_mask>>16); |
| 618 | tile_w(space, offset*2, data&0xffff, mem_mask&0xffff); |
| 619 | tile_w(space, (offset*2)+1, data>>16, mem_mask>>16); |
| 628 | 620 | } |
| 629 | 621 | |
| 630 | | WRITE32_HANDLER(sys24_char32_w) |
| 622 | WRITE32_MEMBER(segas24_tile::char32_w) |
| 631 | 623 | { |
| 632 | | sys24_char_w(space,offset*2, data&0xffff, mem_mask&0xffff); |
| 633 | | sys24_char_w(space,(offset*2)+1, data>>16, mem_mask>>16); |
| 624 | char_w(space, offset*2, data&0xffff, mem_mask&0xffff); |
| 625 | char_w(space, (offset*2)+1, data>>16, mem_mask>>16); |
| 634 | 626 | } |
| 635 | 627 | |
| 636 | | // - System 24 |
| 637 | 628 | |
| 638 | | static UINT16 *sys24_sprite_ram; |
| 629 | segas24_sprite::segas24_sprite(running_machine &_machine, const segas24_sprite_config &_config) |
| 630 | : device_t(_machine, _config), |
| 631 | config(_config) |
| 632 | { |
| 633 | } |
| 639 | 634 | |
| 640 | | void sys24_sprite_vh_start(running_machine &machine) |
| 635 | void segas24_sprite::device_start() |
| 641 | 636 | { |
| 642 | | sys24_sprite_ram = auto_alloc_array(machine, UINT16, 0x40000/2); |
| 637 | sprite_ram = auto_alloc_array(machine(), UINT16, 0x40000/2); |
| 643 | 638 | |
| 644 | | state_save_register_global_pointer(machine, sys24_sprite_ram, 0x40000/2); |
| 645 | | // kc = 0; |
| 639 | save_pointer(NAME(sprite_ram), 0x40000/2); |
| 646 | 640 | } |
| 647 | 641 | |
| 648 | 642 | /* System24 sprites |
| r11224 | r11225 | |
| 669 | 663 | 0 11------ -------- |
| 670 | 664 | */ |
| 671 | 665 | |
| 672 | | void sys24_sprite_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const int *spri) |
| 666 | void segas24_sprite::draw(bitmap_t *bitmap, const rectangle *cliprect, const int *spri) |
| 673 | 667 | { |
| 674 | 668 | UINT16 curspr = 0; |
| 675 | 669 | int countspr = 0; |
| r11224 | r11225 | |
| 686 | 680 | UINT16 *source; |
| 687 | 681 | UINT16 type; |
| 688 | 682 | |
| 689 | | source = sys24_sprite_ram + (curspr << 3); |
| 683 | source = sprite_ram + (curspr << 3); |
| 690 | 684 | |
| 691 | 685 | if(curspr == 0 && source[0] == 0) |
| 692 | 686 | break; |
| r11224 | r11225 | |
| 783 | 777 | flipy = source[4] & 0x8000; |
| 784 | 778 | sy = 1 << ((source[4] & 0x7000) >> 12); |
| 785 | 779 | |
| 786 | | pix = &sys24_sprite_ram[(source[3] & 0x3fff)* 0x8]; |
| 780 | pix = &sprite_ram[(source[3] & 0x3fff)* 0x8]; |
| 787 | 781 | for(px=0; px<8; px++) { |
| 788 | 782 | int c; |
| 789 | 783 | c = pix[px] >> 8; |
| r11224 | r11225 | |
| 830 | 824 | if(xpos2 >= min_x && xpos2 <= max_x) { |
| 831 | 825 | int zx1 = flipx ? 7-zx : zx; |
| 832 | 826 | UINT32 neweroffset = (newoffset+(zx1>>2))&0x1ffff; // crackdown sometimes attempts to use data past the end of spriteram |
| 833 | | int c = (sys24_sprite_ram[neweroffset] >> (((~zx1) & 3) << 2)) & 0xf; |
| 834 | | UINT8 *pri = BITMAP_ADDR8(machine.priority_bitmap, ypos1, xpos2); |
| 827 | int c = (sprite_ram[neweroffset] >> (((~zx1) & 3) << 2)) & 0xf; |
| 828 | UINT8 *pri = BITMAP_ADDR8(machine().priority_bitmap, ypos1, xpos2); |
| 835 | 829 | if(!(*pri & pm[c])) { |
| 836 | 830 | c = colors[c]; |
| 837 | 831 | if(c) { |
| r11224 | r11225 | |
| 868 | 862 | } |
| 869 | 863 | |
| 870 | 864 | |
| 871 | | WRITE16_HANDLER(sys24_sprite_w) |
| 865 | WRITE16_MEMBER(segas24_sprite::write) |
| 872 | 866 | { |
| 873 | | COMBINE_DATA(sys24_sprite_ram + offset); |
| 867 | COMBINE_DATA(sprite_ram + offset); |
| 874 | 868 | } |
| 875 | 869 | |
| 876 | | READ16_HANDLER(sys24_sprite_r) |
| 870 | READ16_MEMBER(segas24_sprite::read) |
| 877 | 871 | { |
| 878 | | return sys24_sprite_ram[offset]; |
| 872 | return sprite_ram[offset]; |
| 879 | 873 | } |
| 880 | 874 | |
| 881 | | // Programmable mixers |
| 882 | | // System 24 |
| 883 | 875 | |
| 884 | | static UINT16 sys24_mixer_reg[0x10]; |
| 876 | segas24_mixer::segas24_mixer(running_machine &_machine, const segas24_mixer_config &_config) |
| 877 | : device_t(_machine, _config), |
| 878 | config(_config) |
| 879 | { |
| 880 | } |
| 885 | 881 | |
| 886 | | void sys24_mixer_vh_start(running_machine &machine) |
| 882 | void segas24_mixer::device_start() |
| 887 | 883 | { |
| 888 | | memset(sys24_mixer_reg, 0, sizeof(sys24_mixer_reg)); |
| 889 | | state_save_register_global_array(machine, sys24_mixer_reg); |
| 884 | memset(mixer_reg, 0, sizeof(mixer_reg)); |
| 885 | save_item(NAME(mixer_reg)); |
| 890 | 886 | } |
| 891 | 887 | |
| 892 | | WRITE16_HANDLER (sys24_mixer_w) |
| 888 | WRITE16_MEMBER(segas24_mixer::write) |
| 893 | 889 | { |
| 894 | | COMBINE_DATA(sys24_mixer_reg + offset); |
| 890 | COMBINE_DATA(mixer_reg + offset); |
| 895 | 891 | } |
| 896 | 892 | |
| 897 | | READ16_HANDLER (sys24_mixer_r) |
| 893 | READ16_MEMBER(segas24_mixer::read) |
| 898 | 894 | { |
| 899 | | return sys24_mixer_reg[offset]; |
| 895 | return mixer_reg[offset]; |
| 900 | 896 | } |
| 901 | 897 | |
| 902 | | int sys24_mixer_get_reg(int reg) |
| 898 | UINT16 segas24_mixer::get_reg(int reg) |
| 903 | 899 | { |
| 904 | | return sys24_mixer_reg[reg]; |
| 900 | return mixer_reg[reg]; |
| 905 | 901 | } |
| 906 | 902 | |
src/mame/layout/bfm_sc1.lay
| r11224 | r11225 | |
| 2089 | 2089 | </screen> |
| 2090 | 2090 | </view> |
| 2091 | 2091 | </mamelayout> |
| 2092 | | |
| 2093 | | <?xml version="1.0"?> |
| 2094 | | <mamelayout version="2"> |
| 2095 | | <element name="matrixlamp"> |
| 2096 | | <rect state ="0"> |
| 2097 | | <bounds x="0" y="0" width="7" height="7" /> |
| 2098 | | <color red="0.7" green="0.7" blue="0.7" /> |
| 2099 | | </rect> |
| 2100 | | <rect state ="1"> |
| 2101 | | <bounds x="0" y="0" width="7" height="7" /> |
| 2102 | | <color red="0.0" green="0.0" blue="1.0" /> |
| 2103 | | </rect> |
| 2104 | | <rect state ="2"> |
| 2105 | | <bounds x="0" y="0" width="7" height="7" /> |
| 2106 | | <color red="0.0" green="1.0" blue="0.0" /> |
| 2107 | | </rect> |
| 2108 | | </element> |
| 2109 | | <element name="vfd0"> |
| 2110 | | <led14segsc> |
| 2111 | | <color red="0" green="0.6" blue="1.0" /> |
| 2112 | | </led14segsc> |
| 2113 | | </element> |
| 2114 | | <element name="Steppers" defstate="96"> |
| 2115 | | <text string="00" state="0"> |
| 2116 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2117 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2118 | | </text> |
| 2119 | | <text string="01" state="1"> |
| 2120 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2121 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2122 | | </text> |
| 2123 | | <text string="02" state="2"> |
| 2124 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2125 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2126 | | </text> |
| 2127 | | <text string="03" state="3"> |
| 2128 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2129 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2130 | | </text> |
| 2131 | | <text string="04" state="4"> |
| 2132 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2133 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2134 | | </text> |
| 2135 | | <text string="05" state="5"> |
| 2136 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2137 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2138 | | </text> |
| 2139 | | <text string="06" state="6"> |
| 2140 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2141 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2142 | | </text> |
| 2143 | | <text string="07" state="7"> |
| 2144 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2145 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2146 | | </text> |
| 2147 | | <text string="08" state="8"> |
| 2148 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2149 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2150 | | </text> |
| 2151 | | <text string="09" state="9"> |
| 2152 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2153 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2154 | | </text> |
| 2155 | | <text string="10" state="10"> |
| 2156 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2157 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2158 | | </text> |
| 2159 | | <text string="11" state="11"> |
| 2160 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2161 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2162 | | </text> |
| 2163 | | <text string="12" state="12"> |
| 2164 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2165 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2166 | | </text> |
| 2167 | | <text string="13" state="13"> |
| 2168 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2169 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2170 | | </text> |
| 2171 | | <text string="14" state="14"> |
| 2172 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2173 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2174 | | </text> |
| 2175 | | <text string="15" state="15"> |
| 2176 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2177 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2178 | | </text> |
| 2179 | | <text string="16" state="16"> |
| 2180 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2181 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2182 | | </text> |
| 2183 | | <text string="17" state="17"> |
| 2184 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2185 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2186 | | </text> |
| 2187 | | <text string="18" state="18"> |
| 2188 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2189 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2190 | | </text> |
| 2191 | | <text string="19" state="19"> |
| 2192 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2193 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2194 | | </text> |
| 2195 | | <text string="20" state="20"> |
| 2196 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2197 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2198 | | </text> |
| 2199 | | <text string="21" state="21"> |
| 2200 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2201 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2202 | | </text> |
| 2203 | | <text string="22" state="22"> |
| 2204 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2205 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2206 | | </text> |
| 2207 | | <text string="23" state="23"> |
| 2208 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2209 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2210 | | </text> |
| 2211 | | <text string="24" state="24"> |
| 2212 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2213 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2214 | | </text> |
| 2215 | | <text string="25" state="25"> |
| 2216 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2217 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2218 | | </text> |
| 2219 | | <text string="26" state="26"> |
| 2220 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2221 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2222 | | </text> |
| 2223 | | <text string="27" state="27"> |
| 2224 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2225 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2226 | | </text> |
| 2227 | | <text string="28" state="28"> |
| 2228 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2229 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2230 | | </text> |
| 2231 | | <text string="29" state="29"> |
| 2232 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2233 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2234 | | </text> |
| 2235 | | <text string="30" state="30"> |
| 2236 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2237 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2238 | | </text> |
| 2239 | | <text string="31" state="31"> |
| 2240 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2241 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2242 | | </text> |
| 2243 | | <text string="32" state="32"> |
| 2244 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2245 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2246 | | </text> |
| 2247 | | <text string="33" state="33"> |
| 2248 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2249 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2250 | | </text> |
| 2251 | | <text string="34" state="34"> |
| 2252 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2253 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2254 | | </text> |
| 2255 | | <text string="35" state="35"> |
| 2256 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2257 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2258 | | </text> |
| 2259 | | <text string="36" state="36"> |
| 2260 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2261 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2262 | | </text> |
| 2263 | | <text string="37" state="37"> |
| 2264 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2265 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2266 | | </text> |
| 2267 | | <text string="38" state="38"> |
| 2268 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2269 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2270 | | </text> |
| 2271 | | <text string="39" state="39"> |
| 2272 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2273 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2274 | | </text> |
| 2275 | | <text string="40" state="40"> |
| 2276 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2277 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2278 | | </text> |
| 2279 | | <text string="41" state="41"> |
| 2280 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2281 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2282 | | </text> |
| 2283 | | <text string="42" state="42"> |
| 2284 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2285 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2286 | | </text> |
| 2287 | | <text string="43" state="43"> |
| 2288 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2289 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2290 | | </text> |
| 2291 | | <text string="44" state="44"> |
| 2292 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2293 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2294 | | </text> |
| 2295 | | <text string="45" state="45"> |
| 2296 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2297 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2298 | | </text> |
| 2299 | | <text string="46" state="46"> |
| 2300 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2301 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2302 | | </text> |
| 2303 | | <text string="47" state="47"> |
| 2304 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2305 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2306 | | </text> |
| 2307 | | <text string="48" state="48"> |
| 2308 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2309 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2310 | | </text> |
| 2311 | | <text string="49" state="49"> |
| 2312 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2313 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2314 | | </text> |
| 2315 | | <text string="50" state="50"> |
| 2316 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2317 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2318 | | </text> |
| 2319 | | <text string="51" state="51"> |
| 2320 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2321 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2322 | | </text> |
| 2323 | | <text string="52" state="52"> |
| 2324 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2325 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2326 | | </text> |
| 2327 | | <text string="53" state="53"> |
| 2328 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2329 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2330 | | </text> |
| 2331 | | <text string="54" state="54"> |
| 2332 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2333 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2334 | | </text> |
| 2335 | | <text string="55" state="55"> |
| 2336 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2337 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2338 | | </text> |
| 2339 | | <text string="56" state="56"> |
| 2340 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2341 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2342 | | </text> |
| 2343 | | <text string="57" state="57"> |
| 2344 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2345 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2346 | | </text> |
| 2347 | | <text string="58" state="58"> |
| 2348 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2349 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2350 | | </text> |
| 2351 | | <text string="59" state="59"> |
| 2352 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2353 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2354 | | </text> |
| 2355 | | <text string="60" state="60"> |
| 2356 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2357 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2358 | | </text> |
| 2359 | | <text string="61" state="61"> |
| 2360 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2361 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2362 | | </text> |
| 2363 | | <text string="62" state="62"> |
| 2364 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2365 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2366 | | </text> |
| 2367 | | <text string="63" state="63"> |
| 2368 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2369 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2370 | | </text> |
| 2371 | | <text string="64" state="64"> |
| 2372 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2373 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2374 | | </text> |
| 2375 | | <text string="65" state="65"> |
| 2376 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2377 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2378 | | </text> |
| 2379 | | <text string="66" state="66"> |
| 2380 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2381 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2382 | | </text> |
| 2383 | | <text string="67" state="67"> |
| 2384 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2385 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2386 | | </text> |
| 2387 | | <text string="68" state="68"> |
| 2388 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2389 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2390 | | </text> |
| 2391 | | <text string="69" state="69"> |
| 2392 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2393 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2394 | | </text> |
| 2395 | | <text string="70" state="70"> |
| 2396 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2397 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2398 | | </text> |
| 2399 | | <text string="71" state="71"> |
| 2400 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2401 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2402 | | </text> |
| 2403 | | <text string="72" state="72"> |
| 2404 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2405 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2406 | | </text> |
| 2407 | | <text string="73" state="73"> |
| 2408 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2409 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2410 | | </text> |
| 2411 | | <text string="74" state="74"> |
| 2412 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2413 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2414 | | </text> |
| 2415 | | <text string="75" state="75"> |
| 2416 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2417 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2418 | | </text> |
| 2419 | | <text string="76" state="76"> |
| 2420 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2421 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2422 | | </text> |
| 2423 | | <text string="77" state="77"> |
| 2424 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2425 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2426 | | </text> |
| 2427 | | <text string="78" state="78"> |
| 2428 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2429 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2430 | | </text> |
| 2431 | | <text string="79" state="79"> |
| 2432 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2433 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2434 | | </text> |
| 2435 | | <text string="80" state="80"> |
| 2436 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2437 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2438 | | </text> |
| 2439 | | <text string="81" state="81"> |
| 2440 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2441 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2442 | | </text> |
| 2443 | | <text string="82" state="82"> |
| 2444 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2445 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2446 | | </text> |
| 2447 | | <text string="83" state="83"> |
| 2448 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2449 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2450 | | </text> |
| 2451 | | <text string="84" state="84"> |
| 2452 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2453 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2454 | | </text> |
| 2455 | | <text string="85" state="85"> |
| 2456 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2457 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2458 | | </text> |
| 2459 | | <text string="86" state="86"> |
| 2460 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2461 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2462 | | </text> |
| 2463 | | <text string="87" state="87"> |
| 2464 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2465 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2466 | | </text> |
| 2467 | | <text string="88" state="88"> |
| 2468 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2469 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2470 | | </text> |
| 2471 | | <text string="89" state="89"> |
| 2472 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2473 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2474 | | </text> |
| 2475 | | <text string="90" state="90"> |
| 2476 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2477 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2478 | | </text> |
| 2479 | | <text string="91" state="91"> |
| 2480 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2481 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2482 | | </text> |
| 2483 | | <text string="92" state="92"> |
| 2484 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2485 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2486 | | </text> |
| 2487 | | <text string="93" state="93"> |
| 2488 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2489 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2490 | | </text> |
| 2491 | | <text string="94" state="94"> |
| 2492 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2493 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2494 | | </text> |
| 2495 | | <text string="95" state="95"> |
| 2496 | | <color red="1.0" green="1.0" blue="1.0" /> |
| 2497 | | <bounds x="0" y="0.1" width="1" height="1" /> |
| 2498 | | </text> |
| 2499 | | </element> |
| 2500 | | |
| 2501 | | <view name="Full Output"> |
| 2502 | | <screen index="0"> |
| 2503 | | <bounds x="127" y="0" width="400" height="280" /> |
| 2504 | | </screen> |
| 2505 | | <backdrop name="vfd0" element="vfd0" state="0"> |
| 2506 | | <bounds x="10" y="280" width="9" height="17"/> |
| 2507 | | </backdrop> |
| 2508 | | <backdrop name="vfd1" element="vfd0" state="0"> |
| 2509 | | <bounds x="19" y="280" width="9" height="17"/> |
| 2510 | | </backdrop> |
| 2511 | | <backdrop name="vfd2" element="vfd0" state="0"> |
| 2512 | | <bounds x="28" y="280" width="9" height="17"/> |
| 2513 | | </backdrop> |
| 2514 | | <backdrop name="vfd3" element="vfd0" state="0"> |
| 2515 | | <bounds x="37" y="280" width="9" height="17"/> |
| 2516 | | </backdrop> |
| 2517 | | <backdrop name="vfd4" element="vfd0" state="0"> |
| 2518 | | <bounds x="46" y="280" width="9" height="17"/> |
| 2519 | | </backdrop> |
| 2520 | | <backdrop name="vfd5" element="vfd0" state="0"> |
| 2521 | | <bounds x="55" y="280" width="9" height="17"/> |
| 2522 | | </backdrop> |
| 2523 | | <backdrop name="vfd6" element="vfd0" state="0"> |
| 2524 | | <bounds x="64" y="280" width="9" height="17"/> |
| 2525 | | </backdrop> |
| 2526 | | <backdrop name="vfd7" element="vfd0" state="0"> |
| 2527 | | <bounds x="73" y="280" width="9" height="17"/> |
| 2528 | | </backdrop> |
| 2529 | | <backdrop name="vfd8" element="vfd0" state="0"> |
| 2530 | | <bounds x="82" y="280" width="9" height="17"/> |
| 2531 | | </backdrop> |
| 2532 | | <backdrop name="vfd9" element="vfd0" state="0"> |
| 2533 | | <bounds x="91" y="280" width="9" height="17"/> |
| 2534 | | </backdrop> |
| 2535 | | <backdrop name="vfd10" element="vfd0" state="0"> |
| 2536 | | <bounds x="100" y="280" width="9" height="17"/> |
| 2537 | | </backdrop> |
| 2538 | | <backdrop name="vfd11" element="vfd0" state="0"> |
| 2539 | | <bounds x="109" y="280" width="9" height="17"/> |
| 2540 | | </backdrop> |
| 2541 | | <backdrop name="vfd12" element="vfd0" state="0"> |
| 2542 | | <bounds x="118" y="280" width="9" height="17"/> |
| 2543 | | </backdrop> |
| 2544 | | <backdrop name="vfd13" element="vfd0" state="0"> |
| 2545 | | <bounds x="127" y="280" width="9" height="17"/> |
| 2546 | | </backdrop> |
| 2547 | | <backdrop name="vfd14" element="vfd0" state="0"> |
| 2548 | | <bounds x="136" y="280" width="9" height="17"/> |
| 2549 | | </backdrop> |
| 2550 | | <backdrop name="vfd15" element="vfd0" state="0"> |
| 2551 | | <bounds x="145" y="280" width="9" height="17"/> |
| 2552 | | </backdrop> |
| 2553 | | <backdrop name="reel1" element="Steppers" state="0"> |
| 2554 | | <bounds x="10" y="320" width="50" height="50"/> |
| 2555 | | </backdrop> |
| 2556 | | <backdrop name="reel2" element="Steppers" state="0"> |
| 2557 | | <bounds x="60" y="320" width="50" height="50"/> |
| 2558 | | </backdrop> |
| 2559 | | <backdrop name="reel3" element="Steppers" state="0"> |
| 2560 | | <bounds x="110" y="320" width="50" height="50"/> |
| 2561 | | </backdrop> |
| 2562 | | <backdrop name="reel4" element="Steppers" state="0"> |
| 2563 | | <bounds x="160" y="320" width="50" height="50"/> |
| 2564 | | </backdrop> |
| 2565 | | <backdrop name="reel5" element="Steppers" state="0"> |
| 2566 | | <bounds x="220" y="320" width="50" height="50"/> |
| 2567 | | </backdrop> |
| 2568 | | <backdrop name="reel6" element="Steppers" state="0"> |
| 2569 | | <bounds x="280" y="320" width="50" height="50"/> |
| 2570 | | </backdrop> |
| 2571 | | <backdrop name="lamp0" element="matrixlamp" state="0"> |
| 2572 | | <bounds x="0" y="0" width="7" height="7"/> |
| 2573 | | </backdrop> |
| 2574 | | <backdrop name="lamp1" element="matrixlamp" state="0"> |
| 2575 | | <bounds x="8" y="0" width="7" height="7"/> |
| 2576 | | </backdrop> |
| 2577 | | <backdrop name="lamp2" element="matrixlamp" state="0"> |
| 2578 | | <bounds x="16" y="0" width="7" height="7"/> |
| 2579 | | </backdrop> |
| 2580 | | <backdrop name="lamp3" element="matrixlamp" state="0"> |
| 2581 | | <bounds x="24" y="0" width="7" height="7"/> |
| 2582 | | </backdrop> |
| 2583 | | <backdrop name="lamp4" element="matrixlamp" state="0"> |
| 2584 | | <bounds x="32" y="0" width="7" height="7"/> |
| 2585 | | </backdrop> |
| 2586 | | <backdrop name="lamp5" element="matrixlamp" state="0"> |
| 2587 | | <bounds x="40" y="0" width="7" height="7"/> |
| 2588 | | </backdrop> |
| 2589 | | <backdrop name="lamp6" element="matrixlamp" state="0"> |
| 2590 | | <bounds x="48" y="0" width="7" height="7"/> |
| 2591 | | </backdrop> |
| 2592 | | <backdrop name="lamp7" element="matrixlamp" state="0"> |
| 2593 | | <bounds x="56" y="0" width="7" height="7"/> |
| 2594 | | </backdrop> |
| 2595 | | <backdrop name="lamp8" element="matrixlamp" state="0"> |
| 2596 | | <bounds x="64" y="0" width="7" height="7"/> |
| 2597 | | </backdrop> |
| 2598 | | <backdrop name="lamp9" element="matrixlamp" state="0"> |
| 2599 | | <bounds x="72" y="0" width="7" height="7"/> |
| 2600 | | </backdrop> |
| 2601 | | <backdrop name="lamp10" element="matrixlamp" state="0"> |
| 2602 | | <bounds x="80" y="0" width="7" height="7"/> |
| 2603 | | </backdrop> |
| 2604 | | <backdrop name="lamp11" element="matrixlamp" state="0"> |
| 2605 | | <bounds x="88" y="0" width="7" height="7"/> |
| 2606 | | </backdrop> |
| 2607 | | <backdrop name="lamp12" element="matrixlamp" state="0"> |
| 2608 | | <bounds x="96" y="0" width="7" height="7"/> |
| 2609 | | </backdrop> |
| 2610 | | <backdrop name="lamp13" element="matrixlamp" state="0"> |
| 2611 | | <bounds x="104" y="0" width="7" height="7"/> |
| 2612 | | </backdrop> |
| 2613 | | <backdrop name="lamp14" element="matrixlamp" state="0"> |
| 2614 | | <bounds x="112" y="0" width="7" height="7"/> |
| 2615 | | </backdrop> |
| 2616 | | <backdrop name="lamp15" element="matrixlamp" state="0"> |
| 2617 | | <bounds x="120" y="0" width="7" height="7"/> |
| 2618 | | </backdrop> |
| 2619 | | <backdrop name="lamp16" element="matrixlamp" state="0"> |
| 2620 | | <bounds x="0" y="8" width="7" height="7"/> |
| 2621 | | </backdrop> |
| 2622 | | <backdrop name="lamp17" element="matrixlamp" state="0"> |
| 2623 | | <bounds x="8" y="8" width="7" height="7"/> |
| 2624 | | </backdrop> |
| 2625 | | <backdrop name="lamp18" element="matrixlamp" state="0"> |
| 2626 | | <bounds x="16" y="8" width="7" height="7"/> |
| 2627 | | </backdrop> |
| 2628 | | <backdrop name="lamp19" element="matrixlamp" state="0"> |
| 2629 | | <bounds x="24" y="8" width="7" height="7"/> |
| 2630 | | </backdrop> |
| 2631 | | <backdrop name="lamp20" element="matrixlamp" state="0"> |
| 2632 | | <bounds x="32" y="8" width="7" height="7"/> |
| 2633 | | </backdrop> |
| 2634 | | <backdrop name="lamp21" element="matrixlamp" state="0"> |
| 2635 | | <bounds x="40" y="8" width="7" height="7"/> |
| 2636 | | </backdrop> |
| 2637 | | <backdrop name="lamp22" element="matrixlamp" state="0"> |
| 2638 | | <bounds x="48" y="8" width="7" height="7"/> |
| 2639 | | </backdrop> |
| 2640 | | <backdrop name="lamp23" element="matrixlamp" state="0"> |
| 2641 | | <bounds x="56" y="8" width="7" height="7"/> |
| 2642 | | </backdrop> |
| 2643 | | <backdrop name="lamp24" element="matrixlamp" state="0"> |
| 2644 | | <bounds x="64" y="8" width="7" height="7"/> |
| 2645 | | </backdrop> |
| 2646 | | <backdrop name="lamp25" element="matrixlamp" state="0"> |
| 2647 | | <bounds x="72" y="8" width="7" height="7"/> |
| 2648 | | </backdrop> |
| 2649 | | <backdrop name="lamp26" element="matrixlamp" state="0"> |
| 2650 | | <bounds x="80" y="8" width="7" height="7"/> |
| 2651 | | </backdrop> |
| 2652 | | <backdrop name="lamp27" element="matrixlamp" state="0"> |
| 2653 | | <bounds x="88" y="8" width="7" height="7"/> |
| 2654 | | </backdrop> |
| 2655 | | <backdrop name="lamp28" element="matrixlamp" state="0"> |
| 2656 | | <bounds x="96" y="8" width="7" height="7"/> |
| 2657 | | </backdrop> |
| 2658 | | <backdrop name="lamp29" element="matrixlamp" state="0"> |
| 2659 | | <bounds x="104" y="8" width="7" height="7"/> |
| 2660 | | </backdrop> |
| 2661 | | <backdrop name="lamp30" element="matrixlamp" state="0"> |
| 2662 | | <bounds x="112" y="8" width="7" height="7"/> |
| 2663 | | </backdrop> |
| 2664 | | <backdrop name="lamp31" element="matrixlamp" state="0"> |
| 2665 | | <bounds x="120" y="8" width="7" height="7"/> |
| 2666 | | </backdrop> |
| 2667 | | <backdrop name="lamp32" element="matrixlamp" state="0"> |
| 2668 | | <bounds x="0" y="16" width="7" height="7"/> |
| 2669 | | </backdrop> |
| 2670 | | <backdrop name="lamp33" element="matrixlamp" state="0"> |
| 2671 | | <bounds x="8" y="16" width="7" height="7"/> |
| 2672 | | </backdrop> |
| 2673 | | <backdrop name="lamp34" element="matrixlamp" state="0"> |
| 2674 | | <bounds x="16" y="16" width="7" height="7"/> |
| 2675 | | </backdrop> |
| 2676 | | <backdrop name="lamp35" element="matrixlamp" state="0"> |
| 2677 | | <bounds x="24" y="16" width="7" height="7"/> |
| 2678 | | </backdrop> |
| 2679 | | <backdrop name="lamp36" element="matrixlamp" state="0"> |
| 2680 | | <bounds x="32" y="16" width="7" height="7"/> |
| 2681 | | </backdrop> |
| 2682 | | <backdrop name="lamp37" element="matrixlamp" state="0"> |
| 2683 | | <bounds x="40" y="16" width="7" height="7"/> |
| 2684 | | </backdrop> |
| 2685 | | <backdrop name="lamp38" element="matrixlamp" state="0"> |
| 2686 | | <bounds x="48" y="16" width="7" height="7"/> |
| 2687 | | </backdrop> |
| 2688 | | <backdrop name="lamp39" element="matrixlamp" state="0"> |
| 2689 | | <bounds x="56" y="16" width="7" height="7"/> |
| 2690 | | </backdrop> |
| 2691 | | <backdrop name="lamp40" element="matrixlamp" state="0"> |
| 2692 | | <bounds x="64" y="16" width="7" height="7"/> |
| 2693 | | </backdrop> |
| 2694 | | <backdrop name="lamp41" element="matrixlamp" state="0"> |
| 2695 | | <bounds x="72" y="16" width="7" height="7"/> |
| 2696 | | </backdrop> |
| 2697 | | <backdrop name="lamp42" element="matrixlamp" state="0"> |
| 2698 | | <bounds x="80" y="16" width="7" height="7"/> |
| 2699 | | </backdrop> |
| 2700 | | <backdrop name="lamp43" element="matrixlamp" state="0"> |
| 2701 | | <bounds x="88" y="16" width="7" height="7"/> |
| 2702 | | </backdrop> |
| 2703 | | <backdrop name="lamp44" element="matrixlamp" state="0"> |
| 2704 | | <bounds x="96" y="16" width="7" height="7"/> |
| 2705 | | </backdrop> |
| 2706 | | <backdrop name="lamp45" element="matrixlamp" state="0"> |
| 2707 | | <bounds x="104" y="16" width="7" height="7"/> |
| 2708 | | </backdrop> |
| 2709 | | <backdrop name="lamp46" element="matrixlamp" state="0"> |
| 2710 | | <bounds x="112" y="16" width="7" height="7"/> |
| 2711 | | </backdrop> |
| 2712 | | <backdrop name="lamp47" element="matrixlamp" state="0"> |
| 2713 | | <bounds x="120" y="16" width="7" height="7"/> |
| 2714 | | </backdrop> |
| 2715 | | <backdrop name="lamp48" element="matrixlamp" state="0"> |
| 2716 | | <bounds x="0" y="24" width="7" height="7"/> |
| 2717 | | </backdrop> |
| 2718 | | <backdrop name="lamp49" element="matrixlamp" state="0"> |
| 2719 | | <bounds x="8" y="24" width="7" height="7"/> |
| 2720 | | </backdrop> |
| 2721 | | <backdrop name="lamp50" element="matrixlamp" state="0"> |
| 2722 | | <bounds x="16" y="24" width="7" height="7"/> |
| 2723 | | </backdrop> |
| 2724 | | <backdrop name="lamp51" element="matrixlamp" state="0"> |
| 2725 | | <bounds x="24" y="24" width="7" height="7"/> |
| 2726 | | </backdrop> |
| 2727 | | <backdrop name="lamp52" element="matrixlamp" state="0"> |
| 2728 | | <bounds x="32" y="24" width="7" height="7"/> |
| 2729 | | </backdrop> |
| 2730 | | <backdrop name="lamp53" element="matrixlamp" state="0"> |
| 2731 | | <bounds x="40" y="24" width="7" height="7"/> |
| 2732 | | </backdrop> |
| 2733 | | <backdrop name="lamp54" element="matrixlamp" state="0"> |
| 2734 | | <bounds x="48" y="24" width="7" height="7"/> |
| 2735 | | </backdrop> |
| 2736 | | <backdrop name="lamp55" element="matrixlamp" state="0"> |
| 2737 | | <bounds x="56" y="24" width="7" height="7"/> |
| 2738 | | </backdrop> |
| 2739 | | <backdrop name="lamp56" element="matrixlamp" state="0"> |
| 2740 | | <bounds x="64" y="24" width="7" height="7"/> |
| 2741 | | </backdrop> |
| 2742 | | <backdrop name="lamp57" element="matrixlamp" state="0"> |
| 2743 | | <bounds x="72" y="24" width="7" height="7"/> |
| 2744 | | </backdrop> |
| 2745 | | <backdrop name="lamp58" element="matrixlamp" state="0"> |
| 2746 | | <bounds x="80" y="24" width="7" height="7"/> |
| 2747 | | </backdrop> |
| 2748 | | <backdrop name="lamp59" element="matrixlamp" state="0"> |
| 2749 | | <bounds x="88" y="24" width="7" height="7"/> |
| 2750 | | </backdrop> |
| 2751 | | <backdrop name="lamp60" element="matrixlamp" state="0"> |
| 2752 | | <bounds x="96" y="24" width="7" height="7"/> |
| 2753 | | </backdrop> |
| 2754 | | <backdrop name="lamp61" element="matrixlamp" state="0"> |
| 2755 | | <bounds x="104" y="24" width="7" height="7"/> |
| 2756 | | </backdrop> |
| 2757 | | <backdrop name="lamp62" element="matrixlamp" state="0"> |
| 2758 | | <bounds x="112" y="24" width="7" height="7"/> |
| 2759 | | </backdrop> |
| 2760 | | <backdrop name="lamp63" element="matrixlamp" state="0"> |
| 2761 | | <bounds x="120" y="24" width="7" height="7"/> |
| 2762 | | </backdrop> |
| 2763 | | <backdrop name="lamp64" element="matrixlamp" state="0"> |
| 2764 | | <bounds x="0" y="32" width="7" height="7"/> |
| 2765 | | </backdrop> |
| 2766 | | <backdrop name="lamp65" element="matrixlamp" state="0"> |
| 2767 | | <bounds x="8" y="32" width="7" height="7"/> |
| 2768 | | </backdrop> |
| 2769 | | <backdrop name="lamp66" element="matrixlamp" state="0"> |
| 2770 | | <bounds x="16" y="32" width="7" height="7"/> |
| 2771 | | </backdrop> |
| 2772 | | <backdrop name="lamp67" element="matrixlamp" state="0"> |
| 2773 | | <bounds x="24" y="32" width="7" height="7"/> |
| 2774 | | </backdrop> |
| 2775 | | <backdrop name="lamp68" element="matrixlamp" state="0"> |
| 2776 | | <bounds x="32" y="32" width="7" height="7"/> |
| 2777 | | </backdrop> |
| 2778 | | <backdrop name="lamp69" element="matrixlamp" state="0"> |
| 2779 | | <bounds x="40" y="32" width="7" height="7"/> |
| 2780 | | </backdrop> |
| 2781 | | <backdrop name="lamp70" element="matrixlamp" state="0"> |
| 2782 | | <bounds x="48" y="32" width="7" height="7"/> |
| 2783 | | </backdrop> |
| 2784 | | <backdrop name="lamp71" element="matrixlamp" state="0"> |
| 2785 | | <bounds x="56" y="32" width="7" height="7"/> |
| 2786 | | </backdrop> |
| 2787 | | <backdrop name="lamp72" element="matrixlamp" state="0"> |
| 2788 | | <bounds x="64" y="32" width="7" height="7"/> |
| 2789 | | </backdrop> |
| 2790 | | <backdrop name="lamp73" element="matrixlamp" state="0"> |
| 2791 | | <bounds x="72" y="32" width="7" height="7"/> |
| 2792 | | </backdrop> |
| 2793 | | <backdrop name="lamp74" element="matrixlamp" state="0"> |
| 2794 | | <bounds x="80" y="32" width="7" height="7"/> |
| 2795 | | </backdrop> |
| 2796 | | <backdrop name="lamp75" element="matrixlamp" state="0"> |
| 2797 | | <bounds x="88" y="32" width="7" height="7"/> |
| 2798 | | </backdrop> |
| 2799 | | <backdrop name="lamp76" element="matrixlamp" state="0"> |
| 2800 | | <bounds x="96" y="32" width="7" height="7"/> |
| 2801 | | </backdrop> |
| 2802 | | <backdrop name="lamp77" element="matrixlamp" state="0"> |
| 2803 | | <bounds x="104" y="32" width="7" height="7"/> |
| 2804 | | </backdrop> |
| 2805 | | <backdrop name="lamp78" element="matrixlamp" state="0"> |
| 2806 | | <bounds x="112" y="32" width="7" height="7"/> |
| 2807 | | </backdrop> |
| 2808 | | <backdrop name="lamp79" element="matrixlamp" state="0"> |
| 2809 | | <bounds x="120" y="32" width="7" height="7"/> |
| 2810 | | </backdrop> |
| 2811 | | <backdrop name="lamp80" element="matrixlamp" state="0"> |
| 2812 | | <bounds x="0" y="40" width="7" height="7"/> |
| 2813 | | </backdrop> |
| 2814 | | <backdrop name="lamp81" element="matrixlamp" state="0"> |
| 2815 | | <bounds x="8" y="40" width="7" height="7"/> |
| 2816 | | </backdrop> |
| 2817 | | <backdrop name="lamp82" element="matrixlamp" state="0"> |
| 2818 | | <bounds x="16" y="40" width="7" height="7"/> |
| 2819 | | </backdrop> |
| 2820 | | <backdrop name="lamp83" element="matrixlamp" state="0"> |
| 2821 | | <bounds x="24" y="40" width="7" height="7"/> |
| 2822 | | </backdrop> |
| 2823 | | <backdrop name="lamp84" element="matrixlamp" state="0"> |
| 2824 | | <bounds x="32" y="40" width="7" height="7"/> |
| 2825 | | </backdrop> |
| 2826 | | <backdrop name="lamp85" element="matrixlamp" state="0"> |
| 2827 | | <bounds x="40" y="40" width="7" height="7"/> |
| 2828 | | </backdrop> |
| 2829 | | <backdrop name="lamp86" element="matrixlamp" state="0"> |
| 2830 | | <bounds x="48" y="40" width="7" height="7"/> |
| 2831 | | </backdrop> |
| 2832 | | <backdrop name="lamp87" element="matrixlamp" state="0"> |
| 2833 | | <bounds x="56" y="40" width="7" height="7"/> |
| 2834 | | </backdrop> |
| 2835 | | <backdrop name="lamp88" element="matrixlamp" state="0"> |
| 2836 | | <bounds x="64" y="40" width="7" height="7"/> |
| 2837 | | </backdrop> |
| 2838 | | <backdrop name="lamp89" element="matrixlamp" state="0"> |
| 2839 | | <bounds x="72" y="40" width="7" height="7"/> |
| 2840 | | </backdrop> |
| 2841 | | <backdrop name="lamp90" element="matrixlamp" state="0"> |
| 2842 | | <bounds x="80" y="40" width="7" height="7"/> |
| 2843 | | </backdrop> |
| 2844 | | <backdrop name="lamp91" element="matrixlamp" state="0"> |
| 2845 | | <bounds x="88" y="40" width="7" height="7"/> |
| 2846 | | </backdrop> |
| 2847 | | <backdrop name="lamp92" element="matrixlamp" state="0"> |
| 2848 | | <bounds x="96" y="40" width="7" height="7"/> |
| 2849 | | </backdrop> |
| 2850 | | <backdrop name="lamp93" element="matrixlamp" state="0"> |
| 2851 | | <bounds x="104" y="40" width="7" height="7"/> |
| 2852 | | </backdrop> |
| 2853 | | <backdrop name="lamp94" element="matrixlamp" state="0"> |
| 2854 | | <bounds x="112" y="40" width="7" height="7"/> |
| 2855 | | </backdrop> |
| 2856 | | <backdrop name="lamp95" element="matrixlamp" state="0"> |
| 2857 | | <bounds x="120" y="40" width="7" height="7"/> |
| 2858 | | </backdrop> |
| 2859 | | <backdrop name="lamp96" element="matrixlamp" state="0"> |
| 2860 | | <bounds x="0" y="48" width="7" height="7"/> |
| 2861 | | </backdrop> |
| 2862 | | <backdrop name="lamp97" element="matrixlamp" state="0"> |
| 2863 | | <bounds x="8" y="48" width="7" height="7"/> |
| 2864 | | </backdrop> |
| 2865 | | <backdrop name="lamp98" element="matrixlamp" state="0"> |
| 2866 | | <bounds x="16" y="48" width="7" height="7"/> |
| 2867 | | </backdrop> |
| 2868 | | <backdrop name="lamp99" element="matrixlamp" state="0"> |
| 2869 | | <bounds x="24" y="48" width="7" height="7"/> |
| 2870 | | </backdrop> |
| 2871 | | <backdrop name="lamp100" element="matrixlamp" state="0"> |
| 2872 | | <bounds x="32" y="48" width="7" height="7"/> |
| 2873 | | </backdrop> |
| 2874 | | <backdrop name="lamp101" element="matrixlamp" state="0"> |
| 2875 | | <bounds x="40" y="48" width="7" height="7"/> |
| 2876 | | </backdrop> |
| 2877 | | <backdrop name="lamp102" element="matrixlamp" state="0"> |
| 2878 | | <bounds x="48" y="48" width="7" height="7"/> |
| 2879 | | </backdrop> |
| 2880 | | <backdrop name="lamp103" element="matrixlamp" state="0"> |
| 2881 | | <bounds x="56" y="48" width="7" height="7"/> |
| 2882 | | </backdrop> |
| 2883 | | <backdrop name="lamp104" element="matrixlamp" state="0"> |
| 2884 | | <bounds x="64" y="48" width="7" height="7"/> |
| 2885 | | </backdrop> |
| 2886 | | <backdrop name="lamp105" element="matrixlamp" state="0"> |
| 2887 | | <bounds x="72" y="48" width="7" height="7"/> |
| 2888 | | </backdrop> |
| 2889 | | <backdrop name="lamp106" element="matrixlamp" state="0"> |
| 2890 | | <bounds x="80" y="48" width="7" height="7"/> |
| 2891 | | </backdrop> |
| 2892 | | <backdrop name="lamp107" element="matrixlamp" state="0"> |
| 2893 | | <bounds x="88" y="48" width="7" height="7"/> |
| 2894 | | </backdrop> |
| 2895 | | <backdrop name="lamp108" element="matrixlamp" state="0"> |
| 2896 | | <bounds x="96" y="48" width="7" height="7"/> |
| 2897 | | </backdrop> |
| 2898 | | <backdrop name="lamp109" element="matrixlamp" state="0"> |
| 2899 | | <bounds x="104" y="48" width="7" height="7"/> |
| 2900 | | </backdrop> |
| 2901 | | <backdrop name="lamp110" element="matrixlamp" state="0"> |
| 2902 | | <bounds x="112" y="48" width="7" height="7"/> |
| 2903 | | </backdrop> |
| 2904 | | <backdrop name="lamp111" element="matrixlamp" state="0"> |
| 2905 | | <bounds x="120" y="48" width="7" height="7"/> |
| 2906 | | </backdrop> |
| 2907 | | <backdrop name="lamp112" element="matrixlamp" state="0"> |
| 2908 | | <bounds x="0" y="56" width="7" height="7"/> |
| 2909 | | </backdrop> |
| 2910 | | <backdrop name="lamp113" element="matrixlamp" state="0"> |
| 2911 | | <bounds x="8" y="56" width="7" height="7"/> |
| 2912 | | </backdrop> |
| 2913 | | <backdrop name="lamp114" element="matrixlamp" state="0"> |
| 2914 | | <bounds x="16" y="56" width="7" height="7"/> |
| 2915 | | </backdrop> |
| 2916 | | <backdrop name="lamp115" element="matrixlamp" state="0"> |
| 2917 | | <bounds x="24" y="56" width="7" height="7"/> |
| 2918 | | </backdrop> |
| 2919 | | <backdrop name="lamp116" element="matrixlamp" state="0"> |
| 2920 | | <bounds x="32" y="56" width="7" height="7"/> |
| 2921 | | </backdrop> |
| 2922 | | <backdrop name="lamp117" element="matrixlamp" state="0"> |
| 2923 | | <bounds x="40" y="56" width="7" height="7"/> |
| 2924 | | </backdrop> |
| 2925 | | <backdrop name="lamp118" element="matrixlamp" state="0"> |
| 2926 | | <bounds x="48" y="56" width="7" height="7"/> |
| 2927 | | </backdrop> |
| 2928 | | <backdrop name="lamp119" element="matrixlamp" state="0"> |
| 2929 | | <bounds x="56" y="56" width="7" height="7"/> |
| 2930 | | </backdrop> |
| 2931 | | <backdrop name="lamp120" element="matrixlamp" state="0"> |
| 2932 | | <bounds x="64" y="56" width="7" height="7"/> |
| 2933 | | </backdrop> |
| 2934 | | <backdrop name="lamp121" element="matrixlamp" state="0"> |
| 2935 | | <bounds x="72" y="56" width="7" height="7"/> |
| 2936 | | </backdrop> |
| 2937 | | <backdrop name="lamp122" element="matrixlamp" state="0"> |
| 2938 | | <bounds x="80" y="56" width="7" height="7"/> |
| 2939 | | </backdrop> |
| 2940 | | <backdrop name="lamp123" element="matrixlamp" state="0"> |
| 2941 | | <bounds x="88" y="56" width="7" height="7"/> |
| 2942 | | </backdrop> |
| 2943 | | <backdrop name="lamp124" element="matrixlamp" state="0"> |
| 2944 | | <bounds x="96" y="56" width="7" height="7"/> |
| 2945 | | </backdrop> |
| 2946 | | <backdrop name="lamp125" element="matrixlamp" state="0"> |
| 2947 | | <bounds x="104" y="56" width="7" height="7"/> |
| 2948 | | </backdrop> |
| 2949 | | <backdrop name="lamp126" element="matrixlamp" state="0"> |
| 2950 | | <bounds x="112" y="56" width="7" height="7"/> |
| 2951 | | </backdrop> |
| 2952 | | <backdrop name="lamp127" element="matrixlamp" state="0"> |
| 2953 | | <bounds x="120" y="56" width="7" height="7"/> |
| 2954 | | </backdrop> |
| 2955 | | <backdrop name="lamp128" element="matrixlamp" state="0"> |
| 2956 | | <bounds x="0" y="64" width="7" height="7"/> |
| 2957 | | </backdrop> |
| 2958 | | <backdrop name="lamp129" element="matrixlamp" state="0"> |
| 2959 | | <bounds x="8" y="64" width="7" height="7"/> |
| 2960 | | </backdrop> |
| 2961 | | <backdrop name="lamp130" element="matrixlamp" state="0"> |
| 2962 | | <bounds x="16" y="64" width="7" height="7"/> |
| 2963 | | </backdrop> |
| 2964 | | <backdrop name="lamp131" element="matrixlamp" state="0"> |
| 2965 | | <bounds x="24" y="64" width="7" height="7"/> |
| 2966 | | </backdrop> |
| 2967 | | <backdrop name="lamp132" element="matrixlamp" state="0"> |
| 2968 | | <bounds x="32" y="64" width="7" height="7"/> |
| 2969 | | </backdrop> |
| 2970 | | <backdrop name="lamp133" element="matrixlamp" state="0"> |
| 2971 | | <bounds x="40" y="64" width="7" height="7"/> |
| 2972 | | </backdrop> |
| 2973 | | <backdrop name="lamp134" element="matrixlamp" state="0"> |
| 2974 | | <bounds x="48" y="64" width="7" height="7"/> |
| 2975 | | </backdrop> |
| 2976 | | <backdrop name="lamp135" element="matrixlamp" state="0"> |
| 2977 | | <bounds x="56" y="64" width="7" height="7"/> |
| 2978 | | </backdrop> |
| 2979 | | <backdrop name="lamp136" element="matrixlamp" state="0"> |
| 2980 | | <bounds x="64" y="64" width="7" height="7"/> |
| 2981 | | </backdrop> |
| 2982 | | <backdrop name="lamp137" element="matrixlamp" state="0"> |
| 2983 | | <bounds x="72" y="64" width="7" height="7"/> |
| 2984 | | </backdrop> |
| 2985 | | <backdrop name="lamp138" element="matrixlamp" state="0"> |
| 2986 | | <bounds x="80" y="64" width="7" height="7"/> |
| 2987 | | </backdrop> |
| 2988 | | <backdrop name="lamp139" element="matrixlamp" state="0"> |
| 2989 | | <bounds x="88" y="64" width="7" height="7"/> |
| 2990 | | </backdrop> |
| 2991 | | <backdrop name="lamp140" element="matrixlamp" state="0"> |
| 2992 | | <bounds x="96" y="64" width="7" height="7"/> |
| 2993 | | </backdrop> |
| 2994 | | <backdrop name="lamp141" element="matrixlamp" state="0"> |
| 2995 | | <bounds x="104" y="64" width="7" height="7"/> |
| 2996 | | </backdrop> |
| 2997 | | <backdrop name="lamp142" element="matrixlamp" state="0"> |
| 2998 | | <bounds x="112" y="64" width="7" height="7"/> |
| 2999 | | </backdrop> |
| 3000 | | <backdrop name="lamp143" element="matrixlamp" state="0"> |
| 3001 | | <bounds x="120" y="64" width="7" height="7"/> |
| 3002 | | </backdrop> |
| 3003 | | <backdrop name="lamp144" element="matrixlamp" state="0"> |
| 3004 | | <bounds x="0" y="72" width="7" height="7"/> |
| 3005 | | </backdrop> |
| 3006 | | <backdrop name="lamp145" element="matrixlamp" state="0"> |
| 3007 | | <bounds x="8" y="72" width="7" height="7"/> |
| 3008 | | </backdrop> |
| 3009 | | <backdrop name="lamp146" element="matrixlamp" state="0"> |
| 3010 | | <bounds x="16" y="72" width="7" height="7"/> |
| 3011 | | </backdrop> |
| 3012 | | <backdrop name="lamp147" element="matrixlamp" state="0"> |
| 3013 | | <bounds x="24" y="72" width="7" height="7"/> |
| 3014 | | </backdrop> |
| 3015 | | <backdrop name="lamp148" element="matrixlamp" state="0"> |
| 3016 | | <bounds x="32" y="72" width="7" height="7"/> |
| 3017 | | </backdrop> |
| 3018 | | <backdrop name="lamp149" element="matrixlamp" state="0"> |
| 3019 | | <bounds x="40" y="72" width="7" height="7"/> |
| 3020 | | </backdrop> |
| 3021 | | <backdrop name="lamp150" element="matrixlamp" state="0"> |
| 3022 | | <bounds x="48" y="72" width="7" height="7"/> |
| 3023 | | </backdrop> |
| 3024 | | <backdrop name="lamp151" element="matrixlamp" state="0"> |
| 3025 | | <bounds x="56" y="72" width="7" height="7"/> |
| 3026 | | </backdrop> |
| 3027 | | <backdrop name="lamp152" element="matrixlamp" state="0"> |
| 3028 | | <bounds x="64" y="72" width="7" height="7"/> |
| 3029 | | </backdrop> |
| 3030 | | <backdrop name="lamp153" element="matrixlamp" state="0"> |
| 3031 | | <bounds x="72" y="72" width="7" height="7"/> |
| 3032 | | </backdrop> |
| 3033 | | <backdrop name="lamp154" element="matrixlamp" state="0"> |
| 3034 | | <bounds x="80" y="72" width="7" height="7"/> |
| 3035 | | </backdrop> |
| 3036 | | <backdrop name="lamp155" element="matrixlamp" state="0"> |
| 3037 | | <bounds x="88" y="72" width="7" height="7"/> |
| 3038 | | </backdrop> |
| 3039 | | <backdrop name="lamp156" element="matrixlamp" state="0"> |
| 3040 | | <bounds x="96" y="72" width="7" height="7"/> |
| 3041 | | </backdrop> |
| 3042 | | <backdrop name="lamp157" element="matrixlamp" state="0"> |
| 3043 | | <bounds x="104" y="72" width="7" height="7"/> |
| 3044 | | </backdrop> |
| 3045 | | <backdrop name="lamp158" element="matrixlamp" state="0"> |
| 3046 | | <bounds x="112" y="72" width="7" height="7"/> |
| 3047 | | </backdrop> |
| 3048 | | <backdrop name="lamp159" element="matrixlamp" state="0"> |
| 3049 | | <bounds x="120" y="72" width="7" height="7"/> |
| 3050 | | </backdrop> |
| 3051 | | <backdrop name="lamp160" element="matrixlamp" state="0"> |
| 3052 | | <bounds x="0" y="80" width="7" height="7"/> |
| 3053 | | </backdrop> |
| 3054 | | <backdrop name="lamp161" element="matrixlamp" state="0"> |
| 3055 | | <bounds x="8" y="80" width="7" height="7"/> |
| 3056 | | </backdrop> |
| 3057 | | <backdrop name="lamp162" element="matrixlamp" state="0"> |
| 3058 | | <bounds x="16" y="80" width="7" height="7"/> |
| 3059 | | </backdrop> |
| 3060 | | <backdrop name="lamp163" element="matrixlamp" state="0"> |
| 3061 | | <bounds x="24" y="80" width="7" height="7"/> |
| 3062 | | </backdrop> |
| 3063 | | <backdrop name="lamp164" element="matrixlamp" state="0"> |
| 3064 | | <bounds x="32" y="80" width="7" height="7"/> |
| 3065 | | </backdrop> |
| 3066 | | <backdrop name="lamp165" element="matrixlamp" state="0"> |
| 3067 | | <bounds x="40" y="80" width="7" height="7"/> |
| 3068 | | </backdrop> |
| 3069 | | <backdrop name="lamp166" element="matrixlamp" state="0"> |
| 3070 | | <bounds x="48" y="80" width="7" height="7"/> |
| 3071 | | </backdrop> |
| 3072 | | <backdrop name="lamp167" element="matrixlamp" state="0"> |
| 3073 | | <bounds x="56" y="80" width="7" height="7"/> |
| 3074 | | </backdrop> |
| 3075 | | <backdrop name="lamp168" element="matrixlamp" state="0"> |
| 3076 | | <bounds x="64" y="80" width="7" height="7"/> |
| 3077 | | </backdrop> |
| 3078 | | <backdrop name="lamp169" element="matrixlamp" state="0"> |
| 3079 | | <bounds x="72" y="80" width="7" height="7"/> |
| 3080 | | </backdrop> |
| 3081 | | <backdrop name="lamp170" element="matrixlamp" state="0"> |
| 3082 | | <bounds x="80" y="80" width="7" height="7"/> |
| 3083 | | </backdrop> |
| 3084 | | <backdrop name="lamp171" element="matrixlamp" state="0"> |
| 3085 | | <bounds x="88" y="80" width="7" height="7"/> |
| 3086 | | </backdrop> |
| 3087 | | <backdrop name="lamp172" element="matrixlamp" state="0"> |
| 3088 | | <bounds x="96" y="80" width="7" height="7"/> |
| 3089 | | </backdrop> |
| 3090 | | <backdrop name="lamp173" element="matrixlamp" state="0"> |
| 3091 | | <bounds x="104" y="80" width="7" height="7"/> |
| 3092 | | </backdrop> |
| 3093 | | <backdrop name="lamp174" element="matrixlamp" state="0"> |
| 3094 | | <bounds x="112" y="80" width="7" height="7"/> |
| 3095 | | </backdrop> |
| 3096 | | <backdrop name="lamp175" element="matrixlamp" state="0"> |
| 3097 | | <bounds x="120" y="80" width="7" height="7"/> |
| 3098 | | </backdrop> |
| 3099 | | <backdrop name="lamp176" element="matrixlamp" state="0"> |
| 3100 | | <bounds x="0" y="88" width="7" height="7"/> |
| 3101 | | </backdrop> |
| 3102 | | <backdrop name="lamp177" element="matrixlamp" state="0"> |
| 3103 | | <bounds x="8" y="88" width="7" height="7"/> |
| 3104 | | </backdrop> |
| 3105 | | <backdrop name="lamp178" element="matrixlamp" state="0"> |
| 3106 | | <bounds x="16" y="88" width="7" height="7"/> |
| 3107 | | </backdrop> |
| 3108 | | <backdrop name="lamp179" element="matrixlamp" state="0"> |
| 3109 | | <bounds x="24" y="88" width="7" height="7"/> |
| 3110 | | </backdrop> |
| 3111 | | <backdrop name="lamp180" element="matrixlamp" state="0"> |
| 3112 | | <bounds x="32" y="88" width="7" height="7"/> |
| 3113 | | </backdrop> |
| 3114 | | <backdrop name="lamp181" element="matrixlamp" state="0"> |
| 3115 | | <bounds x="40" y="88" width="7" height="7"/> |
| 3116 | | </backdrop> |
| 3117 | | <backdrop name="lamp182" element="matrixlamp" state="0"> |
| 3118 | | <bounds x="48" y="88" width="7" height="7"/> |
| 3119 | | </backdrop> |
| 3120 | | <backdrop name="lamp183" element="matrixlamp" state="0"> |
| 3121 | | <bounds x="56" y="88" width="7" height="7"/> |
| 3122 | | </backdrop> |
| 3123 | | <backdrop name="lamp184" element="matrixlamp" state="0"> |
| 3124 | | <bounds x="64" y="88" width="7" height="7"/> |
| 3125 | | </backdrop> |
| 3126 | | <backdrop name="lamp185" element="matrixlamp" state="0"> |
| 3127 | | <bounds x="72" y="88" width="7" height="7"/> |
| 3128 | | </backdrop> |
| 3129 | | <backdrop name="lamp186" element="matrixlamp" state="0"> |
| 3130 | | <bounds x="80" y="88" width="7" height="7"/> |
| 3131 | | </backdrop> |
| 3132 | | <backdrop name="lamp187" element="matrixlamp" state="0"> |
| 3133 | | <bounds x="88" y="88" width="7" height="7"/> |
| 3134 | | </backdrop> |
| 3135 | | <backdrop name="lamp188" element="matrixlamp" state="0"> |
| 3136 | | <bounds x="96" y="88" width="7" height="7"/> |
| 3137 | | </backdrop> |
| 3138 | | <backdrop name="lamp189" element="matrixlamp" state="0"> |
| 3139 | | <bounds x="104" y="88" width="7" height="7"/> |
| 3140 | | </backdrop> |
| 3141 | | <backdrop name="lamp190" element="matrixlamp" state="0"> |
| 3142 | | <bounds x="112" y="88" width="7" height="7"/> |
| 3143 | | </backdrop> |
| 3144 | | <backdrop name="lamp191" element="matrixlamp" state="0"> |
| 3145 | | <bounds x="120" y="88" width="7" height="7"/> |
| 3146 | | </backdrop> |
| 3147 | | <backdrop name="lamp192" element="matrixlamp" state="0"> |
| 3148 | | <bounds x="0" y="96" width="7" height="7"/> |
| 3149 | | </backdrop> |
| 3150 | | <backdrop name="lamp193" element="matrixlamp" state="0"> |
| 3151 | | <bounds x="8" y="96" width="7" height="7"/> |
| 3152 | | </backdrop> |
| 3153 | | <backdrop name="lamp194" element="matrixlamp" state="0"> |
| 3154 | | <bounds x="16" y="96" width="7" height="7"/> |
| 3155 | | </backdrop> |
| 3156 | | <backdrop name="lamp195" element="matrixlamp" state="0"> |
| 3157 | | <bounds x="24" y="96" width="7" height="7"/> |
| 3158 | | </backdrop> |
| 3159 | | <backdrop name="lamp196" element="matrixlamp" state="0"> |
| 3160 | | <bounds x="32" y="96" width="7" height="7"/> |
| 3161 | | </backdrop> |
| 3162 | | <backdrop name="lamp197" element="matrixlamp" state="0"> |
| 3163 | | <bounds x="40" y="96" width="7" height="7"/> |
| 3164 | | </backdrop> |
| 3165 | | <backdrop name="lamp198" element="matrixlamp" state="0"> |
| 3166 | | <bounds x="48" y="96" width="7" height="7"/> |
| 3167 | | </backdrop> |
| 3168 | | <backdrop name="lamp199" element="matrixlamp" state="0"> |
| 3169 | | <bounds x="56" y="96" width="7" height="7"/> |
| 3170 | | </backdrop> |
| 3171 | | <backdrop name="lamp200" element="matrixlamp" state="0"> |
| 3172 | | <bounds x="64" y="96" width="7" height="7"/> |
| 3173 | | </backdrop> |
| 3174 | | <backdrop name="lamp201" element="matrixlamp" state="0"> |
| 3175 | | <bounds x="72" y="96" width="7" height="7"/> |
| 3176 | | </backdrop> |
| 3177 | | <backdrop name="lamp202" element="matrixlamp" state="0"> |
| 3178 | | <bounds x="80" y="96" width="7" height="7"/> |
| 3179 | | </backdrop> |
| 3180 | | <backdrop name="lamp203" element="matrixlamp" state="0"> |
| 3181 | | <bounds x="88" y="96" width="7" height="7"/> |
| 3182 | | </backdrop> |
| 3183 | | <backdrop name="lamp204" element="matrixlamp" state="0"> |
| 3184 | | <bounds x="96" y="96" width="7" height="7"/> |
| 3185 | | </backdrop> |
| 3186 | | <backdrop name="lamp205" element="matrixlamp" state="0"> |
| 3187 | | <bounds x="104" y="96" width="7" height="7"/> |
| 3188 | | </backdrop> |
| 3189 | | <backdrop name="lamp206" element="matrixlamp" state="0"> |
| 3190 | | <bounds x="112" y="96" width="7" height="7"/> |
| 3191 | | </backdrop> |
| 3192 | | <backdrop name="lamp207" element="matrixlamp" state="0"> |
| 3193 | | <bounds x="120" y="96" width="7" height="7"/> |
| 3194 | | </backdrop> |
| 3195 | | <backdrop name="lamp208" element="matrixlamp" state="0"> |
| 3196 | | <bounds x="0" y="104" width="7" height="7"/> |
| 3197 | | </backdrop> |
| 3198 | | <backdrop name="lamp209" element="matrixlamp" state="0"> |
| 3199 | | <bounds x="8" y="104" width="7" height="7"/> |
| 3200 | | </backdrop> |
| 3201 | | <backdrop name="lamp210" element="matrixlamp" state="0"> |
| 3202 | | <bounds x="16" y="104" width="7" height="7"/> |
| 3203 | | </backdrop> |
| 3204 | | <backdrop name="lamp211" element="matrixlamp" state="0"> |
| 3205 | | <bounds x="24" y="104" width="7" height="7"/> |
| 3206 | | </backdrop> |
| 3207 | | <backdrop name="lamp212" element="matrixlamp" state="0"> |
| 3208 | | <bounds x="32" y="104" width="7" height="7"/> |
| 3209 | | </backdrop> |
| 3210 | | <backdrop name="lamp213" element="matrixlamp" state="0"> |
| 3211 | | <bounds x="40" y="104" width="7" height="7"/> |
| 3212 | | </backdrop> |
| 3213 | | <backdrop name="lamp214" element="matrixlamp" state="0"> |
| 3214 | | <bounds x="48" y="104" width="7" height="7"/> |
| 3215 | | </backdrop> |
| 3216 | | <backdrop name="lamp215" element="matrixlamp" state="0"> |
| 3217 | | <bounds x="56" y="104" width="7" height="7"/> |
| 3218 | | </backdrop> |
| 3219 | | <backdrop name="lamp216" element="matrixlamp" state="0"> |
| 3220 | | <bounds x="64" y="104" width="7" height="7"/> |
| 3221 | | </backdrop> |
| 3222 | | <backdrop name="lamp217" element="matrixlamp" state="0"> |
| 3223 | | <bounds x="72" y="104" width="7" height="7"/> |
| 3224 | | </backdrop> |
| 3225 | | <backdrop name="lamp218" element="matrixlamp" state="0"> |
| 3226 | | <bounds x="80" y="104" width="7" height="7"/> |
| 3227 | | </backdrop> |
| 3228 | | <backdrop name="lamp219" element="matrixlamp" state="0"> |
| 3229 | | <bounds x="88" y="104" width="7" height="7"/> |
| 3230 | | </backdrop> |
| 3231 | | <backdrop name="lamp220" element="matrixlamp" state="0"> |
| 3232 | | <bounds x="96" y="104" width="7" height="7"/> |
| 3233 | | </backdrop> |
| 3234 | | <backdrop name="lamp221" element="matrixlamp" state="0"> |
| 3235 | | <bounds x="104" y="104" width="7" height="7"/> |
| 3236 | | </backdrop> |
| 3237 | | <backdrop name="lamp222" element="matrixlamp" state="0"> |
| 3238 | | <bounds x="112" y="104" width="7" height="7"/> |
| 3239 | | </backdrop> |
| 3240 | | <backdrop name="lamp223" element="matrixlamp" state="0"> |
| 3241 | | <bounds x="120" y="104" width="7" height="7"/> |
| 3242 | | </backdrop> |
| 3243 | | <backdrop name="lamp224" element="matrixlamp" state="0"> |
| 3244 | | <bounds x="0" y="112" width="7" height="7"/> |
| 3245 | | </backdrop> |
| 3246 | | <backdrop name="lamp225" element="matrixlamp" state="0"> |
| 3247 | | <bounds x="8" y="112" width="7" height="7"/> |
| 3248 | | </backdrop> |
| 3249 | | <backdrop name="lamp226" element="matrixlamp" state="0"> |
| 3250 | | <bounds x="16" y="112" width="7" height="7"/> |
| 3251 | | </backdrop> |
| 3252 | | <backdrop name="lamp227" element="matrixlamp" state="0"> |
| 3253 | | <bounds x="24" y="112" width="7" height="7"/> |
| 3254 | | </backdrop> |
| 3255 | | <backdrop name="lamp228" element="matrixlamp" state="0"> |
| 3256 | | <bounds x="32" y="112" width="7" height="7"/> |
| 3257 | | </backdrop> |
| 3258 | | <backdrop name="lamp229" element="matrixlamp" state="0"> |
| 3259 | | <bounds x="40" y="112" width="7" height="7"/> |
| 3260 | | </backdrop> |
| 3261 | | <backdrop name="lamp230" element="matrixlamp" state="0"> |
| 3262 | | <bounds x="48" y="112" width="7" height="7"/> |
| 3263 | | </backdrop> |
| 3264 | | <backdrop name="lamp231" element="matrixlamp" state="0"> |
| 3265 | | <bounds x="56" y="112" width="7" height="7"/> |
| 3266 | | </backdrop> |
| 3267 | | <backdrop name="lamp232" element="matrixlamp" state="0"> |
| 3268 | | <bounds x="64" y="112" width="7" height="7"/> |
| 3269 | | </backdrop> |
| 3270 | | <backdrop name="lamp233" element="matrixlamp" state="0"> |
| 3271 | | <bounds x="72" y="112" width="7" height="7"/> |
| 3272 | | </backdrop> |
| 3273 | | <backdrop name="lamp234" element="matrixlamp" state="0"> |
| 3274 | | <bounds x="80" y="112" width="7" height="7"/> |
| 3275 | | </backdrop> |
| 3276 | | <backdrop name="lamp235" element="matrixlamp" state="0"> |
| 3277 | | <bounds x="88" y="112" width="7" height="7"/> |
| 3278 | | </backdrop> |
| 3279 | | <backdrop name="lamp236" element="matrixlamp" state="0"> |
| 3280 | | <bounds x="96" y="112" width="7" height="7"/> |
| 3281 | | </backdrop> |
| 3282 | | <backdrop name="lamp237" element="matrixlamp" state="0"> |
| 3283 | | <bounds x="104" y="112" width="7" height="7"/> |
| 3284 | | </backdrop> |
| 3285 | | <backdrop name="lamp238" element="matrixlamp" state="0"> |
| 3286 | | <bounds x="112" y="112" width="7" height="7"/> |
| 3287 | | </backdrop> |
| 3288 | | <backdrop name="lamp239" element="matrixlamp" state="0"> |
| 3289 | | <bounds x="120" y="112" width="7" height="7"/> |
| 3290 | | </backdrop> |
| 3291 | | <backdrop name="lamp240" element="matrixlamp" state="0"> |
| 3292 | | <bounds x="0" y="120" width="7" height="7"/> |
| 3293 | | </backdrop> |
| 3294 | | <backdrop name="lamp241" element="matrixlamp" state="0"> |
| 3295 | | <bounds x="8" y="120" width="7" height="7"/> |
| 3296 | | </backdrop> |
| 3297 | | <backdrop name="lamp242" element="matrixlamp" state="0"> |
| 3298 | | <bounds x="16" y="120" width="7" height="7"/> |
| 3299 | | </backdrop> |
| 3300 | | <backdrop name="lamp243" element="matrixlamp" state="0"> |
| 3301 | | <bounds x="24" y="120" width="7" height="7"/> |
| 3302 | | </backdrop> |
| 3303 | | <backdrop name="lamp244" element="matrixlamp" state="0"> |
| 3304 | | <bounds x="32" y="120" width="7" height="7"/> |
| 3305 | | </backdrop> |
| 3306 | | <backdrop name="lamp245" element="matrixlamp" state="0"> |
| 3307 | | <bounds x="40" y="120" width="7" height="7"/> |
| 3308 | | </backdrop> |
| 3309 | | <backdrop name="lamp246" element="matrixlamp" state="0"> |
| 3310 | | <bounds x="48" y="120" width="7" height="7"/> |
| 3311 | | </backdrop> |
| 3312 | | <backdrop name="lamp247" element="matrixlamp" state="0"> |
| 3313 | | <bounds x="56" y="120" width="7" height="7"/> |
| 3314 | | </backdrop> |
| 3315 | | <backdrop name="lamp248" element="matrixlamp" state="0"> |
| 3316 | | <bounds x="64" y="120" width="7" height="7"/> |
| 3317 | | </backdrop> |
| 3318 | | <backdrop name="lamp249" element="matrixlamp" state="0"> |
| 3319 | | <bounds x="72" y="120" width="7" height="7"/> |
| 3320 | | </backdrop> |
| 3321 | | <backdrop name="lamp250" element="matrixlamp" state="0"> |
| 3322 | | <bounds x="80" y="120" width="7" height="7"/> |
| 3323 | | </backdrop> |
| 3324 | | <backdrop name="lamp251" element="matrixlamp" state="0"> |
| 3325 | | <bounds x="88" y="120" width="7" height="7"/> |
| 3326 | | </backdrop> |
| 3327 | | <backdrop name="lamp252" element="matrixlamp" state="0"> |
| 3328 | | <bounds x="96" y="120" width="7" height="7"/> |
| 3329 | | </backdrop> |
| 3330 | | <backdrop name="lamp253" element="matrixlamp" state="0"> |
| 3331 | | <bounds x="104" y="120" width="7" height="7"/> |
| 3332 | | </backdrop> |
| 3333 | | <backdrop name="lamp254" element="matrixlamp" state="0"> |
| 3334 | | <bounds x="112" y="120" width="7" height="7"/> |
| 3335 | | </backdrop> |
| 3336 | | <backdrop name="lamp255" element="matrixlamp" state="0"> |
| 3337 | | <bounds x="120" y="120" width="7" height="7"/> |
| 3338 | | </backdrop> |
| 3339 | | </view> |
| 3340 | | |
| 3341 | | <view name="AWP Simulated Video (No Artwork)"> |
| 3342 | | <backdrop name="vfd0" element="vfd0" state="0"> |
| 3343 | | <bounds x="10" y="280" width="9" height="17"/> |
| 3344 | | </backdrop> |
| 3345 | | <backdrop name="vfd1" element="vfd0" state="0"> |
| 3346 | | <bounds x="19" y="280" width="9" height="17"/> |
| 3347 | | </backdrop> |
| 3348 | | <backdrop name="vfd2" element="vfd0" state="0"> |
| 3349 | | <bounds x="28" y="280" width="9" height="17"/> |
| 3350 | | </backdrop> |
| 3351 | | <backdrop name="vfd3" element="vfd0" state="0"> |
| 3352 | | <bounds x="37" y="280" width="9" height="17"/> |
| 3353 | | </backdrop> |
| 3354 | | <backdrop name="vfd4" element="vfd0" state="0"> |
| 3355 | | <bounds x="46" y="280" width="9" height="17"/> |
| 3356 | | </backdrop> |
| 3357 | | <backdrop name="vfd5" element="vfd0" state="0"> |
| 3358 | | <bounds x="55" y="280" width="9" height="17"/> |
| 3359 | | </backdrop> |
| 3360 | | <backdrop name="vfd6" element="vfd0" state="0"> |
| 3361 | | <bounds x="64" y="280" width="9" height="17"/> |
| 3362 | | </backdrop> |
| 3363 | | <backdrop name="vfd7" element="vfd0" state="0"> |
| 3364 | | <bounds x="73" y="280" width="9" height="17"/> |
| 3365 | | </backdrop> |
| 3366 | | <backdrop name="vfd8" element="vfd0" state="0"> |
| 3367 | | <bounds x="82" y="280" width="9" height="17"/> |
| 3368 | | </backdrop> |
| 3369 | | <backdrop name="vfd9" element="vfd0" state="0"> |
| 3370 | | <bounds x="91" y="280" width="9" height="17"/> |
| 3371 | | </backdrop> |
| 3372 | | <backdrop name="vfd10" element="vfd0" state="0"> |
| 3373 | | <bounds x="100" y="280" width="9" height="17"/> |
| 3374 | | </backdrop> |
| 3375 | | <backdrop name="vfd11" element="vfd0" state="0"> |
| 3376 | | <bounds x="109" y="280" width="9" height="17"/> |
| 3377 | | </backdrop> |
| 3378 | | <backdrop name="vfd12" element="vfd0" state="0"> |
| 3379 | | <bounds x="118" y="280" width="9" height="17"/> |
| 3380 | | </backdrop> |
| 3381 | | <backdrop name="vfd13" element="vfd0" state="0"> |
| 3382 | | <bounds x="127" y="280" width="9" height="17"/> |
| 3383 | | </backdrop> |
| 3384 | | <backdrop name="vfd14" element="vfd0" state="0"> |
| 3385 | | <bounds x="136" y="280" width="9" height="17"/> |
| 3386 | | </backdrop> |
| 3387 | | <backdrop name="vfd15" element="vfd0" state="0"> |
| 3388 | | <bounds x="145" y="280" width="9" height="17"/> |
| 3389 | | </backdrop> |
| 3390 | | <backdrop name="reel1" element="Steppers" state="0"> |
| 3391 | | <bounds x="10" y="320" width="50" height="50"/> |
| 3392 | | </backdrop> |
| 3393 | | <backdrop name="reel2" element="Steppers" state="0"> |
| 3394 | | <bounds x="60" y="320" width="50" height="50"/> |
| 3395 | | </backdrop> |
| 3396 | | <backdrop name="reel3" element="Steppers" state="0"> |
| 3397 | | <bounds x="110" y="320" width="50" height="50"/> |
| 3398 | | </backdrop> |
| 3399 | | <backdrop name="reel4" element="Steppers" state="0"> |
| 3400 | | <bounds x="160" y="320" width="50" height="50"/> |
| 3401 | | </backdrop> |
| 3402 | | <backdrop name="reel5" element="Steppers" state="0"> |
| 3403 | | <bounds x="220" y="320" width="50" height="50"/> |
| 3404 | | </backdrop> |
| 3405 | | <backdrop name="reel6" element="Steppers" state="0"> |
| 3406 | | <bounds x="280" y="320" width="50" height="50"/> |
| 3407 | | </backdrop> |
| 3408 | | <backdrop name="lamp0" element="matrixlamp" state="0"> |
| 3409 | | <bounds x="0" y="0" width="7" height="7"/> |
| 3410 | | </backdrop> |
| 3411 | | <backdrop name="lamp1" element="matrixlamp" state="0"> |
| 3412 | | <bounds x="8" y="0" width="7" height="7"/> |
| 3413 | | </backdrop> |
| 3414 | | <backdrop name="lamp2" element="matrixlamp" state="0"> |
| 3415 | | <bounds x="16" y="0" width="7" height="7"/> |
| 3416 | | </backdrop> |
| 3417 | | <backdrop name="lamp3" element="matrixlamp" state="0"> |
| 3418 | | <bounds x="24" y="0" width="7" height="7"/> |
| 3419 | | </backdrop> |
| 3420 | | <backdrop name="lamp4" element="matrixlamp" state="0"> |
| 3421 | | <bounds x="32" y="0" width="7" height="7"/> |
| 3422 | | </backdrop> |
| 3423 | | <backdrop name="lamp5" element="matrixlamp" state="0"> |
| 3424 | | <bounds x="40" y="0" width="7" height="7"/> |
| 3425 | | </backdrop> |
| 3426 | | <backdrop name="lamp6" element="matrixlamp" state="0"> |
| 3427 | | <bounds x="48" y="0" width="7" height="7"/> |
| 3428 | | </backdrop> |
| 3429 | | <backdrop name="lamp7" element="matrixlamp" state="0"> |
| 3430 | | <bounds x="56" y="0" width="7" height="7"/> |
| 3431 | | </backdrop> |
| 3432 | | <backdrop name="lamp8" element="matrixlamp" state="0"> |
| 3433 | | <bounds x="64" y="0" width="7" height="7"/> |
| 3434 | | </backdrop> |
| 3435 | | <backdrop name="lamp9" element="matrixlamp" state="0"> |
| 3436 | | <bounds x="72" y="0" width="7" height="7"/> |
| 3437 | | </backdrop> |
| 3438 | | <backdrop name="lamp10" element="matrixlamp" state="0"> |
| 3439 | | <bounds x="80" y="0" width="7" height="7"/> |
| 3440 | | </backdrop> |
| 3441 | | <backdrop name="lamp11" element="matrixlamp" state="0"> |
| 3442 | | <bounds x="88" y="0" width="7" height="7"/> |
| 3443 | | </backdrop> |
| 3444 | | <backdrop name="lamp12" element="matrixlamp" state="0"> |
| 3445 | | <bounds x="96" y="0" width="7" height="7"/> |
| 3446 | | </backdrop> |
| 3447 | | <backdrop name="lamp13" element="matrixlamp" state="0"> |
| 3448 | | <bounds x="104" y="0" width="7" height="7"/> |
| 3449 | | </backdrop> |
| 3450 | | <backdrop name="lamp14" element="matrixlamp" state="0"> |
| 3451 | | <bounds x="112" y="0" width="7" height="7"/> |
| 3452 | | </backdrop> |
| 3453 | | <backdrop name="lamp15" element="matrixlamp" state="0"> |
| 3454 | | <bounds x="120" y="0" width="7" height="7"/> |
| 3455 | | </backdrop> |
| 3456 | | <backdrop name="lamp16" element="matrixlamp" state="0"> |
| 3457 | | <bounds x="0" y="8" width="7" height="7"/> |
| 3458 | | </backdrop> |
| 3459 | | <backdrop name="lamp17" element="matrixlamp" state="0"> |
| 3460 | | <bounds x="8" y="8" width="7" height="7"/> |
| 3461 | | </backdrop> |
| 3462 | | <backdrop name="lamp18" element="matrixlamp" state="0"> |
| 3463 | | <bounds x="16" y="8" width="7" height="7"/> |
| 3464 | | </backdrop> |
| 3465 | | <backdrop name="lamp19" element="matrixlamp" state="0"> |
| 3466 | | <bounds x="24" y="8" width="7" height="7"/> |
| 3467 | | </backdrop> |
| 3468 | | <backdrop name="lamp20" element="matrixlamp" state="0"> |
| 3469 | | <bounds x="32" y="8" width="7" height="7"/> |
| 3470 | | </backdrop> |
| 3471 | | <backdrop name="lamp21" element="matrixlamp" state="0"> |
| 3472 | | <bounds x="40" y="8" width="7" height="7"/> |
| 3473 | | </backdrop> |
| 3474 | | <backdrop name="lamp22" element="matrixlamp" state="0"> |
| 3475 | | <bounds x="48" y="8" width="7" height="7"/> |
| 3476 | | </backdrop> |
| 3477 | | <backdrop name="lamp23" element="matrixlamp" state="0"> |
| 3478 | | <bounds x="56" y="8" width="7" height="7"/> |
| 3479 | | </backdrop> |
| 3480 | | <backdrop name="lamp24" element="matrixlamp" state="0"> |
| 3481 | | <bounds x="64" y="8" width="7" height="7"/> |
| 3482 | | </backdrop> |
| 3483 | | <backdrop name="lamp25" element="matrixlamp" state="0"> |
| 3484 | | <bounds x="72" y="8" width="7" height="7"/> |
| 3485 | | </backdrop> |
| 3486 | | <backdrop name="lamp26" element="matrixlamp" state="0"> |
| 3487 | | <bounds x="80" y="8" width="7" height="7"/> |
| 3488 | | </backdrop> |
| 3489 | | <backdrop name="lamp27" element="matrixlamp" state="0"> |
| 3490 | | <bounds x="88" y="8" width="7" height="7"/> |
| 3491 | | </backdrop> |
| 3492 | | <backdrop name="lamp28" element="matrixlamp" state="0"> |
| 3493 | | <bounds x="96" y="8" width="7" height="7"/> |
| 3494 | | </backdrop> |
| 3495 | | <backdrop name="lamp29" element="matrixlamp" state="0"> |
| 3496 | | <bounds x="104" y="8" width="7" height="7"/> |
| 3497 | | </backdrop> |
| 3498 | | <backdrop name="lamp30" element="matrixlamp" state="0"> |
| 3499 | | <bounds x="112" y="8" width="7" height="7"/> |
| 3500 | | </backdrop> |
| 3501 | | <backdrop name="lamp31" element="matrixlamp" state="0"> |
| 3502 | | <bounds x="120" y="8" width="7" height="7"/> |
| 3503 | | </backdrop> |
| 3504 | | <backdrop name="lamp32" element="matrixlamp" state="0"> |
| 3505 | | <bounds x="0" y="16" width="7" height="7"/> |
| 3506 | | </backdrop> |
| 3507 | | <backdrop name="lamp33" element="matrixlamp" state="0"> |
| 3508 | | <bounds x="8" y="16" width="7" height="7"/> |
| 3509 | | </backdrop> |
| 3510 | | <backdrop name="lamp34" element="matrixlamp" state="0"> |
| 3511 | | <bounds x="16" y="16" width="7" height="7"/> |
| 3512 | | </backdrop> |
| 3513 | | <backdrop name="lamp35" element="matrixlamp" state="0"> |
| 3514 | | <bounds x="24" y="16" width="7" height="7"/> |
| 3515 | | </backdrop> |
| 3516 | | <backdrop name="lamp36" element="matrixlamp" state="0"> |
| 3517 | | <bounds x="32" y="16" width="7" height="7"/> |
| 3518 | | </backdrop> |
| 3519 | | <backdrop name="lamp37" element="matrixlamp" state="0"> |
| 3520 | | <bounds x="40" y="16" width="7" height="7"/> |
| 3521 | | </backdrop> |
| 3522 | | <backdrop name="lamp38" element="matrixlamp" state="0"> |
| 3523 | | <bounds x="48" y="16" width="7" height="7"/> |
| 3524 | | </backdrop> |
| 3525 | | <backdrop name="lamp39" element="matrixlamp" state="0"> |
| 3526 | | <bounds x="56" y="16" width="7" height="7"/> |
| 3527 | | </backdrop> |
| 3528 | | <backdrop name="lamp40" element="matrixlamp" state="0"> |
| 3529 | | <bounds x="64" y="16" width="7" height="7"/> |
| 3530 | | </backdrop> |
| 3531 | | <backdrop name="lamp41" element="matrixlamp" state="0"> |
| 3532 | | <bounds x="72" y="16" width="7" height="7"/> |
| 3533 | | </backdrop> |
| 3534 | | <backdrop name="lamp42" element="matrixlamp" state="0"> |
| 3535 | | <bounds x="80" y="16" width="7" height="7"/> |
| 3536 | | </backdrop> |
| 3537 | | <backdrop name="lamp43" element="matrixlamp" state="0"> |
| 3538 | | <bounds x="88" y="16" width="7" height="7"/> |
| 3539 | | </backdrop> |
| 3540 | | <backdrop name="lamp44" element="matrixlamp" state="0"> |
| 3541 | | <bounds x="96" y="16" width="7" height="7"/> |
| 3542 | | </backdrop> |
| 3543 | | <backdrop name="lamp45" element="matrixlamp" state="0"> |
| 3544 | | <bounds x="104" y="16" width="7" height="7"/> |
| 3545 | | </backdrop> |
| 3546 | | <backdrop name="lamp46" element="matrixlamp" state="0"> |
| 3547 | | <bounds x="112" y="16" width="7" height="7"/> |
| 3548 | | </backdrop> |
| 3549 | | <backdrop name="lamp47" element="matrixlamp" state="0"> |
| 3550 | | <bounds x="120" y="16" width="7" height="7"/> |
| 3551 | | </backdrop> |
| 3552 | | <backdrop name="lamp48" element="matrixlamp" state="0"> |
| 3553 | | <bounds x="0" y="24" width="7" height="7"/> |
| 3554 | | </backdrop> |
| 3555 | | <backdrop name="lamp49" element="matrixlamp" state="0"> |
| 3556 | | <bounds x="8" y="24" width="7" height="7"/> |
| 3557 | | </backdrop> |
| 3558 | | <backdrop name="lamp50" element="matrixlamp" state="0"> |
| 3559 | | <bounds x="16" y="24" width="7" height="7"/> |
| 3560 | | </backdrop> |
| 3561 | | <backdrop name="lamp51" element="matrixlamp" state="0"> |
| 3562 | | <bounds x="24" y="24" width="7" height="7"/> |
| 3563 | | </backdrop> |
| 3564 | | <backdrop name="lamp52" element="matrixlamp" state="0"> |
| 3565 | | <bounds x="32" y="24" width="7" height="7"/> |
| 3566 | | </backdrop> |
| 3567 | | <backdrop name="lamp53" element="matrixlamp" state="0"> |
| 3568 | | <bounds x="40" y="24" width="7" height="7"/> |
| 3569 | | </backdrop> |
| 3570 | | <backdrop name="lamp54" element="matrixlamp" state="0"> |
| 3571 | | <bounds x="48" y="24" width="7" height="7"/> |
| 3572 | | </backdrop> |
| 3573 | | <backdrop name="lamp55" element="matrixlamp" state="0"> |
| 3574 | | <bounds x="56" y="24" width="7" height="7"/> |
| 3575 | | </backdrop> |
| 3576 | | <backdrop name="lamp56" element="matrixlamp" state="0"> |
| 3577 | | <bounds x="64" y="24" width="7" height="7"/> |
| 3578 | | </backdrop> |
| 3579 | | <backdrop name="lamp57" element="matrixlamp" state="0"> |
| 3580 | | <bounds x="72" y="24" width="7" height="7"/> |
| 3581 | | </backdrop> |
| 3582 | | <backdrop name="lamp58" element="matrixlamp" state="0"> |
| 3583 | | <bounds x="80" y="24" width="7" height="7"/> |
| 3584 | | </backdrop> |
| 3585 | | <backdrop name="lamp59" element="matrixlamp" state="0"> |
| 3586 | | <bounds x="88" y="24" width="7" height="7"/> |
| 3587 | | </backdrop> |
| 3588 | | <backdrop name="lamp60" element="matrixlamp" state="0"> |
| 3589 | | <bounds x="96" y="24" width="7" height="7"/> |
| 3590 | | </backdrop> |
| 3591 | | <backdrop name="lamp61" element="matrixlamp" state="0"> |
| 3592 | | <bounds x="104" y="24" width="7" height="7"/> |
| 3593 | | </backdrop> |
| 3594 | | <backdrop name="lamp62" element="matrixlamp" state="0"> |
| 3595 | | <bounds x="112" y="24" width="7" height="7"/> |
| 3596 | | </backdrop> |
| 3597 | | <backdrop name="lamp63" element="matrixlamp" state="0"> |
| 3598 | | <bounds x="120" y="24" width="7" height="7"/> |
| 3599 | | </backdrop> |
| 3600 | | <backdrop name="lamp64" element="matrixlamp" state="0"> |
| 3601 | | <bounds x="0" y="32" width="7" height="7"/> |
| 3602 | | </backdrop> |
| 3603 | | <backdrop name="lamp65" element="matrixlamp" state="0"> |
| 3604 | | <bounds x="8" y="32" width="7" height="7"/> |
| 3605 | | </backdrop> |
| 3606 | | <backdrop name="lamp66" element="matrixlamp" state="0"> |
| 3607 | | <bounds x="16" y="32" width="7" height="7"/> |
| 3608 | | </backdrop> |
| 3609 | | <backdrop name="lamp67" element="matrixlamp" state="0"> |
| 3610 | | <bounds x="24" y="32" width="7" height="7"/> |
| 3611 | | </backdrop> |
| 3612 | | <backdrop name="lamp68" element="matrixlamp" state="0"> |
| 3613 | | <bounds x="32" y="32" width="7" height="7"/> |
| 3614 | | </backdrop> |
| 3615 | | <backdrop name="lamp69" element="matrixlamp" state="0"> |
| 3616 | | <bounds x="40" y="32" width="7" height="7"/> |
| 3617 | | </backdrop> |
| 3618 | | <backdrop name="lamp70" element="matrixlamp" state="0"> |
| 3619 | | <bounds x="48" y="32" width="7" height="7"/> |
| 3620 | | </backdrop> |
| 3621 | | <backdrop name="lamp71" element="matrixlamp" state="0"> |
| 3622 | | <bounds x="56" y="32" width="7" height="7"/> |
| 3623 | | </backdrop> |
| 3624 | | <backdrop name="lamp72" element="matrixlamp" state="0"> |
| 3625 | | <bounds x="64" y="32" width="7" height="7"/> |
| 3626 | | </backdrop> |
| 3627 | | <backdrop name="lamp73" element="matrixlamp" state="0"> |
| 3628 | | <bounds x="72" y="32" width="7" height="7"/> |
| 3629 | | </backdrop> |
| 3630 | | <backdrop name="lamp74" element="matrixlamp" state="0"> |
| 3631 | | <bounds x="80" y="32" width="7" height="7"/> |
| 3632 | | </backdrop> |
| 3633 | | <backdrop name="lamp75" element="matrixlamp" state="0"> |
| 3634 | | <bounds x="88" y="32" width="7" height="7"/> |
| 3635 | | </backdrop> |
| 3636 | | <backdrop name="lamp76" element="matrixlamp" state="0"> |
| 3637 | | <bounds x="96" y="32" width="7" height="7"/> |
| 3638 | | </backdrop> |
| 3639 | | <backdrop name="lamp77" element="matrixlamp" state="0"> |
| 3640 | | <bounds x="104" y="32" width="7" height="7"/> |
| 3641 | | </backdrop> |
| 3642 | | <backdrop name="lamp78" element="matrixlamp" state="0"> |
| 3643 | | <bounds x="112" y="32" width="7" height="7"/> |
| 3644 | | </backdrop> |
| 3645 | | <backdrop name="lamp79" element="matrixlamp" state="0"> |
| 3646 | | <bounds x="120" y="32" width="7" height="7"/> |
| 3647 | | </backdrop> |
| 3648 | | <backdrop name="lamp80" element="matrixlamp" state="0"> |
| 3649 | | <bounds x="0" y="40" width="7" height="7"/> |
| 3650 | | </backdrop> |
| 3651 | | <backdrop name="lamp81" element="matrixlamp" state="0"> |
| 3652 | | <bounds x="8" y="40" width="7" height="7"/> |
| 3653 | | </backdrop> |
| 3654 | | <backdrop name="lamp82" element="matrixlamp" state="0"> |
| 3655 | | <bounds x="16" y="40" width="7" height="7"/> |
| 3656 | | </backdrop> |
| 3657 | | <backdrop name="lamp83" element="matrixlamp" state="0"> |
| 3658 | | <bounds x="24" y="40" width="7" height="7"/> |
| 3659 | | </backdrop> |
| 3660 | | <backdrop name="lamp84" element="matrixlamp" state="0"> |
| 3661 | | <bounds x="32" y="40" width="7" height="7"/> |
| 3662 | | </backdrop> |
| 3663 | | <backdrop name="lamp85" element="matrixlamp" state="0"> |
| 3664 | | <bounds x="40" y="40" width="7" height="7"/> |
| 3665 | | </backdrop> |
| 3666 | | <backdrop name="lamp86" element="matrixlamp" state="0"> |
| 3667 | | <bounds x="48" y="40" width="7" height="7"/> |
| 3668 | | </backdrop> |
| 3669 | | <backdrop name="lamp87" element="matrixlamp" state="0"> |
| 3670 | | <bounds x="56" y="40" width="7" height="7"/> |
| 3671 | | </backdrop> |
| 3672 | | <backdrop name="lamp88" element="matrixlamp" state="0"> |
| 3673 | | <bounds x="64" y="40" width="7" height="7"/> |
| 3674 | | </backdrop> |
| 3675 | | <backdrop name="lamp89" element="matrixlamp" state="0"> |
| 3676 | | <bounds x="72" y="40" width="7" height="7"/> |
| 3677 | | </backdrop> |
| 3678 | | <backdrop name="lamp90" element="matrixlamp" state="0"> |
| 3679 | | <bounds x="80" y="40" width="7" height="7"/> |
| 3680 | | </backdrop> |
| 3681 | | <backdrop name="lamp91" element="matrixlamp" state="0"> |
| 3682 | | <bounds x="88" y="40" width="7" height="7"/> |
| 3683 | | </backdrop> |
| 3684 | | <backdrop name="lamp92" element="matrixlamp" state="0"> |
| 3685 | | <bounds x="96" y="40" width="7" height="7"/> |
| 3686 | | </backdrop> |
| 3687 | | <backdrop name="lamp93" element="matrixlamp" state="0"> |
| 3688 | | <bounds x="104" y="40" width="7" height="7"/> |
| 3689 | | </backdrop> |
| 3690 | | <backdrop name="lamp94" element="matrixlamp" state="0"> |
| 3691 | | <bounds x="112" y="40" width="7" height="7"/> |
| 3692 | | </backdrop> |
| 3693 | | <backdrop name="lamp95" element="matrixlamp" state="0"> |
| 3694 | | <bounds x="120" y="40" width="7" height="7"/> |
| 3695 | | </backdrop> |
| 3696 | | <backdrop name="lamp96" element="matrixlamp" state="0"> |
| 3697 | | <bounds x="0" y="48" width="7" height="7"/> |
| 3698 | | </backdrop> |
| 3699 | | <backdrop name="lamp97" element="matrixlamp" state="0"> |
| 3700 | | <bounds x="8" y="48" width="7" height="7"/> |
| 3701 | | </backdrop> |
| 3702 | | <backdrop name="lamp98" element="matrixlamp" state="0"> |
| 3703 | | <bounds x="16" y="48" width="7" height="7"/> |
| 3704 | | </backdrop> |
| 3705 | | <backdrop name="lamp99" element="matrixlamp" state="0"> |
| 3706 | | <bounds x="24" y="48" width="7" height="7"/> |
| 3707 | | </backdrop> |
| 3708 | | <backdrop name="lamp100" element="matrixlamp" state="0"> |
| 3709 | | <bounds x="32" y="48" width="7" height="7"/> |
| 3710 | | </backdrop> |
| 3711 | | <backdrop name="lamp101" element="matrixlamp" state="0"> |
| 3712 | | <bounds x="40" y="48" width="7" height="7"/> |
| 3713 | | </backdrop> |
| 3714 | | <backdrop name="lamp102" element="matrixlamp" state="0"> |
| 3715 | | <bounds x="48" y="48" width="7" height="7"/> |
| 3716 | | </backdrop> |
| 3717 | | <backdrop name="lamp103" element="matrixlamp" state="0"> |
| 3718 | | <bounds x="56" y="48" width="7" height="7"/> |
| 3719 | | </backdrop> |
| 3720 | | <backdrop name="lamp104" element="matrixlamp" state="0"> |
| 3721 | | <bounds x="64" y="48" width="7" height="7"/> |
| 3722 | | </backdrop> |
| 3723 | | <backdrop name="lamp105" element="matrixlamp" state="0"> |
| 3724 | | <bounds x="72" y="48" width="7" height="7"/> |
| 3725 | | </backdrop> |
| 3726 | | <backdrop name="lamp106" element="matrixlamp" state="0"> |
| 3727 | | <bounds x="80" y="48" width="7" height="7"/> |
| 3728 | | </backdrop> |
| 3729 | | <backdrop name="lamp107" element="matrixlamp" state="0"> |
| 3730 | | <bounds x="88" y="48" width="7" height="7"/> |
| 3731 | | </backdrop> |
| 3732 | | <backdrop name="lamp108" element="matrixlamp" state="0"> |
| 3733 | | <bounds x="96" y="48" width="7" height="7"/> |
| 3734 | | </backdrop> |
| 3735 | | <backdrop name="lamp109" element="matrixlamp" state="0"> |
| 3736 | | <bounds x="104" y="48" width="7" height="7"/> |
| 3737 | | </backdrop> |
| 3738 | | <backdrop name="lamp110" element="matrixlamp" state="0"> |
| 3739 | | <bounds x="112" y="48" width="7" height="7"/> |
| 3740 | | </backdrop> |
| 3741 | | <backdrop name="lamp111" element="matrixlamp" state="0"> |
| 3742 | | <bounds x="120" y="48" width="7" height="7"/> |
| 3743 | | </backdrop> |
| 3744 | | <backdrop name="lamp112" element="matrixlamp" state="0"> |
| 3745 | | <bounds x="0" y="56" width="7" height="7"/> |
| 3746 | | </backdrop> |
| 3747 | | <backdrop name="lamp113" element="matrixlamp" state="0"> |
| 3748 | | <bounds x="8" y="56" width="7" height="7"/> |
| 3749 | | </backdrop> |
| 3750 | | <backdrop name="lamp114" element="matrixlamp" state="0"> |
| 3751 | | <bounds x="16" y="56" width="7" height="7"/> |
| 3752 | | </backdrop> |
| 3753 | | <backdrop name="lamp115" element="matrixlamp" state="0"> |
| 3754 | | <bounds x="24" y="56" width="7" height="7"/> |
| 3755 | | </backdrop> |
| 3756 | | <backdrop name="lamp116" element="matrixlamp" state="0"> |
| 3757 | | <bounds x="32" y="56" width="7" height="7"/> |
| 3758 | | </backdrop> |
| 3759 | | <backdrop name="lamp117" element="matrixlamp" state="0"> |
| 3760 | | <bounds x="40" y="56" width="7" height="7"/> |
| 3761 | | </backdrop> |
| 3762 | | <backdrop name="lamp118" element="matrixlamp" state="0"> |
| 3763 | | <bounds x="48" y="56" width="7" height="7"/> |
| 3764 | | </backdrop> |
| 3765 | | <backdrop name="lamp119" element="matrixlamp" state="0"> |
| 3766 | | <bounds x="56" y="56" width="7" height="7"/> |
| 3767 | | </backdrop> |
| 3768 | | <backdrop name="lamp120" element="matrixlamp" state="0"> |
| 3769 | | <bounds x="64" y="56" width="7" height="7"/> |
| 3770 | | </backdrop> |
| 3771 | | <backdrop name="lamp121" element="matrixlamp" state="0"> |
| 3772 | | <bounds x="72" y="56" width="7" height="7"/> |
| 3773 | | </backdrop> |
| 3774 | | <backdrop name="lamp122" element="matrixlamp" state="0"> |
| 3775 | | <bounds x="80" y="56" width="7" height="7"/> |
| 3776 | | </backdrop> |
| 3777 | | <backdrop name="lamp123" element="matrixlamp" state="0"> |
| 3778 | | <bounds x="88" y="56" width="7" height="7"/> |
| 3779 | | </backdrop> |
| 3780 | | <backdrop name="lamp124" element="matrixlamp" state="0"> |
| 3781 | | <bounds x="96" y="56" width="7" height="7"/> |
| 3782 | | </backdrop> |
| 3783 | | <backdrop name="lamp125" element="matrixlamp" state="0"> |
| 3784 | | <bounds x="104" y="56" width="7" height="7"/> |
| 3785 | | </backdrop> |
| 3786 | | <backdrop name="lamp126" element="matrixlamp" state="0"> |
| 3787 | | <bounds x="112" y="56" width="7" height="7"/> |
| 3788 | | </backdrop> |
| 3789 | | <backdrop name="lamp127" element="matrixlamp" state="0"> |
| 3790 | | <bounds x="120" y="56" width="7" height="7"/> |
| 3791 | | </backdrop> |
| 3792 | | <backdrop name="lamp128" element="matrixlamp" state="0"> |
| 3793 | | <bounds x="0" y="64" width="7" height="7"/> |
| 3794 | | </backdrop> |
| 3795 | | <backdrop name="lamp129" element="matrixlamp" state="0"> |
| 3796 | | <bounds x="8" y="64" width="7" height="7"/> |
| 3797 | | </backdrop> |
| 3798 | | <backdrop name="lamp130" element="matrixlamp" state="0"> |
| 3799 | | <bounds x="16" y="64" width="7" height="7"/> |
| 3800 | | </backdrop> |
| 3801 | | <backdrop name="lamp131" element="matrixlamp" state="0"> |
| 3802 | | <bounds x="24" y="64" width="7" height="7"/> |
| 3803 | | </backdrop> |
| 3804 | | <backdrop name="lamp132" element="matrixlamp" state="0"> |
| 3805 | | <bounds x="32" y="64" width="7" height="7"/> |
| 3806 | | </backdrop> |
| 3807 | | <backdrop name="lamp133" element="matrixlamp" state="0"> |
| 3808 | | <bounds x="40" y="64" width="7" height="7"/> |
| 3809 | | </backdrop> |
| 3810 | | <backdrop name="lamp134" element="matrixlamp" state="0"> |
| 3811 | | <bounds x="48" y="64" width="7" height="7"/> |
| 3812 | | </backdrop> |
| 3813 | | <backdrop name="lamp135" element="matrixlamp" state="0"> |
| 3814 | | <bounds x="56" y="64" width="7" height="7"/> |
| 3815 | | </backdrop> |
| 3816 | | <backdrop name="lamp136" element="matrixlamp" state="0"> |
| 3817 | | <bounds x="64" y="64" width="7" height="7"/> |
| 3818 | | </backdrop> |
| 3819 | | <backdrop name="lamp137" element="matrixlamp" state="0"> |
| 3820 | | <bounds x="72" y="64" width="7" height="7"/> |
| 3821 | | </backdrop> |
| 3822 | | <backdrop name="lamp138" element="matrixlamp" state="0"> |
| 3823 | | <bounds x="80" y="64" width="7" height="7"/> |
| 3824 | | </backdrop> |
| 3825 | | <backdrop name="lamp139" element="matrixlamp" state="0"> |
| 3826 | | <bounds x="88" y="64" width="7" height="7"/> |
| 3827 | | </backdrop> |
| 3828 | | <backdrop name="lamp140" element="matrixlamp" state="0"> |
| 3829 | | <bounds x="96" y="64" width="7" height="7"/> |
| 3830 | | </backdrop> |
| 3831 | | <backdrop name="lamp141" element="matrixlamp" state="0"> |
| 3832 | | <bounds x="104" y="64" width="7" height="7"/> |
| 3833 | | </backdrop> |
| 3834 | | <backdrop name="lamp142" element="matrixlamp" state="0"> |
| 3835 | | <bounds x="112" y="64" width="7" height="7"/> |
| 3836 | | </backdrop> |
| 3837 | | <backdrop name="lamp143" element="matrixlamp" state="0"> |
| 3838 | | <bounds x="120" y="64" width="7" height="7"/> |
| 3839 | | </backdrop> |
| 3840 | | <backdrop name="lamp144" element="matrixlamp" state="0"> |
| 3841 | | <bounds x="0" y="72" width="7" height="7"/> |
| 3842 | | </backdrop> |
| 3843 | | <backdrop name="lamp145" element="matrixlamp" state="0"> |
| 3844 | | <bounds x="8" y="72" width="7" height="7"/> |
| 3845 | | </backdrop> |
| 3846 | | <backdrop name="lamp146" element="matrixlamp" state="0"> |
| 3847 | | <bounds x="16" y="72" width="7" height="7"/> |
| 3848 | | </backdrop> |
| 3849 | | <backdrop name="lamp147" element="matrixlamp" state="0"> |
| 3850 | | <bounds x="24" y="72" width="7" height="7"/> |
| 3851 | | </backdrop> |
| 3852 | | <backdrop name="lamp148" element="matrixlamp" state="0"> |
| 3853 | | <bounds x="32" y="72" width="7" height="7"/> |
| 3854 | | </backdrop> |
| 3855 | | <backdrop name="lamp149" element="matrixlamp" state="0"> |
| 3856 | | <bounds x="40" y="72" width="7" height="7"/> |
| 3857 | | </backdrop> |
| 3858 | | <backdrop name="lamp150" element="matrixlamp" state="0"> |
| 3859 | | <bounds x="48" y="72" width="7" height="7"/> |
| 3860 | | </backdrop> |
| 3861 | | <backdrop name="lamp151" element="matrixlamp" state="0"> |
| 3862 | | <bounds x="56" y="72" width="7" height="7"/> |
| 3863 | | </backdrop> |
| 3864 | | <backdrop name="lamp152" element="matrixlamp" state="0"> |
| 3865 | | <bounds x="64" y="72" width="7" height="7"/> |
| 3866 | | </backdrop> |
| 3867 | | <backdrop name="lamp153" element="matrixlamp" state="0"> |
| 3868 | | <bounds x="72" y="72" width="7" height="7"/> |
| 3869 | | </backdrop> |
| 3870 | | <backdrop name="lamp154" element="matrixlamp" state="0"> |
| 3871 | | <bounds x="80" y="72" width="7" height="7"/> |
| 3872 | | </backdrop> |
| 3873 | | <backdrop name="lamp155" element="matrixlamp" state="0"> |
| 3874 | | <bounds x="88" y="72" width="7" height="7"/> |
| 3875 | | </backdrop> |
| 3876 | | <backdrop name="lamp156" element="matrixlamp" state="0"> |
| 3877 | | <bounds x="96" y="72" width="7" height="7"/> |
| 3878 | | </backdrop> |
| 3879 | | <backdrop name="lamp157" element="matrixlamp" state="0"> |
| 3880 | | <bounds x="104" y="72" width="7" height="7"/> |
| 3881 | | </backdrop> |
| 3882 | | <backdrop name="lamp158" element="matrixlamp" state="0"> |
| 3883 | | <bounds x="112" y="72" width="7" height="7"/> |
| 3884 | | </backdrop> |
| 3885 | | <backdrop name="lamp159" element="matrixlamp" state="0"> |
| 3886 | | <bounds x="120" y="72" width="7" height="7"/> |
| 3887 | | </backdrop> |
| 3888 | | <backdrop name="lamp160" element="matrixlamp" state="0"> |
| 3889 | | <bounds x="0" y="80" width="7" height="7"/> |
| 3890 | | </backdrop> |
| 3891 | | <backdrop name="lamp161" element="matrixlamp" state="0"> |
| 3892 | | <bounds x="8" y="80" width="7" height="7"/> |
| 3893 | | </backdrop> |
| 3894 | | <backdrop name="lamp162" element="matrixlamp" state="0"> |
| 3895 | | <bounds x="16" y="80" width="7" height="7"/> |
| 3896 | | </backdrop> |
| 3897 | | <backdrop name="lamp163" element="matrixlamp" state="0"> |
| 3898 | | <bounds x="24" y="80" width="7" height="7"/> |
| 3899 | | </backdrop> |
| 3900 | | <backdrop name="lamp164" element="matrixlamp" state="0"> |
| 3901 | | <bounds x="32" y="80" width="7" height="7"/> |
| 3902 | | </backdrop> |
| 3903 | | <backdrop name="lamp165" element="matrixlamp" state="0"> |
| 3904 | | <bounds x="40" y="80" width="7" height="7"/> |
| 3905 | | </backdrop> |
| 3906 | | <backdrop name="lamp166" element="matrixlamp" state="0"> |
| 3907 | | <bounds x="48" y="80" width="7" height="7"/> |
| 3908 | | </backdrop> |
| 3909 | | <backdrop name="lamp167" element="matrixlamp" state="0"> |
| 3910 | | <bounds x="56" y="80" width="7" height="7"/> |
| 3911 | | </backdrop> |
| 3912 | | <backdrop name="lamp168" element="matrixlamp" state="0"> |
| 3913 | | <bounds x="64" y="80" width="7" height="7"/> |
| 3914 | | </backdrop> |
| 3915 | | <backdrop name="lamp169" element="matrixlamp" state="0"> |
| 3916 | | <bounds x="72" y="80" width="7" height="7"/> |
| 3917 | | </backdrop> |
| 3918 | | <backdrop name="lamp170" element="matrixlamp" state="0"> |
| 3919 | | <bounds x="80" y="80" width="7" height="7"/> |
| 3920 | | </backdrop> |
| 3921 | | <backdrop name="lamp171" element="matrixlamp" state="0"> |
| 3922 | | <bounds x="88" y="80" width="7" height="7"/> |
| 3923 | | </backdrop> |
| 3924 | | <backdrop name="lamp172" element="matrixlamp" state="0"> |
| 3925 | | <bounds x="96" y="80" width="7" height="7"/> |
| 3926 | | </backdrop> |
| 3927 | | <backdrop name="lamp173" element="matrixlamp" state="0"> |
| 3928 | | <bounds x="104" y="80" width="7" height="7"/> |
| 3929 | | </backdrop> |
| 3930 | | <backdrop name="lamp174" element="matrixlamp" state="0"> |
| 3931 | | <bounds x="112" y="80" width="7" height="7"/> |
| 3932 | | </backdrop> |
| 3933 | | <backdrop name="lamp175" element="matrixlamp" state="0"> |
| 3934 | | <bounds x="120" y="80" width="7" height="7"/> |
| 3935 | | </backdrop> |
| 3936 | | <backdrop name="lamp176" element="matrixlamp" state="0"> |
| 3937 | | <bounds x="0" y="88" width="7" height="7"/> |
| 3938 | | </backdrop> |
| 3939 | | <backdrop name="lamp177" element="matrixlamp" state="0"> |
| 3940 | | <bounds x="8" y="88" width="7" height="7"/> |
| 3941 | | </backdrop> |
| 3942 | | <backdrop name="lamp178" element="matrixlamp" state="0"> |
| 3943 | | <bounds x="16" y="88" width="7" height="7"/> |
| 3944 | | </backdrop> |
| 3945 | | <backdrop name="lamp179" element="matrixlamp" state="0"> |
| 3946 | | <bounds x="24" y="88" width="7" height="7"/> |
| 3947 | | </backdrop> |
| 3948 | | <backdrop name="lamp180" element="matrixlamp" state="0"> |
| 3949 | | <bounds x="32" y="88" width="7" height="7"/> |
| 3950 | | </backdrop> |
| 3951 | | <backdrop name="lamp181" element="matrixlamp" state="0"> |
| 3952 | | <bounds x="40" y="88" width="7" height="7"/> |
| 3953 | | </backdrop> |
| 3954 | | <backdrop name="lamp182" element="matrixlamp" state="0"> |
| 3955 | | <bounds x="48" y="88" width="7" height="7"/> |
| 3956 | | </backdrop> |
| 3957 | | <backdrop name="lamp183" element="matrixlamp" state="0"> |
| 3958 | | <bounds x="56" y="88" width="7" height="7"/> |
| 3959 | | </backdrop> |
| 3960 | | <backdrop name="lamp184" element="matrixlamp" state="0"> |
| 3961 | | <bounds x="64" y="88" width="7" height="7"/> |
| 3962 | | </backdrop> |
| 3963 | | <backdrop name="lamp185" element="matrixlamp" state="0"> |
| 3964 | | <bounds x="72" y="88" width="7" height="7"/> |
| 3965 | | </backdrop> |
| 3966 | | <backdrop name="lamp186" element="matrixlamp" state="0"> |
| 3967 | | <bounds x="80" y="88" width="7" height="7"/> |
| 3968 | | </backdrop> |
| 3969 | | <backdrop name="lamp187" element="matrixlamp" state="0"> |
| 3970 | | <bounds x="88" y="88" width="7" height="7"/> |
| 3971 | | </backdrop> |
| 3972 | | <backdrop name="lamp188" element="matrixlamp" state="0"> |
| 3973 | | <bounds x="96" y="88" width="7" height="7"/> |
| 3974 | | </backdrop> |
| 3975 | | <backdrop name="lamp189" element="matrixlamp" state="0"> |
| 3976 | | <bounds x="104" y="88" width="7" height="7"/> |
| 3977 | | </backdrop> |
| 3978 | | <backdrop name="lamp190" element="matrixlamp" state="0"> |
| 3979 | | <bounds x="112" y="88" width="7" height="7"/> |
| 3980 | | </backdrop> |
| 3981 | | <backdrop name="lamp191" element="matrixlamp" state="0"> |
| 3982 | | <bounds x="120" y="88" width="7" height="7"/> |
| 3983 | | </backdrop> |
| 3984 | | <backdrop name="lamp192" element="matrixlamp" state="0"> |
| 3985 | | <bounds x="0" y="96" width="7" height="7"/> |
| 3986 | | </backdrop> |
| 3987 | | <backdrop name="lamp193" element="matrixlamp" state="0"> |
| 3988 | | <bounds x="8" y="96" width="7" height="7"/> |
| 3989 | | </backdrop> |
| 3990 | | <backdrop name="lamp194" element="matrixlamp" state="0"> |
| 3991 | | <bounds x="16" y="96" width="7" height="7"/> |
| 3992 | | </backdrop> |
| 3993 | | <backdrop name="lamp195" element="matrixlamp" state="0"> |
| 3994 | | <bounds x="24" y="96" width="7" height="7"/> |
| 3995 | | </backdrop> |
| 3996 | | <backdrop name="lamp196" element="matrixlamp" state="0"> |
| 3997 | | <bounds x="32" y="96" width="7" height="7"/> |
| 3998 | | </backdrop> |
| 3999 | | <backdrop name="lamp197" element="matrixlamp" state="0"> |
| 4000 | | <bounds x="40" y="96" width="7" height="7"/> |
| 4001 | | </backdrop> |
| 4002 | | <backdrop name="lamp198" element="matrixlamp" state="0"> |
| 4003 | | <bounds x="48" y="96" width="7" height="7"/> |
| 4004 | | </backdrop> |
| 4005 | | <backdrop name="lamp199" element="matrixlamp" state="0"> |
| 4006 | | <bounds x="56" y="96" width="7" height="7"/> |
| 4007 | | </backdrop> |
| 4008 | | <backdrop name="lamp200" element="matrixlamp" state="0"> |
| 4009 | | <bounds x="64" y="96" width="7" height="7"/> |
| 4010 | | </backdrop> |
| 4011 | | <backdrop name="lamp201" element="matrixlamp" state="0"> |
| 4012 | | <bounds x="72" y="96" width="7" height="7"/> |
| 4013 | | </backdrop> |
| 4014 | | <backdrop name="lamp202" element="matrixlamp" state="0"> |
| 4015 | | <bounds x="80" y="96" width="7" height="7"/> |
| 4016 | | </backdrop> |
| 4017 | | <backdrop name="lamp203" element="matrixlamp" state="0"> |
| 4018 | | <bounds x="88" y="96" width="7" height="7"/> |
| 4019 | | </backdrop> |
| 4020 | | <backdrop name="lamp204" element="matrixlamp" state="0"> |
| 4021 | | <bounds x="96" y="96" width="7" height="7"/> |
| 4022 | | </backdrop> |
| 4023 | | <backdrop name="lamp205" element="matrixlamp" state="0"> |
| 4024 | | <bounds x="104" y="96" width="7" height="7"/> |
| 4025 | | </backdrop> |
| 4026 | | <backdrop name="lamp206" element="matrixlamp" state="0"> |
| 4027 | | <bounds x="112" y="96" width="7" height="7"/> |
| 4028 | | </backdrop> |
| 4029 | | <backdrop name="lamp207" element="matrixlamp" state="0"> |
| 4030 | | <bounds x="120" y="96" width="7" height="7"/> |
| 4031 | | </backdrop> |
| 4032 | | <backdrop name="lamp208" element="matrixlamp" state="0"> |
| 4033 | | <bounds x="0" y="104" width="7" height="7"/> |
| 4034 | | </backdrop> |
| 4035 | | <backdrop name="lamp209" element="matrixlamp" state="0"> |
| 4036 | | <bounds x="8" y="104" width="7" height="7"/> |
| 4037 | | </backdrop> |
| 4038 | | <backdrop name="lamp210" element="matrixlamp" state="0"> |
| 4039 | | <bounds x="16" y="104" width="7" height="7"/> |
| 4040 | | </backdrop> |
| 4041 | | <backdrop name="lamp211" element="matrixlamp" state="0"> |
| 4042 | | <bounds x="24" y="104" width="7" height="7"/> |
| 4043 | | </backdrop> |
| 4044 | | <backdrop name="lamp212" element="matrixlamp" state="0"> |
| 4045 | | <bounds x="32" y="104" width="7" height="7"/> |
| 4046 | | </backdrop> |
| 4047 | | <backdrop name="lamp213" element="matrixlamp" state="0"> |
| 4048 | | <bounds x="40" y="104" width="7" height="7"/> |
| 4049 | | </backdrop> |
| 4050 | | <backdrop name="lamp214" element="matrixlamp" state="0"> |
| 4051 | | <bounds x="48" y="104" width="7" height="7"/> |
| 4052 | | </backdrop> |
| 4053 | | <backdrop name="lamp215" element="matrixlamp" state="0"> |
| 4054 | | <bounds x="56" y="104" width="7" height="7"/> |
| 4055 | | </backdrop> |
| 4056 | | <backdrop name="lamp216" element="matrixlamp" state="0"> |
| 4057 | | <bounds x="64" y="104" width="7" height="7"/> |
| 4058 | | </backdrop> |
| 4059 | | <backdrop name="lamp217" element="matrixlamp" state="0"> |
| 4060 | | <bounds x="72" y="104" width="7" height="7"/> |
| 4061 | | </backdrop> |
| 4062 | | <backdrop name="lamp218" element="matrixlamp" state="0"> |
| 4063 | | <bounds x="80" y="104" width="7" height="7"/> |
| 4064 | | </backdrop> |
| 4065 | | <backdrop name="lamp219" element="matrixlamp" state="0"> |
| 4066 | | <bounds x="88" y="104" width="7" height="7"/> |
| 4067 | | </backdrop> |
| 4068 | | <backdrop name="lamp220" element="matrixlamp" state="0"> |
| 4069 | | <bounds x="96" y="104" width="7" height="7"/> |
| 4070 | | </backdrop> |
| 4071 | | <backdrop name="lamp221" element="matrixlamp" state="0"> |
| 4072 | | <bounds x="104" y="104" width="7" height="7"/> |
| 4073 | | </backdrop> |
| 4074 | | <backdrop name="lamp222" element="matrixlamp" state="0"> |
| 4075 | | <bounds x="112" y="104" width="7" height="7"/> |
| 4076 | | </backdrop> |
| 4077 | | <backdrop name="lamp223" element="matrixlamp" state="0"> |
| 4078 | | <bounds x="120" y="104" width="7" height="7"/> |
| 4079 | | </backdrop> |
| 4080 | | <backdrop name="lamp224" element="matrixlamp" state="0"> |
| 4081 | | <bounds x="0" y="112" width="7" height="7"/> |
| 4082 | | </backdrop> |
| 4083 | | <backdrop name="lamp225" element="matrixlamp" state="0"> |
| 4084 | | <bounds x="8" y="112" width="7" height="7"/> |
| 4085 | | </backdrop> |
| 4086 | | <backdrop name="lamp226" element="matrixlamp" state="0"> |
| 4087 | | <bounds x="16" y="112" width="7" height="7"/> |
| 4088 | | </backdrop> |
| 4089 | | <backdrop name="lamp227" element="matrixlamp" state="0"> |
| 4090 | | <bounds x="24" y="112" width="7" height="7"/> |
| 4091 | | </backdrop> |
| 4092 | | <backdrop name="lamp228" element="matrixlamp" state="0"> |
| 4093 | | <bounds x="32" y="112" width="7" height="7"/> |
| 4094 | | </backdrop> |
| 4095 | | <backdrop name="lamp229" element="matrixlamp" state="0"> |
| 4096 | | <bounds x="40" y="112" width="7" height="7"/> |
| 4097 | | </backdrop> |
| 4098 | | <backdrop name="lamp230" element="matrixlamp" state="0"> |
| 4099 | | <bounds x="48" y="112" width="7" height="7"/> |
| 4100 | | </backdrop> |
| 4101 | | <backdrop name="lamp231" element="matrixlamp" state="0"> |
| 4102 | | <bounds x="56" y="112" width="7" height="7"/> |
| 4103 | | </backdrop> |
| 4104 | | <backdrop name="lamp232" element="matrixlamp" state="0"> |
| 4105 | | <bounds x="64" y="112" width="7" height="7"/> |
| 4106 | | </backdrop> |
| 4107 | | <backdrop name="lamp233" element="matrixlamp" state="0"> |
| 4108 | | <bounds x="72" y="112" width="7" height="7"/> |
| 4109 | | </backdrop> |
| 4110 | | <backdrop name="lamp234" element="matrixlamp" state="0"> |
| 4111 | | <bounds x="80" y="112" width="7" height="7"/> |
| 4112 | | </backdrop> |
| 4113 | | <backdrop name="lamp235" element="matrixlamp" state="0"> |
| 4114 | | <bounds x="88" y="112" width="7" height="7"/> |
| 4115 | | </backdrop> |
| 4116 | | <backdrop name="lamp236" element="matrixlamp" state="0"> |
| 4117 | | <bounds x="96" y="112" width="7" height="7"/> |
| 4118 | | </backdrop> |
| 4119 | | <backdrop name="lamp237" element="matrixlamp" state="0"> |
| 4120 | | <bounds x="104" y="112" width="7" height="7"/> |
| 4121 | | </backdrop> |
| 4122 | | <backdrop name="lamp238" element="matrixlamp" state="0"> |
| 4123 | | <bounds x="112" y="112" width="7" height="7"/> |
| 4124 | | </backdrop> |
| 4125 | | <backdrop name="lamp239" element="matrixlamp" state="0"> |
| 4126 | | <bounds x="120" y="112" width="7" height="7"/> |
| 4127 | | </backdrop> |
| 4128 | | <backdrop name="lamp240" element="matrixlamp" state="0"> |
| 4129 | | <bounds x="0" y="120" width="7" height="7"/> |
| 4130 | | </backdrop> |
| 4131 | | <backdrop name="lamp241" element="matrixlamp" state="0"> |
| 4132 | | <bounds x="8" y="120" width="7" height="7"/> |
| 4133 | | </backdrop> |
| 4134 | | <backdrop name="lamp242" element="matrixlamp" state="0"> |
| 4135 | | <bounds x="16" y="120" width="7" height="7"/> |
| 4136 | | </backdrop> |
| 4137 | | <backdrop name="lamp243" element="matrixlamp" state="0"> |
| 4138 | | <bounds x="24" y="120" width="7" height="7"/> |
| 4139 | | </backdrop> |
| 4140 | | <backdrop name="lamp244" element="matrixlamp" state="0"> |
| 4141 | | <bounds x="32" y="120" width="7" height="7"/> |
| 4142 | | </backdrop> |
| 4143 | | <backdrop name="lamp245" element="matrixlamp" state="0"> |
| 4144 | | <bounds x="40" y="120" width="7" height="7"/> |
| 4145 | | </backdrop> |
| 4146 | | <backdrop name="lamp246" element="matrixlamp" state="0"> |
| 4147 | | <bounds x="48" y="120" width="7" height="7"/> |
| 4148 | | </backdrop> |
| 4149 | | <backdrop name="lamp247" element="matrixlamp" state="0"> |
| 4150 | | <bounds x="56" y="120" width="7" height="7"/> |
| 4151 | | </backdrop> |
| 4152 | | <backdrop name="lamp248" element="matrixlamp" state="0"> |
| 4153 | | <bounds x="64" y="120" width="7" height="7"/> |
| 4154 | | </backdrop> |
| 4155 | | <backdrop name="lamp249" element="matrixlamp" state="0"> |
| 4156 | | <bounds x="72" y="120" width="7" height="7"/> |
| 4157 | | </backdrop> |
| 4158 | | <backdrop name="lamp250" element="matrixlamp" state="0"> |
| 4159 | | <bounds x="80" y="120" width="7" height="7"/> |
| 4160 | | </backdrop> |
| 4161 | | <backdrop name="lamp251" element="matrixlamp" state="0"> |
| 4162 | | <bounds x="88" y="120" width="7" height="7"/> |
| 4163 | | </backdrop> |
| 4164 | | <backdrop name="lamp252" element="matrixlamp" state="0"> |
| 4165 | | <bounds x="96" y="120" width="7" height="7"/> |
| 4166 | | </backdrop> |
| 4167 | | <backdrop name="lamp253" element="matrixlamp" state="0"> |
| 4168 | | <bounds x="104" y="120" width="7" height="7"/> |
| 4169 | | </backdrop> |
| 4170 | | <backdrop name="lamp254" element="matrixlamp" state="0"> |
| 4171 | | <bounds x="112" y="120" width="7" height="7"/> |
| 4172 | | </backdrop> |
| 4173 | | <backdrop name="lamp255" element="matrixlamp" state="0"> |
| 4174 | | <bounds x="120" y="120" width="7" height="7"/> |
| 4175 | | </backdrop> |
| 4176 | | </view> |
| 4177 | | |
| 4178 | | <view name="Adder 2 Output Only (400:280, No Artwork)"> |
| 4179 | | <screen index="0"> |
| 4180 | | <bounds left="0" top="0" right="400" bottom="280" /> |
| 4181 | | </screen> |
| 4182 | | </view> |
| 4183 | | </mamelayout> |
| 4184 | | |
src/mame/drivers/mpu4.c
| r11224 | r11225 | |
| 4 | 4 | This is the core driver, no video specific stuff should go in here. |
| 5 | 5 | This driver holds all the mechanical games. |
| 6 | 6 | |
| 7 | | 01-2011: Adding the missing 'OKI' sound card, and documented it. |
| 8 | | 05-2009: Miscellaneous lamp fixes, based on data from FME Forever. |
| 7 | 04-2011: More accurate gamball code, fixed ROM banking (Project Amber), added BwB CHR simulator (Amber) |
| 8 | This is still a hard coded system, but significantly different to Barcrest's version. |
| 9 | 03-2011: Lamp timing fixes, support for all known expansion cards added. |
| 10 | 01-2011: Adding the missing 'OKI' sound card, and documented it, but needs 6376 rewrite. |
| 9 | 11 | 09-2007: Haze: Added Deal 'Em video support. |
| 10 | 12 | 03-08-2007: J Wallace: Removed audio filter for now, since sound is more accurate without them. |
| 11 | 13 | Connect 4 now has the right sound. |
| 12 | 14 | 03-07-2007: J Wallace: Several major changes, including input relabelling, and system timer improvements. |
| 13 | 15 | 06-2007: Atari Ace, many cleanups and optimizations of I/O routines |
| 14 | 16 | 09-06-2007: J Wallace: Fixed 50Hz detection circuit. |
| 15 | | 09-04-2007: J Wallace: Corrected a lot of out of date info in this revision history. |
| 16 | | Revisionism, if you will. |
| 17 | 17 | 17-02-2007: J Wallace: Added Deal 'Em - still needs some work. |
| 18 | 18 | 10-02-2007: J Wallace: Improved input timing. |
| 19 | 19 | 30-01-2007: J Wallace: Characteriser rewritten to run the 'extra' data needed by some games. |
| r11224 | r11225 | |
| 256 | 256 | static TIMER_CALLBACK( ic24_timeout ); |
| 257 | 257 | |
| 258 | 258 | |
| 259 | | static const UINT8 reel_mux_table[8]= {0,4,2,6,1,5,3,7};//include 7, although I don't think it's used |
| 259 | static const UINT8 reel_mux_table[8]= {0,4,2,6,1,5,3,7};//include 7, although I don't think it's used, this is basically a wire swap |
| 260 | 260 | static const UINT8 reel_mux_table7[8]= {3,1,5,6,4,2,0,7}; |
| 261 | 261 | |
| 262 | static const UINT8 bwb_chr_table_common[10]= {0x00,0x04,0x04,0x0c,0x0c,0x1c,0x14,0x2c,0x5c,0x2c}; |
| 263 | |
| 262 | 264 | #define STANDARD_REEL 0 /* As originally designed 3/4 reels*/ |
| 263 | 265 | #define FIVE_REEL_5TO8 1 /* Interfaces to meter port, allows some mechanical metering, but there is significant 'bounce' in the extra reel*/ |
| 264 | 266 | #define FIVE_REEL_8TO5 2 /* Mounted backwards for space reasons, but different board*/ |
| r11224 | r11225 | |
| 293 | 295 | UINT8 response; |
| 294 | 296 | }; |
| 295 | 297 | |
| 298 | struct bwb_chr_table//dynamic populated table |
| 299 | { |
| 300 | UINT8 response; |
| 301 | }; |
| 302 | |
| 296 | 303 | /* Video stuff */ |
| 297 | 304 | struct ef9369_t |
| 298 | 305 | { |
| r11224 | r11225 | |
| 358 | 365 | int m_card_live; |
| 359 | 366 | int m_led_extender; |
| 360 | 367 | int m_bwb_bank; |
| 368 | int m_chr_state; |
| 369 | int m_chr_counter; |
| 370 | int m_chr_value; |
| 371 | int m_bwb_return; |
| 372 | int m_pageval; |
| 373 | int m_pageset; |
| 361 | 374 | int m_hopper; |
| 362 | 375 | const mpu4_chr_table* m_current_chr_table; |
| 363 | | |
| 376 | const bwb_chr_table* m_bwb_chr_table1; |
| 364 | 377 | //Video |
| 365 | 378 | UINT8 m_m6840_irq_state; |
| 366 | 379 | UINT8 m_m6850_irq_state; |
| r11224 | r11225 | |
| 608 | 621 | for (reel = 0; reel < 6; reel++) |
| 609 | 622 | { |
| 610 | 623 | stepper_reset_position(reel); |
| 611 | | if (stepper_optic_state(reel)) pattern |= 1<<reel; |
| 624 | if(!state->m_reel_mux) |
| 625 | { |
| 626 | if (stepper_optic_state(reel)) pattern |= 1<<reel; |
| 627 | } |
| 612 | 628 | } |
| 613 | 629 | state->m_optic_pattern = pattern; |
| 614 | 630 | } |
| r11224 | r11225 | |
| 633 | 649 | state->m_IC23G2B = 0; |
| 634 | 650 | |
| 635 | 651 | state->m_prot_col = 0; |
| 652 | state->m_chr_counter = 0; |
| 653 | state->m_chr_value = 0; |
| 636 | 654 | |
| 637 | | /* init rom bank, some games don't set this */ |
| 655 | /* init rom bank, some games don't set this, and will assume bank 0,set 0 */ |
| 638 | 656 | { |
| 639 | 657 | UINT8 *rom = machine.region("maincpu")->base(); |
| 640 | 658 | |
| r11224 | r11225 | |
| 643 | 661 | memory_set_bank(machine, "bank1",0); |
| 644 | 662 | machine.device("maincpu")->reset(); |
| 645 | 663 | } |
| 646 | | |
| 647 | 664 | } |
| 648 | 665 | |
| 649 | 666 | |
| r11224 | r11225 | |
| 680 | 697 | } |
| 681 | 698 | } |
| 682 | 699 | |
| 683 | | /* Bankswitching */ |
| 700 | /* Bankswitching |
| 701 | The MOD 4 ROM cards are set up to handle 8 separate ROM pages, arranged as 2 sets of 4. |
| 702 | The bankswitch selects which of the 4 pages in the set is active, while the bankset |
| 703 | switches between the sets. |
| 704 | It appears that the cards were originally intended to be used in a 'half' page setup, |
| 705 | where the two halves of the ROM space could be mixed and matched as appropriate. |
| 706 | However, there is no evidence to suggest this was ever implemented. |
| 707 | The controls for it exist however, in the form of the Soundboard PIA CB2 pin, which is |
| 708 | used in some cabinets instead of the main control. |
| 709 | */ |
| 684 | 710 | static WRITE8_HANDLER( bankswitch_w ) |
| 685 | 711 | { |
| 686 | | memory_set_bank(space->machine(), "bank1",data & 0x07); |
| 712 | mpu4_state *state = space->machine().driver_data<mpu4_state>(); |
| 713 | state->m_pageval=(data&0x03); |
| 714 | memory_set_bank(space->machine(), "bank1",state->m_pageval + (state->m_pageset?4:0)); |
| 687 | 715 | } |
| 688 | 716 | |
| 689 | 717 | |
| r11224 | r11225 | |
| 693 | 721 | } |
| 694 | 722 | |
| 695 | 723 | |
| 724 | static WRITE8_HANDLER( bankset_w ) |
| 725 | { |
| 726 | mpu4_state *state = space->machine().driver_data<mpu4_state>(); |
| 727 | state->m_pageval=(data - 2);//writes 2 and 3, to represent 0 and 1 - a hangover from the half page design? |
| 728 | memory_set_bank(space->machine(), "bank1",state->m_pageval + (state->m_pageset?4:0)); |
| 729 | } |
| 730 | |
| 731 | |
| 696 | 732 | /* IC2 6840 PTM handler */ |
| 697 | 733 | static WRITE8_DEVICE_HANDLER( ic2_o1_callback ) |
| 698 | 734 | { |
| r11224 | r11225 | |
| 810 | 846 | static WRITE_LINE_DEVICE_HANDLER( pia_ic3_cb2_w ) |
| 811 | 847 | { |
| 812 | 848 | LOG_IC3(("%s: IC3 PIA Write CB (alpha reset), %02X\n",device->machine().describe_context(),state)); |
| 813 | | |
| 849 | // DM Data pin A |
| 814 | 850 | if ( state ) ROC10937_reset(0); |
| 815 | 851 | ROC10937_draw_16seg(0); |
| 816 | 852 | } |
| r11224 | r11225 | |
| 1117 | 1153 | } |
| 1118 | 1154 | |
| 1119 | 1155 | if (mame_stricmp(device->machine().system().name, "m_gmball") == 0) |
| 1120 | | { |
| 1156 | { |
| 1121 | 1157 | /* The 'Gamball' device is a unique piece of mechanical equipment, designed to |
| 1122 | 1158 | provide a truly fair hi-lo gamble for an AWP machine. Functionally, it consists of |
| 1123 | 1159 | a ping-pong ball or similar enclosed in the machine's backbox, on a platform with 12 |
| 1124 | 1160 | holes. When the low 4 bytes of AUX1 are triggered, this fires the ball out from the |
| 1125 | | hole it's currently in, to land in another. Landing in the same hole cause the machine to |
| 1161 | hole it's currently in, to land in another. Landing in the same hole causes the machine to |
| 1126 | 1162 | refire the ball. The ball detection is done by the high 4 bytes of AUX1. |
| 1127 | | Here we call the MAME RNG, clamping it to 16 values, with the unused |
| 1128 | | values effectively asking the machine to 'roll again'. We then trigger the switches corresponding to |
| 1129 | | the correct number. This appears to be the best way of making the game fair, short of simulating |
| 1130 | | the physics of a bouncing ball ;)*/ |
| 1163 | Here we call the MAME RNG, once to pick a row, once to pick from the four pockets within it. We |
| 1164 | then trigger the switches corresponding to the correct number. This appears to be the best way |
| 1165 | of making the game fair, short of simulating the physics of a bouncing ball ;)*/ |
| 1131 | 1166 | if (data & 0x0f) |
| 1132 | 1167 | { |
| 1133 | | switch (device->machine().rand() & 0xf) |
| 1168 | switch (device->machine().rand() & 0x2) |
| 1134 | 1169 | { |
| 1135 | | case 0x00: |
| 1136 | | default: |
| 1137 | | break;// stay where we are if we roll a zero, or roll more than 12 |
| 1138 | | case 0x01: |
| 1139 | | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1140 | | state->m_aux1_input|= 0x50; |
| 1141 | | break; |
| 1142 | | case 0x02: |
| 1143 | | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1144 | | state->m_aux1_input|= 0x90; |
| 1145 | | break; |
| 1146 | | case 0x03: |
| 1147 | | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1148 | | state->m_aux1_input|= 0x20; |
| 1149 | | break; |
| 1150 | | case 0x04: |
| 1151 | | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1152 | | state->m_aux1_input|= 0xb0; |
| 1153 | | break; |
| 1154 | | case 0x05: |
| 1155 | | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1156 | | state->m_aux1_input|= 0x00; |
| 1157 | | break; |
| 1158 | | case 0x06: |
| 1159 | | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1160 | | state->m_aux1_input|= 0x30; |
| 1161 | | break; |
| 1162 | | case 0x07: |
| 1163 | | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1164 | | state->m_aux1_input|= 0xa0; |
| 1165 | | break; |
| 1166 | | case 0x08: |
| 1167 | | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1168 | | state->m_aux1_input|= 0xd0; |
| 1169 | | break; |
| 1170 | | case 0x09: |
| 1171 | | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1172 | | state->m_aux1_input|= 0xd0; |
| 1173 | | break; |
| 1174 | | case 0x0a: |
| 1175 | | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1176 | | state->m_aux1_input|= 0x10; |
| 1177 | | break; |
| 1178 | | case 0xb: |
| 1179 | | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1180 | | state->m_aux1_input|= 0x80; |
| 1181 | | break; |
| 1182 | | case 0xc: |
| 1183 | | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1184 | | state->m_aux1_input|= 0x40; |
| 1185 | | break; |
| 1170 | case 0x00: //Top row |
| 1171 | { |
| 1172 | switch (device->machine().rand() & 0x3) |
| 1173 | { |
| 1174 | case 0x00: //7 |
| 1175 | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1176 | state->m_aux1_input|= 0xa0; |
| 1177 | break; |
| 1178 | case 0x01://4 |
| 1179 | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1180 | state->m_aux1_input|= 0xb0; |
| 1181 | break; |
| 1182 | case 0x02://9 |
| 1183 | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1184 | state->m_aux1_input|= 0xc0; |
| 1185 | break; |
| 1186 | case 0x03://8 |
| 1187 | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1188 | state->m_aux1_input|= 0xd0; |
| 1189 | break; |
| 1190 | } |
| 1191 | } |
| 1192 | case 0x01: //Middle row - note switches don't match pattern |
| 1193 | { |
| 1194 | switch (device->machine().rand() & 0x3) |
| 1195 | { |
| 1196 | case 0x00://12 |
| 1197 | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1198 | state->m_aux1_input|= 0x40; |
| 1199 | break; |
| 1200 | case 0x01://1 |
| 1201 | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1202 | state->m_aux1_input|= 0x50; |
| 1203 | break; |
| 1204 | case 0x02://11 |
| 1205 | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1206 | state->m_aux1_input|= 0x80; |
| 1207 | break; |
| 1208 | case 0x03://2 |
| 1209 | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1210 | state->m_aux1_input|= 0x90; |
| 1211 | break; |
| 1212 | } |
| 1213 | } |
| 1214 | case 0x02: //Bottom row |
| 1215 | { |
| 1216 | switch (device->machine().rand() & 0x3) |
| 1217 | { |
| 1218 | case 0x00://5 |
| 1219 | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1220 | state->m_aux1_input|= 0x00; |
| 1221 | break; |
| 1222 | case 0x01://10 |
| 1223 | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1224 | state->m_aux1_input|= 0x10; |
| 1225 | break; |
| 1226 | case 0x02://3 |
| 1227 | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1228 | state->m_aux1_input|= 0x20; |
| 1229 | break; |
| 1230 | case 0x03://6 |
| 1231 | state->m_aux1_input = (state->m_aux1_input & 0x0f); |
| 1232 | state->m_aux1_input|= 0x30; |
| 1233 | break; |
| 1234 | } |
| 1235 | } |
| 1186 | 1236 | } |
| 1187 | 1237 | } |
| 1188 | 1238 | } |
| r11224 | r11225 | |
| 1574 | 1624 | mpu4_state *drvstate = device->machine().driver_data<mpu4_state>(); |
| 1575 | 1625 | LOG_IC8(("%s: IC8 PIA write CB2 (alpha clock) %02X\n", device->machine().describe_context(), state & 0xFF)); |
| 1576 | 1626 | |
| 1627 | // DM Data pin B |
| 1577 | 1628 | if ( !drvstate->m_alpha_clock && (state) ) |
| 1578 | 1629 | { |
| 1579 | 1630 | ROC10937_shift_data(0, drvstate->m_alpha_data_line&0x01?0:1); |
| r11224 | r11225 | |
| 1663 | 1714 | //Some BWB games use this to drive the bankswitching |
| 1664 | 1715 | if (mstate->m_bwb_bank) |
| 1665 | 1716 | { |
| 1666 | | memory_set_bank(device->machine(), "bank1",state); |
| 1717 | mstate->m_pageval=state; |
| 1718 | |
| 1719 | memory_set_bank(device->machine(), "bank1",mstate->m_pageval + (mstate->m_pageset?4:0)); |
| 1667 | 1720 | } |
| 1668 | 1721 | } |
| 1669 | 1722 | |
| r11224 | r11225 | |
| 1771 | 1824 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_START1) |
| 1772 | 1825 | |
| 1773 | 1826 | PORT_START("DIL1") |
| 1774 | | PORT_DIPNAME( 0x01, 0x00, "DIL101" ) PORT_DIPLOCATION("DIL1:01") |
| 1827 | PORT_DIPNAME( 0x80, 0x00, "DIL101" ) PORT_DIPLOCATION("DIL1:01") |
| 1775 | 1828 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1776 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1777 | | PORT_DIPNAME( 0x02, 0x00, "DIL102" ) PORT_DIPLOCATION("DIL1:02") |
| 1829 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1830 | PORT_DIPNAME( 0x40, 0x00, "DIL102" ) PORT_DIPLOCATION("DIL1:02") |
| 1778 | 1831 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1779 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1780 | | PORT_DIPNAME( 0x04, 0x00, "DIL103" ) PORT_DIPLOCATION("DIL1:03") |
| 1832 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1833 | PORT_DIPNAME( 0x20, 0x00, "DIL103" ) PORT_DIPLOCATION("DIL1:03") |
| 1781 | 1834 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1782 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1783 | | PORT_DIPNAME( 0x08, 0x00, "DIL104" ) PORT_DIPLOCATION("DIL1:04") |
| 1835 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1836 | PORT_DIPNAME( 0x10, 0x00, "DIL104" ) PORT_DIPLOCATION("DIL1:04") |
| 1784 | 1837 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1838 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1839 | PORT_DIPNAME( 0x08, 0x00, "DIL105" ) PORT_DIPLOCATION("DIL1:05") |
| 1840 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1785 | 1841 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 1786 | | PORT_DIPNAME( 0x10, 0x00, "DIL105" ) PORT_DIPLOCATION("DIL1:05") |
| 1842 | PORT_DIPNAME( 0x04, 0x00, "DIL106" ) PORT_DIPLOCATION("DIL1:06") |
| 1787 | 1843 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1788 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1789 | | PORT_DIPNAME( 0x20, 0x00, "DIL106" ) PORT_DIPLOCATION("DIL1:06") |
| 1844 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1845 | PORT_DIPNAME( 0x02, 0x00, "DIL107" ) PORT_DIPLOCATION("DIL1:07") |
| 1790 | 1846 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1791 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1792 | | PORT_DIPNAME( 0x40, 0x00, "DIL107" ) PORT_DIPLOCATION("DIL1:07") |
| 1847 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1848 | PORT_DIPNAME( 0x01, 0x00, "DIL108" ) PORT_DIPLOCATION("DIL1:08") |
| 1793 | 1849 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1794 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1795 | | PORT_DIPNAME( 0x80, 0x00, "DIL108" ) PORT_DIPLOCATION("DIL1:08") |
| 1796 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1797 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1850 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1798 | 1851 | |
| 1799 | 1852 | PORT_START("DIL2") |
| 1800 | | PORT_DIPNAME( 0x01, 0x00, "DIL201" ) PORT_DIPLOCATION("DIL2:01") |
| 1853 | PORT_DIPNAME( 0x80, 0x00, "DIL201" ) PORT_DIPLOCATION("DIL2:01") |
| 1801 | 1854 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1802 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1803 | | PORT_DIPNAME( 0x02, 0x00, "DIL202" ) PORT_DIPLOCATION("DIL2:02") |
| 1855 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1856 | PORT_DIPNAME( 0x40, 0x00, "DIL202" ) PORT_DIPLOCATION("DIL2:02") |
| 1804 | 1857 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1805 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1806 | | PORT_DIPNAME( 0x04, 0x00, "DIL203" ) PORT_DIPLOCATION("DIL2:03") |
| 1858 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1859 | PORT_DIPNAME( 0x20, 0x00, "DIL203" ) PORT_DIPLOCATION("DIL2:03") |
| 1807 | 1860 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1808 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1809 | | PORT_DIPNAME( 0x08, 0x00, "DIL204" ) PORT_DIPLOCATION("DIL2:04") |
| 1861 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1862 | PORT_DIPNAME( 0x10, 0x00, "DIL204" ) PORT_DIPLOCATION("DIL2:04") |
| 1810 | 1863 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1864 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1865 | PORT_DIPNAME( 0x08, 0x00, "DIL205" ) PORT_DIPLOCATION("DIL2:05") |
| 1866 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1811 | 1867 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 1812 | | PORT_DIPNAME( 0x10, 0x00, "DIL205" ) PORT_DIPLOCATION("DIL2:05") |
| 1868 | PORT_DIPNAME( 0x04, 0x00, "DIL206" ) PORT_DIPLOCATION("DIL2:06") |
| 1813 | 1869 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1814 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1815 | | PORT_DIPNAME( 0x20, 0x00, "DIL206" ) PORT_DIPLOCATION("DIL2:06") |
| 1870 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1871 | PORT_DIPNAME( 0x02, 0x00, "DIL207" ) PORT_DIPLOCATION("DIL2:07") |
| 1816 | 1872 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1817 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1818 | | PORT_DIPNAME( 0x40, 0x00, "DIL207" ) PORT_DIPLOCATION("DIL2:07") |
| 1873 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1874 | PORT_DIPNAME( 0x01, 0x00, "DIL208" ) PORT_DIPLOCATION("DIL2:08") |
| 1819 | 1875 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1820 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1821 | | PORT_DIPNAME( 0x80, 0x00, "DIL208" ) PORT_DIPLOCATION("DIL2:08") |
| 1822 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1823 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1876 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1824 | 1877 | |
| 1825 | 1878 | PORT_START("AUX1") |
| 1826 | 1879 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("0") |
| r11224 | r11225 | |
| 1886 | 1939 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Drop") |
| 1887 | 1940 | |
| 1888 | 1941 | PORT_START("DIL1") |
| 1889 | | PORT_DIPNAME( 0x01, 0x00, "DIL101" ) PORT_DIPLOCATION("DIL1:01") |
| 1942 | PORT_DIPNAME( 0x80, 0x00, "DIL101" ) PORT_DIPLOCATION("DIL1:01") |
| 1890 | 1943 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1891 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1892 | | PORT_DIPNAME( 0x02, 0x00, "DIL102" ) PORT_DIPLOCATION("DIL1:02") |
| 1944 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1945 | PORT_DIPNAME( 0x40, 0x00, "DIL102" ) PORT_DIPLOCATION("DIL1:02") |
| 1893 | 1946 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1894 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1895 | | PORT_DIPNAME( 0x04, 0x00, "DIL103" ) PORT_DIPLOCATION("DIL1:03") |
| 1947 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1948 | PORT_DIPNAME( 0x20, 0x00, "DIL103" ) PORT_DIPLOCATION("DIL1:03") |
| 1896 | 1949 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1897 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1898 | | PORT_DIPNAME( 0x08, 0x00, "DIL104" ) PORT_DIPLOCATION("DIL1:04") |
| 1950 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1951 | PORT_DIPNAME( 0x10, 0x00, "DIL104" ) PORT_DIPLOCATION("DIL1:04") |
| 1899 | 1952 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1953 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1954 | PORT_DIPNAME( 0x08, 0x00, "DIL105" ) PORT_DIPLOCATION("DIL1:05") |
| 1955 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1900 | 1956 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 1901 | | PORT_DIPNAME( 0x10, 0x00, "DIL105" ) PORT_DIPLOCATION("DIL1:05") |
| 1957 | PORT_DIPNAME( 0x04, 0x00, "DIL106" ) PORT_DIPLOCATION("DIL1:06") |
| 1902 | 1958 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1903 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1904 | | PORT_DIPNAME( 0x20, 0x00, "DIL106" ) PORT_DIPLOCATION("DIL1:06") |
| 1959 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1960 | PORT_DIPNAME( 0x02, 0x00, "DIL107" ) PORT_DIPLOCATION("DIL1:07") |
| 1905 | 1961 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1906 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1907 | | PORT_DIPNAME( 0x40, 0x00, "DIL107" ) PORT_DIPLOCATION("DIL1:07") |
| 1962 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1963 | PORT_DIPNAME( 0x01, 0x00, "DIL108" ) PORT_DIPLOCATION("DIL1:08") |
| 1908 | 1964 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1909 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1910 | | PORT_DIPNAME( 0x80, 0x00, "Invert Alpha?" ) PORT_DIPLOCATION("DIL1:08") |
| 1911 | | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 1912 | | PORT_DIPSETTING( 0x80, DEF_STR( Yes ) ) |
| 1965 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1913 | 1966 | |
| 1914 | 1967 | PORT_START("DIL2") |
| 1915 | | PORT_DIPNAME( 0x01, 0x00, "DIL201" ) PORT_DIPLOCATION("DIL2:01") |
| 1968 | PORT_DIPNAME( 0x80, 0x00, "DIL201" ) PORT_DIPLOCATION("DIL2:01") |
| 1916 | 1969 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1917 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1918 | | PORT_DIPNAME( 0x02, 0x00, "DIL202" ) PORT_DIPLOCATION("DIL2:02") |
| 1970 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1971 | PORT_DIPNAME( 0x40, 0x00, "DIL202" ) PORT_DIPLOCATION("DIL2:02") |
| 1919 | 1972 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1920 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1921 | | PORT_DIPNAME( 0x04, 0x00, "DIL203" ) PORT_DIPLOCATION("DIL2:03") |
| 1973 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1974 | PORT_DIPNAME( 0x20, 0x00, "DIL203" ) PORT_DIPLOCATION("DIL2:03") |
| 1922 | 1975 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1923 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1924 | | PORT_DIPNAME( 0x08, 0x00, "DIL204" ) PORT_DIPLOCATION("DIL2:04") |
| 1976 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1977 | PORT_DIPNAME( 0x10, 0x00, "DIL204" ) PORT_DIPLOCATION("DIL2:04") |
| 1925 | 1978 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1979 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1980 | PORT_DIPNAME( 0x08, 0x00, "DIL205" ) PORT_DIPLOCATION("DIL2:05") |
| 1981 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1926 | 1982 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 1927 | | PORT_DIPNAME( 0x10, 0x00, "DIL205" ) PORT_DIPLOCATION("DIL2:05") |
| 1983 | PORT_DIPNAME( 0x04, 0x00, "DIL206" ) PORT_DIPLOCATION("DIL2:06") |
| 1928 | 1984 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1929 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1930 | | PORT_DIPNAME( 0x20, 0x00, "DIL206" ) PORT_DIPLOCATION("DIL2:06") |
| 1985 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1986 | PORT_DIPNAME( 0x02, 0x00, "DIL207" ) PORT_DIPLOCATION("DIL2:07") |
| 1931 | 1987 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1932 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1933 | | PORT_DIPNAME( 0x40, 0x00, "DIL207" ) PORT_DIPLOCATION("DIL2:07") |
| 1988 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1989 | PORT_DIPNAME( 0x01, 0x00, "DIL208" ) PORT_DIPLOCATION("DIL2:08") |
| 1934 | 1990 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1935 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1936 | | PORT_DIPNAME( 0x80, 0x00, "DIL208" ) PORT_DIPLOCATION("DIL2:08") |
| 1937 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1938 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1991 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1939 | 1992 | |
| 1940 | 1993 | PORT_START("AUX1") |
| 1941 | 1994 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("0") |
| r11224 | r11225 | |
| 2000 | 2053 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_START1) |
| 2001 | 2054 | |
| 2002 | 2055 | PORT_START("DIL1") |
| 2003 | | PORT_DIPNAME( 0x01, 0x00, "DIL101" ) PORT_DIPLOCATION("DIL1:01") |
| 2056 | PORT_DIPNAME( 0x80, 0x00, "DIL101" ) PORT_DIPLOCATION("DIL1:01") |
| 2004 | 2057 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2005 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 2006 | | PORT_DIPNAME( 0x02, 0x00, "DIL102" ) PORT_DIPLOCATION("DIL1:02") |
| 2058 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 2059 | PORT_DIPNAME( 0x40, 0x00, "DIL102" ) PORT_DIPLOCATION("DIL1:02") |
| 2007 | 2060 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2008 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 2009 | | PORT_DIPNAME( 0x04, 0x00, "DIL103" ) PORT_DIPLOCATION("DIL1:03") |
| 2061 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 2062 | PORT_DIPNAME( 0x20, 0x00, "DIL103" ) PORT_DIPLOCATION("DIL1:03") |
| 2010 | 2063 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2011 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 2012 | | PORT_DIPNAME( 0x08, 0x00, "DIL104" ) PORT_DIPLOCATION("DIL1:04") |
| 2064 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 2065 | PORT_DIPNAME( 0x10, 0x00, "DIL104" ) PORT_DIPLOCATION("DIL1:04") |
| 2013 | 2066 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2067 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 2068 | PORT_DIPNAME( 0x08, 0x00, "DIL105" ) PORT_DIPLOCATION("DIL1:05") |
| 2069 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2014 | 2070 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 2015 | | PORT_DIPNAME( 0x10, 0x00, "DIL105" ) PORT_DIPLOCATION("DIL1:05") |
| 2071 | PORT_DIPNAME( 0x04, 0x00, "DIL106" ) PORT_DIPLOCATION("DIL1:06") |
| 2016 | 2072 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2017 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 2018 | | PORT_DIPNAME( 0x20, 0x00, "DIL106" ) PORT_DIPLOCATION("DIL1:06") |
| 2073 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 2074 | PORT_DIPNAME( 0x02, 0x00, "DIL107" ) PORT_DIPLOCATION("DIL1:07") |
| 2019 | 2075 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2020 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 2021 | | PORT_DIPNAME( 0x40, 0x00, "DIL107" ) PORT_DIPLOCATION("DIL1:07") |
| 2076 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 2077 | PORT_DIPNAME( 0x01, 0x00, "DIL108" ) PORT_DIPLOCATION("DIL1:08") |
| 2022 | 2078 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2023 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 2024 | | PORT_DIPNAME( 0x80, 0x00, "DIL108" ) PORT_DIPLOCATION("DIL1:08") |
| 2025 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2026 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 2079 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 2027 | 2080 | |
| 2028 | 2081 | PORT_START("DIL2") |
| 2029 | | PORT_DIPNAME( 0x01, 0x00, "DIL201" ) PORT_DIPLOCATION("DIL2:01") |
| 2082 | PORT_DIPNAME( 0x80, 0x00, "DIL201" ) PORT_DIPLOCATION("DIL2:01") |
| 2030 | 2083 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2031 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 2032 | | PORT_DIPNAME( 0x02, 0x00, "DIL202" ) PORT_DIPLOCATION("DIL2:02") |
| 2084 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 2085 | PORT_DIPNAME( 0x40, 0x00, "DIL202" ) PORT_DIPLOCATION("DIL2:02") |
| 2033 | 2086 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2034 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 2035 | | PORT_DIPNAME( 0x04, 0x00, "DIL203" ) PORT_DIPLOCATION("DIL2:03") |
| 2087 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 2088 | PORT_DIPNAME( 0x20, 0x00, "DIL203" ) PORT_DIPLOCATION("DIL2:03") |
| 2036 | 2089 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2037 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 2038 | | PORT_DIPNAME( 0x08, 0x00, "DIL204" ) PORT_DIPLOCATION("DIL2:04") |
| 2090 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 2091 | PORT_DIPNAME( 0x10, 0x00, "DIL204" ) PORT_DIPLOCATION("DIL2:04") |
| 2039 | 2092 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2093 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 2094 | PORT_DIPNAME( 0x08, 0x00, "DIL205" ) PORT_DIPLOCATION("DIL2:05") |
| 2095 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2040 | 2096 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 2041 | | PORT_DIPNAME( 0x10, 0x00, "DIL205" ) PORT_DIPLOCATION("DIL2:05") |
| 2097 | PORT_DIPNAME( 0x04, 0x00, "DIL206" ) PORT_DIPLOCATION("DIL2:06") |
| 2042 | 2098 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2043 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 2044 | | PORT_DIPNAME( 0x20, 0x00, "DIL206" ) PORT_DIPLOCATION("DIL2:06") |
| 2099 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 2100 | PORT_DIPNAME( 0x02, 0x00, "DIL207" ) PORT_DIPLOCATION("DIL2:07") |
| 2045 | 2101 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2046 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 2047 | | PORT_DIPNAME( 0x40, 0x00, "DIL207" ) PORT_DIPLOCATION("DIL2:07") |
| 2102 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 2103 | PORT_DIPNAME( 0x01, 0x00, "DIL208" ) PORT_DIPLOCATION("DIL2:08") |
| 2048 | 2104 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2049 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 2050 | | PORT_DIPNAME( 0x80, 0x00, "DIL208" ) PORT_DIPLOCATION("DIL2:08") |
| 2051 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2052 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 2105 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 2053 | 2106 | |
| 2054 | 2107 | PORT_START("AUX1") |
| 2055 | 2108 | PORT_BIT(0xFF, IP_ACTIVE_HIGH, IPT_SPECIAL)//Handled by Gamball unit |
| r11224 | r11225 | |
| 2072 | 2125 | 4, |
| 2073 | 2126 | 0x00 |
| 2074 | 2127 | }; |
| 2128 | |
| 2129 | static const stepper_interface barcrest_reelrev_interface = |
| 2130 | { |
| 2131 | BARCREST_48STEP_REEL, |
| 2132 | 92, |
| 2133 | 4, |
| 2134 | 0x00, |
| 2135 | 1 |
| 2136 | }; |
| 2137 | |
| 2075 | 2138 | static const stepper_interface barcrest_opto1_interface = |
| 2076 | 2139 | { |
| 2077 | 2140 | BARCREST_48STEP_REEL, |
| r11224 | r11225 | |
| 2181 | 2244 | The initial 'PALTEST' routine as found in the Barcrest programs simply writes the first 'call' to the CHR space, |
| 2182 | 2245 | to read back the 'response'. There is no attempt to alter the order or anything else, just |
| 2183 | 2246 | a simple runthrough of the entire data table. The only 'catch' in this is to note that the CHR chip always scans |
| 2184 | | through the table starting at the last accessed data value, unless 00 is used to reset to the beginning. |
| 2247 | through the table starting at the last accessed data value, unless 00 is used to reset to the beginning. This is obviously |
| 2248 | a simplification, in fact the PAL does bit manipulation with some latching. |
| 2185 | 2249 | |
| 2186 | 2250 | However, a final 8 byte row, that controls the lamp matrix is not tested - to date, no-one outside of Barcrest knows |
| 2187 | 2251 | how this is generated, and currently trial and error is the only sensible method. It is noted that the default, |
| r11224 | r11225 | |
| 2280 | 2344 | BwB Characteriser (CHR) |
| 2281 | 2345 | |
| 2282 | 2346 | The BwB method of protection is considerably different to the Barcrest one, with any |
| 2283 | | incorrect behaviour manifesting in ridiculously large payouts. |
| 2347 | incorrect behaviour manifesting in ridiculously large payouts. The hardware is the |
| 2348 | same, however the main weakness of the software has been eliminated. |
| 2284 | 2349 | |
| 2285 | 2350 | In fact, the software seems deliberately designed to mislead, but is (fortunately for |
| 2286 | 2351 | us) prone to similar weaknesses that allow a per game solution. |
| 2287 | 2352 | |
| 2353 | Project Amber performed a source analysis (available on request) which appears to make things work. |
| 2354 | Said weaknesses (A Cheats Guide according to Project Amber) |
| 2355 | |
| 2356 | The common initialisation sequence is "00 04 04 0C 0C 1C 14 2C 5C 2C" |
| 2357 | 0 1 2 3 4 5 6 7 8 |
| 2358 | Using debug search for the first read from said string (best to find it first). |
| 2359 | |
| 2360 | At this point, the X index on the CPU is at the magic number address. |
| 2361 | |
| 2362 | The subsequent calls for each can be found based on the magic address |
| 2363 | |
| 2364 | (0) = ( (BWBMagicAddress)) |
| 2365 | (1) = ( (BWBMagicAddress + 1)) |
| 2366 | (2) = ( (BWBMagicAddress + 2)) |
| 2367 | (3) = ( (BWBMagicAddress + 4)) |
| 2368 | |
| 2369 | (4) = ( (BWBMagicAddress - 5)) |
| 2370 | (5) = ( (BWBMagicAddress - 4)) |
| 2371 | (6) = ( (BWBMagicAddress - 3)) |
| 2372 | (7) = ( (BWBMagicAddress - 2)) |
| 2373 | (8) = ( (BWBMagicAddress - 1)) |
| 2374 | |
| 2375 | These return the standard init sequence as above. |
| 2376 | |
| 2377 | For ease of understanding, we use three tables, one holding the common responses |
| 2378 | and two holding the appropriate call and response pairs for the two stages of operation |
| 2288 | 2379 | */ |
| 2289 | 2380 | |
| 2290 | 2381 | |
| r11224 | r11225 | |
| 2297 | 2388 | if (!state->m_current_chr_table) |
| 2298 | 2389 | fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(&space->device())); |
| 2299 | 2390 | |
| 2300 | | if (offset == 0)//initialisation is always at 0x800 |
| 2391 | if ((offset & 0x3f)== 0)//initialisation is always at 0x800 |
| 2301 | 2392 | { |
| 2393 | if (!state->m_chr_state) |
| 2302 | 2394 | { |
| 2303 | | if (call == 0) |
| 2304 | | { |
| 2305 | | state->m_init_col =0; |
| 2306 | | } |
| 2307 | | else |
| 2308 | | { |
| 2309 | | for (x = state->m_init_col; x < 64; x++) |
| 2310 | | { |
| 2311 | | if (state->m_current_chr_table[(x)].call == call) |
| 2312 | | { |
| 2313 | | state->m_init_col = x; |
| 2314 | | LOG_CHR_FULL(("BwB Characteriser init column %02X\n",state->m_init_col)); |
| 2315 | | break; |
| 2316 | | } |
| 2317 | | } |
| 2318 | | } |
| 2395 | state->m_chr_state=1; |
| 2396 | state->m_chr_counter=0; |
| 2319 | 2397 | } |
| 2398 | if (call == 0) |
| 2399 | { |
| 2400 | state->m_init_col ++; |
| 2401 | } |
| 2402 | else |
| 2403 | { |
| 2404 | state->m_init_col =0; |
| 2405 | } |
| 2320 | 2406 | } |
| 2321 | | else |
| 2407 | |
| 2408 | state->m_chr_value = space->machine().rand(); |
| 2409 | for (x = 0; x < 4; x++) |
| 2322 | 2410 | { |
| 2323 | | for (x = state->m_prot_col; x < 64;) |
| 2411 | if (state->m_current_chr_table[(x)].call == call) |
| 2324 | 2412 | { |
| 2325 | | x++; |
| 2326 | | if (state->m_current_chr_table[(x)].call == call) |
| 2413 | if (x == 0) // reinit |
| 2327 | 2414 | { |
| 2328 | | state->m_prot_col = x; |
| 2329 | | LOG_CHR(("BwB Characteriser init column %02X\n",state->m_prot_col)); |
| 2330 | | break; |
| 2415 | state->m_bwb_return = 0; |
| 2331 | 2416 | } |
| 2417 | state->m_chr_value = bwb_chr_table_common[(state->m_bwb_return)]; |
| 2418 | state->m_bwb_return++; |
| 2419 | break; |
| 2332 | 2420 | } |
| 2333 | 2421 | } |
| 2334 | 2422 | } |
| r11224 | r11225 | |
| 2336 | 2424 | static READ8_HANDLER( bwb_characteriser_r ) |
| 2337 | 2425 | { |
| 2338 | 2426 | mpu4_state *state = space->machine().driver_data<mpu4_state>(); |
| 2339 | | if (!state->m_current_chr_table) |
| 2340 | | fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(&space->device())); |
| 2341 | 2427 | |
| 2342 | 2428 | LOG_CHR(("Characteriser read offset %02X \n",offset)); |
| 2343 | 2429 | |
| 2344 | 2430 | |
| 2345 | 2431 | if (offset ==0) |
| 2346 | 2432 | { |
| 2347 | | LOG_CHR(("Characteriser read data %02X \n",state->m_current_chr_table[state->m_init_col].response)); |
| 2348 | | return state->m_current_chr_table[state->m_init_col].response; |
| 2433 | switch (state->m_chr_counter) |
| 2434 | { |
| 2435 | case 6: |
| 2436 | case 13: |
| 2437 | case 20: |
| 2438 | case 27: |
| 2439 | case 34: |
| 2440 | { |
| 2441 | return state->m_bwb_chr_table1[(((state->m_chr_counter + 1) / 7) - 1)].response; |
| 2442 | break; |
| 2443 | } |
| 2444 | default: |
| 2445 | { |
| 2446 | if (state->m_chr_counter > 34) |
| 2447 | { |
| 2448 | state->m_chr_counter = 35; |
| 2449 | state->m_chr_state = 2; |
| 2450 | } |
| 2451 | state->m_chr_counter ++; |
| 2452 | return state->m_chr_value; |
| 2453 | } |
| 2454 | } |
| 2349 | 2455 | } |
| 2350 | 2456 | else |
| 2351 | 2457 | { |
| 2352 | | LOG_CHR(("Characteriser read BwB data %02X \n",state->m_current_chr_table[state->m_prot_col].response)); |
| 2353 | | return state->m_current_chr_table[state->m_prot_col].response; |
| 2458 | return state->m_chr_value; |
| 2354 | 2459 | } |
| 2355 | 2460 | } |
| 2356 | 2461 | |
| r11224 | r11225 | |
| 2402 | 2507 | {0x00, 0x00},{0x01, 0x00},{0x04, 0x00},{0x09, 0x00},{0x10, 0x00},{0x19, 0x10},{0x24, 0x00},{0x31, 0x00} |
| 2403 | 2508 | }; |
| 2404 | 2509 | |
| 2405 | | static const mpu4_chr_table blsbys_data[72] = { |
| 2406 | | {0x00, 0x00},{0x00, 0x00},{0x00, 0x00},{0x00, 0x00},{0x00, 0x00},{0x00, 0x00},{0x2e, 0x36},{0x20, 0x42}, |
| 2407 | | {0x0f, 0x27},{0x24, 0x42},{0x3c, 0x09},{0x2c, 0x01},{0x01, 0x1d},{0x1d, 0x40},{0x40, 0xd2},{0xd2, 0x01}, |
| 2408 | | {0x01, 0xf9},{0xb1, 0x41},{0x41, 0x1c},{0x1c, 0x01},{0x01, 0xf9},{0x04, 0x54},{0x54, 0x02},{0x02, 0x00}, |
| 2409 | | {0x00, 0x00},{0x00, 0x2e},{0x2e, 0x20},{0x20, 0x0f},{0x0f, 0x24},{0x24, 0x3c},{0x3c, 0x39},{0x3c, 0xc9}, |
| 2410 | | {0xc9, 0x05},{0x05, 0x04},{0x04, 0x54},{0x54, 0x02},{0x02, 0x00},{0x00, 0x00},{0x00, 0x2e},{0x2e, 0x20}, |
| 2411 | | {0x20, 0x0f},{0x0f, 0x24},{0x24, 0x3c},{0x3c, 0x39},{0x3c, 0x36},{0x36, 0x00},{0x42, 0x04},{0x27, 0x04}, |
| 2412 | | {0x42, 0x0c},{0x09, 0x0c},{0x42, 0x1c},{0x27, 0x14},{0x42, 0x2c},{0x42, 0x5c},{0x09, 0x2c}, |
| 2413 | | //All this may be garbage - it never gets called, but is in the ROM (?) |
| 2414 | | {0x0A, 0x00}, |
| 2415 | | {0x31, 0x20},{0x34, 0x90}, {0x1e, 0x40},{0x04, 0x90},{0x01, 0xe4},{0x0c, 0xf4},{0x18, 0x64},{0x19, 0x10}, |
| 2416 | | {0x00, 0x00},{0x01, 0x00},{0x04, 0x00},{0x09, 0x00},{0x10, 0x00},{0x19, 0x10},{0x24, 0x00},{0x31, 0x00} |
| 2510 | static const bwb_chr_table blsbys_data1[5] = { |
| 2511 | //Magic number 724A |
| 2512 | |
| 2513 | // PAL Codes |
| 2514 | // 0 1 2 3 4 5 6 7 8 |
| 2515 | // ?? ?? 20 0F 24 3C 36 27 09 |
| 2516 | |
| 2517 | {0x67},{0x17},{0x0f},{0x24},{0x3c}, |
| 2417 | 2518 | }; |
| 2418 | 2519 | |
| 2520 | static const mpu4_chr_table blsbys_data[8] = { |
| 2521 | {0xEF, 0x02},{0x81, 0x00},{0xCE, 0x00},{0x00, 0x2e}, |
| 2522 | {0x06, 0x20},{0xC6, 0x0f},{0xF8, 0x24},{0x8E, 0x3c}, |
| 2523 | }; |
| 2524 | |
| 2419 | 2525 | // set percentage and other options. 2e 20 0f |
| 2420 | 2526 | // PAL Codes |
| 2421 | 2527 | // 0 1 2 3 4 5 6 7 8 |
| r11224 | r11225 | |
| 2465 | 2571 | mpu4_state *state = machine.driver_data<mpu4_state>(); |
| 2466 | 2572 | state->m_reel_mux=FIVE_REEL_5TO8; |
| 2467 | 2573 | state->m_lamp_extender=SMALL_CARD; |
| 2468 | | // setup 5 default 96 half step reels with the mux board |
| 2469 | | mpu4_config_common_reels(machine,5); |
| 2574 | // setup 4 default 96 half step reels with the mux board |
| 2575 | mpu4_config_common_reels(machine,4); |
| 2576 | stepper_config(machine, 4, &barcrest_reelrev_interface); |
| 2470 | 2577 | state->m_current_chr_table = grtecp_data; |
| 2471 | 2578 | } |
| 2472 | 2579 | |
| r11224 | r11225 | |
| 2481 | 2588 | stepper_config(machine, 2, &bwb_opto1_interface); |
| 2482 | 2589 | stepper_config(machine, 3, &bwb_opto1_interface); |
| 2483 | 2590 | stepper_config(machine, 4, &bwb_opto1_interface); |
| 2591 | state->m_bwb_chr_table1 = blsbys_data1; |
| 2484 | 2592 | state->m_current_chr_table = blsbys_data; |
| 2485 | 2593 | } |
| 2486 | 2594 | |
| r11224 | r11225 | |
| 2517 | 2625 | state->m_signal_50hz = state->m_signal_50hz?0:1; |
| 2518 | 2626 | pia6821_ca1_w(timer.machine().device("pia_ic4"), state->m_signal_50hz); /* signal is connected to IC4 CA1 */ |
| 2519 | 2627 | |
| 2520 | | if (state->m_signal_50hz) |
| 2521 | | { |
| 2522 | | update_meters(state); |
| 2523 | | } |
| 2628 | update_meters(state);//run at 100Hz to sync with PIAs |
| 2524 | 2629 | } |
| 2525 | 2630 | |
| 2526 | 2631 | static ADDRESS_MAP_START( mod2_memmap, AS_PROGRAM, 8 ) |
| r11224 | r11225 | |
| 2599 | 2704 | AM_RANGE(0x0850, 0x0850) AM_WRITE(bankswitch_w) // write bank (rom page select) |
| 2600 | 2705 | |
| 2601 | 2706 | AM_RANGE(0x0858, 0x0858) AM_WRITE(bankswitch_w) // write bank (rom page select) |
| 2707 | AM_RANGE(0x0878, 0x0878) AM_WRITE(bankset_w) // write bank (rom page select) |
| 2602 | 2708 | AM_RANGE(0x0880, 0x0883) AM_DEVREADWRITE("pia_ic4ss", pia6821_r,pia6821_w) // PIA6821 on sampled sound board |
| 2603 | 2709 | |
| 2604 | 2710 | AM_RANGE(0x08c0, 0x08c7) AM_DEVREADWRITE("ptm_ic3ss", ptm6840_read, ptm6840_write) // 6840PTM on sampled sound board |
| r11224 | r11225 | |
| 2771 | 2877 | ROM_END |
| 2772 | 2878 | |
| 2773 | 2879 | ROM_START( m_blsbys ) |
| 2774 | | ROM_REGION( 0x40000, "maincpu", 0 ) |
| 2880 | ROM_REGION( 0x80000, "maincpu", 0 ) |
| 2775 | 2881 | ROM_LOAD("bbprog.bin", 0x00000, 0x20000, CRC(c262cfda) SHA1(f004895e0dd3f8420683927915554e19e41bd20b)) |
| 2882 | ROM_RELOAD(0x40000,0x20000) |
| 2776 | 2883 | |
| 2777 | 2884 | ROM_REGION( 0x200000, "msm6376", 0 ) |
| 2778 | 2885 | ROM_LOAD( "bbsnd.p1", 0x000000, 0x080000, CRC(715c9e95) SHA1(6a0c9c63e56cfc21bf77cf29c1b844b8e0844c1e) ) |
src/mame/drivers/viper.c
| r11224 | r11225 | |
| 37 | 37 | |
| 38 | 38 | */ |
| 39 | 39 | |
| 40 | /* |
| 41 | Software notes (as per Police 911) |
| 42 | -- VL - 22.02.2010 |
| 43 | |
| 44 | IRQs: |
| 45 | |
| 46 | IRQ0: ??? (Task 4) |
| 47 | IRQ1: unused |
| 48 | IRQ2: unused |
| 49 | IRQ3: ??? (Task 5, sound?) |
| 50 | IRQ4: Voodoo3 Currently only for User Interrupt Command, maybe a more extensive handler gets installed later? |
| 51 | |
| 52 | I2C: ??? (no task switch) what drives this? network? |
| 53 | DMA0: unused |
| 54 | DMA1: unused |
| 55 | IIVPR3: unused |
| 56 | |
| 57 | Memory: |
| 58 | |
| 59 | 0x000001E0: Current task |
| 60 | 0x000001E1: Current FPU task |
| 61 | 0x000001E4: Scheduled tasks bitvector (bit 31 = task0, etc.) |
| 62 | 0x00000A00...BFF: Task structures |
| 63 | 0x00-03: unknown |
| 64 | 0x04: unknown |
| 65 | 0x05: if non-zero, this task uses FPU |
| 66 | 0x06-07: unknown |
| 67 | 0x08: unknown mem pointer, task stack pointer? |
| 68 | 0x0c: pointer to task PC (also top of stack?) |
| 69 | |
| 70 | |
| 71 | 0x00000310: Global timer 0 IRQ handler |
| 72 | 0x00000320: Global timer 1 IRQ handler |
| 73 | 0x00000330: Global timer 2 IRQ handler |
| 74 | 0x00000340: Global timer 3 IRQ handler |
| 75 | 0x00000350: IRQ0 handler |
| 76 | 0x00000360: IRQ1 handler |
| 77 | 0x00000370: IRQ2 handler |
| 78 | 0x00000380: IRQ3 handler |
| 79 | 0x00000390: IRQ4 handler |
| 80 | 0x000003a0: I2C IRQ handler |
| 81 | 0x000003b0: DMA0 IRQ handler |
| 82 | 0x000003c0: DMA1 IRQ handler |
| 83 | 0x000003d0: Message Unit IRQ handler |
| 84 | |
| 85 | 0x000004e4: Global timer 0 IRQ handler function ptr |
| 86 | 0x000004e8: Global timer 1 IRQ handler function ptr |
| 87 | 0x000004ec: Global timer 2 IRQ handler function ptr |
| 88 | 0x000004f0: Global timer 3 IRQ handler function ptr |
| 89 | |
| 90 | |
| 91 | Functions of interest: |
| 92 | |
| 93 | 0x0000f7b4: SwitchTask() |
| 94 | 0x00009d00: LoadProgram(): R3 = ptr to filename |
| 95 | */ |
| 96 | |
| 40 | 97 | #include "emu.h" |
| 41 | 98 | #include "cpu/powerpc/ppc.h" |
| 42 | 99 | #include "machine/pci.h" |
| 43 | 100 | #include "memconv.h" |
| 101 | #include "devconv.h" |
| 44 | 102 | #include "machine/idectrl.h" |
| 45 | 103 | #include "machine/timekpr.h" |
| 46 | 104 | #include "video/voodoo.h" |
| 47 | 105 | |
| 106 | #define VIPER_DEBUG_LOG |
| 48 | 107 | |
| 108 | static SCREEN_UPDATE(viper) |
| 109 | { |
| 110 | device_t *device = screen->machine().device("voodoo"); |
| 111 | return voodoo_update(device, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; |
| 112 | } |
| 113 | |
| 49 | 114 | class viper_state : public driver_device |
| 50 | 115 | { |
| 51 | 116 | public: |
| 52 | 117 | viper_state(running_machine &machine, const driver_device_config_base &config) |
| 53 | 118 | : driver_device(machine, config) { } |
| 54 | 119 | |
| 55 | | UINT32 m_mpc8240_regs[256/4]; |
| 120 | |
| 56 | 121 | UINT32 m_epic_iack; |
| 57 | 122 | int m_cf_card_ide; |
| 58 | 123 | int m_unk1_bit; |
| 59 | 124 | UINT32 m_voodoo3_pci_reg[0x100]; |
| 125 | |
| 60 | 126 | }; |
| 61 | 127 | |
| 128 | UINT32 m_mpc8240_regs[256/4]; |
| 62 | 129 | |
| 63 | | //#define VIPER_DEBUG_LOG |
| 64 | | |
| 65 | | static SCREEN_UPDATE(viper) |
| 66 | | { |
| 67 | | device_t *device = screen->machine().device("voodoo"); |
| 68 | | return voodoo_update(device, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; |
| 69 | | } |
| 70 | | |
| 71 | | |
| 72 | 130 | /*****************************************************************************/ |
| 73 | 131 | |
| 74 | 132 | static UINT32 mpc8240_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) |
| 75 | 133 | { |
| 76 | | viper_state *state = device->machine().driver_data<viper_state>(); |
| 134 | // device is null? |
| 135 | // viper_state *state = device->machine().driver_data<viper_state>(); |
| 77 | 136 | #ifdef VIPER_DEBUG_LOG |
| 78 | | printf("MPC8240: PCI read %d, %02X, %08X\n", function, reg, mem_mask); |
| 137 | // printf("MPC8240: PCI read %d, %02X, %08X\n", function, reg, mem_mask); |
| 79 | 138 | #endif |
| 80 | 139 | |
| 81 | 140 | switch (reg) |
| 82 | 141 | { |
| 83 | 142 | } |
| 84 | | |
| 85 | | return state->m_mpc8240_regs[reg/4]; |
| 143 | return m_mpc8240_regs[reg/4]; |
| 144 | //return state->m_mpc8240_regs[reg/4]; |
| 86 | 145 | } |
| 87 | 146 | |
| 88 | 147 | static void mpc8240_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) |
| 89 | 148 | { |
| 90 | | viper_state *state = device->machine().driver_data<viper_state>(); |
| 149 | // device is null? |
| 150 | // viper_state *state = device->machine().driver_data<viper_state>(); |
| 91 | 151 | #ifdef VIPER_DEBUG_LOG |
| 92 | | printf("MPC8240: PCI write %d, %02X, %08X, %08X\n", function, reg, data, mem_mask); |
| 152 | // printf("MPC8240: PCI write %d, %02X, %08X, %08X\n", function, reg, data, mem_mask); |
| 93 | 153 | #endif |
| 94 | | |
| 95 | | COMBINE_DATA(state->m_mpc8240_regs + (reg/4)); |
| 154 | COMBINE_DATA(m_mpc8240_regs + (reg/4)); |
| 155 | //COMBINE_DATA(state->m_mpc8240_regs + (reg/4)); |
| 96 | 156 | } |
| 97 | 157 | |
| 98 | 158 | |
| 99 | 159 | static READ64_DEVICE_HANDLER( pci_config_addr_r ) |
| 100 | 160 | { |
| 101 | | return pci_64be_r(device, 0, U64(0x00000000ffffffff)); |
| 161 | return pci_64be_r(device, 0, U64(0xffffffff00000000)); |
| 102 | 162 | } |
| 103 | 163 | |
| 104 | 164 | static WRITE64_DEVICE_HANDLER( pci_config_addr_w ) |
| 105 | 165 | { |
| 106 | | pci_64be_w(device, 0, data, U64(0x00000000ffffffff)); |
| 166 | pci_64be_w(device, 0, data, U64(0xffffffff00000000)); |
| 107 | 167 | } |
| 108 | 168 | |
| 109 | 169 | static READ64_DEVICE_HANDLER( pci_config_data_r ) |
| 110 | 170 | { |
| 111 | | return pci_64be_r(device, 1, U64(0xffffffff00000000)) << 32; |
| 171 | return pci_64be_r(device, 1, U64(0x00000000ffffffff)) << 32; |
| 112 | 172 | } |
| 113 | 173 | |
| 114 | 174 | static WRITE64_DEVICE_HANDLER( pci_config_data_w ) |
| 115 | 175 | { |
| 116 | | pci_64be_w(device, 1, data >> 32, U64(0xffffffff00000000)); |
| 176 | pci_64be_w(device, 1, data >> 32, U64(0x00000000ffffffff)); |
| 117 | 177 | } |
| 118 | 178 | |
| 119 | 179 | |
| 120 | 180 | |
| 181 | /*****************************************************************************/ |
| 182 | // MPC8240 Embedded Programmable Interrupt Controller (EPIC) |
| 121 | 183 | |
| 184 | #define MPC8240_IRQ0 0 |
| 185 | #define MPC8240_IRQ1 1 |
| 186 | #define MPC8240_IRQ2 2 |
| 187 | #define MPC8240_IRQ3 3 |
| 188 | #define MPC8240_IRQ4 4 |
| 189 | #define MPC8240_IRQ5 5 |
| 190 | #define MPC8240_IRQ6 6 |
| 191 | #define MPC8240_IRQ7 7 |
| 192 | #define MPC8240_IRQ8 8 |
| 193 | #define MPC8240_IRQ9 9 |
| 194 | #define MPC8240_IRQ10 10 |
| 195 | #define MPC8240_IRQ11 11 |
| 196 | #define MPC8240_IRQ12 12 |
| 197 | #define MPC8240_IRQ13 13 |
| 198 | #define MPC8240_IRQ14 14 |
| 199 | #define MPC8240_IRQ15 15 |
| 200 | #define MPC8240_I2C_IRQ 16 |
| 201 | #define MPC8240_DMA0_IRQ 17 |
| 202 | #define MPC8240_DMA1_IRQ 18 |
| 203 | #define MPC8240_MSG_IRQ 19 |
| 204 | #define MPC8240_GTIMER0_IRQ 20 |
| 205 | #define MPC8240_GTIMER1_IRQ 21 |
| 206 | #define MPC8240_GTIMER2_IRQ 22 |
| 207 | #define MPC8240_GTIMER3_IRQ 23 |
| 208 | |
| 209 | #define MPC8240_NUM_INTERRUPTS 24 |
| 210 | |
| 211 | |
| 212 | typedef struct |
| 213 | { |
| 214 | UINT32 vector; |
| 215 | int priority; |
| 216 | int destination; |
| 217 | int active; |
| 218 | int pending; |
| 219 | int mask; |
| 220 | } MPC8240_IRQ; |
| 221 | |
| 222 | |
| 223 | |
| 224 | typedef struct |
| 225 | { |
| 226 | UINT32 iack; |
| 227 | UINT32 eicr; |
| 228 | UINT32 svr; |
| 229 | |
| 230 | int active_irq; |
| 231 | |
| 232 | MPC8240_IRQ irq[MPC8240_NUM_INTERRUPTS]; |
| 233 | |
| 234 | } MPC8240_EPIC; |
| 235 | |
| 236 | |
| 237 | static MPC8240_EPIC epic; |
| 238 | |
| 239 | |
| 240 | static void epic_update_interrupts(running_machine &machine) |
| 241 | { |
| 242 | int i; |
| 243 | |
| 244 | int irq = -1; |
| 245 | int priority = -1; |
| 246 | |
| 247 | // find the highest priority pending interrupt |
| 248 | for (i=MPC8240_NUM_INTERRUPTS-1; i >= 0; i--) |
| 249 | { |
| 250 | if (epic.irq[i].pending) |
| 251 | { |
| 252 | if (epic.irq[i].priority > priority) |
| 253 | { |
| 254 | irq = i; |
| 255 | priority = epic.irq[i].priority; |
| 256 | } |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | if (irq >= 0 && epic.active_irq == -1) |
| 261 | { |
| 262 | printf("EPIC IRQ%d taken\n", irq); |
| 263 | |
| 264 | epic.active_irq = irq; |
| 265 | epic.irq[epic.active_irq].pending = 0; |
| 266 | epic.irq[epic.active_irq].active = 1; |
| 267 | |
| 268 | epic.iack = epic.irq[epic.active_irq].vector; |
| 269 | |
| 270 | printf("vector = %02X\n", epic.iack); |
| 271 | |
| 272 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, ASSERT_LINE); |
| 273 | } |
| 274 | else |
| 275 | { |
| 276 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE); |
| 277 | } |
| 278 | } |
| 279 | |
| 122 | 280 | static READ32_HANDLER( epic_r ) |
| 123 | 281 | { |
| 124 | | viper_state *state = space->machine().driver_data<viper_state>(); |
| 125 | 282 | int reg; |
| 126 | 283 | reg = offset * 4; |
| 127 | 284 | |
| 128 | | #ifdef VIPER_DEBUG_LOG |
| 129 | | printf("EPIC: read %08X, %08X at %08X\n", reg, mem_mask, cpu_get_pc(&space->device())); |
| 130 | | #endif |
| 285 | //printf("EPIC: read %08X, %08X at %08X\n", reg, mem_mask, activecpu_get_pc()); |
| 131 | 286 | |
| 132 | 287 | switch (reg >> 16) |
| 133 | 288 | { |
| 289 | // 0x50000 - 0x5FFFF |
| 290 | case 0x5: |
| 291 | { |
| 292 | switch (reg & 0xffff) |
| 293 | { |
| 294 | case 0x0200: // Offset 0x50200 - IRQ0 vector/priority register |
| 295 | case 0x0220: // Offset 0x50220 - IRQ1 vector/priority register |
| 296 | case 0x0240: // Offset 0x50240 - IRQ2 vector/priority register |
| 297 | case 0x0260: // Offset 0x50260 - IRQ3 vector/priority register |
| 298 | case 0x0280: // Offset 0x50280 - IRQ4 vector/priority register |
| 299 | case 0x02a0: // Offset 0x502a0 - IRQ5 vector/priority register |
| 300 | case 0x02c0: // Offset 0x502c0 - IRQ6 vector/priority register |
| 301 | case 0x02e0: // Offset 0x502e0 - IRQ7 vector/priority register |
| 302 | case 0x0300: // Offset 0x50300 - IRQ8 vector/priority register |
| 303 | case 0x0320: // Offset 0x50320 - IRQ9 vector/priority register |
| 304 | case 0x0340: // Offset 0x50340 - IRQ10 vector/priority register |
| 305 | case 0x0360: // Offset 0x50360 - IRQ11 vector/priority register |
| 306 | case 0x0380: // Offset 0x50380 - IRQ12 vector/priority register |
| 307 | case 0x03a0: // Offset 0x503a0 - IRQ13 vector/priority register |
| 308 | case 0x03c0: // Offset 0x503c0 - IRQ14 vector/priority register |
| 309 | case 0x03e0: // Offset 0x503e0 - IRQ15 vector/priority register |
| 310 | { |
| 311 | int irq = ((reg & 0xffff) - 0x200) >> 5; |
| 312 | int value = 0; |
| 313 | |
| 314 | value |= epic.irq[MPC8240_IRQ0 + irq].mask ? 0x80000000 : 0; |
| 315 | value |= epic.irq[MPC8240_IRQ0 + irq].priority << 16; |
| 316 | value |= epic.irq[MPC8240_IRQ0 + irq].vector; |
| 317 | value |= epic.irq[MPC8240_IRQ0 + irq].active ? 0x40000000 : 0; |
| 318 | |
| 319 | return value; |
| 320 | } |
| 321 | } |
| 322 | break; |
| 323 | } |
| 324 | |
| 134 | 325 | // 0x60000 - 0x6FFFF |
| 135 | 326 | case 0x6: |
| 136 | 327 | { |
| 137 | 328 | switch (reg & 0xffff) |
| 138 | 329 | { |
| 139 | | case 0x00a0: // IACK |
| 140 | | return state->m_epic_iack; |
| 330 | case 0x00a0: // Offset 0x600A0 - IACK |
| 331 | { |
| 332 | epic_update_interrupts(space->machine()); |
| 141 | 333 | |
| 334 | if (epic.active_irq >= 0) |
| 335 | { |
| 336 | return epic.iack; |
| 337 | } |
| 338 | else |
| 339 | { |
| 340 | // spurious vector register is returned if no pending interrupts |
| 341 | return epic.svr; |
| 342 | } |
| 343 | } |
| 344 | |
| 142 | 345 | } |
| 143 | 346 | break; |
| 144 | 347 | } |
| r11224 | r11225 | |
| 149 | 352 | |
| 150 | 353 | static WRITE32_HANDLER( epic_w ) |
| 151 | 354 | { |
| 152 | | viper_state *state = space->machine().driver_data<viper_state>(); |
| 153 | 355 | int reg; |
| 154 | 356 | reg = offset * 4; |
| 155 | 357 | |
| 156 | | #ifdef VIPER_DEBUG_LOG |
| 157 | 358 | printf("EPIC: write %08X, %08X, %08X at %08X\n", data, reg, mem_mask, cpu_get_pc(&space->device())); |
| 158 | | #endif |
| 159 | 359 | |
| 160 | 360 | switch (reg >> 16) |
| 161 | 361 | { |
| 362 | // 0x40000 - 0x4FFFF |
| 363 | case 4: |
| 364 | { |
| 365 | switch (reg & 0xffff) |
| 366 | { |
| 367 | case 0x1030: // Offset 0x41030 - EICR |
| 368 | { |
| 369 | epic.eicr = data; |
| 370 | if (data & 0x08000000) |
| 371 | fatalerror("EPIC: serial interrupts mode not implemented"); |
| 372 | break; |
| 373 | } |
| 374 | case 0x10e0: // Offset 0x410E0 - Spurious Vector Register |
| 375 | { |
| 376 | epic.svr = data; |
| 377 | break; |
| 378 | } |
| 379 | case 0x1120: // Offset 0x41120 - Global timer 0 vector/priority register |
| 380 | case 0x1160: // Offset 0x41160 - Global timer 1 vector/priority register |
| 381 | case 0x11a0: // Offset 0x411A0 - Global timer 2 vector/priority register |
| 382 | case 0x11e0: // Offset 0x411E0 - Global timer 3 vector/priority register |
| 383 | { |
| 384 | int timer = ((reg & 0xffff) - 0x1120) >> 6; |
| 385 | |
| 386 | epic.irq[MPC8240_GTIMER0_IRQ + timer].mask = (data & 0x80000000) ? 1 : 0; |
| 387 | epic.irq[MPC8240_GTIMER0_IRQ + timer].priority = (data >> 16) & 0xf; |
| 388 | epic.irq[MPC8240_GTIMER0_IRQ + timer].vector = data & 0xff; |
| 389 | break; |
| 390 | } |
| 391 | case 0x1130: // Offset 0x41130 - Global timer 0 destination register |
| 392 | case 0x1170: // Offset 0x41170 - Global timer 1 destination register |
| 393 | case 0x11b0: // Offset 0x411B0 - Global timer 2 destination register |
| 394 | case 0x11f0: // Offset 0x411F0 - Global timer 3 destination register |
| 395 | { |
| 396 | int timer = ((reg & 0xffff) - 0x1130) >> 6; |
| 397 | |
| 398 | epic.irq[MPC8240_GTIMER0_IRQ + timer].destination = data & 0x1; |
| 399 | break; |
| 400 | } |
| 401 | } |
| 402 | break; |
| 403 | } |
| 404 | |
| 405 | // 0x50000 - 0x5FFFF |
| 406 | case 0x5: |
| 407 | { |
| 408 | switch (reg & 0xffff) |
| 409 | { |
| 410 | case 0x0200: // Offset 0x50200 - IRQ0 vector/priority register |
| 411 | case 0x0220: // Offset 0x50220 - IRQ1 vector/priority register |
| 412 | case 0x0240: // Offset 0x50240 - IRQ2 vector/priority register |
| 413 | case 0x0260: // Offset 0x50260 - IRQ3 vector/priority register |
| 414 | case 0x0280: // Offset 0x50280 - IRQ4 vector/priority register |
| 415 | case 0x02a0: // Offset 0x502a0 - IRQ5 vector/priority register |
| 416 | case 0x02c0: // Offset 0x502c0 - IRQ6 vector/priority register |
| 417 | case 0x02e0: // Offset 0x502e0 - IRQ7 vector/priority register |
| 418 | case 0x0300: // Offset 0x50300 - IRQ8 vector/priority register |
| 419 | case 0x0320: // Offset 0x50320 - IRQ9 vector/priority register |
| 420 | case 0x0340: // Offset 0x50340 - IRQ10 vector/priority register |
| 421 | case 0x0360: // Offset 0x50360 - IRQ11 vector/priority register |
| 422 | case 0x0380: // Offset 0x50380 - IRQ12 vector/priority register |
| 423 | case 0x03a0: // Offset 0x503a0 - IRQ13 vector/priority register |
| 424 | case 0x03c0: // Offset 0x503c0 - IRQ14 vector/priority register |
| 425 | case 0x03e0: // Offset 0x503e0 - IRQ15 vector/priority register |
| 426 | { |
| 427 | int irq = ((reg & 0xffff) - 0x200) >> 5; |
| 428 | |
| 429 | epic.irq[MPC8240_IRQ0 + irq].mask = (data & 0x80000000) ? 1 : 0; |
| 430 | epic.irq[MPC8240_IRQ0 + irq].priority = (data >> 16) & 0xf; |
| 431 | epic.irq[MPC8240_IRQ0 + irq].vector = data & 0xff; |
| 432 | break; |
| 433 | } |
| 434 | case 0x0210: // Offset 0x50210 - IRQ0 destination register |
| 435 | case 0x0230: // Offset 0x50230 - IRQ1 destination register |
| 436 | case 0x0250: // Offset 0x50250 - IRQ2 destination register |
| 437 | case 0x0270: // Offset 0x50270 - IRQ3 destination register |
| 438 | case 0x0290: // Offset 0x50290 - IRQ4 destination register |
| 439 | case 0x02b0: // Offset 0x502b0 - IRQ5 destination register |
| 440 | case 0x02d0: // Offset 0x502d0 - IRQ6 destination register |
| 441 | case 0x02f0: // Offset 0x502f0 - IRQ7 destination register |
| 442 | case 0x0310: // Offset 0x50310 - IRQ8 destination register |
| 443 | case 0x0330: // Offset 0x50330 - IRQ9 destination register |
| 444 | case 0x0350: // Offset 0x50350 - IRQ10 destination register |
| 445 | case 0x0370: // Offset 0x50370 - IRQ11 destination register |
| 446 | case 0x0390: // Offset 0x50390 - IRQ12 destination register |
| 447 | case 0x03b0: // Offset 0x503b0 - IRQ13 destination register |
| 448 | case 0x03d0: // Offset 0x503d0 - IRQ14 destination register |
| 449 | case 0x03f0: // Offset 0x503f0 - IRQ15 destination register |
| 450 | { |
| 451 | int irq = ((reg & 0xffff) - 0x210) >> 5; |
| 452 | |
| 453 | epic.irq[MPC8240_IRQ0 + irq].destination = data & 0x1; |
| 454 | break; |
| 455 | } |
| 456 | } |
| 457 | break; |
| 458 | } |
| 459 | |
| 162 | 460 | // 0x60000 - 0x6FFFF |
| 163 | 461 | case 0x6: |
| 164 | 462 | { |
| 165 | 463 | switch (reg & 0xffff) |
| 166 | 464 | { |
| 167 | | case 0x00b0: // EOI |
| 168 | | state->m_epic_iack = 0xff; |
| 465 | case 0x00b0: // Offset 0x600B0 - EOI |
| 466 | printf("EPIC IRQ%d cleared.\n", epic.active_irq); |
| 467 | epic.irq[epic.active_irq].active = 0; |
| 468 | epic.active_irq = -1; |
| 469 | |
| 470 | epic_update_interrupts(space->machine()); |
| 169 | 471 | break; |
| 170 | 472 | } |
| 171 | 473 | break; |
| r11224 | r11225 | |
| 183 | 485 | } |
| 184 | 486 | |
| 185 | 487 | |
| 488 | static void mpc8240_interrupt(running_machine &machine, int irq) |
| 489 | { |
| 490 | if (epic.irq[irq].mask == 0 && epic.irq[irq].priority > 0) |
| 491 | { |
| 492 | epic.irq[irq].pending = 1; |
| 186 | 493 | |
| 494 | epic_update_interrupts(machine); |
| 495 | } |
| 496 | } |
| 497 | |
| 498 | static void mpc8240_epic_reset(void) |
| 499 | { |
| 500 | int i; |
| 501 | |
| 502 | for (i=0; i < MPC8240_NUM_INTERRUPTS; i++) |
| 503 | { |
| 504 | epic.irq[i].mask = 1; |
| 505 | } |
| 506 | |
| 507 | epic.active_irq = -1; |
| 508 | } |
| 509 | |
| 510 | /*****************************************************************************/ |
| 511 | |
| 512 | |
| 187 | 513 | static const UINT8 cf_card_tuples[] = |
| 188 | 514 | { |
| 189 | 515 | 0x01, // Device Tuple |
| r11224 | r11225 | |
| 243 | 569 | static READ64_DEVICE_HANDLER(cf_card_r) |
| 244 | 570 | { |
| 245 | 571 | viper_state *state = device->machine().driver_data<viper_state>(); |
| 572 | |
| 246 | 573 | UINT64 r = 0; |
| 247 | 574 | |
| 248 | 575 | if (ACCESSING_BITS_16_31) |
| r11224 | r11225 | |
| 289 | 616 | { |
| 290 | 617 | int reg = offset; |
| 291 | 618 | |
| 292 | | //printf("cf_r: %04X\n", reg); |
| 619 | printf("cf_r: %04X\n", reg); |
| 293 | 620 | |
| 294 | 621 | if ((reg >> 1) < sizeof(cf_card_tuples)) |
| 295 | 622 | { |
| r11224 | r11225 | |
| 307 | 634 | static WRITE64_DEVICE_HANDLER(cf_card_w) |
| 308 | 635 | { |
| 309 | 636 | viper_state *state = device->machine().driver_data<viper_state>(); |
| 637 | |
| 310 | 638 | #ifdef VIPER_DEBUG_LOG |
| 311 | | printf("%s:compact_flash_w: %08X%08X, %08X, %08X%08X\n", device->machine().describe_context(), (UINT32)(data>>32), (UINT32)(data), offset, (UINT32)(mem_mask >> 32), (UINT32)(mem_mask)); |
| 639 | //printf("%s:compact_flash_w: %08X%08X, %08X, %08X%08X\n", device->machine().describe_context(), (UINT32)(data>>32), (UINT32)(data), offset, (UINT32)(mem_mask >> 32), (UINT32)(mem_mask)); |
| 312 | 640 | #endif |
| 313 | 641 | |
| 314 | 642 | if (ACCESSING_BITS_16_31) |
| r11224 | r11225 | |
| 368 | 696 | // cylinder high register is set to 0x00 |
| 369 | 697 | |
| 370 | 698 | ide_bus_w(device, 1, 6, 0x04); |
| 699 | |
| 700 | ide_bus_w(device, 0, 2, 0x01); |
| 701 | ide_bus_w(device, 0, 3, 0x01); |
| 702 | ide_bus_w(device, 0, 4, 0x00); |
| 703 | ide_bus_w(device, 0, 5, 0x00); |
| 371 | 704 | } |
| 372 | 705 | break; |
| 373 | 706 | } |
| r11224 | r11225 | |
| 383 | 716 | static WRITE64_HANDLER(unk2_w) |
| 384 | 717 | { |
| 385 | 718 | viper_state *state = space->machine().driver_data<viper_state>(); |
| 719 | |
| 386 | 720 | if (ACCESSING_BITS_56_63) |
| 387 | 721 | { |
| 388 | 722 | state->m_cf_card_ide = 0; |
| r11224 | r11225 | |
| 416 | 750 | } |
| 417 | 751 | } |
| 418 | 752 | |
| 753 | |
| 419 | 754 | static READ64_HANDLER(unk1_r) |
| 420 | 755 | { |
| 421 | 756 | viper_state *state = space->machine().driver_data<viper_state>(); |
| 757 | |
| 422 | 758 | UINT64 r = 0; |
| 423 | 759 | //return 0;//U64(0x0000400000000000); |
| 424 | 760 | |
| 425 | 761 | if (ACCESSING_BITS_40_47) |
| 426 | 762 | { |
| 427 | 763 | r |= (UINT64)(state->m_unk1_bit << 5) << 40; |
| 764 | r |= U64(0x0000400000000000); |
| 428 | 765 | } |
| 429 | 766 | |
| 430 | 767 | return r; |
| r11224 | r11225 | |
| 433 | 770 | static WRITE64_HANDLER(unk1a_w) |
| 434 | 771 | { |
| 435 | 772 | viper_state *state = space->machine().driver_data<viper_state>(); |
| 773 | |
| 436 | 774 | if (ACCESSING_BITS_56_63) |
| 437 | 775 | { |
| 438 | 776 | state->m_unk1_bit = 1; |
| r11224 | r11225 | |
| 442 | 780 | static WRITE64_HANDLER(unk1b_w) |
| 443 | 781 | { |
| 444 | 782 | viper_state *state = space->machine().driver_data<viper_state>(); |
| 783 | |
| 445 | 784 | if (ACCESSING_BITS_56_63) |
| 446 | 785 | { |
| 447 | 786 | state->m_unk1_bit = 0; |
| 448 | 787 | } |
| 449 | 788 | } |
| 450 | 789 | |
| 790 | |
| 451 | 791 | static UINT32 voodoo3_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) |
| 452 | 792 | { |
| 453 | 793 | viper_state *state = device->machine().driver_data<viper_state>(); |
| 794 | |
| 454 | 795 | switch (reg) |
| 455 | 796 | { |
| 456 | 797 | case 0x00: // PCI Vendor ID (0x121a = 3dfx), Device ID (0x0005 = Voodoo 3) |
| r11224 | r11225 | |
| 491 | 832 | static void voodoo3_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) |
| 492 | 833 | { |
| 493 | 834 | viper_state *state = device->machine().driver_data<viper_state>(); |
| 835 | |
| 494 | 836 | // printf("voodoo3_pci_w: %08X, %08X\n", reg, data); |
| 495 | 837 | |
| 496 | 838 | switch (reg) |
| r11224 | r11225 | |
| 556 | 898 | } |
| 557 | 899 | } |
| 558 | 900 | |
| 559 | | #if 0 |
| 560 | 901 | static READ64_HANDLER(voodoo3_io_r) |
| 561 | 902 | { |
| 562 | | return read64be_with_32le_handler(banshee_io_0_r, space->machine(), offset, mem_mask); |
| 903 | device_t *device = space->machine().device("voodoo"); |
| 904 | return read64be_with_32le_device_handler(banshee_io_r, device, offset, mem_mask); |
| 563 | 905 | } |
| 564 | 906 | static WRITE64_HANDLER(voodoo3_io_w) |
| 565 | 907 | { |
| 566 | 908 | // printf("voodoo3_io_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, cpu_get_pc(&space->device())); |
| 567 | | write64be_with_32le_handler(banshee_io_0_w, space->machine(), offset, data, mem_mask); |
| 909 | |
| 910 | device_t *device = space->machine().device("voodoo"); |
| 911 | write64be_with_32le_device_handler(banshee_io_w, device, offset, data, mem_mask); |
| 568 | 912 | } |
| 569 | 913 | |
| 570 | 914 | static READ64_HANDLER(voodoo3_r) |
| 571 | 915 | { |
| 572 | | return read64be_with_32le_handler(banshee_0_r, space->machine(), offset, mem_mask); |
| 916 | device_t *device = space->machine().device("voodoo"); |
| 917 | return read64be_with_32le_device_handler(banshee_r, device, offset, mem_mask); |
| 573 | 918 | } |
| 574 | 919 | static WRITE64_HANDLER(voodoo3_w) |
| 575 | 920 | { |
| 576 | 921 | // printf("voodoo3_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, cpu_get_pc(&space->device())); |
| 577 | | write64be_with_32le_handler(banshee_0_w, space->machine(), offset, data, mem_mask); |
| 922 | |
| 923 | device_t *device = space->machine().device("voodoo"); |
| 924 | write64be_with_32le_device_handler(banshee_w, device, offset, data, mem_mask); |
| 578 | 925 | } |
| 579 | 926 | |
| 580 | 927 | static READ64_HANDLER(voodoo3_lfb_r) |
| 581 | 928 | { |
| 582 | | return read64be_with_32le_handler(banshee_fb_0_r, space->machine(), offset, mem_mask); |
| 929 | device_t *device = space->machine().device("voodoo"); |
| 930 | return read64be_with_32le_device_handler(banshee_fb_r, device, offset, mem_mask); |
| 583 | 931 | } |
| 584 | 932 | static WRITE64_HANDLER(voodoo3_lfb_w) |
| 585 | 933 | { |
| 586 | 934 | // printf("voodoo3_lfb_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, cpu_get_pc(&space->device())); |
| 587 | | write64be_with_32le_handler(banshee_fb_0_w, space->machine(), offset, data, mem_mask); |
| 935 | |
| 936 | device_t *device = space->machine().device("voodoo"); |
| 937 | write64be_with_32le_device_handler(banshee_fb_w, device, offset, data, mem_mask); |
| 588 | 938 | } |
| 589 | | #endif |
| 590 | 939 | |
| 591 | 940 | |
| 592 | 941 | /*****************************************************************************/ |
| r11224 | r11225 | |
| 594 | 943 | static ADDRESS_MAP_START(viper_map, AS_PROGRAM, 64) |
| 595 | 944 | AM_RANGE(0x00000000, 0x00ffffff) AM_MIRROR(0x1000000) AM_RAM |
| 596 | 945 | AM_RANGE(0x80000000, 0x800fffff) AM_READWRITE(epic_64be_r, epic_64be_w) |
| 597 | | AM_RANGE(0x82000000, 0x83ffffff) AM_DEVREADWRITE32("voodoo", banshee_r, banshee_w, U64(0xffffffffffffffff)) |
| 598 | | AM_RANGE(0x84000000, 0x85ffffff) AM_DEVREADWRITE32("voodoo", banshee_fb_r, banshee_fb_w, U64(0xffffffffffffffff)) |
| 599 | | AM_RANGE(0xfe800000, 0xfe8000ff) AM_DEVREADWRITE32("voodoo", banshee_io_r, banshee_io_w, U64(0xffffffffffffffff)) |
| 946 | // AM_RANGE(0x82000000, 0x83ffffff) AM_DEVREADWRITE32("voodoo", banshee_r, banshee_w, U64(0xffffffffffffffff)) |
| 947 | // AM_RANGE(0x84000000, 0x85ffffff) AM_DEVREADWRITE32("voodoo", banshee_fb_r, banshee_fb_w, U64(0xffffffffffffffff)) |
| 948 | // AM_RANGE(0xfe800000, 0xfe8000ff) AM_DEVREADWRITE32("voodoo", banshee_io_r, banshee_io_w, U64(0xffffffffffffffff)) |
| 949 | AM_RANGE(0x82000000, 0x83ffffff) AM_READWRITE(voodoo3_r, voodoo3_w) |
| 950 | AM_RANGE(0x84000000, 0x85ffffff) AM_READWRITE(voodoo3_lfb_r, voodoo3_lfb_w) |
| 951 | AM_RANGE(0xfe800000, 0xfe8000ff) AM_READWRITE(voodoo3_io_r, voodoo3_io_w) |
| 600 | 952 | AM_RANGE(0xfec00000, 0xfedfffff) AM_DEVREADWRITE("pcibus", pci_config_addr_r, pci_config_addr_w) |
| 601 | 953 | AM_RANGE(0xfee00000, 0xfeefffff) AM_DEVREADWRITE("pcibus", pci_config_data_r, pci_config_data_w) |
| 954 | // 0xff000000, 0xff000fff - cf_card_data_r/w (installed in DRIVER_INIT(vipercf)) |
| 955 | // 0xff200000, 0xff200fff - cf_card_r/w (installed in DRIVER_INIT(vipercf)) |
| 602 | 956 | AM_RANGE(0xff300000, 0xff300fff) AM_DEVREADWRITE("ide", ata_r, ata_w) |
| 603 | 957 | AM_RANGE(0xffe10000, 0xffe10007) AM_READ(unk1_r) |
| 604 | 958 | AM_RANGE(0xffe30000, 0xffe31fff) AM_DEVREADWRITE8("m48t58",timekeeper_r, timekeeper_w, U64(0xffffffffffffffff)) |
| r11224 | r11225 | |
| 624 | 978 | |
| 625 | 979 | static INTERRUPT_GEN(viper_vblank) |
| 626 | 980 | { |
| 981 | mpc8240_interrupt(device->machine(), MPC8240_IRQ0); |
| 982 | //mpc8240_interrupt(device->machine, MPC8240_IRQ3); |
| 983 | } |
| 627 | 984 | |
| 985 | static void voodoo_vblank(const device_config *device, int param) |
| 986 | { |
| 987 | //mpc8240_interrupt(device->machine, MPC8240_IRQ4); |
| 628 | 988 | } |
| 629 | 989 | |
| 630 | 990 | static void ide_interrupt(device_t *device, int state) |
| r11224 | r11225 | |
| 634 | 994 | static MACHINE_RESET(viper) |
| 635 | 995 | { |
| 636 | 996 | devtag_reset(machine, "ide"); |
| 997 | mpc8240_epic_reset(); |
| 637 | 998 | } |
| 638 | 999 | |
| 1000 | |
| 1001 | |
| 1002 | |
| 639 | 1003 | static MACHINE_CONFIG_START( viper, viper_state ) |
| 640 | 1004 | |
| 641 | 1005 | /* basic machine hardware */ |
| r11224 | r11225 | |
| 647 | 1011 | MCFG_MACHINE_RESET(viper) |
| 648 | 1012 | |
| 649 | 1013 | MCFG_PCI_BUS_ADD("pcibus", 0) |
| 650 | | MCFG_PCI_BUS_DEVICE(0, NULL, mpc8240_pci_r, mpc8240_pci_w) |
| 1014 | MCFG_PCI_BUS_DEVICE(0, "mpc8240", mpc8240_pci_r, mpc8240_pci_w) |
| 651 | 1015 | MCFG_PCI_BUS_DEVICE(12, "voodoo", voodoo3_pci_r, voodoo3_pci_w) |
| 652 | 1016 | |
| 653 | 1017 | MCFG_IDE_CONTROLLER_ADD("ide", ide_interrupt) |
| 654 | 1018 | MCFG_3DFX_VOODOO_3_ADD("voodoo", STD_VOODOO_3_CLOCK, 16, "screen") |
| 655 | 1019 | MCFG_3DFX_VOODOO_CPU("maincpu") |
| 1020 | MCFG_3DFX_VOODOO_VBLANK(voodoo_vblank) |
| 656 | 1021 | |
| 657 | 1022 | /* video hardware */ |
| 658 | 1023 | MCFG_SCREEN_ADD("screen", RASTER) |
| r11224 | r11225 | |
| 660 | 1025 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 661 | 1026 | MCFG_SCREEN_SIZE(800, 600) |
| 662 | 1027 | MCFG_SCREEN_VISIBLE_AREA(0, 799, 0, 599) |
| 663 | | MCFG_SCREEN_UPDATE(viper) |
| 664 | 1028 | |
| 665 | 1029 | MCFG_PALETTE_LENGTH(65536) |
| 666 | 1030 | |
| 1031 | MCFG_SCREEN_UPDATE(viper) |
| 1032 | |
| 667 | 1033 | /* sound hardware */ |
| 668 | 1034 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 669 | 1035 | |
src/mame/drivers/segas18.c
| r11224 | r11225 | |
| 82 | 82 | |
| 83 | 83 | static const segaic16_memory_map_entry rom_171_shad_info[] = |
| 84 | 84 | { |
| 85 | | { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, NULL, misc_io_w, NULL, NULL, "I/O space" }, |
| 86 | | { 0x39/2, 0x00000, 0x02000, 0xffe000, ~0, NULL, "bank10", segaic16_paletteram_w, NULL, &segaic16_paletteram, "color RAM" }, |
| 87 | | { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, NULL, "bank11", segaic16_tileram_0_w, NULL, &segaic16_tileram_0, "tile RAM" }, |
| 88 | | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, NULL, "bank12", segaic16_textram_0_w, NULL, &segaic16_textram_0, "text RAM" }, |
| 89 | | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, NULL, "bank13", NULL, "bank13", &segaic16_spriteram_0, "object RAM" }, |
| 90 | | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, NULL, "bank14", NULL, "bank14", &workram, "work RAM" }, |
| 91 | | { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, NULL, NULL, NULL, NULL, NULL, "????" }, |
| 92 | | { 0x25/2, 0x00000, 0x00010, 0xfffff0, ~0, genesis_vdp_r, NULL, genesis_vdp_w, NULL, NULL, "VDP" }, |
| 93 | | { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, NULL, "bank17", NULL, NULL, NULL, "ROM 0" }, |
| 85 | { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC(misc_io_r), NULL, FUNC(misc_io_w), NULL, NULL, "I/O space" }, |
| 86 | { 0x39/2, 0x00000, 0x02000, 0xffe000, ~0, FUNC_NULL, "bank10", FUNC(segaic16_paletteram_w), NULL, &segaic16_paletteram, "color RAM" }, |
| 87 | { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, FUNC_NULL, "bank11", FUNC(segaic16_tileram_0_w), NULL, &segaic16_tileram_0, "tile RAM" }, |
| 88 | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, FUNC_NULL, "bank12", FUNC(segaic16_textram_0_w), NULL, &segaic16_textram_0, "text RAM" }, |
| 89 | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, FUNC_NULL, "bank13", FUNC_NULL, "bank13", &segaic16_spriteram_0, "object RAM" }, |
| 90 | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC_NULL, "bank14", FUNC_NULL, "bank14", &workram, "work RAM" }, |
| 91 | { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, FUNC_NULL, NULL, FUNC_NULL, NULL, NULL, "????" }, |
| 92 | { 0x25/2, 0x00000, 0x00010, 0xfffff0, ~0, FUNC(genesis_vdp_r), NULL, FUNC(genesis_vdp_w), NULL, NULL, "VDP" }, |
| 93 | { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, FUNC_NULL, "bank17", FUNC_NULL, NULL, NULL, "ROM 0" }, |
| 94 | 94 | { 0 } |
| 95 | 95 | }; |
| 96 | 96 | |
| 97 | 97 | static const segaic16_memory_map_entry rom_171_5874_info[] = |
| 98 | 98 | { |
| 99 | | { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, NULL, misc_io_w, NULL, NULL, "I/O space" }, |
| 100 | | { 0x39/2, 0x00000, 0x02000, 0xffe000, ~0, NULL, "bank10", segaic16_paletteram_w, NULL, &segaic16_paletteram, "color RAM" }, |
| 101 | | { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, NULL, "bank11", segaic16_tileram_0_w, NULL, &segaic16_tileram_0, "tile RAM" }, |
| 102 | | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, NULL, "bank12", segaic16_textram_0_w, NULL, &segaic16_textram_0, "text RAM" }, |
| 103 | | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, NULL, "bank13", NULL, "bank13", &segaic16_spriteram_0, "object RAM" }, |
| 104 | | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, NULL, "bank14", NULL, "bank14", &workram, "work RAM" }, |
| 105 | | { 0x29/2, 0x00000, 0x00010, 0xfffff0, ~0, genesis_vdp_r, NULL, genesis_vdp_w, NULL, NULL, "VDP" }, |
| 106 | | { 0x25/2, 0x00000, 0x80000, 0xf80000, 0x80000, NULL, "bank16", NULL, NULL, NULL, "ROM 1" }, |
| 107 | | { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, NULL, "bank17", NULL, NULL, NULL, "ROM 0" }, |
| 99 | { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC(misc_io_r), NULL, FUNC(misc_io_w), NULL, NULL, "I/O space" }, |
| 100 | { 0x39/2, 0x00000, 0x02000, 0xffe000, ~0, FUNC_NULL, "bank10", FUNC(segaic16_paletteram_w), NULL, &segaic16_paletteram, "color RAM" }, |
| 101 | { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, FUNC_NULL, "bank11", FUNC(segaic16_tileram_0_w), NULL, &segaic16_tileram_0, "tile RAM" }, |
| 102 | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, FUNC_NULL, "bank12", FUNC(segaic16_textram_0_w), NULL, &segaic16_textram_0, "text RAM" }, |
| 103 | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, FUNC_NULL, "bank13", FUNC_NULL, "bank13", &segaic16_spriteram_0, "object RAM" }, |
| 104 | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC_NULL, "bank14", FUNC_NULL, "bank14", &workram, "work RAM" }, |
| 105 | { 0x29/2, 0x00000, 0x00010, 0xfffff0, ~0, FUNC(genesis_vdp_r), NULL, FUNC(genesis_vdp_w), NULL, NULL, "VDP" }, |
| 106 | { 0x25/2, 0x00000, 0x80000, 0xf80000, 0x80000, FUNC_NULL, "bank16", FUNC_NULL, NULL, NULL, "ROM 1" }, |
| 107 | { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, FUNC_NULL, "bank17", FUNC_NULL, NULL, NULL, "ROM 0" }, |
| 108 | 108 | { 0 } |
| 109 | 109 | }; |
| 110 | 110 | |
| 111 | 111 | static const segaic16_memory_map_entry rom_171_5987_info[] = |
| 112 | 112 | { |
| 113 | | { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, NULL, misc_io_w, NULL, NULL, "I/O space" }, |
| 114 | | { 0x39/2, 0x00000, 0x02000, 0xffe000, ~0, NULL, "bank10", segaic16_paletteram_w, NULL, &segaic16_paletteram, "color RAM" }, |
| 115 | | { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, NULL, "bank11", segaic16_tileram_0_w, NULL, &segaic16_tileram_0, "tile RAM" }, |
| 116 | | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, NULL, "bank12", segaic16_textram_0_w, NULL, &segaic16_textram_0, "text RAM" }, |
| 117 | | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, NULL, "bank13", NULL, "bank13", &segaic16_spriteram_0, "object RAM" }, |
| 118 | | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, NULL, "bank14", NULL, "bank14", &workram, "work RAM" }, |
| 119 | | { 0x29/2, 0x00000, 0x00010, 0xfffff0, ~0, genesis_vdp_r, NULL, genesis_vdp_w, NULL, NULL, "VDP" }, |
| 120 | | { 0x25/2, 0x00000, 0x80000, 0xf80000, 0x80000, NULL, "bank16", rom_5987_bank_w, NULL, NULL, "ROM 1/banking" }, |
| 121 | | { 0x21/2, 0x00000, 0x100000,0xf00000, 0x00000, NULL, "bank17", NULL, NULL, NULL, "ROM 0" }, |
| 113 | { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC(misc_io_r), NULL, FUNC(misc_io_w), NULL, NULL, "I/O space" }, |
| 114 | { 0x39/2, 0x00000, 0x02000, 0xffe000, ~0, FUNC_NULL, "bank10", FUNC(segaic16_paletteram_w), NULL, &segaic16_paletteram, "color RAM" }, |
| 115 | { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, FUNC_NULL, "bank11", FUNC(segaic16_tileram_0_w), NULL, &segaic16_tileram_0, "tile RAM" }, |
| 116 | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, FUNC_NULL, "bank12", FUNC(segaic16_textram_0_w), NULL, &segaic16_textram_0, "text RAM" }, |
| 117 | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, FUNC_NULL, "bank13", FUNC_NULL, "bank13", &segaic16_spriteram_0, "object RAM" }, |
| 118 | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC_NULL, "bank14", FUNC_NULL, "bank14", &workram, "work RAM" }, |
| 119 | { 0x29/2, 0x00000, 0x00010, 0xfffff0, ~0, FUNC(genesis_vdp_r), NULL, FUNC(genesis_vdp_w), NULL, NULL, "VDP" }, |
| 120 | { 0x25/2, 0x00000, 0x80000, 0xf80000, 0x80000, FUNC_NULL, "bank16", FUNC(rom_5987_bank_w), NULL, NULL, "ROM 1/banking" }, |
| 121 | { 0x21/2, 0x00000, 0x100000,0xf00000, 0x00000, FUNC_NULL, "bank17", FUNC_NULL, NULL, NULL, "ROM 0" }, |
| 122 | 122 | { 0 } |
| 123 | 123 | }; |
| 124 | 124 | |
src/mame/drivers/mpu3.c
| r0 | r11225 | |
| 1 | /*********************************************************************************************************** |
| 2 | Barcrest MPU3 highly preliminary driver by J.Wallace, and Anonymous. |
| 3 | |
| 4 | --- Board Setup --- |
| 5 | |
| 6 | This original board uses a ~1.Mhz 6808 CPU, and a number of PIA6821 chips for multiplexing inputs and the like. |
| 7 | |
| 8 | A 6840PTM is used for internal timing |
| 9 | A GAME CARD (cartridge) plugs into the board containing the game, and a protection PAL (the 'characteriser'). |
| 10 | |
| 11 | --- Preliminary MPU3 Memorymap --- |
| 12 | |
| 13 | hex |r/w| D D D D D D D D | |
| 14 | location | | 7 6 5 4 3 2 1 0 | function |
| 15 | -----------+---+-----------------+-------------------------------------------------------------------------- |
| 16 | 0000-07FF |R/W| D D D D D D D D | 2k RAM |
| 17 | -----------+---+-----------------+-------------------------------------------------------------------------- |
| 18 | |
| 19 | 8800-881F |R/W| ???????????????? | MC6840 PTM IC2 (unusual bus setup, address shifted two bytes) |
| 20 | |
| 21 | Outputs hooked into IC 19 |
| 22 | |
| 23 | Clock1 <-------------------------------------- |
| 24 | | | |
| 25 | V | |
| 26 | Output1 ---> Clock2 | |
| 27 | | |
| 28 | Output2 --+-> Clock3 | |
| 29 | | | |
| 30 | | Output3 ---> 'to audio amp' ?? |
| 31 | | |
| 32 | +--------> CA1 IC3 ( |
| 33 | |
| 34 | IRQ line connected to CPU |
| 35 | |
| 36 | -----------+---+-----------------+-------------------------------------------------------------------------- |
| 37 | 9000- |R/W| D D D D D D D D | PIA6821 IC3 |
| 38 | | | | PA2-PA7 INPUT multiplexed inputs data |
| 39 | | | | PA1, CB1 connected to IC2 C1 pin |
| 40 | | | | CA1 INPUT, not connected |
| 41 | | | | CA2 OUTPUT, A on strobe multiplexer |
| 42 | | | | IRQA Not connected |
| 43 | | | | |
| 44 | | | | CB2 IC19 Triac switch |
| 45 | | | | Port B triacs |
| 46 | |
| 47 | 9800 |R/W| D D D D D D D D | PIA6821 IC4 |
| 48 | | | | PA0-PA6 INPUT Yellow 15 way data (7SEG LED or Meters) |
| 49 | | | | PA7 802 (Q) IC11 G1 |
| 50 | | | | PB0-PB7 INPUT IC24 |
| 51 | | | | CA2 OUTPUT, B on strobe multiplexer |
| 52 | | | | CB2 TRiac switch |
| 53 | |
| 54 | A000-A003 |R/W| D D D D D D D D | PIA6821 IC5 port A Reel drives |
| 55 | | | | port B Reel opto |
| 56 | | | | |
| 57 | | | | CA2 OUTPUT, C on strobe multiplexer |
| 58 | | | | CB2 TRiac switch |
| 59 | -----------+---+-----------------+-------------------------------------------------------------------------- |
| 60 | A800-A803 |R/W| D D D D D D D D | PIA6821 IC6 PA0-PA7, AUX1 connector (ALPHA) |
| 61 | | | | PB0-PB7, AUX2 connector |
| 62 | | | | |
| 63 | | | | |
| 64 | |
| 65 | -----------+---+-----------------+-------------------------------------------------------------------------- |
| 66 | ??? B000-FFFF | R | D D D D D D D D | ROM |
| 67 | -----------+---+-----------------+-------------------------------------------------------------------------- |
| 68 | |
| 69 | TODO: - Distinguish door switches using manual |
| 70 | - Add discrete sound functionality (same as MPU4 alarm) |
| 71 | - Is pulse timer ic11 right? |
| 72 | - 12V meter alarm on hyper viper - how are meters sensed? |
| 73 | |
| 74 | ***********************************************************************************************************/ |
| 75 | #include "emu.h" |
| 76 | #include "machine/6821pia.h" |
| 77 | #include "machine/6840ptm.h" |
| 78 | #include "machine/nvram.h" |
| 79 | |
| 80 | #include "cpu/m6800/m6800.h" |
| 81 | #include "machine/steppers.h" |
| 82 | #include "machine/roc10937.h" |
| 83 | #include "machine/meters.h" |
| 84 | |
| 85 | #ifdef MAME_DEBUG |
| 86 | #define MPU3VERBOSE 1 |
| 87 | #else |
| 88 | #define MPU3VERBOSE 0 |
| 89 | #endif |
| 90 | |
| 91 | #define LOG(x) do { if (MPU3VERBOSE) logerror x; } while (0) |
| 92 | |
| 93 | #include "video/awpvid.h" //Fruit Machines Only |
| 94 | |
| 95 | #define MPU3_MASTER_CLOCK (XTAL_4MHz) |
| 96 | |
| 97 | /* Lookup table for CHR data */ |
| 98 | |
| 99 | struct mpu3_chr_table |
| 100 | { |
| 101 | UINT8 call; |
| 102 | UINT8 response; |
| 103 | }; |
| 104 | |
| 105 | class mpu3_state : public driver_device |
| 106 | { |
| 107 | public: |
| 108 | mpu3_state(running_machine &machine, const driver_device_config_base &config) |
| 109 | : driver_device(machine, config) { } |
| 110 | |
| 111 | |
| 112 | int m_alpha_data_line; |
| 113 | int m_alpha_clock; |
| 114 | int m_triac_ic3; |
| 115 | int m_triac_ic4; |
| 116 | int m_triac_ic5; |
| 117 | int m_ic3_data; |
| 118 | int m_IC11G1; |
| 119 | int m_IC11G2A; |
| 120 | int m_IC11G2B; |
| 121 | int m_IC11GC; |
| 122 | int m_IC11GB; |
| 123 | int m_IC11GA; |
| 124 | |
| 125 | int m_ic10_output; |
| 126 | int m_ic11_active; |
| 127 | int m_ic11_output; |
| 128 | int m_disp_func; |
| 129 | |
| 130 | int m_ic4_input_a; |
| 131 | int m_aux1_input; |
| 132 | int m_aux2_input; |
| 133 | int m_input_strobe; /* IC11 74LS138 A = CA2 IC3, B = CA2 IC4, C = CA2 IC5 */ |
| 134 | UINT8 m_lamp_strobe; |
| 135 | UINT8 m_led_strobe; |
| 136 | int m_signal_50hz; |
| 137 | |
| 138 | const mpu3_chr_table* m_current_chr_table; |
| 139 | int m_prot_col; |
| 140 | |
| 141 | int m_optic_pattern; |
| 142 | |
| 143 | emu_timer *m_ic21_timer; |
| 144 | }; |
| 145 | |
| 146 | #define DISPLAY_PORT 0 |
| 147 | #define METER_PORT 1 |
| 148 | #define BWB_FUNCTIONALITY 2 |
| 149 | static TIMER_CALLBACK( ic21_timeout ); |
| 150 | |
| 151 | static void update_triacs(running_machine &machine) |
| 152 | { |
| 153 | mpu3_state *state = machine.driver_data<mpu3_state>(); |
| 154 | int i,triacdata; |
| 155 | |
| 156 | triacdata=state->m_triac_ic3 + (state->m_triac_ic4 << 8) + (state->m_triac_ic5 << 9); |
| 157 | |
| 158 | for (i = 0; i < 8; i++) |
| 159 | { |
| 160 | output_set_indexed_value("triac", i, triacdata & (1 << i)); |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | /* called if board is reset */ |
| 165 | static void mpu3_stepper_reset(running_machine &machine) |
| 166 | { |
| 167 | mpu3_state *state = machine.driver_data<mpu3_state>(); |
| 168 | int pattern = 0,reel; |
| 169 | for (reel = 0; reel < 6; reel++) |
| 170 | { |
| 171 | stepper_reset_position(reel); |
| 172 | if (stepper_optic_state(reel)) pattern |= 1<<reel; |
| 173 | } |
| 174 | state->m_optic_pattern = pattern; |
| 175 | } |
| 176 | |
| 177 | static MACHINE_RESET( mpu3 ) |
| 178 | { |
| 179 | mpu3_state *state = machine.driver_data<mpu3_state>(); |
| 180 | ROC10937_reset(0); /* reset display1 */ |
| 181 | |
| 182 | mpu3_stepper_reset(machine); |
| 183 | |
| 184 | state->m_lamp_strobe = 0; |
| 185 | state->m_led_strobe = 0; |
| 186 | |
| 187 | state->m_IC11GC = 0; |
| 188 | state->m_IC11GB = 0; |
| 189 | state->m_IC11GA = 0; |
| 190 | state->m_IC11G1 = 1; |
| 191 | state->m_IC11G2A = 0; |
| 192 | state->m_IC11G2B = 0; |
| 193 | } |
| 194 | |
| 195 | /* 6808 IRQ handler */ |
| 196 | static WRITE_LINE_DEVICE_HANDLER( cpu0_irq ) |
| 197 | { |
| 198 | device_t *pia3 = device->machine().device("pia_ic3"); |
| 199 | device_t *pia4 = device->machine().device("pia_ic4"); |
| 200 | device_t *pia5 = device->machine().device("pia_ic5"); |
| 201 | device_t *pia6 = device->machine().device("pia_ic6"); |
| 202 | device_t *ptm2 = device->machine().device("ptm_ic2"); |
| 203 | |
| 204 | /* The PIA and PTM IRQ lines are all connected to a common PCB track, leading directly to the 6809 IRQ line. */ |
| 205 | int combined_state = pia6821_get_irq_a(pia3) | pia6821_get_irq_b(pia3) | |
| 206 | pia6821_get_irq_a(pia4) | pia6821_get_irq_b(pia4) | |
| 207 | pia6821_get_irq_a(pia5) | pia6821_get_irq_b(pia5) | |
| 208 | pia6821_get_irq_a(pia6) | pia6821_get_irq_b(pia6) | |
| 209 | ptm6840_get_irq(ptm2); |
| 210 | |
| 211 | cputag_set_input_line(device->machine(), "maincpu", M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); |
| 212 | LOG(("6808 int%d \n", combined_state)); |
| 213 | } |
| 214 | |
| 215 | |
| 216 | /* IC2 6840 PTM handler probably clocked from elsewhere*/ |
| 217 | static WRITE8_DEVICE_HANDLER( ic2_o1_callback ) |
| 218 | { |
| 219 | } |
| 220 | |
| 221 | //FIXME FROM HERE |
| 222 | static WRITE8_DEVICE_HANDLER( ic2_o2_callback ) |
| 223 | { |
| 224 | } |
| 225 | |
| 226 | |
| 227 | static WRITE8_DEVICE_HANDLER( ic2_o3_callback ) |
| 228 | { |
| 229 | } |
| 230 | |
| 231 | |
| 232 | static const ptm6840_interface ptm_ic2_intf = |
| 233 | { |
| 234 | MPU3_MASTER_CLOCK,///4, |
| 235 | { 0, 0, 0 }, |
| 236 | { DEVCB_HANDLER(ic2_o1_callback), |
| 237 | DEVCB_HANDLER(ic2_o2_callback), |
| 238 | DEVCB_HANDLER(ic2_o3_callback) }, |
| 239 | DEVCB_LINE(cpu0_irq) |
| 240 | }; |
| 241 | |
| 242 | /* |
| 243 | IC23 emulation |
| 244 | |
| 245 | IC23 is a 74LS138 1-of-8 Decoder |
| 246 | |
| 247 | It is used as a multiplexer for the LEDs, lamp selects and inputs.*/ |
| 248 | |
| 249 | static void ic11_update(mpu3_state *state) |
| 250 | { |
| 251 | if (!state->m_IC11G2A) |
| 252 | { |
| 253 | if (!state->m_IC11G2B) |
| 254 | { |
| 255 | if (state->m_IC11G1) |
| 256 | { |
| 257 | if ( state->m_IC11GA ) state->m_input_strobe |= 0x01; |
| 258 | else state->m_input_strobe &= ~0x01; |
| 259 | |
| 260 | if ( state->m_IC11GB ) state->m_input_strobe |= 0x02; |
| 261 | else state->m_input_strobe &= ~0x02; |
| 262 | |
| 263 | if ( state->m_IC11GC ) state->m_input_strobe |= 0x04; |
| 264 | else state->m_input_strobe &= ~0x04; |
| 265 | } |
| 266 | } |
| 267 | } |
| 268 | else |
| 269 | if ((state->m_IC11G2A)||(state->m_IC11G2B)||(!state->m_IC11G1)) |
| 270 | { |
| 271 | state->m_input_strobe = 0x00; |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | |
| 276 | /* |
| 277 | IC21 emulation |
| 278 | |
| 279 | IC21 is an 8602 or equivalent pulse generator |
| 280 | |
| 281 | CLEAR and B2 are tied high, so a high to low transition on A2 |
| 282 | (tied to IC11 GA) will trigger operation. |
| 283 | |
| 284 | Cx = 2.2 uF |
| 285 | |
| 286 | Rx = 47k |
| 287 | |
| 288 | K = ~0.34 |
| 289 | |
| 290 | t/ns = .34 * 47 * 2.2e6 [ 1+ (1/47)] |
| 291 | |
| 292 | |
| 293 | This seems less stable than the revised version used in MPU4 |
| 294 | */ |
| 295 | static void ic21_output(mpu3_state *state,int data) |
| 296 | { |
| 297 | state->m_IC11G1 = data; |
| 298 | ic11_update(state); |
| 299 | } |
| 300 | |
| 301 | static void ic21_setup(mpu3_state *state) |
| 302 | { |
| 303 | if (state->m_IC11GA) |
| 304 | { |
| 305 | { |
| 306 | state->m_ic11_active=1; |
| 307 | ic21_output(state,1); |
| 308 | state->m_ic21_timer->adjust(attotime::from_nsec( (0.34 * 47 * 2200000) *(1+(1/47)))); |
| 309 | } |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | static TIMER_CALLBACK( ic21_timeout ) |
| 314 | { |
| 315 | mpu3_state *state = machine.driver_data<mpu3_state>(); |
| 316 | state->m_ic11_active=0; |
| 317 | ic21_output(state,0); |
| 318 | } |
| 319 | |
| 320 | static READ8_DEVICE_HANDLER( pia_ic3_porta_r ) |
| 321 | { |
| 322 | mpu3_state *state = device->machine().driver_data<mpu3_state>(); |
| 323 | static const char *const portnames[] = { "ORANGE1", "ORANGE2", "BLACK1", "BLACK2", "DIL1", "DIL1", "DIL2", "DIL2" }; |
| 324 | int data=0,swizzle; |
| 325 | LOG(("%s: IC3 PIA Read of Port A (MUX input data)\n", device->machine().describe_context())); |
| 326 | popmessage("%x",state->m_input_strobe); |
| 327 | switch (state->m_input_strobe) |
| 328 | { |
| 329 | case 0: |
| 330 | case 1: |
| 331 | case 2: |
| 332 | case 3: |
| 333 | { |
| 334 | data = (input_port_read(device->machine(), portnames[state->m_input_strobe])<<2); |
| 335 | break; |
| 336 | } |
| 337 | case 4://DIL1 |
| 338 | case 6://DIL2 |
| 339 | { |
| 340 | swizzle = (input_port_read(device->machine(), portnames[state->m_input_strobe])); |
| 341 | data = (((swizzle & 0x01) << 7) + ((swizzle & 0x02) << 5) + ((swizzle & 0x04) << 3) |
| 342 | + ((swizzle & 0x08) << 1) +((swizzle & 0x10) >> 1) + ((swizzle & 0x20) >> 3)); |
| 343 | break; |
| 344 | } |
| 345 | case 5://DIL1 |
| 346 | case 7://DIL2 |
| 347 | { |
| 348 | swizzle = (input_port_read(device->machine(), portnames[state->m_input_strobe])); |
| 349 | data = (((swizzle & 0x80) >> 1) + ((swizzle & 0x40) << 1)); |
| 350 | break; |
| 351 | } |
| 352 | } |
| 353 | if (state->m_signal_50hz) |
| 354 | { |
| 355 | data |= 0x02; |
| 356 | } |
| 357 | else |
| 358 | { |
| 359 | data &= ~0x02; |
| 360 | } |
| 361 | return data; |
| 362 | } |
| 363 | |
| 364 | static WRITE8_DEVICE_HANDLER( pia_ic3_portb_w ) |
| 365 | { |
| 366 | mpu3_state *state = device->machine().driver_data<mpu3_state>(); |
| 367 | LOG(("%s: IC3 PIA Port B Set to %2x (Triac)\n", device->machine().describe_context(),data)); |
| 368 | state->m_triac_ic3 =data; |
| 369 | } |
| 370 | |
| 371 | |
| 372 | static WRITE_LINE_DEVICE_HANDLER( pia_ic3_ca2_w ) |
| 373 | { |
| 374 | mpu3_state *mstate = device->machine().driver_data<mpu3_state>(); |
| 375 | LOG(("%s: IC3 PIA Port CA2 Set to %2x (input A)\n", device->machine().describe_context(),state)); |
| 376 | mstate->m_IC11GA = state; |
| 377 | ic21_setup(mstate); |
| 378 | ic11_update(mstate); |
| 379 | } |
| 380 | |
| 381 | static const pia6821_interface pia_ic3_intf = |
| 382 | { |
| 383 | DEVCB_HANDLER(pia_ic3_porta_r), /* port A in */ |
| 384 | DEVCB_NULL, /* port B in */ |
| 385 | DEVCB_NULL, /* line CA1 in */ |
| 386 | DEVCB_NULL, /* line CB1 in */ |
| 387 | DEVCB_NULL, /* line CA2 in */ |
| 388 | DEVCB_NULL, /* line CB2 in */ |
| 389 | DEVCB_NULL, /* port A out */ |
| 390 | DEVCB_HANDLER(pia_ic3_portb_w), /* port B out */ |
| 391 | DEVCB_LINE(pia_ic3_ca2_w), /* line CA2 out */ |
| 392 | DEVCB_NULL, /* port CB2 out */ |
| 393 | DEVCB_NULL, /* IRQA */ |
| 394 | DEVCB_LINE(cpu0_irq) /* IRQB */ |
| 395 | }; |
| 396 | |
| 397 | static READ8_DEVICE_HANDLER( pia_ic4_porta_r ) |
| 398 | { |
| 399 | mpu3_state *state = device->machine().driver_data<mpu3_state>(); |
| 400 | if (state->m_ic11_active) |
| 401 | { |
| 402 | state->m_ic4_input_a|=0x80; |
| 403 | } |
| 404 | else |
| 405 | { |
| 406 | state->m_ic4_input_a&=~0x80; |
| 407 | } |
| 408 | return state->m_ic4_input_a; |
| 409 | } |
| 410 | |
| 411 | /* IC4, 7 seg leds */ |
| 412 | static WRITE8_DEVICE_HANDLER( pia_ic4_porta_w ) |
| 413 | { |
| 414 | mpu3_state *state = device->machine().driver_data<mpu3_state>(); |
| 415 | int meter,swizzle; |
| 416 | LOG(("%s: IC4 PIA Port A Set to %2x (DISPLAY PORT)\n", device->machine().describe_context(),data)); |
| 417 | state->m_ic4_input_a=data; |
| 418 | switch (state->m_disp_func) |
| 419 | { |
| 420 | case DISPLAY_PORT: |
| 421 | if(state->m_ic11_active) |
| 422 | { |
| 423 | if(state->m_led_strobe != state->m_input_strobe) |
| 424 | { |
| 425 | swizzle = ((state->m_ic4_input_a & 0x01) << 2)+(state->m_ic4_input_a & 0x02)+((state->m_ic4_input_a & 0x4) >> 2)+(state->m_ic4_input_a & 0x08)+((state->m_ic4_input_a & 0x10) << 2)+(state->m_ic4_input_a & 0x20)+((state->m_ic4_input_a & 0x40) >> 2); |
| 426 | output_set_digit_value(7 - state->m_input_strobe,swizzle); |
| 427 | } |
| 428 | state->m_led_strobe = state->m_input_strobe; |
| 429 | } |
| 430 | break; |
| 431 | |
| 432 | case METER_PORT: |
| 433 | for (meter = 0; meter < 6; meter ++) |
| 434 | { |
| 435 | swizzle = ((state->m_ic4_input_a ^ 0xff) & 0x3f); |
| 436 | MechMtr_update(meter, (swizzle & (1 << meter))); |
| 437 | } |
| 438 | break; |
| 439 | |
| 440 | case BWB_FUNCTIONALITY: |
| 441 | //Need to find a game to work this out, MFME has a specific option for it, but I see no activity there. |
| 442 | break; |
| 443 | |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | static WRITE8_DEVICE_HANDLER( pia_ic4_portb_w ) |
| 448 | { |
| 449 | mpu3_state *state = device->machine().driver_data<mpu3_state>(); |
| 450 | LOG(("%s: IC4 PIA Port B Set to %2x (Lamp)\n", device->machine().describe_context(),data)); |
| 451 | int i; |
| 452 | if(state->m_ic11_active) |
| 453 | { |
| 454 | if (state->m_lamp_strobe != state->m_input_strobe) |
| 455 | { |
| 456 | // Because of the nature of the lamping circuit, there is an element of persistance where the lamp retains residual charge |
| 457 | // As a consequence, the lamp column data can change before the input strobe (effectively writing 0 to the previous strobe) |
| 458 | // without causing the relevant lamps to black out. |
| 459 | |
| 460 | for (i = 0; i < 8; i++) |
| 461 | { |
| 462 | output_set_lamp_value((8*state->m_input_strobe)+i, ((data & (1 << i)) !=0)); |
| 463 | } |
| 464 | state->m_lamp_strobe = state->m_input_strobe; |
| 465 | } |
| 466 | } |
| 467 | } |
| 468 | |
| 469 | static WRITE_LINE_DEVICE_HANDLER( pia_ic4_ca2_w ) |
| 470 | { |
| 471 | mpu3_state *mstate = device->machine().driver_data<mpu3_state>(); |
| 472 | LOG(("%s: IC4 PIA Port CA2 Set to %2x (Input B)\n", device->machine().describe_context(),state)); |
| 473 | mstate->m_IC11GB = state; |
| 474 | ic11_update(mstate); |
| 475 | } |
| 476 | |
| 477 | static WRITE_LINE_DEVICE_HANDLER( pia_ic4_cb2_w ) |
| 478 | { |
| 479 | mpu3_state *mstate = device->machine().driver_data<mpu3_state>(); |
| 480 | LOG(("%s: IC4 PIA Port CA2 Set to %2x (Triac)\n", device->machine().describe_context(),state)); |
| 481 | mstate->m_triac_ic4=state; |
| 482 | } |
| 483 | |
| 484 | static const pia6821_interface pia_ic4_intf = |
| 485 | { |
| 486 | DEVCB_HANDLER(pia_ic4_porta_r), /* port A in */ |
| 487 | DEVCB_NULL, /* port B in */ |
| 488 | DEVCB_NULL, /* line CA1 in */ |
| 489 | DEVCB_NULL, /* line CB1 in */ |
| 490 | DEVCB_NULL, /* line CA2 in */ |
| 491 | DEVCB_NULL, /* line CB2 in */ |
| 492 | DEVCB_HANDLER(pia_ic4_porta_w), /* port A out */ |
| 493 | DEVCB_HANDLER(pia_ic4_portb_w), /* port B out */ |
| 494 | DEVCB_LINE(pia_ic4_ca2_w), /* line CA2 out */ |
| 495 | DEVCB_LINE(pia_ic4_cb2_w), /* line CB2 out */ |
| 496 | DEVCB_LINE(cpu0_irq), /* IRQA */ |
| 497 | DEVCB_NULL /* IRQB */ |
| 498 | }; |
| 499 | |
| 500 | /* IC5, AUX ports, coin lockouts and AY sound chip select (MODs below 4 only) */ |
| 501 | static WRITE8_DEVICE_HANDLER( pia_ic5_porta_w ) |
| 502 | { |
| 503 | mpu3_state *state = device->machine().driver_data<mpu3_state>(); |
| 504 | |
| 505 | LOG(("%s: IC5 PIA Port A Set to %2x (Reel)\n", device->machine().describe_context(),data)); |
| 506 | stepper_update(0, data & 0x03 ); |
| 507 | stepper_update(1, (data>>2) & 0x03 ); |
| 508 | stepper_update(2, (data>>4) & 0x03 ); |
| 509 | stepper_update(3, (data>>6) & 0x03 ); |
| 510 | awp_draw_reel(0); |
| 511 | awp_draw_reel(1); |
| 512 | awp_draw_reel(2); |
| 513 | awp_draw_reel(3); |
| 514 | |
| 515 | { |
| 516 | if ( stepper_optic_state(0) ) state->m_optic_pattern |= 0x01; |
| 517 | else state->m_optic_pattern &= ~0x01; |
| 518 | |
| 519 | if ( stepper_optic_state(1) ) state->m_optic_pattern |= 0x02; |
| 520 | else state->m_optic_pattern &= ~0x02; |
| 521 | if ( stepper_optic_state(2) ) state->m_optic_pattern |= 0x04; |
| 522 | else state->m_optic_pattern &= ~0x04; |
| 523 | |
| 524 | if ( stepper_optic_state(3) ) state->m_optic_pattern |= 0x08; |
| 525 | else state->m_optic_pattern &= ~0x08; |
| 526 | |
| 527 | } |
| 528 | |
| 529 | } |
| 530 | |
| 531 | static READ8_DEVICE_HANDLER( pia_ic5_portb_r ) |
| 532 | { |
| 533 | mpu3_state *state = device->machine().driver_data<mpu3_state>(); |
| 534 | if (state->m_ic3_data & 0x80 ) |
| 535 | { |
| 536 | return state->m_optic_pattern; |
| 537 | } |
| 538 | else |
| 539 | { |
| 540 | return state->m_ic3_data; |
| 541 | } |
| 542 | } |
| 543 | |
| 544 | |
| 545 | |
| 546 | static WRITE8_DEVICE_HANDLER( pia_ic5_portb_w ) |
| 547 | { |
| 548 | mpu3_state *state = device->machine().driver_data<mpu3_state>(); |
| 549 | state->m_ic3_data = data; |
| 550 | } |
| 551 | |
| 552 | static WRITE_LINE_DEVICE_HANDLER( pia_ic5_ca2_w ) |
| 553 | { |
| 554 | mpu3_state *mstate = device->machine().driver_data<mpu3_state>(); |
| 555 | LOG(("%s: IC5 PIA Port CA2 Set to %2x (C)\n", device->machine().describe_context(),state)); |
| 556 | mstate->m_IC11GC = state; |
| 557 | ic11_update(mstate); |
| 558 | } |
| 559 | |
| 560 | static WRITE_LINE_DEVICE_HANDLER( pia_ic5_cb2_w ) |
| 561 | { |
| 562 | mpu3_state *mstate = device->machine().driver_data<mpu3_state>(); |
| 563 | LOG(("%s: IC5 PIA Port CB2 Set to %2x (Triac)\n", device->machine().describe_context(),state)); |
| 564 | mstate->m_triac_ic5 = state; |
| 565 | } |
| 566 | |
| 567 | static const pia6821_interface pia_ic5_intf = |
| 568 | { |
| 569 | DEVCB_NULL, /* port A in */ |
| 570 | DEVCB_HANDLER(pia_ic5_portb_r), /* port B in */ |
| 571 | DEVCB_NULL, /* line CA1 in */ |
| 572 | DEVCB_NULL, /* line CB1 in */ |
| 573 | DEVCB_NULL, /* line CA2 in */ |
| 574 | DEVCB_NULL, /* line CB2 in */ |
| 575 | DEVCB_HANDLER(pia_ic5_porta_w), /* port A out */ |
| 576 | DEVCB_HANDLER(pia_ic5_portb_w), /* port B out */ |
| 577 | DEVCB_LINE(pia_ic5_ca2_w), /* line CA2 out */ |
| 578 | DEVCB_LINE(pia_ic5_cb2_w), /* port CB2 out */ |
| 579 | DEVCB_NULL, /* IRQA */ |
| 580 | DEVCB_NULL /* IRQB */ |
| 581 | }; |
| 582 | |
| 583 | |
| 584 | /* IC6, AUX ports*/ |
| 585 | static READ8_DEVICE_HANDLER( pia_ic6_porta_r ) |
| 586 | { |
| 587 | mpu3_state *state = device->machine().driver_data<mpu3_state>(); |
| 588 | return (input_port_read(device->machine(), "AUX1"))|state->m_aux1_input; |
| 589 | } |
| 590 | |
| 591 | |
| 592 | static READ8_DEVICE_HANDLER( pia_ic6_portb_r ) |
| 593 | { |
| 594 | mpu3_state *state = device->machine().driver_data<mpu3_state>(); |
| 595 | return (input_port_read(device->machine(), "AUX2"))|state->m_aux2_input; |
| 596 | } |
| 597 | |
| 598 | static WRITE8_DEVICE_HANDLER( pia_ic6_porta_w ) |
| 599 | { |
| 600 | mpu3_state *state = device->machine().driver_data<mpu3_state>(); |
| 601 | LOG(("%s: IC6 PIA Port A Set to %2x (Alpha)\n", device->machine().describe_context(),data)); |
| 602 | if ( data & 0x08 ) ROC10937_reset(0); |
| 603 | |
| 604 | state->m_alpha_data_line = ((data & 0x20) >> 5); |
| 605 | if ( !state->m_alpha_clock && (data & 0x10) ) |
| 606 | { |
| 607 | ROC10937_shift_data(0, state->m_alpha_data_line&0x01?0:1); |
| 608 | } |
| 609 | state->m_alpha_clock = (data & 0x10); |
| 610 | |
| 611 | ROC10937_draw_16seg(0); |
| 612 | } |
| 613 | |
| 614 | static WRITE8_DEVICE_HANDLER( pia_ic6_portb_w ) |
| 615 | { |
| 616 | mpu3_state *state = device->machine().driver_data<mpu3_state>(); |
| 617 | LOG(("%s: IC6 PIA Port B Set to %2x (AUX2)\n", device->machine().describe_context(),data)); |
| 618 | state->m_aux2_input = data; |
| 619 | } |
| 620 | |
| 621 | static const pia6821_interface pia_ic6_intf = |
| 622 | { |
| 623 | DEVCB_HANDLER(pia_ic6_porta_r), /* port A in */ |
| 624 | DEVCB_HANDLER(pia_ic6_portb_r), /* port B in */ |
| 625 | DEVCB_NULL, /* line CA1 in */ |
| 626 | DEVCB_NULL, /* line CB1 in */ |
| 627 | DEVCB_NULL, /* line CA2 in */ |
| 628 | DEVCB_NULL, /* line CB2 in */ |
| 629 | DEVCB_HANDLER(pia_ic6_porta_w), /* port A out */ |
| 630 | DEVCB_HANDLER(pia_ic6_portb_w), /* port B out */ |
| 631 | DEVCB_NULL, /* line CA2 out */ |
| 632 | DEVCB_NULL, /* port CB2 out */ |
| 633 | DEVCB_LINE(cpu0_irq), /* IRQA */ |
| 634 | DEVCB_LINE(cpu0_irq) /* IRQB */ |
| 635 | }; |
| 636 | |
| 637 | static INPUT_PORTS_START( mpu3 ) |
| 638 | PORT_START("ORANGE1") |
| 639 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cancel") |
| 640 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("01") |
| 641 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("02") |
| 642 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("03") |
| 643 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("04") |
| 644 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("05") |
| 645 | |
| 646 | |
| 647 | PORT_START("ORANGE2") |
| 648 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("08") |
| 649 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("09") |
| 650 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Exchange") |
| 651 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("11") |
| 652 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("12") |
| 653 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("13") |
| 654 | |
| 655 | PORT_START("BLACK1") |
| 656 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Hi") |
| 657 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Lo") |
| 658 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Auto Nudge") |
| 659 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Button") PORT_CODE(KEYCODE_W) |
| 660 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE |
| 661 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Cashbox Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE |
| 662 | |
| 663 | PORT_START("BLACK2") |
| 664 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("20p") |
| 665 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("10p") |
| 666 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Token") |
| 667 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Hold 1") |
| 668 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Hold 2") |
| 669 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("Hold 3") |
| 670 | |
| 671 | PORT_START("DIL1") |
| 672 | PORT_DIPNAME( 0x80, 0x00, "DIL101" ) PORT_DIPLOCATION("DIL1:01") |
| 673 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 674 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 675 | PORT_DIPNAME( 0x40, 0x00, "DIL102" ) PORT_DIPLOCATION("DIL1:02") |
| 676 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 677 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 678 | PORT_DIPNAME( 0x20, 0x00, "DIL103" ) PORT_DIPLOCATION("DIL1:03") |
| 679 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 680 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 681 | PORT_DIPNAME( 0x10, 0x00, "DIL104" ) PORT_DIPLOCATION("DIL1:04") |
| 682 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 683 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 684 | PORT_DIPNAME( 0x08, 0x00, "DIL105" ) PORT_DIPLOCATION("DIL1:05") |
| 685 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 686 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 687 | PORT_DIPNAME( 0x04, 0x00, "DIL106" ) PORT_DIPLOCATION("DIL1:06") |
| 688 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 689 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 690 | PORT_DIPNAME( 0x02, 0x00, "DIL107" ) PORT_DIPLOCATION("DIL1:07") |
| 691 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 692 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 693 | PORT_DIPNAME( 0x01, 0x00, "DIL108" ) PORT_DIPLOCATION("DIL1:08") |
| 694 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 695 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 696 | |
| 697 | PORT_START("DIL2") |
| 698 | PORT_DIPNAME( 0x80, 0x00, "DIL201" ) PORT_DIPLOCATION("DIL2:01") |
| 699 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 700 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 701 | PORT_DIPNAME( 0x40, 0x00, "DIL202" ) PORT_DIPLOCATION("DIL2:02") |
| 702 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 703 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 704 | PORT_DIPNAME( 0x20, 0x00, "DIL203" ) PORT_DIPLOCATION("DIL2:03") |
| 705 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 706 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 707 | PORT_DIPNAME( 0x10, 0x00, "DIL204" ) PORT_DIPLOCATION("DIL2:04") |
| 708 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 709 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 710 | PORT_DIPNAME( 0x08, 0x00, "DIL205" ) PORT_DIPLOCATION("DIL2:05") |
| 711 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 712 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 713 | PORT_DIPNAME( 0x04, 0x00, "DIL206" ) PORT_DIPLOCATION("DIL2:06") |
| 714 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 715 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 716 | PORT_DIPNAME( 0x02, 0x00, "DIL207" ) PORT_DIPLOCATION("DIL2:07") |
| 717 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 718 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 719 | PORT_DIPNAME( 0x01, 0x00, "DIL208" ) PORT_DIPLOCATION("DIL2:08") |
| 720 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 721 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 722 | |
| 723 | PORT_START("AUX1") |
| 724 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("0") |
| 725 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("1") |
| 726 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("2") |
| 727 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("3") |
| 728 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("4") |
| 729 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5") |
| 730 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("6") |
| 731 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("7") |
| 732 | |
| 733 | PORT_START("AUX2") |
| 734 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SPECIAL) |
| 735 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SPECIAL) |
| 736 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SPECIAL) |
| 737 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SPECIAL) |
| 738 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) |
| 739 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5) |
| 740 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5) |
| 741 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5) |
| 742 | INPUT_PORTS_END |
| 743 | |
| 744 | static const stepper_interface mpu3_reel_interface = |
| 745 | { |
| 746 | MPU3_48STEP_REEL, |
| 747 | 92, |
| 748 | 2, |
| 749 | 0x00 |
| 750 | }; |
| 751 | |
| 752 | /* Common configurations */ |
| 753 | static void mpu3_config_common(running_machine &machine) |
| 754 | { |
| 755 | mpu3_state *state = machine.driver_data<mpu3_state>(); |
| 756 | state->m_ic21_timer = machine.scheduler().timer_alloc(FUNC(ic21_timeout)); |
| 757 | } |
| 758 | |
| 759 | static MACHINE_START( mpu3 ) |
| 760 | { |
| 761 | mpu3_config_common(machine); |
| 762 | |
| 763 | /* setup 8 mechanical meters */ |
| 764 | MechMtr_config(machine,8); |
| 765 | |
| 766 | /* setup 4 reels */ |
| 767 | stepper_config(machine, 0, &mpu3_reel_interface); |
| 768 | stepper_config(machine, 1, &mpu3_reel_interface); |
| 769 | stepper_config(machine, 2, &mpu3_reel_interface); |
| 770 | stepper_config(machine, 3, &mpu3_reel_interface); |
| 771 | |
| 772 | /* setup the standard oki MSC1937 display */ |
| 773 | ROC10937_init(0, MSC1937,0); |
| 774 | } |
| 775 | /* |
| 776 | Characteriser (CHR) |
| 777 | |
| 778 | The MPU3 characteriser is surprisingly simple to simulate, as it operates a call, response pairing. The only factor that provides a challenge is that the |
| 779 | address of the PAL in memory varies between games. Once found, the memory location of the data table is easily found from the X register of the CPU. |
| 780 | */ |
| 781 | |
| 782 | static WRITE8_HANDLER( characteriser_w ) |
| 783 | { |
| 784 | mpu3_state *state = space->machine().driver_data<mpu3_state>(); |
| 785 | int x; |
| 786 | int call=data; |
| 787 | if (!state->m_current_chr_table) |
| 788 | fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(&space->device())); |
| 789 | |
| 790 | if (offset == 0) |
| 791 | { |
| 792 | { |
| 793 | if (call == 0) |
| 794 | { |
| 795 | state->m_prot_col = 0; |
| 796 | } |
| 797 | else |
| 798 | { |
| 799 | for (x = state->m_prot_col; x < 64; x++) |
| 800 | { |
| 801 | if (state->m_current_chr_table[(x)].call == call) |
| 802 | { |
| 803 | state->m_prot_col = x; |
| 804 | break; |
| 805 | } |
| 806 | } |
| 807 | } |
| 808 | } |
| 809 | } |
| 810 | } |
| 811 | |
| 812 | |
| 813 | static READ8_HANDLER( characteriser_r ) |
| 814 | { |
| 815 | mpu3_state *state = space->machine().driver_data<mpu3_state>(); |
| 816 | if (!state->m_current_chr_table) |
| 817 | fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(&space->device())); |
| 818 | |
| 819 | if (offset == 0) |
| 820 | { |
| 821 | return state->m_current_chr_table[state->m_prot_col].response; |
| 822 | } |
| 823 | return 0; |
| 824 | } |
| 825 | |
| 826 | /* generate a 50 Hz signal (some components rely on this for external sync) */ |
| 827 | static TIMER_DEVICE_CALLBACK( gen_50hz ) |
| 828 | { |
| 829 | mpu3_state *state = timer.machine().driver_data<mpu3_state>(); |
| 830 | /* Although reported as a '50Hz' signal, the fact that both rising and |
| 831 | falling edges of the pulse are used means the timer actually gives a 100Hz |
| 832 | oscillating signal.*/ |
| 833 | state->m_signal_50hz = state->m_signal_50hz?0:1; |
| 834 | ptm6840_set_c1(timer.machine().device("ptm_ic2"), 0, state->m_signal_50hz); |
| 835 | pia6821_cb1_w(timer.machine().device("pia_ic3"), ~state->m_signal_50hz); |
| 836 | update_triacs(timer.machine()); |
| 837 | } |
| 838 | |
| 839 | static TIMER_DEVICE_CALLBACK( ic10_callback ) |
| 840 | { |
| 841 | mpu3_state *state = timer.machine().driver_data<mpu3_state>(); |
| 842 | // TODO: Use discrete handler for 555, this is far too simplistic |
| 843 | |
| 844 | state->m_ic10_output = state->m_ic10_output?0:1; |
| 845 | ptm6840_set_c2(timer.machine().device("ptm_ic2"), 0, state->m_ic10_output); |
| 846 | pia6821_ca1_w(timer.machine().device("pia_ic4"), state->m_ic10_output); |
| 847 | |
| 848 | } |
| 849 | static WRITE8_HANDLER( mpu3ptm_w ) |
| 850 | { |
| 851 | device_t *ptm2 = space->machine().device("ptm_ic2"); |
| 852 | |
| 853 | ptm6840_write(ptm2,offset >>2,data);//((offset & 0x1f) >>2),data); |
| 854 | } |
| 855 | |
| 856 | static READ8_HANDLER( mpu3ptm_r ) |
| 857 | { |
| 858 | device_t *ptm2 = space->machine().device("ptm_ic2"); |
| 859 | |
| 860 | return ptm6840_read(ptm2,offset >>2); |
| 861 | } |
| 862 | |
| 863 | static ADDRESS_MAP_START( mpu3_basemap, AS_PROGRAM, 8 ) |
| 864 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram") |
| 865 | AM_RANGE(0x8800, 0x881f) AM_READWRITE(mpu3ptm_r, mpu3ptm_w)/* PTM6840 IC2 */ |
| 866 | AM_RANGE(0x9000, 0x9003) AM_DEVREADWRITE("pia_ic3", pia6821_r, pia6821_w) /* PIA6821 IC3 */ |
| 867 | AM_RANGE(0x9800, 0x9803) AM_DEVREADWRITE("pia_ic4", pia6821_r, pia6821_w) /* PIA6821 IC4 */ |
| 868 | AM_RANGE(0xa000, 0xa003) AM_DEVREADWRITE("pia_ic5", pia6821_r, pia6821_w) /* PIA6821 IC5 */ |
| 869 | AM_RANGE(0xa800, 0xa803) AM_DEVREADWRITE("pia_ic6", pia6821_r, pia6821_w) /* PIA6821 IC6 */ |
| 870 | |
| 871 | AM_RANGE(0x1000, 0xffff) AM_ROM |
| 872 | ADDRESS_MAP_END |
| 873 | |
| 874 | static MACHINE_CONFIG_START( mpu3base, mpu3_state ) |
| 875 | MCFG_MACHINE_START(mpu3) |
| 876 | MCFG_MACHINE_RESET(mpu3) |
| 877 | MCFG_CPU_ADD("maincpu", M6808, MPU3_MASTER_CLOCK)///4) |
| 878 | MCFG_CPU_PROGRAM_MAP(mpu3_basemap) |
| 879 | |
| 880 | MCFG_TIMER_ADD_PERIODIC("50hz",gen_50hz, attotime::from_hz(100)) |
| 881 | MCFG_TIMER_ADD_PERIODIC("555_ic10",ic10_callback, PERIOD_OF_555_ASTABLE(10000,1000,0.0000001)) |
| 882 | |
| 883 | /* 6840 PTM */ |
| 884 | MCFG_PTM6840_ADD("ptm_ic2", ptm_ic2_intf) |
| 885 | |
| 886 | MCFG_PIA6821_ADD("pia_ic3", pia_ic3_intf) |
| 887 | MCFG_PIA6821_ADD("pia_ic4", pia_ic4_intf) |
| 888 | MCFG_PIA6821_ADD("pia_ic5", pia_ic5_intf) |
| 889 | MCFG_PIA6821_ADD("pia_ic6", pia_ic6_intf) |
| 890 | |
| 891 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 892 | |
| 893 | MCFG_DEFAULT_LAYOUT(layout_awpvid16) |
| 894 | MACHINE_CONFIG_END |
| 895 | |
| 896 | |
| 897 | static const mpu3_chr_table hprvpr_data[64] = { |
| 898 | {0x00, 0x00},{0x1a, 0x80},{0x04, 0xec},{0x10, 0x1c},{0x18, 0xf0},{0x0f, 0x28},{0x13, 0x54},{0x1b, 0x04}, |
| 899 | {0x03, 0xa4},{0x07, 0xac},{0x17, 0x3c},{0x1d, 0xf4},{0x16, 0x48},{0x15, 0x54},{0x0b, 0x00},{0x08, 0xc4}, |
| 900 | {0x19, 0x88},{0x01, 0x7c},{0x02, 0xf4},{0x05, 0x48},{0x0c, 0x54},{0x09, 0x04},{0x11, 0xc0},{0x14, 0xc8}, |
| 901 | {0x0a, 0x7c},{0x1f, 0xf4},{0x06, 0x6c},{0x0e, 0x70},{0x1c, 0x00},{0x12, 0xa4},{0x1e, 0x8c},{0x0d, 0x5c}, |
| 902 | {0x14, 0xf0},{0x0a, 0x28},{0x19, 0x30},{0x15, 0x40},{0x06, 0xe4},{0x0f, 0x88},{0x08, 0x5c},{0x1b, 0x94}, |
| 903 | {0x1e, 0x0c},{0x04, 0x74},{0x01, 0x40},{0x0c, 0xc4},{0x18, 0x8c},{0x1a, 0x7c},{0x11, 0xd4},{0x0b, 0x08}, |
| 904 | {0x03, 0x34},{0x17, 0x40},{0x10, 0xa4},{0x1d, 0xe8},{0x0e, 0x78},{0x07, 0x90},{0x12, 0x0c},{0x09, 0x54}, |
| 905 | {0x0d, 0x04},{0x1f, 0xc0},{0x16, 0xc8},{0x05, 0x78},{0x13, 0xd4},{0x1c, 0x0c},{0x02, 0x74},{0x00, 0x00}, |
| 906 | }; |
| 907 | |
| 908 | static DRIVER_INIT (m_hprvpr) |
| 909 | { |
| 910 | mpu3_state *state = machine.driver_data<mpu3_state>(); |
| 911 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 912 | |
| 913 | state->m_disp_func=METER_PORT; |
| 914 | state->m_current_chr_table = hprvpr_data; |
| 915 | space->install_legacy_readwrite_handler(0xc000, 0xc000 , FUNC(characteriser_r),FUNC(characteriser_w)); |
| 916 | |
| 917 | } |
| 918 | |
| 919 | ROM_START( mpu3utst ) |
| 920 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) |
| 921 | ROM_LOAD( "ut5.bin", 0x7800, 0x0800, CRC(89994adb) SHA1(03e38a860b6ba9d7ae2dbfa7845e85bcf67a6f4d)) |
| 922 | ROM_RELOAD(0xF800, 0x0800) |
| 923 | ROM_END |
| 924 | |
| 925 | ROM_START( m_hprvpr ) |
| 926 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) |
| 927 | ROM_LOAD( "hv.p3", 0x2000, 0x2000, CRC(63f8e04f) SHA1(9bfe06a6ea8c308e4a7035752722babbfd792160)) |
| 928 | ROM_RELOAD(0xc000, 0x2000) |
| 929 | ROM_LOAD( "hv.p2", 0x4000, 0x2000, CRC(b3b6f19e) SHA1(b2251dbe632b04ea7b5952b8a6217605b0df904c)) |
| 930 | ROM_RELOAD(0xc000, 0x2000) |
| 931 | ROM_LOAD( "hv.p1", 0x6000, 0x2000, CRC(05c0cf97) SHA1(085f432b608cec6054f1e03cf24ca80d3949a0de)) |
| 932 | ROM_RELOAD(0xe000, 0x2000) |
| 933 | ROM_END |
| 934 | |
| 935 | // year, name, parent, machine, input, init, monitor, company, fullname, flags |
| 936 | //Diagnostic ROMs |
| 937 | GAME( 198?, mpu3utst, 0, mpu3base, mpu3, 0, ROT0, "Barcrest", "MPU3 Unit Test (Program 5)", GAME_NO_SOUND ) |
| 938 | GAME( 198?, m_hprvpr, 0, mpu3base, mpu3, m_hprvpr, ROT0, "Barcrest", "Hyper Viper", GAME_NO_SOUND|GAME_UNEMULATED_PROTECTION ) |
src/mame/drivers/segas24.c
| r11224 | r11225 | |
| 331 | 331 | just made a copy & renamed them for now to avoid any conflicts |
| 332 | 332 | */ |
| 333 | 333 | |
| 334 | #define ADDRESS_MAP_MODERN |
| 334 | 335 | #include "emu.h" |
| 335 | 336 | #include "deprecat.h" |
| 336 | 337 | #include "cpu/m68000/m68000.h" |
| r11224 | r11225 | |
| 343 | 344 | |
| 344 | 345 | #define MASTER_CLOCK XTAL_20MHz |
| 345 | 346 | #define VIDEO_CLOCK XTAL_32MHz |
| 347 | #define TIMER_CLOCK (VIDEO_CLOCK/4) |
| 348 | #define HSYNC_CLOCK (VIDEO_CLOCK/2/656.0) |
| 346 | 349 | |
| 347 | | |
| 348 | 350 | // Floppy Fisk Controller |
| 349 | 351 | |
| 350 | | |
| 351 | | static void fdc_init(running_machine &machine) |
| 352 | void segas24_state::fdc_init() |
| 352 | 353 | { |
| 353 | | segas24_state *state = machine.driver_data<segas24_state>(); |
| 354 | | state->m_fdc_status = 0; |
| 355 | | state->m_fdc_track = 0; |
| 356 | | state->m_fdc_sector = 0; |
| 357 | | state->m_fdc_data = 0; |
| 358 | | state->m_fdc_phys_track = 0; |
| 359 | | state->m_fdc_irq = 0; |
| 360 | | state->m_fdc_drq = 0; |
| 361 | | state->m_fdc_index_count = 0; |
| 354 | fdc_status = 0; |
| 355 | fdc_track = 0; |
| 356 | fdc_sector = 0; |
| 357 | fdc_data = 0; |
| 358 | fdc_phys_track = 0; |
| 359 | fdc_irq = 0; |
| 360 | fdc_drq = 0; |
| 361 | fdc_index_count = 0; |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | | static READ16_HANDLER( fdc_r ) |
| 364 | READ16_MEMBER( segas24_state::fdc_r ) |
| 365 | 365 | { |
| 366 | | segas24_state *state = space->machine().driver_data<segas24_state>(); |
| 367 | | if(!state->m_track_size) |
| 366 | if(!track_size) |
| 368 | 367 | return 0xffff; |
| 369 | 368 | |
| 370 | 369 | switch(offset) { |
| 371 | 370 | case 0: |
| 372 | | state->m_fdc_irq = 0; |
| 373 | | return state->m_fdc_status; |
| 371 | fdc_irq = 0; |
| 372 | return fdc_status; |
| 374 | 373 | case 1: |
| 375 | | return state->m_fdc_track; |
| 374 | return fdc_track; |
| 376 | 375 | case 2: |
| 377 | | return state->m_fdc_sector; |
| 376 | return fdc_sector; |
| 378 | 377 | case 3: |
| 379 | 378 | default: { |
| 380 | | int res = state->m_fdc_data; |
| 381 | | if(state->m_fdc_drq) { |
| 382 | | state->m_fdc_span--; |
| 383 | | // logerror("Read %02x (%d)\n", res, state->m_fdc_span); |
| 384 | | if(state->m_fdc_span) { |
| 385 | | state->m_fdc_pt++; |
| 386 | | state->m_fdc_data = *state->m_fdc_pt; |
| 379 | int res = fdc_data; |
| 380 | if(fdc_drq) { |
| 381 | fdc_span--; |
| 382 | // logerror("Read %02x (%d)\n", res, fdc_span); |
| 383 | if(fdc_span) { |
| 384 | fdc_pt++; |
| 385 | fdc_data = *fdc_pt; |
| 387 | 386 | } else { |
| 388 | 387 | logerror("FDC: transfert complete\n"); |
| 389 | | state->m_fdc_drq = 0; |
| 390 | | state->m_fdc_status = 0; |
| 391 | | state->m_fdc_irq = 1; |
| 388 | fdc_drq = 0; |
| 389 | fdc_status = 0; |
| 390 | fdc_irq = 1; |
| 392 | 391 | } |
| 393 | 392 | } else |
| 394 | 393 | logerror("FDC: data read with drq down\n"); |
| r11224 | r11225 | |
| 397 | 396 | } |
| 398 | 397 | } |
| 399 | 398 | |
| 400 | | static WRITE16_HANDLER( fdc_w ) |
| 399 | WRITE16_MEMBER( segas24_state::fdc_w ) |
| 401 | 400 | { |
| 402 | | segas24_state *state = space->machine().driver_data<segas24_state>(); |
| 403 | | if(!state->m_track_size) |
| 401 | if(!track_size) |
| 404 | 402 | return; |
| 405 | 403 | |
| 406 | 404 | if(ACCESSING_BITS_0_7) { |
| 407 | 405 | data &= 0xff; |
| 408 | 406 | switch(offset) { |
| 409 | 407 | case 0: |
| 410 | | state->m_fdc_irq = 0; |
| 408 | fdc_irq = 0; |
| 411 | 409 | switch(data >> 4) { |
| 412 | 410 | case 0x0: |
| 413 | 411 | logerror("FDC: Restore\n"); |
| 414 | | state->m_fdc_phys_track = state->m_fdc_track = 0; |
| 415 | | state->m_fdc_irq = 1; |
| 416 | | state->m_fdc_status = 4; |
| 412 | fdc_phys_track = fdc_track = 0; |
| 413 | fdc_irq = 1; |
| 414 | fdc_status = 4; |
| 417 | 415 | break; |
| 418 | 416 | case 0x1: |
| 419 | | logerror("FDC: Seek %d\n", state->m_fdc_data); |
| 420 | | state->m_fdc_phys_track = state->m_fdc_track = state->m_fdc_data; |
| 421 | | state->m_fdc_irq = 1; |
| 422 | | state->m_fdc_status = state->m_fdc_track ? 0 : 4; |
| 417 | logerror("FDC: Seek %d\n", fdc_data); |
| 418 | fdc_phys_track = fdc_track = fdc_data; |
| 419 | fdc_irq = 1; |
| 420 | fdc_status = fdc_track ? 0 : 4; |
| 423 | 421 | break; |
| 424 | 422 | case 0x9: |
| 425 | | logerror("Read multiple [%02x] %d..%d side %d track %d\n", data, state->m_fdc_sector, state->m_fdc_sector+state->m_fdc_data-1, data & 8 ? 1 : 0, state->m_fdc_phys_track); |
| 426 | | state->m_fdc_pt = space->machine().region("floppy")->base() + state->m_track_size*(2*state->m_fdc_phys_track+(data & 8 ? 1 : 0)); |
| 427 | | state->m_fdc_span = state->m_track_size; |
| 428 | | state->m_fdc_status = 3; |
| 429 | | state->m_fdc_drq = 1; |
| 430 | | state->m_fdc_data = *state->m_fdc_pt; |
| 423 | logerror("Read multiple [%02x] %d..%d side %d track %d\n", data, fdc_sector, fdc_sector+fdc_data-1, data & 8 ? 1 : 0, fdc_phys_track); |
| 424 | fdc_pt = machine().region("floppy")->base() + track_size*(2*fdc_phys_track+(data & 8 ? 1 : 0)); |
| 425 | fdc_span = track_size; |
| 426 | fdc_status = 3; |
| 427 | fdc_drq = 1; |
| 428 | fdc_data = *fdc_pt; |
| 431 | 429 | break; |
| 432 | 430 | case 0xb: |
| 433 | | logerror("Write multiple [%02x] %d..%d side %d track %d\n", data, state->m_fdc_sector, state->m_fdc_sector+state->m_fdc_data-1, data & 8 ? 1 : 0, state->m_fdc_phys_track); |
| 434 | | state->m_fdc_pt = space->machine().region("floppy")->base() + state->m_track_size*(2*state->m_fdc_phys_track+(data & 8 ? 1 : 0)); |
| 435 | | state->m_fdc_span = state->m_track_size; |
| 436 | | state->m_fdc_status = 3; |
| 437 | | state->m_fdc_drq = 1; |
| 431 | logerror("Write multiple [%02x] %d..%d side %d track %d\n", data, fdc_sector, fdc_sector+fdc_data-1, data & 8 ? 1 : 0, fdc_phys_track); |
| 432 | fdc_pt = machine().region("floppy")->base() + track_size*(2*fdc_phys_track+(data & 8 ? 1 : 0)); |
| 433 | fdc_span = track_size; |
| 434 | fdc_status = 3; |
| 435 | fdc_drq = 1; |
| 438 | 436 | break; |
| 439 | 437 | case 0xd: |
| 440 | 438 | logerror("FDC: Forced interrupt\n"); |
| 441 | | state->m_fdc_span = 0; |
| 442 | | state->m_fdc_drq = 0; |
| 443 | | state->m_fdc_irq = data & 1; |
| 444 | | state->m_fdc_status = 0; |
| 439 | fdc_span = 0; |
| 440 | fdc_drq = 0; |
| 441 | fdc_irq = data & 1; |
| 442 | fdc_status = 0; |
| 445 | 443 | break; |
| 446 | 444 | case 0xf: |
| 447 | 445 | if(data == 0xfe) |
| 448 | | logerror("FDC: Assign mode %02x\n", state->m_fdc_data); |
| 446 | logerror("FDC: Assign mode %02x\n", fdc_data); |
| 449 | 447 | else if(data == 0xfd) |
| 450 | | logerror("FDC: Assign parameter %02x\n", state->m_fdc_data); |
| 448 | logerror("FDC: Assign parameter %02x\n", fdc_data); |
| 451 | 449 | else |
| 452 | 450 | logerror("FDC: Unknown command %02x\n", data); |
| 453 | 451 | break; |
| r11224 | r11225 | |
| 458 | 456 | break; |
| 459 | 457 | case 1: |
| 460 | 458 | logerror("FDC: Track register %02x\n", data); |
| 461 | | state->m_fdc_track = data; |
| 459 | fdc_track = data; |
| 462 | 460 | break; |
| 463 | 461 | case 2: |
| 464 | 462 | logerror("FDC: Sector register %02x\n", data); |
| 465 | | state->m_fdc_sector = data; |
| 463 | fdc_sector = data; |
| 466 | 464 | break; |
| 467 | 465 | case 3: |
| 468 | | if(state->m_fdc_drq) { |
| 469 | | // logerror("Write %02x (%d)\n", data, state->m_fdc_span); |
| 470 | | *state->m_fdc_pt++ = data; |
| 471 | | state->m_fdc_span--; |
| 472 | | if(!state->m_fdc_span) { |
| 466 | if(fdc_drq) { |
| 467 | // logerror("Write %02x (%d)\n", data, fdc_span); |
| 468 | *fdc_pt++ = data; |
| 469 | fdc_span--; |
| 470 | if(!fdc_span) { |
| 473 | 471 | logerror("FDC: transfert complete\n"); |
| 474 | | state->m_fdc_drq = 0; |
| 475 | | state->m_fdc_status = 0; |
| 476 | | state->m_fdc_irq = 1; |
| 472 | fdc_drq = 0; |
| 473 | fdc_status = 0; |
| 474 | fdc_irq = 1; |
| 477 | 475 | } |
| 478 | 476 | } else |
| 479 | 477 | logerror("FDC: Data register %02x\n", data); |
| 480 | | state->m_fdc_data = data; |
| 478 | fdc_data = data; |
| 481 | 479 | break; |
| 482 | 480 | } |
| 483 | 481 | } |
| 484 | 482 | } |
| 485 | 483 | |
| 486 | | static READ16_HANDLER( fdc_status_r ) |
| 484 | READ16_MEMBER( segas24_state::fdc_status_r ) |
| 487 | 485 | { |
| 488 | | segas24_state *state = space->machine().driver_data<segas24_state>(); |
| 489 | | if(!state->m_track_size) |
| 486 | if(!track_size) |
| 490 | 487 | return 0xffff; |
| 491 | 488 | |
| 492 | | return 0x90 | (state->m_fdc_irq ? 2 : 0) | (state->m_fdc_drq ? 1 : 0) | (state->m_fdc_phys_track ? 0x40 : 0) | (state->m_fdc_index_count ? 0x20 : 0); |
| 489 | return 0x90 | (fdc_irq ? 2 : 0) | (fdc_drq ? 1 : 0) | (fdc_phys_track ? 0x40 : 0) | (fdc_index_count ? 0x20 : 0); |
| 493 | 490 | } |
| 494 | 491 | |
| 495 | | static WRITE16_HANDLER( fdc_ctrl_w ) |
| 492 | WRITE16_MEMBER( segas24_state::fdc_ctrl_w ) |
| 496 | 493 | { |
| 497 | 494 | if(ACCESSING_BITS_0_7) |
| 498 | 495 | logerror("FDC control %02x\n", data & 0xff); |
| r11224 | r11225 | |
| 501 | 498 | |
| 502 | 499 | // I/O Mappers |
| 503 | 500 | |
| 504 | | static UINT8 hotrod_io_r(running_machine &machine, int port) |
| 501 | UINT8 segas24_state::hotrod_io_r(UINT8 port) |
| 505 | 502 | { |
| 506 | 503 | switch(port) |
| 507 | 504 | { |
| 508 | 505 | case 0: |
| 509 | | return input_port_read(machine, "P1"); |
| 506 | return input_port_read(machine(), "P1"); |
| 510 | 507 | case 1: |
| 511 | | return input_port_read(machine, "P2"); |
| 508 | return input_port_read(machine(), "P2"); |
| 512 | 509 | case 2: |
| 513 | | return input_port_read_safe(machine, "P3", 0xff); |
| 510 | return input_port_read_safe(machine(), "P3", 0xff); |
| 514 | 511 | case 3: |
| 515 | 512 | return 0xff; |
| 516 | 513 | case 4: |
| 517 | | return input_port_read(machine, "SERVICE"); |
| 514 | return input_port_read(machine(), "SERVICE"); |
| 518 | 515 | case 5: // Dip switches |
| 519 | | return input_port_read(machine, "COINAGE"); |
| 516 | return input_port_read(machine(), "COINAGE"); |
| 520 | 517 | case 6: |
| 521 | | return input_port_read(machine, "DSW"); |
| 518 | return input_port_read(machine(), "DSW"); |
| 522 | 519 | case 7: // DAC |
| 523 | 520 | return 0xff; |
| 524 | 521 | } |
| 525 | 522 | return 0x00; |
| 526 | 523 | } |
| 527 | 524 | |
| 528 | | static UINT8 dcclub_io_r(running_machine &machine, int port) |
| 525 | UINT8 segas24_state::dcclub_io_r(UINT8 port) |
| 529 | 526 | { |
| 530 | 527 | switch(port) |
| 531 | 528 | { |
| 532 | 529 | case 0: |
| 533 | 530 | { |
| 534 | 531 | static const UINT8 pos[16] = { 0, 1, 3, 2, 6, 4, 12, 8, 9 }; |
| 535 | | return (input_port_read(machine, "P1") & 0xf) | ((~pos[input_port_read(machine, "PADDLE")>>4]<<4) & 0xf0); |
| 532 | return (input_port_read(machine(), "P1") & 0xf) | ((~pos[input_port_read(machine(), "PADDLE")>>4]<<4) & 0xf0); |
| 536 | 533 | } |
| 537 | 534 | case 1: |
| 538 | | return input_port_read(machine, "P2"); |
| 535 | return input_port_read(machine(), "P2"); |
| 539 | 536 | case 2: |
| 540 | 537 | return 0xff; |
| 541 | 538 | case 3: |
| 542 | 539 | return 0xff; |
| 543 | 540 | case 4: |
| 544 | | return input_port_read(machine, "SERVICE"); |
| 541 | return input_port_read(machine(), "SERVICE"); |
| 545 | 542 | case 5: // Dip switches |
| 546 | | return input_port_read(machine, "COINAGE"); |
| 543 | return input_port_read(machine(), "COINAGE"); |
| 547 | 544 | case 6: |
| 548 | | return input_port_read(machine, "DSW"); |
| 545 | return input_port_read(machine(), "DSW"); |
| 549 | 546 | case 7: // DAC |
| 550 | 547 | return 0xff; |
| 551 | 548 | } |
| r11224 | r11225 | |
| 553 | 550 | } |
| 554 | 551 | |
| 555 | 552 | |
| 556 | | static UINT8 mahmajn_io_r(running_machine &machine, int port) |
| 553 | UINT8 segas24_state::mahmajn_io_r(UINT8 port) |
| 557 | 554 | { |
| 558 | | segas24_state *state = machine.driver_data<segas24_state>(); |
| 559 | 555 | static const char *const keynames[] = { "MJ0", "MJ1", "MJ2", "MJ3", "MJ4", "MJ5", "P1", "P2" }; |
| 560 | 556 | |
| 561 | 557 | switch(port) |
| 562 | 558 | { |
| 563 | 559 | case 0: |
| 564 | | return ~(1 << state->m_cur_input_line); |
| 560 | return ~(1 << cur_input_line); |
| 565 | 561 | case 1: |
| 566 | 562 | return 0xff; |
| 567 | 563 | case 2: |
| 568 | | return input_port_read(machine, keynames[state->m_cur_input_line]); |
| 564 | return input_port_read(machine(), keynames[cur_input_line]); |
| 569 | 565 | case 3: |
| 570 | 566 | return 0xff; |
| 571 | 567 | case 4: |
| 572 | | return input_port_read(machine, "SERVICE"); |
| 568 | return input_port_read(machine(), "SERVICE"); |
| 573 | 569 | case 5: // Dip switches |
| 574 | | return input_port_read(machine, "COINAGE"); |
| 570 | return input_port_read(machine(), "COINAGE"); |
| 575 | 571 | case 6: |
| 576 | | return input_port_read(machine, "DSW"); |
| 572 | return input_port_read(machine(), "DSW"); |
| 577 | 573 | case 7: // DAC |
| 578 | 574 | return 0xff; |
| 579 | 575 | } |
| 580 | 576 | return 0x00; |
| 581 | 577 | } |
| 582 | 578 | |
| 583 | | static void mahmajn_io_w(running_machine &machine, int port, UINT8 data) |
| 579 | void segas24_state::mahmajn_io_w(UINT8 port, UINT8 data) |
| 584 | 580 | { |
| 585 | | segas24_state *state = machine.driver_data<segas24_state>(); |
| 586 | 581 | switch(port) |
| 587 | 582 | { |
| 588 | 583 | case 3: |
| 589 | 584 | if(data & 4) |
| 590 | | state->m_cur_input_line = (state->m_cur_input_line + 1) & 7; |
| 585 | cur_input_line = (cur_input_line + 1) & 7; |
| 591 | 586 | break; |
| 592 | 587 | case 7: // DAC |
| 593 | | dac_signed_data_w(machine.device("dac"), data); |
| 588 | dac_signed_data_w(machine().device("dac"), data); |
| 594 | 589 | break; |
| 595 | 590 | default: |
| 596 | 591 | fprintf(stderr, "Port %d : %02x\n", port, data & 0xff); |
| 597 | 592 | } |
| 598 | 593 | } |
| 599 | 594 | |
| 600 | | static void hotrod_io_w(running_machine &machine, int port, UINT8 data) |
| 595 | void segas24_state::hotrod_io_w(UINT8 port, UINT8 data) |
| 601 | 596 | { |
| 602 | 597 | switch(port) |
| 603 | 598 | { |
| 604 | 599 | case 3: // Lamps |
| 605 | 600 | break; |
| 606 | 601 | case 7: // DAC |
| 607 | | dac_signed_data_w(machine.device("dac"), data); |
| 602 | dac_signed_data_w(machine().device("dac"), data); |
| 608 | 603 | break; |
| 609 | 604 | default: |
| 610 | 605 | fprintf(stderr, "Port %d : %02x\n", port, data & 0xff); |
| r11224 | r11225 | |
| 612 | 607 | } |
| 613 | 608 | |
| 614 | 609 | |
| 615 | | static WRITE16_HANDLER( hotrod3_ctrl_w ) |
| 610 | WRITE16_MEMBER( segas24_state::hotrod3_ctrl_w ) |
| 616 | 611 | { |
| 617 | | segas24_state *state = space->machine().driver_data<segas24_state>(); |
| 618 | 612 | static const char *const portnames[] = { "PEDAL1", "PEDAL2", "PEDAL3", "PEDAL4" }; |
| 619 | 613 | |
| 620 | 614 | if(ACCESSING_BITS_0_7) |
| 621 | 615 | { |
| 622 | 616 | data &= 3; |
| 623 | | state->m_hotrod_ctrl_cur = input_port_read_safe(space->machine(), portnames[data], 0); |
| 617 | hotrod_ctrl_cur = input_port_read_safe(machine(), portnames[data], 0); |
| 624 | 618 | } |
| 625 | 619 | } |
| 626 | 620 | |
| 627 | | static READ16_HANDLER( hotrod3_ctrl_r ) |
| 621 | READ16_MEMBER( segas24_state::hotrod3_ctrl_r ) |
| 628 | 622 | { |
| 629 | | segas24_state *state = space->machine().driver_data<segas24_state>(); |
| 630 | 623 | if(ACCESSING_BITS_0_7) |
| 631 | 624 | { |
| 632 | 625 | switch(offset) |
| 633 | 626 | { |
| 634 | 627 | // Steering dials |
| 635 | 628 | case 0: |
| 636 | | return input_port_read_safe(space->machine(), "DIAL1", 0) & 0xff; |
| 629 | return input_port_read_safe(machine(), "DIAL1", 0) & 0xff; |
| 637 | 630 | case 1: |
| 638 | | return input_port_read_safe(space->machine(), "DIAL1", 0) >> 8; |
| 631 | return input_port_read_safe(machine(), "DIAL1", 0) >> 8; |
| 639 | 632 | case 2: |
| 640 | | return input_port_read_safe(space->machine(), "DIAL2", 0) & 0xff; |
| 633 | return input_port_read_safe(machine(), "DIAL2", 0) & 0xff; |
| 641 | 634 | case 3: |
| 642 | | return input_port_read_safe(space->machine(), "DIAL2", 0) >> 8; |
| 635 | return input_port_read_safe(machine(), "DIAL2", 0) >> 8; |
| 643 | 636 | case 4: |
| 644 | | return input_port_read_safe(space->machine(), "DIAL3", 0) & 0xff; |
| 637 | return input_port_read_safe(machine(), "DIAL3", 0) & 0xff; |
| 645 | 638 | case 5: |
| 646 | | return input_port_read_safe(space->machine(), "DIAL3", 0) >> 8; |
| 639 | return input_port_read_safe(machine(), "DIAL3", 0) >> 8; |
| 647 | 640 | case 6: |
| 648 | | return input_port_read_safe(space->machine(), "DIAL4", 0) & 0xff; |
| 641 | return input_port_read_safe(machine(), "DIAL4", 0) & 0xff; |
| 649 | 642 | case 7: |
| 650 | | return input_port_read_safe(space->machine(), "DIAL4", 0) >> 8; |
| 643 | return input_port_read_safe(machine(), "DIAL4", 0) >> 8; |
| 651 | 644 | |
| 652 | 645 | case 8: |
| 653 | 646 | { |
| 654 | 647 | // Serial ADCs for the accel |
| 655 | | int v = state->m_hotrod_ctrl_cur & 0x80; |
| 656 | | state->m_hotrod_ctrl_cur <<= 1; |
| 648 | int v = hotrod_ctrl_cur & 0x80; |
| 649 | hotrod_ctrl_cur <<= 1; |
| 657 | 650 | return v ? 0xff : 0; |
| 658 | 651 | } |
| 659 | 652 | } |
| r11224 | r11225 | |
| 661 | 654 | return 0; |
| 662 | 655 | } |
| 663 | 656 | |
| 664 | | static READ16_HANDLER( iod_r ) |
| 657 | READ16_MEMBER( segas24_state::iod_r ) |
| 665 | 658 | { |
| 666 | | logerror("IO daughterboard read %02x (%x)\n", offset, cpu_get_pc(&space->device())); |
| 659 | logerror("IO daughterboard read %02x (%x)\n", offset, cpu_get_pc(&space.device())); |
| 667 | 660 | return 0xffff; |
| 668 | 661 | } |
| 669 | 662 | |
| 670 | | static WRITE16_HANDLER( iod_w ) |
| 663 | WRITE16_MEMBER( segas24_state::iod_w ) |
| 671 | 664 | { |
| 672 | | logerror("IO daughterboard write %02x, %04x & %04x (%x)\n", offset, data, mem_mask, cpu_get_pc(&space->device())); |
| 665 | logerror("IO daughterboard write %02x, %04x & %04x (%x)\n", offset, data, mem_mask, cpu_get_pc(&space.device())); |
| 673 | 666 | } |
| 674 | 667 | |
| 675 | 668 | |
| 676 | 669 | // Cpu #1 reset control |
| 677 | 670 | |
| 678 | 671 | |
| 679 | | static void reset_reset(running_machine &machine) |
| 672 | void segas24_state::reset_reset() |
| 680 | 673 | { |
| 681 | | segas24_state *state = machine.driver_data<segas24_state>(); |
| 682 | | int changed = state->m_resetcontrol ^ state->m_prev_resetcontrol; |
| 674 | int changed = resetcontrol ^ prev_resetcontrol; |
| 683 | 675 | if(changed & 2) { |
| 684 | | if(state->m_resetcontrol & 2) { |
| 685 | | cputag_set_input_line(machine, "sub", INPUT_LINE_HALT, CLEAR_LINE); |
| 686 | | cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, PULSE_LINE); |
| 676 | if(resetcontrol & 2) { |
| 677 | cputag_set_input_line(machine(), "sub", INPUT_LINE_HALT, CLEAR_LINE); |
| 678 | cputag_set_input_line(machine(), "sub", INPUT_LINE_RESET, PULSE_LINE); |
| 687 | 679 | // mame_printf_debug("enable 2nd cpu!\n"); |
| 688 | 680 | // debugger_break(machine); |
| 689 | | s24_fd1094_machine_init(machine); |
| 681 | s24_fd1094_machine_init(machine()); |
| 690 | 682 | |
| 691 | 683 | } else |
| 692 | | cputag_set_input_line(machine, "sub", INPUT_LINE_HALT, ASSERT_LINE); |
| 684 | cputag_set_input_line(machine(), "sub", INPUT_LINE_HALT, ASSERT_LINE); |
| 693 | 685 | } |
| 694 | 686 | if(changed & 4) |
| 695 | | devtag_reset(machine, "ymsnd"); |
| 696 | | state->m_prev_resetcontrol = state->m_resetcontrol; |
| 687 | devtag_reset(machine(), "ymsnd"); |
| 688 | prev_resetcontrol = resetcontrol; |
| 697 | 689 | } |
| 698 | 690 | |
| 699 | | static void resetcontrol_w(address_space *space, UINT8 data) |
| 691 | void segas24_state::reset_control_w(UINT8 data) |
| 700 | 692 | { |
| 701 | | segas24_state *state = space->machine().driver_data<segas24_state>(); |
| 702 | | state->m_resetcontrol = data; |
| 703 | | logerror("Reset control %02x ('%s':%x)\n", state->m_resetcontrol, space->device().tag(), cpu_get_pc(&space->device())); |
| 704 | | reset_reset(space->machine()); |
| 693 | resetcontrol = data; |
| 694 | reset_reset(); |
| 705 | 695 | } |
| 706 | 696 | |
| 707 | 697 | |
| 708 | 698 | // Rom board bank access |
| 709 | 699 | |
| 710 | 700 | |
| 711 | | static void reset_bank(running_machine &machine) |
| 701 | void segas24_state::reset_bank() |
| 712 | 702 | { |
| 713 | | segas24_state *state = machine.driver_data<segas24_state>(); |
| 714 | | if (machine.region("romboard")->base()) |
| 703 | if (machine().region("romboard")->base()) |
| 715 | 704 | { |
| 716 | | memory_set_bank(machine, "bank1", state->m_curbank & 15); |
| 717 | | memory_set_bank(machine, "bank2", state->m_curbank & 15); |
| 705 | memory_set_bank(machine(), "bank1", curbank & 15); |
| 706 | memory_set_bank(machine(), "bank2", curbank & 15); |
| 718 | 707 | } |
| 719 | 708 | } |
| 720 | 709 | |
| 721 | | static READ16_HANDLER( curbank_r ) |
| 710 | READ16_MEMBER( segas24_state::curbank_r ) |
| 722 | 711 | { |
| 723 | | segas24_state *state = space->machine().driver_data<segas24_state>(); |
| 724 | | return state->m_curbank; |
| 712 | return curbank; |
| 725 | 713 | } |
| 726 | 714 | |
| 727 | | static WRITE16_HANDLER( curbank_w ) |
| 715 | WRITE16_MEMBER( segas24_state::curbank_w ) |
| 728 | 716 | { |
| 729 | | segas24_state *state = space->machine().driver_data<segas24_state>(); |
| 730 | 717 | if(ACCESSING_BITS_0_7) { |
| 731 | | state->m_curbank = data & 0xff; |
| 732 | | reset_bank(space->machine()); |
| 718 | curbank = data & 0xff; |
| 719 | reset_bank(); |
| 733 | 720 | } |
| 734 | 721 | } |
| 735 | 722 | |
| r11224 | r11225 | |
| 737 | 724 | |
| 738 | 725 | // Protection magic latch |
| 739 | 726 | |
| 740 | | static const UINT8 mahmajn_mlt[8] = { 5, 1, 6, 2, 3, 7, 4, 0 }; |
| 741 | | static const UINT8 mahmajn2_mlt[8] = { 6, 0, 5, 3, 1, 4, 2, 7 }; |
| 742 | | static const UINT8 qgh_mlt[8] = { 3, 7, 4, 0, 2, 6, 5, 1 }; |
| 743 | | static const UINT8 bnzabros_mlt[8] = { 2, 4, 0, 5, 7, 3, 1, 6 }; |
| 744 | | static const UINT8 qrouka_mlt[8] = { 1, 6, 4, 7, 0, 5, 3, 2 }; |
| 745 | | static const UINT8 quizmeku_mlt[8] = { 0, 3, 2, 4, 6, 1, 7, 5 }; |
| 746 | | static const UINT8 dcclub_mlt[8] = { 4, 7, 3, 0, 2, 6, 5, 1 }; |
| 727 | const UINT8 segas24_state::mahmajn_mlt[8] = { 5, 1, 6, 2, 3, 7, 4, 0 }; |
| 728 | const UINT8 segas24_state::mahmajn2_mlt[8] = { 6, 0, 5, 3, 1, 4, 2, 7 }; |
| 729 | const UINT8 segas24_state::qgh_mlt[8] = { 3, 7, 4, 0, 2, 6, 5, 1 }; |
| 730 | const UINT8 segas24_state::bnzabros_mlt[8] = { 2, 4, 0, 5, 7, 3, 1, 6 }; |
| 731 | const UINT8 segas24_state::qrouka_mlt[8] = { 1, 6, 4, 7, 0, 5, 3, 2 }; |
| 732 | const UINT8 segas24_state::quizmeku_mlt[8] = { 0, 3, 2, 4, 6, 1, 7, 5 }; |
| 733 | const UINT8 segas24_state::dcclub_mlt[8] = { 4, 7, 3, 0, 2, 6, 5, 1 }; |
| 747 | 734 | |
| 748 | 735 | |
| 749 | | static READ16_HANDLER( mlatch_r ) |
| 736 | READ16_MEMBER( segas24_state::mlatch_r ) |
| 750 | 737 | { |
| 751 | | segas24_state *state = space->machine().driver_data<segas24_state>(); |
| 752 | | return state->m_mlatch; |
| 738 | return mlatch; |
| 753 | 739 | } |
| 754 | 740 | |
| 755 | | static WRITE16_HANDLER( mlatch_w ) |
| 741 | WRITE16_MEMBER( segas24_state::mlatch_w ) |
| 756 | 742 | { |
| 757 | | segas24_state *state = space->machine().driver_data<segas24_state>(); |
| 758 | 743 | if(ACCESSING_BITS_0_7) { |
| 759 | 744 | int i; |
| 760 | 745 | UINT8 mxor = 0; |
| 761 | | if(!state->m_mlatch_table) { |
| 762 | | logerror("Protection: magic latch accessed but no table loaded (%s:%x)\n", space->device().tag(), cpu_get_pc(&space->device())); |
| 746 | if(!mlatch_table) { |
| 747 | logerror("Protection: magic latch accessed but no table loaded (%s:%x)\n", space.device().tag(), cpu_get_pc(&space.device())); |
| 763 | 748 | return; |
| 764 | 749 | } |
| 765 | 750 | |
| r11224 | r11225 | |
| 767 | 752 | |
| 768 | 753 | if(data != 0xff) { |
| 769 | 754 | for(i=0; i<8; i++) |
| 770 | | if(state->m_mlatch & (1<<i)) |
| 771 | | mxor |= 1 << state->m_mlatch_table[i]; |
| 772 | | state->m_mlatch = data ^ mxor; |
| 773 | | logerror("Magic latching %02x ^ %02x as %02x (%s:%x)\n", data & 0xff, mxor, state->m_mlatch, space->device().tag(), cpu_get_pc(&space->device())); |
| 755 | if(mlatch & (1<<i)) |
| 756 | mxor |= 1 << mlatch_table[i]; |
| 757 | mlatch = data ^ mxor; |
| 758 | logerror("Magic latching %02x ^ %02x as %02x (%s:%x)\n", data & 0xff, mxor, mlatch, space.device().tag(), cpu_get_pc(&space.device())); |
| 774 | 759 | } else { |
| 775 | | logerror("Magic latch reset (%s:%x)\n", space->device().tag(), cpu_get_pc(&space->device())); |
| 776 | | state->m_mlatch = 0x00; |
| 760 | logerror("Magic latch reset (%s:%x)\n", space.device().tag(), cpu_get_pc(&space.device())); |
| 761 | mlatch = 0x00; |
| 777 | 762 | } |
| 778 | 763 | } |
| 779 | 764 | } |
| r11224 | r11225 | |
| 788 | 773 | IRQ_SPRITE = 4 |
| 789 | 774 | }; |
| 790 | 775 | |
| 776 | void segas24_state::irq_timer_sync() |
| 777 | { |
| 778 | attotime ctime = machine().time(); |
| 791 | 779 | |
| 780 | switch(irq_tmode) { |
| 781 | case 0: |
| 782 | break; |
| 783 | case 1: { |
| 784 | // Don't remove the floor(), the value may be slightly negative |
| 785 | int ppos = floor((irq_synctime - irq_vsynctime).as_double() * HSYNC_CLOCK); |
| 786 | int cpos = floor((ctime - irq_vsynctime).as_double() * HSYNC_CLOCK); |
| 787 | irq_tval += cpos-ppos; |
| 788 | break; |
| 789 | } |
| 790 | case 2: { |
| 791 | abort(); |
| 792 | } |
| 793 | case 3: { |
| 794 | int ppos = floor((irq_synctime - irq_vsynctime).as_double() * TIMER_CLOCK); |
| 795 | int cpos = floor((ctime - irq_vsynctime).as_double() * TIMER_CLOCK); |
| 796 | irq_tval += cpos-ppos; |
| 797 | break; |
| 798 | } |
| 799 | } |
| 800 | |
| 801 | irq_synctime = ctime; |
| 802 | } |
| 803 | |
| 804 | void segas24_state::irq_timer_start(int old_tmode) |
| 805 | { |
| 806 | switch(irq_tmode) { |
| 807 | case 0: |
| 808 | if(old_tmode) { |
| 809 | irq_tval++; |
| 810 | if(irq_tval == 0x1000) |
| 811 | irq_timer->adjust(attotime::zero); |
| 812 | else |
| 813 | irq_timer->enable(false); |
| 814 | } |
| 815 | break; |
| 816 | case 1: { |
| 817 | int count = 0x1000 - irq_tval; |
| 818 | irq_timer->adjust(attotime::from_hz(HSYNC_CLOCK)*count); |
| 819 | break; |
| 820 | } |
| 821 | case 2: |
| 822 | abort(); |
| 823 | break; |
| 824 | case 3: { |
| 825 | int count = 0x1000 - irq_tval; |
| 826 | irq_timer->adjust(attotime::from_hz(TIMER_CLOCK)*count); |
| 827 | break; |
| 828 | } |
| 829 | } |
| 830 | } |
| 831 | |
| 792 | 832 | static TIMER_DEVICE_CALLBACK( irq_timer_cb ) |
| 793 | 833 | { |
| 794 | 834 | segas24_state *state = timer.machine().driver_data<segas24_state>(); |
| 795 | | state->m_irq_timer_pend0 = state->m_irq_timer_pend1 = 1; |
| 796 | | if(state->m_irq_allow0 & (1 << IRQ_TIMER)) |
| 835 | state->irq_timer_sync(); |
| 836 | |
| 837 | if(state->irq_tval != 0x1000) |
| 838 | fprintf(stderr, "Error: timer desync %x != 1000\n", state->irq_tval); |
| 839 | |
| 840 | state->irq_tval = state->irq_tdata; |
| 841 | state->irq_timer_start(state->irq_tmode); |
| 842 | |
| 843 | state->irq_timer_pend0 = state->irq_timer_pend1 = 1; |
| 844 | if(state->irq_allow0 & (1 << IRQ_TIMER)) |
| 797 | 845 | cputag_set_input_line(timer.machine(), "maincpu", IRQ_TIMER+1, ASSERT_LINE); |
| 798 | | if(state->m_irq_allow1 & (1 << IRQ_TIMER)) |
| 846 | if(state->irq_allow1 & (1 << IRQ_TIMER)) |
| 799 | 847 | cputag_set_input_line(timer.machine(), "sub", IRQ_TIMER+1, ASSERT_LINE); |
| 848 | |
| 849 | if(state->irq_tmode == 1 || state->irq_tmode == 2) |
| 850 | timer.machine().primary_screen->update_now(); |
| 800 | 851 | } |
| 801 | 852 | |
| 802 | 853 | static TIMER_DEVICE_CALLBACK( irq_timer_clear_cb ) |
| 803 | 854 | { |
| 804 | 855 | segas24_state *state = timer.machine().driver_data<segas24_state>(); |
| 805 | | state->m_irq_sprite = state->m_irq_vblank = 0; |
| 856 | state->irq_sprite = state->irq_vblank = 0; |
| 806 | 857 | cputag_set_input_line(timer.machine(), "maincpu", IRQ_VBLANK+1, CLEAR_LINE); |
| 807 | 858 | cputag_set_input_line(timer.machine(), "maincpu", IRQ_SPRITE+1, CLEAR_LINE); |
| 808 | 859 | cputag_set_input_line(timer.machine(), "sub", IRQ_VBLANK+1, CLEAR_LINE); |
| 809 | 860 | cputag_set_input_line(timer.machine(), "sub", IRQ_SPRITE+1, CLEAR_LINE); |
| 810 | 861 | } |
| 811 | 862 | |
| 812 | | static void irq_init(running_machine &machine) |
| 863 | void segas24_state::irq_init() |
| 813 | 864 | { |
| 814 | | segas24_state *state = machine.driver_data<segas24_state>(); |
| 815 | | state->m_irq_timera = 0; |
| 816 | | state->m_irq_timerb = 0; |
| 817 | | state->m_irq_allow0 = 0; |
| 818 | | state->m_irq_allow1 = 0; |
| 819 | | state->m_irq_timer_pend0 = 0; |
| 820 | | state->m_irq_timer_pend1 = 0; |
| 821 | | state->m_irq_vblank = 0; |
| 822 | | state->m_irq_sprite = 0; |
| 823 | | state->m_irq_timer = machine.device<timer_device>("irq_timer"); |
| 824 | | state->m_irq_timer_clear = machine.device<timer_device>("irq_timer_clear"); |
| 865 | irq_tdata = 0; |
| 866 | irq_tmode = 0; |
| 867 | irq_allow0 = 0; |
| 868 | irq_allow1 = 0; |
| 869 | irq_timer_pend0 = 0; |
| 870 | irq_timer_pend1 = 0; |
| 871 | irq_vblank = 0; |
| 872 | irq_sprite = 0; |
| 873 | irq_timer = machine().device<timer_device>("irq_timer"); |
| 874 | irq_timer_clear = machine().device<timer_device>("irq_timer_clear"); |
| 875 | irq_tval = 0; |
| 876 | irq_synctime = attotime::zero; |
| 877 | irq_vsynctime = attotime::zero; |
| 825 | 878 | } |
| 826 | 879 | |
| 827 | | static void irq_timer_reset(running_machine &machine) |
| 880 | WRITE16_MEMBER(segas24_state::irq_w) |
| 828 | 881 | { |
| 829 | | segas24_state *state = machine.driver_data<segas24_state>(); |
| 830 | | int freq = (state->m_irq_timerb << 12) | state->m_irq_timera; |
| 831 | | freq &= 0x1fff; |
| 832 | | |
| 833 | | state->m_irq_timer->adjust(attotime::from_hz(freq), 0, attotime::from_hz(freq)); |
| 834 | | logerror("New timer frequency: %0d [%02x %04x]\n", freq, state->m_irq_timerb, state->m_irq_timera); |
| 835 | | } |
| 836 | | |
| 837 | | static WRITE16_HANDLER(irq_w) |
| 838 | | { |
| 839 | | segas24_state *state = space->machine().driver_data<segas24_state>(); |
| 840 | 882 | switch(offset) { |
| 841 | 883 | case 0: { |
| 842 | | UINT16 old_ta = state->m_irq_timera; |
| 843 | | COMBINE_DATA(&state->m_irq_timera); |
| 844 | | if(old_ta != state->m_irq_timera) |
| 845 | | irq_timer_reset(space->machine()); |
| 884 | irq_timer_sync(); |
| 885 | COMBINE_DATA(&irq_tdata); |
| 886 | irq_tdata &= 0xfff; |
| 887 | irq_timer_start(irq_tmode); |
| 846 | 888 | break; |
| 847 | 889 | } |
| 848 | 890 | case 1: |
| 849 | 891 | if(ACCESSING_BITS_0_7) { |
| 850 | | UINT8 old_tb = state->m_irq_timerb; |
| 851 | | state->m_irq_timerb = data; |
| 852 | | if(old_tb != state->m_irq_timerb) |
| 853 | | irq_timer_reset(space->machine()); |
| 892 | UINT8 old_tmode = irq_tmode; |
| 893 | irq_timer_sync(); |
| 894 | irq_tmode = data & 3; |
| 895 | irq_timer_start(old_tmode); |
| 854 | 896 | } |
| 855 | 897 | break; |
| 856 | 898 | case 2: |
| 857 | | state->m_irq_allow0 = data; |
| 858 | | state->m_irq_timer_pend0 = 0; |
| 859 | | cputag_set_input_line(space->machine(), "maincpu", IRQ_TIMER+1, CLEAR_LINE); |
| 860 | | cputag_set_input_line(space->machine(), "maincpu", IRQ_YM2151+1, state->m_irq_yms && (state->m_irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); |
| 861 | | cputag_set_input_line(space->machine(), "maincpu", IRQ_VBLANK+1, state->m_irq_vblank && (state->m_irq_allow0 & (1 << IRQ_VBLANK)) ? ASSERT_LINE : CLEAR_LINE); |
| 862 | | cputag_set_input_line(space->machine(), "maincpu", IRQ_SPRITE+1, state->m_irq_sprite && (state->m_irq_allow0 & (1 << IRQ_SPRITE)) ? ASSERT_LINE : CLEAR_LINE); |
| 899 | irq_allow0 = data & 0x1f; |
| 900 | irq_timer_pend0 = 0; |
| 901 | cputag_set_input_line(machine(), "maincpu", IRQ_TIMER+1, CLEAR_LINE); |
| 902 | cputag_set_input_line(machine(), "maincpu", IRQ_YM2151+1, irq_yms && (irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); |
| 903 | cputag_set_input_line(machine(), "maincpu", IRQ_VBLANK+1, irq_vblank && (irq_allow0 & (1 << IRQ_VBLANK)) ? ASSERT_LINE : CLEAR_LINE); |
| 904 | cputag_set_input_line(machine(), "maincpu", IRQ_SPRITE+1, irq_sprite && (irq_allow0 & (1 << IRQ_SPRITE)) ? ASSERT_LINE : CLEAR_LINE); |
| 863 | 905 | break; |
| 864 | 906 | case 3: |
| 865 | | state->m_irq_allow1 = data; |
| 866 | | state->m_irq_timer_pend1 = 0; |
| 867 | | cputag_set_input_line(space->machine(), "sub", IRQ_TIMER+1, CLEAR_LINE); |
| 868 | | cputag_set_input_line(space->machine(), "sub", IRQ_YM2151+1, state->m_irq_yms && (state->m_irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); |
| 869 | | cputag_set_input_line(space->machine(), "sub", IRQ_VBLANK+1, state->m_irq_vblank && (state->m_irq_allow1 & (1 << IRQ_VBLANK)) ? ASSERT_LINE : CLEAR_LINE); |
| 870 | | cputag_set_input_line(space->machine(), "sub", IRQ_SPRITE+1, state->m_irq_sprite && (state->m_irq_allow1 & (1 << IRQ_SPRITE)) ? ASSERT_LINE : CLEAR_LINE); |
| 907 | irq_allow1 = data & 0x1f; |
| 908 | irq_timer_pend1 = 0; |
| 909 | cputag_set_input_line(machine(), "sub", IRQ_TIMER+1, CLEAR_LINE); |
| 910 | cputag_set_input_line(machine(), "sub", IRQ_YM2151+1, irq_yms && (irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); |
| 911 | cputag_set_input_line(machine(), "sub", IRQ_VBLANK+1, irq_vblank && (irq_allow1 & (1 << IRQ_VBLANK)) ? ASSERT_LINE : CLEAR_LINE); |
| 912 | cputag_set_input_line(machine(), "sub", IRQ_SPRITE+1, irq_sprite && (irq_allow1 & (1 << IRQ_SPRITE)) ? ASSERT_LINE : CLEAR_LINE); |
| 871 | 913 | break; |
| 872 | 914 | } |
| 873 | 915 | } |
| 874 | 916 | |
| 875 | | static READ16_HANDLER(irq_r) |
| 917 | // gground bp at 849c (84a4) |
| 918 | // cmp.w $a00000, d0 | 16 |
| 919 | // dbeq d1, 84b4 | 10 |
| 920 | // 26 cycles/tour |
| 921 | // 0x200 counts |
| 922 | // 656 cycles/ligne |
| 923 | // 656*0x200/26 = 12918 (3276) -> cd89 (got e087, delta = 1f78, 8056) |
| 924 | // 410 cycles/ligne |
| 925 | // 410*0x200/26 = 8073 |
| 926 | |
| 927 | READ16_MEMBER(segas24_state::irq_r) |
| 876 | 928 | { |
| 877 | | segas24_state *state = space->machine().driver_data<segas24_state>(); |
| 878 | 929 | switch(offset) { |
| 879 | | case 0: { |
| 880 | | int pc = cpu_get_pc(&space->device()); |
| 881 | | if(pc == 0x84a4 || pc == 0x84a6) |
| 882 | | return 0; |
| 883 | | if(pc == 0x84aa || pc == 0x84ac) { |
| 884 | | // limit = 0x1b5f |
| 885 | | state->m_turns = 0x0100; |
| 886 | | return 1; |
| 887 | | } |
| 888 | | if(pc == 0x84ba || pc == 0x84bc) { |
| 889 | | // 26 cycles/read |
| 890 | | state->m_turns--; |
| 891 | | return state->m_turns ? 1 : 0x200; |
| 892 | | } |
| 893 | | // 84c8 |
| 894 | | // -> 85ac / 85bc? |
| 895 | | break; |
| 896 | | } |
| 897 | 930 | case 2: |
| 898 | | state->m_irq_timer_pend0 = 0; |
| 899 | | cputag_set_input_line(space->machine(), "maincpu", IRQ_TIMER+1, CLEAR_LINE); |
| 931 | irq_timer_pend0 = 0; |
| 932 | cputag_set_input_line(machine(), "maincpu", IRQ_TIMER+1, CLEAR_LINE); |
| 900 | 933 | break; |
| 901 | 934 | case 3: |
| 902 | | state->m_irq_timer_pend1 = 0; |
| 903 | | cputag_set_input_line(space->machine(), "sub", IRQ_TIMER+1, CLEAR_LINE); |
| 935 | irq_timer_pend1 = 0; |
| 936 | cputag_set_input_line(machine(), "sub", IRQ_TIMER+1, CLEAR_LINE); |
| 904 | 937 | break; |
| 905 | 938 | } |
| 906 | | return 0xffff; |
| 939 | irq_timer_sync(); |
| 940 | return irq_tval & 0xfff; |
| 907 | 941 | } |
| 908 | 942 | |
| 909 | 943 | static INTERRUPT_GEN(irq_vbl) |
| r11224 | r11225 | |
| 913 | 947 | |
| 914 | 948 | if(cpu_getiloops(device)) { |
| 915 | 949 | irq = IRQ_SPRITE; |
| 916 | | state->m_irq_sprite = 1; |
| 950 | state->irq_sprite = 1; |
| 917 | 951 | } else { |
| 918 | 952 | irq = IRQ_VBLANK; |
| 919 | | state->m_irq_vblank = 1; |
| 953 | state->irq_vblank = 1; |
| 920 | 954 | } |
| 921 | 955 | |
| 922 | | state->m_irq_timer_clear->adjust(attotime::from_hz(VIDEO_CLOCK/2/656.0)); |
| 956 | state->irq_timer_clear->adjust(attotime::from_hz(HSYNC_CLOCK)); |
| 923 | 957 | |
| 924 | 958 | mask = 1 << irq; |
| 925 | 959 | |
| 926 | | if(state->m_irq_allow0 & mask) |
| 960 | if(state->irq_allow0 & mask) |
| 927 | 961 | cputag_set_input_line(device->machine(), "maincpu", 1+irq, ASSERT_LINE); |
| 928 | 962 | |
| 929 | | if(state->m_irq_allow1 & mask) |
| 963 | if(state->irq_allow1 & mask) |
| 930 | 964 | cputag_set_input_line(device->machine(), "sub", 1+irq, ASSERT_LINE); |
| 931 | 965 | |
| 932 | 966 | if(!cpu_getiloops(device)) { |
| 933 | 967 | // Ensure one index pulse every 20 frames |
| 934 | 968 | // The is some code in bnzabros at 0x852 that makes it crash |
| 935 | 969 | // if the pulse train is too fast |
| 936 | | state->m_fdc_index_count++; |
| 937 | | if(state->m_fdc_index_count >= 20) |
| 938 | | state->m_fdc_index_count = 0; |
| 970 | state->fdc_index_count++; |
| 971 | if(state->fdc_index_count >= 20) |
| 972 | state->fdc_index_count = 0; |
| 939 | 973 | } |
| 974 | |
| 975 | state->irq_timer_sync(); |
| 976 | state->irq_vsynctime = device->machine().time(); |
| 940 | 977 | } |
| 941 | 978 | |
| 942 | 979 | static void irq_ym(device_t *device, int irq) |
| 943 | 980 | { |
| 944 | 981 | segas24_state *state = device->machine().driver_data<segas24_state>(); |
| 945 | | state->m_irq_yms = irq; |
| 946 | | cputag_set_input_line(device->machine(), "maincpu", IRQ_YM2151+1, state->m_irq_yms && (state->m_irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); |
| 947 | | cputag_set_input_line(device->machine(), "sub", IRQ_YM2151+1, state->m_irq_yms && (state->m_irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); |
| 982 | state->irq_yms = irq; |
| 983 | cputag_set_input_line(device->machine(), "maincpu", IRQ_YM2151+1, state->irq_yms && (state->irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); |
| 984 | cputag_set_input_line(device->machine(), "sub", IRQ_YM2151+1, state->irq_yms && (state->irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); |
| 948 | 985 | } |
| 949 | 986 | |
| 950 | 987 | |
| 988 | READ16_MEMBER ( segas24_state::sys16_io_r ) |
| 989 | { |
| 990 | // logerror("IO read %02x (%s:%x)\n", offset, space->device().tag(), cpu_get_pc(&space->device())); |
| 991 | if(offset < 8) |
| 992 | return (this->*io_r)(offset); |
| 993 | else if (offset < 0x20) { |
| 994 | switch(offset) { |
| 995 | case 0x8: |
| 996 | return 'S'; |
| 997 | case 0x9: |
| 998 | return 'E'; |
| 999 | case 0xa: |
| 1000 | return 'G'; |
| 1001 | case 0xb: |
| 1002 | return 'A'; |
| 1003 | case 0xe: |
| 1004 | return io_cnt; |
| 1005 | case 0xf: |
| 1006 | return io_dir; |
| 1007 | default: |
| 1008 | logerror("IO control read %02x (%s:%x)\n", offset, space.device().tag(), cpu_get_pc(&space.device())); |
| 1009 | return 0xff; |
| 1010 | } |
| 1011 | } else |
| 1012 | return iod_r(space, offset & 0x1f, mem_mask); |
| 1013 | } |
| 1014 | |
| 1015 | WRITE16_MEMBER( segas24_state::sys16_io_w ) |
| 1016 | { |
| 1017 | if(ACCESSING_BITS_0_7) { |
| 1018 | if(offset < 8) { |
| 1019 | if(!(io_dir & (1 << offset))) { |
| 1020 | logerror("IO port write on input-only port (%d, [%02x], %02x, %s:%x)\n", offset, io_dir, data & 0xff, space.device().tag(), cpu_get_pc(&space.device())); |
| 1021 | return; |
| 1022 | } |
| 1023 | (this->*io_w)(offset, data); |
| 1024 | } else if (offset < 0x20) { |
| 1025 | switch(offset) { |
| 1026 | case 0xe: |
| 1027 | io_cnt = data; |
| 1028 | reset_control_w(data & 7); |
| 1029 | break; |
| 1030 | case 0xf: |
| 1031 | io_dir = data; |
| 1032 | break; |
| 1033 | default: |
| 1034 | logerror("IO control write %02x, %02x (%s:%x)\n", offset, data & 0xff, space.device().tag(), cpu_get_pc(&space.device())); |
| 1035 | } |
| 1036 | } |
| 1037 | } |
| 1038 | if(offset >= 0x20) |
| 1039 | iod_w(space, offset & 0x1f, data, mem_mask); |
| 1040 | } |
| 1041 | |
| 1042 | // 315-5242 |
| 1043 | |
| 1044 | READ16_MEMBER( segas24_state::sys16_paletteram_r ) |
| 1045 | { |
| 1046 | return machine().generic.paletteram.u16[offset]; |
| 1047 | } |
| 1048 | |
| 1049 | WRITE16_MEMBER( segas24_state::sys16_paletteram_w ) |
| 1050 | { |
| 1051 | int r, g, b; |
| 1052 | COMBINE_DATA (machine().generic.paletteram.u16 + offset); |
| 1053 | data = machine().generic.paletteram.u16[offset]; |
| 1054 | |
| 1055 | r = (data & 0x00f) << 4; |
| 1056 | if(data & 0x1000) |
| 1057 | r |= 8; |
| 1058 | |
| 1059 | g = data & 0x0f0; |
| 1060 | if(data & 0x2000) |
| 1061 | g |= 8; |
| 1062 | |
| 1063 | b = (data & 0xf00) >> 4; |
| 1064 | if(data & 0x4000) |
| 1065 | b |= 8; |
| 1066 | |
| 1067 | r |= r >> 5; |
| 1068 | g |= g >> 5; |
| 1069 | b |= b >> 5; |
| 1070 | |
| 1071 | palette_set_color(machine(), offset, MAKE_RGB(r, g, b)); |
| 1072 | |
| 1073 | if(data & 0x8000) { |
| 1074 | r = 255-0.6*(255-r); |
| 1075 | g = 255-0.6*(255-g); |
| 1076 | b = 255-0.6*(255-b); |
| 1077 | } else { |
| 1078 | r = 0.6*r; |
| 1079 | g = 0.6*g; |
| 1080 | b = 0.6*b; |
| 1081 | } |
| 1082 | palette_set_color(machine(), offset+machine().total_colors()/2, MAKE_RGB(r, g, b)); |
| 1083 | } |
| 1084 | |
| 1085 | |
| 951 | 1086 | /* |
| 952 | 1087 | CPU1: |
| 953 | 1088 | 00-03 ROM (1) |
| r11224 | r11225 | |
| 997 | 1132 | */ |
| 998 | 1133 | |
| 999 | 1134 | |
| 1000 | | static ADDRESS_MAP_START( system24_cpu1_map, AS_PROGRAM, 16 ) |
| 1135 | static ADDRESS_MAP_START( system24_cpu1_map, AS_PROGRAM, 16, segas24_state ) |
| 1001 | 1136 | AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0x040000) AM_ROM AM_REGION("maincpu", 0) |
| 1002 | 1137 | AM_RANGE(0x080000, 0x0bffff) AM_MIRROR(0x040000) AM_RAM AM_SHARE("share1") |
| 1003 | 1138 | AM_RANGE(0x100000, 0x13ffff) AM_MIRROR(0x0c0000) AM_ROM AM_REGION("maincpu", 0) |
| 1004 | | AM_RANGE(0x200000, 0x20ffff) AM_MIRROR(0x110000) AM_READWRITE(sys24_tile_r, sys24_tile_w) |
| 1139 | AM_RANGE(0x200000, 0x20ffff) AM_MIRROR(0x110000) AM_DEVREADWRITE("tile", segas24_tile, tile_r, tile_w) |
| 1005 | 1140 | AM_RANGE(0x220000, 0x220001) AM_MIRROR(0x11fffe) AM_WRITENOP /* Horizontal split position (ABSEL) */ |
| 1006 | 1141 | AM_RANGE(0x240000, 0x240001) AM_MIRROR(0x11fffe) AM_WRITENOP /* Scanline trigger position (XHOUT) */ |
| 1007 | 1142 | AM_RANGE(0x260000, 0x260001) AM_MIRROR(0x10fffe) AM_WRITENOP /* Frame trigger position (XVOUT) */ |
| 1008 | 1143 | AM_RANGE(0x270000, 0x270001) AM_MIRROR(0x10fffe) AM_WRITENOP /* Synchronization mode */ |
| 1009 | | AM_RANGE(0x280000, 0x29ffff) AM_MIRROR(0x160000) AM_READWRITE(sys24_char_r, sys24_char_w) |
| 1010 | | AM_RANGE(0x400000, 0x403fff) AM_MIRROR(0x1f8000) AM_READWRITE(system24temp_sys16_paletteram1_r, system24temp_sys16_paletteram1_w) AM_BASE_GENERIC(paletteram) |
| 1011 | | AM_RANGE(0x404000, 0x40401f) AM_MIRROR(0x1fbfe0) AM_READWRITE(sys24_mixer_r, sys24_mixer_w) |
| 1012 | | AM_RANGE(0x600000, 0x63ffff) AM_MIRROR(0x180000) AM_READWRITE(sys24_sprite_r, sys24_sprite_w) |
| 1013 | | AM_RANGE(0x800000, 0x80007f) AM_MIRROR(0x1ffe00) AM_READWRITE(system24temp_sys16_io_r, system24temp_sys16_io_w) |
| 1014 | | AM_RANGE(0x800100, 0x800103) AM_MIRROR(0x1ffe00) AM_DEVREADWRITE8("ymsnd", ym2151_r, ym2151_w, 0x00ff) |
| 1144 | AM_RANGE(0x280000, 0x29ffff) AM_MIRROR(0x160000) AM_DEVREADWRITE("tile", segas24_tile, char_r, char_w) |
| 1145 | AM_RANGE(0x400000, 0x403fff) AM_MIRROR(0x1f8000) AM_READWRITE(sys16_paletteram_r, sys16_paletteram_w) AM_BASE_GENERIC(paletteram) |
| 1146 | AM_RANGE(0x404000, 0x40401f) AM_MIRROR(0x1fbfe0) AM_DEVREADWRITE("mixer", segas24_mixer, read, write) |
| 1147 | AM_RANGE(0x600000, 0x63ffff) AM_MIRROR(0x180000) AM_DEVREADWRITE("sprite", segas24_sprite, read, write) |
| 1148 | AM_RANGE(0x800000, 0x80007f) AM_MIRROR(0x1ffe00) AM_READWRITE(sys16_io_r, sys16_io_w) |
| 1149 | AM_RANGE(0x800100, 0x800103) AM_MIRROR(0x1ffe00) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2151_r, ym2151_w, 0x00ff) |
| 1015 | 1150 | AM_RANGE(0xa00000, 0xa00007) AM_MIRROR(0x0ffff8) AM_READWRITE(irq_r, irq_w) |
| 1016 | 1151 | AM_RANGE(0xb00000, 0xb00007) AM_MIRROR(0x07fff0) AM_READWRITE(fdc_r, fdc_w) |
| 1017 | 1152 | AM_RANGE(0xb00008, 0xb0000f) AM_MIRROR(0x07fff0) AM_READWRITE(fdc_status_r, fdc_ctrl_w) |
| r11224 | r11225 | |
| 1034 | 1169 | * |
| 1035 | 1170 | *************************************/ |
| 1036 | 1171 | |
| 1037 | | static ADDRESS_MAP_START( system24_cpu2_map, AS_PROGRAM, 16 ) |
| 1172 | static ADDRESS_MAP_START( system24_cpu2_map, AS_PROGRAM, 16, segas24_state ) |
| 1038 | 1173 | AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0x040000) AM_RAM AM_SHARE("share2") |
| 1039 | 1174 | AM_RANGE(0x080000, 0x0bffff) AM_MIRROR(0x040000) AM_RAM AM_SHARE("share1") |
| 1040 | 1175 | AM_RANGE(0x100000, 0x13ffff) AM_MIRROR(0x0c0000) AM_ROM AM_REGION("maincpu", 0) |
| 1041 | | AM_RANGE(0x200000, 0x20ffff) AM_MIRROR(0x110000) AM_READWRITE(sys24_tile_r, sys24_tile_w) |
| 1176 | AM_RANGE(0x200000, 0x20ffff) AM_MIRROR(0x110000) AM_DEVREADWRITE("tile", segas24_tile, tile_r, tile_w) |
| 1042 | 1177 | AM_RANGE(0x220000, 0x220001) AM_MIRROR(0x11fffe) AM_WRITENOP /* Horizontal split position (ABSEL) */ |
| 1043 | 1178 | AM_RANGE(0x240000, 0x240001) AM_MIRROR(0x11fffe) AM_WRITENOP /* Scanline trigger position (XHOUT) */ |
| 1044 | 1179 | AM_RANGE(0x260000, 0x260001) AM_MIRROR(0x10fffe) AM_WRITENOP /* Frame trigger position (XVOUT) */ |
| 1045 | 1180 | AM_RANGE(0x270000, 0x270001) AM_MIRROR(0x10fffe) AM_WRITENOP /* Synchronization mode */ |
| 1046 | | AM_RANGE(0x280000, 0x29ffff) AM_MIRROR(0x160000) AM_READWRITE(sys24_char_r, sys24_char_w) |
| 1047 | | AM_RANGE(0x400000, 0x403fff) AM_MIRROR(0x1f8000) AM_READWRITE(system24temp_sys16_paletteram1_r, system24temp_sys16_paletteram1_w) |
| 1048 | | AM_RANGE(0x404000, 0x40401f) AM_MIRROR(0x1fbfe0) AM_READWRITE(sys24_mixer_r, sys24_mixer_w) |
| 1049 | | AM_RANGE(0x600000, 0x63ffff) AM_MIRROR(0x180000) AM_READWRITE(sys24_sprite_r, sys24_sprite_w) |
| 1050 | | AM_RANGE(0x800000, 0x80007f) AM_MIRROR(0x1ffe00) AM_READWRITE(system24temp_sys16_io_r, system24temp_sys16_io_w) |
| 1051 | | AM_RANGE(0x800100, 0x800103) AM_MIRROR(0x1ffe00) AM_DEVREADWRITE8("ymsnd", ym2151_r, ym2151_w, 0x00ff) |
| 1181 | AM_RANGE(0x280000, 0x29ffff) AM_MIRROR(0x160000) AM_DEVREADWRITE("tile", segas24_tile, char_r, char_w) |
| 1182 | AM_RANGE(0x400000, 0x403fff) AM_MIRROR(0x1f8000) AM_READWRITE(sys16_paletteram_r, sys16_paletteram_w) AM_BASE_GENERIC(paletteram) |
| 1183 | AM_RANGE(0x404000, 0x40401f) AM_MIRROR(0x1fbfe0) AM_DEVREADWRITE("mixer", segas24_mixer, read, write) |
| 1184 | AM_RANGE(0x600000, 0x63ffff) AM_MIRROR(0x180000) AM_DEVREADWRITE("sprite", segas24_sprite, read, write) |
| 1185 | AM_RANGE(0x800000, 0x80007f) AM_MIRROR(0x1ffe00) AM_READWRITE(sys16_io_r, sys16_io_w) |
| 1186 | AM_RANGE(0x800100, 0x800103) AM_MIRROR(0x1ffe00) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2151_r, ym2151_w, 0x00ff) |
| 1052 | 1187 | AM_RANGE(0xa00000, 0xa00007) AM_MIRROR(0x0ffff8) AM_READWRITE(irq_r, irq_w) |
| 1053 | 1188 | AM_RANGE(0xb00000, 0xb00007) AM_MIRROR(0x07fff0) AM_READWRITE(fdc_r, fdc_w) |
| 1054 | 1189 | AM_RANGE(0xb00008, 0xb0000f) AM_MIRROR(0x07fff0) AM_READWRITE(fdc_status_r, fdc_ctrl_w) |
| r11224 | r11225 | |
| 1074 | 1209 | static MACHINE_START( system24 ) |
| 1075 | 1210 | { |
| 1076 | 1211 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 1077 | | if (state->m_track_size) |
| 1078 | | machine.device<nvram_device>("floppy_nvram")->set_base(machine.region("floppy")->base(), 2*state->m_track_size); |
| 1212 | if (state->track_size) |
| 1213 | machine.device<nvram_device>("floppy_nvram")->set_base(machine.region("floppy")->base(), 2*state->track_size); |
| 1079 | 1214 | |
| 1080 | 1215 | UINT8 *usr1 = machine.region("romboard")->base(); |
| 1081 | 1216 | if (usr1) |
| r11224 | r11225 | |
| 1083 | 1218 | memory_configure_bank(machine, "bank1", 0, 16, usr1, 0x40000); |
| 1084 | 1219 | memory_configure_bank(machine, "bank2", 0, 16, usr1, 0x40000); |
| 1085 | 1220 | } |
| 1221 | |
| 1222 | state->vtile = machine.device<segas24_tile>("tile"); |
| 1223 | state->vsprite = machine.device<segas24_sprite>("sprite"); |
| 1224 | state->vmixer = machine.device<segas24_mixer>("mixer"); |
| 1086 | 1225 | } |
| 1087 | 1226 | |
| 1088 | 1227 | static MACHINE_RESET( system24 ) |
| 1089 | 1228 | { |
| 1090 | 1229 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 1091 | 1230 | cputag_set_input_line(machine, "sub", INPUT_LINE_HALT, ASSERT_LINE); |
| 1092 | | state->m_prev_resetcontrol = state->m_resetcontrol = 0x06; |
| 1093 | | fdc_init(machine); |
| 1094 | | state->m_curbank = 0; |
| 1095 | | reset_bank(machine); |
| 1096 | | irq_init(machine); |
| 1097 | | state->m_mlatch = 0x00; |
| 1231 | state->prev_resetcontrol = state->resetcontrol = 0x06; |
| 1232 | state->fdc_init(); |
| 1233 | state->curbank = 0; |
| 1234 | state->reset_bank(); |
| 1235 | state->irq_init(); |
| 1236 | state->mlatch = 0x00; |
| 1098 | 1237 | } |
| 1099 | 1238 | |
| 1100 | 1239 | /************************************* |
| r11224 | r11225 | |
| 1791 | 1930 | |
| 1792 | 1931 | MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) |
| 1793 | 1932 | |
| 1933 | MCFG_S24TILE_DEVICE_ADD("tile", 0xfff) |
| 1934 | MCFG_S24SPRITE_DEVICE_ADD("sprite") |
| 1935 | MCFG_S24MIXER_DEVICE_ADD("mixer") |
| 1936 | |
| 1794 | 1937 | MCFG_SCREEN_ADD("screen", RASTER) |
| 1795 | 1938 | MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK/2, 656, 0/*+69*/, 496/*+69*/, 424, 0/*+25*/, 384/*+25*/) |
| 1796 | 1939 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| r11224 | r11225 | |
| 1798 | 1941 | |
| 1799 | 1942 | MCFG_PALETTE_LENGTH(8192*2) |
| 1800 | 1943 | |
| 1801 | | MCFG_VIDEO_START(system24) |
| 1802 | | |
| 1803 | 1944 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1804 | 1945 | |
| 1805 | 1946 | MCFG_SOUND_ADD("ymsnd", YM2151, 4000000) |
| r11224 | r11225 | |
| 2162 | 2303 | static DRIVER_INIT( qgh ) |
| 2163 | 2304 | { |
| 2164 | 2305 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 2165 | | system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w); |
| 2166 | | state->m_mlatch_table = qgh_mlt; |
| 2167 | | state->m_track_size = 0; |
| 2306 | state->io_r = &segas24_state::hotrod_io_r; |
| 2307 | state->io_w = &segas24_state::hotrod_io_w; |
| 2308 | state->mlatch_table = segas24_state::qgh_mlt; |
| 2309 | state->track_size = 0; |
| 2168 | 2310 | } |
| 2169 | 2311 | |
| 2170 | 2312 | static DRIVER_INIT( dcclub ) |
| 2171 | 2313 | { |
| 2172 | 2314 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 2173 | | system24temp_sys16_io_set_callbacks(machine, dcclub_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w); |
| 2174 | | state->m_mlatch_table = dcclub_mlt; |
| 2175 | | state->m_track_size = 0; |
| 2315 | state->io_r = &segas24_state::dcclub_io_r; |
| 2316 | state->io_w = &segas24_state::hotrod_io_w; |
| 2317 | state->mlatch_table = segas24_state::dcclub_mlt; |
| 2318 | state->track_size = 0; |
| 2176 | 2319 | } |
| 2177 | 2320 | |
| 2178 | 2321 | static DRIVER_INIT( qrouka ) |
| 2179 | 2322 | { |
| 2180 | 2323 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 2181 | | system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w); |
| 2182 | | state->m_mlatch_table = qrouka_mlt; |
| 2183 | | state->m_track_size = 0; |
| 2324 | state->io_r = &segas24_state::hotrod_io_r; |
| 2325 | state->io_w = &segas24_state::hotrod_io_w; |
| 2326 | state->mlatch_table = segas24_state::qrouka_mlt; |
| 2327 | state->track_size = 0; |
| 2184 | 2328 | } |
| 2185 | 2329 | |
| 2186 | 2330 | static DRIVER_INIT( quizmeku ) |
| 2187 | 2331 | { |
| 2188 | 2332 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 2189 | | system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w); |
| 2190 | | state->m_mlatch_table = quizmeku_mlt; |
| 2191 | | state->m_track_size = 0; |
| 2333 | state->io_r = &segas24_state::hotrod_io_r; |
| 2334 | state->io_w = &segas24_state::hotrod_io_w; |
| 2335 | state->mlatch_table = segas24_state::quizmeku_mlt; |
| 2336 | state->track_size = 0; |
| 2192 | 2337 | } |
| 2193 | 2338 | |
| 2194 | 2339 | static DRIVER_INIT( mahmajn ) |
| 2195 | 2340 | { |
| 2196 | 2341 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 2197 | | system24temp_sys16_io_set_callbacks(machine, mahmajn_io_r, mahmajn_io_w, resetcontrol_w, iod_r, iod_w); |
| 2198 | | state->m_mlatch_table = mahmajn_mlt; |
| 2199 | | state->m_track_size = 0; |
| 2200 | | state->m_cur_input_line = 0; |
| 2342 | state->io_r = &segas24_state::mahmajn_io_r; |
| 2343 | state->io_w = &segas24_state::mahmajn_io_w; |
| 2344 | state->mlatch_table = segas24_state::mahmajn_mlt; |
| 2345 | state->track_size = 0; |
| 2346 | state->cur_input_line = 0; |
| 2201 | 2347 | } |
| 2202 | 2348 | |
| 2203 | 2349 | static DRIVER_INIT( mahmajn2 ) |
| 2204 | 2350 | { |
| 2205 | 2351 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 2206 | | system24temp_sys16_io_set_callbacks(machine, mahmajn_io_r, mahmajn_io_w, resetcontrol_w, iod_r, iod_w); |
| 2207 | | state->m_mlatch_table = mahmajn2_mlt; |
| 2208 | | state->m_track_size = 0; |
| 2209 | | state->m_cur_input_line = 0; |
| 2352 | state->io_r = &segas24_state::mahmajn_io_r; |
| 2353 | state->io_w = &segas24_state::mahmajn_io_w; |
| 2354 | state->mlatch_table = segas24_state::mahmajn2_mlt; |
| 2355 | state->track_size = 0; |
| 2356 | state->cur_input_line = 0; |
| 2210 | 2357 | } |
| 2211 | 2358 | |
| 2212 | 2359 | static DRIVER_INIT( hotrod ) |
| 2213 | 2360 | { |
| 2214 | 2361 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 2215 | | system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w); |
| 2216 | | state->m_mlatch_table = 0; |
| 2362 | state->io_r = &segas24_state::hotrod_io_r; |
| 2363 | state->io_w = &segas24_state::hotrod_io_w; |
| 2364 | state->mlatch_table = 0; |
| 2217 | 2365 | |
| 2218 | 2366 | // Sector Size |
| 2219 | 2367 | // 1 8192 |
| r11224 | r11225 | |
| 2223 | 2371 | // 5 512 |
| 2224 | 2372 | // 6 256 |
| 2225 | 2373 | |
| 2226 | | state->m_track_size = 0x2f00; |
| 2374 | state->track_size = 0x2f00; |
| 2227 | 2375 | } |
| 2228 | 2376 | |
| 2229 | 2377 | static DRIVER_INIT( bnzabros ) |
| 2230 | 2378 | { |
| 2231 | 2379 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 2232 | | system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w); |
| 2233 | | state->m_mlatch_table = bnzabros_mlt; |
| 2380 | state->io_r = &segas24_state::hotrod_io_r; |
| 2381 | state->io_w = &segas24_state::hotrod_io_w; |
| 2382 | state->mlatch_table = segas24_state::bnzabros_mlt; |
| 2234 | 2383 | |
| 2235 | 2384 | // Sector Size |
| 2236 | 2385 | // 1 2048 |
| r11224 | r11225 | |
| 2241 | 2390 | // 6 1024 |
| 2242 | 2391 | // 7 256 |
| 2243 | 2392 | |
| 2244 | | state->m_track_size = 0x2d00; |
| 2393 | state->track_size = 0x2d00; |
| 2245 | 2394 | } |
| 2246 | 2395 | |
| 2247 | 2396 | static DRIVER_INIT( sspirits ) |
| 2248 | 2397 | { |
| 2249 | 2398 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 2250 | | system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w); |
| 2251 | | state->m_mlatch_table = 0; |
| 2252 | | state->m_track_size = 0x2d00; |
| 2399 | state->io_r = &segas24_state::hotrod_io_r; |
| 2400 | state->io_w = &segas24_state::hotrod_io_w; |
| 2401 | state->mlatch_table = 0; |
| 2402 | state->track_size = 0x2d00; |
| 2253 | 2403 | s24_fd1094_driver_init(machine); |
| 2254 | 2404 | } |
| 2255 | 2405 | |
| 2256 | 2406 | static DRIVER_INIT( sspiritj ) |
| 2257 | 2407 | { |
| 2258 | 2408 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 2259 | | system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w); |
| 2260 | | state->m_mlatch_table = 0; |
| 2261 | | state->m_track_size = 0x2f00; |
| 2409 | state->io_r = &segas24_state::hotrod_io_r; |
| 2410 | state->io_w = &segas24_state::hotrod_io_w; |
| 2411 | state->mlatch_table = 0; |
| 2412 | state->track_size = 0x2f00; |
| 2262 | 2413 | s24_fd1094_driver_init(machine); |
| 2263 | 2414 | } |
| 2264 | 2415 | |
| 2265 | 2416 | static DRIVER_INIT( dcclubfd ) |
| 2266 | 2417 | { |
| 2267 | 2418 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 2268 | | system24temp_sys16_io_set_callbacks(machine, dcclub_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w); |
| 2269 | | state->m_mlatch_table = dcclub_mlt; |
| 2270 | | state->m_track_size = 0x2d00; |
| 2419 | state->io_r = &segas24_state::dcclub_io_r; |
| 2420 | state->io_w = &segas24_state::hotrod_io_w; |
| 2421 | state->mlatch_table = segas24_state::dcclub_mlt; |
| 2422 | state->track_size = 0x2d00; |
| 2271 | 2423 | s24_fd1094_driver_init(machine); |
| 2272 | 2424 | } |
| 2273 | 2425 | |
| r11224 | r11225 | |
| 2275 | 2427 | static DRIVER_INIT( sgmast ) |
| 2276 | 2428 | { |
| 2277 | 2429 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 2278 | | system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w); |
| 2279 | | state->m_mlatch_table = 0; |
| 2280 | | state->m_track_size = 0x2d00; |
| 2430 | state->io_r = &segas24_state::hotrod_io_r; |
| 2431 | state->io_w = &segas24_state::hotrod_io_w; |
| 2432 | state->mlatch_table = 0; |
| 2433 | state->track_size = 0x2d00; |
| 2281 | 2434 | s24_fd1094_driver_init(machine); |
| 2282 | 2435 | } |
| 2283 | 2436 | |
| 2284 | 2437 | static DRIVER_INIT( qsww ) |
| 2285 | 2438 | { |
| 2286 | 2439 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 2287 | | system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w); |
| 2288 | | state->m_mlatch_table = 0; |
| 2289 | | state->m_track_size = 0x2d00; |
| 2440 | state->io_r = &segas24_state::hotrod_io_r; |
| 2441 | state->io_w = &segas24_state::hotrod_io_w; |
| 2442 | state->mlatch_table = 0; |
| 2443 | state->track_size = 0x2d00; |
| 2290 | 2444 | s24_fd1094_driver_init(machine); |
| 2291 | 2445 | } |
| 2292 | 2446 | |
| 2293 | 2447 | static DRIVER_INIT( gground ) |
| 2294 | 2448 | { |
| 2295 | 2449 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 2296 | | system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w); |
| 2297 | | state->m_mlatch_table = 0; |
| 2298 | | state->m_track_size = 0x2d00; |
| 2450 | state->io_r = &segas24_state::hotrod_io_r; |
| 2451 | state->io_w = &segas24_state::hotrod_io_w; |
| 2452 | state->mlatch_table = 0; |
| 2453 | state->track_size = 0x2d00; |
| 2299 | 2454 | s24_fd1094_driver_init(machine); |
| 2300 | 2455 | } |
| 2301 | 2456 | |
| 2302 | 2457 | static DRIVER_INIT( crkdown ) |
| 2303 | 2458 | { |
| 2304 | 2459 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 2305 | | system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w); |
| 2306 | | state->m_mlatch_table = 0; |
| 2307 | | state->m_track_size = 0x2d00; |
| 2460 | state->io_r = &segas24_state::hotrod_io_r; |
| 2461 | state->io_w = &segas24_state::hotrod_io_w; |
| 2462 | state->mlatch_table = 0; |
| 2463 | state->track_size = 0x2d00; |
| 2308 | 2464 | s24_fd1094_driver_init(machine); |
| 2309 | 2465 | } |
| 2310 | 2466 | |
| 2311 | 2467 | static DRIVER_INIT( roughrac ) |
| 2312 | 2468 | { |
| 2313 | 2469 | segas24_state *state = machine.driver_data<segas24_state>(); |
| 2314 | | system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w); |
| 2315 | | state->m_mlatch_table = 0; |
| 2316 | | state->m_track_size = 0x2d00; |
| 2470 | state->io_r = &segas24_state::hotrod_io_r; |
| 2471 | state->io_w = &segas24_state::hotrod_io_w; |
| 2472 | state->mlatch_table = 0; |
| 2473 | state->track_size = 0x2d00; |
| 2317 | 2474 | s24_fd1094_driver_init(machine); |
| 2318 | 2475 | } |
| 2319 | 2476 | |
src/mame/drivers/segas16b.c
| r11224 | r11225 | |
| 937 | 937 | |
| 938 | 938 | static const segaic16_memory_map_entry rom_171_5358_info_small[] = |
| 939 | 939 | { |
| 940 | | { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, NULL, misc_io_w, NULL, NULL, "I/O space" }, |
| 941 | | { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, NULL, "bank10", segaic16_paletteram_w, NULL, &segaic16_paletteram, "color RAM" }, |
| 942 | | { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, NULL, "bank11", segaic16_tileram_0_w, NULL, &segaic16_tileram_0, "tile RAM" }, |
| 943 | | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, NULL, "bank12", segaic16_textram_0_w, NULL, &segaic16_textram_0, "text RAM" }, |
| 944 | | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, NULL, "bank13", NULL, "bank13", &segaic16_spriteram_0, "object RAM" }, |
| 945 | | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, NULL, "bank14", NULL, "bank14", &workram, "work RAM" }, |
| 946 | | { 0x29/2, 0x00000, 0x20000, 0xfe0000, 0x20000, NULL, "bank15", NULL, NULL, NULL, "ROM 2" }, |
| 947 | | { 0x25/2, 0x00000, 0x20000, 0xfe0000, 0x10000, NULL, "bank16", NULL, NULL, NULL, "ROM 1" }, |
| 948 | | { 0x21/2, 0x00000, 0x20000, 0xfe0000, 0x00000, NULL, "bank17", NULL, NULL, NULL, "ROM 0" }, |
| 940 | { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC(misc_io_r), NULL, FUNC(misc_io_w), NULL, NULL, "I/O space" }, |
| 941 | { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, FUNC_NULL, "bank10", FUNC(segaic16_paletteram_w), NULL, &segaic16_paletteram, "color RAM" }, |
| 942 | { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, FUNC_NULL, "bank11", FUNC(segaic16_tileram_0_w), NULL, &segaic16_tileram_0, "tile RAM" }, |
| 943 | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, FUNC_NULL, "bank12", FUNC(segaic16_textram_0_w), NULL, &segaic16_textram_0, "text RAM" }, |
| 944 | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, FUNC_NULL, "bank13", FUNC_NULL, "bank13", &segaic16_spriteram_0, "object RAM" }, |
| 945 | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC_NULL, "bank14", FUNC_NULL, "bank14", &workram, "work RAM" }, |
| 946 | { 0x29/2, 0x00000, 0x20000, 0xfe0000, 0x20000, FUNC_NULL, "bank15", FUNC_NULL, NULL, NULL, "ROM 2" }, |
| 947 | { 0x25/2, 0x00000, 0x20000, 0xfe0000, 0x10000, FUNC_NULL, "bank16", FUNC_NULL, NULL, NULL, "ROM 1" }, |
| 948 | { 0x21/2, 0x00000, 0x20000, 0xfe0000, 0x00000, FUNC_NULL, "bank17", FUNC_NULL, NULL, NULL, "ROM 0" }, |
| 949 | 949 | { 0 } |
| 950 | 950 | }; |
| 951 | 951 | |
| 952 | 952 | static const segaic16_memory_map_entry rom_171_5358_info[] = |
| 953 | 953 | { |
| 954 | | { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, NULL, misc_io_w, NULL, NULL, "I/O space" }, |
| 955 | | { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, NULL, "bank10", segaic16_paletteram_w, NULL, &segaic16_paletteram, "color RAM" }, |
| 956 | | { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, NULL, "bank11", segaic16_tileram_0_w, NULL, &segaic16_tileram_0, "tile RAM" }, |
| 957 | | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, NULL, "bank12", segaic16_textram_0_w, NULL, &segaic16_textram_0, "text RAM" }, |
| 958 | | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, NULL, "bank13", NULL, "bank13", &segaic16_spriteram_0, "object RAM" }, |
| 959 | | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, NULL, "bank14", NULL, "bank14", &workram, "work RAM" }, |
| 960 | | { 0x29/2, 0x00000, 0x20000, 0xfe0000, 0x40000, NULL, "bank15", NULL, NULL, NULL, "ROM 2" }, |
| 961 | | { 0x25/2, 0x00000, 0x20000, 0xfe0000, 0x20000, NULL, "bank16", NULL, NULL, NULL, "ROM 1" }, |
| 962 | | { 0x21/2, 0x00000, 0x20000, 0xfe0000, 0x00000, NULL, "bank17", NULL, NULL, NULL, "ROM 0" }, |
| 954 | { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC(misc_io_r), NULL, FUNC(misc_io_w), NULL, NULL, "I/O space" }, |
| 955 | { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, FUNC_NULL, "bank10", FUNC(segaic16_paletteram_w), NULL, &segaic16_paletteram, "color RAM" }, |
| 956 | { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, FUNC_NULL, "bank11", FUNC(segaic16_tileram_0_w), NULL, &segaic16_tileram_0, "tile RAM" }, |
| 957 | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, FUNC_NULL, "bank12", FUNC(segaic16_textram_0_w), NULL, &segaic16_textram_0, "text RAM" }, |
| 958 | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, FUNC_NULL, "bank13", FUNC_NULL, "bank13", &segaic16_spriteram_0, "object RAM" }, |
| 959 | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC_NULL, "bank14", FUNC_NULL, "bank14", &workram, "work RAM" }, |
| 960 | { 0x29/2, 0x00000, 0x20000, 0xfe0000, 0x40000, FUNC_NULL, "bank15", FUNC_NULL, NULL, NULL, "ROM 2" }, |
| 961 | { 0x25/2, 0x00000, 0x20000, 0xfe0000, 0x20000, FUNC_NULL, "bank16", FUNC_NULL, NULL, NULL, "ROM 1" }, |
| 962 | { 0x21/2, 0x00000, 0x20000, 0xfe0000, 0x00000, FUNC_NULL, "bank17", FUNC_NULL, NULL, NULL, "ROM 0" }, |
| 963 | 963 | { 0 } |
| 964 | 964 | }; |
| 965 | 965 | |
| 966 | 966 | static const segaic16_memory_map_entry rom_171_5704_info[] = |
| 967 | 967 | { |
| 968 | | { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, NULL, misc_io_w, NULL, NULL, "I/O space" }, |
| 969 | | { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, NULL, "bank10", segaic16_paletteram_w, NULL, &segaic16_paletteram, "color RAM" }, |
| 970 | | { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, NULL, "bank11", segaic16_tileram_0_w, NULL, &segaic16_tileram_0, "tile RAM" }, |
| 971 | | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, NULL, "bank12", segaic16_textram_0_w, NULL, &segaic16_textram_0, "text RAM" }, |
| 972 | | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, NULL, "bank13", NULL, "bank13", &segaic16_spriteram_0, "object RAM" }, |
| 973 | | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, NULL, "bank14", NULL, "bank14", &workram, "work RAM" }, |
| 974 | | { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, NULL, NULL, rom_5704_bank_w, NULL, NULL, "tile bank" }, |
| 975 | | { 0x25/2, 0x00000, 0x80000, 0xfc0000, 0x80000, NULL, "bank16", NULL, NULL, NULL, "ROM 1" }, |
| 976 | | { 0x21/2, 0x00000, 0x80000, 0xfc0000, 0x00000, NULL, "bank17", NULL, NULL, NULL, "ROM 0" }, |
| 968 | { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC(misc_io_r), NULL, FUNC(misc_io_w), NULL, NULL, "I/O space" }, |
| 969 | { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, FUNC_NULL, "bank10", FUNC(segaic16_paletteram_w), NULL, &segaic16_paletteram, "color RAM" }, |
| 970 | { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, FUNC_NULL, "bank11", FUNC(segaic16_tileram_0_w), NULL, &segaic16_tileram_0, "tile RAM" }, |
| 971 | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, FUNC_NULL, "bank12", FUNC(segaic16_textram_0_w), NULL, &segaic16_textram_0, "text RAM" }, |
| 972 | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, FUNC_NULL, "bank13", FUNC_NULL, "bank13", &segaic16_spriteram_0, "object RAM" }, |
| 973 | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC_NULL, "bank14", FUNC_NULL, "bank14", &workram, "work RAM" }, |
| 974 | { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, FUNC_NULL, NULL, FUNC(rom_5704_bank_w), NULL, NULL, "tile bank" }, |
| 975 | { 0x25/2, 0x00000, 0x80000, 0xfc0000, 0x80000, FUNC_NULL, "bank16", FUNC_NULL, NULL, NULL, "ROM 1" }, |
| 976 | { 0x21/2, 0x00000, 0x80000, 0xfc0000, 0x00000, FUNC_NULL, "bank17", FUNC_NULL, NULL, NULL, "ROM 0" }, |
| 977 | 977 | { 0 } |
| 978 | 978 | }; |
| 979 | 979 | |
| 980 | 980 | static const segaic16_memory_map_entry rom_atomicp_info[] = |
| 981 | 981 | { |
| 982 | | { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, NULL, misc_io_w, NULL, NULL, "I/O space" }, |
| 983 | | { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, NULL, "bank10", segaic16_paletteram_w, NULL, &segaic16_paletteram, "color RAM" }, |
| 984 | | { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, NULL, "bank11", segaic16_tileram_0_w, NULL, &segaic16_tileram_0, "tile RAM" }, |
| 985 | | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, NULL, "bank12", segaic16_textram_0_w, NULL, &segaic16_textram_0, "text RAM" }, |
| 986 | | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, NULL, "bank13", NULL, "bank13", &segaic16_spriteram_0, "object RAM" }, |
| 987 | | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, NULL, "bank14", NULL, "bank14", &workram, "work RAM" }, |
| 988 | | { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, NULL, NULL, rom_5704_bank_w, NULL, NULL, "tile bank" }, |
| 989 | | { 0x25/2, 0x00000, 0x10000, 0xff0000, ~0, NULL, NULL, atomicp_sound_w, NULL, NULL, "sound" }, |
| 990 | | { 0x21/2, 0x00000, 0x80000, 0xfc0000, 0x00000, NULL, "bank17", NULL, NULL, NULL, "ROM 0" }, |
| 982 | { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC(misc_io_r), NULL, FUNC(misc_io_w), NULL, NULL, "I/O space" }, |
| 983 | { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, FUNC_NULL, "bank10", FUNC(segaic16_paletteram_w), NULL, &segaic16_paletteram, "color RAM" }, |
| 984 | { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, FUNC_NULL, "bank11", FUNC(segaic16_tileram_0_w), NULL, &segaic16_tileram_0, "tile RAM" }, |
| 985 | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, FUNC_NULL, "bank12", FUNC(segaic16_textram_0_w), NULL, &segaic16_textram_0, "text RAM" }, |
| 986 | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, FUNC_NULL, "bank13", FUNC_NULL, "bank13", &segaic16_spriteram_0, "object RAM" }, |
| 987 | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC_NULL, "bank14", FUNC_NULL, "bank14", &workram, "work RAM" }, |
| 988 | { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, FUNC_NULL, NULL, FUNC(rom_5704_bank_w), NULL, NULL, "tile bank" }, |
| 989 | { 0x25/2, 0x00000, 0x10000, 0xff0000, ~0, FUNC_NULL, NULL, FUNC(atomicp_sound_w), NULL, NULL, "sound" }, |
| 990 | { 0x21/2, 0x00000, 0x80000, 0xfc0000, 0x00000, FUNC_NULL, "bank17", FUNC_NULL, NULL, NULL, "ROM 0" }, |
| 991 | 991 | { 0 } |
| 992 | 992 | }; |
| 993 | 993 | |
| 994 | 994 | static const segaic16_memory_map_entry rom_171_5797_info[] = |
| 995 | 995 | { |
| 996 | | { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, NULL, misc_io_w, NULL, NULL, "I/O space" }, |
| 997 | | { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, NULL, "bank10", segaic16_paletteram_w, NULL, &segaic16_paletteram, "color RAM" }, |
| 998 | | { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, NULL, "bank11", segaic16_tileram_0_w, NULL, &segaic16_tileram_0, "tile RAM" }, |
| 999 | | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, NULL, "bank12", segaic16_textram_0_w, NULL, &segaic16_textram_0, "text RAM" }, |
| 1000 | | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, NULL, "bank13", NULL, "bank13", &segaic16_spriteram_0, "object RAM" }, |
| 1001 | | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, NULL, "bank14", NULL, "bank14", &workram, "work RAM" }, |
| 1002 | | { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, unknown_rgn2_r, NULL, unknown_rgn2_w, NULL, NULL, "???" }, |
| 1003 | | { 0x25/2, 0x00000, 0x04000, 0xffc000, ~0, rom_5797_bank_math_r, NULL, rom_5797_bank_math_w, NULL, NULL, "tile bank/math" }, |
| 1004 | | { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, NULL, "bank17", NULL, NULL, NULL, "ROM 0" }, |
| 996 | { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC(misc_io_r), NULL, FUNC(misc_io_w), NULL, NULL, "I/O space" }, |
| 997 | { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, FUNC_NULL, "bank10", FUNC(segaic16_paletteram_w), NULL, &segaic16_paletteram, "color RAM" }, |
| 998 | { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, FUNC_NULL, "bank11", FUNC(segaic16_tileram_0_w), NULL, &segaic16_tileram_0, "tile RAM" }, |
| 999 | { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, FUNC_NULL, "bank12", FUNC(segaic16_textram_0_w), NULL, &segaic16_textram_0, "text RAM" }, |
| 1000 | { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, FUNC_NULL, "bank13", FUNC_NULL, "bank13", &segaic16_spriteram_0, "object RAM" }, |
| 1001 | { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC_NULL, "bank14", FUNC_NULL, "bank14", &workram, "work RAM" }, |
| 1002 | { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, FUNC(unknown_rgn2_r), NULL, FUNC(unknown_rgn2_w), NULL, NULL, "???" }, |
| 1003 | { 0x25/2, 0x00000, 0x04000, 0xffc000, ~0, FUNC(rom_5797_bank_math_r), NULL, FUNC(rom_5797_bank_math_w), NULL, NULL, "tile bank/math" }, |
| 1004 | { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, FUNC_NULL, "bank17", FUNC_NULL, NULL, NULL, "ROM 0" }, |
| 1005 | 1005 | { 0 } |
| 1006 | 1006 | }; |
| 1007 | 1007 | |
src/emu/memory.c
| r11224 | r11225 | |
| 2082 | 2082 | if (readorwrite == ROW_READ) |
| 2083 | 2083 | switch (data.m_bits) |
| 2084 | 2084 | { |
| 2085 | | case 8: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read8_delegate(entry.m_rproto8, *object), data.m_mask); break; |
| 2086 | | case 16: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read16_delegate(entry.m_rproto16, *object), data.m_mask); break; |
| 2087 | | case 32: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read32_delegate(entry.m_rproto32, *object), data.m_mask); break; |
| 2088 | | case 64: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read64_delegate(entry.m_rproto64, *object), data.m_mask); break; |
| 2085 | case 8: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read8_delegate(entry.m_rproto8, object), data.m_mask); break; |
| 2086 | case 16: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read16_delegate(entry.m_rproto16, object), data.m_mask); break; |
| 2087 | case 32: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read32_delegate(entry.m_rproto32, object), data.m_mask); break; |
| 2088 | case 64: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read64_delegate(entry.m_rproto64, object), data.m_mask); break; |
| 2089 | 2089 | } |
| 2090 | 2090 | else |
| 2091 | 2091 | switch (data.m_bits) |
| 2092 | 2092 | { |
| 2093 | | case 8: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write8_delegate(entry.m_wproto8, *object), data.m_mask); break; |
| 2094 | | case 16: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write16_delegate(entry.m_wproto16, *object), data.m_mask); break; |
| 2095 | | case 32: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write32_delegate(entry.m_wproto32, *object), data.m_mask); break; |
| 2096 | | case 64: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write64_delegate(entry.m_wproto64, *object), data.m_mask); break; |
| 2093 | case 8: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write8_delegate(entry.m_wproto8, object), data.m_mask); break; |
| 2094 | case 16: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write16_delegate(entry.m_wproto16, object), data.m_mask); break; |
| 2095 | case 32: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write32_delegate(entry.m_wproto32, object), data.m_mask); break; |
| 2096 | case 64: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write64_delegate(entry.m_wproto64, object), data.m_mask); break; |
| 2097 | 2097 | } |
| 2098 | 2098 | break; |
| 2099 | 2099 | |
| r11224 | r11225 | |
| 3743 | 3743 | { |
| 3744 | 3744 | // 8-bit case |
| 3745 | 3745 | case 8: |
| 3746 | | m_handlers[STATIC_UNMAP]->set_delegate(read8_delegate_create(address_table_read, unmap_r<UINT8>, *this)); |
| 3747 | | m_handlers[STATIC_NOP]->set_delegate(read8_delegate_create(address_table_read, nop_r<UINT8>, *this)); |
| 3748 | | m_handlers[STATIC_WATCHPOINT]->set_delegate(read8_delegate_create(address_table_read, watchpoint_r<UINT8>, *this)); |
| 3746 | m_handlers[STATIC_UNMAP]->set_delegate(read8_delegate(FUNC(address_table_read::unmap_r<UINT8>), this)); |
| 3747 | m_handlers[STATIC_NOP]->set_delegate(read8_delegate(FUNC(address_table_read::nop_r<UINT8>), this)); |
| 3748 | m_handlers[STATIC_WATCHPOINT]->set_delegate(read8_delegate(FUNC(address_table_read::watchpoint_r<UINT8>), this)); |
| 3749 | 3749 | break; |
| 3750 | 3750 | |
| 3751 | 3751 | // 16-bit case |
| 3752 | 3752 | case 16: |
| 3753 | | m_handlers[STATIC_UNMAP]->set_delegate(read16_delegate_create(address_table_read, unmap_r<UINT16>, *this)); |
| 3754 | | m_handlers[STATIC_NOP]->set_delegate(read16_delegate_create(address_table_read, nop_r<UINT16>, *this)); |
| 3755 | | m_handlers[STATIC_WATCHPOINT]->set_delegate(read16_delegate_create(address_table_read, watchpoint_r<UINT16>, *this)); |
| 3753 | m_handlers[STATIC_UNMAP]->set_delegate(read16_delegate(FUNC(address_table_read::unmap_r<UINT16>), this)); |
| 3754 | m_handlers[STATIC_NOP]->set_delegate(read16_delegate(FUNC(address_table_read::nop_r<UINT16>), this)); |
| 3755 | m_handlers[STATIC_WATCHPOINT]->set_delegate(read16_delegate(FUNC(address_table_read::watchpoint_r<UINT16>), this)); |
| 3756 | 3756 | break; |
| 3757 | 3757 | |
| 3758 | 3758 | // 32-bit case |
| 3759 | 3759 | case 32: |
| 3760 | | m_handlers[STATIC_UNMAP]->set_delegate(read32_delegate_create(address_table_read, unmap_r<UINT32>, *this)); |
| 3761 | | m_handlers[STATIC_NOP]->set_delegate(read32_delegate_create(address_table_read, nop_r<UINT32>, *this)); |
| 3762 | | m_handlers[STATIC_WATCHPOINT]->set_delegate(read32_delegate_create(address_table_read, watchpoint_r<UINT32>, *this)); |
| 3760 | m_handlers[STATIC_UNMAP]->set_delegate(read32_delegate(FUNC(address_table_read::unmap_r<UINT32>), this)); |
| 3761 | m_handlers[STATIC_NOP]->set_delegate(read32_delegate(FUNC(address_table_read::nop_r<UINT32>), this)); |
| 3762 | m_handlers[STATIC_WATCHPOINT]->set_delegate(read32_delegate(FUNC(address_table_read::watchpoint_r<UINT32>), this)); |
| 3763 | 3763 | break; |
| 3764 | 3764 | |
| 3765 | 3765 | // 64-bit case |
| 3766 | 3766 | case 64: |
| 3767 | | m_handlers[STATIC_UNMAP]->set_delegate(read64_delegate_create(address_table_read, unmap_r<UINT64>, *this)); |
| 3768 | | m_handlers[STATIC_NOP]->set_delegate(read64_delegate_create(address_table_read, nop_r<UINT64>, *this)); |
| 3769 | | m_handlers[STATIC_WATCHPOINT]->set_delegate(read64_delegate_create(address_table_read, watchpoint_r<UINT64>, *this)); |
| 3767 | m_handlers[STATIC_UNMAP]->set_delegate(read64_delegate(FUNC(address_table_read::unmap_r<UINT64>), this)); |
| 3768 | m_handlers[STATIC_NOP]->set_delegate(read64_delegate(FUNC(address_table_read::nop_r<UINT64>), this)); |
| 3769 | m_handlers[STATIC_WATCHPOINT]->set_delegate(read64_delegate(FUNC(address_table_read::watchpoint_r<UINT64>), this)); |
| 3770 | 3770 | break; |
| 3771 | 3771 | } |
| 3772 | 3772 | |
| r11224 | r11225 | |
| 3819 | 3819 | { |
| 3820 | 3820 | // 8-bit case |
| 3821 | 3821 | case 8: |
| 3822 | | m_handlers[STATIC_UNMAP]->set_delegate(write8_delegate_create(address_table_write, unmap_w<UINT8>, *this)); |
| 3823 | | m_handlers[STATIC_NOP]->set_delegate(write8_delegate_create(address_table_write, nop_w<UINT8>, *this)); |
| 3824 | | m_handlers[STATIC_WATCHPOINT]->set_delegate(write8_delegate_create(address_table_write, watchpoint_w<UINT8>, *this)); |
| 3822 | m_handlers[STATIC_UNMAP]->set_delegate(write8_delegate(FUNC(address_table_write::unmap_w<UINT8>), this)); |
| 3823 | m_handlers[STATIC_NOP]->set_delegate(write8_delegate(FUNC(address_table_write::nop_w<UINT8>), this)); |
| 3824 | m_handlers[STATIC_WATCHPOINT]->set_delegate(write8_delegate(FUNC(address_table_write::watchpoint_w<UINT8>), this)); |
| 3825 | 3825 | break; |
| 3826 | 3826 | |
| 3827 | 3827 | // 16-bit case |
| 3828 | 3828 | case 16: |
| 3829 | | m_handlers[STATIC_UNMAP]->set_delegate(write16_delegate_create(address_table_write, unmap_w<UINT16>, *this)); |
| 3830 | | m_handlers[STATIC_NOP]->set_delegate(write16_delegate_create(address_table_write, nop_w<UINT16>, *this)); |
| 3831 | | m_handlers[STATIC_WATCHPOINT]->set_delegate(write16_delegate_create(address_table_write, watchpoint_w<UINT16>, *this)); |
| 3829 | m_handlers[STATIC_UNMAP]->set_delegate(write16_delegate(FUNC(address_table_write::unmap_w<UINT16>), this)); |
| 3830 | m_handlers[STATIC_NOP]->set_delegate(write16_delegate(FUNC(address_table_write::nop_w<UINT16>), this)); |
| 3831 | m_handlers[STATIC_WATCHPOINT]->set_delegate(write16_delegate(FUNC(address_table_write::watchpoint_w<UINT16>), this)); |
| 3832 | 3832 | break; |
| 3833 | 3833 | |
| 3834 | 3834 | // 32-bit case |
| 3835 | 3835 | case 32: |
| 3836 | | m_handlers[STATIC_UNMAP]->set_delegate(write32_delegate_create(address_table_write, unmap_w<UINT32>, *this)); |
| 3837 | | m_handlers[STATIC_NOP]->set_delegate(write32_delegate_create(address_table_write, nop_w<UINT32>, *this)); |
| 3838 | | m_handlers[STATIC_WATCHPOINT]->set_delegate(write32_delegate_create(address_table_write, watchpoint_w<UINT32>, *this)); |
| 3836 | m_handlers[STATIC_UNMAP]->set_delegate(write32_delegate(FUNC(address_table_write::unmap_w<UINT32>), this)); |
| 3837 | m_handlers[STATIC_NOP]->set_delegate(write32_delegate(FUNC(address_table_write::nop_w<UINT32>), this)); |
| 3838 | m_handlers[STATIC_WATCHPOINT]->set_delegate(write32_delegate(FUNC(address_table_write::watchpoint_w<UINT32>), this)); |
| 3839 | 3839 | break; |
| 3840 | 3840 | |
| 3841 | 3841 | // 64-bit case |
| 3842 | 3842 | case 64: |
| 3843 | | m_handlers[STATIC_UNMAP]->set_delegate(write64_delegate_create(address_table_write, unmap_w<UINT64>, *this)); |
| 3844 | | m_handlers[STATIC_NOP]->set_delegate(write64_delegate_create(address_table_write, nop_w<UINT64>, *this)); |
| 3845 | | m_handlers[STATIC_WATCHPOINT]->set_delegate(write64_delegate_create(address_table_write, watchpoint_w<UINT64>, *this)); |
| 3843 | m_handlers[STATIC_UNMAP]->set_delegate(write64_delegate(FUNC(address_table_write::unmap_w<UINT64>), this)); |
| 3844 | m_handlers[STATIC_NOP]->set_delegate(write64_delegate(FUNC(address_table_write::nop_w<UINT64>), this)); |
| 3845 | m_handlers[STATIC_WATCHPOINT]->set_delegate(write64_delegate(FUNC(address_table_write::watchpoint_w<UINT64>), this)); |
| 3846 | 3846 | break; |
| 3847 | 3847 | } |
| 3848 | 3848 | |
| r11224 | r11225 | |
| 4446 | 4446 | { |
| 4447 | 4447 | configure_subunits(mask, 8); |
| 4448 | 4448 | if (m_datawidth == 16) |
| 4449 | | set_delegate(read16_delegate(read16_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_16_from_8>(delegate.name()), *this)); |
| 4449 | set_delegate(read16_delegate(&handler_entry_read::read_stub_16_from_8, delegate.name(), this)); |
| 4450 | 4450 | else if (m_datawidth == 32) |
| 4451 | | set_delegate(read32_delegate(read32_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_32_from_8>(delegate.name()), *this)); |
| 4451 | set_delegate(read32_delegate(&handler_entry_read::read_stub_32_from_8, delegate.name(), this)); |
| 4452 | 4452 | else if (m_datawidth == 64) |
| 4453 | | set_delegate(read64_delegate(read64_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_64_from_8>(delegate.name()), *this)); |
| 4453 | set_delegate(read64_delegate(&handler_entry_read::read_stub_64_from_8, delegate.name(), this)); |
| 4454 | 4454 | } |
| 4455 | 4455 | } |
| 4456 | 4456 | |
| r11224 | r11225 | |
| 4475 | 4475 | { |
| 4476 | 4476 | configure_subunits(mask, 16); |
| 4477 | 4477 | if (m_datawidth == 32) |
| 4478 | | set_delegate(read32_delegate(read32_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_32_from_16>(delegate.name()), *this)); |
| 4478 | set_delegate(read32_delegate(&handler_entry_read::read_stub_32_from_16, delegate.name(), this)); |
| 4479 | 4479 | else if (m_datawidth == 64) |
| 4480 | | set_delegate(read64_delegate(read64_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_64_from_16>(delegate.name()), *this)); |
| 4480 | set_delegate(read64_delegate(&handler_entry_read::read_stub_64_from_16, delegate.name(), this)); |
| 4481 | 4481 | } |
| 4482 | 4482 | } |
| 4483 | 4483 | |
| r11224 | r11225 | |
| 4502 | 4502 | { |
| 4503 | 4503 | configure_subunits(mask, 32); |
| 4504 | 4504 | if (m_datawidth == 64) |
| 4505 | | set_delegate(read64_delegate(read64_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_64_from_32>(delegate.name()), *this)); |
| 4505 | set_delegate(read64_delegate(&handler_entry_read::read_stub_64_from_32, delegate.name(), this)); |
| 4506 | 4506 | } |
| 4507 | 4507 | } |
| 4508 | 4508 | |
| r11224 | r11225 | |
| 4532 | 4532 | { |
| 4533 | 4533 | m_legacy_handler.space8 = func; |
| 4534 | 4534 | m_legacy_object.space = &space; |
| 4535 | | set_delegate(read8_delegate(read8_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_legacy>(name), *this), mask); |
| 4535 | set_delegate(read8_delegate(&handler_entry_read::read_stub_legacy, name, this), mask); |
| 4536 | 4536 | } |
| 4537 | 4537 | |
| 4538 | 4538 | void handler_entry_read::set_legacy_func(address_space &space, read16_space_func func, const char *name, UINT64 mask) |
| 4539 | 4539 | { |
| 4540 | 4540 | m_legacy_handler.space16 = func; |
| 4541 | 4541 | m_legacy_object.space = &space; |
| 4542 | | set_delegate(read16_delegate(read16_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_legacy>(name), *this), mask); |
| 4542 | set_delegate(read16_delegate(&handler_entry_read::read_stub_legacy, name, this), mask); |
| 4543 | 4543 | } |
| 4544 | 4544 | |
| 4545 | 4545 | void handler_entry_read::set_legacy_func(address_space &space, read32_space_func func, const char *name, UINT64 mask) |
| 4546 | 4546 | { |
| 4547 | 4547 | m_legacy_handler.space32 = func; |
| 4548 | 4548 | m_legacy_object.space = &space; |
| 4549 | | set_delegate(read32_delegate(read32_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_legacy>(name), *this), mask); |
| 4549 | set_delegate(read32_delegate(&handler_entry_read::read_stub_legacy, name, this), mask); |
| 4550 | 4550 | } |
| 4551 | 4551 | |
| 4552 | 4552 | void handler_entry_read::set_legacy_func(address_space &space, read64_space_func func, const char *name, UINT64 mask) |
| 4553 | 4553 | { |
| 4554 | 4554 | m_legacy_handler.space64 = func; |
| 4555 | 4555 | m_legacy_object.space = &space; |
| 4556 | | set_delegate(read64_delegate(read64_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_legacy>(name), *this), mask); |
| 4556 | set_delegate(read64_delegate(&handler_entry_read::read_stub_legacy, name, this), mask); |
| 4557 | 4557 | } |
| 4558 | 4558 | |
| 4559 | 4559 | |
| r11224 | r11225 | |
| 4566 | 4566 | { |
| 4567 | 4567 | m_legacy_handler.device8 = func; |
| 4568 | 4568 | m_legacy_object.device = &device; |
| 4569 | | set_delegate(read8_delegate(read8_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_legacy>(name), *this), mask); |
| 4569 | set_delegate(read8_delegate(&handler_entry_read::read_stub_legacy, name, this), mask); |
| 4570 | 4570 | } |
| 4571 | 4571 | |
| 4572 | 4572 | void handler_entry_read::set_legacy_func(device_t &device, read16_device_func func, const char *name, UINT64 mask) |
| 4573 | 4573 | { |
| 4574 | 4574 | m_legacy_handler.device16 = func; |
| 4575 | 4575 | m_legacy_object.device = &device; |
| 4576 | | set_delegate(read16_delegate(read16_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_legacy>(name), *this), mask); |
| 4576 | set_delegate(read16_delegate(&handler_entry_read::read_stub_legacy, name, this), mask); |
| 4577 | 4577 | } |
| 4578 | 4578 | |
| 4579 | 4579 | void handler_entry_read::set_legacy_func(device_t &device, read32_device_func func, const char *name, UINT64 mask) |
| 4580 | 4580 | { |
| 4581 | 4581 | m_legacy_handler.device32 = func; |
| 4582 | 4582 | m_legacy_object.device = &device; |
| 4583 | | set_delegate(read32_delegate(read32_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_legacy>(name), *this), mask); |
| 4583 | set_delegate(read32_delegate(&handler_entry_read::read_stub_legacy, name, this), mask); |
| 4584 | 4584 | } |
| 4585 | 4585 | |
| 4586 | 4586 | void handler_entry_read::set_legacy_func(device_t &device, read64_device_func func, const char *name, UINT64 mask) |
| 4587 | 4587 | { |
| 4588 | 4588 | m_legacy_handler.device64 = func; |
| 4589 | 4589 | m_legacy_object.device = &device; |
| 4590 | | set_delegate(read64_delegate(read64_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_legacy>(name), *this), mask); |
| 4590 | set_delegate(read64_delegate(&handler_entry_read::read_stub_legacy, name, this), mask); |
| 4591 | 4591 | } |
| 4592 | 4592 | |
| 4593 | 4593 | |
| r11224 | r11225 | |
| 4600 | 4600 | { |
| 4601 | 4601 | m_ioport = &ioport; |
| 4602 | 4602 | if (m_datawidth == 8) |
| 4603 | | set_delegate(read8_delegate(read8_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_ioport<UINT8> >(ioport.tag), *this)); |
| 4603 | set_delegate(read8_delegate(&handler_entry_read::read_stub_ioport<UINT8>, ioport.tag, this)); |
| 4604 | 4604 | else if (m_datawidth == 16) |
| 4605 | | set_delegate(read16_delegate(read16_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_ioport<UINT16> >(ioport.tag), *this)); |
| 4605 | set_delegate(read16_delegate(&handler_entry_read::read_stub_ioport<UINT16>, ioport.tag, this)); |
| 4606 | 4606 | else if (m_datawidth == 32) |
| 4607 | | set_delegate(read32_delegate(read32_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_ioport<UINT32> >(ioport.tag), *this)); |
| 4607 | set_delegate(read32_delegate(&handler_entry_read::read_stub_ioport<UINT32>, ioport.tag, this)); |
| 4608 | 4608 | else if (m_datawidth == 64) |
| 4609 | | set_delegate(read64_delegate(read64_proto_delegate::_create_member<handler_entry_read, &handler_entry_read::read_stub_ioport<UINT64> >(ioport.tag), *this)); |
| 4609 | set_delegate(read64_delegate(&handler_entry_read::read_stub_ioport<UINT64>, ioport.tag, this)); |
| 4610 | 4610 | } |
| 4611 | 4611 | |
| 4612 | 4612 | |
| r11224 | r11225 | |
| 4788 | 4788 | { |
| 4789 | 4789 | configure_subunits(mask, 8); |
| 4790 | 4790 | if (m_datawidth == 16) |
| 4791 | | set_delegate(write16_delegate(write16_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_16_from_8>(delegate.name()), *this)); |
| 4791 | set_delegate(write16_delegate(&handler_entry_write::write_stub_16_from_8, delegate.name(), this)); |
| 4792 | 4792 | else if (m_datawidth == 32) |
| 4793 | | set_delegate(write32_delegate(write32_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_32_from_8>(delegate.name()), *this)); |
| 4793 | set_delegate(write32_delegate(&handler_entry_write::write_stub_32_from_8, delegate.name(), this)); |
| 4794 | 4794 | else if (m_datawidth == 64) |
| 4795 | | set_delegate(write64_delegate(write64_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_64_from_8>(delegate.name()), *this)); |
| 4795 | set_delegate(write64_delegate(&handler_entry_write::write_stub_64_from_8, delegate.name(), this)); |
| 4796 | 4796 | } |
| 4797 | 4797 | } |
| 4798 | 4798 | |
| r11224 | r11225 | |
| 4812 | 4812 | { |
| 4813 | 4813 | configure_subunits(mask, 16); |
| 4814 | 4814 | if (m_datawidth == 32) |
| 4815 | | set_delegate(write32_delegate(write32_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_32_from_16>(delegate.name()), *this)); |
| 4815 | set_delegate(write32_delegate(&handler_entry_write::write_stub_32_from_16, delegate.name(), this)); |
| 4816 | 4816 | else if (m_datawidth == 64) |
| 4817 | | set_delegate(write64_delegate(write64_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_64_from_16>(delegate.name()), *this)); |
| 4817 | set_delegate(write64_delegate(&handler_entry_write::write_stub_64_from_16, delegate.name(), this)); |
| 4818 | 4818 | } |
| 4819 | 4819 | } |
| 4820 | 4820 | |
| r11224 | r11225 | |
| 4834 | 4834 | { |
| 4835 | 4835 | configure_subunits(mask, 32); |
| 4836 | 4836 | if (m_datawidth == 64) |
| 4837 | | set_delegate(write64_delegate(write64_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_64_from_32>(delegate.name()), *this)); |
| 4837 | set_delegate(write64_delegate(&handler_entry_write::write_stub_64_from_32, delegate.name(), this)); |
| 4838 | 4838 | } |
| 4839 | 4839 | } |
| 4840 | 4840 | |
| r11224 | r11225 | |
| 4859 | 4859 | { |
| 4860 | 4860 | m_legacy_handler.space8 = func; |
| 4861 | 4861 | m_legacy_object.space = &space; |
| 4862 | | set_delegate(write8_delegate(write8_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_legacy>(name), *this), mask); |
| 4862 | set_delegate(write8_delegate(&handler_entry_write::write_stub_legacy, name, this), mask); |
| 4863 | 4863 | } |
| 4864 | 4864 | |
| 4865 | 4865 | void handler_entry_write::set_legacy_func(address_space &space, write16_space_func func, const char *name, UINT64 mask) |
| 4866 | 4866 | { |
| 4867 | 4867 | m_legacy_handler.space16 = func; |
| 4868 | 4868 | m_legacy_object.space = &space; |
| 4869 | | set_delegate(write16_delegate(write16_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_legacy>(name), *this), mask); |
| 4869 | set_delegate(write16_delegate(&handler_entry_write::write_stub_legacy, name, this), mask); |
| 4870 | 4870 | } |
| 4871 | 4871 | |
| 4872 | 4872 | void handler_entry_write::set_legacy_func(address_space &space, write32_space_func func, const char *name, UINT64 mask) |
| 4873 | 4873 | { |
| 4874 | 4874 | m_legacy_handler.space32 = func; |
| 4875 | 4875 | m_legacy_object.space = &space; |
| 4876 | | set_delegate(write32_delegate(write32_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_legacy>(name), *this), mask); |
| 4876 | set_delegate(write32_delegate(&handler_entry_write::write_stub_legacy, name, this), mask); |
| 4877 | 4877 | } |
| 4878 | 4878 | |
| 4879 | 4879 | void handler_entry_write::set_legacy_func(address_space &space, write64_space_func func, const char *name, UINT64 mask) |
| 4880 | 4880 | { |
| 4881 | 4881 | m_legacy_handler.space64 = func; |
| 4882 | 4882 | m_legacy_object.space = &space; |
| 4883 | | set_delegate(write64_delegate(write64_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_legacy>(name), *this), mask); |
| 4883 | set_delegate(write64_delegate(&handler_entry_write::write_stub_legacy, name, this), mask); |
| 4884 | 4884 | } |
| 4885 | 4885 | |
| 4886 | 4886 | |
| r11224 | r11225 | |
| 4893 | 4893 | { |
| 4894 | 4894 | m_legacy_handler.device8 = func; |
| 4895 | 4895 | m_legacy_object.device = &device; |
| 4896 | | set_delegate(write8_delegate(write8_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_legacy>(name), *this), mask); |
| 4896 | set_delegate(write8_delegate(&handler_entry_write::write_stub_legacy, name, this), mask); |
| 4897 | 4897 | } |
| 4898 | 4898 | |
| 4899 | 4899 | void handler_entry_write::set_legacy_func(device_t &device, write16_device_func func, const char *name, UINT64 mask) |
| 4900 | 4900 | { |
| 4901 | 4901 | m_legacy_handler.device16 = func; |
| 4902 | 4902 | m_legacy_object.device = &device; |
| 4903 | | set_delegate(write16_delegate(write16_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_legacy>(name), *this), mask); |
| 4903 | set_delegate(write16_delegate(&handler_entry_write::write_stub_legacy, name, this), mask); |
| 4904 | 4904 | } |
| 4905 | 4905 | |
| 4906 | 4906 | void handler_entry_write::set_legacy_func(device_t &device, write32_device_func func, const char *name, UINT64 mask) |
| 4907 | 4907 | { |
| 4908 | 4908 | m_legacy_handler.device32 = func; |
| 4909 | 4909 | m_legacy_object.device = &device; |
| 4910 | | set_delegate(write32_delegate(write32_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_legacy>(name), *this), mask); |
| 4910 | set_delegate(write32_delegate(&handler_entry_write::write_stub_legacy, name, this), mask); |
| 4911 | 4911 | } |
| 4912 | 4912 | |
| 4913 | 4913 | void handler_entry_write::set_legacy_func(device_t &device, write64_device_func func, const char *name, UINT64 mask) |
| 4914 | 4914 | { |
| 4915 | 4915 | m_legacy_handler.device64 = func; |
| 4916 | 4916 | m_legacy_object.device = &device; |
| 4917 | | set_delegate(write64_delegate(write64_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_legacy>(name), *this), mask); |
| 4917 | set_delegate(write64_delegate(&handler_entry_write::write_stub_legacy, name, this), mask); |
| 4918 | 4918 | } |
| 4919 | 4919 | |
| 4920 | 4920 | |
| r11224 | r11225 | |
| 4927 | 4927 | { |
| 4928 | 4928 | m_ioport = &ioport; |
| 4929 | 4929 | if (m_datawidth == 8) |
| 4930 | | set_delegate(write8_delegate(write8_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_ioport<UINT8> >(ioport.tag), *this)); |
| 4930 | set_delegate(write8_delegate(&handler_entry_write::write_stub_ioport<UINT8>, ioport.tag, this)); |
| 4931 | 4931 | else if (m_datawidth == 16) |
| 4932 | | set_delegate(write16_delegate(write16_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_ioport<UINT16> >(ioport.tag), *this)); |
| 4932 | set_delegate(write16_delegate(&handler_entry_write::write_stub_ioport<UINT16>, ioport.tag, this)); |
| 4933 | 4933 | else if (m_datawidth == 32) |
| 4934 | | set_delegate(write32_delegate(write32_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_ioport<UINT32> >(ioport.tag), *this)); |
| 4934 | set_delegate(write32_delegate(&handler_entry_write::write_stub_ioport<UINT32>, ioport.tag, this)); |
| 4935 | 4935 | else if (m_datawidth == 64) |
| 4936 | | set_delegate(write64_delegate(write64_proto_delegate::_create_member<handler_entry_write, &handler_entry_write::write_stub_ioport<UINT64> >(ioport.tag), *this)); |
| 4936 | set_delegate(write64_delegate(&handler_entry_write::write_stub_ioport<UINT64>, ioport.tag, this)); |
| 4937 | 4937 | } |
| 4938 | 4938 | |
| 4939 | 4939 | |
src/emu/addrmap.h
| r11224 | r11225 | |
| 157 | 157 | offs_t m_rgnoffs; // offset within the region |
| 158 | 158 | |
| 159 | 159 | // handlers |
| 160 | | read8_proto_delegate m_rproto8; // 8-bit read proto-delegate |
| 161 | | read16_proto_delegate m_rproto16; // 16-bit read proto-delegate |
| 162 | | read32_proto_delegate m_rproto32; // 32-bit read proto-delegate |
| 163 | | read64_proto_delegate m_rproto64; // 64-bit read proto-delegate |
| 160 | read8_delegate m_rproto8; // 8-bit read proto-delegate |
| 161 | read16_delegate m_rproto16; // 16-bit read proto-delegate |
| 162 | read32_delegate m_rproto32; // 32-bit read proto-delegate |
| 163 | read64_delegate m_rproto64; // 64-bit read proto-delegate |
| 164 | 164 | read8_space_func m_rspace8; // 8-bit legacy address space handler |
| 165 | 165 | read16_space_func m_rspace16; // 16-bit legacy address space handler |
| 166 | 166 | read32_space_func m_rspace32; // 32-bit legacy address space handler |
| r11224 | r11225 | |
| 169 | 169 | read16_device_func m_rdevice16; // 16-bit legacy device handler |
| 170 | 170 | read32_device_func m_rdevice32; // 32-bit legacy device handler |
| 171 | 171 | read64_device_func m_rdevice64; // 64-bit legacy device handler |
| 172 | | write8_proto_delegate m_wproto8; // 8-bit write proto-delegate |
| 173 | | write16_proto_delegate m_wproto16; // 16-bit write proto-delegate |
| 174 | | write32_proto_delegate m_wproto32; // 32-bit write proto-delegate |
| 175 | | write64_proto_delegate m_wproto64; // 64-bit write proto-delegate |
| 172 | write8_delegate m_wproto8; // 8-bit write proto-delegate |
| 173 | write16_delegate m_wproto16; // 16-bit write proto-delegate |
| 174 | write32_delegate m_wproto32; // 32-bit write proto-delegate |
| 175 | write64_delegate m_wproto64; // 64-bit write proto-delegate |
| 176 | 176 | write8_space_func m_wspace8; // 8-bit legacy address space handler |
| 177 | 177 | write16_space_func m_wspace16; // 16-bit legacy address space handler |
| 178 | 178 | write32_space_func m_wspace32; // 32-bit legacy address space handler |
| r11224 | r11225 | |
| 200 | 200 | void internal_set_handler(const device_config &devconfig, const char *tag, read8_device_func func, const char *string, UINT64 mask); |
| 201 | 201 | void internal_set_handler(const device_config &devconfig, const char *tag, write8_device_func func, const char *string, UINT64 mask); |
| 202 | 202 | void internal_set_handler(const device_config &devconfig, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT64 mask); |
| 203 | | void internal_set_handler(const device_config &devconfig, const char *tag, read8_proto_delegate func, UINT64 mask); |
| 204 | | void internal_set_handler(const device_config &devconfig, const char *tag, write8_proto_delegate func, UINT64 mask); |
| 205 | | void internal_set_handler(const device_config &devconfig, const char *tag, read8_proto_delegate rfunc, write8_proto_delegate wfunc, UINT64 mask); |
| 203 | void internal_set_handler(const device_config &devconfig, const char *tag, read8_delegate func, UINT64 mask); |
| 204 | void internal_set_handler(const device_config &devconfig, const char *tag, write8_delegate func, UINT64 mask); |
| 205 | void internal_set_handler(const device_config &devconfig, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT64 mask); |
| 206 | 206 | |
| 207 | 207 | // internal handler setters for 16-bit functions |
| 208 | 208 | void internal_set_handler(read16_space_func func, const char *string, UINT64 mask); |
| r11224 | r11225 | |
| 211 | 211 | void internal_set_handler(const device_config &devconfig, const char *tag, read16_device_func func, const char *string, UINT64 mask); |
| 212 | 212 | void internal_set_handler(const device_config &devconfig, const char *tag, write16_device_func func, const char *string, UINT64 mask); |
| 213 | 213 | void internal_set_handler(const device_config &devconfig, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT64 mask); |
| 214 | | void internal_set_handler(const device_config &devconfig, const char *tag, read16_proto_delegate func, UINT64 mask); |
| 215 | | void internal_set_handler(const device_config &devconfig, const char *tag, write16_proto_delegate func, UINT64 mask); |
| 216 | | void internal_set_handler(const device_config &devconfig, const char *tag, read16_proto_delegate rfunc, write16_proto_delegate wfunc, UINT64 mask); |
| 214 | void internal_set_handler(const device_config &devconfig, const char *tag, read16_delegate func, UINT64 mask); |
| 215 | void internal_set_handler(const device_config &devconfig, const char *tag, write16_delegate func, UINT64 mask); |
| 216 | void internal_set_handler(const device_config &devconfig, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT64 mask); |
| 217 | 217 | |
| 218 | 218 | // internal handler setters for 32-bit functions |
| 219 | 219 | void internal_set_handler(read32_space_func func, const char *string, UINT64 mask); |
| r11224 | r11225 | |
| 222 | 222 | void internal_set_handler(const device_config &devconfig, const char *tag, read32_device_func func, const char *string, UINT64 mask); |
| 223 | 223 | void internal_set_handler(const device_config &devconfig, const char *tag, write32_device_func func, const char *string, UINT64 mask); |
| 224 | 224 | void internal_set_handler(const device_config &devconfig, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring, UINT64 mask); |
| 225 | | void internal_set_handler(const device_config &devconfig, const char *tag, read32_proto_delegate func, UINT64 mask); |
| 226 | | void internal_set_handler(const device_config &devconfig, const char *tag, write32_proto_delegate func, UINT64 mask); |
| 227 | | void internal_set_handler(const device_config &devconfig, const char *tag, read32_proto_delegate rfunc, write32_proto_delegate wfunc, UINT64 mask); |
| 225 | void internal_set_handler(const device_config &devconfig, const char *tag, read32_delegate func, UINT64 mask); |
| 226 | void internal_set_handler(const device_config &devconfig, const char *tag, write32_delegate func, UINT64 mask); |
| 227 | void internal_set_handler(const device_config &devconfig, const char *tag, read32_delegate rfunc, write32_delegate wfunc, UINT64 mask); |
| 228 | 228 | |
| 229 | 229 | // internal handler setters for 64-bit functions |
| 230 | 230 | void internal_set_handler(read64_space_func func, const char *string, UINT64 mask); |
| r11224 | r11225 | |
| 233 | 233 | void internal_set_handler(const device_config &devconfig, const char *tag, read64_device_func func, const char *string, UINT64 mask); |
| 234 | 234 | void internal_set_handler(const device_config &devconfig, const char *tag, write64_device_func func, const char *string, UINT64 mask); |
| 235 | 235 | void internal_set_handler(const device_config &devconfig, const char *tag, read64_device_func rfunc, const char *rstring, write64_device_func wfunc, const char *wstring, UINT64 mask); |
| 236 | | void internal_set_handler(const device_config &devconfig, const char *tag, read64_proto_delegate func, UINT64 mask); |
| 237 | | void internal_set_handler(const device_config &devconfig, const char *tag, write64_proto_delegate func, UINT64 mask); |
| 238 | | void internal_set_handler(const device_config &devconfig, const char *tag, read64_proto_delegate rfunc, write64_proto_delegate wfunc, UINT64 mask); |
| 236 | void internal_set_handler(const device_config &devconfig, const char *tag, read64_delegate func, UINT64 mask); |
| 237 | void internal_set_handler(const device_config &devconfig, const char *tag, write64_delegate func, UINT64 mask); |
| 238 | void internal_set_handler(const device_config &devconfig, const char *tag, read64_delegate rfunc, write64_delegate wfunc, UINT64 mask); |
| 239 | 239 | |
| 240 | 240 | private: |
| 241 | 241 | // helper functions |
| r11224 | r11225 | |
| 260 | 260 | void set_handler(const device_config &devconfig, const char *tag, read8_device_func func, const char *string) { internal_set_handler(devconfig, tag, func, string, 0); } |
| 261 | 261 | void set_handler(const device_config &devconfig, const char *tag, write8_device_func func, const char *string) { internal_set_handler(devconfig, tag, func, string, 0); } |
| 262 | 262 | void set_handler(const device_config &devconfig, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, 0); } |
| 263 | | void set_handler(const device_config &devconfig, const char *tag, read8_proto_delegate func) { internal_set_handler(devconfig, tag, func, 0); } |
| 264 | | void set_handler(const device_config &devconfig, const char *tag, write8_proto_delegate func) { internal_set_handler(devconfig, tag, func, 0); } |
| 265 | | void set_handler(const device_config &devconfig, const char *tag, read8_proto_delegate rfunc, write8_proto_delegate wfunc) { internal_set_handler(devconfig, tag, rfunc, wfunc, 0); } |
| 263 | void set_handler(const device_config &devconfig, const char *tag, read8_delegate func) { internal_set_handler(devconfig, tag, func, 0); } |
| 264 | void set_handler(const device_config &devconfig, const char *tag, write8_delegate func) { internal_set_handler(devconfig, tag, func, 0); } |
| 265 | void set_handler(const device_config &devconfig, const char *tag, read8_delegate rfunc, write8_delegate wfunc) { internal_set_handler(devconfig, tag, rfunc, wfunc, 0); } |
| 266 | 266 | }; |
| 267 | 267 | |
| 268 | 268 | |
| r11224 | r11225 | |
| 283 | 283 | void set_handler(const device_config &devconfig, const char *tag, read16_device_func func, const char *string) { internal_set_handler(devconfig, tag, func, string, 0); } |
| 284 | 284 | void set_handler(const device_config &devconfig, const char *tag, write16_device_func func, const char *string) { internal_set_handler(devconfig, tag, func, string, 0); } |
| 285 | 285 | void set_handler(const device_config &devconfig, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, 0); } |
| 286 | | void set_handler(const device_config &devconfig, const char *tag, read16_proto_delegate func) { internal_set_handler(devconfig, tag, func, 0); } |
| 287 | | void set_handler(const device_config &devconfig, const char *tag, write16_proto_delegate func) { internal_set_handler(devconfig, tag, func, 0); } |
| 288 | | void set_handler(const device_config &devconfig, const char *tag, read16_proto_delegate rfunc, write16_proto_delegate wfunc) { internal_set_handler(devconfig, tag, rfunc, wfunc, 0); } |
| 286 | void set_handler(const device_config &devconfig, const char *tag, read16_delegate func) { internal_set_handler(devconfig, tag, func, 0); } |
| 287 | void set_handler(const device_config &devconfig, const char *tag, write16_delegate func) { internal_set_handler(devconfig, tag, func, 0); } |
| 288 | void set_handler(const device_config &devconfig, const char *tag, read16_delegate rfunc, write16_delegate wfunc) { internal_set_handler(devconfig, tag, rfunc, wfunc, 0); } |
| 289 | 289 | |
| 290 | 290 | // 8-bit handlers |
| 291 | 291 | void set_handler(read8_space_func func, const char *string, UINT16 mask) { internal_set_handler(func, string, mask); } |
| r11224 | r11225 | |
| 294 | 294 | void set_handler(const device_config &devconfig, const char *tag, read8_device_func func, const char *string, UINT16 mask) { internal_set_handler(devconfig, tag, func, string, mask); } |
| 295 | 295 | void set_handler(const device_config &devconfig, const char *tag, write8_device_func func, const char *string, UINT16 mask) { internal_set_handler(devconfig, tag, func, string, mask); } |
| 296 | 296 | void set_handler(const device_config &devconfig, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT16 mask) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, mask); } |
| 297 | | void set_handler(const device_config &devconfig, const char *tag, read8_proto_delegate func, UINT16 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 298 | | void set_handler(const device_config &devconfig, const char *tag, write8_proto_delegate func, UINT16 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 299 | | void set_handler(const device_config &devconfig, const char *tag, read8_proto_delegate rfunc, write8_proto_delegate wfunc, UINT16 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); } |
| 297 | void set_handler(const device_config &devconfig, const char *tag, read8_delegate func, UINT16 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 298 | void set_handler(const device_config &devconfig, const char *tag, write8_delegate func, UINT16 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 299 | void set_handler(const device_config &devconfig, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT16 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); } |
| 300 | 300 | }; |
| 301 | 301 | |
| 302 | 302 | |
| r11224 | r11225 | |
| 317 | 317 | void set_handler(const device_config &devconfig, const char *tag, read32_device_func func, const char *string) { internal_set_handler(devconfig, tag, func, string, 0); } |
| 318 | 318 | void set_handler(const device_config &devconfig, const char *tag, write32_device_func func, const char *string) { internal_set_handler(devconfig, tag, func, string, 0); } |
| 319 | 319 | void set_handler(const device_config &devconfig, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, 0); } |
| 320 | | void set_handler(const device_config &devconfig, const char *tag, read32_proto_delegate func) { internal_set_handler(devconfig, tag, func, 0); } |
| 321 | | void set_handler(const device_config &devconfig, const char *tag, write32_proto_delegate func) { internal_set_handler(devconfig, tag, func, 0); } |
| 322 | | void set_handler(const device_config &devconfig, const char *tag, read32_proto_delegate rfunc, write32_proto_delegate wfunc) { internal_set_handler(devconfig, tag, rfunc, wfunc, 0); } |
| 320 | void set_handler(const device_config &devconfig, const char *tag, read32_delegate func) { internal_set_handler(devconfig, tag, func, 0); } |
| 321 | void set_handler(const device_config &devconfig, const char *tag, write32_delegate func) { internal_set_handler(devconfig, tag, func, 0); } |
| 322 | void set_handler(const device_config &devconfig, const char *tag, read32_delegate rfunc, write32_delegate wfunc) { internal_set_handler(devconfig, tag, rfunc, wfunc, 0); } |
| 323 | 323 | |
| 324 | 324 | // 16-bit handlers |
| 325 | 325 | void set_handler(read16_space_func func, const char *string, UINT32 mask) { internal_set_handler(func, string, mask); } |
| r11224 | r11225 | |
| 328 | 328 | void set_handler(const device_config &devconfig, const char *tag, read16_device_func func, const char *string, UINT32 mask) { internal_set_handler(devconfig, tag, func, string, mask); } |
| 329 | 329 | void set_handler(const device_config &devconfig, const char *tag, write16_device_func func, const char *string, UINT32 mask) { internal_set_handler(devconfig, tag, func, string, mask); } |
| 330 | 330 | void set_handler(const device_config &devconfig, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT32 mask) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, mask); } |
| 331 | | void set_handler(const device_config &devconfig, const char *tag, read16_proto_delegate func, UINT32 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 332 | | void set_handler(const device_config &devconfig, const char *tag, write16_proto_delegate func, UINT32 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 333 | | void set_handler(const device_config &devconfig, const char *tag, read16_proto_delegate rfunc, write16_proto_delegate wfunc, UINT32 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); } |
| 331 | void set_handler(const device_config &devconfig, const char *tag, read16_delegate func, UINT32 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 332 | void set_handler(const device_config &devconfig, const char *tag, write16_delegate func, UINT32 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 333 | void set_handler(const device_config &devconfig, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT32 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); } |
| 334 | 334 | |
| 335 | 335 | // 8-bit handlers |
| 336 | 336 | void set_handler(read8_space_func func, const char *string, UINT32 mask) { internal_set_handler(func, string, mask); } |
| r11224 | r11225 | |
| 339 | 339 | void set_handler(const device_config &devconfig, const char *tag, read8_device_func func, const char *string, UINT32 mask) { internal_set_handler(devconfig, tag, func, string, mask); } |
| 340 | 340 | void set_handler(const device_config &devconfig, const char *tag, write8_device_func func, const char *string, UINT32 mask) { internal_set_handler(devconfig, tag, func, string, mask); } |
| 341 | 341 | void set_handler(const device_config &devconfig, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT32 mask) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, mask); } |
| 342 | | void set_handler(const device_config &devconfig, const char *tag, read8_proto_delegate func, UINT32 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 343 | | void set_handler(const device_config &devconfig, const char *tag, write8_proto_delegate func, UINT32 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 344 | | void set_handler(const device_config &devconfig, const char *tag, read8_proto_delegate rfunc, write8_proto_delegate wfunc, UINT32 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); } |
| 342 | void set_handler(const device_config &devconfig, const char *tag, read8_delegate func, UINT32 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 343 | void set_handler(const device_config &devconfig, const char *tag, write8_delegate func, UINT32 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 344 | void set_handler(const device_config &devconfig, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT32 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); } |
| 345 | 345 | }; |
| 346 | 346 | |
| 347 | 347 | |
| r11224 | r11225 | |
| 362 | 362 | void set_handler(const device_config &devconfig, const char *tag, read64_device_func func, const char *string) { internal_set_handler(devconfig, tag, func, string, 0); } |
| 363 | 363 | void set_handler(const device_config &devconfig, const char *tag, write64_device_func func, const char *string) { internal_set_handler(devconfig, tag, func, string, 0); } |
| 364 | 364 | void set_handler(const device_config &devconfig, const char *tag, read64_device_func rfunc, const char *rstring, write64_device_func wfunc, const char *wstring) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, 0); } |
| 365 | | void set_handler(const device_config &devconfig, const char *tag, read64_proto_delegate func) { internal_set_handler(devconfig, tag, func, 0); } |
| 366 | | void set_handler(const device_config &devconfig, const char *tag, write64_proto_delegate func) { internal_set_handler(devconfig, tag, func, 0); } |
| 367 | | void set_handler(const device_config &devconfig, const char *tag, read64_proto_delegate rfunc, write64_proto_delegate wfunc) { internal_set_handler(devconfig, tag, rfunc, wfunc, 0); } |
| 365 | void set_handler(const device_config &devconfig, const char *tag, read64_delegate func) { internal_set_handler(devconfig, tag, func, 0); } |
| 366 | void set_handler(const device_config &devconfig, const char *tag, write64_delegate func) { internal_set_handler(devconfig, tag, func, 0); } |
| 367 | void set_handler(const device_config &devconfig, const char *tag, read64_delegate rfunc, write64_delegate wfunc) { internal_set_handler(devconfig, tag, rfunc, wfunc, 0); } |
| 368 | 368 | |
| 369 | 369 | // 32-bit handlers |
| 370 | 370 | void set_handler(read32_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); } |
| r11224 | r11225 | |
| 373 | 373 | void set_handler(const device_config &devconfig, const char *tag, read32_device_func func, const char *string, UINT64 mask) { internal_set_handler(devconfig, tag, func, string, mask); } |
| 374 | 374 | void set_handler(const device_config &devconfig, const char *tag, write32_device_func func, const char *string, UINT64 mask) { internal_set_handler(devconfig, tag, func, string, mask); } |
| 375 | 375 | void set_handler(const device_config &devconfig, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, mask); } |
| 376 | | void set_handler(const device_config &devconfig, const char *tag, read32_proto_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 377 | | void set_handler(const device_config &devconfig, const char *tag, write32_proto_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 378 | | void set_handler(const device_config &devconfig, const char *tag, read32_proto_delegate rfunc, write32_proto_delegate wfunc, UINT64 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); } |
| 376 | void set_handler(const device_config &devconfig, const char *tag, read32_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 377 | void set_handler(const device_config &devconfig, const char *tag, write32_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 378 | void set_handler(const device_config &devconfig, const char *tag, read32_delegate rfunc, write32_delegate wfunc, UINT64 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); } |
| 379 | 379 | |
| 380 | 380 | // 16-bit handlers |
| 381 | 381 | void set_handler(read16_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); } |
| r11224 | r11225 | |
| 384 | 384 | void set_handler(const device_config &devconfig, const char *tag, read16_device_func func, const char *string, UINT64 mask) { internal_set_handler(devconfig, tag, func, string, mask); } |
| 385 | 385 | void set_handler(const device_config &devconfig, const char *tag, write16_device_func func, const char *string, UINT64 mask) { internal_set_handler(devconfig, tag, func, string, mask); } |
| 386 | 386 | void set_handler(const device_config &devconfig, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, mask); } |
| 387 | | void set_handler(const device_config &devconfig, const char *tag, read16_proto_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 388 | | void set_handler(const device_config &devconfig, const char *tag, write16_proto_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 389 | | void set_handler(const device_config &devconfig, const char *tag, read16_proto_delegate rfunc, write16_proto_delegate wfunc, UINT64 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); } |
| 387 | void set_handler(const device_config &devconfig, const char *tag, read16_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 388 | void set_handler(const device_config &devconfig, const char *tag, write16_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 389 | void set_handler(const device_config &devconfig, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT64 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); } |
| 390 | 390 | |
| 391 | 391 | // 8-bit handlers |
| 392 | 392 | void set_handler(read8_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); } |
| r11224 | r11225 | |
| 395 | 395 | void set_handler(const device_config &devconfig, const char *tag, read8_device_func func, const char *string, UINT64 mask) { internal_set_handler(devconfig, tag, func, string, mask); } |
| 396 | 396 | void set_handler(const device_config &devconfig, const char *tag, write8_device_func func, const char *string, UINT64 mask) { internal_set_handler(devconfig, tag, func, string, mask); } |
| 397 | 397 | void set_handler(const device_config &devconfig, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, mask); } |
| 398 | | void set_handler(const device_config &devconfig, const char *tag, read8_proto_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 399 | | void set_handler(const device_config &devconfig, const char *tag, write8_proto_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 400 | | void set_handler(const device_config &devconfig, const char *tag, read8_proto_delegate rfunc, write8_proto_delegate wfunc, UINT64 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); } |
| 398 | void set_handler(const device_config &devconfig, const char *tag, read8_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 399 | void set_handler(const device_config &devconfig, const char *tag, write8_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); } |
| 400 | void set_handler(const device_config &devconfig, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT64 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); } |
| 401 | 401 | }; |
| 402 | 402 | |
| 403 | 403 | |
| r11224 | r11225 | |
| 461 | 461 | #define ADDRESS_MAP_START(_name, _space, _bits) \ |
| 462 | 462 | void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig) \ |
| 463 | 463 | { \ |
| 464 | | typedef read##_bits##_proto_delegate read_proto_delegate; \ |
| 465 | | typedef write##_bits##_proto_delegate write_proto_delegate; \ |
| 464 | typedef read##_bits##_delegate read_delegate; \ |
| 465 | typedef write##_bits##_delegate write_delegate; \ |
| 466 | 466 | address_map_entry##_bits *curentry = NULL; \ |
| 467 | 467 | (void)curentry; \ |
| 468 | 468 | map.configure(_space, _bits); \ |
| r11224 | r11225 | |
| 588 | 588 | |
| 589 | 589 | // device reads |
| 590 | 590 | #define AM_DEVREAD_MODERN(_tag, _class, _handler) \ |
| 591 | | curentry->set_handler(devconfig, _tag, read_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler)); \ |
| 591 | curentry->set_handler(devconfig, _tag, read_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0)); \ |
| 592 | 592 | |
| 593 | 593 | #define AM_DEVREAD8_MODERN(_tag, _class, _handler, _unitmask) \ |
| 594 | | curentry->set_handler(devconfig, _tag, read8_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \ |
| 594 | curentry->set_handler(devconfig, _tag, read8_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \ |
| 595 | 595 | |
| 596 | 596 | #define AM_DEVREAD16_MODERN(_tag, _class, _handler, _unitmask) \ |
| 597 | | curentry->set_handler(devconfig, _tag, read16_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \ |
| 597 | curentry->set_handler(devconfig, _tag, read16_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \ |
| 598 | 598 | |
| 599 | 599 | #define AM_DEVREAD32_MODERN(_tag, _class, _handler, _unitmask) \ |
| 600 | | curentry->set_handler(devconfig, _tag, read32_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \ |
| 600 | curentry->set_handler(devconfig, _tag, read32_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \ |
| 601 | 601 | |
| 602 | 602 | |
| 603 | 603 | // device writes |
| 604 | 604 | #define AM_DEVWRITE_MODERN(_tag, _class, _handler) \ |
| 605 | | curentry->set_handler(devconfig, _tag, write_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler)); \ |
| 605 | curentry->set_handler(devconfig, _tag, write_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0)); \ |
| 606 | 606 | |
| 607 | 607 | #define AM_DEVWRITE8_MODERN(_tag, _class, _handler, _unitmask) \ |
| 608 | | curentry->set_handler(devconfig, _tag, write8_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \ |
| 608 | curentry->set_handler(devconfig, _tag, write8_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \ |
| 609 | 609 | |
| 610 | 610 | #define AM_DEVWRITE16_MODERN(_tag, _class, _handler, _unitmask) \ |
| 611 | | curentry->set_handler(devconfig, _tag, write16_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \ |
| 611 | curentry->set_handler(devconfig, _tag, write16_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \ |
| 612 | 612 | |
| 613 | 613 | #define AM_DEVWRITE32_MODERN(_tag, _class, _handler, _unitmask) \ |
| 614 | | curentry->set_handler(devconfig, _tag, write32_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \ |
| 614 | curentry->set_handler(devconfig, _tag, write32_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \ |
| 615 | 615 | |
| 616 | 616 | |
| 617 | 617 | // device reads/writes |
| 618 | 618 | #define AM_DEVREADWRITE_MODERN(_tag, _class, _rhandler, _whandler) \ |
| 619 | | curentry->set_handler(devconfig, _tag, read_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler)); \ |
| 619 | curentry->set_handler(devconfig, _tag, read_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0)); \ |
| 620 | 620 | |
| 621 | 621 | #define AM_DEVREADWRITE8_MODERN(_tag, _class, _rhandler, _whandler, _unitmask) \ |
| 622 | | curentry->set_handler(devconfig, _tag, read8_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write8_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler), _unitmask); \ |
| 622 | curentry->set_handler(devconfig, _tag, read8_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write8_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \ |
| 623 | 623 | |
| 624 | 624 | #define AM_DEVREADWRITE16_MODERN(_tag, _class, _rhandler, _whandler, _unitmask) \ |
| 625 | | curentry->set_handler(devconfig, _tag, read16_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write16_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler), _unitmask); \ |
| 625 | curentry->set_handler(devconfig, _tag, read16_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write16_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \ |
| 626 | 626 | |
| 627 | 627 | #define AM_DEVREADWRITE32_MODERN(_tag, _class, _rhandler, _whandler, _unitmask) \ |
| 628 | | curentry->set_handler(devconfig, _tag, read32_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write32_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler), _unitmask); \ |
| 628 | curentry->set_handler(devconfig, _tag, read32_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write32_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \ |
| 629 | 629 | |
| 630 | 630 | |
| 631 | 631 | // special-case accesses |
| r11224 | r11225 | |
| 730 | 730 | #define ADDRESS_MAP_START(_name, _space, _bits, _class) \ |
| 731 | 731 | void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig) \ |
| 732 | 732 | { \ |
| 733 | | typedef read##_bits##_proto_delegate read_proto_delegate; \ |
| 734 | | typedef write##_bits##_proto_delegate write_proto_delegate; \ |
| 733 | typedef read##_bits##_delegate read_delegate; \ |
| 734 | typedef write##_bits##_delegate write_delegate; \ |
| 735 | 735 | address_map_entry##_bits *curentry = NULL; \ |
| 736 | 736 | (void)curentry; \ |
| 737 | 737 | map.configure(_space, _bits); \ |
| r11224 | r11225 | |
| 858 | 858 | |
| 859 | 859 | // driver data base reads |
| 860 | 860 | #define AM_READ_BASE(_class, _handler) \ |
| 861 | | curentry->set_handler(devconfig, NULL, read_proto_delegate::_create_member<_class, &_class::_handler>("driver_data::" #_handler)); \ |
| 861 | curentry->set_handler(devconfig, NULL, read_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0)); \ |
| 862 | 862 | |
| 863 | 863 | #define AM_READ8_BASE(_class, _handler, _unitmask) \ |
| 864 | | curentry->set_handler(devconfig, NULL, read8_proto_delegate::_create_member<_class, &_class::_handler>("driver_data::" #_handler), _unitmask); \ |
| 864 | curentry->set_handler(devconfig, NULL, read8_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \ |
| 865 | 865 | |
| 866 | 866 | #define AM_READ16_BASE(_class, _handler, _unitmask) \ |
| 867 | | curentry->set_handler(devconfig, NULL, read16_proto_delegate::_create_member<_class, &_class::_handler>("driver_data::" #_handler), _unitmask); \ |
| 867 | curentry->set_handler(devconfig, NULL, read16_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \ |
| 868 | 868 | |
| 869 | 869 | #define AM_READ32_BASE(_class, _handler, _unitmask) \ |
| 870 | | curentry->set_handler(devconfig, NULL, read32_proto_delegate::_create_member<_class, &_class::_handler>("driver_data::" #_handler), _unitmask); \ |
| 870 | curentry->set_handler(devconfig, NULL, read32_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \ |
| 871 | 871 | |
| 872 | 872 | |
| 873 | 873 | // driver data base writes |
| 874 | 874 | #define AM_WRITE_BASE(_class, _handler) \ |
| 875 | | curentry->set_handler(devconfig, NULL, write_proto_delegate::_create_member<_class, &_class::_handler>("driver_data::" #_handler)); \ |
| 875 | curentry->set_handler(devconfig, NULL, write_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0)); \ |
| 876 | 876 | |
| 877 | 877 | #define AM_WRITE8_BASE(_class, _handler, _unitmask) \ |
| 878 | | curentry->set_handler(devconfig, NULL, write8_proto_delegate::_create_member<_class, &_class::_handler>("driver_data::" #_handler), _unitmask); \ |
| 878 | curentry->set_handler(devconfig, NULL, write8_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \ |
| 879 | 879 | |
| 880 | 880 | #define AM_WRITE16_BASE(_class, _handler, _unitmask) \ |
| 881 | | curentry->set_handler(devconfig, NULL, write16_proto_delegate::_create_member<_class, &_class::_handler>("driver_data::" #_handler), _unitmask); \ |
| 881 | curentry->set_handler(devconfig, NULL, write16_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \ |
| 882 | 882 | |
| 883 | 883 | #define AM_WRITE32_BASE(_class, _handler, _unitmask) \ |
| 884 | | curentry->set_handler(devconfig, NULL, write32_proto_delegate::_create_member<_class, &_class::_handler>("driver_data::" #_handler), _unitmask); \ |
| 884 | curentry->set_handler(devconfig, NULL, write32_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \ |
| 885 | 885 | |
| 886 | 886 | |
| 887 | 887 | // driver data base reads/writes |
| 888 | 888 | #define AM_READWRITE_BASE(_class, _rhandler, _whandler) \ |
| 889 | | curentry->set_handler(devconfig, NULL, read_proto_delegate::_create_member<_class, &_class::_rhandler>("driver_data::" #_rhandler), write_proto_delegate::_create_member<_class, &_class::_whandler>("driver_data::" #_whandler)); \ |
| 889 | curentry->set_handler(devconfig, NULL, read_delegate(&_class::_rhandler, "driver_data::" #_rhandler, (_class *)0), write_delegate(&_class::_whandler, "driver_data::" #_whandler, (_class *)0)); \ |
| 890 | 890 | |
| 891 | 891 | #define AM_READWRITE8_BASE(_class, _rhandler, _whandler, _unitmask) \ |
| 892 | | curentry->set_handler(devconfig, NULL, read8_proto_delegate::_create_member<_class, &_class::_rhandler>("driver_data::" #_rhandler), write8_proto_delegate::_create_member<_class, &_class::_whandler>("driver_data::" #_whandler), _unitmask); \ |
| 892 | curentry->set_handler(devconfig, NULL, read8_delegate(&_class::_rhandler, "driver_data::" #_rhandler, (_class *)0), write8_delegate(&_class::_whandler, "driver_data::" #_whandler, (_class *)0), _unitmask); \ |
| 893 | 893 | |
| 894 | 894 | #define AM_READWRITE16_BASE(_class, _rhandler, _whandler, _unitmask) \ |
| 895 | | curentry->set_handler(devconfig, NULL, read16_proto_delegate::_create_member<_class, &_class::_rhandler>("driver_data::" #_rhandler), write16_proto_delegate::_create_member<_class, &_class::_whandler>("driver_data::" #_whandler), _unitmask); \ |
| 895 | curentry->set_handler(devconfig, NULL, read16_delegate(&_class::_rhandler, "driver_data::" #_rhandler, (_class *)0), write16_delegate(&_class::_whandler, "driver_data::" #_whandler, (_class *)0), _unitmask); \ |
| 896 | 896 | |
| 897 | 897 | #define AM_READWRITE32_BASE(_class, _rhandler, _whandler, _unitmask) \ |
| 898 | | curentry->set_handler(devconfig, NULL, read32_proto_delegate::_create_member<_class, &_class::_rhandler>("driver_data::" #_rhandler), write32_proto_delegate::_create_member<_class, &_class::_whandler>("driver_data::" #_whandler), _unitmask); \ |
| 898 | curentry->set_handler(devconfig, NULL, read32_delegate(&_class::_rhandler, "driver_data::" #_rhandler, (_class *)0), write32_delegate(&_class::_whandler, "driver_data::" #_whandler, (_class *)0), _unitmask); \ |
| 899 | 899 | |
| 900 | 900 | |
| 901 | 901 | // driver data reads |
| 902 | 902 | #define AM_READ(_handler) \ |
| 903 | | curentry->set_handler(devconfig, NULL, read_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler)); \ |
| 903 | curentry->set_handler(devconfig, NULL, read_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0)); \ |
| 904 | 904 | |
| 905 | 905 | #define AM_READ8(_handler, _unitmask) \ |
| 906 | | curentry->set_handler(devconfig, NULL, read8_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler), _unitmask); \ |
| 906 | curentry->set_handler(devconfig, NULL, read8_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \ |
| 907 | 907 | |
| 908 | 908 | #define AM_READ16(_handler, _unitmask) \ |
| 909 | | curentry->set_handler(devconfig, NULL, read16_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler), _unitmask); \ |
| 909 | curentry->set_handler(devconfig, NULL, read16_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \ |
| 910 | 910 | |
| 911 | 911 | #define AM_READ32(_handler, _unitmask) \ |
| 912 | | curentry->set_handler(devconfig, NULL, read32_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler), _unitmask); \ |
| 912 | curentry->set_handler(devconfig, NULL, read32_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \ |
| 913 | 913 | |
| 914 | 914 | |
| 915 | 915 | // driver data writes |
| 916 | 916 | #define AM_WRITE(_handler) \ |
| 917 | | curentry->set_handler(devconfig, NULL, write_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler)); \ |
| 917 | curentry->set_handler(devconfig, NULL, write_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0)); \ |
| 918 | 918 | |
| 919 | 919 | #define AM_WRITE8(_handler, _unitmask) \ |
| 920 | | curentry->set_handler(devconfig, NULL, write8_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler), _unitmask); \ |
| 920 | curentry->set_handler(devconfig, NULL, write8_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \ |
| 921 | 921 | |
| 922 | 922 | #define AM_WRITE16(_handler, _unitmask) \ |
| 923 | | curentry->set_handler(devconfig, NULL, write16_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler), _unitmask); \ |
| 923 | curentry->set_handler(devconfig, NULL, write16_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \ |
| 924 | 924 | |
| 925 | 925 | #define AM_WRITE32(_handler, _unitmask) \ |
| 926 | | curentry->set_handler(devconfig, NULL, write32_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler), _unitmask); \ |
| 926 | curentry->set_handler(devconfig, NULL, write32_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \ |
| 927 | 927 | |
| 928 | 928 | |
| 929 | 929 | // driver data reads/writes |
| 930 | 930 | #define AM_READWRITE(_rhandler, _whandler) \ |
| 931 | | curentry->set_handler(devconfig, NULL, read_proto_delegate::_create_member<drivdata_class, &drivdata_class::_rhandler>("driver_data::" #_rhandler), write_proto_delegate::_create_member<drivdata_class, &drivdata_class::_whandler>("driver_data::" #_whandler)); \ |
| 931 | curentry->set_handler(devconfig, NULL, read_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, (drivdata_class *)0), write_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, (drivdata_class *)0)); \ |
| 932 | 932 | |
| 933 | 933 | #define AM_READWRITE8(_rhandler, _whandler, _unitmask) \ |
| 934 | | curentry->set_handler(devconfig, NULL, read8_proto_delegate::_create_member<drivdata_class, &drivdata_class::_rhandler>("driver_data::" #_rhandler), write8_proto_delegate::_create_member<drivdata_class, &drivdata_class::_whandler>("driver_data::" #_whandler), _unitmask); \ |
| 934 | curentry->set_handler(devconfig, NULL, read8_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, (drivdata_class *)0), write8_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, (drivdata_class *)0), _unitmask); \ |
| 935 | 935 | |
| 936 | 936 | #define AM_READWRITE16(_rhandler, _whandler, _unitmask) \ |
| 937 | | curentry->set_handler(devconfig, NULL, read16_proto_delegate::_create_member<drivdata_class, &drivdata_class::_rhandler>("driver_data::" #_rhandler), write16_proto_delegate::_create_member<drivdata_class, &drivdata_class::_whandler>("driver_data::" #_whandler), _unitmask); \ |
| 937 | curentry->set_handler(devconfig, NULL, read16_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, (drivdata_class *)0), write16_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, (drivdata_class *)0), _unitmask); \ |
| 938 | 938 | |
| 939 | 939 | #define AM_READWRITE32(_rhandler, _whandler, _unitmask) \ |
| 940 | | curentry->set_handler(devconfig, NULL, read32_proto_delegate::_create_member<drivdata_class, &drivdata_class::_rhandler>("driver_data::" #_rhandler), write32_proto_delegate::_create_member<drivdata_class, &drivdata_class::_whandler>("driver_data::" #_whandler), _unitmask); \ |
| 940 | curentry->set_handler(devconfig, NULL, read32_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, (drivdata_class *)0), write32_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, (drivdata_class *)0), _unitmask); \ |
| 941 | 941 | |
| 942 | 942 | |
| 943 | 943 | // device reads |
| 944 | 944 | #define AM_DEVREAD(_tag, _class, _handler) \ |
| 945 | | curentry->set_handler(devconfig, _tag, read_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler)); \ |
| 945 | curentry->set_handler(devconfig, _tag, read_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0)); \ |
| 946 | 946 | |
| 947 | 947 | #define AM_DEVREAD8(_tag, _class, _handler, _unitmask) \ |
| 948 | | curentry->set_handler(devconfig, _tag, read8_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \ |
| 948 | curentry->set_handler(devconfig, _tag, read8_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \ |
| 949 | 949 | |
| 950 | 950 | #define AM_DEVREAD16(_tag, _class, _handler, _unitmask) \ |
| 951 | | curentry->set_handler(devconfig, _tag, read16_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \ |
| 951 | curentry->set_handler(devconfig, _tag, read16_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \ |
| 952 | 952 | |
| 953 | 953 | #define AM_DEVREAD32(_tag, _class, _handler, _unitmask) \ |
| 954 | | curentry->set_handler(devconfig, _tag, read32_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \ |
| 954 | curentry->set_handler(devconfig, _tag, read32_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \ |
| 955 | 955 | |
| 956 | 956 | |
| 957 | 957 | // device writes |
| 958 | 958 | #define AM_DEVWRITE(_tag, _class, _handler) \ |
| 959 | | curentry->set_handler(devconfig, _tag, write_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler)); \ |
| 959 | curentry->set_handler(devconfig, _tag, write_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0)); \ |
| 960 | 960 | |
| 961 | 961 | #define AM_DEVWRITE8(_tag, _class, _handler, _unitmask) \ |
| 962 | | curentry->set_handler(devconfig, _tag, write8_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \ |
| 962 | curentry->set_handler(devconfig, _tag, write8_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \ |
| 963 | 963 | |
| 964 | 964 | #define AM_DEVWRITE16(_tag, _class, _handler, _unitmask) \ |
| 965 | | curentry->set_handler(devconfig, _tag, write16_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \ |
| 965 | curentry->set_handler(devconfig, _tag, write16_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \ |
| 966 | 966 | |
| 967 | 967 | #define AM_DEVWRITE32(_tag, _class, _handler, _unitmask) \ |
| 968 | | curentry->set_handler(devconfig, _tag, write32_proto_delegate::_create_member<_class, &_class::_handler>(#_class "::" #_handler), _unitmask); \ |
| 968 | curentry->set_handler(devconfig, _tag, write32_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \ |
| 969 | 969 | |
| 970 | 970 | |
| 971 | 971 | // device reads/writes |
| 972 | 972 | #define AM_DEVREADWRITE(_tag, _class, _rhandler, _whandler) \ |
| 973 | | curentry->set_handler(devconfig, _tag, read_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler)); \ |
| 973 | curentry->set_handler(devconfig, _tag, read_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0)); \ |
| 974 | 974 | |
| 975 | 975 | #define AM_DEVREADWRITE8(_tag, _class, _rhandler, _whandler, _unitmask) \ |
| 976 | | curentry->set_handler(devconfig, _tag, read8_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write8_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler), _unitmask); \ |
| 976 | curentry->set_handler(devconfig, _tag, read8_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write8_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \ |
| 977 | 977 | |
| 978 | 978 | #define AM_DEVREADWRITE16(_tag, _class, _rhandler, _whandler, _unitmask) \ |
| 979 | | curentry->set_handler(devconfig, _tag, read16_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write16_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler), _unitmask); \ |
| 979 | curentry->set_handler(devconfig, _tag, read16_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write16_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \ |
| 980 | 980 | |
| 981 | 981 | #define AM_DEVREADWRITE32(_tag, _class, _rhandler, _whandler, _unitmask) \ |
| 982 | | curentry->set_handler(devconfig, _tag, read32_proto_delegate::_create_member<_class, &_class::_rhandler>(#_class "::" #_rhandler), write32_proto_delegate::_create_member<_class, &_class::_whandler>(#_class "::" #_whandler), _unitmask); \ |
| 982 | curentry->set_handler(devconfig, _tag, read32_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write32_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \ |
| 983 | 983 | |
| 984 | 984 | |
| 985 | 985 | // special-case accesses |
src/emu/delegate.h
| r11224 | r11225 | |
| 123 | 123 | #define USE_DELEGATE_TYPE DELEGATE_TYPE_COMPATIBLE |
| 124 | 124 | #endif |
| 125 | 125 | |
| 126 | | // nicer macros to hide the template gobblety-gook and to pass the names |
| 127 | | #define create_member_name(_class, _member, _name) _create_member<_class, &_class::_member>(_name) |
| 128 | | #define create_member(_class, _member) _create_member<_class, &_class::_member>(#_class "::" #_member) |
| 129 | | #define create_static(_class, _func) _crate_static<_class, &_func>(#_func) |
| 130 | 126 | |
| 131 | 127 | |
| 132 | | |
| 133 | 128 | //************************************************************************** |
| 134 | 129 | // HELPER CLASSES |
| 135 | 130 | //************************************************************************** |
| r11224 | r11225 | |
| 169 | 164 | typedef delegate_generic_class *(*deferred_cast_func)(bindable_object &object); |
| 170 | 165 | |
| 171 | 166 | |
| 172 | | // ======================> delegate_base |
| 167 | // ======================> delegate_traits |
| 173 | 168 | |
| 174 | | // simple base class for all delegates to derive from; it is explicitly |
| 175 | | // polymorphic so that a delegate_base * can be used as a lowest-common |
| 176 | | // denominator, and then downcast to the appropriate type with proper |
| 177 | | // type checking |
| 178 | | class delegate_base |
| 169 | // delegate_traits is a meta-template that is used to provide a static function pointer |
| 170 | // and member function pointer of the appropriate type and number of parameters; we use |
| 171 | // partial template specialization to support fewer parameters by defaulting the later |
| 172 | // parameters to the special type delegate_param_none |
| 173 | template<typename _ClassType, typename _ReturnType, typename _P1Type, typename _P2Type, typename _P3Type, typename _P4Type> |
| 174 | struct delegate_traits |
| 179 | 175 | { |
| 180 | | public: |
| 181 | | delegate_base(deferred_cast_func caster, const char *name) |
| 182 | | : m_caster(caster), |
| 183 | | m_name(name) { } |
| 184 | | |
| 185 | | virtual ~delegate_base() { } |
| 186 | | |
| 187 | | // getters |
| 188 | | bool isnull() const { return (m_caster == NULL); } |
| 189 | | bool valid_target(bindable_object &object) const { return ((*m_caster)(object) != NULL); } |
| 190 | | const char *name() const { return m_name; } |
| 191 | | |
| 192 | | protected: |
| 193 | | deferred_cast_func m_caster; // pointer to helper function that does the cast |
| 194 | | const char * m_name; // name string |
| 176 | typedef _ReturnType (*static_func_type)(_ClassType *, _P1Type, _P2Type, _P3Type, _P4Type); |
| 177 | typedef _ReturnType (*static_ref_func_type)(_ClassType &, _P1Type, _P2Type, _P3Type, _P4Type); |
| 178 | typedef _ReturnType (_ClassType::*member_func_type)(_P1Type, _P2Type, _P3Type, _P4Type); |
| 195 | 179 | }; |
| 196 | 180 | |
| 181 | // dummy class used to indicate a non-existant parameter |
| 182 | class delegate_param_none { }; |
| 197 | 183 | |
| 198 | | |
| 199 | | //************************************************************************** |
| 200 | | // COMPATIBLE DELEGATES |
| 201 | | //************************************************************************** |
| 202 | | |
| 203 | | #if (USE_DELEGATE_TYPE == DELEGATE_TYPE_COMPATIBLE) |
| 204 | | |
| 205 | | // ======================> proto_delegate_0param |
| 206 | | |
| 207 | | template<typename _ReturnType> |
| 208 | | class proto_delegate_0param : public delegate_base |
| 184 | // specialization for 3 parameters |
| 185 | template<typename _ClassType, typename _ReturnType, typename _P1Type, typename _P2Type, typename _P3Type> |
| 186 | struct delegate_traits<_ClassType, _ReturnType, _P1Type, _P2Type, _P3Type, delegate_param_none> |
| 209 | 187 | { |
| 210 | | protected: |
| 211 | | // pointer to a static version of the function which takes the object as a first parameter |
| 212 | | typedef _ReturnType (*static_func)(delegate_generic_class *); |
| 213 | | |
| 214 | | public: |
| 215 | | // constructors |
| 216 | | proto_delegate_0param(static_func function = NULL, deferred_cast_func caster = NULL, const char *name = NULL) |
| 217 | | : delegate_base(caster, name), |
| 218 | | m_function(function) { } |
| 219 | | |
| 220 | | proto_delegate_0param(const proto_delegate_0param &proto) |
| 221 | | : delegate_base(proto.m_caster, proto.m_name), |
| 222 | | m_function(proto.m_function) { } |
| 223 | | |
| 224 | | // create a member function proto-delegate |
| 225 | | template<class _FunctionClass, _ReturnType (_FunctionClass::*_FunctionPtr)()> |
| 226 | | static proto_delegate_0param _create_member(const char *name = NULL) |
| 227 | | { |
| 228 | | return proto_delegate_0param(&method_stub<_FunctionClass, _FunctionPtr>, &deferred_cast<_FunctionClass>, name); |
| 229 | | } |
| 230 | | |
| 231 | | // create a static function proto-delegate |
| 232 | | template<class _FunctionClass, _ReturnType (*_FunctionPtr)(_FunctionClass *)> |
| 233 | | static proto_delegate_0param _create_static(const char *name = NULL) |
| 234 | | { |
| 235 | | return proto_delegate_0param(reinterpret_cast<static_func>(_FunctionPtr), &deferred_cast<_FunctionClass>, name); |
| 236 | | } |
| 237 | | |
| 238 | | // equality testing |
| 239 | | bool operator==(const proto_delegate_0param &rhs) const |
| 240 | | { |
| 241 | | return (m_function == rhs.m_function && m_caster == rhs.m_caster); |
| 242 | | } |
| 243 | | |
| 244 | | protected: |
| 245 | | // helper stub that calls the member function |
| 246 | | template<class _FunctionClass, _ReturnType (_FunctionClass::*_FunctionPtr)()> |
| 247 | | static _ReturnType method_stub(delegate_generic_class *object_ptr) |
| 248 | | { |
| 249 | | _FunctionClass *p = reinterpret_cast<_FunctionClass *>(object_ptr); |
| 250 | | return (p->*_FunctionPtr)(); |
| 251 | | } |
| 252 | | |
| 253 | | // internal state |
| 254 | | static_func m_function; // pointer to the stub or static function |
| 188 | typedef _ReturnType (*static_func_type)(_ClassType *, _P1Type, _P2Type, _P3Type); |
| 189 | typedef _ReturnType (*static_ref_func_type)(_ClassType &, _P1Type, _P2Type, _P3Type); |
| 190 | typedef _ReturnType (_ClassType::*member_func_type)(_P1Type, _P2Type, _P3Type); |
| 255 | 191 | }; |
| 256 | 192 | |
| 257 | | |
| 258 | | // ======================> delegate_0param |
| 259 | | |
| 260 | | template<typename _ReturnType> |
| 261 | | class delegate_0param : public proto_delegate_0param<_ReturnType> |
| 193 | // specialization for 2 parameters |
| 194 | template<typename _ClassType, typename _ReturnType, typename _P1Type, typename _P2Type> |
| 195 | struct delegate_traits<_ClassType, _ReturnType, _P1Type, _P2Type, delegate_param_none, delegate_param_none> |
| 262 | 196 | { |
| 263 | | typedef proto_delegate_0param<_ReturnType> proto_base; |
| 264 | | |
| 265 | | using delegate_base::m_caster; |
| 266 | | using proto_base::m_function; |
| 267 | | |
| 268 | | public: |
| 269 | | // constructors |
| 270 | | delegate_0param() |
| 271 | | : m_object(NULL) { } |
| 272 | | |
| 273 | | delegate_0param(proto_base proto) |
| 274 | | : proto_delegate_0param<_ReturnType>(proto), |
| 275 | | m_object(NULL) { } |
| 276 | | |
| 277 | | delegate_0param(proto_base proto, bindable_object &object) |
| 278 | | : proto_delegate_0param<_ReturnType>(proto), |
| 279 | | m_object((*m_caster)(object)) { } |
| 280 | | |
| 281 | | // bind the actual object |
| 282 | | void bind(bindable_object &object) { m_object = (*m_caster)(object); } |
| 283 | | |
| 284 | | // call the function |
| 285 | | _ReturnType operator()() const { return (*m_function)(m_object); } |
| 286 | | |
| 287 | | // testing |
| 288 | | bool has_object() const { return (m_object != NULL); } |
| 289 | | bool operator==(const delegate_0param &rhs) const { return (m_object == rhs.m_object && proto_base::operator==(rhs)); } |
| 290 | | |
| 291 | | protected: |
| 292 | | // internal state |
| 293 | | delegate_generic_class *m_object; // pointer to the post-cast object |
| 197 | typedef _ReturnType (*static_func_type)(_ClassType *, _P1Type, _P2Type); |
| 198 | typedef _ReturnType (*static_ref_func_type)(_ClassType &, _P1Type, _P2Type); |
| 199 | typedef _ReturnType (_ClassType::*member_func_type)(_P1Type, _P2Type); |
| 294 | 200 | }; |
| 295 | 201 | |
| 296 | | |
| 297 | | // ======================> proto_delegate_1param |
| 298 | | |
| 299 | | template<typename _ReturnType, typename _P1Type> |
| 300 | | class proto_delegate_1param : public delegate_base |
| 202 | // specialization for 1 parameter |
| 203 | template<typename _ClassType, typename _ReturnType, typename _P1Type> |
| 204 | struct delegate_traits<_ClassType, _ReturnType, _P1Type, delegate_param_none, delegate_param_none, delegate_param_none> |
| 301 | 205 | { |
| 302 | | protected: |
| 303 | | // pointer to a static version of the function which takes the object as a first parameter |
| 304 | | typedef _ReturnType (*static_func)(delegate_generic_class *, _P1Type); |
| 305 | | |
| 306 | | public: |
| 307 | | // constructors |
| 308 | | proto_delegate_1param(static_func function = NULL, deferred_cast_func caster = NULL, const char *name = NULL) |
| 309 | | : delegate_base(caster, name), |
| 310 | | m_function(function) { } |
| 311 | | |
| 312 | | proto_delegate_1param(const proto_delegate_1param &proto) |
| 313 | | : delegate_base(proto.m_caster, proto.m_name), |
| 314 | | m_function(proto.m_function) { } |
| 315 | | |
| 316 | | // create a member function proto-delegate |
| 317 | | template<class _FunctionClass, _ReturnType (_FunctionClass::*_FunctionPtr)(_P1Type)> |
| 318 | | static proto_delegate_1param _create_member(const char *name = NULL) |
| 319 | | { |
| 320 | | return proto_delegate_1param(&method_stub<_FunctionClass, _FunctionPtr>, &deferred_cast<_FunctionClass>, name); |
| 321 | | } |
| 322 | | |
| 323 | | // create a static function proto-delegate |
| 324 | | template<class _FunctionClass, _ReturnType (*_FunctionPtr)(_FunctionClass *, _P1Type)> |
| 325 | | static proto_delegate_1param _create_static(const char *name = NULL) |
| 326 | | { |
| 327 | | return proto_delegate_1param(reinterpret_cast<static_func>(_FunctionPtr), &deferred_cast<_FunctionClass>, name); |
| 328 | | } |
| 329 | | |
| 330 | | // equality testing |
| 331 | | bool operator==(const proto_delegate_1param &rhs) const |
| 332 | | { |
| 333 | | return (m_function == rhs.m_function && m_caster == rhs.m_caster); |
| 334 | | } |
| 335 | | |
| 336 | | protected: |
| 337 | | // helper stub that calls the member function |
| 338 | | template<class _FunctionClass, _ReturnType (_FunctionClass::*_FunctionPtr)(_P1Type)> |
| 339 | | static _ReturnType method_stub(delegate_generic_class *object_ptr, _P1Type p1) |
| 340 | | { |
| 341 | | _FunctionClass *p = reinterpret_cast<_FunctionClass *>(object_ptr); |
| 342 | | return (p->*_FunctionPtr)(p1); |
| 343 | | } |
| 344 | | |
| 345 | | // internal state |
| 346 | | static_func m_function; // pointer to the stub or static function |
| 206 | typedef _ReturnType (*static_func_type)(_ClassType *, _P1Type); |
| 207 | typedef _ReturnType (*static_ref_func_type)(_ClassType &, _P1Type); |
| 208 | typedef _ReturnType (_ClassType::*member_func_type)(_P1Type); |
| 347 | 209 | }; |
| 348 | 210 | |
| 349 | | |
| 350 | | // ======================> delegate_1param |
| 351 | | |
| 352 | | template<typename _ReturnType, typename _P1Type> |
| 353 | | class delegate_1param : public proto_delegate_1param<_ReturnType, _P1Type> |
| 211 | // specialization for no parameters |
| 212 | template<typename _ClassType, typename _ReturnType> |
| 213 | struct delegate_traits<_ClassType, _ReturnType, delegate_param_none, delegate_param_none, delegate_param_none, delegate_param_none> |
| 354 | 214 | { |
| 355 | | typedef proto_delegate_1param<_ReturnType, _P1Type> proto_base; |
| 215 | typedef _ReturnType (*static_func_type)(_ClassType *); |
| 216 | typedef _ReturnType (*static_ref_func_type)(_ClassType &); |
| 217 | typedef _ReturnType (_ClassType::*member_func_type)(); |
| 218 | }; |
| 356 | 219 | |
| 357 | | using delegate_base::m_caster; |
| 358 | | using proto_base::m_function; |
| 359 | 220 | |
| 360 | | public: |
| 361 | | // constructors |
| 362 | | delegate_1param() |
| 363 | | : m_object(NULL) { } |
| 364 | 221 | |
| 365 | | delegate_1param(proto_delegate_1param<_ReturnType, _P1Type> proto) |
| 366 | | : proto_delegate_1param<_ReturnType, _P1Type>(proto), |
| 367 | | m_object(NULL) { } |
| 222 | //************************************************************************** |
| 223 | // COMPATIBLE DELEGATES |
| 224 | //************************************************************************** |
| 368 | 225 | |
| 369 | | delegate_1param(proto_delegate_1param<_ReturnType, _P1Type> proto, bindable_object &object) |
| 370 | | : proto_delegate_1param<_ReturnType, _P1Type>(proto), |
| 371 | | m_object((*m_caster)(object)) { } |
| 226 | #if (USE_DELEGATE_TYPE == DELEGATE_TYPE_COMPATIBLE) |
| 372 | 227 | |
| 373 | | // bind the actual object |
| 374 | | void bind(bindable_object &object) { m_object = (*m_caster)(object); } |
| 228 | // ======================> delegate_raw_mfp |
| 375 | 229 | |
| 376 | | // call the function |
| 377 | | _ReturnType operator()(_P1Type p1) const { return (*m_function)(m_object, p1); } |
| 378 | | |
| 379 | | // testing |
| 380 | | bool has_object() const { return (m_object != NULL); } |
| 381 | | bool operator==(const delegate_1param &rhs) const { return (m_object == rhs.m_object && proto_base::operator==(rhs)); } |
| 382 | | |
| 383 | | protected: |
| 384 | | // internal state |
| 385 | | delegate_generic_class *m_object; // pointer to the post-cast object |
| 386 | | }; |
| 387 | | |
| 388 | | |
| 389 | | // ======================> proto_delegate_2param |
| 390 | | |
| 391 | | template<typename _ReturnType, typename _P1Type, typename _P2Type> |
| 392 | | class proto_delegate_2param : public delegate_base |
| 230 | // delegate_raw_mfp is a class that wraps a generic member function pointer |
| 231 | // in a static buffer, and can effectively recast itself back for later use; |
| 232 | // it hides some of the gross details involved in copying artibtrary member |
| 233 | // function pointers around |
| 234 | struct delegate_raw_mfp |
| 393 | 235 | { |
| 394 | | protected: |
| 395 | | // pointer to a static version of the function which takes the object as a first parameter |
| 396 | | typedef _ReturnType (*static_func)(delegate_generic_class *, _P1Type, _P2Type); |
| 236 | // for MSVC maximum size is one pointer, plus 3 ints |
| 237 | static const int MAX_MFP_SIZE = sizeof(void *) + 3 * sizeof(int); |
| 397 | 238 | |
| 398 | | public: |
| 399 | | // constructors |
| 400 | | proto_delegate_2param(static_func function = NULL, deferred_cast_func caster = NULL, const char *name = NULL) |
| 401 | | : delegate_base(caster, name), |
| 402 | | m_function(function) { } |
| 239 | // default and copy constructors |
| 240 | delegate_raw_mfp() { memset(&m_rawdata, 0, sizeof(m_rawdata)); } |
| 241 | delegate_raw_mfp(const delegate_raw_mfp &src) : m_rawdata(src.m_rawdata) { } |
| 403 | 242 | |
| 404 | | proto_delegate_2param(const proto_delegate_2param &proto) |
| 405 | | : delegate_base(proto.m_caster, proto.m_name), |
| 406 | | m_function(proto.m_function) { } |
| 407 | | |
| 408 | | // create a member function proto-delegate |
| 409 | | template<class _FunctionClass, _ReturnType (_FunctionClass::*_FunctionPtr)(_P1Type, _P2Type)> |
| 410 | | static proto_delegate_2param _create_member(const char *name = NULL) |
| 243 | // construct from any member function pointer |
| 244 | template<typename _FunctionType> |
| 245 | delegate_raw_mfp(_FunctionType mfp) |
| 411 | 246 | { |
| 412 | | return proto_delegate_2param(&method_stub<_FunctionClass, _FunctionPtr>, &deferred_cast<_FunctionClass>, name); |
| 247 | assert(sizeof(mfp) <= sizeof(m_rawdata)); |
| 248 | memset(&m_rawdata, 0, sizeof(m_rawdata)); |
| 249 | *reinterpret_cast<_FunctionType *>(&m_rawdata) = mfp; |
| 413 | 250 | } |
| 414 | 251 | |
| 415 | | // create a static function proto-delegate |
| 416 | | template<class _FunctionClass, _ReturnType (*_FunctionPtr)(_FunctionClass *, _P1Type, _P2Type)> |
| 417 | | static proto_delegate_2param _create_static(const char *name = NULL) |
| 252 | // assignment operator |
| 253 | delegate_raw_mfp &operator=(const delegate_raw_mfp &src) |
| 418 | 254 | { |
| 419 | | return proto_delegate_2param(reinterpret_cast<static_func>(_FunctionPtr), &deferred_cast<_FunctionClass>, name); |
| 255 | if (this != &src) |
| 256 | m_rawdata = src.m_rawdata; |
| 257 | return *this; |
| 420 | 258 | } |
| 421 | 259 | |
| 422 | | // equality testing |
| 423 | | bool operator==(const proto_delegate_2param &rhs) const |
| 260 | // comparison operator |
| 261 | bool operator==(const delegate_raw_mfp &rhs) const |
| 424 | 262 | { |
| 425 | | return (m_function == rhs.m_function && m_caster == rhs.m_caster); |
| 263 | return (memcmp(&m_rawdata, &rhs.m_rawdata, sizeof(m_rawdata)) == 0); |
| 426 | 264 | } |
| 427 | 265 | |
| 428 | | protected: |
| 429 | | // helper stub that calls the member function |
| 430 | | template<class _FunctionClass, _ReturnType (_FunctionClass::*_FunctionPtr)(_P1Type, _P2Type)> |
| 431 | | static _ReturnType method_stub(delegate_generic_class *object_ptr, _P1Type p1, _P2Type p2) |
| 432 | | { |
| 433 | | _FunctionClass *p = reinterpret_cast<_FunctionClass *>(object_ptr); |
| 434 | | return (p->*_FunctionPtr)(p1, p2); |
| 435 | | } |
| 266 | // convert back to a member function pointer |
| 267 | template<class _FunctionType> |
| 268 | _FunctionType &mfp() const { return *reinterpret_cast<_FunctionType *>(&m_rawdata); } |
| 436 | 269 | |
| 437 | | // internal state |
| 438 | | static_func m_function; // pointer to the stub or static function |
| 270 | // raw buffer to hold the copy of the function pointer |
| 271 | mutable struct { UINT8 bytes[MAX_MFP_SIZE]; } m_rawdata; |
| 439 | 272 | }; |
| 440 | 273 | |
| 441 | 274 | |
| 442 | | // ======================> delegate_2param |
| 275 | // ======================> delegate |
| 443 | 276 | |
| 444 | | template<typename _ReturnType, typename _P1Type, typename _P2Type> |
| 445 | | class delegate_2param : public proto_delegate_2param<_ReturnType, _P1Type, _P2Type> |
| 277 | // general delegate class template supporting up to 4 parameters |
| 278 | template<typename _ReturnType, typename _P1Type = delegate_param_none, typename _P2Type = delegate_param_none, typename _P3Type = delegate_param_none, typename _P4Type = delegate_param_none> |
| 279 | class delegate_base |
| 446 | 280 | { |
| 447 | | typedef proto_delegate_2param<_ReturnType, _P1Type, _P2Type> proto_base; |
| 281 | typedef typename delegate_traits<delegate_generic_class, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type generic_static_func; |
| 448 | 282 | |
| 449 | | using delegate_base::m_caster; |
| 450 | | using proto_base::m_function; |
| 451 | | |
| 452 | 283 | public: |
| 453 | | // constructors |
| 454 | | delegate_2param() |
| 455 | | : m_object(NULL) { } |
| 284 | // generic constructor |
| 285 | delegate_base() |
| 286 | : m_caster(NULL), |
| 287 | m_name(NULL), |
| 288 | m_function(NULL), |
| 289 | m_object(NULL), |
| 290 | m_callobject(NULL) { } |
| 456 | 291 | |
| 457 | | delegate_2param(proto_delegate_2param<_ReturnType, _P1Type, _P2Type> proto) |
| 458 | | : proto_delegate_2param<_ReturnType, _P1Type, _P2Type>(proto), |
| 459 | | m_object(NULL) { } |
| 292 | // copy constructor |
| 293 | delegate_base(const delegate_base &src) |
| 294 | : m_caster(src.m_caster), |
| 295 | m_name(src.m_name), |
| 296 | m_object(src.m_object), |
| 297 | m_callobject(src.is_mfp() ? reinterpret_cast<delegate_generic_class *>(this) : src.m_object), |
| 298 | m_function(src.m_function), |
| 299 | m_rawfunction(src.m_rawfunction) { } |
| 460 | 300 | |
| 461 | | delegate_2param(proto_delegate_2param<_ReturnType, _P1Type, _P2Type> proto, bindable_object &object) |
| 462 | | : proto_delegate_2param<_ReturnType, _P1Type, _P2Type>(proto), |
| 463 | | m_object((*m_caster)(object)) { } |
| 301 | // copy constructor with re-bind |
| 302 | template<class _FunctionClass> |
| 303 | delegate_base(const delegate_base &src, _FunctionClass *object) |
| 304 | : m_caster(src.m_caster), |
| 305 | m_name(src.m_name), |
| 306 | m_object(src.m_object), |
| 307 | m_callobject(src.is_mfp() ? reinterpret_cast<delegate_generic_class *>(this) : src.m_object), |
| 308 | m_function(src.m_function), |
| 309 | m_rawfunction(src.m_rawfunction) { bind(object); } |
| 464 | 310 | |
| 465 | | // bind the actual object |
| 466 | | void bind(bindable_object &object) { m_object = (*m_caster)(object); } |
| 311 | // construct from member function with object pointer |
| 312 | template<class _FunctionClass> |
| 313 | delegate_base(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::member_func_type funcptr, const char *name, _FunctionClass *object) |
| 314 | : m_caster(&deferred_cast<_FunctionClass>), |
| 315 | m_name(name), |
| 316 | m_function(&delegate_base::method_stub<_FunctionClass>), |
| 317 | m_object(NULL), |
| 318 | m_callobject(reinterpret_cast<delegate_generic_class *>(this)), |
| 319 | m_rawfunction(funcptr) { bind(object); } |
| 467 | 320 | |
| 468 | | // call the function |
| 469 | | _ReturnType operator()(_P1Type p1, _P2Type p2) const { return (*m_function)(m_object, p1, p2); } |
| 321 | // construct from static function with object pointer |
| 322 | template<class _FunctionClass> |
| 323 | delegate_base(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type funcptr, const char *name, _FunctionClass *object) |
| 324 | : m_caster(&deferred_cast<_FunctionClass>), |
| 325 | m_name(name), |
| 326 | m_object(NULL), |
| 327 | m_callobject(NULL), |
| 328 | m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(object); } |
| 470 | 329 | |
| 471 | | // testing |
| 472 | | bool has_object() const { return (m_object != NULL); } |
| 473 | | bool operator==(const delegate_2param &rhs) const { return (m_object == rhs.m_object && proto_base::operator==(rhs)); } |
| 330 | // construct from static reference function with object pointer |
| 331 | template<class _FunctionClass> |
| 332 | delegate_base(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) |
| 333 | : m_caster(&deferred_cast<_FunctionClass>), |
| 334 | m_name(name), |
| 335 | m_object(NULL), |
| 336 | m_callobject(NULL), |
| 337 | m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(object); } |
| 474 | 338 | |
| 475 | | protected: |
| 476 | | // internal state |
| 477 | | delegate_generic_class *m_object; // pointer to the post-cast object |
| 478 | | }; |
| 479 | | |
| 480 | | |
| 481 | | // ======================> proto_delegate_3param |
| 482 | | |
| 483 | | template<typename _ReturnType, typename _P1Type, typename _P2Type, typename _P3Type> |
| 484 | | class proto_delegate_3param : public delegate_base |
| 485 | | { |
| 486 | | protected: |
| 487 | | // pointer to a static version of the function which takes the object as a first parameter |
| 488 | | typedef _ReturnType (*static_func)(delegate_generic_class *, _P1Type, _P2Type, _P3Type); |
| 489 | | |
| 490 | | public: |
| 491 | | // constructors |
| 492 | | proto_delegate_3param(static_func function = NULL, deferred_cast_func caster = NULL, const char *name = NULL) |
| 493 | | : delegate_base(caster, name), |
| 494 | | m_function(function) { } |
| 495 | | |
| 496 | | proto_delegate_3param(const proto_delegate_3param &proto) |
| 497 | | : delegate_base(proto.m_caster, proto.m_name), |
| 498 | | m_function(proto.m_function) { } |
| 499 | | |
| 500 | | // create a member function proto-delegate |
| 501 | | template<class _FunctionClass, _ReturnType (_FunctionClass::*_FunctionPtr)(_P1Type, _P2Type, _P3Type)> |
| 502 | | static proto_delegate_3param _create_member(const char *name = NULL) |
| 339 | // copy operator |
| 340 | delegate_base &operator=(const delegate_base &src) |
| 503 | 341 | { |
| 504 | | return proto_delegate_3param(&method_stub<_FunctionClass, _FunctionPtr>, &deferred_cast<_FunctionClass>, name); |
| 342 | if (this != &src) |
| 343 | { |
| 344 | m_caster = src.m_caster; |
| 345 | m_name = src.m_name; |
| 346 | m_object = src.m_object; |
| 347 | m_callobject = src.is_mfp() ? reinterpret_cast<delegate_generic_class *>(this) : src.m_object; |
| 348 | m_function = src.m_function; |
| 349 | m_rawfunction = src.m_rawfunction; |
| 350 | } |
| 351 | return *this; |
| 505 | 352 | } |
| 506 | 353 | |
| 507 | | // create a static function proto-delegate |
| 508 | | template<class _FunctionClass, _ReturnType (*_FunctionPtr)(_FunctionClass *, _P1Type, _P2Type, _P3Type)> |
| 509 | | static proto_delegate_3param _create_static(const char *name = NULL) |
| 354 | // comparison operator |
| 355 | bool operator==(const delegate_base &rhs) const |
| 510 | 356 | { |
| 511 | | return proto_delegate_3param(reinterpret_cast<static_func>(_FunctionPtr), &deferred_cast<_FunctionClass>, name); |
| 357 | return (m_caster == rhs.m_caster && m_object == rhs.m_object && |
| 358 | m_function == m_function && m_rawfunction == m_rawfunction); |
| 512 | 359 | } |
| 513 | 360 | |
| 514 | | // equality testing |
| 515 | | bool operator==(const proto_delegate_3param &rhs) const |
| 516 | | { |
| 517 | | return (m_function == rhs.m_function && m_caster == rhs.m_caster); |
| 518 | | } |
| 361 | // getters |
| 362 | bool isnull() const { return (m_caster == NULL); } |
| 363 | bool valid_target(bindable_object &object) const { return ((*m_caster)(object) != NULL); } |
| 364 | bool has_object() const { return (m_object != NULL); } |
| 365 | const char *name() const { return m_name; } |
| 519 | 366 | |
| 520 | | protected: |
| 521 | | // helper stub that calls the member function |
| 522 | | template<class _FunctionClass, _ReturnType (_FunctionClass::*_FunctionPtr)(_P1Type, _P2Type, _P3Type)> |
| 523 | | static _ReturnType method_stub(delegate_generic_class *object_ptr, _P1Type p1, _P2Type p2, _P3Type p3) |
| 524 | | { |
| 525 | | _FunctionClass *p = reinterpret_cast<_FunctionClass *>(object_ptr); |
| 526 | | return (p->*_FunctionPtr)(p1, p2, p3); |
| 527 | | } |
| 528 | | |
| 529 | | // internal state |
| 530 | | static_func m_function; // pointer to the stub or static function |
| 531 | | }; |
| 532 | | |
| 533 | | |
| 534 | | // ======================> delegate_3param |
| 535 | | |
| 536 | | template<typename _ReturnType, typename _P1Type, typename _P2Type, typename _P3Type> |
| 537 | | class delegate_3param : public proto_delegate_3param<_ReturnType, _P1Type, _P2Type, _P3Type> |
| 538 | | { |
| 539 | | typedef proto_delegate_3param<_ReturnType, _P1Type, _P2Type, _P3Type> proto_base; |
| 540 | | |
| 541 | | using delegate_base::m_caster; |
| 542 | | using proto_base::m_function; |
| 543 | | |
| 544 | | public: |
| 545 | | // constructors |
| 546 | | delegate_3param() |
| 547 | | : m_object(NULL) { } |
| 548 | | |
| 549 | | delegate_3param(proto_delegate_3param<_ReturnType, _P1Type, _P2Type, _P3Type> proto) |
| 550 | | : proto_delegate_3param<_ReturnType, _P1Type, _P2Type, _P3Type>(proto), |
| 551 | | m_object(NULL) { } |
| 552 | | |
| 553 | | delegate_3param(proto_delegate_3param<_ReturnType, _P1Type, _P2Type, _P3Type> proto, bindable_object &object) |
| 554 | | : proto_delegate_3param<_ReturnType, _P1Type, _P2Type, _P3Type>(proto), |
| 555 | | m_object((*m_caster)(object)) { } |
| 556 | | |
| 557 | | // bind the actual object |
| 558 | | void bind(bindable_object &object) { m_object = (*m_caster)(object); } |
| 559 | | |
| 560 | 367 | // call the function |
| 561 | | _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3) const { return (*m_function)(m_object, p1, p2, p3); } |
| 368 | _ReturnType operator()() const { return (*m_function)(m_callobject); } |
| 369 | _ReturnType operator()(_P1Type p1) const { return (*m_function)(m_callobject, p1); } |
| 370 | _ReturnType operator()(_P1Type p1, _P2Type p2) const { return (*m_function)(m_callobject, p1, p2); } |
| 371 | _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3) const { return (*m_function)(m_callobject, p1, p2, p3); } |
| 372 | _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4) const { return (*m_function)(m_callobject, p1, p2, p3, p4); } |
| 562 | 373 | |
| 563 | | // testing |
| 564 | | bool has_object() const { return (m_object != NULL); } |
| 565 | | bool operator==(const delegate_3param &rhs) const { return (m_object == rhs.m_object && proto_base::operator==(rhs)); } |
| 566 | | |
| 567 | 374 | protected: |
| 568 | | // internal state |
| 569 | | delegate_generic_class *m_object; // pointer to the post-cast object |
| 570 | | }; |
| 571 | | |
| 572 | | |
| 573 | | // ======================> proto_delegate_4param |
| 574 | | |
| 575 | | template<typename _ReturnType, typename _P1Type, typename _P2Type, typename _P3Type, typename _P4Type> |
| 576 | | class proto_delegate_4param : public delegate_base |
| 577 | | { |
| 578 | | protected: |
| 579 | | // pointer to a static version of the function which takes the object as a first parameter |
| 580 | | typedef _ReturnType (*static_func)(delegate_generic_class *, _P1Type, _P2Type, _P3Type, _P4Type); |
| 581 | | |
| 582 | | public: |
| 583 | | // constructors |
| 584 | | proto_delegate_4param(static_func function = NULL, deferred_cast_func caster = NULL, const char *name = NULL) |
| 585 | | : delegate_base(caster, name), |
| 586 | | m_function(function) { } |
| 587 | | |
| 588 | | proto_delegate_4param(const proto_delegate_4param &proto) |
| 589 | | : delegate_base(proto.m_caster, proto.m_name), |
| 590 | | m_function(proto.m_function) { } |
| 591 | | |
| 592 | | // create a member function proto-delegate |
| 593 | | template<class _FunctionClass, _ReturnType (_FunctionClass::*_FunctionPtr)(_P1Type, _P2Type, _P3Type, _P4Type)> |
| 594 | | static proto_delegate_4param _create_member(const char *name = NULL) |
| 375 | // bind the actual object |
| 376 | void bind(bindable_object *object) |
| 595 | 377 | { |
| 596 | | return proto_delegate_4param(&method_stub<_FunctionClass, _FunctionPtr>, &deferred_cast<_FunctionClass>, name); |
| 378 | m_object = (object != NULL) ? (*this->m_caster)(*object) : NULL; |
| 379 | if (!is_mfp()) m_callobject = m_object; |
| 597 | 380 | } |
| 598 | 381 | |
| 599 | | // create a static function proto-delegate |
| 600 | | template<class _FunctionClass, _ReturnType (*_FunctionPtr)(_FunctionClass *, _P1Type, _P2Type, _P3Type, _P4Type)> |
| 601 | | static proto_delegate_4param _create_static(const char *name = NULL) |
| 602 | | { |
| 603 | | return proto_delegate_4param(reinterpret_cast<static_func>(_FunctionPtr), &deferred_cast<_FunctionClass>, name); |
| 604 | | } |
| 382 | // internal helpers |
| 383 | bool is_mfp() const { return m_callobject == reinterpret_cast<const delegate_generic_class *>(this); } |
| 605 | 384 | |
| 606 | | // equality testing |
| 607 | | bool operator==(const proto_delegate_4param &rhs) const |
| 608 | | { |
| 609 | | return (m_function == rhs.m_function && m_caster == rhs.m_caster); |
| 610 | | } |
| 385 | // helper stub that calls the member function; we need one for each parameter count |
| 386 | template<class _FunctionClass> |
| 387 | static _ReturnType method_stub(delegate_generic_class *object) |
| 388 | { |
| 389 | typedef _ReturnType (_FunctionClass::*mfptype)(); |
| 390 | delegate_base *_this = reinterpret_cast<delegate_base *>(object); |
| 391 | mfptype &mfp = _this->m_rawfunction.mfp<mfptype>(); |
| 392 | return (reinterpret_cast<_FunctionClass *>(_this->m_object)->*mfp)(); |
| 393 | } |
| 611 | 394 | |
| 612 | | protected: |
| 613 | | // helper stub that calls the member function |
| 614 | | template<class _FunctionClass, _ReturnType (_FunctionClass::*_FunctionPtr)(_P1Type, _P2Type, _P3Type, _P4Type)> |
| 615 | | static _ReturnType method_stub(delegate_generic_class *object_ptr, _P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4) |
| 395 | template<class _FunctionClass> |
| 396 | static _ReturnType method_stub(delegate_generic_class *object, _P1Type p1) |
| 616 | 397 | { |
| 617 | | _FunctionClass *p = reinterpret_cast<_FunctionClass *>(object_ptr); |
| 618 | | return (p->*_FunctionPtr)(p1, p2, p3, p4); |
| 398 | typedef _ReturnType (_FunctionClass::*mfptype)(_P1Type p1); |
| 399 | delegate_base *_this = reinterpret_cast<delegate_base *>(object); |
| 400 | mfptype &mfp = _this->m_rawfunction.mfp<mfptype>(); |
| 401 | return (reinterpret_cast<_FunctionClass *>(_this->m_object)->*mfp)(p1); |
| 619 | 402 | } |
| 620 | 403 | |
| 621 | | // internal state |
| 622 | | static_func m_function; // pointer to the stub or static function |
| 623 | | }; |
| 404 | template<class _FunctionClass> |
| 405 | static _ReturnType method_stub(delegate_generic_class *object, _P1Type p1, _P2Type p2) |
| 406 | { |
| 407 | typedef _ReturnType (_FunctionClass::*mfptype)(_P1Type p1, _P2Type p2); |
| 408 | delegate_base *_this = reinterpret_cast<delegate_base *>(object); |
| 409 | mfptype &mfp = _this->m_rawfunction.mfp<mfptype>(); |
| 410 | return (reinterpret_cast<_FunctionClass *>(_this->m_object)->*mfp)(p1, p2); |
| 411 | } |
| 624 | 412 | |
| 413 | template<class _FunctionClass> |
| 414 | static _ReturnType method_stub(delegate_generic_class *object, _P1Type p1, _P2Type p2, _P3Type p3) |
| 415 | { |
| 416 | typedef _ReturnType (_FunctionClass::*mfptype)(_P1Type p1, _P2Type p2, _P3Type p3); |
| 417 | delegate_base *_this = reinterpret_cast<delegate_base *>(object); |
| 418 | mfptype &mfp = _this->m_rawfunction.mfp<mfptype>(); |
| 419 | return (reinterpret_cast<_FunctionClass *>(_this->m_object)->*mfp)(p1, p2, p3); |
| 420 | } |
| 625 | 421 | |
| 626 | | // ======================> delegate_4param |
| 422 | template<class _FunctionClass> |
| 423 | static _ReturnType method_stub(delegate_generic_class *object, _P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4) |
| 424 | { |
| 425 | typedef _ReturnType (_FunctionClass::*mfptype)(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4); |
| 426 | delegate_base *_this = reinterpret_cast<delegate_base *>(object); |
| 427 | mfptype &mfp = _this->m_rawfunction.mfp<mfptype>(); |
| 428 | return (reinterpret_cast<_FunctionClass *>(_this->m_object)->*mfp)(p1, p2, p3, p4); |
| 429 | } |
| 627 | 430 | |
| 628 | | template<typename _ReturnType, typename _P1Type, typename _P2Type, typename _P3Type, typename _P4Type> |
| 629 | | class delegate_4param : public proto_delegate_4param<_ReturnType, _P1Type, _P2Type, _P3Type, _P4Type> |
| 630 | | { |
| 631 | | typedef proto_delegate_4param<_ReturnType, _P1Type, _P2Type, _P3Type, _P4Type> proto_base; |
| 632 | | |
| 633 | | using delegate_base::m_caster; |
| 634 | | using proto_base::m_function; |
| 635 | | |
| 636 | | public: |
| 637 | | // constructors |
| 638 | | delegate_4param() |
| 639 | | : m_object(NULL) { } |
| 640 | | |
| 641 | | delegate_4param(proto_delegate_4param<_ReturnType, _P1Type, _P2Type, _P3Type, _P4Type> proto) |
| 642 | | : proto_delegate_4param<_ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>(proto), |
| 643 | | m_object(NULL) { } |
| 644 | | |
| 645 | | delegate_4param(proto_delegate_4param<_ReturnType, _P1Type, _P2Type, _P3Type, _P4Type> proto, bindable_object &object) |
| 646 | | : proto_delegate_4param<_ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>(proto), |
| 647 | | m_object((*m_caster)(object)) { } |
| 648 | | |
| 649 | | // bind the actual object |
| 650 | | void bind(bindable_object &object) { m_object = (*m_caster)(object); } |
| 651 | | |
| 652 | | // call the function |
| 653 | | _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4) const { return (*m_function)(m_object, p1, p2, p3, p4); } |
| 654 | | |
| 655 | | // testing |
| 656 | | bool has_object() const { return (m_object != NULL); } |
| 657 | | bool operator==(const delegate_4param &rhs) const { return (m_object == rhs.m_object && proto_base::operator==(rhs)); } |
| 658 | | |
| 659 | | protected: |
| 660 | 431 | // internal state |
| 661 | | delegate_generic_class *m_object; // pointer to the post-cast object |
| 432 | deferred_cast_func m_caster; // pointer to helper function that does the cast |
| 433 | const char * m_name; // name string |
| 434 | generic_static_func m_function; // generic static function pointer |
| 435 | delegate_raw_mfp m_rawfunction; // copy of raw MFP |
| 436 | delegate_generic_class * m_object; // pointer to the post-cast object |
| 437 | delegate_generic_class * m_callobject; // pointer to the object used for calling |
| 662 | 438 | }; |
| 663 | 439 | |
| 664 | | |
| 665 | 440 | #endif |
| 666 | 441 | |
| 667 | 442 | |
| r11224 | r11225 | |
| 675 | 450 | typedef void (*delegate_generic_function)(); |
| 676 | 451 | |
| 677 | 452 | // struct describing the contents of a member function pointer |
| 678 | | struct delegate_gcc_mfp_internal |
| 453 | struct delegate_internal_mfp |
| 679 | 454 | { |
| 680 | | union // first item can be one of two things: |
| 681 | | { |
| 682 | | delegate_generic_function funcptr; // if even, it's a pointer to the function |
| 683 | | FPTR vtable_index; // if odd, it's the byte offset into the vtable |
| 684 | | } u; |
| 685 | | int this_delta; // delta to apply to the 'this' pointer |
| 686 | | }; |
| 455 | // default constructor |
| 456 | delegate_internal_mfp() |
| 457 | : m_function(0), |
| 458 | m_this_delta(0) { } |
| 687 | 459 | |
| 688 | | // helper function |
| 689 | | delegate_generic_function delegate_convert_raw(delegate_generic_class *&object, delegate_gcc_mfp_internal &mfp); |
| 460 | // copy constructor |
| 461 | delegate_internal_mfp(const delegate_internal_mfp &src) |
| 462 | : m_function(src.m_function), |
| 463 | m_this_delta(src.m_this_delta) { } |
| 690 | 464 | |
| 691 | | // global dummy extern |
| 692 | | extern delegate_gcc_mfp_internal delegate_gcc_mfp_null; |
| 693 | | |
| 694 | | |
| 695 | | // ======================> proto_delegate_0param |
| 696 | | |
| 697 | | template<typename _ReturnType> |
| 698 | | class proto_delegate_0param : public delegate_base |
| 699 | | { |
| 700 | | protected: |
| 701 | | // pointer to a static function which takes the object as a first parameter |
| 702 | | typedef _ReturnType (*static_func)(delegate_generic_class *); |
| 703 | | |
| 704 | | public: |
| 705 | | // constructors |
| 706 | | proto_delegate_0param(delegate_gcc_mfp_internal &mfp = delegate_gcc_mfp_null, static_func function = NULL, deferred_cast_func caster = NULL, const char *name = NULL) |
| 707 | | : delegate_base(caster, name), |
| 708 | | m_function(function), |
| 709 | | m_rawfunction(mfp) { } |
| 710 | | |
| 711 | | proto_delegate_0param(const proto_delegate_0param &proto) |
| 712 | | : delegate_base(proto.m_caster, proto.m_name), |
| 713 | | m_function(proto.m_function), |
| 714 | | m_rawfunction(proto.m_rawfunction) { } |
| 715 | | |
| 716 | | // create a member function proto-delegate |
| 717 | | template<class _FunctionClass, _ReturnType (_FunctionClass::*_FunctionPtr)()> |
| 718 | | static proto_delegate_0param _create_member(const char *name = NULL) |
| 465 | // construct from any member function pointer |
| 466 | template<typename _FunctionPtr> |
| 467 | delegate_internal_mfp(_FunctionPtr funcptr) |
| 719 | 468 | { |
| 720 | | union |
| 721 | | { |
| 722 | | _ReturnType (_FunctionClass::*mfp)(); |
| 723 | | delegate_gcc_mfp_internal internal; |
| 724 | | } tempunion; |
| 725 | | tempunion.mfp = _FunctionPtr; |
| 726 | | return proto_delegate_0param(tempunion.internal, NULL, &deferred_cast<_FunctionClass>, name); |
| 469 | assert(sizeof(funcptr) == sizeof(*this)); |
| 470 | *reinterpret_cast<_FunctionPtr *>(this) = funcptr; |
| 727 | 471 | } |
| 728 | 472 | |
| 729 | | // create a static function proto-delegate |
| 730 | | template<class _FunctionClass, _ReturnType (*_FunctionPtr)(_FunctionClass *)> |
| 731 | | static proto_delegate_0param _create_static(const char *name = NULL) |
| 473 | // assignment operator |
| 474 | delegate_internal_mfp &operator=(const delegate_internal_mfp &src) |
| 732 | 475 | { |
| 733 | | return proto_delegate_0param(delegate_gcc_mfp_null, reinterpret_cast<static_func>(_FunctionPtr), &deferred_cast<_FunctionClass>, name); |
| 476 | if (this != &src) |
| 477 | { |
| 478 | m_function = src.m_function; |
| 479 | m_this_delta = src.m_this_delta; |
| 480 | } |
| 481 | return *this; |
| 734 | 482 | } |
| 735 | 483 | |
| 736 | | // equality testing |
| 737 | | bool operator==(const proto_delegate_0param &rhs) const |
| 484 | // comparison operator |
| 485 | bool operator==(const delegate_internal_mfp &rhs) const |
| 738 | 486 | { |
| 739 | | return (m_function == rhs.m_function && m_caster == rhs.m_caster && |
| 740 | | m_rawfunction.u.funcptr == rhs.m_rawfunction.u.funcptr && |
| 741 | | m_rawfunction.this_delta == rhs.m_rawfunction.this_delta); |
| 487 | return (m_function == rhs.m_function && m_this_delta == rhs.m_this_delta); |
| 742 | 488 | } |
| 743 | 489 | |
| 744 | | protected: |
| 745 | | // internal state |
| 746 | | static_func m_function; // generic static function pointer |
| 747 | | delegate_gcc_mfp_internal m_rawfunction; // raw member function definition |
| 490 | // extract the generic function and adjust the object pointer |
| 491 | delegate_generic_function convert_to_generic(delegate_generic_class *&object) const; |
| 492 | |
| 493 | // actual state |
| 494 | FPTR m_function; // first item can be one of two things: |
| 495 | // if even, it's a pointer to the function |
| 496 | // if odd, it's the byte offset into the vtable |
| 497 | int m_this_delta; // delta to apply to the 'this' pointer |
| 748 | 498 | }; |
| 749 | 499 | |
| 750 | 500 | |
| 751 | | // ======================> delegate_0param |
| 501 | // ======================> delegate |
| 752 | 502 | |
| 753 | | template<typename _ReturnType> |
| 754 | | class delegate_0param : public proto_delegate_0param<_ReturnType> |
| 503 | template<typename _ReturnType, typename _P1Type = delegate_param_none, typename _P2Type = delegate_param_none, typename _P3Type = delegate_param_none, typename _P4Type = delegate_param_none> |
| 504 | class delegate_base |
| 755 | 505 | { |
| 756 | | typedef _ReturnType (*static_func)(delegate_generic_class *); |
| 757 | | typedef proto_delegate_0param<_ReturnType> proto_base; |
| 506 | typedef typename delegate_traits<delegate_generic_class, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type generic_static_func; |
| 758 | 507 | |
| 759 | | using delegate_base::m_caster; |
| 760 | | using proto_base::m_function; |
| 761 | | using proto_base::m_rawfunction; |
| 762 | | |
| 763 | 508 | public: |
| 764 | | // constructors |
| 765 | | delegate_0param() |
| 766 | | : m_object(NULL) { } |
| 509 | // generic constructor |
| 510 | delegate_base() |
| 511 | : m_caster(NULL), |
| 512 | m_name(NULL), |
| 513 | m_object(NULL), |
| 514 | m_function(NULL) { } |
| 767 | 515 | |
| 768 | | delegate_0param(proto_base proto) |
| 769 | | : proto_delegate_0param<_ReturnType>(proto), |
| 770 | | m_object(NULL) { } |
| 516 | // copy constructor |
| 517 | delegate_base(const delegate_base &src) |
| 518 | : m_caster(src.m_caster), |
| 519 | m_name(src.m_name), |
| 520 | m_object(src.m_object), |
| 521 | m_function(src.m_function), |
| 522 | m_rawfunction(src.m_rawfunction) { } |
| 771 | 523 | |
| 772 | | delegate_0param(proto_base proto, bindable_object &object) |
| 773 | | : proto_delegate_0param<_ReturnType>(proto), |
| 774 | | m_object(NULL) { bind(object); } |
| 524 | // copy constructor with re-bind |
| 525 | template<class _FunctionClass> |
| 526 | delegate_base(const delegate_base &src, _FunctionClass *object) |
| 527 | : m_caster(src.m_caster), |
| 528 | m_name(src.m_name), |
| 529 | m_object(src.m_object), |
| 530 | m_function(src.m_function), |
| 531 | m_rawfunction(src.m_rawfunction) { bind(object); } |
| 775 | 532 | |
| 776 | | // bind the actual object |
| 777 | | void bind(bindable_object &object) |
| 778 | | { |
| 779 | | m_object = (*this->m_caster)(object); |
| 780 | | if (m_rawfunction.u.funcptr != NULL) |
| 781 | | m_function = reinterpret_cast<static_func>(delegate_convert_raw(m_object, m_rawfunction)); |
| 782 | | } |
| 533 | // construct from member function with object pointer |
| 534 | template<class _FunctionClass> |
| 535 | delegate_base(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::member_func_type funcptr, const char *name, _FunctionClass *object) |
| 536 | : m_caster(&deferred_cast<_FunctionClass>), |
| 537 | m_name(name), |
| 538 | m_object(NULL), |
| 539 | m_function(NULL), |
| 540 | m_rawfunction(funcptr) { bind(object); } |
| 783 | 541 | |
| 784 | | // call the function |
| 785 | | _ReturnType operator()() const { return (*m_function)(m_object); } |
| 542 | // construct from static function with object pointer |
| 543 | template<class _FunctionClass> |
| 544 | delegate_base(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type funcptr, const char *name, _FunctionClass *object) |
| 545 | : m_caster(&deferred_cast<_FunctionClass>), |
| 546 | m_name(name), |
| 547 | m_object(NULL), |
| 548 | m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(object); } |
| 786 | 549 | |
| 787 | | // testing |
| 788 | | bool has_object() const { return (m_object != NULL); } |
| 789 | | bool operator==(const delegate_0param &rhs) const { return (m_object == rhs.m_object && proto_base::operator==(rhs)); } |
| 550 | // construct from static reference function with object pointer |
| 551 | template<class _FunctionClass> |
| 552 | delegate_base(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) |
| 553 | : m_caster(&deferred_cast<_FunctionClass>), |
| 554 | m_name(name), |
| 555 | m_object(NULL), |
| 556 | m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(object); } |
| 790 | 557 | |
| 791 | | protected: |
| 792 | | // internal state |
| 793 | | delegate_generic_class *m_object; // pointer to the post-cast object |
| 794 | | }; |
| 795 | | |
| 796 | | |
| 797 | | // ======================> proto_delegate_1param |
| 798 | | |
| 799 | | template<typename _ReturnType, typename _P1Type> |
| 800 | | class proto_delegate_1param : public delegate_base |
| 801 | | { |
| 802 | | protected: |
| 803 | | // pointer to a static function which takes the object as a first parameter |
| 804 | | typedef _ReturnType (*static_func)(delegate_generic_class *, _P1Type); |
| 805 | | |
| 806 | | public: |
| 807 | | // constructors |
| 808 | | proto_delegate_1param(delegate_gcc_mfp_internal &mfp = delegate_gcc_mfp_null, static_func function = NULL, deferred_cast_func caster = NULL, const char *name = NULL) |
| 809 | | : delegate_base(caster, name), |
| 810 | | m_function(function), |
| 811 | | m_rawfunction(mfp) { } |
| 812 | | |
| 813 | | proto_delegate_1param(const proto_delegate_1param &proto) |
| 814 | | : delegate_base(proto.m_caster, proto.m_name), |
| 815 | | m_function(proto.m_function), |
| 816 | | m_rawfunction(proto.m_rawfunction) { } |
| 817 | | |
| 818 | | // create a member function proto-delegate |
| 819 | | template<class _FunctionClass, _ReturnType (_FunctionClass::*_FunctionPtr)(_P1Type)> |
| 820 | | static proto_delegate_1param _create_member(const char *name = NULL) |
| 558 | // copy operator |
| 559 | delegate_base &operator=(const delegate_base &src) |
| 821 | 560 | { |
| 822 | | union |
| 561 | if (this != &src) |
| 823 | 562 | { |
| 824 | | _ReturnType (_FunctionClass::*mfp)(_P1Type); |
| 825 | | delegate_gcc_mfp_internal internal; |
| 826 | | } tempunion; |
| 827 | | tempunion.mfp = _FunctionPtr; |
| 828 | | return proto_delegate_1param(tempunion.internal, NULL, &deferred_cast<_FunctionClass>, name); |
| 563 | m_caster = src.m_caster; |
| 564 | m_name = src.m_name; |
| 565 | m_object = src.m_object; |
| 566 | m_function = src.m_function; |
| 567 | m_rawfunction = src.m_rawfunction; |
| 568 | } |
| 569 | return *this; |
| 829 | 570 | } |
| 830 | 571 | |
| 831 | | // create a static function proto-delegate |
| 832 | | template<class _FunctionClass, _ReturnType (*_FunctionPtr)(_FunctionClass *, _P1Type)> |
| 833 | | static proto_delegate_1param _create_static(const char *name = NULL) |
| 572 | // comparison operator |
| 573 | bool operator==(const delegate_base &rhs) const |
| 834 | 574 | { |
| 835 | | return proto_delegate_1param(delegate_gcc_mfp_null, reinterpret_cast<static_func>(_FunctionPtr), &deferred_cast<_FunctionClass>, name); |
| 575 | return (m_caster == rhs.m_caster && m_object == rhs.m_object && |
| 576 | m_function == m_function && m_rawfunction == m_rawfunction); |
| 836 | 577 | } |
| 837 | 578 | |
| 838 | | // equality testing |
| 839 | | bool operator==(const proto_delegate_1param &rhs) const |
| 840 | | { |
| 841 | | return (m_function == rhs.m_function && m_caster == rhs.m_caster && |
| 842 | | m_rawfunction.u.funcptr == rhs.m_rawfunction.u.funcptr && |
| 843 | | m_rawfunction.this_delta == rhs.m_rawfunction.this_delta); |
| 844 | | } |
| 579 | // getters |
| 580 | bool isnull() const { return (m_caster == NULL); } |
| 581 | bool valid_target(bindable_object &object) const { return ((*m_caster)(object) != NULL); } |
| 582 | bool has_object() const { return (m_object != NULL); } |
| 583 | const char *name() const { return m_name; } |
| 845 | 584 | |
| 846 | | protected: |
| 847 | | // internal state |
| 848 | | static_func m_function; // generic static function pointer |
| 849 | | delegate_gcc_mfp_internal m_rawfunction; // raw member function definition |
| 850 | | }; |
| 851 | | |
| 852 | | |
| 853 | | // ======================> delegate_1param |
| 854 | | |
| 855 | | template<typename _ReturnType, typename _P1Type> |
| 856 | | class delegate_1param : public proto_delegate_1param<_ReturnType, _P1Type> |
| 857 | | { |
| 858 | | typedef _ReturnType (*static_func)(delegate_generic_class *, _P1Type); |
| 859 | | typedef proto_delegate_1param<_ReturnType, _P1Type> proto_base; |
| 860 | | |
| 861 | | using delegate_base::m_caster; |
| 862 | | using proto_base::m_function; |
| 863 | | using proto_base::m_rawfunction; |
| 864 | | |
| 865 | | public: |
| 866 | | // constructors |
| 867 | | delegate_1param() |
| 868 | | : m_object(NULL) { } |
| 869 | | |
| 870 | | delegate_1param(proto_base proto) |
| 871 | | : proto_delegate_1param<_ReturnType, _P1Type>(proto), |
| 872 | | m_object(NULL) { } |
| 873 | | |
| 874 | | delegate_1param(proto_base proto, bindable_object &object) |
| 875 | | : proto_delegate_1param<_ReturnType, _P1Type>(proto), |
| 876 | | m_object(NULL) { bind(object); } |
| 877 | | |
| 878 | | // bind the actual object |
| 879 | | void bind(bindable_object &object) |
| 880 | | { |
| 881 | | m_object = (*this->m_caster)(object); |
| 882 | | if (m_rawfunction.u.funcptr != NULL) |
| 883 | | m_function = reinterpret_cast<static_func>(delegate_convert_raw(m_object, m_rawfunction)); |
| 884 | | } |
| 885 | | |
| 886 | 585 | // call the function |
| 586 | _ReturnType operator()() const { return (*m_function)(m_object); } |
| 887 | 587 | _ReturnType operator()(_P1Type p1) const { return (*m_function)(m_object, p1); } |
| 588 | _ReturnType operator()(_P1Type p1, _P2Type p2) const { return (*m_function)(m_object, p1, p2); } |
| 589 | _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3) const { return (*m_function)(m_object, p1, p2, p3); } |
| 590 | _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4) const { return (*m_function)(m_object, p1, p2, p3, p4); } |
| 888 | 591 | |
| 889 | | // testing |
| 890 | | bool has_object() const { return (m_object != NULL); } |
| 891 | | bool operator==(const delegate_1param &rhs) const { return (m_object == rhs.m_object && proto_base::operator==(rhs)); } |
| 892 | | |
| 893 | 592 | protected: |
| 894 | | // internal state |
| 895 | | delegate_generic_class *m_object; // pointer to the post-cast object |
| 896 | | }; |
| 897 | | |
| 898 | | |
| 899 | | // ======================> proto_delegate_2param |
| 900 | | |
| 901 | | template<typename _ReturnType, typename _P1Type, typename _P2Type> |
| 902 | | class proto_delegate_2param : public delegate_base |
| 903 | | { |
| 904 | | protected: |
| 905 | | // pointer to a static function which takes the object as a first parameter |
| 906 | | typedef _ReturnType (*static_func)(delegate_generic_class *, _P1Type, _P2Type); |
| 907 | | |
| 908 | | public: |
| 909 | | // constructors |
| 910 | | proto_delegate_2param(delegate_gcc_mfp_internal &mfp = delegate_gcc_mfp_null, static_func function = NULL, deferred_cast_func caster = NULL, const char *name = NULL) |
| 911 | | : delegate_base(caster, name), |
| 912 | | m_function(function), |
| 913 | | m_rawfunction(mfp) { } |
| 914 | | |
| 915 | | proto_delegate_2param(const proto_delegate_2param &proto) |
| 916 | | : delegate_base(proto.m_caster, proto.m_name), |
| 917 | | m_function(proto.m_function), |
| 918 | | m_rawfunction(proto.m_rawfunction) { } |
| 919 | | |
| 920 | | // create a member function proto-delegate |
| 921 | | template<class _FunctionClass, _ReturnType (_FunctionClass::*_FunctionPtr)(_P1Type, _P2Type)> |
| 922 | | static proto_delegate_2param _create_member(const char *name = NULL) |
| 593 | // bind the actual object |
| 594 | void bind(bindable_object *object) |
| 923 | 595 | { |
| 924 | | union |
| 925 | | { |
| 926 | | _ReturnType (_FunctionClass::*mfp)(_P1Type, _P2Type); |
| 927 | | delegate_gcc_mfp_internal internal; |
| 928 | | } tempunion; |
| 929 | | tempunion.mfp = _FunctionPtr; |
| 930 | | return proto_delegate_2param(tempunion.internal, NULL, &deferred_cast<_FunctionClass>, name); |
| 596 | m_object = (object != NULL) ? (*this->m_caster)(*object) : NULL; |
| 597 | if (m_object != NULL && m_rawfunction.m_function != 0) |
| 598 | m_function = reinterpret_cast<generic_static_func>(m_rawfunction.convert_to_generic(m_object)); |
| 931 | 599 | } |
| 932 | 600 | |
| 933 | | // create a static function proto-delegate |
| 934 | | template<class _FunctionClass, _ReturnType (*_FunctionPtr)(_FunctionClass *, _P1Type, _P2Type)> |
| 935 | | static proto_delegate_2param _create_static(const char *name = NULL) |
| 936 | | { |
| 937 | | return proto_delegate_2param(delegate_gcc_mfp_null, reinterpret_cast<static_func>(_FunctionPtr), &deferred_cast<_FunctionClass>, name); |
| 938 | | } |
| 939 | | |
| 940 | | // equality testing |
| 941 | | bool operator==(const proto_delegate_2param &rhs) const |
| 942 | | { |
| 943 | | return (m_function == rhs.m_function && m_caster == rhs.m_caster && |
| 944 | | m_rawfunction.u.funcptr == rhs.m_rawfunction.u.funcptr && |
| 945 | | m_rawfunction.this_delta == rhs.m_rawfunction.this_delta); |
| 946 | | } |
| 947 | | |
| 948 | | protected: |
| 949 | 601 | // internal state |
| 950 | | static_func m_function; // generic static function pointer |
| 951 | | delegate_gcc_mfp_internal m_rawfunction; // raw member function definition |
| 602 | deferred_cast_func m_caster; // pointer to helper function that does the cast |
| 603 | const char * m_name; // name string |
| 604 | delegate_generic_class * m_object; // pointer to the post-cast object |
| 605 | generic_static_func m_function; // generic static function pointer |
| 606 | delegate_internal_mfp m_rawfunction; // raw member function definition |
| 952 | 607 | }; |
| 953 | 608 | |
| 609 | #endif |
| 954 | 610 | |
| 955 | | // ======================> delegate_2param |
| 956 | 611 | |
| 957 | | template<typename _ReturnType, typename _P1Type, typename _P2Type> |
| 958 | | class delegate_2param : public proto_delegate_2param<_ReturnType, _P1Type, _P2Type> |
| 959 | | { |
| 960 | | typedef _ReturnType (*static_func)(delegate_generic_class *, _P1Type, _P2Type); |
| 961 | | typedef proto_delegate_2param<_ReturnType, _P1Type, _P2Type> proto_base; |
| 612 | //************************************************************************** |
| 613 | // NATURAL SYNTAX |
| 614 | //************************************************************************** |
| 962 | 615 | |
| 963 | | using delegate_base::m_caster; |
| 964 | | using proto_base::m_function; |
| 965 | | using proto_base::m_rawfunction; |
| 616 | // declare the base template |
| 617 | template <typename Signature> |
| 618 | class delegate; |
| 966 | 619 | |
| 620 | // specialize for 0 parameters; we derive from the base class and provide equivalent |
| 621 | // pass-through constructors for each type, as well as an assignment operator |
| 622 | template<typename _ReturnType> |
| 623 | class delegate<_ReturnType ()> : public delegate_base<_ReturnType> |
| 624 | { |
| 625 | typedef delegate_base<_ReturnType> basetype; |
| 967 | 626 | public: |
| 968 | | // constructors |
| 969 | | delegate_2param() |
| 970 | | : m_object(NULL) { } |
| 971 | | |
| 972 | | delegate_2param(proto_base proto) |
| 973 | | : proto_delegate_2param<_ReturnType, _P1Type, _P2Type>(proto), |
| 974 | | m_object(NULL) { } |
| 975 | | |
| 976 | | delegate_2param(proto_base proto, bindable_object &object) |
| 977 | | : proto_delegate_2param<_ReturnType, _P1Type, _P2Type>(proto), |
| 978 | | m_object(NULL) { bind(object); } |
| 979 | | |
| 980 | | // bind the actual object |
| 981 | | void bind(bindable_object &object) |
| 982 | | { |
| 983 | | m_object = (*this->m_caster)(object); |
| 984 | | if (m_rawfunction.u.funcptr != NULL) |
| 985 | | m_function = reinterpret_cast<static_func>(delegate_convert_raw(m_object, m_rawfunction)); |
| 986 | | } |
| 987 | | |
| 988 | | // call the function |
| 989 | | _ReturnType operator()(_P1Type p1, _P2Type p2) const { return (*m_function)(m_object, p1, p2); } |
| 990 | | |
| 991 | | // testing |
| 992 | | bool has_object() const { return (m_object != NULL); } |
| 993 | | bool operator==(const delegate_2param &rhs) const { return (m_object == rhs.m_object && proto_base::operator==(rhs)); } |
| 994 | | |
| 995 | | protected: |
| 996 | | // internal state |
| 997 | | delegate_generic_class *m_object; // pointer to the post-cast object |
| 627 | delegate() : basetype() { } |
| 628 | delegate(const basetype &src) : basetype(src) { } |
| 629 | template<class _FunctionClass> delegate(const basetype &src, _FunctionClass *object) : basetype(src, object) { } |
| 630 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, delegate_param_none, delegate_param_none, delegate_param_none, delegate_param_none>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 631 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, delegate_param_none, delegate_param_none, delegate_param_none, delegate_param_none>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 632 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, delegate_param_none, delegate_param_none, delegate_param_none, delegate_param_none>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 633 | delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; } |
| 998 | 634 | }; |
| 999 | 635 | |
| 1000 | | |
| 1001 | | // ======================> proto_delegate_3param |
| 1002 | | |
| 1003 | | template<typename _ReturnType, typename _P1Type, typename _P2Type, typename _P3Type> |
| 1004 | | class proto_delegate_3param : public delegate_base |
| 636 | // specialize for 1 parameter |
| 637 | template<typename _ReturnType, typename _P1Type> |
| 638 | class delegate<_ReturnType (_P1Type)> : public delegate_base<_ReturnType, _P1Type> |
| 1005 | 639 | { |
| 1006 | | protected: |
| 1007 | | // pointer to a static function which takes the object as a first parameter |
| 1008 | | typedef _ReturnType (*static_func)(delegate_generic_class *, _P1Type, _P2Type, _P3Type); |
| 1009 | | |
| 640 | typedef delegate_base<_ReturnType, _P1Type> basetype; |
| 1010 | 641 | public: |
| 1011 | | // constructors |
| 1012 | | proto_delegate_3param(delegate_gcc_mfp_internal &mfp = delegate_gcc_mfp_null, static_func function = NULL, deferred_cast_func caster = NULL, const char *name = NULL) |
| 1013 | | : delegate_base(caster, name), |
| 1014 | | m_function(function), |
| 1015 | | m_rawfunction(mfp) { } |
| 1016 | | |
| 1017 | | proto_delegate_3param(const proto_delegate_3param &proto) |
| 1018 | | : delegate_base(proto.m_caster, proto.m_name), |
| 1019 | | m_function(proto.m_function), |
| 1020 | | m_rawfunction(proto.m_rawfunction) { } |
| 1021 | | |
| 1022 | | // create a member function proto-delegate |
| 1023 | | template<class _FunctionClass, _ReturnType (_FunctionClass::*_FunctionPtr)(_P1Type, _P2Type, _P3Type)> |
| 1024 | | static proto_delegate_3param _create_member(const char *name = NULL) |
| 1025 | | { |
| 1026 | | union |
| 1027 | | { |
| 1028 | | _ReturnType (_FunctionClass::*mfp)(_P1Type, _P2Type, _P3Type); |
| 1029 | | delegate_gcc_mfp_internal internal; |
| 1030 | | } tempunion; |
| 1031 | | tempunion.mfp = _FunctionPtr; |
| 1032 | | return proto_delegate_3param(tempunion.internal, NULL, &deferred_cast<_FunctionClass>, name); |
| 1033 | | } |
| 1034 | | |
| 1035 | | // create a static function proto-delegate |
| 1036 | | template<class _FunctionClass, _ReturnType (*_FunctionPtr)(_FunctionClass *, _P1Type, _P2Type, _P3Type)> |
| 1037 | | static proto_delegate_3param _create_static(const char *name = NULL) |
| 1038 | | { |
| 1039 | | return proto_delegate_3param(delegate_gcc_mfp_null, reinterpret_cast<static_func>(_FunctionPtr), &deferred_cast<_FunctionClass>, name); |
| 1040 | | } |
| 1041 | | |
| 1042 | | // equality testing |
| 1043 | | bool operator==(const proto_delegate_3param &rhs) const |
| 1044 | | { |
| 1045 | | return (m_function == rhs.m_function && m_caster == rhs.m_caster && |
| 1046 | | m_rawfunction.u.funcptr == rhs.m_rawfunction.u.funcptr && |
| 1047 | | m_rawfunction.this_delta == rhs.m_rawfunction.this_delta); |
| 1048 | | } |
| 1049 | | |
| 1050 | | protected: |
| 1051 | | // internal state |
| 1052 | | static_func m_function; // generic static function pointer |
| 1053 | | delegate_gcc_mfp_internal m_rawfunction; // raw member function definition |
| 642 | delegate() : basetype() { } |
| 643 | delegate(const basetype &src) : basetype(src) { } |
| 644 | template<class _FunctionClass> delegate(const basetype &src, _FunctionClass *object) : basetype(src, object) { } |
| 645 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, delegate_param_none, delegate_param_none, delegate_param_none>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 646 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, delegate_param_none, delegate_param_none, delegate_param_none>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 647 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, delegate_param_none, delegate_param_none, delegate_param_none>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 648 | delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; } |
| 1054 | 649 | }; |
| 1055 | 650 | |
| 1056 | | |
| 1057 | | // ======================> delegate_3param |
| 1058 | | |
| 1059 | | template<typename _ReturnType, typename _P1Type, typename _P2Type, typename _P3Type> |
| 1060 | | class delegate_3param : public proto_delegate_3param<_ReturnType, _P1Type, _P2Type, _P3Type> |
| 651 | // specialize for 2 parameters |
| 652 | template<typename _ReturnType, typename _P1Type, typename _P2Type> |
| 653 | class delegate<_ReturnType (_P1Type, _P2Type)> : public delegate_base<_ReturnType, _P1Type, _P2Type> |
| 1061 | 654 | { |
| 1062 | | typedef _ReturnType (*static_func)(delegate_generic_class *, _P1Type, _P2Type, _P3Type); |
| 1063 | | typedef proto_delegate_3param<_ReturnType, _P1Type, _P2Type, _P3Type> proto_base; |
| 1064 | | |
| 1065 | | using delegate_base::m_caster; |
| 1066 | | using proto_base::m_function; |
| 1067 | | using proto_base::m_rawfunction; |
| 1068 | | |
| 655 | typedef delegate_base<_ReturnType, _P1Type, _P2Type> basetype; |
| 1069 | 656 | public: |
| 1070 | | // constructors |
| 1071 | | delegate_3param() |
| 1072 | | : m_object(NULL) { } |
| 1073 | | |
| 1074 | | delegate_3param(proto_base proto) |
| 1075 | | : proto_delegate_3param<_ReturnType, _P1Type, _P2Type, _P3Type>(proto), |
| 1076 | | m_object(NULL) { } |
| 1077 | | |
| 1078 | | delegate_3param(proto_base proto, bindable_object &object) |
| 1079 | | : proto_delegate_3param<_ReturnType, _P1Type, _P2Type, _P3Type>(proto), |
| 1080 | | m_object(NULL) { bind(object); } |
| 1081 | | |
| 1082 | | // bind the actual object |
| 1083 | | void bind(bindable_object &object) |
| 1084 | | { |
| 1085 | | m_object = (*this->m_caster)(object); |
| 1086 | | if (m_rawfunction.u.funcptr != NULL) |
| 1087 | | m_function = reinterpret_cast<static_func>(delegate_convert_raw(m_object, m_rawfunction)); |
| 1088 | | } |
| 1089 | | |
| 1090 | | // call the function |
| 1091 | | _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3) const { return (*m_function)(m_object, p1, p2, p3); } |
| 1092 | | |
| 1093 | | // testing |
| 1094 | | bool has_object() const { return (m_object != NULL); } |
| 1095 | | bool operator==(const delegate_3param &rhs) const { return (m_object == rhs.m_object && proto_base::operator==(rhs)); } |
| 1096 | | |
| 1097 | | protected: |
| 1098 | | // internal state |
| 1099 | | delegate_generic_class *m_object; // pointer to the post-cast object |
| 657 | delegate() : basetype() { } |
| 658 | delegate(const basetype &src) : basetype(src) { } |
| 659 | template<class _FunctionClass> delegate(const basetype &src, _FunctionClass *object) : basetype(src, object) { } |
| 660 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, delegate_param_none, delegate_param_none>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 661 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, delegate_param_none, delegate_param_none>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 662 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, delegate_param_none, delegate_param_none>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 663 | delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; } |
| 1100 | 664 | }; |
| 1101 | 665 | |
| 1102 | | |
| 1103 | | // ======================> proto_delegate_4param |
| 1104 | | |
| 1105 | | template<typename _ReturnType, typename _P1Type, typename _P2Type, typename _P3Type, typename _P4Type> |
| 1106 | | class proto_delegate_4param : public delegate_base |
| 666 | // specialize for 3 parameters |
| 667 | template<typename _ReturnType, typename _P1Type, typename _P2Type, typename _P3Type> |
| 668 | class delegate<_ReturnType (_P1Type, _P2Type, _P3Type)> : public delegate_base<_ReturnType, _P1Type, _P2Type, _P3Type> |
| 1107 | 669 | { |
| 1108 | | protected: |
| 1109 | | // pointer to a static function which takes the object as a first parameter |
| 1110 | | typedef _ReturnType (*static_func)(delegate_generic_class *, _P1Type, _P2Type, _P3Type, _P4Type); |
| 1111 | | |
| 670 | typedef delegate_base<_ReturnType, _P1Type, _P2Type, _P3Type> basetype; |
| 1112 | 671 | public: |
| 1113 | | // constructors |
| 1114 | | proto_delegate_4param(delegate_gcc_mfp_internal &mfp = delegate_gcc_mfp_null, static_func function = NULL, deferred_cast_func caster = NULL, const char *name = NULL) |
| 1115 | | : delegate_base(caster, name), |
| 1116 | | m_function(function), |
| 1117 | | m_rawfunction(mfp) { } |
| 1118 | | |
| 1119 | | proto_delegate_4param(const proto_delegate_4param &proto) |
| 1120 | | : delegate_base(proto.m_caster, proto.m_name), |
| 1121 | | m_function(proto.m_function), |
| 1122 | | m_rawfunction(proto.m_rawfunction) { } |
| 1123 | | |
| 1124 | | // create a member function proto-delegate |
| 1125 | | template<class _FunctionClass, _ReturnType (_FunctionClass::*_FunctionPtr)(_P1Type, _P2Type, _P3Type, _P4Type)> |
| 1126 | | static proto_delegate_4param _create_member(const char *name = NULL) |
| 1127 | | { |
| 1128 | | union |
| 1129 | | { |
| 1130 | | _ReturnType (_FunctionClass::*mfp)(_P1Type, _P2Type, _P3Type, _P4Type); |
| 1131 | | delegate_gcc_mfp_internal internal; |
| 1132 | | } tempunion; |
| 1133 | | tempunion.mfp = _FunctionPtr; |
| 1134 | | return proto_delegate_4param(tempunion.internal, NULL, &deferred_cast<_FunctionClass>, name); |
| 1135 | | } |
| 1136 | | |
| 1137 | | // create a static function proto-delegate |
| 1138 | | template<class _FunctionClass, _ReturnType (*_FunctionPtr)(_FunctionClass *, _P1Type, _P2Type, _P3Type, _P4Type)> |
| 1139 | | static proto_delegate_4param _create_static(const char *name = NULL) |
| 1140 | | { |
| 1141 | | return proto_delegate_4param(delegate_gcc_mfp_null, reinterpret_cast<static_func>(_FunctionPtr), &deferred_cast<_FunctionClass>, name); |
| 1142 | | } |
| 1143 | | |
| 1144 | | // equality testing |
| 1145 | | bool operator==(const proto_delegate_4param &rhs) const |
| 1146 | | { |
| 1147 | | return (m_function == rhs.m_function && m_caster == rhs.m_caster && |
| 1148 | | m_rawfunction.u.funcptr == rhs.m_rawfunction.u.funcptr && |
| 1149 | | m_rawfunction.this_delta == rhs.m_rawfunction.this_delta); |
| 1150 | | } |
| 1151 | | |
| 1152 | | protected: |
| 1153 | | // internal state |
| 1154 | | static_func m_function; // generic static function pointer |
| 1155 | | delegate_gcc_mfp_internal m_rawfunction; // raw member function definition |
| 672 | delegate() : basetype() { } |
| 673 | delegate(const basetype &src) : basetype(src) { } |
| 674 | template<class _FunctionClass> delegate(const basetype &src, _FunctionClass *object) : basetype(src, object) { } |
| 675 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, delegate_param_none>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 676 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, delegate_param_none>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 677 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, delegate_param_none>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 678 | delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; } |
| 1156 | 679 | }; |
| 1157 | 680 | |
| 1158 | | |
| 1159 | | // ======================> delegate_4param |
| 1160 | | |
| 681 | // specialize for 4 parameters |
| 1161 | 682 | template<typename _ReturnType, typename _P1Type, typename _P2Type, typename _P3Type, typename _P4Type> |
| 1162 | | class delegate_4param : public proto_delegate_4param<_ReturnType, _P1Type, _P2Type, _P3Type, _P4Type> |
| 683 | class delegate<_ReturnType (_P1Type, _P2Type, _P3Type, _P4Type)> : public delegate_base<_ReturnType, _P1Type, _P2Type, _P3Type, _P4Type> |
| 1163 | 684 | { |
| 1164 | | typedef _ReturnType (*static_func)(delegate_generic_class *, _P1Type, _P2Type, _P3Type, _P4Type); |
| 1165 | | typedef proto_delegate_4param<_ReturnType, _P1Type, _P2Type, _P3Type, _P4Type> proto_base; |
| 1166 | | |
| 1167 | | using delegate_base::m_caster; |
| 1168 | | using proto_base::m_function; |
| 1169 | | using proto_base::m_rawfunction; |
| 1170 | | |
| 685 | typedef delegate_base<_ReturnType, _P1Type, _P2Type, _P3Type, _P4Type> basetype; |
| 1171 | 686 | public: |
| 1172 | | // constructors |
| 1173 | | delegate_4param() |
| 1174 | | : m_object(NULL) { } |
| 1175 | | |
| 1176 | | delegate_4param(proto_base proto) |
| 1177 | | : proto_delegate_4param<_ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>(proto), |
| 1178 | | m_object(NULL) { } |
| 1179 | | |
| 1180 | | delegate_4param(proto_base proto, bindable_object &object) |
| 1181 | | : proto_delegate_4param<_ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>(proto), |
| 1182 | | m_object(NULL) { bind(object); } |
| 1183 | | |
| 1184 | | // bind the actual object |
| 1185 | | void bind(bindable_object &object) |
| 1186 | | { |
| 1187 | | m_object = (*this->m_caster)(object); |
| 1188 | | if (m_rawfunction.u.funcptr != NULL) |
| 1189 | | m_function = reinterpret_cast<static_func>(delegate_convert_raw(m_object, m_rawfunction)); |
| 1190 | | } |
| 1191 | | |
| 1192 | | // call the function |
| 1193 | | _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4) const { return (*m_function)(m_object, p1, p2, p3, p4); } |
| 1194 | | |
| 1195 | | // testing |
| 1196 | | bool has_object() const { return (m_object != NULL); } |
| 1197 | | bool operator==(const delegate_4param &rhs) const { return (m_object == rhs.m_object && proto_base::operator==(rhs)); } |
| 1198 | | |
| 1199 | | protected: |
| 1200 | | // internal state |
| 1201 | | delegate_generic_class *m_object; // pointer to the post-cast object |
| 687 | delegate() : basetype() { } |
| 688 | delegate(const basetype &src) : basetype(src) { } |
| 689 | template<class _FunctionClass> delegate(const basetype &src, _FunctionClass *object) : basetype(src, object) { } |
| 690 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 691 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 692 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 693 | delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; } |
| 1202 | 694 | }; |
| 1203 | 695 | |
| 1204 | 696 | |
| 1205 | | |
| 1206 | | #endif |
| 1207 | | |
| 1208 | | |
| 1209 | 697 | #endif /* __DELEGATE_H__ */ |
src/mess/machine/nes_pcb.c
| r11224 | r11225 | |
| 11650 | 11650 | struct nes_memory_accessor |
| 11651 | 11651 | { |
| 11652 | 11652 | write8_space_func write; |
| 11653 | const char *write_name; |
| 11653 | 11654 | read8_space_func read; |
| 11655 | const char *read_name; |
| 11654 | 11656 | }; |
| 11655 | 11657 | |
| 11656 | 11658 | typedef struct _nes_pcb_intf nes_pcb_intf; |
| r11224 | r11225 | |
| 11666 | 11668 | }; |
| 11667 | 11669 | |
| 11668 | 11670 | #define NES_NOACCESS \ |
| 11669 | | {NULL, NULL} |
| 11671 | {FUNC_NULL, FUNC_NULL} |
| 11670 | 11672 | |
| 11671 | 11673 | #define NES_READONLY(a) \ |
| 11672 | | {NULL, a} |
| 11674 | {FUNC_NULL, FUNC(a)} |
| 11673 | 11675 | |
| 11674 | 11676 | #define NES_WRITEONLY(a) \ |
| 11675 | | {a, NULL} |
| 11677 | {FUNC(a), FUNC_NULL} |
| 11676 | 11678 | |
| 11677 | 11679 | static WRITE8_HANDLER( dummy_l_w ) |
| 11678 | 11680 | { |
| r11224 | r11225 | |
| 11733 | 11735 | { STD_TXROM, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(txrom_w), NULL, NULL, mmc3_irq }, |
| 11734 | 11736 | { STD_TVROM, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(txrom_w), NULL, NULL, mmc3_irq }, |
| 11735 | 11737 | { STD_TKROM, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(txrom_w), NULL, NULL, mmc3_irq }, |
| 11736 | | { STD_HKROM, NES_NOACCESS, {hkrom_m_w, hkrom_m_r}, NES_WRITEONLY(hkrom_w), NULL, NULL, mmc3_irq }, |
| 11738 | { STD_HKROM, NES_NOACCESS, {FUNC(hkrom_m_w), FUNC(hkrom_m_r)}, NES_WRITEONLY(hkrom_w), NULL, NULL, mmc3_irq }, |
| 11737 | 11739 | { STD_TQROM, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(tqrom_w), NULL, NULL, mmc3_irq }, |
| 11738 | 11740 | { STD_TXSROM, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(txsrom_w), NULL, NULL, mmc3_irq }, |
| 11739 | 11741 | { STD_DXROM, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(dxrom_w), NULL, NULL, NULL }, |
| r11224 | r11225 | |
| 11742 | 11744 | { NAMCOT_3425, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(namcot3425_w), NULL, NULL, NULL }, |
| 11743 | 11745 | { NAMCOT_3446, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(namcot3446_w), NULL, NULL, NULL }, |
| 11744 | 11746 | { NAMCOT_3453, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(namcot3453_w), NULL, NULL, NULL }, |
| 11745 | | { STD_EXROM, {exrom_l_w, exrom_l_r}, NES_NOACCESS, NES_NOACCESS, NULL, NULL, mmc5_irq }, |
| 11747 | { STD_EXROM, {FUNC(exrom_l_w), FUNC(exrom_l_r)}, NES_NOACCESS, NES_NOACCESS, NULL, NULL, mmc5_irq }, |
| 11746 | 11748 | { NES_QJ, NES_NOACCESS, NES_WRITEONLY(qj_m_w), NES_WRITEONLY(txrom_w), NULL, NULL, mmc3_irq }, |
| 11747 | 11749 | { PAL_ZZ, NES_NOACCESS, NES_WRITEONLY(zz_m_w), NES_WRITEONLY(txrom_w), NULL, NULL, mmc3_irq }, |
| 11748 | 11750 | { UXROM_CC, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(uxrom_cc_w), NULL, NULL, NULL }, |
| r11224 | r11225 | |
| 11775 | 11777 | { KONAMI_VRC4, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(konami_vrc4_w), NULL, NULL, konami_irq }, |
| 11776 | 11778 | { KONAMI_VRC6, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(konami_vrc6_w), NULL, NULL, konami_irq }, |
| 11777 | 11779 | { KONAMI_VRC7, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(konami_vrc7_w), NULL, NULL, konami_irq }, |
| 11778 | | { NAMCOT_163, {namcot163_l_w, namcot163_l_r}, NES_NOACCESS, NES_WRITEONLY(namcot163_w), NULL, NULL, namcot_irq }, |
| 11780 | { NAMCOT_163, {FUNC(namcot163_l_w), FUNC(namcot163_l_r) }, NES_NOACCESS, NES_WRITEONLY(namcot163_w), NULL, NULL, namcot_irq }, |
| 11779 | 11781 | { SUNSOFT_1, NES_NOACCESS, NES_WRITEONLY(sunsoft1_m_w), NES_NOACCESS, NULL, NULL, NULL }, |
| 11780 | 11782 | { SUNSOFT_2, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(sunsoft2_w), NULL, NULL, NULL }, |
| 11781 | 11783 | { SUNSOFT_3, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(sunsoft3_w), NULL, NULL, sunsoft3_irq }, |
| 11782 | 11784 | { TAITO_TC0190FMC, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(tc0190fmc_w), NULL, NULL, NULL }, |
| 11783 | 11785 | { TAITO_TC0190FMCP, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(tc0190fmc_p16_w), NULL, NULL, mmc3_irq }, |
| 11784 | | { TAITO_X1_005, NES_NOACCESS, {x1005_m_w, x1005_m_r}, NES_NOACCESS, NULL, NULL, NULL }, |
| 11785 | | { TAITO_X1_005_A, NES_NOACCESS, {x1005a_m_w, x1005_m_r}, NES_NOACCESS, NULL, NULL, NULL }, |
| 11786 | | { TAITO_X1_017, NES_NOACCESS, {x1017_m_w, x1017_m_r}, NES_NOACCESS, NULL, NULL, NULL }, |
| 11786 | { TAITO_X1_005, NES_NOACCESS, {FUNC(x1005_m_w), FUNC(x1005_m_r)}, NES_NOACCESS, NULL, NULL, NULL }, |
| 11787 | { TAITO_X1_005_A, NES_NOACCESS, {FUNC(x1005a_m_w), FUNC(x1005_m_r)}, NES_NOACCESS, NULL, NULL, NULL }, |
| 11788 | { TAITO_X1_017, NES_NOACCESS, {FUNC(x1017_m_w), FUNC(x1017_m_r)}, NES_NOACCESS, NULL, NULL, NULL }, |
| 11787 | 11789 | // |
| 11788 | 11790 | { AGCI_50282, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(agci_50282_w), NULL, NULL, NULL }, |
| 11789 | 11791 | { ACTENT_ACT52, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(ae_act52_w), NULL, NULL, NULL }, |
| r11224 | r11225 | |
| 11797 | 11799 | { CAMERICA_BF9097, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(bf9093_w), NULL, NULL, NULL }, |
| 11798 | 11800 | { CAMERICA_BF9096, NES_NOACCESS, NES_WRITEONLY(bf9096_w), NES_WRITEONLY(bf9096_w), NULL, NULL, NULL }, |
| 11799 | 11801 | { CAMERICA_GOLDENFIVE, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(golden5_w), NULL, NULL, NULL }, |
| 11800 | | { CONY_BOARD, {cony_l_w, cony_l_r}, NES_NOACCESS, NES_WRITEONLY(cony_w), NULL, NULL, sunsoft3_irq }, |
| 11802 | { CONY_BOARD, {FUNC(cony_l_w), FUNC(cony_l_r)}, NES_NOACCESS, NES_WRITEONLY(cony_w), NULL, NULL, sunsoft3_irq }, |
| 11801 | 11803 | { DREAMTECH_BOARD, NES_WRITEONLY(dreamtech_l_w), NES_NOACCESS, NES_NOACCESS, NULL, NULL, NULL }, |
| 11802 | 11804 | { FUTUREMEDIA_BOARD, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(futuremedia_w), NULL, NULL, futuremedia_irq }, |
| 11803 | | { FUKUTAKE_BOARD, {fukutake_l_w, fukutake_l_r}, NES_NOACCESS, NES_NOACCESS, NULL, NULL, NULL }, |
| 11804 | | { GOUDER_37017, {gouder_sf4_l_w, gouder_sf4_l_r}, NES_NOACCESS, NES_WRITEONLY(txrom_w), NULL, NULL, mmc3_irq }, |
| 11805 | { FUKUTAKE_BOARD, {FUNC(fukutake_l_w), FUNC(fukutake_l_r)}, NES_NOACCESS, NES_NOACCESS, NULL, NULL, NULL }, |
| 11806 | { GOUDER_37017, {FUNC(gouder_sf4_l_w), FUNC(gouder_sf4_l_r)}, NES_NOACCESS, NES_WRITEONLY(txrom_w), NULL, NULL, mmc3_irq }, |
| 11805 | 11807 | { HENGEDIANZI_BOARD, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(henggedianzi_w), NULL, NULL, NULL }, |
| 11806 | 11808 | { HENGEDIANZI_XJZB, NES_WRITEONLY(heng_xjzb_l_w), NES_NOACCESS, NES_WRITEONLY(heng_xjzb_w), NULL, NULL, NULL }, |
| 11807 | 11809 | { HES6IN1_BOARD, NES_WRITEONLY(hes6in1_l_w), NES_NOACCESS, NES_NOACCESS, NULL, NULL, NULL }, |
| 11808 | 11810 | { HES_BOARD, NES_WRITEONLY(hes_l_w), NES_NOACCESS, NES_NOACCESS, NULL, NULL, NULL }, |
| 11809 | 11811 | { HOSENKAN_BOARD, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(hosenkan_w), NULL, NULL, mmc3_irq }, |
| 11810 | 11812 | { KAISER_KS7058, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(ks7058_w), NULL, NULL, NULL }, |
| 11811 | | { KAISER_KS7022, NES_NOACCESS, NES_NOACCESS, {ks7022_w, ks7022_r}, NULL, NULL, NULL }, |
| 11813 | { KAISER_KS7022, NES_NOACCESS, NES_NOACCESS, {FUNC(ks7022_w), FUNC(ks7022_r)}, NULL, NULL, NULL }, |
| 11812 | 11814 | { KAISER_KS7032, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(ks7032_w), NULL, NULL, ks7032_irq }, |
| 11813 | 11815 | { KAISER_KS202, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(ks202_w), NULL, NULL, ks7032_irq }, |
| 11814 | 11816 | { KAISER_KS7017, NES_WRITEONLY(ks7017_l_w), NES_NOACCESS, NES_NOACCESS, NULL, NULL, mmc_fds_irq }, |
| 11815 | | { KAY_PANDAPRINCE, {kay_pp_l_w, kay_pp_l_r}, NES_NOACCESS, NES_WRITEONLY(kay_pp_w), NULL, NULL, mmc3_irq }, |
| 11817 | { KAY_PANDAPRINCE, {FUNC(kay_pp_l_w), FUNC(kay_pp_l_r)}, NES_NOACCESS, NES_WRITEONLY(kay_pp_w), NULL, NULL, mmc3_irq }, |
| 11816 | 11818 | { KASING_BOARD, NES_NOACCESS, NES_WRITEONLY(kasing_m_w), NES_WRITEONLY(txrom_w), NULL, NULL, mmc3_irq }, |
| 11817 | | { SACHEN_74LS374, {sachen_74x374_l_w, sachen_74x374_l_r}, NES_NOACCESS, NES_NOACCESS, NULL, NULL, NULL }, |
| 11819 | { SACHEN_74LS374, {FUNC(sachen_74x374_l_w), FUNC(sachen_74x374_l_r)}, NES_NOACCESS, NES_NOACCESS, NULL, NULL, NULL }, |
| 11818 | 11820 | { SACHEN_74LS374_A, NES_WRITEONLY(sachen_74x374a_l_w), NES_NOACCESS, NES_NOACCESS, NULL, NULL, NULL }, |
| 11819 | 11821 | { SACHEN_8259A, NES_WRITEONLY(s8259_l_w), NES_WRITEONLY(s8259_m_w), NES_NOACCESS, NULL, NULL, NULL }, |
| 11820 | 11822 | { SACHEN_8259B, NES_WRITEONLY(s8259_l_w), NES_WRITEONLY(s8259_m_w), NES_NOACCESS, NULL, NULL, NULL }, |
| r11224 | r11225 | |
| 11827 | 11829 | { SACHEN_SA72008, NES_WRITEONLY(sa72008_l_w), NES_NOACCESS, NES_NOACCESS, NULL, NULL, NULL }, |
| 11828 | 11830 | { SACHEN_TCA01, NES_READONLY(tca01_l_r), NES_NOACCESS, NES_NOACCESS, NULL, NULL, NULL }, |
| 11829 | 11831 | { SACHEN_TCU01, NES_WRITEONLY(tcu01_l_w), NES_WRITEONLY(tcu01_m_w), NES_WRITEONLY(tcu01_w), NULL, NULL, NULL }, |
| 11830 | | { SACHEN_TCU02, {tcu02_l_w, tcu02_l_r}, NES_NOACCESS, NES_NOACCESS, NULL, NULL, NULL }, |
| 11832 | { SACHEN_TCU02, {FUNC(tcu02_l_w), FUNC(tcu02_l_r)}, NES_NOACCESS, NES_NOACCESS, NULL, NULL, NULL }, |
| 11831 | 11833 | { SUBOR_TYPE0, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(subor0_w), NULL, NULL, NULL }, |
| 11832 | 11834 | { SUBOR_TYPE1, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(subor1_w), NULL, NULL, NULL }, |
| 11833 | 11835 | { MAGICSERIES_MD, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(magics_md_w), NULL, NULL, NULL }, |
| 11834 | | { NANJING_BOARD, {nanjing_l_w, nanjing_l_r}, NES_NOACCESS, NES_NOACCESS, NULL, NULL, nanjing_irq }, |
| 11836 | { NANJING_BOARD, {FUNC(nanjing_l_w), FUNC(nanjing_l_r)}, NES_NOACCESS, NES_NOACCESS, NULL, NULL, nanjing_irq }, |
| 11835 | 11837 | { NITRA_TDA, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(nitra_w), NULL, NULL, mmc3_irq }, |
| 11836 | 11838 | { NTDEC_ASDER, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(ntdec_asder_w), NULL, NULL, NULL }, |
| 11837 | 11839 | { NTDEC_FIGHTINGHERO, NES_NOACCESS, NES_WRITEONLY(ntdec_fh_m_w), NES_NOACCESS, NULL, NULL, NULL }, |
| 11838 | 11840 | { OPENCORP_DAOU306, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(daou306_w), NULL, NULL, NULL }, |
| 11839 | 11841 | { RCM_GS2015, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(gs2015_w), NULL, NULL, NULL }, |
| 11840 | 11842 | { RCM_TETRISFAMILY, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(rcm_tf_w), NULL, NULL, NULL }, |
| 11841 | | { REXSOFT_DBZ5, {rex_dbz_l_w, rex_dbz_l_r}, NES_READONLY(rex_dbz_l_r), NES_WRITEONLY(txrom_w), NULL, NULL, mmc3_irq }, |
| 11843 | { REXSOFT_DBZ5, {FUNC(rex_dbz_l_w), FUNC(rex_dbz_l_r)}, NES_READONLY(rex_dbz_l_r), NES_WRITEONLY(txrom_w), NULL, NULL, mmc3_irq }, |
| 11842 | 11844 | { REXSOFT_SL1632, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(rex_sl1632_w), NULL, NULL, mmc3_irq }, |
| 11843 | 11845 | { RUMBLESTATION_BOARD, NES_NOACCESS, NES_WRITEONLY(rumblestation_m_w), NES_WRITEONLY(rumblestation_w), NULL, NULL, NULL }, |
| 11844 | 11846 | { SOMERI_SL12, NES_WRITEONLY(someri_l_w), NES_NOACCESS, NES_WRITEONLY(someri_w), NULL, NULL, mmc3_irq }, |
| r11224 | r11225 | |
| 11847 | 11849 | { TENGEN_800008, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(tengen_800008_w), NULL, NULL, NULL }, |
| 11848 | 11850 | { TENGEN_800032, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(tengen_800032_w), NULL, NULL, tengen_800032_irq }, |
| 11849 | 11851 | { TENGEN_800037, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(tengen_800037_w), NULL, NULL, tengen_800032_irq }, |
| 11850 | | { TXC_22211A, {txc_22211_l_w, txc_22211_l_r}, NES_NOACCESS, NES_WRITEONLY(txc_22211_w), NULL, NULL, NULL }, |
| 11851 | | { TXC_22211B, {txc_22211_l_w, txc_22211_l_r}, NES_NOACCESS, NES_WRITEONLY(txc_22211b_w), NULL, NULL, NULL }, |
| 11852 | | { TXC_22211C, {txc_22211_l_w, txc_22211c_l_r}, NES_NOACCESS, NES_WRITEONLY(txc_22211_w), NULL, NULL, NULL }, |
| 11852 | { TXC_22211A, {FUNC(txc_22211_l_w), FUNC(txc_22211_l_r)}, NES_NOACCESS, NES_WRITEONLY(txc_22211_w), NULL, NULL, NULL }, |
| 11853 | { TXC_22211B, {FUNC(txc_22211_l_w), FUNC(txc_22211_l_r)}, NES_NOACCESS, NES_WRITEONLY(txc_22211b_w), NULL, NULL, NULL }, |
| 11854 | { TXC_22211C, {FUNC(txc_22211_l_w), FUNC(txc_22211c_l_r)}, NES_NOACCESS, NES_WRITEONLY(txc_22211_w), NULL, NULL, NULL }, |
| 11853 | 11855 | { TXC_TW, NES_WRITEONLY(txc_tw_l_w), NES_WRITEONLY(txc_tw_m_w), NES_WRITEONLY(txrom_w), NULL, NULL, mmc3_irq }, |
| 11854 | 11856 | { TXC_STRIKEWOLF, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(txc_strikewolf_w), NULL, NULL, NULL }, |
| 11855 | 11857 | { TXC_MXMDHTWO, NES_READONLY(txc_mxmdhtwo_l_r), NES_NOACCESS, NES_WRITEONLY(txc_mxmdhtwo_w), NULL, NULL, NULL }, |
| r11224 | r11225 | |
| 11877 | 11879 | { UNL_CC21, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(unl_cc21_w), NULL, NULL, NULL }, |
| 11878 | 11880 | { UNL_KOF97, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(unl_kof97_w), NULL, NULL, mmc3_irq }, |
| 11879 | 11881 | { UNL_T230, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(unl_t230_w), NULL, NULL, konami_irq }, |
| 11880 | | { UNL_KOF96, {kof96_l_w, kof96_l_r}, NES_NOACCESS, NES_WRITEONLY(kof96_w), NULL, NULL, mmc3_irq }, |
| 11882 | { UNL_KOF96, {FUNC(kof96_l_w), FUNC(kof96_l_r)}, NES_NOACCESS, NES_WRITEONLY(kof96_w), NULL, NULL, mmc3_irq }, |
| 11881 | 11883 | { UNL_MK2, NES_NOACCESS, NES_WRITEONLY(mk2_m_w), NES_NOACCESS, NULL, NULL, mmc3_irq }, |
| 11882 | 11884 | { UNL_N625092, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(n625092_w), NULL, NULL, NULL }, |
| 11883 | 11885 | { UNL_SC127, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(sc127_w), NULL, NULL, sc127_irq }, |
| r11224 | r11225 | |
| 11886 | 11888 | { UNL_XZY, NES_WRITEONLY(unl_xzy_l_w), NES_NOACCESS, NES_NOACCESS, NULL, NULL, NULL }, |
| 11887 | 11889 | { UNL_RACERMATE, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(unl_racmate_w), NULL, NULL, NULL }, |
| 11888 | 11890 | { UNL_STUDYNGAME, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(sng32_w), NULL, NULL, NULL }, |
| 11889 | | { UNL_603_5052, {unl_6035052_extra_w, unl_6035052_extra_r}, {unl_6035052_extra_w, unl_6035052_extra_r}, NES_WRITEONLY(txrom_w), NULL, NULL, mmc3_irq }, |
| 11891 | { UNL_603_5052, {FUNC(unl_6035052_extra_w), FUNC(unl_6035052_extra_r)}, {FUNC(unl_6035052_extra_w), FUNC(unl_6035052_extra_r)}, NES_WRITEONLY(txrom_w), NULL, NULL, mmc3_irq }, |
| 11890 | 11892 | { UNL_EDU2K, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(edu2k_w), NULL, NULL, NULL }, |
| 11891 | 11893 | { UNL_SHJY3, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(shjy3_w), NULL, NULL, shjy3_irq }, |
| 11892 | | { UNL_H2288, {h2288_l_w, h2288_l_r}, NES_NOACCESS, NES_WRITEONLY(h2288_w), NULL, NULL, mmc3_irq }, |
| 11894 | { UNL_H2288, {FUNC(h2288_l_w), FUNC(h2288_l_r)}, NES_NOACCESS, NES_WRITEONLY(h2288_w), NULL, NULL, mmc3_irq }, |
| 11893 | 11895 | // |
| 11894 | 11896 | { BTL_AISENSHINICOL, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(btl_mariobaby_w), NULL, NULL, NULL }, |
| 11895 | 11897 | { BTL_DRAGONNINJA, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(btl_dn_w), NULL, NULL, btl_dn_irq }, |
| r11224 | r11225 | |
| 11899 | 11901 | { BTL_SMB3, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(btl_smb3_w), NULL, NULL, btl_smb3_irq }, |
| 11900 | 11902 | { BTL_SUPERBROS11, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(btl_smb11_w), NULL, NULL, mmc3_irq }, |
| 11901 | 11903 | { BTL_TOBIDASE, NES_WRITEONLY(btl_tobi_l_w), NES_NOACCESS, NES_NOACCESS, NULL, NULL, NULL }, |
| 11902 | | { BTL_PIKACHUY2K, NES_NOACCESS, {btl_pika_y2k_m_w, btl_pika_y2k_m_r}, NES_WRITEONLY(btl_pika_y2k_w), NULL, NULL, mmc3_irq }, |
| 11904 | { BTL_PIKACHUY2K, NES_NOACCESS, {FUNC(btl_pika_y2k_m_w), FUNC(btl_pika_y2k_m_r)}, NES_WRITEONLY(btl_pika_y2k_w), NULL, NULL, mmc3_irq }, |
| 11903 | 11905 | { WHIRLWIND_2706, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(whirl2706_w), NULL, NULL, NULL }, |
| 11904 | 11906 | // |
| 11905 | 11907 | { BMC_190IN1, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(bmc_190in1_w), NULL, NULL, NULL }, |
| r11224 | r11225 | |
| 11938 | 11940 | { BMC_15IN1, NES_NOACCESS, NES_WRITEONLY(bmc_15in1_m_w), NES_WRITEONLY(txrom_w), NULL, NULL, mmc3_irq }, |
| 11939 | 11941 | { BMC_BALLGAMES_11IN1, NES_NOACCESS, NES_WRITEONLY(bmc_ball11_m_w), NES_WRITEONLY(bmc_ball11_w), NULL, NULL, NULL }, |
| 11940 | 11942 | { BMC_GOLDENCARD_6IN1, NES_WRITEONLY(bmc_gc6in1_l_w), NES_NOACCESS, NES_WRITEONLY(bmc_gc6in1_w), NULL, NULL, mmc3_irq }, |
| 11941 | | { BMC_VT5201, NES_NOACCESS, NES_NOACCESS, {bmc_vt5201_w, bmc_vt5201_r}, NULL, NULL, NULL }, |
| 11943 | { BMC_VT5201, NES_NOACCESS, NES_NOACCESS, {FUNC(bmc_vt5201_w), FUNC(bmc_vt5201_r)}, NULL, NULL, NULL }, |
| 11942 | 11944 | { BMC_BENSHENG_BS5, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(bmc_bs5_w), NULL, NULL, NULL }, |
| 11943 | 11945 | { BMC_810544, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(bmc_810544_w), NULL, NULL, NULL }, |
| 11944 | 11946 | { BMC_NTD_03, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(bmc_ntd03_w), NULL, NULL, NULL }, |
| 11945 | | { BMC_G63IN1, NES_NOACCESS, NES_NOACCESS, {bmc_gb63_w, bmc_gb63_r}, NULL, NULL, NULL }, |
| 11947 | { BMC_G63IN1, NES_NOACCESS, NES_NOACCESS, {FUNC(bmc_gb63_w), FUNC(bmc_gb63_r)}, NULL, NULL, NULL }, |
| 11946 | 11948 | { BMC_FK23C, NES_WRITEONLY(fk23c_l_w), NES_NOACCESS, NES_WRITEONLY(fk23c_w), NULL, NULL, mmc3_irq }, |
| 11947 | 11949 | { BMC_FK23CA, NES_WRITEONLY(fk23c_l_w), NES_NOACCESS, NES_WRITEONLY(fk23c_w), NULL, NULL, mmc3_irq }, |
| 11948 | 11950 | { BMC_PJOY84, NES_NOACCESS, NES_WRITEONLY(pjoy84_m_w), NES_WRITEONLY(txrom_w), NULL, NULL, mmc3_irq }, |
| r11224 | r11225 | |
| 11951 | 11953 | { FFE_MAPPER8, NES_NOACCESS, NES_NOACCESS, NES_WRITEONLY(mapper8_w), NULL, NULL, NULL }, |
| 11952 | 11954 | { FFE_MAPPER17, NES_WRITEONLY(mapper17_l_w), NES_NOACCESS, NES_NOACCESS, NULL, NULL, ffe_irq }, |
| 11953 | 11955 | // for debug and development |
| 11954 | | { UNKNOWN_BOARD, {dummy_l_w, dummy_l_r}, {dummy_m_w, dummy_m_r}, {dummy_w, dummy_r}, NULL, NULL, NULL }, |
| 11956 | { UNKNOWN_BOARD, {FUNC(dummy_l_w), FUNC(dummy_l_r)}, {FUNC(dummy_m_w), FUNC(dummy_m_r)}, {FUNC(dummy_w), FUNC(dummy_r)}, NULL, NULL, NULL }, |
| 11955 | 11957 | // |
| 11956 | 11958 | { UNSUPPORTED_BOARD, NES_NOACCESS, NES_NOACCESS, NES_NOACCESS, NULL, NULL, NULL }, |
| 11957 | 11959 | // |
| r11224 | r11225 | |
| 11980 | 11982 | if (intf) |
| 11981 | 11983 | { |
| 11982 | 11984 | state->m_mmc_write_low = intf->mmc_l.write; |
| 11985 | state->m_mmc_write_low_name = intf->mmc_l.write_name; |
| 11983 | 11986 | state->m_mmc_write_mid = intf->mmc_m.write; |
| 11987 | state->m_mmc_write_mid_name = intf->mmc_m.write_name; |
| 11984 | 11988 | state->m_mmc_write = intf->mmc_h.write; |
| 11989 | state->m_mmc_write_name = intf->mmc_h.write_name; |
| 11985 | 11990 | state->m_mmc_read_low = intf->mmc_l.read; |
| 11991 | state->m_mmc_read_low_name = intf->mmc_l.read_name; |
| 11986 | 11992 | state->m_mmc_read_mid = intf->mmc_m.read; // in progress |
| 11993 | state->m_mmc_read_mid_name = intf->mmc_m.read_name; |
| 11987 | 11994 | state->m_mmc_read = intf->mmc_h.read; // in progress |
| 11995 | state->m_mmc_read_name = intf->mmc_h.read_name; |
| 11988 | 11996 | ppu2c0x_set_latch(ppu, intf->mmc_ppu_latch); |
| 11989 | 11997 | } |
| 11990 | 11998 | else |