Previous 15994 Revisions Next

r14035 Sunday 15th January, 2012 at 07:52:21 UTC by Miodrag Milanović
Sync with MAME r15033 (nw)
[src/emu]machine.c screen.c screen.h tilemap.c
[src/emu/cpu/h6280]h6280ops.h
[src/emu/machine]laserdsc.c
[src/emu/sound]cdp1864.c
[src/emu/video]315_5124.c cdp1861.c cdp1862.c v9938.c
[src/lib/util]bitmap.c bitmap.h
[src/mame/drivers]aleck64.c astrocorp.c coolridr.c gei.c lastfght.c mazerbla.c sliver.c sms.c taitotz.c tmaster.c
[src/mame/video]airbustr.c argus.c bigevglf.c bking.c blockout.c buggychl.c cave.c ccastles.c changela.c cloud9.c cvs.c dday.c decospr.c dkong.c dogfgt.c exidy.c fgoal.c firetrk.c gaiden.c galastrm.c galpanic.c gomoku.c hyhoo.c ikki.c kaneko16.c magmax.c mappy.c mcd212.c mermaid.c model3.c ms32.c nbmj8891.c nbmj8900.c nbmj8991.c nbmj9195.c ninjakd2.c niyanpai.c ojankohs.c pacland.c paradise.c psikyosh.c quasar.c shangha3.c spbactn.c sprint2.c sprint4.c sprint8.c starfire.c starshp1.c taito_f3.c taitojc.c taitosj.c tank8.c tceptor.c tecmo16.c toaplan2.c toobin.c triplhnt.c ultratnk.c wolfpack.c zac2650.c

src/mame/video/fgoal.c
r14034r14035
3232VIDEO_START( fgoal )
3333{
3434   fgoal_state *state = machine.driver_data<fgoal_state>();
35   state->m_fgbitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
36   state->m_bgbitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
35   machine.primary_screen->register_screen_bitmap(state->m_fgbitmap);
36   machine.primary_screen->register_screen_bitmap(state->m_bgbitmap);
3737
3838   state->save_item(NAME(state->m_fgbitmap));
3939   state->save_item(NAME(state->m_bgbitmap));
src/mame/video/mcd212.c
r14034r14035
15111511void mcd212_init(running_machine &machine, mcd212_regs_t *mcd212)
15121512{
15131513    mcd212->m_machine = &machine;
1514    mcd212->m_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
1514    machine.primary_screen->register_screen_bitmap(mcd212->m_bitmap);
15151515
15161516    int index = 0;
15171517    for(index = 0; index < 2; index++)
r14034r14035
16581658    state->m_mcd212_regs.scan_timer->adjust(machine.primary_screen->time_until_pos(0, 0));
16591659
16601660   screen_device *screen = downcast<screen_device *>(machine.device("lcd"));
1661    state->m_lcdbitmap.allocate(screen->width(), screen->height());
1661    screen->register_screen_bitmap(state->m_lcdbitmap);
16621662}
16631663
16641664SCREEN_UPDATE_RGB32( cdimono1 )
src/mame/video/nbmj9195.c
r14034r14035
394394   int width = machine.primary_screen->width();
395395   int height = machine.primary_screen->height();
396396
397   state->m_tmpbitmap[0].allocate(machine.primary_screen->width(), machine.primary_screen->height());
397   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap[0]);
398398   state->m_videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height);
399399   state->m_palette = auto_alloc_array(machine, UINT8, 0x200);
400400   state->m_clut[0] = auto_alloc_array(machine, UINT8, 0x1000);
r14034r14035
409409   int width = machine.primary_screen->width();
410410   int height = machine.primary_screen->height();
411411
412   state->m_tmpbitmap[0].allocate(machine.primary_screen->width(), machine.primary_screen->height());
413   state->m_tmpbitmap[1].allocate(machine.primary_screen->width(), machine.primary_screen->height());
412   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap[0]);
413   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap[1]);
414414   state->m_videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height);
415415   state->m_videoram[1] = auto_alloc_array_clear(machine, UINT16, width * height);
416416   state->m_palette = auto_alloc_array(machine, UINT8, 0x200);
r14034r14035
427427   int width = machine.primary_screen->width();
428428   int height = machine.primary_screen->height();
429429
430   state->m_tmpbitmap[0].allocate(machine.primary_screen->width(), machine.primary_screen->height());
431   state->m_tmpbitmap[1].allocate(machine.primary_screen->width(), machine.primary_screen->height());
430   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap[0]);
431   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap[1]);
432432   state->m_videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height);
433433   state->m_videoram[1] = auto_alloc_array_clear(machine, UINT16, width * height);
434434   state->m_videoworkram[0] = auto_alloc_array_clear(machine, UINT16, width * height);
src/mame/video/bking.c
r14034r14035
241241{
242242   bking_state *state = machine.driver_data<bking_state>();
243243   state->m_bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
244   state->m_tmp_bitmap1.allocate(machine.primary_screen->width(), machine.primary_screen->height());
245   state->m_tmp_bitmap2.allocate(machine.primary_screen->width(), machine.primary_screen->height());
244   machine.primary_screen->register_screen_bitmap(state->m_tmp_bitmap1);
245   machine.primary_screen->register_screen_bitmap(state->m_tmp_bitmap2);
246246
247247   state->save_item(NAME(state->m_tmp_bitmap1));
248248   state->save_item(NAME(state->m_tmp_bitmap2));
src/mame/video/ccastles.c
r14034r14035
3232         3,   resistances, state->m_bweights, 1000, 0);
3333
3434   /* allocate a bitmap for drawing sprites */
35   state->m_spritebitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
35   machine.primary_screen->register_screen_bitmap(state->m_spritebitmap);
3636
3737   /* register for savestates */
3838   state->save_item(NAME(state->m_video_control));
src/mame/video/sprint2.c
r14034r14035
4646VIDEO_START( sprint2 )
4747{
4848   sprint2_state *state = machine.driver_data<sprint2_state>();
49   state->m_helper.allocate(machine.primary_screen->width(), machine.primary_screen->height());
49   machine.primary_screen->register_screen_bitmap(state->m_helper);
5050
5151   state->m_bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 16, 8, 32, 32);
5252}
src/mame/video/niyanpai.c
r14034r14035
365365   int width = machine.primary_screen->width();
366366   int height = machine.primary_screen->height();
367367
368   state->m_tmpbitmap[0].allocate(machine.primary_screen->width(), machine.primary_screen->height());
369   state->m_tmpbitmap[1].allocate(machine.primary_screen->width(), machine.primary_screen->height());
370   state->m_tmpbitmap[2].allocate(machine.primary_screen->width(), machine.primary_screen->height());
368   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap[0]);
369   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap[1]);
370   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap[2]);
371371   state->m_videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height);
372372   state->m_videoram[1] = auto_alloc_array_clear(machine, UINT16, width * height);
373373   state->m_videoram[2] = auto_alloc_array_clear(machine, UINT16, width * height);
src/mame/video/paradise.c
r14034r14035
169169   state->m_tilemap_2 = tilemap_create(machine, get_tile_info_2, tilemap_scan_rows, 8, 8, 0x20, 0x20);
170170
171171   /* pixmap */
172   state->m_tmpbitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
172   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap);
173173
174174   tilemap_set_transparent_pen(state->m_tilemap_0, 0x0f);
175175   tilemap_set_transparent_pen(state->m_tilemap_1, 0xff);
src/mame/video/argus.c
r14034r14035
312312
313313   tilemap_set_transparent_pen(state->m_tx_tilemap,  15);
314314
315   state->m_mosaicbitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
315   machine.primary_screen->register_screen_bitmap(state->m_mosaicbitmap);
316316
317317   jal_blend_init(machine, 1);
318318}
src/mame/video/gaiden.c
r14034r14035
7575VIDEO_START( gaiden )
7676{
7777   gaiden_state *state = machine.driver_data<gaiden_state>();
78   int width = machine.primary_screen->width();
79   int height = machine.primary_screen->height();
8078
8179   /* set up tile layers */
82   state->m_tile_bitmap_bg.allocate(width, height);
83   state->m_tile_bitmap_fg.allocate(width, height);
80   machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_bg);
81   machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_fg);
8482
8583   state->m_background = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 64, 32);
8684   state->m_foreground = tilemap_create(machine, get_fg_tile_info_raiga, tilemap_scan_rows, 16, 16, 64, 32);
r14034r14035
9997   tilemap_set_scrolldx(state->m_text_layer, 0, -1);
10098
10199   /* set up sprites */
102   state->m_sprite_bitmap.allocate(width, height);
100   machine.primary_screen->register_screen_bitmap(state->m_sprite_bitmap);
103101}
104102
105103VIDEO_START( mastninj )
106104{
107105
108106   gaiden_state *state = machine.driver_data<gaiden_state>();
109   int width = machine.primary_screen->width();
110   int height = machine.primary_screen->height();
111107
112108   /* set up tile layers */
113   state->m_tile_bitmap_bg.allocate(width, height);
114   state->m_tile_bitmap_fg.allocate(width, height);
109   machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_bg);
110   machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_fg);
115111
116112   state->m_background = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 64, 32);
117113   state->m_foreground = tilemap_create(machine, get_fg_tile_info_raiga, tilemap_scan_rows, 16, 16, 64, 32);
r14034r14035
122118   tilemap_set_transparent_pen(state->m_text_layer, 15);
123119
124120   /* set up sprites */
125   state->m_sprite_bitmap.allocate(width, height);
121   machine.primary_screen->register_screen_bitmap(state->m_sprite_bitmap);
126122
127123   tilemap_set_scrolldx(state->m_background, -248, 248);
128124   tilemap_set_scrolldx(state->m_foreground, -252, 252);
r14034r14035
131127VIDEO_START( raiga )
132128{
133129   gaiden_state *state = machine.driver_data<gaiden_state>();
134   int width = machine.primary_screen->width();
135   int height = machine.primary_screen->height();
136130
137131   /* set up tile layers */
138   state->m_tile_bitmap_bg.allocate(width, height);
139   state->m_tile_bitmap_fg.allocate(width, height);
132   machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_bg);
133   machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_fg);
140134
141135   state->m_background = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 64, 32);
142136   state->m_foreground = tilemap_create(machine, get_fg_tile_info_raiga, tilemap_scan_rows, 16, 16, 64, 32);
r14034r14035
147141   tilemap_set_transparent_pen(state->m_text_layer, 0);
148142
149143   /* set up sprites */
150   state->m_sprite_bitmap.allocate(width, height);
144   machine.primary_screen->register_screen_bitmap(state->m_sprite_bitmap);
151145}
152146
153147VIDEO_START( drgnbowl )
src/mame/video/galpanic.c
r14034r14035
66VIDEO_START( galpanic )
77{
88   galpanic_state *state = machine.driver_data<galpanic_state>();
9   state->m_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
10   state->m_sprites_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
9   machine.primary_screen->register_screen_bitmap(state->m_bitmap);
10   machine.primary_screen->register_screen_bitmap(state->m_sprites_bitmap);
1111}
1212
1313PALETTE_INIT( galpanic )
src/mame/video/dkong.c
r14034r14035
947947   switch (state->m_hardware_type)
948948   {
949949      case HARDWARE_TRS02:
950         state->m_bg_bits.allocate(machine.primary_screen->width(), machine.primary_screen->height());
950         machine.primary_screen->register_screen_bitmap(state->m_bg_bits);
951951         state->m_gfx3 = machine.region("gfx3")->base();
952952         state->m_gfx3_len = machine.region("gfx3")->bytes();
953953          /* fall through */
r14034r14035
960960         state->m_bg_tilemap = tilemap_create(machine, radarscp1_bg_tile_info, tilemap_scan_rows,  8, 8, 32, 32);
961961         tilemap_set_scrolldx(state->m_bg_tilemap, 0, 128);
962962
963         state->m_bg_bits.allocate(machine.primary_screen->width(), machine.primary_screen->height());
963         machine.primary_screen->register_screen_bitmap(state->m_bg_bits);
964964         state->m_gfx4 = machine.region("gfx4")->base();
965965         state->m_gfx3 = machine.region("gfx3")->base();
966966         state->m_gfx3_len = machine.region("gfx3")->bytes();
src/mame/video/sprint4.c
r14034r14035
5151VIDEO_START( sprint4 )
5252{
5353   sprint4_state *state = machine.driver_data<sprint4_state>();
54   state->m_helper.allocate(machine.primary_screen->width(), machine.primary_screen->height());
54   machine.primary_screen->register_screen_bitmap(state->m_helper);
5555
5656   state->m_playfield = tilemap_create(machine, sprint4_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
5757}
src/mame/video/kaneko16.c
r14034r14035
122122
123123   state->m_tmap[3] = 0;
124124
125   state->m_sprites_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
125   machine.primary_screen->register_screen_bitmap(state->m_sprites_bitmap);
126126
127127   {
128128      int dx, dy;
r14034r14035
294294
295295   state->m_tmap[3] = 0;
296296
297   state->m_sprites_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
297   machine.primary_screen->register_screen_bitmap(state->m_sprites_bitmap);
298298
299299   {
300300      int dx = 0x5b, dy = 8;
src/mame/video/ms32.c
r14034r14035
6969VIDEO_START( ms32 )
7070{
7171   ms32_state *state = machine.driver_data<ms32_state>();
72   int width = machine.primary_screen->width();
73   int height = machine.primary_screen->height();
7472
7573   state->m_priram_8   = auto_alloc_array_clear(machine, UINT8, 0x2000);
7674   state->m_palram_16  = auto_alloc_array_clear(machine, UINT16, 0x20000);
r14034r14035
8785
8886
8987   /* set up tile layers */
90   state->m_temp_bitmap_tilemaps.allocate(width, height);
91   state->m_temp_bitmap_sprites.allocate(width, height);
92   state->m_temp_bitmap_sprites_pri.allocate(width, height); // not actually being used for rendering, we embed pri info in the raw colour bitmap
88   machine.primary_screen->register_screen_bitmap(state->m_temp_bitmap_tilemaps);
89   machine.primary_screen->register_screen_bitmap(state->m_temp_bitmap_sprites);
90   machine.primary_screen->register_screen_bitmap(state->m_temp_bitmap_sprites_pri); // not actually being used for rendering, we embed pri info in the raw colour bitmap
9391
9492   state->m_temp_bitmap_tilemaps.fill(0);
9593   state->m_temp_bitmap_sprites.fill(0);
src/mame/video/spbactn.c
r14034r14035
111111   spbactn_state *state = machine.driver_data<spbactn_state>();
112112
113113   /* allocate bitmaps */
114   int width = machine.primary_screen->width();
115   int height = machine.primary_screen->height();
116
117   state->m_tile_bitmap_bg.allocate(width, height);
118   state->m_tile_bitmap_fg.allocate(width, height);
114   machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_bg);
115   machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_fg);
119116}
120117
121118SCREEN_UPDATE_RGB32( spbactn )
src/mame/video/tank8.c
r14034r14035
104104VIDEO_START( tank8 )
105105{
106106   tank8_state *state = machine.driver_data<tank8_state>();
107   state->m_helper1.allocate(machine.primary_screen->width(), machine.primary_screen->height());
108   state->m_helper2.allocate(machine.primary_screen->width(), machine.primary_screen->height());
109   state->m_helper3.allocate(machine.primary_screen->width(), machine.primary_screen->height());
107   machine.primary_screen->register_screen_bitmap(state->m_helper1);
108   machine.primary_screen->register_screen_bitmap(state->m_helper2);
109   machine.primary_screen->register_screen_bitmap(state->m_helper3);
110110
111111   state->m_tilemap = tilemap_create(machine, tank8_get_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
112112
src/mame/video/mermaid.c
r14034r14035
184184   tilemap_set_scroll_cols(state->m_fg_tilemap, 32);
185185   tilemap_set_transparent_pen(state->m_fg_tilemap, 0);
186186
187   state->m_helper.allocate(machine.primary_screen->width(), machine.primary_screen->height());
188   state->m_helper2.allocate(machine.primary_screen->width(), machine.primary_screen->height());
187   machine.primary_screen->register_screen_bitmap(state->m_helper);
188   machine.primary_screen->register_screen_bitmap(state->m_helper2);
189189}
190190
191191static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
src/mame/video/decospr.c
r14034r14035
165165
166166void decospr_device::alloc_sprite_bitmap()
167167{
168   m_sprite_bitmap.allocate(machine().primary_screen->width(), machine().primary_screen->height());
168   machine().primary_screen->register_screen_bitmap(m_sprite_bitmap);
169169}
170170
171171void decospr_device::set_pri_callback(decospr_priority_callback_func callback)
src/mame/video/taitojc.c
r14034r14035
261261VIDEO_START( taitojc )
262262{
263263   taitojc_state *state = machine.driver_data<taitojc_state>();
264   int width, height;
265264
266265   state->m_poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
267266   machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(taitojc_exit), &machine));
r14034r14035
285284
286285   state->m_texture = auto_alloc_array(machine, UINT8, 0x400000);
287286
288   state->m_framebuffer.allocate(machine.primary_screen->width(), machine.primary_screen->height());
289
290   width = machine.primary_screen->width();
291   height = machine.primary_screen->height();
292   state->m_zbuffer.allocate(width, height);
287   machine.primary_screen->register_screen_bitmap(state->m_framebuffer);
288   machine.primary_screen->register_screen_bitmap(state->m_zbuffer);
293289}
294290
295291static void draw_object_bank(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 bank_type, UINT8 pri)
src/mame/video/model3.c
r14034r14035
117117VIDEO_START( model3 )
118118{
119119   model3_state *state = machine.driver_data<model3_state>();
120   int width, height;
121120
122121   state->m_poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), 0);
123122   machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(model3_exit), &machine));
124123
125   width = machine.primary_screen->width();
126   height = machine.primary_screen->height();
127   state->m_bitmap3d.allocate(machine.primary_screen->width(), machine.primary_screen->height());
128   state->m_zbuffer.allocate(width, height);
124   machine.primary_screen->register_screen_bitmap(state->m_bitmap3d);
125   machine.primary_screen->register_screen_bitmap(state->m_zbuffer);
129126
130127   state->m_m3_char_ram = auto_alloc_array_clear(machine, UINT64, 0x100000/8);
131128   state->m_m3_tile_ram = auto_alloc_array_clear(machine, UINT64, 0x8000/8);
src/mame/video/ikki.c
r14034r14035
119119VIDEO_START( ikki )
120120{
121121   ikki_state *state = machine.driver_data<ikki_state>();
122   state->m_sprite_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
122   machine.primary_screen->register_screen_bitmap(state->m_sprite_bitmap);
123123   state->save_item(NAME(state->m_sprite_bitmap));
124124}
125125
src/mame/video/toaplan2.c
r14034r14035
8282VIDEO_START( toaplan2 )
8383{
8484   toaplan2_state *state = machine.driver_data<toaplan2_state>();
85   int width = machine.primary_screen->width();
86   int height = machine.primary_screen->height();
8785
8886   /* cache the VDP device */
8987   state->m_vdp0 = machine.device<gp9001vdp_device>("gp9001vdp0");
9088   state->m_vdp1 = machine.device<gp9001vdp_device>("gp9001vdp1");
9189
9290   /* our current VDP implementation needs this bitmap to work with */
93   state->m_custom_priority_bitmap.allocate(width, height);
91   machine.primary_screen->register_screen_bitmap(state->m_custom_priority_bitmap);
9492
9593   if (state->m_vdp0 != NULL)
9694   {
r14034r14035
10098
10199   if (state->m_vdp1 != NULL)
102100   {
103      state->m_secondary_render_bitmap.allocate(width, height);
101      machine.primary_screen->register_screen_bitmap(state->m_secondary_render_bitmap);
104102      state->m_vdp1->custom_priority_bitmap = &state->m_custom_priority_bitmap;
105103   }
106104
src/mame/video/galastrm.c
r14034r14035
3333   galastrm_state *state = machine.driver_data<galastrm_state>();
3434   state->m_spritelist = auto_alloc_array(machine, struct tempsprite, 0x4000);
3535
36   state->m_tmpbitmaps.allocate(machine.primary_screen->width(), machine.primary_screen->height());
37   state->m_polybitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
36   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmaps);
37   machine.primary_screen->register_screen_bitmap(state->m_polybitmap);
3838
3939   state->m_poly = poly_alloc(machine, 16, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
4040   machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(galastrm_exit), &machine));
src/mame/video/starfire.c
r14034r14035
1919{
2020   starfire_state *state = machine.driver_data<starfire_state>();
2121
22   state->m_starfire_screen.allocate(machine.primary_screen->width(), machine.primary_screen->height());
22   machine.primary_screen->register_screen_bitmap(state->m_starfire_screen);
2323   state->m_scanline_timer = machine.scheduler().timer_alloc(FUNC(starfire_scanline_callback));
2424   state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(STARFIRE_VBEND), STARFIRE_VBEND);
2525
src/mame/video/sprint8.c
r14034r14035
117117VIDEO_START( sprint8 )
118118{
119119   sprint8_state *state = machine.driver_data<sprint8_state>();
120   state->m_helper1.allocate(machine.primary_screen->width(), machine.primary_screen->height());
121   state->m_helper2.allocate(machine.primary_screen->width(), machine.primary_screen->height());
120   machine.primary_screen->register_screen_bitmap(state->m_helper1);
121   machine.primary_screen->register_screen_bitmap(state->m_helper2);
122122
123123   state->m_tilemap1 = tilemap_create(machine, get_tile_info1, tilemap_scan_rows, 16, 8, 32, 32);
124124   state->m_tilemap2 = tilemap_create(machine, get_tile_info2, tilemap_scan_rows, 16, 8, 32, 32);
src/mame/video/tceptor.c
r14034r14035
394394   decode_sprite32(machine, "gfx4");
395395
396396   /* allocate temp bitmaps */
397   state->m_temp_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
397   machine.primary_screen->register_screen_bitmap(state->m_temp_bitmap);
398398
399399   namco_road_init(machine, gfx_index);
400400
src/mame/video/bigevglf.c
r14034r14035
5858{
5959   bigevglf_state *state = machine.driver_data<bigevglf_state>();
6060
61   state->m_tmp_bitmap[0].allocate(machine.primary_screen->width(), machine.primary_screen->height());
62   state->m_tmp_bitmap[1].allocate(machine.primary_screen->width(), machine.primary_screen->height());
63   state->m_tmp_bitmap[2].allocate(machine.primary_screen->width(), machine.primary_screen->height());
64   state->m_tmp_bitmap[3].allocate(machine.primary_screen->width(), machine.primary_screen->height());
61   machine.primary_screen->register_screen_bitmap(state->m_tmp_bitmap[0]);
62   machine.primary_screen->register_screen_bitmap(state->m_tmp_bitmap[1]);
63   machine.primary_screen->register_screen_bitmap(state->m_tmp_bitmap[2]);
64   machine.primary_screen->register_screen_bitmap(state->m_tmp_bitmap[3]);
6565   state->save_item(NAME(state->m_tmp_bitmap[0]));
6666   state->save_item(NAME(state->m_tmp_bitmap[1]));
6767   state->save_item(NAME(state->m_tmp_bitmap[2]));
src/mame/video/ninjakd2.c
r14034r14035
121121      state->m_robokid_bg2_videoram = auto_alloc_array_clear(machine, UINT8, size);
122122   }
123123
124   state->m_sp_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
124   machine.primary_screen->register_screen_bitmap(state->m_sp_bitmap);
125125}
126126
127127static int stencil_ninjakd2( UINT16 pal );
src/mame/video/ojankohs.c
r14034r14035
296296{
297297   ojankohs_state *state = machine.driver_data<ojankohs_state>();
298298
299   state->m_tmpbitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
299   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap);
300300   state->m_videoram = auto_alloc_array(machine, UINT8, 0x8000);
301301   state->m_paletteram = auto_alloc_array(machine, UINT8, 0x20);
302302
src/mame/video/nbmj8891.c
r14034r14035
499499   int width = machine.primary_screen->width();
500500   int height = machine.primary_screen->height();
501501
502   state->m_tmpbitmap0.allocate(machine.primary_screen->width(), machine.primary_screen->height());
502   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap0);
503503   state->m_videoram0 = auto_alloc_array(machine, UINT8, width * height);
504504   state->m_palette = auto_alloc_array(machine, UINT8, 0x200);
505505   state->m_clut = auto_alloc_array(machine, UINT8, 0x800);
r14034r14035
516516   int width = machine.primary_screen->width();
517517   int height = machine.primary_screen->height();
518518
519   state->m_tmpbitmap0.allocate(machine.primary_screen->width(), machine.primary_screen->height());
520   state->m_tmpbitmap1.allocate(machine.primary_screen->width(), machine.primary_screen->height());
519   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap0);
520   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap1);
521521   state->m_videoram0 = auto_alloc_array(machine, UINT8, width * height);
522522   state->m_videoram1 = auto_alloc_array(machine, UINT8, width * height);
523523   state->m_palette = auto_alloc_array(machine, UINT8, 0x200);
src/mame/video/cvs.c
r14034r14035
169169   }
170170
171171   /* create helper bitmaps */
172   state->m_background_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
173   state->m_collision_background.allocate(machine.primary_screen->width(), machine.primary_screen->height());
174   state->m_scrolled_collision_background.allocate(machine.primary_screen->width(), machine.primary_screen->height());
172   machine.primary_screen->register_screen_bitmap(state->m_background_bitmap);
173   machine.primary_screen->register_screen_bitmap(state->m_collision_background);
174   machine.primary_screen->register_screen_bitmap(state->m_scrolled_collision_background);
175175
176176   /* register save */
177177   state->save_item(NAME(state->m_background_bitmap));
src/mame/video/magmax.c
r14034r14035
7272
7373   state->m_prom_tab = auto_alloc_array(machine, UINT32, 256);
7474   
75   state->m_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
75   machine.primary_screen->register_screen_bitmap(state->m_bitmap);
7676
7777   /* Allocate temporary bitmap */
7878   for (i=0; i<256; i++)
src/mame/video/quasar.c
r14034r14035
9696   state->m_effectram = auto_alloc_array(machine, UINT8, 0x400);
9797
9898   /* create helper bitmap */
99   state->m_collision_background.allocate(machine.primary_screen->width(), machine.primary_screen->height());
99   machine.primary_screen->register_screen_bitmap(state->m_collision_background);
100100
101101   /* register save */
102102   state->save_item(NAME(state->m_collision_background));
src/mame/video/pacland.c
r14034r14035
196196   pacland_state *state = machine.driver_data<pacland_state>();
197197   int color;
198198
199   state->m_fg_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
199   machine.primary_screen->register_screen_bitmap(state->m_fg_bitmap);
200200   state->m_fg_bitmap.fill(0xffff);
201201
202202   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows,8,8,64,32);
src/mame/video/dogfgt.c
r14034r14035
7373   state->m_bitmapram = auto_alloc_array(machine, UINT8, BITMAPRAM_SIZE);
7474   state->save_pointer(NAME(state->m_bitmapram), BITMAPRAM_SIZE);
7575
76   state->m_pixbitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
76   machine.primary_screen->register_screen_bitmap(state->m_pixbitmap);
7777   state->save_item(NAME(state->m_pixbitmap));
7878}
7979
src/mame/video/taitosj.c
r14034r14035
180180
181181   for (i = 0; i < 3; i++)
182182   {
183      state->m_layer_bitmap[i].allocate(machine.primary_screen->width(), machine.primary_screen->height());
184      state->m_sprite_layer_collbitmap2[i].allocate(machine.primary_screen->width(), machine.primary_screen->height());
183      machine.primary_screen->register_screen_bitmap(state->m_layer_bitmap[i]);
184      machine.primary_screen->register_screen_bitmap(state->m_sprite_layer_collbitmap2[i]);
185185   }
186186
187187   state->m_sprite_sprite_collbitmap1.allocate(32,32);
src/mame/video/nbmj8991.c
r14034r14035
296296   int width = machine.primary_screen->width();
297297   int height = machine.primary_screen->height();
298298
299   state->m_tmpbitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
299   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap);
300300   state->m_videoram = auto_alloc_array(machine, UINT8, width * height);
301301   state->m_clut = auto_alloc_array(machine, UINT8, 0x800);
302302   memset(state->m_videoram, 0x00, (width * height * sizeof(UINT8)));
src/mame/video/blockout.c
r14034r14035
6666   blockout_state *state = machine.driver_data<blockout_state>();
6767
6868   /* Allocate temporary bitmaps */
69   state->m_tmpbitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
69   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap);
7070   state->save_item(NAME(state->m_tmpbitmap));
7171}
7272
src/mame/video/toobin.c
r14034r14035
9797   tilemap_set_transparent_pen(state->m_alpha_tilemap, 0);
9898
9999   /* allocate a playfield bitmap for rendering */
100   state->m_pfbitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
100   machine.primary_screen->register_screen_bitmap(state->m_pfbitmap);
101101
102102   state->save_item(NAME(state->m_brightness));
103103}
src/mame/video/nbmj8900.c
r14034r14035
383383   state->m_screen_width = machine.primary_screen->width();
384384   state->m_screen_height = machine.primary_screen->height();
385385
386   state->m_tmpbitmap0.allocate(machine.primary_screen->width(), machine.primary_screen->height());
387   state->m_tmpbitmap1.allocate(machine.primary_screen->width(), machine.primary_screen->height());
386   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap0);
387   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap1);
388388   state->m_videoram0 = auto_alloc_array(machine, UINT8, state->m_screen_width * state->m_screen_height);
389389   state->m_videoram1 = auto_alloc_array(machine, UINT8, state->m_screen_width * state->m_screen_height);
390390   state->m_palette = auto_alloc_array(machine, UINT8, 0x200);
src/mame/video/tecmo16.c
r14034r14035
5959VIDEO_START( fstarfrc )
6060{
6161   tecmo16_state *state = machine.driver_data<tecmo16_state>();
62   int width = machine.primary_screen->width();
63   int height = machine.primary_screen->height();
6462
6563   /* set up tile layers */
66   state->m_tile_bitmap_bg.allocate(width, height);
67   state->m_tile_bitmap_fg.allocate(width, height);
64   machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_bg);
65   machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_fg);
6866
6967   /* set up sprites */
70   state->m_sprite_bitmap.allocate(width, height);
68   machine.primary_screen->register_screen_bitmap(state->m_sprite_bitmap);
7169
7270   state->m_fg_tilemap = tilemap_create(machine, fg_get_tile_info,tilemap_scan_rows,16,16,32,32);
7371   state->m_bg_tilemap = tilemap_create(machine, bg_get_tile_info,tilemap_scan_rows,16,16,32,32);
r14034r14035
8583VIDEO_START( ginkun )
8684{
8785   tecmo16_state *state = machine.driver_data<tecmo16_state>();
88   int width = machine.primary_screen->width();
89   int height = machine.primary_screen->height();
9086
9187   /* set up tile layers */
92   state->m_tile_bitmap_bg.allocate(width, height);
93   state->m_tile_bitmap_fg.allocate(width, height);
88   machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_bg);
89   machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_fg);
9490
9591   /* set up sprites */
96   state->m_sprite_bitmap.allocate(width, height);
92   machine.primary_screen->register_screen_bitmap(state->m_sprite_bitmap);
9793
9894   state->m_fg_tilemap = tilemap_create(machine, fg_get_tile_info,tilemap_scan_rows,16,16,64,32);
9995   state->m_bg_tilemap = tilemap_create(machine, bg_get_tile_info,tilemap_scan_rows,16,16,64,32);
r14034r14035
109105VIDEO_START( riot )
110106{
111107   tecmo16_state *state = machine.driver_data<tecmo16_state>();
112   int width = machine.primary_screen->width();
113   int height = machine.primary_screen->height();
114108
115109   /* set up tile layers */
116   state->m_tile_bitmap_bg.allocate(width, height);
117   state->m_tile_bitmap_fg.allocate(width, height);
110   machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_bg);
111   machine.primary_screen->register_screen_bitmap(state->m_tile_bitmap_fg);
118112
119113   /* set up sprites */
120   state->m_sprite_bitmap.allocate(width, height);
114   machine.primary_screen->register_screen_bitmap(state->m_sprite_bitmap);
121115
122116   state->m_fg_tilemap = tilemap_create(machine, fg_get_tile_info,tilemap_scan_rows,16,16,64,32);
123117   state->m_bg_tilemap = tilemap_create(machine, bg_get_tile_info,tilemap_scan_rows,16,16,64,32);
src/mame/video/ultratnk.c
r14034r14035
4949VIDEO_START( ultratnk )
5050{
5151   ultratnk_state *state = machine.driver_data<ultratnk_state>();
52   state->m_helper.allocate(machine.primary_screen->width(), machine.primary_screen->height());
52   machine.primary_screen->register_screen_bitmap(state->m_helper);
5353
5454   state->m_playfield = tilemap_create(machine, ultratnk_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
5555}
src/mame/video/dday.c
r14034r14035
219219   state->m_text_tilemap = tilemap_create(machine, get_text_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
220220   state->m_sl_tilemap = tilemap_create(machine, get_sl_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
221221
222   state->m_main_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
222   machine.primary_screen->register_screen_bitmap(state->m_main_bitmap);
223223
224224   tilemap_set_transmask(state->m_bg_tilemap, 0, 0x00f0, 0xff0f); /* pens 0-3 have priority over the foreground layer */
225225   tilemap_set_transparent_pen(state->m_fg_tilemap, 0);
src/mame/video/mappy.c
r14034r14035
323323   mappy_state *state = machine.driver_data<mappy_state>();
324324
325325   state->m_bg_tilemap = tilemap_create(machine, superpac_get_tile_info,superpac_tilemap_scan,8,8,36,28);
326   state->m_sprite_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
326   machine.primary_screen->register_screen_bitmap(state->m_sprite_bitmap);
327327
328328   colortable_configure_tilemap_groups(machine.colortable, state->m_bg_tilemap, machine.gfx[0], 31);
329329}
src/mame/video/psikyosh.c
r14034r14035
12271227{
12281228   psikyosh_state *state = machine.driver_data<psikyosh_state>();
12291229   UINT8 *alphatable = state->m_alphatable;
1230   int width = machine.primary_screen->width();
1231   int height = machine.primary_screen->height();
12321230
1233   state->m_z_bitmap.allocate(width, height); /* z-buffer */
1231   machine.primary_screen->register_screen_bitmap(state->m_z_bitmap); /* z-buffer */
12341232   state->m_zoom_bitmap.allocate(16*16, 16*16); /* temp buffer for assembling sprites */
12351233   state->m_bg_bitmap.allocate(32*16, 32*16); /* temp buffer for assembling tilemaps */
12361234   state->m_bg_zoom = auto_alloc_array(machine, UINT16, 256);
src/mame/video/gomoku.c
r14034r14035
117117   int bgdata;
118118   int color;
119119
120   state->m_bg_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
120   machine.primary_screen->register_screen_bitmap(state->m_bg_bitmap);
121121
122122   state->m_fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,32, 32);
123123
src/mame/video/firetrk.c
r14034r14035
225225VIDEO_START( firetrk )
226226{
227227   firetrk_state *state = machine.driver_data<firetrk_state>();
228   state->m_helper1.allocate(machine.primary_screen->width(), machine.primary_screen->height());
229   state->m_helper2.allocate(machine.primary_screen->width(), machine.primary_screen->height());
228   machine.primary_screen->register_screen_bitmap(state->m_helper1);
229   machine.primary_screen->register_screen_bitmap(state->m_helper2);
230230
231231   state->m_tilemap1 = tilemap_create(machine, firetrk_get_tile_info1, tilemap_scan_rows, 16, 16, 16, 16);
232232   state->m_tilemap2 = tilemap_create(machine, firetrk_get_tile_info2, tilemap_scan_rows, 16, 16, 16, 16);
r14034r14035
236236VIDEO_START( superbug )
237237{
238238   firetrk_state *state = machine.driver_data<firetrk_state>();
239   state->m_helper1.allocate(machine.primary_screen->width(), machine.primary_screen->height());
240   state->m_helper2.allocate(machine.primary_screen->width(), machine.primary_screen->height());
239   machine.primary_screen->register_screen_bitmap(state->m_helper1);
240   machine.primary_screen->register_screen_bitmap(state->m_helper2);
241241
242242   state->m_tilemap1 = tilemap_create(machine, superbug_get_tile_info1, tilemap_scan_rows, 16, 16, 16, 16);
243243   state->m_tilemap2 = tilemap_create(machine, superbug_get_tile_info2, tilemap_scan_rows, 16, 16, 16, 16);
r14034r14035
247247VIDEO_START( montecar )
248248{
249249   firetrk_state *state = machine.driver_data<firetrk_state>();
250   state->m_helper1.allocate(machine.primary_screen->width(), machine.primary_screen->height());
251   state->m_helper2.allocate(machine.primary_screen->width(), machine.primary_screen->height());
250   machine.primary_screen->register_screen_bitmap(state->m_helper1);
251   machine.primary_screen->register_screen_bitmap(state->m_helper2);
252252
253253   state->m_tilemap1 = tilemap_create(machine, montecar_get_tile_info1, tilemap_scan_rows, 16, 16, 16, 16);
254254   state->m_tilemap2 = tilemap_create(machine, montecar_get_tile_info2, tilemap_scan_rows, 16, 16, 16, 16);
src/mame/video/buggychl.c
r14034r14035
1515VIDEO_START( buggychl )
1616{
1717   buggychl_state *state = machine.driver_data<buggychl_state>();
18   state->m_tmp_bitmap1.allocate(machine.primary_screen->width(), machine.primary_screen->height());
19   state->m_tmp_bitmap2.allocate(machine.primary_screen->width(), machine.primary_screen->height());
18   machine.primary_screen->register_screen_bitmap(state->m_tmp_bitmap1);
19   machine.primary_screen->register_screen_bitmap(state->m_tmp_bitmap2);
2020
2121   state->save_item(NAME(state->m_tmp_bitmap1));
2222   state->save_item(NAME(state->m_tmp_bitmap2));
src/mame/video/starshp1.c
r14034r14035
8181      val = (val << 1) | (bit & 1);
8282   }
8383
84   state->m_helper.allocate(machine.primary_screen->width(), machine.primary_screen->height());
84   machine.primary_screen->register_screen_bitmap(state->m_helper);
8585}
8686
8787
src/mame/video/exidy.c
r14034r14035
3535{
3636   exidy_state *state = machine.driver_data<exidy_state>();
3737
38   state->m_background_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
38   machine.primary_screen->register_screen_bitmap(state->m_background_bitmap);
3939   state->m_motion_object_1_vid.allocate(16, 16);
4040   state->m_motion_object_2_vid.allocate(16, 16);
4141   state->m_motion_object_2_clip.allocate(16, 16);
src/mame/video/hyhoo.c
r14034r14035
227227VIDEO_START( hyhoo )
228228{
229229   hyhoo_state *state = machine.driver_data<hyhoo_state>();
230   state->m_tmpbitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
230   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmap);
231231}
232232
233233
src/mame/video/zac2650.c
r14034r14035
144144   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
145145       24, 24, 32, 32);
146146
147   state->m_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
148   state->m_spritebitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
147   machine.primary_screen->register_screen_bitmap(state->m_bitmap);
148   machine.primary_screen->register_screen_bitmap(state->m_spritebitmap);
149149
150150   gfx_element_set_source(machine.gfx[1], state->m_s2636_0_ram);
151151   gfx_element_set_source(machine.gfx[2], state->m_s2636_0_ram);
src/mame/video/shangha3.c
r14034r14035
6969   shangha3_state *state = machine.driver_data<shangha3_state>();
7070   int i;
7171
72   state->m_rawbitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
72   machine.primary_screen->register_screen_bitmap(state->m_rawbitmap);
7373
7474   for (i = 0;i < 14;i++)
7575      state->m_drawmode_table[i] = DRAWMODE_SOURCE;
src/mame/video/taito_f3.c
r14034r14035
542542{
543543   taito_f3_state *state = machine.driver_data<taito_f3_state>();
544544   const struct F3config *pCFG=&f3_config_table[0];
545   int width, height, i;
545   int i;
546546
547547   state->m_f3_alpha_level_2as=127;
548548   state->m_f3_alpha_level_2ad=127;
r14034r14035
647647   state->m_pixel_layer = tilemap_create(machine, get_tile_info_pixel,tilemap_scan_cols,8,8,64,32);
648648   state->m_pf_line_inf = auto_alloc_array(machine, struct f3_playfield_line_inf, 5);
649649   state->m_sa_line_inf = auto_alloc_array(machine, struct f3_spritealpha_line_inf, 1);
650   width = machine.primary_screen->width();
651   height = machine.primary_screen->height();
652   state->m_pri_alp_bitmap.allocate(width, height);
650   machine.primary_screen->register_screen_bitmap(state->m_pri_alp_bitmap);
653651   state->m_tile_opaque_sp = auto_alloc_array(machine, UINT8, machine.gfx[2]->total_elements);
654652   for (i=0; i<8; i++)
655653      state->m_tile_opaque_pf[i] = auto_alloc_array(machine, UINT8, machine.gfx[1]->total_elements);
src/mame/video/airbustr.c
r14034r14035
121121   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
122122   state->m_fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
123123
124   state->m_sprites_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
124   machine.primary_screen->register_screen_bitmap(state->m_sprites_bitmap);
125125   tilemap_set_transparent_pen(state->m_fg_tilemap, 0);
126126
127127   tilemap_set_scrolldx(state->m_bg_tilemap, 0x094, 0x06a);
src/mame/video/cave.c
r14034r14035
730730static void sprite_init_cave( running_machine &machine )
731731{
732732   cave_state *state = machine.driver_data<cave_state>();
733   int screen_width = machine.primary_screen->width();
734   int screen_height = machine.primary_screen->height();
735733
736734   if (state->m_spritetype[0] == 0 || state->m_spritetype[0] == 2)   // most of the games
737735   {
r14034r14035
745743   }
746744
747745   state->m_sprite_zbuf_baseval = 0x10000 - MAX_SPRITE_NUM;
748   state->m_sprite_zbuf.allocate(screen_width, screen_height);
746   machine.primary_screen->register_screen_bitmap(state->m_sprite_zbuf);
749747   state->m_blit.baseaddr_zbuf = &state->m_sprite_zbuf.pix8(0);
750748   state->m_blit.line_offset_zbuf = state->m_sprite_zbuf.rowpixels() * state->m_sprite_zbuf.bpp() / 8;
751749
src/mame/video/cloud9.c
r14034r14035
3636         3,   resistances, state->m_bweights, 1000, 0);
3737
3838   /* allocate a bitmap for drawing sprites */
39   state->m_spritebitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
39   machine.primary_screen->register_screen_bitmap(state->m_spritebitmap);
4040
4141   /* register for savestates */
4242   state->save_pointer(NAME(state->m_videoram), 0x8000);
src/mame/video/changela.c
r14034r14035
2424   state->m_memory_devices = auto_alloc_array(machine, UINT8, 4 * 0x800); /* 0 - not connected, 1,2,3 - RAMs*/
2525   state->m_tree_ram = auto_alloc_array(machine, UINT8, 2 * 0x20);
2626
27   state->m_obj0_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
28   state->m_river_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
29   state->m_tree0_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
30   state->m_tree1_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
27   machine.primary_screen->register_screen_bitmap(state->m_obj0_bitmap);
28   machine.primary_screen->register_screen_bitmap(state->m_river_bitmap);
29   machine.primary_screen->register_screen_bitmap(state->m_tree0_bitmap);
30   machine.primary_screen->register_screen_bitmap(state->m_tree1_bitmap);
3131
3232   state->m_scanline_timer = machine.scheduler().timer_alloc(FUNC(changela_scanline_callback));
3333   state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(30), 30);
src/mame/video/triplhnt.c
r14034r14035
2020VIDEO_START( triplhnt )
2121{
2222   triplhnt_state *state = machine.driver_data<triplhnt_state>();
23   state->m_helper.allocate(machine.primary_screen->width(), machine.primary_screen->height());
23   machine.primary_screen->register_screen_bitmap(state->m_helper);
2424
2525   state->m_bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 16, 16, 16, 16);
2626}
src/mame/video/wolfpack.c
r14034r14035
116116
117117   state->m_LFSR = auto_alloc_array(machine, UINT8, 0x8000);
118118
119   state->m_helper.allocate(machine.primary_screen->width(), machine.primary_screen->height());
119   machine.primary_screen->register_screen_bitmap(state->m_helper);
120120
121121   for (i = 0; i < 0x8000; i++)
122122   {
src/mame/drivers/taitotz.c
r14034r14035
107107{
108108   taitotz_state *state = machine.driver_data<taitotz_state>();
109109
110   state->framebuffer.allocate(machine.primary_screen->width(), machine.primary_screen->height());
110   machine.primary_screen->register_screen_bitmap(state->framebuffer);
111111}
112112
113113static SCREEN_UPDATE_RGB32( taitotz )
src/mame/drivers/lastfght.c
r14034r14035
114114   lastfght_state *state = machine.driver_data<lastfght_state>();
115115   int i;
116116   for (i = 0; i < 2; i++)
117      state->m_bitmap[i].allocate(machine.primary_screen->width(), machine.primary_screen->height());
117      machine.primary_screen->register_screen_bitmap(state->m_bitmap[i]);
118118
119119   state->save_item(NAME(state->m_bitmap[0]));
120120   state->save_item(NAME(state->m_bitmap[1]));
src/mame/drivers/gei.c
r14034r14035
147147
148148void gei_state::video_start()
149149{
150   m_bitmap.allocate(machine().primary_screen->width(), machine().primary_screen->height());
150   machine().primary_screen->register_screen_bitmap(m_bitmap);
151151}
152152
153153UINT32 gei_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
src/mame/drivers/astrocorp.c
r14034r14035
6161{
6262   astrocorp_state *state = machine.driver_data<astrocorp_state>();
6363
64   state->m_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
64   machine.primary_screen->register_screen_bitmap(state->m_bitmap);
6565
6666   state->save_item(NAME(state->m_bitmap));
6767   state->save_item       (NAME(state->m_screen_enable));
src/mame/drivers/coolridr.c
r14034r14035
293293static VIDEO_START(coolridr)
294294{
295295   coolridr_state *state = machine.driver_data<coolridr_state>();
296   int width = machine.primary_screen->width();
297   int height = machine.primary_screen->height();
298
299   state->m_temp_bitmap_sprites.allocate(width, height);
296   machine.primary_screen->register_screen_bitmap(state->m_temp_bitmap_sprites);
300297   state->m_test_offs = 0x2000;
301298}
302299
src/mame/drivers/aleck64.c
r14034r14035
277277
278278static ADDRESS_MAP_START( n64_map, AS_PROGRAM, 32 )
279279   AM_RANGE(0x00000000, 0x007fffff) AM_RAM   /*AM_MIRROR(0xc0000000)*/ AM_BASE(&rdram)            // RDRAM
280
281   AM_RANGE(0x03f00000, 0x03f00027) AM_DEVREADWRITE_MODERN("rcp", n64_periphs, rdram_reg_r, rdram_reg_w)
280282   AM_RANGE(0x04000000, 0x04000fff) AM_RAM AM_SHARE("dmem")               // RSP DMEM
281283   AM_RANGE(0x04001000, 0x04001fff) AM_RAM AM_SHARE("imem")               // RSP IMEM
282284   AM_RANGE(0x04040000, 0x040fffff) AM_DEVREADWRITE("rsp", n64_sp_reg_r, n64_sp_reg_w)   // RSP
283285   AM_RANGE(0x04100000, 0x041fffff) AM_DEVREADWRITE("rsp", n64_dp_reg_r, n64_dp_reg_w)   // RDP
284   AM_RANGE(0x04300000, 0x043fffff) AM_READWRITE(n64_mi_reg_r, n64_mi_reg_w)   // MIPS Interface
285   AM_RANGE(0x04400000, 0x044fffff) AM_READWRITE(n64_vi_reg_r, n64_vi_reg_w)   // Video Interface
286   AM_RANGE(0x04500000, 0x045fffff) AM_READWRITE(n64_ai_reg_r, n64_ai_reg_w)   // Audio Interface
287   AM_RANGE(0x04600000, 0x046fffff) AM_READWRITE(n64_pi_reg_r, n64_pi_reg_w)   // Peripheral Interface
288   AM_RANGE(0x04700000, 0x047fffff) AM_READWRITE(n64_ri_reg_r, n64_ri_reg_w)   // RDRAM Interface
289   AM_RANGE(0x04800000, 0x048fffff) AM_READWRITE(n64_si_reg_r, n64_si_reg_w)   // Serial Interface
286   AM_RANGE(0x04300000, 0x043fffff) AM_DEVREADWRITE_MODERN("rcp", n64_periphs, mi_reg_r, mi_reg_w)   // MIPS Interface
287   AM_RANGE(0x04400000, 0x044fffff) AM_DEVREADWRITE_MODERN("rcp", n64_periphs, vi_reg_r, vi_reg_w)   // Video Interface
288   AM_RANGE(0x04500000, 0x045fffff) AM_DEVREADWRITE_MODERN("rcp", n64_periphs, ai_reg_r, ai_reg_w)   // Audio Interface
289   AM_RANGE(0x04600000, 0x046fffff) AM_DEVREADWRITE_MODERN("rcp", n64_periphs, pi_reg_r, pi_reg_w)   // Peripheral Interface
290   AM_RANGE(0x04700000, 0x047fffff) AM_DEVREADWRITE_MODERN("rcp", n64_periphs, ri_reg_r, ri_reg_w)   // RDRAM Interface
291   AM_RANGE(0x04800000, 0x048fffff) AM_DEVREADWRITE_MODERN("rcp", n64_periphs, si_reg_r, si_reg_w)   // Serial Interface
290292   AM_RANGE(0x10000000, 0x13ffffff) AM_ROM AM_REGION("user2", 0)   // Cartridge
291293   AM_RANGE(0x1fc00000, 0x1fc007bf) AM_ROM AM_REGION("user1", 0)   // PIF ROM
292   AM_RANGE(0x1fc007c0, 0x1fc007ff) AM_READWRITE(n64_pif_ram_r, n64_pif_ram_w)
294   AM_RANGE(0x1fc007c0, 0x1fc007ff) AM_DEVREADWRITE_MODERN("rcp", n64_periphs, pif_ram_r, pif_ram_w)
293295
294296   /*
295297        Surely this should mirror main ram? srmvs crashes, and
src/mame/drivers/mazerbla.c
r14034r14035
158158   state->m_dbg_lookup = 4;
159159#endif
160160
161   state->m_tmpbitmaps[0].allocate(machine.primary_screen->width(), machine.primary_screen->height());
162   state->m_tmpbitmaps[1].allocate(machine.primary_screen->width(), machine.primary_screen->height());
163   state->m_tmpbitmaps[2].allocate(machine.primary_screen->width(), machine.primary_screen->height());
164   state->m_tmpbitmaps[3].allocate(machine.primary_screen->width(), machine.primary_screen->height());
161   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmaps[0]);
162   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmaps[1]);
163   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmaps[2]);
164   machine.primary_screen->register_screen_bitmap(state->m_tmpbitmaps[3]);
165165
166166   state->save_item(NAME(state->m_tmpbitmaps[0]));
167167   state->save_item(NAME(state->m_tmpbitmaps[1]));
src/mame/drivers/sliver.c
r14034r14035
441441{
442442   sliver_state *state = machine.driver_data<sliver_state>();
443443
444   state->m_bitmap_bg.allocate(machine.primary_screen->width(), machine.primary_screen->height());
445   state->m_bitmap_fg.allocate(machine.primary_screen->width(), machine.primary_screen->height());
444   machine.primary_screen->register_screen_bitmap(state->m_bitmap_bg);
445   machine.primary_screen->register_screen_bitmap(state->m_bitmap_fg);
446446}
447447
448448static SCREEN_UPDATE_RGB32(sliver)
src/mame/drivers/tmaster.c
r14034r14035
299299   {
300300      for (buffer = 0; buffer < 2; buffer++)
301301      {
302         state->m_bitmap[layer][buffer].allocate(machine.primary_screen->width(), machine.primary_screen->height());
302         machine.primary_screen->register_screen_bitmap(state->m_bitmap[layer][buffer]);
303303         state->m_bitmap[layer][buffer].fill(0xff);
304304      }
305305   }
src/mame/drivers/sms.c
r14034r14035
465465static VIDEO_START( sms )
466466{
467467   sms_state *state = machine.driver_data<sms_state>();
468   state->m_bitmap.allocate(machine.primary_screen->width(), machine.primary_screen->height());
468   machine.primary_screen->register_screen_bitmap(state->m_bitmap);
469469
470470   state_save_register_global_array(machine, state->m_vid_regs);
471471   state_save_register_global_bitmap(machine, &state->m_bitmap);
src/emu/cpu/h6280/h6280ops.h
r14034r14035
2727#define P   cpustate->p
2828#define S   cpustate->sp.b.l
2929
30#define TRANSLATED(addr)   ((cpustate->mmr[(addr)>>13] << 13) | ((addr)&0x1fff))
30#define TRANSLATED(addr)   ((cpustate->mmr[(addr)>>13&7] << 13) | ((addr)&0x1fff))
3131#define H6280_CYCLES(cyc)                                 \
3232   {                                                \
3333      cpustate->ICount -= ((cyc) * cpustate->clocks_per_cycle);      \
src/emu/video/cdp1862.c
r14034r14035
122122
123123   // find devices
124124   m_screen =  machine().device<screen_device>(m_screen_tag);
125   m_bitmap.allocate(m_screen->width(), m_screen->height(), m_screen->format());
125   m_screen->register_screen_bitmap(m_bitmap);
126126
127127   // init palette
128128   initialize_palette();
src/emu/video/v9938.c
r14034r14035
596596   m_vdp_ops_count = 1;
597597   m_vdp_engine = NULL;
598598
599   m_bitmap.allocate(m_screen->width(), m_screen->height());
599   m_screen->register_screen_bitmap(m_bitmap);
600600   m_size_old = -1;
601601
602602   // allocate VRAM
r14034r14035
22122212      else
22132213         m_screen->set_visible_area (0, 256 + 16 - 1, 0, 212 + 28 - 1);
22142214
2215      m_bitmap.allocate(m_screen->width(), m_screen->height());
22162215      m_size_old = m_size;
22172216   }
22182217
src/emu/video/315_5124.c
r14034r14035
16091609void sega315_5124_device::device_start()
16101610{
16111611   m_screen = machine().device<screen_device>( m_screen_tag );
1612   int width = m_screen->width();
1613   int height = m_screen->height();
16141612
16151613   /* Resolve callbacks */
16161614   m_cb_int.resolve( m_int_callback, *this );
r14034r14035
16241622   m_frame_timing = (m_is_pal) ? pal_192 : ntsc_192;
16251623
16261624   /* Make temp bitmap for rendering */
1627   m_tmpbitmap.allocate(width, height);
1628   m_y1_bitmap.allocate(width, height);
1625   m_screen->register_screen_bitmap(m_tmpbitmap);
1626   m_screen->register_screen_bitmap(m_y1_bitmap);
16291627
16301628   m_display_timer = timer_alloc(TIMER_LINE);
16311629   m_display_timer->adjust(m_screen->time_until_pos(0, DISPLAY_CB_HPOS), 0, m_screen->scan_period());
src/emu/video/cdp1861.c
r14034r14035
8282   // find devices
8383   m_cpu = machine().device<cpu_device>(m_cpu_tag);
8484   m_screen =  machine().device<screen_device>(m_screen_tag);
85   m_bitmap.allocate(m_screen->width(), m_screen->height(), m_screen->format());
85   m_screen->register_screen_bitmap(m_bitmap);
8686
8787   // register for state saving
8888   save_item(NAME(m_disp));
src/emu/tilemap.c
r14034r14035
291291
292292void tilemap_init(running_machine &machine)
293293{
294   UINT32 screen_width, screen_height;
295
296   if (machine.primary_screen == NULL)
294   if (machine.primary_screen == NULL || machine.primary_screen->width() == 0)
297295      return;
298296
299   screen_width  = machine.primary_screen->width();
300   screen_height = machine.primary_screen->height();
301
302   if (screen_width != 0 && screen_height != 0)
303   {
304      machine.priority_bitmap.allocate(screen_width, screen_height);
305      machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(tilemap_exit), &machine));
306   }
297   machine.primary_screen->register_screen_bitmap(machine.priority_bitmap);
298   machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(tilemap_exit), &machine));
307299}
308300
309301
src/emu/machine.c
r14034r14035
450450      error = MAMERR_FATALERROR;
451451   }
452452
453   // make sure our phase is set properly before cleaning up,
454   // in case we got here via exception
455   m_current_phase = MACHINE_PHASE_EXIT;
456
453457   // call all exit callbacks registered
454458   call_notifiers(MACHINE_NOTIFY_EXIT);
455459   zip_file_cache_clear();
src/emu/sound/cdp1864.c
r14034r14035
169169   // find devices
170170   m_cpu = machine().device<cpu_device>(m_cpu_tag);
171171   m_screen = machine().device<screen_device>(m_screen_tag);
172   m_bitmap.allocate(m_screen->width(), m_screen->height());
172   m_screen->register_screen_bitmap(m_bitmap);
173173
174174   // register for state saving
175175   save_item(NAME(m_disp));
src/emu/machine/laserdsc.c
r14034r14035
864864      for (int index = 0; index < ARRAY_LENGTH(m_overbitmap); index++)
865865      {
866866         m_overbitmap[index].set_format(format, texformat);
867         m_overbitmap[index].allocate(m_overwidth, m_overheight);
868867         m_overbitmap[index].set_palette(machine().palette);
868         m_overbitmap[index].resize(m_overwidth, m_overheight);
869869      }
870870     
871871      // allocate overlay texture
src/emu/screen.c
r14034r14035
300300   m_screen_update_rgb32.bind_relative_to(*owner());
301301   m_screen_vblank.bind_relative_to(*owner());
302302   
303   // configure bitmap formats
303   // configure bitmap formats and allocate screen bitmaps
304304   texture_format texformat = !m_screen_update_ind16.isnull() ? TEXFORMAT_PALETTE16 : TEXFORMAT_RGB32;
305305   for (int index = 0; index < ARRAY_LENGTH(m_bitmap); index++)
306   {
306307      m_bitmap[index].set_format(format(), texformat);
308      register_screen_bitmap(m_bitmap[index]);
309   }
307310
311   // allocate raw textures
312   m_texture[0] = machine().render().texture_alloc();
313   m_texture[1] = machine().render().texture_alloc();
314
308315   // configure the default cliparea
309316   render_container::user_settings settings;
310317   m_container->get_user_settings(settings);
r14034r14035
522529   if (m_type == SCREEN_TYPE_VECTOR)
523530      return;
524531
525   // extract the current width/height from the bitmap
526   int curwidth = 0, curheight = 0;
527   if (m_bitmap[0].valid())
528   {
529      curwidth = m_bitmap[0].width();
530      curheight = m_bitmap[0].height();
531   }
532   // reize all registered screen bitmaps
533   for (auto_bitmap_item *item = m_auto_bitmap_list.first(); item != NULL; item = item->next())
534      item->m_bitmap.resize(m_width, m_height);
532535
533   // if we're too small to contain this width/height, reallocate our bitmaps and textures
534   if (m_width > curwidth || m_height > curheight)
535   {
536      // free what we have currently
537      machine().render().texture_free(m_texture[0]);
538      machine().render().texture_free(m_texture[1]);
539
540      // compute new width/height
541      curwidth = MAX(m_width, curwidth);
542      curheight = MAX(m_height, curheight);
543
544      // allocate raw textures
545      m_texture[0] = machine().render().texture_alloc();
546      m_texture[1] = machine().render().texture_alloc();
547
548      // allocate bitmaps
549      m_bitmap[0].allocate(curwidth, curheight);
550      m_bitmap[0].set_palette(machine().palette);
551      m_bitmap[1].allocate(curwidth, curheight);
552      m_bitmap[1].set_palette(machine().palette);
553
554      // set up textures
555      m_texture[0]->set_bitmap(m_bitmap[0], m_visarea, m_bitmap[0].texformat());
556      m_texture[1]->set_bitmap(m_bitmap[1], m_visarea, m_bitmap[1].texformat());
557   }
536   // re-set up textures
537   m_texture[0]->set_bitmap(m_bitmap[0], m_visarea, m_bitmap[0].texformat());
538   m_texture[1]->set_bitmap(m_bitmap[1], m_visarea, m_bitmap[1].texformat());
558539}
559540
560541
r14034r14035
564545
565546void screen_device::set_visible_area(int min_x, int max_x, int min_y, int max_y)
566547{
567   // validate arguments
568   assert(min_x >= 0);
569   assert(min_y >= 0);
570   assert(min_x < max_x);
571   assert(min_y < max_y);
572
573   rectangle visarea;
574   visarea.min_x = min_x;
575   visarea.max_x = max_x;
576   visarea.min_y = min_y;
577   visarea.max_y = max_y;
578
548   rectangle visarea(min_x, max_x, min_y, max_y);
549   assert(!visarea.empty());
579550   configure(m_width, m_height, visarea, m_frame_period);
580551}
581552
r14034r14035
810781
811782
812783//-------------------------------------------------
784//  register_screen_bitmap - registers a bitmap
785//  that should track the screen size
786//-------------------------------------------------
787
788void screen_device::register_screen_bitmap(bitmap_t &bitmap)
789{
790   // append to the list
791   m_auto_bitmap_list.append(*global_alloc(auto_bitmap_item(bitmap)));
792
793   // if allocating now, just do it
794   bitmap.allocate(width(), height());
795   bitmap.set_palette(machine().palette);
796}
797
798
799//-------------------------------------------------
813800//  vblank_begin - call any external callbacks to
814801//  signal the VBLANK period has begun
815802//-------------------------------------------------
src/emu/screen.h
r14034r14035
7777{
7878private:
7979   // internal helpers
80   bitmap_t &appropriate_bitmap()
81   {
82      switch (m_format)
83      {
84         case BITMAP_FORMAT_IND16: return m_ind16;
85         case BITMAP_FORMAT_RGB32: return m_rgb32;
86         default: throw emu_fatalerror("Invalid screen_bitmap format");
87      }
88   }
80   bitmap_t &live() { assert(m_live != NULL); return *m_live; }
81   const bitmap_t &live() const { assert(m_live != NULL); return *m_live; }
8982
90   const bitmap_t &appropriate_bitmap() const
91   {
92      switch (m_format)
93      {
94         case BITMAP_FORMAT_IND16: return m_ind16;
95         case BITMAP_FORMAT_RGB32: return m_rgb32;
96         default: throw emu_fatalerror("Invalid screen_bitmap format");
97      }
98   }
99
10083public:
10184   // construction/destruction
10285   screen_bitmap()
10386      : m_format(BITMAP_FORMAT_INVALID),
104        m_texformat(TEXFORMAT_UNDEFINED) { }
87        m_texformat(TEXFORMAT_UNDEFINED),
88        m_live(NULL) { }
10589   screen_bitmap(bitmap_ind16 &orig)
10690      : m_format(BITMAP_FORMAT_IND16),
10791        m_texformat(TEXFORMAT_PALETTE16),
92        m_live(&m_ind16),
10893        m_ind16(orig, orig.cliprect()) { }
10994   screen_bitmap(bitmap_rgb32 &orig)
11095      : m_format(BITMAP_FORMAT_RGB32),
11196        m_texformat(TEXFORMAT_RGB32),
97        m_live(&m_rgb32),
11298        m_rgb32(orig, orig.cliprect()) { }
11399   
114   // allocation
115   void allocate(int width, int height)
116   {
117      switch (m_format)
118      {
119         case BITMAP_FORMAT_IND16: m_ind16.allocate(width, height); break;
120         case BITMAP_FORMAT_RGB32: m_rgb32.allocate(width, height); break;
121         default: throw emu_fatalerror("Invalid screen_bitmap format");
122      }
123   }
100   // resizing
101   void resize(int width, int height) { live().resize(width, height); }
124102
125103   // conversion
126   operator bitmap_t &() { return appropriate_bitmap(); }
104   operator bitmap_t &() { return live(); }
127105   bitmap_ind16 &as_ind16() { assert(m_format == BITMAP_FORMAT_IND16); return m_ind16; }
128106   bitmap_rgb32 &as_rgb32() { assert(m_format == BITMAP_FORMAT_RGB32); return m_rgb32; }
129107   
130108   // getters
131   INT32 width() const { return appropriate_bitmap().width(); }
132   INT32 height() const { return appropriate_bitmap().height(); }
133   INT32 rowpixels() const { return appropriate_bitmap().rowpixels(); }
134   INT32 rowbytes() const { return appropriate_bitmap().rowbytes(); }
135   UINT8 bpp() const { return appropriate_bitmap().bpp(); }
109   INT32 width() const { return live().width(); }
110   INT32 height() const { return live().height(); }
111   INT32 rowpixels() const { return live().rowpixels(); }
112   INT32 rowbytes() const { return live().rowbytes(); }
113   UINT8 bpp() const { return live().bpp(); }
136114   bitmap_format format() const { return m_format; }
137115   texture_format texformat() const { return m_texformat; }
138   bool valid() const { return appropriate_bitmap().valid(); }
139   palette_t *palette() const { return appropriate_bitmap().palette(); }
140   const rectangle &cliprect() const { return appropriate_bitmap().cliprect(); }
116   bool valid() const { return live().valid(); }
117   palette_t *palette() const { return live().palette(); }
118   const rectangle &cliprect() const { return live().cliprect(); }
141119
142120   // operations
143   void set_palette(palette_t *palette) { appropriate_bitmap().set_palette(palette); }
121   void set_palette(palette_t *palette) { live().set_palette(palette); }
144122   void set_format(bitmap_format format, texture_format texformat)
145123   {
146124      m_format = format;
147125      m_texformat = texformat;
126      switch (format)
127      {
128         case BITMAP_FORMAT_IND16:   m_live = &m_ind16;   break;
129         case BITMAP_FORMAT_RGB32:   m_live = &m_rgb32;   break;
130         default:               m_live = NULL;      break;
131      }
148132      m_ind16.reset();
149133      m_rgb32.reset();
150134   }
r14034r14035
153137   // internal state
154138   bitmap_format      m_format;
155139   texture_format      m_texformat;
140   bitmap_t *         m_live;
156141   bitmap_ind16      m_ind16;
157142   bitmap_rgb32      m_rgb32;
158143};
r14034r14035
237222   
238223   // additional helpers
239224   void register_vblank_callback(vblank_state_delegate vblank_callback);
225   void register_screen_bitmap(bitmap_t &bitmap);
240226
241227   // internal to the video system
242228   bool update_quads();
r14034r14035
315301   UINT64            m_frame_number;            // the current frame number
316302   UINT32            m_partial_updates_this_frame;// partial update counter this frame
317303
304   // VBLANK callbacks
318305   class callback_item
319306   {
320307   public:
r14034r14035
327314      vblank_state_delegate      m_callback;
328315   };
329316   simple_list<callback_item> m_callback_list;      // list of VBLANK callbacks
317
318   // auto-sizing bitmaps
319   class auto_bitmap_item
320   {
321   public:
322      auto_bitmap_item(bitmap_t &bitmap)
323         : m_next(NULL),
324           m_bitmap(bitmap) { }
325      auto_bitmap_item *next() const { return m_next; }
326     
327      auto_bitmap_item *         m_next;
328      bitmap_t &               m_bitmap;
329   };
330   simple_list<auto_bitmap_item> m_auto_bitmap_list; // list of registered bitmaps
330331};
331332
332333// device type definition
src/lib/util/bitmap.c
r14034r14035
3939
4040#include "bitmap.h"
4141
42#include <stdlib.h>
43
44#ifdef __cplusplus
4542#include <new>
46#endif
4743
4844
45
4946//**************************************************************************
50//  BITMAP ALLOCATION/CONFIGURATION
47//  CONSTANTS
5148//**************************************************************************
5249
50// alignment values; 128 bytes is the largest cache line on typical
51// architectures today
52const UINT32 BITMAP_OVERALL_ALIGN = 128;
53const UINT32 BITMAP_ROWBYTES_ALIGN = 128;
54
55
56
57//**************************************************************************
58//  INLINE HELPERS
59//**************************************************************************
60
5361//-------------------------------------------------
54//  bitmap_t - basic constructor
62//  compute_rowpixels - compute an aligned
63//  rowpixels value
5564//-------------------------------------------------
5665
57bitmap_t::bitmap_t()
58   : m_alloc(NULL),
59     m_palette(NULL)
66inline INT32 bitmap_t::compute_rowpixels(int width, int xslop)
6067{
61   // deallocate intializes all other fields
62   reset();
68   int rowpixels_align = BITMAP_ROWBYTES_ALIGN / (m_bpp / 8);
69   return ((width + 2 * xslop + (rowpixels_align - 1)) / rowpixels_align) * rowpixels_align;
6370}
6471
6572
66bitmap_t::bitmap_t(int width, int height, bitmap_format format, int xslop, int yslop)
73//-------------------------------------------------
74//  compute_base - compute an aligned bitmap base
75//  address with the given slop values
76//-------------------------------------------------
77
78inline void bitmap_t::compute_base(int xslop, int yslop)
79{
80   m_base = m_alloc + (m_rowpixels * yslop + xslop) * (m_bpp / 8);
81   UINT64 aligned_base = ((reinterpret_cast<UINT64>(m_base) + (BITMAP_OVERALL_ALIGN - 1)) / BITMAP_OVERALL_ALIGN) * BITMAP_OVERALL_ALIGN;
82   m_base = reinterpret_cast<void *>(aligned_base);
83}
84
85
86
87//**************************************************************************
88//  BITMAP ALLOCATION/CONFIGURATION
89//**************************************************************************
90
91//-------------------------------------------------
92//  bitmap_t - basic constructor
93//-------------------------------------------------
94
95bitmap_t::bitmap_t(bitmap_format format, int bpp, int width, int height, int xslop, int yslop)
6796   : m_alloc(NULL),
97     m_allocbytes(0),
98     m_format(format),
99     m_bpp(bpp),
68100     m_palette(NULL)
69101{
70102   // allocate intializes all other fields
71   allocate(width, height, format, xslop, yslop);
103   allocate(width, height, xslop, yslop);
72104}
73105
74106
75bitmap_t::bitmap_t(void *base, int width, int height, int rowpixels, bitmap_format format)
107bitmap_t::bitmap_t(bitmap_format format, int bpp, void *base, int width, int height, int rowpixels)
76108   : m_alloc(NULL),
109     m_allocbytes(0),
77110     m_base(base),
78111     m_rowpixels(rowpixels),
79112     m_width(width),
80113     m_height(height),
81114     m_format(format),
82     m_bpp(format_to_bpp(format)),
115     m_bpp(bpp),
83116     m_palette(NULL),
84117     m_cliprect(0, width - 1, 0, height - 1)
85118{
86   // fail if invalid format
87   if (m_bpp == 0)
88      throw std::bad_alloc();
89119}
90120
91121
92bitmap_t::bitmap_t(bitmap_t &source, const rectangle &subrect)
122bitmap_t::bitmap_t(bitmap_format format, int bpp, bitmap_t &source, const rectangle &subrect)
93123   : m_alloc(NULL),
124     m_allocbytes(0),
94125     m_base(source.raw_pixptr(subrect.min_y, subrect.min_x)),
95126     m_rowpixels(source.m_rowpixels),
96127     m_width(subrect.width()),
97128     m_height(subrect.height()),
98     m_format(source.m_format),
99     m_bpp(source.m_bpp),
129     m_format(format),
130     m_bpp(bpp),
100131     m_palette(NULL),
101132     m_cliprect(0, subrect.width() - 1, 0, subrect.height() - 1)
102133{
134   assert(format == source.m_format);
135   assert(bpp == source.m_bpp);
103136   assert(source.cliprect().contains(subrect));
104137}
105138
r14034r14035
121154//  already exists
122155//-------------------------------------------------
123156
124void bitmap_t::allocate(int width, int height, bitmap_format format, int xslop, int yslop)
157void bitmap_t::allocate(int width, int height, int xslop, int yslop)
125158{
159   assert(m_format != BITMAP_FORMAT_INVALID);
160   assert(m_bpp == 8 || m_bpp == 16 || m_bpp == 32 || m_bpp == 64);
161
126162   // delete any existing stuff
127163   reset();
164   
165   // handle empty requests cleanly
166   if (width <= 0 || height <= 0)
167      return;
128168
129169   // initialize fields
130   m_rowpixels = (width + 2 * xslop + 7) & ~7;
170   m_rowpixels = compute_rowpixels(width, xslop);
131171   m_width = width;
132172   m_height = height;
133   m_format = format;
134   m_bpp = format_to_bpp(format);
135   if (m_bpp == 0)
136      throw std::bad_alloc();
137173   m_cliprect.set(0, width - 1, 0, height - 1);
138174
139175   // allocate memory for the bitmap itself
140   size_t allocbytes = m_rowpixels * (m_height + 2 * yslop) * m_bpp / 8;
141   m_alloc = new UINT8[allocbytes];
176   m_allocbytes = m_rowpixels * (m_height + 2 * yslop) * m_bpp / 8;
177   m_allocbytes += BITMAP_OVERALL_ALIGN - 1;
178   m_alloc = new UINT8[m_allocbytes];
142179
143180   // clear to 0 by default
144   memset(m_alloc, 0, allocbytes);
181   memset(m_alloc, 0, m_allocbytes);
145182
146183   // compute the base
147   m_base = m_alloc + (m_rowpixels * yslop + xslop) * (m_bpp / 8);
184   compute_base(xslop, yslop);
148185}
149186
150187
151188//-------------------------------------------------
189//  resize -- resize a bitmap, reusing existing
190//  memory if the new size is smaller than the
191//  current size
192//-------------------------------------------------
193
194void bitmap_t::resize(int width, int height, int xslop, int yslop)
195{
196   assert(m_format != BITMAP_FORMAT_INVALID);
197   assert(m_bpp == 8 || m_bpp == 16 || m_bpp == 32 || m_bpp == 64);
198
199   // handle empty requests cleanly
200   if (width <= 0 || height <= 0)
201      width = height = 0;
202
203   // determine how much memory we need for the new bitmap
204   int new_rowpixels = compute_rowpixels(width, xslop);
205   UINT32 new_allocbytes = new_rowpixels * (height + 2 * yslop) * m_bpp / 8;
206   new_allocbytes += BITMAP_OVERALL_ALIGN - 1;
207   
208   // if we need more memory, just realloc
209   if (new_allocbytes > m_allocbytes)
210   {
211      palette_t *palette = m_palette;
212      allocate(width, height, xslop, yslop);
213      set_palette(palette);
214      return;
215   }
216   
217   // otherwise, reconfigure
218   m_rowpixels = new_rowpixels;
219   m_width = width;
220   m_height = height;
221   m_cliprect.set(0, width - 1, 0, height - 1);
222
223   // re-compute the base
224   compute_base(xslop, yslop);
225}
226
227
228//-------------------------------------------------
152229//  reset -- reset to an invalid bitmap, deleting
153230//  all allocated stuff
154231//-------------------------------------------------
r14034r14035
165242   m_rowpixels = 0;
166243   m_width = 0;
167244   m_height = 0;
168   m_format = BITMAP_FORMAT_INVALID;
169   m_bpp = 0;
170245   m_cliprect.set(0, -1, 0, -1);
171246}
172247
r14034r14035
176251//  bitmap does not own the memory
177252//-------------------------------------------------
178253
179void bitmap_t::wrap(void *base, int width, int height, int rowpixels, bitmap_format format)
254void bitmap_t::wrap(void *base, int width, int height, int rowpixels)
180255{
181256   // delete any existing stuff
182257   reset();
r14034r14035
186261   m_rowpixels = rowpixels;
187262   m_width = width;
188263   m_height = height;
189   m_format = format;
190   m_bpp = format_to_bpp(format);
191264   m_cliprect.set(0, m_width - 1, 0, m_height - 1);
192265}
193266
r14034r14035
200273
201274void bitmap_t::wrap(bitmap_t &source, const rectangle &subrect)
202275{
276   assert(m_format == source.m_format);
277   assert(m_bpp == source.m_bpp);
278   assert(source.cliprect().contains(subrect));
279
203280   // delete any existing stuff
204281   reset();
205282   
206283   // copy relevant fields
207   assert(source.cliprect().contains(subrect));
208284   m_base = source.raw_pixptr(subrect.min_y, subrect.min_x);
209285   m_rowpixels = source.m_rowpixels;
210286   m_width = subrect.width();
211287   m_height = subrect.height();
212   m_format = source.m_format;
213   m_bpp = source.m_bpp;
214288   set_palette(source.m_palette);
215289   m_cliprect.set(0, m_width - 1, 0, m_height - 1);
216290}
r14034r14035
333407         break;
334408   }
335409}
336
337
338//-------------------------------------------------
339//  format_to_bpp - given a format, return the bpp
340//-------------------------------------------------
341
342UINT8 bitmap_t::format_to_bpp(bitmap_format format)
343{
344   // choose a depth for the format
345   switch (format)
346   {
347      case BITMAP_FORMAT_IND8:
348         return 8;
349
350      case BITMAP_FORMAT_IND16:
351      case BITMAP_FORMAT_YUY16:
352         return 16;
353
354      case BITMAP_FORMAT_IND32:
355      case BITMAP_FORMAT_RGB32:
356      case BITMAP_FORMAT_ARGB32:
357         return 32;
358
359      case BITMAP_FORMAT_IND64:
360         return 64;
361
362      default:
363         break;
364   }
365   return 0;
366}
src/lib/util/bitmap.h
r14034r14035
129129   bitmap_t &operator=(const bitmap_t &);
130130
131131protected:
132   // construction/destruction -- subclasses only
133   bitmap_t();
134   bitmap_t(int width, int height, bitmap_format format, int xslop = 0, int yslop = 0);
135   bitmap_t(void *base, int width, int height, int rowpixels, bitmap_format format);
136   bitmap_t(bitmap_t &source, const rectangle &subrect);
132   // construction/destruction -- subclasses only to ensure type correctness
133   bitmap_t(bitmap_format format, int bpp, int width = 0, int height = 0, int xslop = 0, int yslop = 0);
134   bitmap_t(bitmap_format format, int bpp, void *base, int width, int height, int rowpixels);
135   bitmap_t(bitmap_format format, int bpp, bitmap_t &source, const rectangle &subrect);
137136   virtual ~bitmap_t();
138137
139138public:
r14034r14035
151150   palette_t *palette() const { return m_palette; }
152151   const rectangle &cliprect() const { return m_cliprect; }
153152
153   // allocation/sizing
154   void allocate(int width, int height, int xslop = 0, int yslop = 0);
155   void resize(int width, int height, int xslop = 0, int yslop = 0);
156
154157   // operations
155158   void set_palette(palette_t *palette);
156159   void fill(rgb_t color) { fill(color, m_cliprect); }
r14034r14035
166169   _PixelType &pixt(INT32 y, INT32 x = 0) const { return *(reinterpret_cast<_PixelType *>(m_base) + y * m_rowpixels + x); }
167170   void *raw_pixptr(INT32 y, INT32 x = 0) const { return reinterpret_cast<UINT8 *>(m_base) + (y * m_rowpixels + x) * m_bpp / 8; }
168171
169   // static helpers
170   static UINT8 format_to_bpp(bitmap_format format);
171
172172protected:
173   // for use by subclasses only
174   void allocate(int width, int height, bitmap_format format, int xslop = 0, int yslop = 0);
175   void wrap(void *base, int width, int height, int rowpixels, bitmap_format format);
173   // for use by subclasses only to ensure type correctness
174   void wrap(void *base, int width, int height, int rowpixels);
176175   void wrap(bitmap_t &source, const rectangle &subrect);
177176
178177private:
178   // internal helpers
179   INT32 compute_rowpixels(int width, int xslop);
180   void compute_base(int xslop, int yslop);
181
179182   // internal state
180183   UINT8 *         m_alloc;      // pointer to allocated pixel memory
184   UINT32         m_allocbytes;   // size of our allocation
181185   void *         m_base;         // pointer to pixel (0,0) (adjusted for padding)
182186   INT32         m_rowpixels;   // pixels per row (including padding)
183187   INT32         m_width;      // width of the bitmap
r14034r14035
200204
201205protected:
202206   // construction/destruction -- subclasses only
203   bitmap8_t() : bitmap_t() { }
204   bitmap8_t(int width, int height, bitmap_format format, int xslop = 0, int yslop = 0) : bitmap_t(width, height, format, xslop, yslop) { assert(valid_format(format)); }
205   bitmap8_t(void *base, int width, int height, int rowpixels, bitmap_format format): bitmap_t(base, width, height, rowpixels, format) { assert(valid_format(format)); }
206   bitmap8_t(bitmap8_t &source, const rectangle &subrect) : bitmap_t(source, subrect) { }
207   bitmap8_t(bitmap_format format, int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap_t(format, 8, width, height, xslop, yslop) { }
208   bitmap8_t(bitmap_format format, void *base, int width, int height, int rowpixels) : bitmap_t(format, 8, base, width, height, rowpixels) { assert(valid_format(format)); }
209   bitmap8_t(bitmap_format format, bitmap8_t &source, const rectangle &subrect) : bitmap_t(format, 8, source, subrect) { }
207210
208211public:
209212   // getters
r14034r14035
224227
225228protected:
226229   // construction/destruction -- subclasses only
227   bitmap16_t() : bitmap_t() { }
228   bitmap16_t(int width, int height, bitmap_format format, int xslop = 0, int yslop = 0) : bitmap_t(width, height, format, xslop, yslop) { assert(valid_format(format)); }
229   bitmap16_t(void *base, int width, int height, int rowpixels, bitmap_format format): bitmap_t(base, width, height, rowpixels, format) { assert(valid_format(format)); }
230   bitmap16_t(bitmap16_t &source, const rectangle &subrect) : bitmap_t(source, subrect) { }
230   bitmap16_t(bitmap_format format, int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap_t(format, 16, width, height, xslop, yslop) { assert(valid_format(format)); }
231   bitmap16_t(bitmap_format format, void *base, int width, int height, int rowpixels) : bitmap_t(format, 16, base, width, height, rowpixels) { assert(valid_format(format)); }
232   bitmap16_t(bitmap_format format, bitmap16_t &source, const rectangle &subrect) : bitmap_t(format, 16, source, subrect) { }
231233
232234public:
233235   // getters
r14034r14035
248250
249251protected:
250252   // construction/destruction -- subclasses only
251   bitmap32_t() : bitmap_t() { }
252   bitmap32_t(int width, int height, bitmap_format format, int xslop = 0, int yslop = 0) : bitmap_t(width, height, format, xslop, yslop) { assert(valid_format(format)); }
253   bitmap32_t(void *base, int width, int height, int rowpixels, bitmap_format format): bitmap_t(base, width, height, rowpixels, format) { assert(valid_format(format)); }
254   bitmap32_t(bitmap32_t &source, const rectangle &subrect) : bitmap_t(source, subrect) { }
253   bitmap32_t(bitmap_format format, int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap_t(format, 32, width, height, xslop, yslop) { assert(valid_format(format)); }
254   bitmap32_t(bitmap_format format, void *base, int width, int height, int rowpixels) : bitmap_t(format, 32, base, width, height, rowpixels) { assert(valid_format(format)); }
255   bitmap32_t(bitmap_format format, bitmap32_t &source, const rectangle &subrect) : bitmap_t(format, 32, source, subrect) { }
255256
256257public:
257258   // getters
r14034r14035
272273
273274protected:
274275   // construction/destruction -- subclasses only
275   bitmap64_t() : bitmap_t() { }
276   bitmap64_t(int width, int height, bitmap_format format, int xslop = 0, int yslop = 0) : bitmap_t(width, height, format, xslop, yslop) { assert(valid_format(format)); }
277   bitmap64_t(void *base, int width, int height, int rowpixels, bitmap_format format): bitmap_t(base, width, height, rowpixels, format) { assert(valid_format(format)); }
278   bitmap64_t(bitmap64_t &source, const rectangle &subrect) : bitmap_t(source, subrect) { }
276   bitmap64_t(bitmap_format format, int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap_t(format, 64, width, height, xslop, yslop) { assert(valid_format(format)); }
277   bitmap64_t(bitmap_format format, void *base, int width, int height, int rowpixels) : bitmap_t(format, 64, base, width, height, rowpixels) { assert(valid_format(format)); }
278   bitmap64_t(bitmap_format format, bitmap64_t &source, const rectangle &subrect) : bitmap_t(format, 64, source, subrect) { }
279279
280280public:
281281   // getters
r14034r14035
297297   
298298public:
299299   // construction/destruction
300   bitmap_ind8() : bitmap8_t() { }
301   bitmap_ind8(int width, int height, int xslop = 0, int yslop = 0) : bitmap8_t(width, height, k_bitmap_format, xslop, yslop) { }
302   bitmap_ind8(void *base, int width, int height, int rowpixels) : bitmap8_t(base, width, height, rowpixels, k_bitmap_format) { }
303   bitmap_ind8(bitmap_ind8 &source, const rectangle &subrect) : bitmap8_t(source, subrect) { }
304   void allocate(int width, int height, int xslop = 0, int yslop = 0) { bitmap_t::allocate(width, height, k_bitmap_format, xslop, yslop); }
305   void wrap(UINT8 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels, k_bitmap_format); }
300   bitmap_ind8(int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap8_t(k_bitmap_format, width, height, xslop, yslop) { }
301   bitmap_ind8(void *base, int width, int height, int rowpixels) : bitmap8_t(k_bitmap_format, base, width, height, rowpixels) { }
302   bitmap_ind8(bitmap_ind8 &source, const rectangle &subrect) : bitmap8_t(k_bitmap_format, source, subrect) { }
303   void wrap(UINT8 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); }
306304   void wrap(bitmap_ind8 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast<bitmap_t &>(source), subrect); }
307305
308306   // getters
r14034r14035
316314
317315public:
318316   // construction/destruction
319   bitmap_ind16() : bitmap16_t() { }
320   bitmap_ind16(int width, int height, int xslop = 0, int yslop = 0) : bitmap16_t(width, height, k_bitmap_format, xslop, yslop) { }
321   bitmap_ind16(void *base, int width, int height, int rowpixels) : bitmap16_t(base, width, height, rowpixels, k_bitmap_format) { }
322   bitmap_ind16(bitmap_ind16 &source, const rectangle &subrect) : bitmap16_t(source, subrect) { }
323   void allocate(int width, int height, int xslop = 0, int yslop = 0) { bitmap_t::allocate(width, height, k_bitmap_format, xslop, yslop); }
324   void wrap(UINT16 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels, k_bitmap_format); }
325   void wrap(bitmap_ind16 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast<bitmap_t &>(source), subrect); }
317   bitmap_ind16(int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap16_t(k_bitmap_format, width, height, xslop, yslop) { }
318   bitmap_ind16(void *base, int width, int height, int rowpixels) : bitmap16_t(k_bitmap_format, base, width, height, rowpixels) { }
319   bitmap_ind16(bitmap_ind16 &source, const rectangle &subrect) : bitmap16_t(k_bitmap_format, source, subrect) { }
320   void wrap(UINT16 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); }
321   void wrap(bitmap_ind8 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast<bitmap_t &>(source), subrect); }
326322
327323   // getters
328324   bitmap_format format() const { return k_bitmap_format; }
r14034r14035
335331
336332public:
337333   // construction/destruction
338   bitmap_ind32() : bitmap32_t() { }
339   bitmap_ind32(int width, int height, int xslop = 0, int yslop = 0) : bitmap32_t(width, height, k_bitmap_format, xslop, yslop) { }
340   bitmap_ind32(void *base, int width, int height, int rowpixels) : bitmap32_t(base, width, height, rowpixels, k_bitmap_format) { }
341   bitmap_ind32(bitmap_ind32 &source, const rectangle &subrect) : bitmap32_t(source, subrect) { }
342   void allocate(int width, int height, int xslop = 0, int yslop = 0) { bitmap_t::allocate(width, height, k_bitmap_format, xslop, yslop); }
343   void wrap(UINT32 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels, k_bitmap_format); }
344   void wrap(bitmap_ind32 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast<bitmap_t &>(source), subrect); }
334   bitmap_ind32(int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap32_t(k_bitmap_format, width, height, xslop, yslop) { }
335   bitmap_ind32(void *base, int width, int height, int rowpixels) : bitmap32_t(k_bitmap_format, base, width, height, rowpixels) { }
336   bitmap_ind32(bitmap_ind32 &source, const rectangle &subrect) : bitmap32_t(k_bitmap_format, source, subrect) { }
337   void wrap(UINT32 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); }
338   void wrap(bitmap_ind8 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast<bitmap_t &>(source), subrect); }
345339
346340   // getters
347341   bitmap_format format() const { return k_bitmap_format; }
r14034r14035
354348
355349public:
356350   // construction/destruction
357   bitmap_ind64() : bitmap64_t() { }
358   bitmap_ind64(int width, int height, int xslop = 0, int yslop = 0) : bitmap64_t(width, height, k_bitmap_format, xslop, yslop) { }
359   bitmap_ind64(void *base, int width, int height, int rowpixels) : bitmap64_t(base, width, height, rowpixels, k_bitmap_format) { }
360   bitmap_ind64(bitmap_ind64 &source, const rectangle &subrect) : bitmap64_t(source, subrect) { }
361   void allocate(int width, int height, int xslop = 0, int yslop = 0) { bitmap_t::allocate(width, height, k_bitmap_format, xslop, yslop); }
362   void wrap(UINT64 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels, k_bitmap_format); }
363   void wrap(bitmap_ind64 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast<bitmap_t &>(source), subrect); }
351   bitmap_ind64(int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap64_t(k_bitmap_format, width, height, xslop, yslop) { }
352   bitmap_ind64(void *base, int width, int height, int rowpixels) : bitmap64_t(k_bitmap_format, base, width, height, rowpixels) { }
353   bitmap_ind64(bitmap_ind64 &source, const rectangle &subrect) : bitmap64_t(k_bitmap_format, source, subrect) { }
354   void wrap(UINT64 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); }
355   void wrap(bitmap_ind8 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast<bitmap_t &>(source), subrect); }
364356
365357   // getters
366358   bitmap_format format() const { return k_bitmap_format; }
r14034r14035
376368
377369public:
378370   // construction/destruction
379   bitmap_yuy16() : bitmap16_t() { }
380   bitmap_yuy16(int width, int height, int xslop = 0, int yslop = 0) : bitmap16_t(width, height, k_bitmap_format, xslop, yslop) { }
381   bitmap_yuy16(void *base, int width, int height, int rowpixels) : bitmap16_t(base, width, height, rowpixels, k_bitmap_format) { }
382   bitmap_yuy16(bitmap_yuy16 &source, const rectangle &subrect) : bitmap16_t(source, subrect) { }
383   void allocate(int width, int height, int xslop = 0, int yslop = 0) { bitmap_t::allocate(width, height, k_bitmap_format, xslop, yslop); }
384   void wrap(UINT16 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels, k_bitmap_format); }
371   bitmap_yuy16(int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap16_t(k_bitmap_format, width, height, xslop, yslop) { }
372   bitmap_yuy16(void *base, int width, int height, int rowpixels) : bitmap16_t(k_bitmap_format, base, width, height, rowpixels) { }
373   bitmap_yuy16(bitmap_yuy16 &source, const rectangle &subrect) : bitmap16_t(k_bitmap_format, source, subrect) { }
374   void wrap(UINT16 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); }
385375   void wrap(bitmap_yuy16 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast<bitmap_t &>(source), subrect); }
386376
387377   // getters
r14034r14035
395385
396386public:
397387   // construction/destruction
398   bitmap_rgb32() : bitmap32_t() { }
399   bitmap_rgb32(int width, int height, int xslop = 0, int yslop = 0) : bitmap32_t(width, height, k_bitmap_format, xslop, yslop) { }
400   bitmap_rgb32(void *base, int width, int height, int rowpixels) : bitmap32_t(base, width, height, rowpixels, k_bitmap_format) { }
401   bitmap_rgb32(bitmap_rgb32 &source, const rectangle &subrect) : bitmap32_t(source, subrect) { }
402   void allocate(int width, int height, int xslop = 0, int yslop = 0) { bitmap_t::allocate(width, height, k_bitmap_format, xslop, yslop); }
403   void wrap(UINT32 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels, k_bitmap_format); }
388   bitmap_rgb32(int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap32_t(k_bitmap_format, width, height, xslop, yslop) { }
389   bitmap_rgb32(void *base, int width, int height, int rowpixels) : bitmap32_t(k_bitmap_format, base, width, height, rowpixels) { }
390   bitmap_rgb32(bitmap_rgb32 &source, const rectangle &subrect) : bitmap32_t(k_bitmap_format, source, subrect) { }
391   void wrap(UINT32 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); }
404392   void wrap(bitmap_rgb32 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast<bitmap_t &>(source), subrect); }
405393
406394   // getters
r14034r14035
414402
415403public:
416404   // construction/destruction
417   bitmap_argb32() : bitmap32_t() { }
418   bitmap_argb32(int width, int height, int xslop = 0, int yslop = 0) : bitmap32_t(width, height, k_bitmap_format, xslop, yslop) { }
419   bitmap_argb32(void *base, int width, int height, int rowpixels) : bitmap32_t(base, width, height, rowpixels, k_bitmap_format) { }
420   bitmap_argb32(bitmap_argb32 &source, const rectangle &subrect) : bitmap32_t(source, subrect) { }
421   void allocate(int width, int height, int xslop = 0, int yslop = 0) { bitmap_t::allocate(width, height, k_bitmap_format, xslop, yslop); }
422   void wrap(UINT32 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels, k_bitmap_format); }
405   bitmap_argb32(int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap32_t(k_bitmap_format, width, height, xslop, yslop) { }
406   bitmap_argb32(void *base, int width, int height, int rowpixels) : bitmap32_t(k_bitmap_format, base, width, height, rowpixels) { }
407   bitmap_argb32(bitmap_argb32 &source, const rectangle &subrect) : bitmap32_t(k_bitmap_format, source, subrect) { }
408   void wrap(UINT32 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); }
423409   void wrap(bitmap_argb32 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast<bitmap_t &>(source), subrect); }
424410
425411   // getters

Previous 15994 Revisions Next


© 1998-2018 The MESS Team