| Previous | 15994 Revisions | Next |
| r14224 Friday 27th January, 2012 at 07:43:30 UTC by Miodrag Milanović |
|---|
| Sync with MAME r15181 (no whatsnew) |
| [src/emu] | device.c device.h emualloc.c emualloc.h emutempl.h machine.c machine.h render.h romload.c ui.c video.c video.h |
| [src/emu/machine] | generic.c |
| [src/mame/drivers] | asuka.c bbusters.c champbwl.c crystal.c ddenlovr.c dec8.c dreamwld.c dynduke.c funkball.c galpanic.c gottlieb.c hvyunit.c lemmings.c n8080.c psikyo.c raiden.c sandscrp.c seta.c slapfght.c snowbros.c twin16.c wwfwfest.c |
| [src/mame/includes] | gottlieb.h lemmings.h |
| [src/mame/video] | airbustr.c armedf.c baraduke.c bionicc.c blktiger.c commando.c cps1.c crshrace.c deco_mlc.c decospr.c djboy.c dooyong.c exedexes.c gng.c gottlieb.c lastduel.c lemmings.c macrossp.c mcatadv.c namcos1.c namcos86.c othldrby.c pgm.c psikyo.c psikyosh.c seta.c sidearms.c simpl156.c srumbler.c taito_b.c taito_f2.c taito_f3.c taito_l.c taotaido.c tceptor.c tigeroad.c tnzs.c toaplan1.c toki.c twincobr.c tx1.c |
| r14223 | r14224 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | VIDEO_START( lemmings ); |
| 36 | 36 | SCREEN_VBLANK( lemmings ); |
| 37 | SCREEN_UPDATE_IND16( lemmings ); | |
| 37 | SCREEN_UPDATE_RGB32( lemmings ); | |
| 38 |
| r14223 | r14224 | |
|---|---|---|
| 86 | 86 | |
| 87 | 87 | VIDEO_START( gottlieb ); |
| 88 | 88 | VIDEO_START( screwloo ); |
| 89 | SCREEN_UPDATE_ | |
| 89 | SCREEN_UPDATE_RGB32( gottlieb ); |
| r14223 | r14224 | |
|---|---|---|
| 253 | 253 | |
| 254 | 254 | SCREEN_VBLANK( blktiger ) |
| 255 | 255 | { |
| 256 | // falling edge | |
| 257 | if (!vblank_on) | |
| 256 | // rising edge | |
| 257 | if (vblank_on) | |
| 258 | 258 | { |
| 259 | 259 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 260 | 260 |
| r14223 | r14224 | |
|---|---|---|
| 496 | 496 | |
| 497 | 497 | SCREEN_VBLANK( mlc ) |
| 498 | 498 | { |
| 499 | // falling edge | |
| 500 | if (!vblank_on) | |
| 499 | // rising edge | |
| 500 | if (vblank_on) | |
| 501 | 501 | { |
| 502 | 502 | deco_mlc_state *state = screen.machine().driver_data<deco_mlc_state>(); |
| 503 | 503 | /* Spriteram is definitely double buffered, as the vram lookup tables |
| r14223 | r14224 | |
|---|---|---|
| 17 | 17 | state->m_pf2_rowscroll = auto_alloc_array_clear(machine, UINT16, 0x800/2); |
| 18 | 18 | state->m_spriteram = auto_alloc_array_clear(machine, UINT16, 0x2000/2); |
| 19 | 19 | machine.generic.paletteram.u16 = auto_alloc_array_clear(machine, UINT16, 0x1000/2); |
| 20 | ||
| 21 | memset(state->m_spriteram, 0xff, 0x2000); | |
| 20 | 22 | |
| 21 | 23 | /* and register the allocated ram so that save states still work */ |
| 22 | 24 | state->save_pointer(NAME(state->m_pf1_rowscroll), 0x800/2); |
| r14223 | r14224 | |
| 41 | 43 | //FIXME: flip_screen_x should not be written! |
| 42 | 44 | flip_screen_set_no_update(screen.machine(), 1); |
| 43 | 45 | |
| 44 | screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, state->m_spriteram, 0x | |
| 46 | screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, state->m_spriteram, 0x1400/4); // 0x1400/4 seems | |
| 45 | 47 | return 0; |
| 46 | 48 | } |
| r14223 | r14224 | |
|---|---|---|
| 518 | 518 | |
| 519 | 519 | SCREEN_VBLANK( toaplan0 ) |
| 520 | 520 | { |
| 521 | // falling edge | |
| 522 | if (!vblank_on) | |
| 521 | // rising edge | |
| 522 | if (vblank_on) | |
| 523 | 523 | { |
| 524 | 524 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 525 | 525 |
| r14223 | r14224 | |
|---|---|---|
| 247 | 247 | |
| 248 | 248 | SCREEN_VBLANK( exedexes ) |
| 249 | 249 | { |
| 250 | // falling edge | |
| 251 | if (!vblank_on) | |
| 250 | // rising edge | |
| 251 | if (vblank_on) | |
| 252 | 252 | { |
| 253 | 253 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 254 | 254 |
| r14223 | r14224 | |
|---|---|---|
| 433 | 433 | |
| 434 | 434 | SCREEN_VBLANK( armedf ) |
| 435 | 435 | { |
| 436 | // falling edge | |
| 437 | if (!vblank_on) | |
| 436 | // rising edge | |
| 437 | if (vblank_on) | |
| 438 | 438 | { |
| 439 | 439 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 440 | 440 |
| r14223 | r14224 | |
|---|---|---|
| 505 | 505 | |
| 506 | 506 | SCREEN_VBLANK( taitob ) |
| 507 | 507 | { |
| 508 | // falling edge | |
| 509 | if (!vblank_on) | |
| 508 | // rising edge | |
| 509 | if (vblank_on) | |
| 510 | 510 | { |
| 511 | 511 | taitob_state *state = screen.machine().driver_data<taitob_state>(); |
| 512 | 512 | UINT8 video_control = tc0180vcu_get_videoctrl(state->m_tc0180vcu, 0); |
| r14223 | r14224 | |
|---|---|---|
| 398 | 398 | |
| 399 | 399 | SCREEN_VBLANK( namcos86 ) |
| 400 | 400 | { |
| 401 | // falling edge | |
| 402 | if (!vblank_on) | |
| 401 | // rising edge | |
| 402 | if (vblank_on) | |
| 403 | 403 | { |
| 404 | 404 | namcos86_state *state = screen.machine().driver_data<namcos86_state>(); |
| 405 | 405 | if (state->m_copy_sprites) |
| r14223 | r14224 | |
|---|---|---|
| 2951 | 2951 | |
| 2952 | 2952 | SCREEN_VBLANK( cps1 ) |
| 2953 | 2953 | { |
| 2954 | // falling edge | |
| 2955 | if (!vblank_on) | |
| 2954 | // rising edge | |
| 2955 | if (vblank_on) | |
| 2956 | 2956 | { |
| 2957 | 2957 | cps_state *state = screen.machine().driver_data<cps_state>(); |
| 2958 | 2958 |
| r14223 | r14224 | |
|---|---|---|
| 226 | 226 | |
| 227 | 227 | SCREEN_VBLANK( othldrby ) |
| 228 | 228 | { |
| 229 | // falling edge | |
| 230 | if (!vblank_on) | |
| 229 | // rising edge | |
| 230 | if (vblank_on) | |
| 231 | 231 | { |
| 232 | 232 | othldrby_state *state = screen.machine().driver_data<othldrby_state>(); |
| 233 | 233 |
| r14223 | r14224 | |
|---|---|---|
| 22 | 22 | cbuster.c (could probably use pdrawgfx, not m_sprite_bitmap) |
| 23 | 23 | mirage.c (could probably use pdrawgfx, not m_sprite_bitmap) |
| 24 | 24 | cninja.c |
| 25 | lemmings.c | |
| 26 | deco32.c | |
| 25 | 27 | |
| 26 | 28 | partially converted: |
| 27 | deco32.c - video mixing | |
| 28 | ||
| 29 | ||
| 29 | 30 | difficult to convert: |
| 30 | 31 | rohga.c - complex video mixing, 6bpp gfx.. |
| 31 | lemmings.c - priority stuff (plus sprites seem somewhat different anyway??) | |
| 32 | 32 | dassault.c - complex video mixing |
| 33 | 33 | boogwing.c - complex video mixing |
| 34 | 34 |
| r14223 | r14224 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | #include "emu.h" |
| 16 | 16 | #include "includes/lemmings.h" |
| 17 | #include "video/decospr.h" | |
| 17 | 18 | |
| 18 | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 *spritedata, int gfxbank, UINT16 pri ) | |
| 19 | { | |
| 20 | int offs; | |
| 21 | ||
| 22 | for (offs = 0; offs < 0x400; offs += 4) | |
| 23 | { | |
| 24 | int x, y, sprite, colour, multi, fx, fy, inc, flash, mult; | |
| 25 | ||
| 26 | sprite = spritedata[offs + 1] & 0x3fff; | |
| 27 | ||
| 28 | if ((spritedata[offs + 2] & 0x2000) != pri) | |
| 29 | continue; | |
| 30 | ||
| 31 | y = spritedata[offs]; | |
| 32 | flash = y & 0x1000; | |
| 33 | if (flash && (machine.primary_screen->frame_number() & 1)) | |
| 34 | continue; | |
| 35 | ||
| 36 | x = spritedata[offs + 2]; | |
| 37 | colour = (x >>9) & 0xf; | |
| 38 | ||
| 39 | fx = y & 0x2000; | |
| 40 | fy = y & 0x4000; | |
| 41 | multi = (1 << ((y & 0x0600) >> 9)) - 1; /* 1x, 2x, 4x, 8x height */ | |
| 42 | ||
| 43 | x = x & 0x01ff; | |
| 44 | y = y & 0x01ff; | |
| 45 | if (x >= 320) x -= 512; | |
| 46 | if (y >= 256) y -= 512; | |
| 47 | ||
| 48 | if (x > 320 || x < -16) continue; | |
| 49 | ||
| 50 | sprite &= ~multi; | |
| 51 | if (fy) | |
| 52 | inc = 1; | |
| 53 | else | |
| 54 | { | |
| 55 | sprite += multi; | |
| 56 | inc = -1; | |
| 57 | } | |
| 58 | mult = -16; | |
| 59 | ||
| 60 | while (multi >= 0) | |
| 61 | { | |
| 62 | drawgfx_transpen(bitmap,cliprect,machine.gfx[gfxbank], | |
| 63 | sprite - multi * inc, | |
| 64 | colour, | |
| 65 | fx,fy, | |
| 66 | x,y + mult * multi,0); | |
| 67 | ||
| 68 | multi--; | |
| 69 | } | |
| 70 | } | |
| 71 | } | |
| 72 | ||
| 73 | 19 | /******************************************************************************/ |
| 74 | 20 | |
| 75 | 21 | static TILE_GET_INFO( get_tile_info ) |
| r14223 | r14224 | |
| 99 | 45 | |
| 100 | 46 | gfx_element_set_source(machine.gfx[2], state->m_vram_buffer); |
| 101 | 47 | |
| 48 | machine.device<decospr_device>("spritegen")->alloc_sprite_bitmap(); | |
| 49 | machine.device<decospr_device>("spritegen2")->alloc_sprite_bitmap(); | |
| 50 | ||
| 102 | 51 | state->save_item(NAME(*state->m_bitmap0)); |
| 103 | 52 | state->save_pointer(NAME(state->m_vram_buffer), 2048 * 64); |
| 104 | 53 | state->save_pointer(NAME(state->m_sprite_triple_buffer_0), 0x800 / 2); |
| r14223 | r14224 | |
| 119 | 68 | |
| 120 | 69 | /******************************************************************************/ |
| 121 | 70 | |
| 71 | // RAM based | |
| 122 | 72 | WRITE16_HANDLER( lemmings_pixel_0_w ) |
| 123 | 73 | { |
| 74 | ||
| 124 | 75 | lemmings_state *state = space->machine().driver_data<lemmings_state>(); |
| 125 | 76 | int sx, sy, src, old; |
| 126 | 77 | |
| r14223 | r14224 | |
| 140 | 91 | state->m_bitmap0->pix16(sy, sx + 1) = ((src >> 0) & 0xf) | 0x100; |
| 141 | 92 | } |
| 142 | 93 | |
| 94 | // RAM based tiles for the FG tilemap | |
| 143 | 95 | WRITE16_HANDLER( lemmings_pixel_1_w ) |
| 144 | 96 | { |
| 145 | 97 | lemmings_state *state = space->machine().driver_data<lemmings_state>(); |
| 146 | int sx, sy, src, | |
| 98 | int sx, sy, src, | |
| 147 | 99 | |
| 148 | // old = state->m_pixel_1_data[offset]; | |
| 149 | 100 | COMBINE_DATA(&state->m_pixel_1_data[offset]); |
| 150 | 101 | src = state->m_pixel_1_data[offset]; |
| 151 | // if (old == src) | |
| 152 | // return; | |
| 153 | 102 | |
| 154 | 103 | sy = ((offset << 1) / 0x200); |
| 155 | 104 | sx = ((offset << 1) & 0x1ff); |
| r14223 | r14224 | |
| 170 | 119 | state->m_vram_tilemap->mark_tile_dirty(offset); |
| 171 | 120 | } |
| 172 | 121 | |
| 173 | SCREEN_UPDATE_IND16( lemmings ) | |
| 122 | ||
| 123 | void lemmings_copy_bitmap(running_machine &machine, bitmap_rgb32& bitmap, bitmap_ind16& srcbitmap, int* xscroll, int* yscroll, const rectangle& cliprect) | |
| 174 | 124 | { |
| 125 | int y,x; | |
| 126 | const pen_t *paldata = machine.pens; | |
| 127 | ||
| 128 | for (y=cliprect.min_y; y<cliprect.max_y;y++) | |
| 129 | { | |
| 130 | UINT32* dst = &bitmap.pix32(y,0); | |
| 131 | ||
| 132 | for (x=cliprect.min_x; x<cliprect.max_x;x++) | |
| 133 | { | |
| 134 | UINT16 src = srcbitmap.pix16((y-*yscroll)&0xff,(x-*xscroll)&0x7ff); | |
| 135 | ||
| 136 | if (src!=0x100) | |
| 137 | dst[x] = paldata[src]; | |
| 138 | } | |
| 139 | } | |
| 140 | } | |
| 141 | ||
| 142 | SCREEN_UPDATE_RGB32( lemmings ) | |
| 143 | { | |
| 175 | 144 | lemmings_state *state = screen.machine().driver_data<lemmings_state>(); |
| 176 | 145 | int x1 = -state->m_control_data[0]; |
| 177 | 146 | int x0 = -state->m_control_data[2]; |
| r14223 | r14224 | |
| 180 | 149 | rect.max_y = cliprect.max_y; |
| 181 | 150 | rect.min_y = cliprect.min_y; |
| 182 | 151 | |
| 152 | screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, state->m_sprite_triple_buffer_1, 0x400, true); | |
| 153 | screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, state->m_sprite_triple_buffer_0, 0x400, true); | |
| 154 | ||
| 183 | 155 | bitmap.fill(get_black_pen(screen.machine()), cliprect); |
| 184 | | |
| 156 | | |
| 185 | 157 | |
| 186 | 158 | /* Pixel layer can be windowed in hardware (two player mode) */ |
| 187 | 159 | if ((state->m_control_data[6] & 2) == 0) |
| 188 | copyscrollbitmap_trans(bitmap, *state->m_bitmap0, 1, &x1, 1, &y, cliprect, 0x100); | |
| 160 | { | |
| 161 | lemmings_copy_bitmap(screen.machine(), bitmap, *state->m_bitmap0, &x1, &y, cliprect); | |
| 162 | } | |
| 189 | 163 | else |
| 190 | 164 | { |
| 191 | 165 | rect.max_x = 159; |
| 192 | 166 | rect.min_x = 0; |
| 193 | copyscrollbitmap_trans(bitmap, *state->m_bitmap0, 1, &x0, 1, &y, rect, 0x100); | |
| 167 | lemmings_copy_bitmap(screen.machine(), bitmap, *state->m_bitmap0, &x0, &y, rect); | |
| 168 | ||
| 194 | 169 | rect.max_x = 319; |
| 195 | 170 | rect.min_x = 160; |
| 196 | copy | |
| 171 | lemmings_copy_ | |
| 197 | 172 | } |
| 198 | draw_sprites(screen.machine(), bitmap, cliprect, state->m_sprite_triple_buffer_0, 0, 0x0000); | |
| 199 | draw_sprites(screen.machine(), bitmap, cliprect, state->m_sprite_triple_buffer_1, 1, 0x2000); | |
| 173 | ||
| 174 | screen.machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 0x200, 0xff); | |
| 175 | screen.machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 0x300, 0xff); | |
| 200 | 176 | state->m_vram_tilemap->draw(bitmap, cliprect, 0, 0); |
| 201 | | |
| 177 | | |
| 202 | 178 | return 0; |
| 203 | 179 | } |
| r14223 | r14224 | |
|---|---|---|
| 1219 | 1219 | |
| 1220 | 1220 | SCREEN_VBLANK( rallybik ) |
| 1221 | 1221 | { |
| 1222 | // falling edge | |
| 1223 | if (!vblank_on) | |
| 1222 | // rising edge | |
| 1223 | if (vblank_on) | |
| 1224 | 1224 | { |
| 1225 | 1225 | toaplan1_state *state = screen.machine().driver_data<toaplan1_state>(); |
| 1226 | 1226 | |
| r14223 | r14224 | |
| 1230 | 1230 | |
| 1231 | 1231 | SCREEN_VBLANK( toaplan1 ) |
| 1232 | 1232 | { |
| 1233 | // falling edge | |
| 1234 | if (!vblank_on) | |
| 1233 | // rising edge | |
| 1234 | if (vblank_on) | |
| 1235 | 1235 | { |
| 1236 | 1236 | toaplan1_state *state = screen.machine().driver_data<toaplan1_state>(); |
| 1237 | 1237 | |
| r14223 | r14224 | |
| 1242 | 1242 | |
| 1243 | 1243 | SCREEN_VBLANK( samesame ) |
| 1244 | 1244 | { |
| 1245 | // falling edge | |
| 1246 | if (!vblank_on) | |
| 1245 | // rising edge | |
| 1246 | if (vblank_on) | |
| 1247 | 1247 | { |
| 1248 | 1248 | toaplan1_state *state = screen.machine().driver_data<toaplan1_state>(); |
| 1249 | 1249 |
| r14223 | r14224 | |
|---|---|---|
| 262 | 262 | |
| 263 | 263 | SCREEN_VBLANK( bionicc ) |
| 264 | 264 | { |
| 265 | // falling edge | |
| 266 | if (!vblank_on) | |
| 265 | // rising edge | |
| 266 | if (vblank_on) | |
| 267 | 267 | { |
| 268 | 268 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 269 | 269 |
| r14223 | r14224 | |
|---|---|---|
| 389 | 389 | /* tile layers 0 & 1 have priorities 1 & 2 */ |
| 390 | 390 | static const int pri[] = { 0, 0xfc, 0xff, 0xff }; |
| 391 | 391 | int offs; |
| 392 | ||
| 393 | UINT16 *spritelist = (UINT16 *)(state->m_spriteram + 0x1800 / 4); | |
| 394 | ||
| 392 | UINT16 *spritelist = (UINT16 *)(state->m_spritebuf2 + 0x1800 / 4); | |
| 395 | 393 | UINT8 *TILES = machine.region("spritelut")->base(); // Sprites LUT |
| 396 | 394 | int TILES_LEN = machine.region("spritelut")->bytes(); |
| 397 | 395 | |
| r14223 | r14224 | |
| 425 | 423 | sprite = spritelist[BYTE_XOR_BE(offs)]; |
| 426 | 424 | |
| 427 | 425 | sprite %= 0x300; |
| 428 | // source = &state->m_bootleg_spritebuffer[sprite * 8 / 4]; | |
| 429 | source = &state->m_spriteram[sprite * 8 / 4]; | |
| 426 | source = &state->m_spritebuf2[sprite * 8 / 4]; | |
| 430 | 427 | |
| 431 | 428 | /* Draw this sprite */ |
| 432 | 429 | |
| r14223 | r14224 | |
| 708 | 705 | UINT32 layer1_scrollx, layer1_scrolly; |
| 709 | 706 | UINT32 layer0_ctrl = state->m_vregs[0x412 / 4]; |
| 710 | 707 | UINT32 layer1_ctrl = state->m_vregs[0x416 / 4]; |
| 711 | UINT32 spr_ctrl = state->m_sprite | |
| 708 | UINT32 spr_ctrl = state->m_spritebuf2[0x1ffe / 4]; | |
| 712 | 709 | |
| 713 | 710 | tilemap_t *tmptilemap0, *tmptilemap1; |
| 714 | 711 | |
| r14223 | r14224 | |
| 866 | 863 | |
| 867 | 864 | SCREEN_VBLANK( psikyo ) |
| 868 | 865 | { |
| 869 | // falling edge | |
| 870 | if (!vblank_on) | |
| 866 | // rising edge | |
| 867 | if (vblank_on) | |
| 871 | 868 | { |
| 872 | 869 | psikyo_state *state = screen.machine().driver_data<psikyo_state>(); |
| 873 | 870 | memcpy(state->m_spritebuf2, state->m_spritebuf1, 0x2000); |
| r14223 | r14224 | |
|---|---|---|
| 675 | 675 | |
| 676 | 676 | SCREEN_VBLANK( pgm ) |
| 677 | 677 | { |
| 678 | // falling edge | |
| 679 | if (!vblank_on) | |
| 678 | // rising edge | |
| 679 | if (vblank_on) | |
| 680 | 680 | { |
| 681 | 681 | pgm_state *state = screen.machine().driver_data<pgm_state>(); |
| 682 | 682 |
| r14223 | r14224 | |
|---|---|---|
| 271 | 271 | |
| 272 | 272 | SCREEN_VBLANK( mcatadv ) |
| 273 | 273 | { |
| 274 | // falling edge | |
| 275 | if (!vblank_on) | |
| 274 | // rising edge | |
| 275 | if (vblank_on) | |
| 276 | 276 | { |
| 277 | 277 | mcatadv_state *state = screen.machine().driver_data<mcatadv_state>(); |
| 278 | 278 | memcpy(state->m_spriteram_old, state->m_spriteram, state->m_spriteram_size); |
| r14223 | r14224 | |
|---|---|---|
| 308 | 308 | |
| 309 | 309 | SCREEN_VBLANK( lastduel ) |
| 310 | 310 | { |
| 311 | // falling edge | |
| 312 | if (!vblank_on) | |
| 311 | // rising edge | |
| 312 | if (vblank_on) | |
| 313 | 313 | { |
| 314 | 314 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 315 | 315 |
| r14223 | r14224 | |
|---|---|---|
| 569 | 569 | |
| 570 | 570 | SCREEN_VBLANK( tceptor ) |
| 571 | 571 | { |
| 572 | // falling edge | |
| 573 | if (!vblank_on) | |
| 572 | // rising edge | |
| 573 | if (vblank_on) | |
| 574 | 574 | { |
| 575 | 575 | tceptor_state *state = screen.machine().driver_data<tceptor_state>(); |
| 576 | 576 | memcpy(state->m_sprite_ram_buffered, state->m_sprite_ram, 0x200); |
| r14223 | r14224 | |
|---|---|---|
| 147 | 147 | |
| 148 | 148 | SCREEN_VBLANK( commando ) |
| 149 | 149 | { |
| 150 | // falling edge | |
| 151 | if (!vblank_on) | |
| 150 | // rising edge | |
| 151 | if (vblank_on) | |
| 152 | 152 | { |
| 153 | 153 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 154 | 154 |
| r14223 | r14224 | |
|---|---|---|
| 152 | 152 | |
| 153 | 153 | SCREEN_VBLANK( gng ) |
| 154 | 154 | { |
| 155 | // falling edge | |
| 156 | if (!vblank_on) | |
| 155 | // rising edge | |
| 156 | if (vblank_on) | |
| 157 | 157 | { |
| 158 | 158 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 159 | 159 |
| r14223 | r14224 | |
|---|---|---|
| 1067 | 1067 | |
| 1068 | 1068 | SCREEN_VBLANK( setaroul ) |
| 1069 | 1069 | { |
| 1070 | // falling edge | |
| 1071 | if (!vblank_on) | |
| 1070 | // rising edge | |
| 1071 | if (vblank_on) | |
| 1072 | 1072 | screen.machine().device<seta001_device>("spritegen")->tnzs_eof(); |
| 1073 | 1073 | } |
| 1074 | 1074 |
| r14223 | r14224 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | SCREEN_VBLANK( tnzs ) |
| 57 | 57 | { |
| 58 | // falling edge | |
| 59 | if (!vblank_on) | |
| 58 | // rising edge | |
| 59 | if (vblank_on) | |
| 60 | 60 | screen.machine().device<seta001_device>("spritegen")->tnzs_eof(); |
| 61 | 61 | } |
| r14223 | r14224 | |
|---|---|---|
| 442 | 442 | |
| 443 | 443 | SCREEN_VBLANK( namcos1 ) |
| 444 | 444 | { |
| 445 | // falling edge | |
| 446 | if (!vblank_on) | |
| 445 | // rising edge | |
| 446 | if (vblank_on) | |
| 447 | 447 | { |
| 448 | 448 | namcos1_state *state = screen.machine().driver_data<namcos1_state>(); |
| 449 | 449 | if (state->m_copy_sprites) |
| r14223 | r14224 | |
|---|---|---|
| 35 | 35 | |
| 36 | 36 | SCREEN_VBLANK( toki ) |
| 37 | 37 | { |
| 38 | // falling edge | |
| 39 | if (!vblank_on) | |
| 38 | // rising edge | |
| 39 | if (vblank_on) | |
| 40 | 40 | buffer_spriteram16_w(screen.machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | SCREEN_VBLANK( tokib ) |
| 44 | 44 | { |
| 45 | // falling edge | |
| 46 | if (!vblank_on) | |
| 45 | // rising edge | |
| 46 | if (vblank_on) | |
| 47 | 47 | buffer_spriteram16_w(screen.machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff); |
| 48 | 48 | } |
| 49 | 49 |
| r14223 | r14224 | |
|---|---|---|
| 368 | 368 | |
| 369 | 369 | SCREEN_VBLANK( sidearms ) |
| 370 | 370 | { |
| 371 | // falling edge | |
| 372 | if (!vblank_on) | |
| 371 | // rising edge | |
| 372 | if (vblank_on) | |
| 373 | 373 | { |
| 374 | 374 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 375 | 375 |
| r14223 | r14224 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | SCREEN_VBLANK( djboy ) |
| 85 | 85 | { |
| 86 | // falling edge | |
| 87 | if (!vblank_on) | |
| 86 | // rising edge | |
| 87 | if (vblank_on) | |
| 88 | 88 | { |
| 89 | 89 | djboy_state *state = screen.machine().driver_data<djboy_state>(); |
| 90 | 90 | pandora_eof(state->m_pandora); |
| r14223 | r14224 | |
|---|---|---|
| 1126 | 1126 | |
| 1127 | 1127 | SCREEN_VBLANK( tx1 ) |
| 1128 | 1128 | { |
| 1129 | // falling edge | |
| 1130 | if (!vblank_on) | |
| 1129 | // rising edge | |
| 1130 | if (vblank_on) | |
| 1131 | 1131 | { |
| 1132 | 1132 | tx1_state *state = screen.machine().driver_data<tx1_state>(); |
| 1133 | 1133 | |
| r14223 | r14224 | |
| 3034 | 3034 | |
| 3035 | 3035 | SCREEN_VBLANK( buggyboy ) |
| 3036 | 3036 | { |
| 3037 | // falling edge | |
| 3038 | if (!vblank_on) | |
| 3037 | // rising edge | |
| 3038 | if (vblank_on) | |
| 3039 | 3039 | { |
| 3040 | 3040 | tx1_state *state = screen.machine().driver_data<tx1_state>(); |
| 3041 | 3041 |
| r14223 | r14224 | |
|---|---|---|
| 172 | 172 | |
| 173 | 173 | SCREEN_VBLANK( srumbler ) |
| 174 | 174 | { |
| 175 | // falling edge | |
| 176 | if (!vblank_on) | |
| 175 | // rising edge | |
| 176 | if (vblank_on) | |
| 177 | 177 | { |
| 178 | 178 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 179 | 179 |
| r14223 | r14224 | |
|---|---|---|
| 173 | 173 | |
| 174 | 174 | SCREEN_VBLANK( tigeroad ) |
| 175 | 175 | { |
| 176 | // falling edge | |
| 177 | if (!vblank_on) | |
| 176 | // rising edge | |
| 177 | if (vblank_on) | |
| 178 | 178 | { |
| 179 | 179 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 180 | 180 |
| r14223 | r14224 | |
|---|---|---|
| 1310 | 1310 | |
| 1311 | 1311 | SCREEN_VBLANK( psikyosh ) |
| 1312 | 1312 | { |
| 1313 | // falling edge | |
| 1314 | if (!vblank_on) | |
| 1313 | // rising edge | |
| 1314 | if (vblank_on) | |
| 1315 | 1315 | { |
| 1316 | 1316 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 1317 | 1317 | buffer_spriteram32_w(space, 0, 0, 0xffffffff); |
| r14223 | r14224 | |
|---|---|---|
| 893 | 893 | |
| 894 | 894 | SCREEN_VBLANK( taitof2_no_buffer ) |
| 895 | 895 | { |
| 896 | // falling edge | |
| 897 | if (!vblank_on) | |
| 896 | // rising edge | |
| 897 | if (vblank_on) | |
| 898 | 898 | { |
| 899 | 899 | taitof2_state *state = screen.machine().driver_data<taitof2_state>(); |
| 900 | 900 | |
| r14223 | r14224 | |
| 906 | 906 | |
| 907 | 907 | SCREEN_VBLANK( taitof2_full_buffer_delayed ) |
| 908 | 908 | { |
| 909 | // falling edge | |
| 910 | if (!vblank_on) | |
| 909 | // rising edge | |
| 910 | if (vblank_on) | |
| 911 | 911 | { |
| 912 | 912 | taitof2_state *state = screen.machine().driver_data<taitof2_state>(); |
| 913 | 913 | UINT16 *spriteram = state->m_spriteram; |
| r14223 | r14224 | |
| 925 | 925 | |
| 926 | 926 | SCREEN_VBLANK( taitof2_partial_buffer_delayed ) |
| 927 | 927 | { |
| 928 | // falling edge | |
| 929 | if (!vblank_on) | |
| 928 | // rising edge | |
| 929 | if (vblank_on) | |
| 930 | 930 | { |
| 931 | 931 | taitof2_state *state = screen.machine().driver_data<taitof2_state>(); |
| 932 | 932 | UINT16 *spriteram = state->m_spriteram; |
| r14223 | r14224 | |
| 944 | 944 | |
| 945 | 945 | SCREEN_VBLANK( taitof2_partial_buffer_delayed_thundfox ) |
| 946 | 946 | { |
| 947 | // falling edge | |
| 948 | if (!vblank_on) | |
| 947 | // rising edge | |
| 948 | if (vblank_on) | |
| 949 | 949 | { |
| 950 | 950 | taitof2_state *state = screen.machine().driver_data<taitof2_state>(); |
| 951 | 951 | UINT16 *spriteram = state->m_spriteram; |
| r14223 | r14224 | |
| 967 | 967 | |
| 968 | 968 | SCREEN_VBLANK( taitof2_partial_buffer_delayed_qzchikyu ) |
| 969 | 969 | { |
| 970 | // falling edge | |
| 971 | if (!vblank_on) | |
| 970 | // rising edge | |
| 971 | if (vblank_on) | |
| 972 | 972 | { |
| 973 | 973 | /* spriteram[2] and [3] are 1 frame behind... |
| 974 | 974 | probably thundfox_eof_callback would work fine */ |
| r14223 | r14224 | |
|---|---|---|
| 211 | 211 | * |
| 212 | 212 | *************************************/ |
| 213 | 213 | |
| 214 | static void draw_sprites(running_machine &machine, bitmap_ | |
| 214 | static void draw_sprites(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect) | |
| 215 | 215 | { |
| 216 | 216 | gottlieb_state *state = machine.driver_data<gottlieb_state>(); |
| 217 | 217 | UINT8 *spriteram = state->m_spriteram; |
| r14223 | r14224 | |
| 249 | 249 | * |
| 250 | 250 | *************************************/ |
| 251 | 251 | |
| 252 | SCREEN_UPDATE_ | |
| 252 | SCREEN_UPDATE_RGB32( gottlieb ) | |
| 253 | 253 | { |
| 254 | 254 | gottlieb_state *state = screen.machine().driver_data<gottlieb_state>(); |
| 255 | 255 | /* if the background has lower priority, render it first, else clear the screen */ |
| 256 | 256 | if (!state->m_background_priority) |
| 257 | 257 | state->m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 258 | 258 | else |
| 259 | bitmap.fill(0, cliprect); | |
| 259 | bitmap.fill(screen.machine().pens[0], cliprect); | |
| 260 | 260 | |
| 261 | 261 | /* draw the sprites */ |
| 262 | 262 | draw_sprites(screen.machine(), bitmap, cliprect); |
| r14223 | r14224 | |
|---|---|---|
| 431 | 431 | |
| 432 | 432 | SCREEN_VBLANK( macrossp ) |
| 433 | 433 | { |
| 434 | // falling edge | |
| 435 | if (!vblank_on) | |
| 434 | // rising edge | |
| 435 | if (vblank_on) | |
| 436 | 436 | { |
| 437 | 437 | macrossp_state *state = screen.machine().driver_data<macrossp_state>(); |
| 438 | 438 |
| r14223 | r14224 | |
|---|---|---|
| 329 | 329 | |
| 330 | 330 | SCREEN_VBLANK( taitol ) |
| 331 | 331 | { |
| 332 | // falling edge | |
| 333 | if (!vblank_on) | |
| 332 | // rising edge | |
| 333 | if (vblank_on) | |
| 334 | 334 | { |
| 335 | 335 | taitol_state *state = screen.machine().driver_data<taitol_state>(); |
| 336 | 336 | UINT8 *spriteram = state->m_rambanks + 0xb000; |
| r14223 | r14224 | |
|---|---|---|
| 226 | 226 | |
| 227 | 227 | SCREEN_VBLANK( taotaido ) |
| 228 | 228 | { |
| 229 | // falling edge | |
| 230 | if (!vblank_on) | |
| 229 | // rising edge | |
| 230 | if (vblank_on) | |
| 231 | 231 | { |
| 232 | 232 | taotaido_state *state = screen.machine().driver_data<taotaido_state>(); |
| 233 | 233 | /* sprites need to be delayed by 2 frames? */ |
| r14223 | r14224 | |
|---|---|---|
| 517 | 517 | |
| 518 | 518 | SCREEN_VBLANK( f3 ) |
| 519 | 519 | { |
| 520 | // falling edge | |
| 521 | if (!vblank_on) | |
| 520 | // rising edge | |
| 521 | if (vblank_on) | |
| 522 | 522 | { |
| 523 | 523 | taito_f3_state *state = screen.machine().driver_data<taito_f3_state>(); |
| 524 | 524 | if (state->m_sprite_lag==2) |
| r14223 | r14224 | |
|---|---|---|
| 342 | 342 | |
| 343 | 343 | SCREEN_VBLANK( baraduke ) |
| 344 | 344 | { |
| 345 | // falling edge | |
| 346 | if (!vblank_on) | |
| 345 | // rising edge | |
| 346 | if (vblank_on) | |
| 347 | 347 | { |
| 348 | 348 | baraduke_state *state = screen.machine().driver_data<baraduke_state>(); |
| 349 | 349 | if (state->m_copy_sprites) |
| r14223 | r14224 | |
|---|---|---|
| 219 | 219 | |
| 220 | 220 | SCREEN_VBLANK( crshrace ) |
| 221 | 221 | { |
| 222 | // falling edge | |
| 223 | if (!vblank_on) | |
| 222 | // rising edge | |
| 223 | if (vblank_on) | |
| 224 | 224 | { |
| 225 | 225 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 226 | 226 |
| r14223 | r14224 | |
|---|---|---|
| 148 | 148 | |
| 149 | 149 | SCREEN_VBLANK( airbustr ) |
| 150 | 150 | { |
| 151 | // falling edge | |
| 152 | if (!vblank_on) | |
| 151 | // rising edge | |
| 152 | if (vblank_on) | |
| 153 | 153 | { |
| 154 | 154 | airbustr_state *state = screen.machine().driver_data<airbustr_state>(); |
| 155 | 155 |
| r14223 | r14224 | |
|---|---|---|
| 933 | 933 | |
| 934 | 934 | SCREEN_VBLANK( dooyong ) |
| 935 | 935 | { |
| 936 | // falling edge | |
| 937 | if (!vblank_on) | |
| 936 | // rising edge | |
| 937 | if (vblank_on) | |
| 938 | 938 | { |
| 939 | 939 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 940 | 940 | |
| r14223 | r14224 | |
| 944 | 944 | |
| 945 | 945 | SCREEN_VBLANK( rshark ) |
| 946 | 946 | { |
| 947 | // falling edge | |
| 948 | if (!vblank_on) | |
| 947 | // rising edge | |
| 948 | if (vblank_on) | |
| 949 | 949 | { |
| 950 | 950 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 951 | 951 |
| r14223 | r14224 | |
|---|---|---|
| 287 | 287 | MCFG_MACHINE_RESET(seibu_sound) |
| 288 | 288 | |
| 289 | 289 | // video hardware |
| 290 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 290 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 291 | 291 | |
| 292 | 292 | MCFG_SCREEN_ADD("screen", RASTER) |
| 293 | 293 | MCFG_SCREEN_REFRESH_RATE(60) |
| r14223 | r14224 | |
|---|---|---|
| 94 | 94 | |
| 95 | 95 | static SCREEN_VBLANK( snowbros ) |
| 96 | 96 | { |
| 97 | // falling edge | |
| 98 | if (!vblank_on) | |
| 97 | // rising edge | |
| 98 | if (vblank_on) | |
| 99 | 99 | { |
| 100 | 100 | device_t *pandora = screen.machine().device("pandora"); |
| 101 | 101 | pandora_eof(pandora); |
| r14223 | r14224 | |
|---|---|---|
| 8505 | 8505 | MCFG_CPU_PROGRAM_MAP(hparadis_map) |
| 8506 | 8506 | MCFG_CPU_IO_MAP(hparadis_portmap) |
| 8507 | 8507 | MCFG_CPU_VBLANK_INT("screen", hparadis_irq) |
| 8508 | MCFG_DEVICE_REMOVE("scantimer") | |
| 8509 | 8508 | |
| 8510 | 8509 | MCFG_MACHINE_START(hparadis) |
| 8511 | 8510 | MACHINE_CONFIG_END |
| r14223 | r14224 | |
|---|---|---|
| 1547 | 1547 | */ |
| 1548 | 1548 | static SCREEN_VBLANK( seta_buffer_sprites ) |
| 1549 | 1549 | { |
| 1550 | // falling edge | |
| 1551 | if (!vblank_on) | |
| 1550 | // rising edge | |
| 1551 | if (vblank_on) | |
| 1552 | 1552 | { |
| 1553 | 1553 | //seta_state *state = machine.driver_data<seta_state>(); |
| 1554 | 1554 | screen.machine().device<seta001_device>("spritegen")->setac_eof(); |
| r14223 | r14224 | |
|---|---|---|
| 462 | 462 | |
| 463 | 463 | SCREEN_VBLANK( champbwl ) |
| 464 | 464 | { |
| 465 | // falling edge | |
| 466 | if (!vblank_on) | |
| 465 | // rising edge | |
| 466 | if (vblank_on) | |
| 467 | 467 | screen.machine().device<seta001_device>("spritegen")->tnzs_eof(); |
| 468 | 468 | } |
| 469 | 469 | |
| r14223 | r14224 | |
| 521 | 521 | |
| 522 | 522 | static SCREEN_VBLANK( doraemon ) |
| 523 | 523 | { |
| 524 | // falling edge | |
| 525 | if (!vblank_on) | |
| 524 | // rising edge | |
| 525 | if (vblank_on) | |
| 526 | 526 | screen.machine().device<seta001_device>("spritegen")->setac_eof(); |
| 527 | 527 | } |
| 528 | 528 |
| r14223 | r14224 | |
|---|---|---|
| 244 | 244 | |
| 245 | 245 | static SCREEN_VBLANK( raiden ) |
| 246 | 246 | { |
| 247 | // falling edge | |
| 248 | if (!vblank_on) | |
| 247 | // rising edge | |
| 248 | if (vblank_on) | |
| 249 | 249 | { |
| 250 | 250 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 251 | 251 | buffer_spriteram16_w(space,0,0,0xffff); /* Could be a memory location instead */ |
| r14223 | r14224 | |
|---|---|---|
| 770 | 770 | MCFG_MACHINE_RESET(slapfight) |
| 771 | 771 | |
| 772 | 772 | /* video hardware */ |
| 773 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 773 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 774 | 774 | |
| 775 | 775 | MCFG_SCREEN_ADD("screen", RASTER) |
| 776 | 776 | MCFG_SCREEN_REFRESH_RATE(60) |
| r14223 | r14224 | |
| 816 | 816 | MCFG_MACHINE_RESET(slapfight) |
| 817 | 817 | |
| 818 | 818 | /* video hardware */ |
| 819 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 819 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 820 | 820 | |
| 821 | 821 | MCFG_SCREEN_ADD("screen", RASTER) |
| 822 | 822 | MCFG_SCREEN_REFRESH_RATE(60) |
| r14223 | r14224 | |
| 864 | 864 | MCFG_MACHINE_RESET(slapfight) |
| 865 | 865 | |
| 866 | 866 | /* video hardware */ |
| 867 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 867 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 868 | 868 | |
| 869 | 869 | MCFG_SCREEN_ADD("screen", RASTER) |
| 870 | 870 | MCFG_SCREEN_REFRESH_RATE(60) |
| r14223 | r14224 | |
| 913 | 913 | MCFG_MACHINE_RESET(slapfight) |
| 914 | 914 | |
| 915 | 915 | /* video hardware */ |
| 916 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 916 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 917 | 917 | |
| 918 | 918 | MCFG_SCREEN_ADD("screen", RASTER) |
| 919 | 919 | MCFG_SCREEN_REFRESH_RATE(60) |
| r14223 | r14224 | |
|---|---|---|
| 1884 | 1884 | MCFG_LASERDISC_AUDIO(laserdisc_audio_delegate(FUNC(laserdisc_audio_process), device)) |
| 1885 | 1885 | MCFG_LASERDISC_OVERLAY_STATIC(GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, gottlieb) |
| 1886 | 1886 | MCFG_LASERDISC_OVERLAY_CLIP(0, GOTTLIEB_VIDEO_HBLANK-1, 0, GOTTLIEB_VIDEO_VBLANK-8) |
| 1887 | MCFG_SOUND_ROUTE(0, "mono", 1.0) | |
| 1888 | /* right channel is processed as data */ | |
| 1887 | 1889 | |
| 1888 | 1890 | MCFG_DEVICE_REMOVE("screen") |
| 1889 | 1891 | MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc") |
| 1890 | ||
| 1891 | MCFG_SOUND_MODIFY("laserdisc") | |
| 1892 | MCFG_SOUND_ROUTE(0, "mono", 1.0) | |
| 1893 | /* right channel is processed as data */ | |
| 1894 | 1892 | MACHINE_CONFIG_END |
| 1895 | 1893 | |
| 1896 | 1894 | |
| r14223 | r14224 | |
| 1936 | 1934 | MCFG_LASERDISC_AUDIO(laserdisc_audio_delegate(FUNC(laserdisc_audio_process), device)) |
| 1937 | 1935 | MCFG_LASERDISC_OVERLAY_STATIC(GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, gottlieb) |
| 1938 | 1936 | MCFG_LASERDISC_OVERLAY_CLIP(0, GOTTLIEB_VIDEO_HBLANK-1, 0, GOTTLIEB_VIDEO_VBLANK-8) |
| 1937 | MCFG_SOUND_ROUTE(0, "mono", 1.0) | |
| 1938 | /* right channel is processed as data */ | |
| 1939 | 1939 | |
| 1940 | 1940 | MCFG_DEVICE_REMOVE("screen") |
| 1941 | 1941 | MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc") |
| 1942 | 1942 | |
| 1943 | MCFG_SOUND_MODIFY("laserdisc") | |
| 1944 | MCFG_SOUND_ROUTE(0, "mono", 1.0) | |
| 1945 | /* right channel is processed as data */ | |
| 1946 | ||
| 1947 | 1943 | /* sound hardware */ |
| 1948 | 1944 | MCFG_SOUND_MODIFY("dac1") |
| 1949 | 1945 | MCFG_SOUND_ROUTES_RESET() |
| r14223 | r14224 | |
|---|---|---|
| 383 | 383 | |
| 384 | 384 | static SCREEN_VBLANK( wwfwfest ) |
| 385 | 385 | { |
| 386 | // falling edge | |
| 387 | if (!vblank_on) | |
| 386 | // rising edge | |
| 387 | if (vblank_on) | |
| 388 | 388 | { |
| 389 | 389 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 390 | 390 |
| r14223 | r14224 | |
|---|---|---|
| 696 | 696 | |
| 697 | 697 | static SCREEN_VBLANK(crystal) |
| 698 | 698 | { |
| 699 | // falling edge | |
| 700 | if (!vblank_on) | |
| 699 | // rising edge | |
| 700 | if (vblank_on) | |
| 701 | 701 | { |
| 702 | 702 | crystal_state *state = screen.machine().driver_data<crystal_state>(); |
| 703 | 703 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| r14223 | r14224 | |
|---|---|---|
| 127 | 127 | |
| 128 | 128 | static SCREEN_VBLANK( galpanic ) |
| 129 | 129 | { |
| 130 | // falling edge | |
| 131 | if (!vblank_on) | |
| 130 | // rising edge | |
| 131 | if (vblank_on) | |
| 132 | 132 | { |
| 133 | 133 | device_t *pandora = screen.machine().device("pandora"); |
| 134 | 134 | pandora_eof(pandora); |
| r14223 | r14224 | |
|---|---|---|
| 700 | 700 | MCFG_NVRAM_ADD_0FILL("eeprom") |
| 701 | 701 | |
| 702 | 702 | /* video hardware */ |
| 703 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 703 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 704 | 704 | |
| 705 | 705 | MCFG_SCREEN_ADD("screen", RASTER) |
| 706 | 706 | MCFG_SCREEN_REFRESH_RATE(60) |
| r14223 | r14224 | |
| 737 | 737 | MCFG_CPU_IO_MAP(sounda_portmap) |
| 738 | 738 | |
| 739 | 739 | /* video hardware */ |
| 740 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 740 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 741 | 741 | |
| 742 | 742 | MCFG_SCREEN_ADD("screen", RASTER) |
| 743 | 743 | MCFG_SCREEN_REFRESH_RATE(60) |
| r14223 | r14224 | |
|---|---|---|
| 21 | 21 | #include "sound/2151intf.h" |
| 22 | 22 | #include "sound/okim6295.h" |
| 23 | 23 | #include "includes/lemmings.h" |
| 24 | #include "video/decospr.h" | |
| 24 | 25 | |
| 25 | 26 | static WRITE16_HANDLER( lemmings_control_w ) |
| 26 | 27 | { |
| r14223 | r14224 | |
| 230 | 231 | 4, |
| 231 | 232 | { 0x30000*8, 0x20000*8, 0x10000*8, 0x00000*8 }, |
| 232 | 233 | { |
| 233 | | |
| 234 | | |
| 234 | 235 | }, |
| 235 | { | |
| 236 | { 0 | |
| 236 | 237 | 32*8 |
| 237 | 238 | }; |
| 238 | 239 | |
| 239 | 240 | static GFXDECODE_START( lemmings ) |
| 240 | GFXDECODE_ENTRY( "gfx1", 0, sprite_layout, 32*16, 16 ) /* Sprites 16x16 */ | |
| 241 | GFXDECODE_ENTRY( "gfx2", 0, sprite_layout, 48*16, 16 ) /* Sprites 16x16 */ | |
| 241 | GFXDECODE_ENTRY( "gfx1", 0, sprite_layout, 0, 16 ) /* Sprites 16x16 */ | |
| 242 | GFXDECODE_ENTRY( "gfx2", 0, sprite_layout, 0, 16 ) /* Sprites 16x16 */ | |
| 242 | 243 | GFXDECODE_ENTRY( NULL, 0, charlayout, 0, 16 ) /* Dynamically modified */ |
| 243 | 244 | GFXDECODE_END |
| 244 | 245 | |
| r14223 | r14224 | |
| 290 | 291 | |
| 291 | 292 | MCFG_VIDEO_START(lemmings) |
| 292 | 293 | |
| 294 | MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) | |
| 295 | decospr_device::set_gfx_region(*device, 1); | |
| 296 | ||
| 297 | MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) | |
| 298 | decospr_device::set_gfx_region(*device, 0); | |
| 299 | ||
| 300 | ||
| 293 | 301 | /* sound hardware */ |
| 294 | 302 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 295 | 303 |
| r14223 | r14224 | |
|---|---|---|
| 1167 | 1167 | MCFG_SCREEN_SIZE(320, 256) |
| 1168 | 1168 | MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 256-32-1) |
| 1169 | 1169 | MCFG_SCREEN_UPDATE_STATIC(psikyo_bootleg) |
| 1170 | MCFG_SCREEN_VBLANK_STATIC(psikyo) | |
| 1170 | 1171 | |
| 1171 | 1172 | MCFG_GFXDECODE(psikyo) |
| 1172 | 1173 | MCFG_PALETTE_LENGTH(0x1000) |
| r14223 | r14224 | |
|---|---|---|
| 466 | 466 | |
| 467 | 467 | static I8085_CONFIG( n8080_cpu_config ) |
| 468 | 468 | { |
| 469 | DEVCB_HANDLER(n8080_status_callback), /* STATUS changed callback */ | |
| 470 | DEVCB_LINE(n8080_inte_callback), /* INTE changed callback */ | |
| 469 | DEVCB_DEVICE_HANDLER("maincpu",n8080_status_callback), /* STATUS changed callback */ | |
| 470 | DEVCB_DEVICE_LINE("maincpu",n8080_inte_callback), /* INTE changed callback */ | |
| 471 | 471 | DEVCB_NULL, /* SID changed callback (8085A only) */ |
| 472 | 472 | DEVCB_NULL /* SOD changed callback (8085A only) */ |
| 473 | 473 | }; |
| r14223 | r14224 | |
|---|---|---|
| 585 | 585 | MCFG_MACHINE_RESET(dreamwld) |
| 586 | 586 | |
| 587 | 587 | /* video hardware */ |
| 588 | MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) | |
| 589 | ||
| 590 | 588 | MCFG_SCREEN_ADD("screen", RASTER) |
| 591 | 589 | MCFG_SCREEN_REFRESH_RATE(58) |
| 592 | 590 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) |
| r14223 | r14224 | |
|---|---|---|
| 3 | 3 | |
| 4 | 4 | /*************************************************************************** |
| 5 | 5 | |
| 6 | driver by Angelo Salese & Phil Bennett | |
| 7 | ||
| 6 | 8 | Notes: |
| 7 | - currently fails DAC r/w in Voodoo registers (FPU fault?); | |
| 8 | (note: some of those are redundant) | |
| 9 | bp 0x18390,ax = 1;bp 0x1b5cb,ax = 1; | |
| 9 | - | |
| 10 | 10 | |
| 11 | 11 | Funky Ball |
| 12 | 12 | dgPIX, 1998 |
| r14223 | r14224 | |
| 127 | 127 | DECLARE_READ8_MEMBER( flash_data_r ); |
| 128 | 128 | DECLARE_WRITE8_MEMBER( flash_data_w ); |
| 129 | 129 | // DECLARE_WRITE8_MEMBER( bios_ram_w ); |
| 130 | DECLARE_READ | |
| 130 | DECLARE_READ8 | |
| 131 | 131 | |
| 132 | 132 | DECLARE_READ8_MEMBER( fdc_r ); |
| 133 | 133 | DECLARE_WRITE8_MEMBER( fdc_w ); |
| r14223 | r14224 | |
| 560 | 560 | } |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | READ | |
| 563 | READ8 | |
| 564 | 564 | { |
| 565 | return -1; | |
| 565 | static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7", | |
| 566 | "IN8", "IN9", "INA", "INB", "INC", "IND", "INE", "INF",}; | |
| 567 | ||
| 568 | return input_port_read(machine(), portnames[offset]); | |
| 566 | 569 | } |
| 567 | 570 | |
| 568 | 571 | static ADDRESS_MAP_START(funkball_map, AS_PROGRAM, 32, funkball_state) |
| r14223 | r14224 | |
| 608 | 611 | AM_RANGE(0x0360, 0x0363) AM_WRITE8(flash_w,0xffffffff) |
| 609 | 612 | |
| 610 | 613 | // AM_RANGE(0x0320, 0x0323) AM_READ(test_r) |
| 611 | AM_RANGE(0x036 | |
| 614 | AM_RANGE(0x0360, 0x036f) AM_READ8(test_r,0xffffffff) // inputs | |
| 612 | 615 | ADDRESS_MAP_END |
| 613 | 616 | |
| 614 | 617 | static INPUT_PORTS_START( funkball ) |
| 618 | PORT_START("IN0") | |
| 619 | PORT_DIPNAME( 0x01, 0x01, "0" ) | |
| 620 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 621 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 622 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 623 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 624 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 625 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 626 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 627 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 628 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 629 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 630 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 631 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 632 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 633 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 634 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 635 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 636 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 637 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 638 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 639 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 640 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 641 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 642 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 643 | PORT_START("IN1") | |
| 644 | PORT_DIPNAME( 0x01, 0x01, "1" ) | |
| 645 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 646 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 647 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 648 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 649 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 650 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 651 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 652 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 653 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 654 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 655 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 656 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 657 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 658 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 659 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 660 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 661 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 662 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 663 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 664 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 665 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 666 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 667 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 668 | PORT_START("IN2") | |
| 669 | PORT_DIPNAME( 0x01, 0x01, "2" ) | |
| 670 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 671 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 672 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 673 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 674 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 675 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 676 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 677 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 678 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 679 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 680 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 681 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 682 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 683 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 684 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 685 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 686 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 687 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 688 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 689 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 690 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 691 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 692 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 693 | PORT_START("IN3") | |
| 694 | PORT_DIPNAME( 0x01, 0x01, "3" ) | |
| 695 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 696 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 697 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 698 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 699 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 700 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 701 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 702 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 703 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 704 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 705 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 706 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 707 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 708 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 709 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 710 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 711 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 712 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 713 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 714 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 715 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 716 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 717 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 718 | PORT_START("IN4") | |
| 719 | PORT_DIPNAME( 0x01, 0x01, "4" ) | |
| 720 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 721 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 722 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 723 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 724 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 725 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 726 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 727 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 728 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 729 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 730 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 731 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 732 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 733 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 734 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 735 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 736 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 737 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 738 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 739 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 740 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 741 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 742 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 743 | PORT_START("IN5") | |
| 744 | PORT_DIPNAME( 0x01, 0x01, "5" ) | |
| 745 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 746 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 747 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 748 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 749 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 750 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 751 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 752 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 753 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 754 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 755 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 756 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 757 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 758 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 759 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 760 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 761 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 762 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 763 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 764 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 765 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 766 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 767 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 768 | PORT_START("IN6") | |
| 769 | PORT_DIPNAME( 0x01, 0x01, "6" ) | |
| 770 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 771 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 772 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 773 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 774 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 775 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 776 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 777 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 778 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 779 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 780 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 781 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 782 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 783 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 784 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 785 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 786 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 787 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 788 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 789 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 790 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 791 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 792 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 793 | /* 7-8 P1/P2 E-F "dgDelay" */ | |
| 794 | PORT_START("IN7") | |
| 795 | PORT_DIPNAME( 0x01, 0x01, "7" ) | |
| 796 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 797 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 798 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 799 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 800 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 801 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 802 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 803 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 804 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 805 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 806 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 807 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 808 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 809 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 810 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 811 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 812 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 813 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 814 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 815 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 816 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 817 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 818 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 819 | PORT_START("IN8") | |
| 820 | PORT_DIPNAME( 0x01, 0x01, "8" ) | |
| 821 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 822 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 823 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 824 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 825 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 826 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 827 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 828 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 829 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 830 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 831 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 832 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 833 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 834 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 835 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 836 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 837 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 838 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 839 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 840 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 841 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 842 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 843 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 844 | PORT_START("IN9") | |
| 845 | PORT_DIPNAME( 0x01, 0x01, "9" ) | |
| 846 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 847 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 848 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 849 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 850 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 851 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 852 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 853 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 854 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 855 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 856 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 857 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 858 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 859 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 860 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 861 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 862 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 863 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 864 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 865 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 866 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 867 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 868 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 869 | PORT_START("INA") | |
| 870 | PORT_DIPNAME( 0x01, 0x01, "A" ) | |
| 871 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 872 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 873 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 874 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 875 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 876 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 877 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 878 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 879 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 880 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 881 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 882 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 883 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 884 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 885 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 886 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 887 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 888 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 889 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 890 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 891 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 892 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 893 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 894 | PORT_START("INB") | |
| 895 | PORT_DIPNAME( 0x01, 0x01, "B" ) | |
| 896 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 897 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 898 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 899 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 900 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 901 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 902 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 903 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 904 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 905 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 906 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 907 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 908 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 909 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 910 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 911 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 912 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 913 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 914 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 915 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 916 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 917 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 918 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 919 | PORT_START("INC") | |
| 920 | PORT_DIPNAME( 0x01, 0x01, "C" ) | |
| 921 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 922 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 923 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 924 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 925 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 926 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 927 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 928 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 929 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 930 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 931 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 932 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 933 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 934 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 935 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 936 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 937 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 938 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 939 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 940 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 941 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 942 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 943 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 944 | PORT_START("IND") | |
| 945 | PORT_DIPNAME( 0x01, 0x01, "D" ) | |
| 946 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 947 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 948 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 949 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 950 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 951 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 952 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 953 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 954 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 955 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 956 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 957 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 958 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 959 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 960 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 961 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 962 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 963 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 964 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 965 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 966 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 967 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 968 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 969 | PORT_START("INE") | |
| 970 | PORT_DIPNAME( 0x01, 0x01, "E" ) | |
| 971 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 972 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 973 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 974 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 975 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 976 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 977 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 978 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 979 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 980 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 981 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 982 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 983 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 984 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 985 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 986 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 987 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 988 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 989 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 990 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 991 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 992 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 993 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 994 | PORT_START("INF") | |
| 995 | PORT_DIPNAME( 0x01, 0x01, "F" ) | |
| 996 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 997 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 998 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 999 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 1000 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1001 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 1002 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 1003 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1004 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 1005 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 1006 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1007 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 1008 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 1009 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1010 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 1011 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 1012 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1013 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 1014 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 1015 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1016 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 1017 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 1018 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 615 | 1019 | INPUT_PORTS_END |
| 616 | 1020 | |
| 617 | 1021 | static const struct pit8253_config funkball_pit8254_config = |
| r14223 | r14224 | |
| 742 | 1146 | } |
| 743 | 1147 | |
| 744 | 1148 | static MACHINE_CONFIG_START( funkball, funkball_state ) |
| 745 | MCFG_CPU_ADD("maincpu", MEDIAGX, 66666666*3.5 | |
| 1149 | MCFG_CPU_ADD("maincpu", MEDIAGX, 66666666*3.5 | |
| 746 | 1150 | MCFG_CPU_PROGRAM_MAP(funkball_map) |
| 747 | 1151 | MCFG_CPU_IO_MAP(funkball_io) |
| 748 | 1152 |
| r14223 | r14224 | |
|---|---|---|
| 136 | 136 | |
| 137 | 137 | static SCREEN_VBLANK( sandscrp ) |
| 138 | 138 | { |
| 139 | // falling edge | |
| 140 | if (!vblank_on) | |
| 139 | // rising edge | |
| 140 | if (vblank_on) | |
| 141 | 141 | { |
| 142 | 142 | sandscrp_state *state = screen.machine().driver_data<sandscrp_state>(); |
| 143 | 143 | device_t *pandora = screen.machine().device("pandora"); |
| r14223 | r14224 | |
|---|---|---|
| 746 | 746 | MCFG_MACHINE_RESET(twin16) |
| 747 | 747 | |
| 748 | 748 | // video hardware |
| 749 | MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_BUFFERS_SPRITERAM | |
| 749 | MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_BUFFERS_SPRITERAM | |
| 750 | 750 | |
| 751 | 751 | MCFG_SCREEN_ADD("screen", RASTER) |
| 752 | 752 | MCFG_SCREEN_REFRESH_RATE(((double)XTAL_18_432MHz / 2) / (576 * 264)) |
| r14223 | r14224 | |
| 799 | 799 | MCFG_MACHINE_RESET(twin16) |
| 800 | 800 | |
| 801 | 801 | /* video hardware */ |
| 802 | MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_BUFFERS_SPRITERAM | |
| 802 | MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_BUFFERS_SPRITERAM | |
| 803 | 803 | |
| 804 | 804 | MCFG_SCREEN_ADD("screen", RASTER) |
| 805 | 805 | MCFG_SCREEN_REFRESH_RATE(60) |
| r14223 | r14224 | |
|---|---|---|
| 2065 | 2065 | MCFG_MACHINE_RESET(dec8) |
| 2066 | 2066 | |
| 2067 | 2067 | /* video hardware */ |
| 2068 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 2068 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 2069 | 2069 | |
| 2070 | 2070 | MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) |
| 2071 | 2071 | deco_bac06_device::set_gfx_region_wide(*device, 2,2,0); |
| r14223 | r14224 | |
| 2217 | 2217 | MCFG_MACHINE_RESET(dec8) |
| 2218 | 2218 | |
| 2219 | 2219 | /* video hardware */ |
| 2220 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 2220 | MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | |
| 2221 | 2221 | |
| 2222 | 2222 | MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0) |
| 2223 | 2223 | deco_karnovsprites_device::set_gfx_region(*device, 1); |
| r14223 | r14224 | |
|---|---|---|
| 876 | 876 | |
| 877 | 877 | static SCREEN_VBLANK( asuka ) |
| 878 | 878 | { |
| 879 | if (!vblank_on) | |
| 879 | // rising edge | |
| 880 | if (vblank_on) | |
| 880 | 881 | { |
| 881 | 882 | asuka_state *state = screen.machine().driver_data<asuka_state>(); |
| 882 | 883 | pc090oj_eof_callback(state->m_pc090oj); |
| r14223 | r14224 | |
|---|---|---|
| 171 | 171 | |
| 172 | 172 | static SCREEN_VBLANK( hvyunit ) |
| 173 | 173 | { |
| 174 | // falling edge | |
| 175 | if (!vblank_on) | |
| 174 | // rising edge | |
| 175 | if (vblank_on) | |
| 176 | 176 | { |
| 177 | 177 | hvyunit_state *state = screen.machine().driver_data<hvyunit_state>(); |
| 178 | 178 | pandora_eof(state->m_pandora); |
| r14223 | r14224 | |
|---|---|---|
| 1281 | 1281 | invalid palette index |
| 1282 | 1282 | -------------------------------------------------*/ |
| 1283 | 1283 | |
| 1284 | ||
| 1284 | bool video_assert_out_of_range_pixels(running_machine &machine, bitmap_ind16 &bitmap) | |
| 1285 | 1285 | { |
| 1286 | 1286 | #ifdef MAME_DEBUG |
| 1287 | // iterate over rows | |
| 1287 | 1288 | int maxindex = palette_get_max_index(machine.palette); |
| 1288 | int x, y; | |
| 1289 | ||
| 1290 | // iterate over rows | |
| 1291 | for (y = 0; y < bitmap.height(); y++) | |
| 1289 | for (int y = 0; y < bitmap.height(); y++) | |
| 1292 | 1290 | { |
| 1293 | 1291 | UINT16 *rowbase = &bitmap.pix16(y); |
| 1294 | for (x = 0; x < bitmap.width(); x++) | |
| 1295 | assert(rowbase[x] < maxindex); | |
| 1292 | for (int x = 0; x < bitmap.width(); x++) | |
| 1293 | if (rowbase[x] > maxindex) | |
| 1294 | { | |
| 1295 | osd_break_into_debugger("Out of range pixel"); | |
| 1296 | return true; | |
| 1297 | } | |
| 1296 | 1298 | } |
| 1297 | 1299 | #endif |
| 1300 | return false; | |
| 1298 | 1301 | } |
| 1299 | 1302 | |
| 1300 | 1303 |
| r14223 | r14224 | |
|---|---|---|
| 204 | 204 | // ----- debugging helpers ----- |
| 205 | 205 | |
| 206 | 206 | // assert if any pixels in the given bitmap contain an invalid palette index |
| 207 | ||
| 207 | bool video_assert_out_of_range_pixels(running_machine &machine, bitmap_ind16 &bitmap); | |
| 208 | 208 | |
| 209 | 209 | |
| 210 | 210 | #endif /* __VIDEO_H__ */ |
| r14223 | r14224 | |
|---|---|---|
| 112 | 112 | // GLOBALS |
| 113 | 113 | //************************************************************************** |
| 114 | 114 | |
| 115 | // global resource pool to handle allocations outside of the emulator context | |
| 116 | resource_pool global_resource_pool(6151); | |
| 117 | ||
| 118 | 115 | // dummy zeromem object |
| 119 | 116 | const zeromem_t zeromem = { }; |
| 120 | 117 | |
| r14223 | r14224 | |
| 126 | 123 | memory_entry *memory_entry::s_hash[memory_entry::k_hash_prime] = { NULL }; |
| 127 | 124 | memory_entry *memory_entry::s_freehead = NULL; |
| 128 | 125 | |
| 126 | // wrapper for the global resource pool to help ensure construction order | |
| 127 | resource_pool &global_resource_pool() | |
| 128 | { | |
| 129 | static resource_pool s_pool(6151); | |
| 130 | return s_pool; | |
| 131 | }; | |
| 129 | 132 | |
| 130 | 133 | |
| 131 | 134 | //************************************************************************** |
| r14223 | r14224 | |
|---|---|---|
| 932 | 932 | |
| 933 | 933 | void running_machine::reset_all_devices() |
| 934 | 934 | { |
| 935 | // iterate over devices and reset them | |
| 936 | device_iterator iter(root_device()); | |
| 937 | for (device_t *device = iter.first(); device != NULL; device = iter.next()) | |
| 938 | device->reset(); | |
| 935 | // reset the root and it will reset children | |
| 936 | root_device().reset(); | |
| 939 | 937 | } |
| 940 | 938 | |
| 941 | 939 | |
| r14223 | r14224 | |
| 1268 | 1266 | |
| 1269 | 1267 | |
| 1270 | 1268 | //------------------------------------------------- |
| 1271 | // device_reset - device override which calls | |
| 1272 | // the various helpers | |
| 1269 | // device_reset_after_children - device override | |
| 1270 | // which calls the various helpers; must happen | |
| 1271 | // after all child devices are reset | |
| 1273 | 1272 | //------------------------------------------------- |
| 1274 | 1273 | |
| 1275 | void driver_device::device_reset() | |
| 1274 | void driver_device::device_reset_after_children() | |
| 1276 | 1275 | { |
| 1277 | 1276 | // reset each piece |
| 1278 | 1277 | driver_reset(); |
| r14223 | r14224 | |
|---|---|---|
| 74 | 74 | #define pool_free(_pool, v) (_pool).remove(v) |
| 75 | 75 | |
| 76 | 76 | // global allocation helpers |
| 77 | #define global_alloc(_type) pool_alloc(global_resource_pool, _type) | |
| 78 | #define global_alloc_clear(_type) pool_alloc_clear(global_resource_pool, _type) | |
| 79 | #define global_alloc_array(_type, _num) pool_alloc_array(global_resource_pool, _type, _num) | |
| 80 | #define global_alloc_array_clear(_type, _num) pool_alloc_array_clear(global_resource_pool, _type, _num) | |
| 81 | #define global_free(v) pool_free(global_resource_pool, v) | |
| 77 | #define global_alloc(_type) pool_alloc(global_resource_pool(), _type) | |
| 78 | #define global_alloc_clear(_type) pool_alloc_clear(global_resource_pool(), _type) | |
| 79 | #define global_alloc_array(_type, _num) pool_alloc_array(global_resource_pool(), _type, _num) | |
| 80 | #define global_alloc_array_clear(_type, _num) pool_alloc_array_clear(global_resource_pool(), _type, _num) | |
| 81 | #define global_free(v) pool_free(global_resource_pool(), v) | |
| 82 | 82 | |
| 83 | 83 | |
| 84 | 84 | |
| r14223 | r14224 | |
| 281 | 281 | |
| 282 | 282 | public: |
| 283 | 283 | resource_pool(int hash_size = 193); |
| 284 | ~resource_pool(); | |
| 284 | virtual ~resource_pool(); | |
| 285 | 285 | |
| 286 | 286 | void add(resource_pool_item &item); |
| 287 | 287 | void remove(resource_pool_item &item) { remove(item.m_ptr); } |
| r14223 | r14224 | |
| 308 | 308 | // GLOBAL VARIABLES |
| 309 | 309 | //************************************************************************** |
| 310 | 310 | |
| 311 | // global resource pool | |
| 312 | extern resource_pool global_resource_pool; | |
| 313 | ||
| 314 | 311 | // dummy objects to pass to the specialized new variants |
| 315 | 312 | extern const zeromem_t zeromem; |
| 316 | 313 | |
| 317 | 314 | |
| 315 | resource_pool &global_resource_pool(); | |
| 318 | 316 | |
| 317 | ||
| 318 | ||
| 319 | 319 | //************************************************************************** |
| 320 | 320 | // ADDDITIONAL MACROS |
| 321 | 321 | //************************************************************************** |
| r14223 | r14224 | |
|---|---|---|
| 682 | 682 | virtual const rom_entry *device_rom_region() const; |
| 683 | 683 | virtual ioport_constructor device_input_ports() const; |
| 684 | 684 | virtual void device_start(); |
| 685 | virtual void device_reset(); | |
| 685 | virtual void device_reset_after_children(); | |
| 686 | 686 | |
| 687 | 687 | // internal helpers |
| 688 | 688 | inline UINT16 paletteram16_le(offs_t offset) const { return m_generic_paletteram[offset & ~1] | (m_generic_paletteram[offset | 1] << 8); } |
| r14223 | r14224 | |
|---|---|---|
| 1066 | 1066 | |
| 1067 | 1067 | /* count how many identical sound chips we have */ |
| 1068 | 1068 | int count = 1; |
| 1069 | // for (device_sound_interface *scan = snditer.current(); scan != NULL; scan = snditer.next()) | |
| 1070 | // { | |
| 1071 | // if (sound->device().type() != scan->device().type() || sound->device().clock() != scan->device().clock()) | |
| 1072 | // break; | |
| 1073 | // count++; | |
| 1074 | // sound = scan; | |
| 1075 | // } | |
| 1069 | for (device_sound_interface *scan = snditer.next(); scan != NULL; scan = snditer.next()) | |
| 1070 | { | |
| 1071 | if (sound->device().type() != scan->device().type() || sound->device().clock() != scan->device().clock()) | |
| 1072 | break; | |
| 1073 | count++; | |
| 1074 | sound = scan; | |
| 1075 | } | |
| 1076 | 1076 | snditer.set_current(*sound); |
| 1077 | 1077 | |
| 1078 | 1078 | /* if more than one, prepend a #x in front of the CPU name */ |
| r14223 | r14224 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | public: |
| 61 | 61 | // construction/destruction |
| 62 | simple_list(resource_pool &pool = global_resource_pool) : | |
| 63 | m_head(NULL), | |
| 64 | m_tail(NULL), | |
| 65 | m_pool(pool), | |
| 66 | m_count(0) { } | |
| 62 | simple_list(resource_pool &pool = global_resource_pool()) | |
| 63 | : m_head(NULL), | |
| 64 | m_tail(NULL), | |
| 65 | m_pool(pool), | |
| 66 | m_count(0) { } | |
| 67 | 67 | |
| 68 | 68 | virtual ~simple_list() { reset(); } |
| 69 | 69 | |
| r14223 | r14224 | |
| 307 | 307 | |
| 308 | 308 | public: |
| 309 | 309 | // construction/destruction |
| 310 | fixed_allocator(resource_pool &pool = global_resource_pool) | |
| 310 | fixed_allocator(resource_pool &pool = global_resource_pool()) | |
| 311 | 311 | : m_freelist(pool) { } |
| 312 | 312 | |
| 313 | 313 | // allocate a new item, either by recycling an old one, or by allocating a new one |
| r14223 | r14224 | |
| 343 | 343 | |
| 344 | 344 | public: |
| 345 | 345 | // construction/destruction |
| 346 | tagged_list(resource_pool &pool = global_resource_pool) : | |
| 347 | m_list(pool) { } | |
| 346 | tagged_list(resource_pool &pool = global_resource_pool()) | |
| 347 | : m_list(pool) { } | |
| 348 | 348 | |
| 349 | 349 | // simple getters |
| 350 | 350 | resource_pool &pool() const { return m_list.pool(); } |
| r14223 | r14224 | |
|---|---|---|
| 260 | 260 | |
| 261 | 261 | public: |
| 262 | 262 | // construction/destruction |
| 263 | render_screen_list(resource_pool &pool = global_resource_pool) | |
| 263 | render_screen_list(resource_pool &pool = global_resource_pool()) | |
| 264 | 264 | : m_list(pool) { } |
| 265 | 265 | |
| 266 | 266 | // getters |
| r14223 | r14224 | |
|---|---|---|
| 34 | 34 | TYPE DEFINITIONS |
| 35 | 35 | ***************************************************************************/ |
| 36 | 36 | |
| 37 | typedef struct _open_chd open_chd; | |
| 38 | struct _open_chd | |
| 37 | class open_chd | |
| 39 | 38 | { |
| 40 | open_chd * next; /* pointer to next in the list */ | |
| 41 | const char * region; /* disk region we came from */ | |
| 42 | chd_file * origchd; /* handle to the original CHD */ | |
| 43 | emu_file * origfile; /* file handle to the original CHD file */ | |
| 44 | chd_file * diffchd; /* handle to the diff CHD */ | |
| 45 | emu_file * difffile; /* file handle to the diff CHD file */ | |
| 39 | friend class simple_list<open_chd>; | |
| 40 | ||
| 41 | public: | |
| 42 | open_chd(const char *region, emu_file &file, chd_file &chdfile, emu_file *difffile = NULL, chd_file *diffchd = NULL) | |
| 43 | : m_next(NULL), | |
| 44 | m_region(region), | |
| 45 | m_origchd(&chdfile), | |
| 46 | m_origfile(&file), | |
| 47 | m_diffchd(diffchd), | |
| 48 | m_difffile(difffile) { } | |
| 49 | ||
| 50 | ~open_chd() | |
| 51 | { | |
| 52 | if (m_diffchd != NULL) chd_close(m_diffchd); | |
| 53 | global_free(m_difffile); | |
| 54 | chd_close(m_origchd); | |
| 55 | global_free(m_origfile); | |
| 56 | } | |
| 57 | ||
| 58 | open_chd *next() const { return m_next; } | |
| 59 | const char *region() const { return m_region; } | |
| 60 | chd_file *chd() const { return (m_diffchd != NULL) ? m_diffchd : m_origchd; } | |
| 61 | ||
| 62 | private: | |
| 63 | open_chd * m_next; /* pointer to next in the list */ | |
| 64 | astring m_region; /* disk region we came from */ | |
| 65 | chd_file * m_origchd; /* handle to the original CHD */ | |
| 66 | emu_file * m_origfile; /* file handle to the original CHD file */ | |
| 67 | chd_file * m_diffchd; /* handle to the diff CHD */ | |
| 68 | emu_file * m_difffile; /* file handle to the diff CHD file */ | |
| 46 | 69 | }; |
| 47 | 70 | |
| 48 | 71 | |
| r14223 | r14224 | |
| 65 | 88 | UINT32 romstotalsize; /* total size of ROMs to read */ |
| 66 | 89 | |
| 67 | 90 | emu_file * file; /* current file */ |
| 68 | open_chd * chd_list; /* disks */ | |
| 69 | open_chd ** chd_list_tailptr; | |
| 91 | simple_list<open_chd> chd_list; /* disks */ | |
| 70 | 92 | |
| 71 | 93 | memory_region * region; /* info about current region */ |
| 72 | 94 | |
| r14223 | r14224 | |
| 132 | 154 | |
| 133 | 155 | chd_file *get_disk_handle(running_machine &machine, const char *region) |
| 134 | 156 | { |
| 135 | open_chd *curdisk; | |
| 136 | ||
| 137 | for (curdisk = machine.romload_data->chd_list; curdisk != NULL; curdisk = curdisk->next) | |
| 138 | if (strcmp(curdisk->region, region) == 0) | |
| 139 | return (curdisk->diffchd != NULL) ? curdisk->diffchd : curdisk->origchd; | |
| 157 | for (open_chd *curdisk = machine.romload_data->chd_list.first(); curdisk != NULL; curdisk = curdisk->next()) | |
| 158 | if (strcmp(curdisk->region(), region) == 0) | |
| 159 | return curdisk->chd(); | |
| 140 | 160 | return NULL; |
| 141 | 161 | } |
| 142 | 162 | |
| 143 | 163 | |
| 144 | 164 | /*------------------------------------------------- |
| 145 | add_disk_handle - add a disk to the to the | |
| 146 | list of CHD files | |
| 147 | -------------------------------------------------*/ | |
| 148 | ||
| 149 | static void add_disk_handle(running_machine &machine, open_chd *chd) | |
| 150 | { | |
| 151 | romload_private *romload_data = machine.romload_data; | |
| 152 | ||
| 153 | *romload_data->chd_list_tailptr = auto_alloc(machine, open_chd); | |
| 154 | **romload_data->chd_list_tailptr = *chd; | |
| 155 | romload_data->chd_list_tailptr = &(*romload_data->chd_list_tailptr)->next; | |
| 156 | } | |
| 157 | ||
| 158 | ||
| 159 | /*------------------------------------------------- | |
| 160 | 165 | set_disk_handle - set a pointer to the CHD |
| 161 | 166 | file associated with the given region |
| 162 | 167 | -------------------------------------------------*/ |
| 163 | 168 | |
| 164 | 169 | void set_disk_handle(running_machine &machine, const char *region, emu_file &file, chd_file &chdfile) |
| 165 | 170 | { |
| 166 | open_chd chd = { 0 }; | |
| 167 | ||
| 168 | /* note the region we are in */ | |
| 169 | chd.region = region; | |
| 170 | chd.origchd = &chdfile; | |
| 171 | chd.origfile = &file; | |
| 172 | ||
| 173 | /* we're okay, add to the list of disks */ | |
| 174 | add_disk_handle(machine, &chd); | |
| 171 | machine.romload_data->chd_list.append(*global_alloc(open_chd(region, file, chdfile))); | |
| 175 | 172 | } |
| 176 | 173 | |
| 177 | 174 | |
| r14223 | r14224 | |
| 1224 | 1221 | if (ROMENTRY_ISFILE(romp)) |
| 1225 | 1222 | { |
| 1226 | 1223 | hash_collection hashes(ROM_GETHASHDATA(romp)); |
| 1227 | open_chd chd = { 0 }; | |
| 1228 | 1224 | chd_header header; |
| 1229 | 1225 | chd_error err; |
| 1230 | 1226 | |
| 1231 | /* note the region we are in */ | |
| 1232 | chd.region = regiontag; | |
| 1233 | ||
| 1234 | 1227 | /* make the filename of the source */ |
| 1235 | 1228 | astring filename(ROM_GETNAME(romp), ".chd"); |
| 1236 | 1229 | |
| 1237 | 1230 | /* first open the source drive */ |
| 1231 | chd_file *origchd; | |
| 1232 | emu_file *origfile; | |
| 1238 | 1233 | LOG(("Opening disk image: %s\n", filename.cstr())); |
| 1239 | err = open_disk_image(romdata->machine().options(), &romdata->machine().system(), romp, & | |
| 1234 | err = open_disk_image(romdata->machine().options(), &romdata->machine().system(), romp, & | |
| 1240 | 1235 | if (err != CHDERR_NONE) |
| 1241 | 1236 | { |
| 1242 | 1237 | if (err == CHDERR_FILE_NOT_FOUND) |
| r14223 | r14224 | |
| 1255 | 1250 | } |
| 1256 | 1251 | |
| 1257 | 1252 | /* get the header and extract the SHA1 */ |
| 1258 | header = *chd_get_header( | |
| 1253 | header = *chd_get_header( | |
| 1259 | 1254 | hash_collection acthashes; |
| 1260 | 1255 | acthashes.add_from_buffer(hash_collection::HASH_SHA1, header.sha1, sizeof(header.sha1)); |
| 1261 | 1256 | |
| r14223 | r14224 | |
| 1273 | 1268 | } |
| 1274 | 1269 | |
| 1275 | 1270 | /* if not read-only, make the diff file */ |
| 1271 | chd_file *diffchd = NULL; | |
| 1272 | emu_file *difffile = NULL; | |
| 1276 | 1273 | if (!DISK_ISREADONLY(romp)) |
| 1277 | 1274 | { |
| 1278 | 1275 | /* try to open or create the diff */ |
| 1279 | err = open_disk_diff(romdata->machine().options(), romp, | |
| 1276 | err = open_disk_diff(romdata->machine().options(), romp, | |
| 1280 | 1277 | if (err != CHDERR_NONE) |
| 1281 | 1278 | { |
| 1282 | 1279 | romdata->errorstring.catprintf("%s DIFF CHD ERROR: %s\n", filename.cstr(), chd_error_string(err)); |
| r14223 | r14224 | |
| 1287 | 1284 | |
| 1288 | 1285 | /* we're okay, add to the list of disks */ |
| 1289 | 1286 | LOG(("Assigning to handle %d\n", DISK_GETINDEX(romp))); |
| 1290 | | |
| 1287 | romd | |
| 1291 | 1288 | } |
| 1292 | 1289 | } |
| 1293 | 1290 | } |
| r14223 | r14224 | |
| 1502 | 1499 | process_rom_entries(romdata, (source->shortname()!=NULL) ? source->shortname() : NULL, region, region + 1); |
| 1503 | 1500 | } |
| 1504 | 1501 | else if (ROMREGION_ISDISKDATA(region)) |
| 1505 | process_disk_entries(romdata, | |
| 1502 | process_disk_entries(romdata, | |
| 1506 | 1503 | } |
| 1507 | 1504 | |
| 1508 | 1505 | /* now go back and post-process all the regions */ |
| r14223 | r14224 | |
| 1539 | 1536 | count_roms(romdata); |
| 1540 | 1537 | |
| 1541 | 1538 | /* reset the disk list */ |
| 1542 | romdata->chd_list = NULL; | |
| 1543 | romdata->chd_list_tailptr = &machine.romload_data->chd_list; | |
| 1539 | romdata->chd_list.reset(); | |
| 1544 | 1540 | |
| 1545 | 1541 | /* process the ROM entries we were passed */ |
| 1546 | 1542 | process_region_list(romdata); |
| r14223 | r14224 | |
| 1556 | 1552 | |
| 1557 | 1553 | static void rom_exit(running_machine &machine) |
| 1558 | 1554 | { |
| 1559 | open_chd *curchd; | |
| 1560 | ||
| 1561 | /* close all hard drives */ | |
| 1562 | for (curchd = machine.romload_data->chd_list; curchd != NULL; curchd = curchd->next) | |
| 1563 | { | |
| 1564 | if (curchd->diffchd != NULL) | |
| 1565 | chd_close(curchd->diffchd); | |
| 1566 | if (curchd->difffile != NULL) | |
| 1567 | global_free(curchd->difffile); | |
| 1568 | if (curchd->origchd != NULL) | |
| 1569 | chd_close(curchd->origchd); | |
| 1570 | if (curchd->origfile != NULL) | |
| 1571 | global_free(curchd->origfile); | |
| 1572 | } | |
| 1573 | 1555 | } |
| 1574 | 1556 | |
| 1575 | 1557 |
| r14223 | r14224 | |
|---|---|---|
| 262 | 262 | |
| 263 | 263 | // reset the device |
| 264 | 264 | device_reset(); |
| 265 | ||
| 266 | // reset all child devices | |
| 267 | for (device_t *child = m_subdevice_list.first(); child != NULL; child = child->next()) | |
| 268 | child->reset(); | |
| 269 | ||
| 270 | // now allow for some post-child reset action | |
| 271 | device_reset_after_children(); | |
| 265 | 272 | |
| 266 | 273 | // let the interfaces do their post-work |
| 267 | 274 | for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next()) |
| r14223 | r14224 | |
| 580 | 587 | |
| 581 | 588 | |
| 582 | 589 | //------------------------------------------------- |
| 590 | // device_reset_after_children - hook to do | |
| 591 | // reset logic that must happen after the children | |
| 592 | // are reset; designed to be overriden by the | |
| 593 | // actual device implementation | |
| 594 | //------------------------------------------------- | |
| 595 | ||
| 596 | void device_t::device_reset_after_children() | |
| 597 | { | |
| 598 | // do nothing by default | |
| 599 | } | |
| 600 | ||
| 601 | ||
| 602 | //------------------------------------------------- | |
| 583 | 603 | // device_stop - clean up anything that needs to |
| 584 | 604 | // happen before the running_machine goes away |
| 585 | 605 | //------------------------------------------------- |
| r14223 | r14224 | |
|---|---|---|
| 186 | 186 | astring &siblingtag(astring &dest, const char *tag) const { return (this != NULL && m_owner != NULL) ? m_owner->subtag(dest, tag) : dest.cpy(tag); } |
| 187 | 187 | const memory_region *subregion(const char *tag) const; |
| 188 | 188 | device_t *subdevice(const char *tag) const; |
| 189 | device_t *siblingdevice(const char *tag) const | |
| 189 | device_t *siblingdevice(const char *tag) const | |
| 190 | 190 | template<class _DeviceClass> inline _DeviceClass *subdevice(const char *tag) const { return downcast<_DeviceClass *>(subdevice(tag)); } |
| 191 | 191 | template<class _DeviceClass> inline _DeviceClass *siblingdevice(const char *tag) const { return downcast<_DeviceClass *>(siblingdevice(tag)); } |
| 192 | 192 | const memory_region *region() const { return m_region; } |
| r14223 | r14224 | |
| 248 | 248 | virtual void device_start() ATTR_COLD = 0; |
| 249 | 249 | virtual void device_stop() ATTR_COLD; |
| 250 | 250 | virtual void device_reset() ATTR_COLD; |
| 251 | virtual void device_reset_after_children() ATTR_COLD; | |
| 251 | 252 | virtual void device_pre_save() ATTR_COLD; |
| 252 | 253 | virtual void device_post_load() ATTR_COLD; |
| 253 | 254 | virtual void device_clock_changed(); |
| r14223 | r14224 | |
| 754 | 755 | |
| 755 | 756 | |
| 756 | 757 | //------------------------------------------------- |
| 758 | // siblingdevice - given a tag, find the device | |
| 759 | // by name relative to this device's parent | |
| 760 | //------------------------------------------------- | |
| 761 | ||
| 762 | inline device_t *device_t::siblingdevice(const char *tag) const | |
| 763 | { | |
| 764 | // safety first | |
| 765 | if (this == NULL) | |
| 766 | return NULL; | |
| 767 | ||
| 768 | // empty string or NULL means this device | |
| 769 | if (tag == NULL || *tag == 0) | |
| 770 | return const_cast<device_t *>(this); | |
| 771 | ||
| 772 | // leading caret implies the owner, just skip it | |
| 773 | if (tag[0] == '^') tag++; | |
| 774 | ||
| 775 | // query relative to the parent | |
| 776 | return (m_owner != NULL) ? m_owner->subdevice(tag) : NULL; | |
| 777 | } | |
| 778 | ||
| 779 | ||
| 780 | //------------------------------------------------- | |
| 757 | 781 | // bind_relative_to - perform a late binding of |
| 758 | 782 | // a device_delegate |
| 759 | 783 | //------------------------------------------------- |
| r14223 | r14224 | |
|---|---|---|
| 316 | 316 | NVRAM depending of selected BIOS |
| 317 | 317 | -------------------------------------------------*/ |
| 318 | 318 | |
| 319 | static astring nvram_filename( | |
| 319 | static astring &nvram_filename( | |
| 320 | 320 | { |
| 321 | if (rom_system_bios(machine) == 0 || rom_default_bios(machine) == rom_system_bios(machine)) { | |
| 322 | result.printf("%s",machine.basename()); | |
| 323 | } else { | |
| 324 | result.printf("%s_%d",machine.basename(),rom_system_bios(machine) - 1); | |
| 325 | } | |
| 326 | return result; | |
| 327 | } | |
| 321 | running_machine &machine = device.machine(); | |
| 328 | 322 | |
| 329 | /*------------------------------------------------- | |
| 330 | nvram_filename - returns filename of system's | |
| 331 | NVRAM depending of selected BIOS | |
| 332 | -------------------------------------------------*/ | |
| 323 | // start with either basename or basename_biosnum | |
| 324 | result.cpy(machine.basename()); | |
| 325 | if (rom_system_bios(machine) != 0 && rom_default_bios(machine) != rom_system_bios(machine)) | |
| 326 | result.catprintf("_%d", rom_system_bios(machine) - 1); | |
| 333 | 327 | |
| 334 | static astring nvram_filename(device_t &device, astring &result) | |
| 335 | { | |
| 336 | running_machine &machine = device.machine(); | |
| 337 | astring name = astring(device.tag()).replacechr(':','_'); | |
| 338 | if (rom_system_bios(machine) == 0 || rom_default_bios(machine) == rom_system_bios(machine)) { | |
| 339 | result.printf("%s\\%s",machine.basename(),name.cstr()); | |
| 340 | } else { | |
| 341 | result.printf("%s_%d\\%s",machine.basename(),rom_system_bios(machine) - 1,name.cstr()); | |
| 328 | // device-based NVRAM gets its own name in a subdirectory | |
| 329 | if (&device != &device.machine().root_device()) | |
| 330 | { | |
| 331 | astring tag(device.tag()); | |
| 332 | tag.del(0, 1).replacechr(':', '_'); | |
| 333 | result.cat('\\').cat(tag); | |
| 342 | 334 | } |
| 343 | 335 | return result; |
| 344 | 336 | } |
| r14223 | r14224 | |
| 353 | 345 | { |
| 354 | 346 | astring filename; |
| 355 | 347 | emu_file file(machine.options().nvram_directory(), OPEN_FLAG_READ); |
| 356 | if (file.open(nvram_filename(machine | |
| 348 | if (file.open(nvram_filename(filename, machine.root_device( | |
| 357 | 349 | { |
| 358 | 350 | (*machine.config().m_nvram_handler)(machine, &file, FALSE); |
| 359 | 351 | file.close(); |
| r14223 | r14224 | |
| 369 | 361 | { |
| 370 | 362 | astring filename; |
| 371 | 363 | emu_file file(machine.options().nvram_directory(), OPEN_FLAG_READ); |
| 372 | if (file.open(nvram_filename(nvram->device() | |
| 364 | if (file.open(nvram_filename(filename, nvram->device() | |
| 373 | 365 | { |
| 374 | 366 | nvram->nvram_load(file); |
| 375 | 367 | file.close(); |
| r14223 | r14224 | |
| 390 | 382 | { |
| 391 | 383 | astring filename; |
| 392 | 384 | emu_file file(machine.options().nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); |
| 393 | if (file.open(nvram_filename(machine | |
| 385 | if (file.open(nvram_filename(filename, machine.root_device() | |
| 394 | 386 | { |
| 395 | 387 | (*machine.config().m_nvram_handler)(machine, &file, TRUE); |
| 396 | 388 | file.close(); |
| r14223 | r14224 | |
| 402 | 394 | { |
| 403 | 395 | astring filename; |
| 404 | 396 | emu_file file(machine.options().nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); |
| 405 | if (file.open(nvram_filename(nvram->device() | |
| 397 | if (file.open(nvram_filename(filename, nvram->device() | |
| 406 | 398 | { |
| 407 | 399 | nvram->nvram_save(file); |
| 408 | 400 | file.close(); |
| Previous | 15994 Revisions | Next |