VIDEO_START_MEMBER(vindictr_state,vindictr) { static const atarimo_desc modesc = { 0, /* index to which gfx system */ 1, /* number of motion object banks */ 1, /* are the entries linked? */ 0, /* are the entries split? */ 0, /* render in reverse order? */ 0, /* render in swapped X/Y order? */ 0, /* does the neighbor bit affect the next object? */ 8, /* pixels per SLIP entry (0 for no-slip) */ 0, /* pixel offset for SLIPs */ 0, /* maximum number of links to visit/scanline (0=all) */ 0x100, /* base palette entry */ 0x100, /* maximum number of colors */ 0, /* transparent pen index */ {{ 0,0,0,0x03ff }}, /* mask for the link */ {{ 0 }}, /* mask for the graphics bank */ {{ 0x7fff,0,0,0 }}, /* mask for the code index */ {{ 0 }}, /* mask for the upper code index */ {{ 0,0x000f,0,0 }}, /* mask for the color */ {{ 0,0xff80,0,0 }}, /* mask for the X position */ {{ 0,0,0xff80,0 }}, /* mask for the Y position */ {{ 0,0,0x0038,0 }}, /* mask for the width, in tiles*/ {{ 0,0,0x0007,0 }}, /* mask for the height, in tiles */ {{ 0,0,0x0040,0 }}, /* mask for the horizontal flip */ {{ 0 }}, /* mask for the vertical flip */ {{ 0,0x0070,0,0 }}, /* mask for the priority */ {{ 0 }}, /* mask for the neighbor */ {{ 0 }}, /* mask for absolute coordinates */ {{ 0 }}, /* mask for the special value */ 0, /* resulting value to indicate "special" */ NULL /* callback routine for special entries */ }; /* initialize the playfield */ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(vindictr_state::get_playfield_tile_info),this), TILEMAP_SCAN_COLS, 8,8, 64,64); /* initialize the motion objects */ atarimo_init(machine(), 0, &modesc); /* initialize the alphanumerics */ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(vindictr_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32); m_alpha_tilemap->set_transparent_pen(0); /* save states */ save_item(NAME(m_playfield_tile_bank)); save_item(NAME(m_playfield_xscroll)); save_item(NAME(m_playfield_yscroll)); }
VIDEO_START_MEMBER(rampart_state,rampart) { static const atarimo_desc modesc = { 0, /* index to which gfx system */ 1, /* number of motion object banks */ 1, /* are the entries linked? */ 0, /* are the entries split? */ 0, /* render in reverse order? */ 0, /* render in swapped X/Y order? */ 0, /* does the neighbor bit affect the next object? */ 8, /* pixels per SLIP entry (0 for no-slip) */ 0, /* pixel offset for SLIPs */ 0, /* maximum number of links to visit/scanline (0=all) */ 0x100, /* base palette entry */ 0x100, /* maximum number of colors */ 0, /* transparent pen index */ {{ 0x00ff,0,0,0 }}, /* mask for the link */ {{ 0 }}, /* mask for the graphics bank */ {{ 0,0x7fff,0,0 }}, /* mask for the code index */ {{ 0 }}, /* mask for the upper code index */ {{ 0,0,0x000f,0 }}, /* mask for the color */ {{ 0,0,0xff80,0 }}, /* mask for the X position */ {{ 0,0,0,0xff80 }}, /* mask for the Y position */ {{ 0,0,0,0x0070 }}, /* mask for the width, in tiles*/ {{ 0,0,0,0x0007 }}, /* mask for the height, in tiles */ {{ 0,0x8000,0,0 }}, /* mask for the horizontal flip */ {{ 0 }}, /* mask for the vertical flip */ {{ 0 }}, /* mask for the priority */ {{ 0 }}, /* mask for the neighbor */ {{ 0 }}, /* mask for absolute coordinates */ {{ 0 }}, /* mask for the special value */ 0, /* resulting value to indicate "special" */ 0, /* callback routine for special entries */ }; /* initialize the motion objects */ atarimo_init(machine(), 0, &modesc); /* set the intial scroll offset */ atarimo_set_xscroll(0, -12); }
int batman_vh_start(void) { static const struct ataripf_desc pf0desc = { 0, /* index to which gfx system */ 64,64, /* size of the playfield in tiles (x,y) */ 64,1, /* tile_index = x * xmult + y * ymult (xmult,ymult) */ 0x300, /* index of palette base */ 0x500, /* maximum number of colors */ 0, /* color XOR for shadow effect (if any) */ 0x003f, /* latch mask */ 0, /* transparent pen mask */ 0x007fff, /* tile data index mask */ 0x4f0000, /* tile data color mask */ 0x008000, /* tile data hflip mask */ 0, /* tile data vflip mask */ 0x300000 /* tile data priority mask */ }; static const struct ataripf_desc pf1desc = { 0, /* index to which gfx system */ 64,64, /* size of the playfield in tiles (x,y) */ 64,1, /* tile_index = x * xmult + y * ymult (xmult,ymult) */ 0x200, /* index of palette base */ 0x500, /* maximum number of colors */ 0, /* color XOR for shadow effect (if any) */ 0x3f00, /* latch mask */ 0x0001, /* transparent pen mask */ 0x007fff, /* tile data index mask */ 0x4f0000, /* tile data color mask */ 0x008000, /* tile data hflip mask */ 0, /* tile data vflip mask */ 0x300000 /* tile data priority mask */ }; static const struct atarimo_desc modesc = { 1, /* index to which gfx system */ 1, /* number of motion object banks */ 1, /* are the entries linked? */ 0, /* are the entries split? */ 1, /* render in reverse order? */ 0, /* render in swapped X/Y order? */ 0, /* does the neighbor bit affect the next object? */ 8, /* pixels per SLIP entry (0 for no-slip) */ 8, /* number of scanlines between MO updates */ 0x100, /* base palette entry */ 0x500, /* maximum number of colors */ 0, /* transparent pen index */ {{ 0x03ff,0,0,0 }}, /* mask for the link */ {{ 0 }}, /* mask for the graphics bank */ {{ 0,0x7fff,0,0 }}, /* mask for the code index */ {{ 0 }}, /* mask for the upper code index */ {{ 0,0,0x000f,0 }}, /* mask for the color */ {{ 0,0,0xff80,0 }}, /* mask for the X position */ {{ 0,0,0,0xff80 }}, /* mask for the Y position */ {{ 0,0,0,0x0070 }}, /* mask for the width, in tiles*/ {{ 0,0,0,0x0007 }}, /* mask for the height, in tiles */ {{ 0,0x8000,0,0 }}, /* mask for the horizontal flip */ {{ 0 }}, /* mask for the vertical flip */ {{ 0,0,0x0030,0 }}, /* mask for the priority */ {{ 0 }}, /* mask for the neighbor */ {{ 0 }}, /* mask for absolute coordinates */ {{ 0 }}, /* mask for the ignore value */ 0, /* resulting value to indicate "ignore" */ 0 /* callback routine for ignored entries */ }; static const struct atarian_desc andesc = { 2, /* index to which gfx system */ 64,32, /* size of the alpha RAM in tiles (x,y) */ 0x000, /* index of palette base */ 0x100, /* maximum number of colors */ 0, /* mask of the palette split */ 0x707ff, /* tile data index mask */ 0x07800, /* tile data color mask */ 0, /* tile data hflip mask */ 0x08000 /* tile data opacity mask */ }; UINT32 *pflookup, *anlookup; int i, size; /* initialize the playfield */ if (!ataripf_init(0, &pf0desc)) goto cant_create_pf0; /* initialize the second playfield */ if (!ataripf_init(1, &pf1desc)) goto cant_create_pf1; /* initialize the motion objects */ if (!atarimo_init(0, &modesc)) goto cant_create_mo; /* initialize the alphanumerics */ if (!atarian_init(0, &andesc)) goto cant_create_an; /* modify the playfield 0 lookup table to handle the palette bank */ pflookup = ataripf_get_lookup(0, &size); for (i = 0; i < size; i++) { int color = ATARIPF_LOOKUP_COLOR(pflookup[i]); if (color & 0x10) color ^= 0x50; ATARIPF_LOOKUP_SET_COLOR(pflookup[i], color); } /* modify the playfield 1 lookup table to handle the palette bank */ pflookup = ataripf_get_lookup(1, &size); for (i = 0; i < size; i++) { int color = ATARIPF_LOOKUP_COLOR(pflookup[i]); if (color & 0x10) color ^= 0x50; ATARIPF_LOOKUP_SET_COLOR(pflookup[i], color); } /* modify the alphanumerics lookup table to handle the code bank */ anlookup = atarian_get_lookup(0, &size); for (i = 0; i < size; i++) { int entry = i << ATARIAN_LOOKUP_DATABITS; int code = entry & 0x3ff; if (entry & 0x400) code += (entry >> 16) * 0x400; ATARIAN_LOOKUP_SET_CODE(anlookup[i], code); } return 0; /* error cases */ cant_create_an: atarimo_free(); cant_create_mo: cant_create_pf1: ataripf_free(); cant_create_pf0: return 1; }
VIDEO_START_MEMBER(atarisy2_state,atarisy2) { static const atarimo_desc modesc = { 1, /* index to which gfx system */ 1, /* number of motion object banks */ 1, /* are the entries linked? */ 0, /* are the entries split? */ 0, /* render in reverse order? */ 0, /* render in swapped X/Y order? */ 0, /* does the neighbor bit affect the next object? */ 0, /* pixels per SLIP entry (0 for no-slip) */ 0, /* pixel offset for SLIPs */ 0, /* maximum number of links to visit/scanline (0=all) */ 0x00, /* base palette entry */ 0x40, /* maximum number of colors */ 15, /* transparent pen index */ {{ 0,0,0,0x07f8 }}, /* mask for the link */ {{ 0 }}, /* mask for the graphics bank */ {{ 0,0x07ff,0,0 }}, /* mask for the code index */ {{ 0x0007,0,0,0 }}, /* mask for the upper code index */ {{ 0,0,0,0x3000 }}, /* mask for the color */ {{ 0,0,0xffc0,0 }}, /* mask for the X position */ {{ 0x7fc0,0,0,0 }}, /* mask for the Y position */ {{ 0 }}, /* mask for the width, in tiles*/ {{ 0,0x3800,0,0 }}, /* mask for the height, in tiles */ {{ 0,0x4000,0,0 }}, /* mask for the horizontal flip */ {{ 0 }}, /* mask for the vertical flip */ {{ 0,0,0,0xc000 }}, /* mask for the priority */ {{ 0,0x8000,0,0 }}, /* mask for the neighbor */ {{ 0 }}, /* mask for absolute coordinates */ {{ 0 }}, /* mask for the special value */ 0, /* resulting value to indicate "special" */ 0 /* callback routine for special entries */ }; /* initialize banked memory */ m_alpha.set_target(&m_vram[0x0000], 0x2000); m_playfield.set_target(&m_vram[0x2000], 0x2000); /* initialize the playfield */ m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarisy2_state::get_playfield_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 128,64); /* initialize the motion objects */ atarimo_init(machine(), 0, &modesc); /* initialize the alphanumerics */ m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(atarisy2_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,48); m_alpha_tilemap->set_transparent_pen(0); /* reset the statics */ m_yscroll_reset_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(atarisy2_state::reset_yscroll_callback),this)); m_videobank = 0; /* save states */ save_item(NAME(m_playfield_tile_bank)); save_item(NAME(m_videobank)); save_item(NAME(m_vram)); }
int atarisys2_vh_start(void) { static const struct ataripf_desc pfdesc = { 0, /* index to which gfx system */ 128,64, /* size of the playfield in tiles (x,y) */ 1,128, /* tile_index = x * xmult + y * ymult (xmult,ymult) */ 0x80, /* index of palette base */ 0x80, /* maximum number of colors */ 0, /* color XOR for shadow effect (if any) */ 0, /* latch mask */ 0, /* transparent pen mask */ 0xff07ff, /* tile data index mask */ 0x003800, /* tile data color mask */ 0, /* tile data hflip mask */ 0, /* tile data vflip mask */ 0x00c000 /* tile data priority mask */ }; static const struct atarimo_desc modesc = { 1, /* index to which gfx system */ 1, /* number of motion object banks */ 1, /* are the entries linked? */ 0, /* are the entries split? */ 0, /* render in reverse order? */ 0, /* render in swapped X/Y order? */ 0, /* does the neighbor bit affect the next object? */ 0, /* pixels per SLIP entry (0 for no-slip) */ 8, /* number of scanlines between MO updates */ 0x00, /* base palette entry */ 0x40, /* maximum number of colors */ 15, /* transparent pen index */ {{ 0,0,0,0x07f8 }}, /* mask for the link */ {{ 0 }}, /* mask for the graphics bank */ {{ 0,0x07ff,0,0 }}, /* mask for the code index */ {{ 0x0007,0,0,0 }}, /* mask for the upper code index */ {{ 0,0,0,0x3000 }}, /* mask for the color */ {{ 0,0,0xffc0,0 }}, /* mask for the X position */ {{ 0x7fc0,0,0,0 }}, /* mask for the Y position */ {{ 0 }}, /* mask for the width, in tiles*/ {{ 0,0x3800,0,0 }}, /* mask for the height, in tiles */ {{ 0,0x4000,0,0 }}, /* mask for the horizontal flip */ {{ 0 }}, /* mask for the vertical flip */ {{ 0,0,0,0xc000 }}, /* mask for the priority */ {{ 0,0x8000,0,0 }}, /* mask for the neighbor */ {{ 0 }}, /* mask for absolute coordinates */ {{ 0 }}, /* mask for the ignore value */ 0, /* resulting value to indicate "ignore" */ 0 /* callback routine for ignored entries */ }; static const struct atarian_desc andesc = { 2, /* index to which gfx system */ 64,64, /* size of the alpha RAM in tiles (x,y) */ 0x40, /* index of palette base */ 0x40, /* maximum number of colors */ 0, /* mask of the palette split */ 0x03ff, /* tile data index mask */ 0xe000, /* tile data color mask */ 0, /* tile data hflip mask */ 0 /* tile data opacity mask */ }; UINT32 *pflookup; int i, size; /* allocate banked memory */ vram = calloc(0x8000, 1); if (!vram) goto cant_allocate_ram; atarian_0_base = &vram[0x0000]; atarimo_0_spriteram = &vram[0x0c00]; ataripf_0_base = &vram[0x2000]; /* initialize the playfield */ if (!ataripf_init(0, &pfdesc)) goto cant_create_pf; /* initialize the motion objects */ if (!atarimo_init(0, &modesc)) goto cant_create_mo; /* initialize the alphanumerics */ if (!atarian_init(0, &andesc)) goto cant_create_an; /* modify the playfield lookup table to support our odd banking system */ pflookup = ataripf_get_lookup(0, &size); for (i = 0; i < size; i++) { int code = i << ATARIPF_LOOKUP_DATABITS; int bankselect = (code >> 10) & 1; int bank = (code >> (16 + 4 * bankselect)) & 15; code = (code & 0x3ff) | (bank << 10); ATARIPF_LOOKUP_SET_CODE(pflookup[i], code); } /* initialize the (fixed) palette usage table */ if (palette_used_colors) { memset(palette_used_colors, PALETTE_COLOR_USED, Machine->drv->total_colors * sizeof(UINT8)); for (i = 0; i < 4; i++) palette_used_colors[15 + i * 16] = PALETTE_COLOR_TRANSPARENT; for (i = 0; i < 8; i++) palette_used_colors[64 + i * 4] = PALETTE_COLOR_TRANSPARENT; } /* reset the statics */ bankbits = 0; videobank = 0; return 0; /* error cases */ cant_create_mo: ataripf_free(); cant_create_pf: atarian_free(); cant_create_an: free(vram); cant_allocate_ram: return 1; }
int toobin_vh_start(void) { static const struct ataripf_desc pfdesc = { 0, /* index to which gfx system */ 128,64, /* size of the playfield in tiles (x,y) */ 1,128, /* tile_index = x * xmult + y * ymult (xmult,ymult) */ 0x000, /* index of palette base */ 0x100, /* maximum number of colors */ 0, /* color XOR for shadow effect (if any) */ 0, /* latch mask */ 0, /* transparent pen mask */ 0x003fff, /* tile data index mask */ 0x0f0000, /* tile data color mask */ 0x004000, /* tile data hflip mask */ 0x008000, /* tile data vflip mask */ 0x300000 /* tile data priority mask */ }; static const struct atarimo_desc modesc = { 1, /* index to which gfx system */ 1, /* number of motion object banks */ 1, /* are the entries linked? */ 0, /* are the entries split? */ 0, /* render in reverse order? */ 1, /* render in swapped X/Y order? */ 0, /* does the neighbor bit affect the next object? */ 1024, /* pixels per SLIP entry (0 for no-slip) */ 8, /* number of scanlines between MO updates */ 0x100, /* base palette entry */ 0x100, /* maximum number of colors */ 0, /* transparent pen index */ {{ 0,0,0x00ff,0 }}, /* mask for the link */ {{ 0 }}, /* mask for the graphics bank */ {{ 0,0x3fff,0,0 }}, /* mask for the code index */ {{ 0 }}, /* mask for the upper code index */ {{ 0,0,0,0x000f }}, /* mask for the color */ {{ 0,0,0,0xffc0 }}, /* mask for the X position */ {{ 0x7fc0,0,0,0 }}, /* mask for the Y position */ {{ 0x0007,0,0,0 }}, /* mask for the width, in tiles*/ {{ 0x0038,0,0,0 }}, /* mask for the height, in tiles */ {{ 0,0x4000,0,0 }}, /* mask for the horizontal flip */ {{ 0,0x8000,0,0 }}, /* mask for the vertical flip */ {{ 0 }}, /* mask for the priority */ {{ 0 }}, /* mask for the neighbor */ {{ 0x8000,0,0,0 }}, /* mask for absolute coordinates */ {{ 0 }}, /* mask for the ignore value */ 0, /* resulting value to indicate "ignore" */ 0 /* callback routine for ignored entries */ }; static const struct atarian_desc andesc = { 2, /* index to which gfx system */ 64,64, /* size of the alpha RAM in tiles (x,y) */ 0x200, /* index of palette base */ 0x040, /* maximum number of colors */ 0, /* mask of the palette split */ 0x03ff, /* tile data index mask */ 0xf000, /* tile data color mask */ 0x0400, /* tile data hflip mask */ 0 /* tile data opacity mask */ }; /* initialize the playfield */ if (!ataripf_init(0, &pfdesc)) goto cant_create_pf; /* initialize the motion objects */ if (!atarimo_init(0, &modesc)) goto cant_create_mo; /* initialize the alphanumerics */ if (!atarian_init(0, &andesc)) goto cant_create_an; /* reset the statics */ last_intensity = 0; return 0; /* error cases */ cant_create_an: atarimo_free(); cant_create_mo: ataripf_free(); cant_create_pf: return 1; }