/*************************************************************************** Start the video hardware emulation. ***************************************************************************/ int pbaction_vh_start(void) { int i; if (generic_vh_start() != 0) return 1; if ((dirtybuffer2 = malloc(videoram_size)) == 0) { generic_vh_stop(); return 1; } memset(dirtybuffer2,1,videoram_size); if ((tmpbitmap2 = osd_create_bitmap(Machine->drv->screen_width,Machine->drv->screen_height)) == 0) { free(dirtybuffer2); generic_vh_stop(); return 1; } /* leave everything at the default, but map all foreground 0 pens as transparent */ for (i = 0;i < 16;i++) palette_used_colors[8 * i] = PALETTE_COLOR_TRANSPARENT; return 0; }
/*************************************************************************** Start the video hardware emulation. ***************************************************************************/ int invaders_vh_start (void) { if ((tmpbitmap = osd_create_bitmap(Machine->drv->screen_width,Machine->drv->screen_height)) == 0) return 1; return 0; }
int vigilant_vh_start(void) { generic_vh_start(); if ((bg_bitmap = osd_create_bitmap(512*3,256)) == 0) { generic_vh_stop(); return 1; } return 0; }
int exidy_vh_start(void) { exidy_collision_counter = 0; if (generic_vh_start()!=0) return 1; if ((motion_object_1_vid = osd_create_bitmap(16,16)) == 0) { generic_vh_stop(); return 1; } if ((motion_object_2_vid = osd_create_bitmap(16,16)) == 0) { osd_free_bitmap(motion_object_1_vid); generic_vh_stop(); return 1; } return 0; }
int sprint2_vh_start(void) { if (generic_vh_start()!=0) return 1; if ((back_vid = osd_create_bitmap(16,8)) == 0) { generic_vh_stop(); return 1; } if ((grey_cars_vid = osd_create_bitmap(16,8)) == 0) { osd_free_bitmap(back_vid); generic_vh_stop(); return 1; } if ((black_car_vid = osd_create_bitmap(16,8)) == 0) { osd_free_bitmap(back_vid); osd_free_bitmap(grey_cars_vid); generic_vh_stop(); return 1; } if ((white_car_vid = osd_create_bitmap(16,8)) == 0) { osd_free_bitmap(back_vid); osd_free_bitmap(grey_cars_vid); osd_free_bitmap(black_car_vid); generic_vh_stop(); return 1; } return 0; }
/*************************************************************************** Start the video hardware emulation. ***************************************************************************/ int spiders_vh_start(void) { int loop; if ((tmpbitmap = osd_create_bitmap(Machine->drv->screen_width,Machine->drv->screen_height)) == 0) return 1; for(loop=0;loop<256;loop++) { bitflip[loop]=(loop&0x01)?0x80:0x00; bitflip[loop]|=(loop&0x02)?0x40:0x00; bitflip[loop]|=(loop&0x04)?0x20:0x00; bitflip[loop]|=(loop&0x08)?0x10:0x00; bitflip[loop]|=(loop&0x10)?0x08:0x00; bitflip[loop]|=(loop&0x20)?0x04:0x00; bitflip[loop]|=(loop&0x40)?0x02:0x00; bitflip[loop]|=(loop&0x80)?0x01:0x00; } if ((screenbuffer = (int *)gp2x_malloc(SCREENBUFFER_SIZE*sizeof(int))) == 0) return 1; fast_memset(screenbuffer,1,SCREENBUFFER_SIZE*sizeof(int)); return 0; }
/*************************************************************************** Start the video hardware emulation. ***************************************************************************/ int tnzs_vh_start(void) { int column,x,y; for (column=0;column<16;column++) { if ((tnzs_column[column] = osd_create_bitmap(32,256)) == 0) { /* Free all the columns */ for (column--;column;column--) osd_free_bitmap(tnzs_column[column]); return 1; } } for (x=0;x<32;x++) { for (y=0;y<16;y++) { tnzs_dirty_map[x][y] = -1; } } return 0; }
/*************************************************************************** Start the video hardware emulation. ***************************************************************************/ int congo_vh_start(void) { int offs; int sx,sy; struct osd_bitmap *prebitmap; if (generic_vh_start() != 0) return 1; /* large bitmap for the precalculated background */ if ((backgroundbitmap = osd_create_bitmap(512,2303+32)) == 0) { generic_vh_stop(); return 1; } /* create a temporary bitmap to prepare the background before converting it */ if ((prebitmap = osd_create_bitmap(4096,256)) == 0) { osd_free_bitmap(backgroundbitmap); generic_vh_stop(); return 1; } /* prepare the background */ for (offs = 0;offs < 0x4000;offs++) { sx = 8 * (511 - offs / 32); sy = 8 * (offs % 32); drawgfx(prebitmap,Machine->gfx[2], Machine->memory_region[2][offs] + 256 * (Machine->memory_region[2][0x4000 + offs] & 3), Machine->memory_region[2][0x4000 + offs] >> 4, 0,0, sx,sy, 0,TRANSPARENCY_NONE,0); } /* the background is stored as a rectangle, but is drawn by the hardware skewed: */ /* go right two pixels, then up one pixel. Doing the conversion at run time would */ /* be extremely expensive, so we do it now. To save memory, we squash the image */ /* horizontally (doing line shifts at run time is much less expensive than doing */ /* column shifts) */ for (offs = -510;offs < 4096;offs += 2) { sy = (2302-510/2) - offs/2; for (sx = 0;sx < 512;sx += 2) { if (offs + sx < 0 || offs + sx >= 4096) { backgroundbitmap->line[sy][sx] = Machine->background_pen; backgroundbitmap->line[sy][sx+1] = Machine->background_pen; } else { backgroundbitmap->line[sy][sx] = prebitmap->line[sx/2][offs + sx]; backgroundbitmap->line[sy][sx+1] = prebitmap->line[sx/2][offs + sx+1]; } } } osd_free_bitmap(prebitmap); /* free the graphics ROMs, they are no longer needed */ free(Machine->memory_region[2]); Machine->memory_region[2] = 0; return 0; }