summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/redclash.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2012-01-12 21:19:49 +0000
committer Aaron Giles <aaron@aarongiles.com>2012-01-12 21:19:49 +0000
commite4238fb654d6ce33993877476566d42846fba9a0 (patch)
tree2f635b3572bebf756f7cd5015d7c6a950bade249 /src/mame/video/redclash.c
parent6a8a2afd4aed4bacfde0824259d47ce960c0983c (diff)
Major bitmap-related changes throughout the system. There are
almost certainly some regressions lurking. Let me know if something seems busted. Bitmaps are now strongly typed based on format. bitmap_t still exists as an abstract base class, but it is almost never used. Instead, format-specific bitmap classes are provided: bitmap_ind8 == 8bpp indexed bitmap_ind16 == 16bpp indexed bitmap_ind32 == 32bpp indexed bitmap_ind64 == 64bpp indexed bitmap_rgb32 == 32bpp RGB bitmap_argb32 == 32bpp ARGB bitmap_yuy16 == 16bpp YUY For each format, a generic pix() method is provided which references pixels of the correct type. The old pix8/pix16/pix32/ pix64 methods still exist in the short term, but the only one available is the one that matches the bitmap's pixel size. Note also that the old RGB15 format bitmaps are no longer supported at all. Converted model1, megadriv, and stv drivers away from the RGB15 format bitmaps. New auto_bitmap_<type>_alloc() macros are provided for allocating the appropriate type of bitmap. Screen update functions now must specify the correct bitmap type as their input parameters. For static update functions the SCREEN_UPDATE macro is now replaced with SCREEN_UPDATE_RGB32 and SCREEN_UPDATE_IND16 macros. All existing drivers have been updated to use the correct macros. Screen update functions are now required for all screens; there is no longer any default behavior of copying a "default" bitmap to the screen (in fact the default bitmap has been deprecated). Use one of the following to specify your screen_update callback: MCFG_SCREEN_UPDATE_STATIC(name) - static functions MCFG_SCREEN_UPDATE_DRIVER(class, func) - driver members MCFG_SCREEN_UPDATE_DEVICE(tag, class, func) - device members Because the target bitmap format can now be deduced from the screen update function itself, the MCFG_SCREEN_FORMAT macro is no longer necessary, and has been removed. If you specify a screen update callback that takes a bitmap_ind16, then the screen will be configured to use a 16bpp indexed bitmap, and if you specify a callback that takes a bitmap_rgb32, then a 32bpp RGB bitmap will be provided. Extended the bitmap classes to support wrapping a subregion of another bitmap, and cleaner allocation/resetting. The preferred use of bitmaps now is to define them directly in drivers/devices and use allocate() or wrap() to set them up, rather than allocating them via auto_bitmap_*_alloc(). Several common devices needed overhauls or changes as a result of the above changes: * Reorganized the laserdisc base driver and all the laserdisc drivers as modern C++ devices, cleaning the code up considerably. Merged ldsound device into the laserdsc device since modern devices are flexible enough to handle it. * Reorganized the v9938 device as a modern C++ device. Removed v9938mod.c in favor of template functions in v9938.c directly. * Added independent ind16 and rgb32 callbacks for TMS340x0 devices. * All video devices are now hard-coded to either ind16 or rgb32 bitmaps. The most notable is the mc6845 which is rgb32, and required changes to a number of consumers. * Added screen_update methods to most video devices so they can be directly called via MCFG_SCREEN_UPDATE_DEVICE instead of creating tons of stub functions.
Diffstat (limited to 'src/mame/video/redclash.c')
-rw-r--r--src/mame/video/redclash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mame/video/redclash.c b/src/mame/video/redclash.c
index ad07b4aade6..f167c0f1a02 100644
--- a/src/mame/video/redclash.c
+++ b/src/mame/video/redclash.c
@@ -183,7 +183,7 @@ VIDEO_START( redclash )
tilemap_set_transparent_pen(state->m_fg_tilemap, 0);
}
-static void draw_sprites( running_machine &machine, bitmap_t &bitmap, const rectangle &cliprect )
+static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
{
ladybug_state *state = machine.driver_data<ladybug_state>();
UINT8 *spriteram = state->m_spriteram;
@@ -267,7 +267,7 @@ static void draw_sprites( running_machine &machine, bitmap_t &bitmap, const rect
}
}
-static void draw_bullets( running_machine &machine, bitmap_t &bitmap, const rectangle &cliprect )
+static void draw_bullets( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
{
ladybug_state *state = machine.driver_data<ladybug_state>();
int offs;
@@ -360,7 +360,7 @@ void redclash_set_stars_speed( running_machine &machine, UINT8 speed )
/* Space Raider doesn't use the Va bit, and it is also set up to */
/* window the stars to a certain x range */
-void redclash_draw_stars( running_machine &machine, bitmap_t &bitmap, const rectangle &cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx )
+void redclash_draw_stars( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx )
{
ladybug_state *redclash = machine.driver_data<ladybug_state>();
int i;
@@ -423,7 +423,7 @@ SCREEN_EOF( redclash )
redclash_update_stars_state(screen.machine());
}
-SCREEN_UPDATE( redclash )
+SCREEN_UPDATE_IND16( redclash )
{
ladybug_state *state = screen.machine().driver_data<ladybug_state>();