- Moved some variable declerations so that they are only visible where they are actually used
Note that the diff is large only because I removed a level of indentation from a huge chunk of code.
I could do that because the case it was checking for was already caught by one of the asserts added.
* PALETTE_INIT no longer has a colortable parameter
* removed game_colortable and remapped_colortable from machine_config
* updated a few stragglers that still referenced these fields
* removed tile_draw_colortable from tilemap.c
(From Zsolt): Added support for the new colortable object in the palette viewer
Changed the input port tokens to use a union instead of casting everything to FPTR.
In the future, C99-enabled compilers will be able to achieve type safety with
designated initializers.
longer used. Source needs to be recompiled because of the changed enum.
- Changed copybitmap and copyscrollbitmap:
There are now 2 versions of each, one without and with transparency:
void copybitmap(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy, int sx,int sy,const rectangle *clip);
void copybitmap_trans(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy, int sx,int sy,const rectangle *clip, pen_t transparent_pen);
void copyscrollbitmap(mame_bitmap *dest,mame_bitmap *src, nt rows,const int *rowscroll,int cols,const int *colscroll, const rectangle *clip);
void copyscrollbitmap_trans(mame_bitmap *dest,mame_bitmap *src, int rows,const int *rowscroll,int cols,const int *colscroll, const rectangle *clip, pen_t transparent_pen);
The version without _trans is the equivalent of the old TRANSPARENCY_NONE, The *_trans version is the equivalent
of the old TRANSPARENCY_PEN. The old TRANSPARENCY_COLOR mode is done via calling *_trans version and passing in
the pen that has been looked up via machine->pens[].
So for example, copybitmap(..., TRANSPARENCY_COLOR, 0) becomes
copybitmap_trans(..., machine->pens[0])
- Changed all drivers to the new calls. Suprising how few drivers still use these functions.
Most have still not been converted to tilemaps, or they are still writing to a tmpbitmap
which gets copied over to the real bitmap in VIDEO_UPDATE.
- Changed machine->screen[0].visarea to 'cliprect' where appropriate.
The idea is to create extra work if a driver wants to use these and hopefully
gives an incentive to look for an alternate solution
- Added #include of deprecat.h that rely on these contructs
- Removed a bunch of unneccassary #include's from these files
While investigating alternate gfx layout schemes, I stumbled across
the fact that some drivers are allocating graphics with one layout and
then decoding them with another (!). There's no guarantee this will
work, but for the drivers that do so (all Konami games), the layouts
are similar enough that it does. A related potential bug is that many
drivers are decoding using the layout provided to allocgfx, not the
layout attached the element returned from allocgfx. If the element
had scaling applied to it, this would be incorrect, but since scaling
is rare these are also benign. It would also be a problem if the
layout data had a different internal representation (which is
something I'm experimenting with), so to reduce the possibility of
coding errors and allow for future changes, I'd like to remove the
layout parameter from decodechar.
So here's two patches, the first fixes the affected Konami drivers to
allocate and decode using the same layouts. It changes the notion of
plane_order and bpp in the functions somewhat to let the start
routines select the appropriate layout, but acceptably so IMHO (I can
clean this up further if there are loud objections). The second patch
then removes the layout parameter from all the decodechar() calls.
I also reviewed MESS to see if it had similar problems and didn't find
any.
0. This patch does minor cleanup to existing layouts, trimming/padding
entries as appropriate and reformating a few layouts.
1. This patch introduces a GFXLAYOUT_RAW() macro, and uses it
throughout. It codifies the requirements for a raw layout in one
place.
2. This patch adds new validation code to the core for some previously
unchecked assumptions about layouts, and reduces the number of
references to the gfx_layout fields in preparation for a change in the
representation.
3. This patch constifies the remaining non-const gfx_layouts in MAME.
It does this by adjusting the code so that the only modification to a
layout ever needed is for the total field, which is then handled by
modifying a stack-based copy of the layout before invoking allocgfx. I
also spent some time consolidating and simplifying the layout code in
konamiic.c.
- removed years from copyright notices
- removed redundant (c) from copyright notices
- updated "the MAME Team" to be "Nicola Salmoria and the MAME Team"
This patch should complete the addition of static qualifiers to all
MAME symbols that aren't explicitly exported. It primarily handles
generated code (e.g. amspdwy.c), plus a handful of cases I'd
previously missed and some new cases introduced in the last update.
One interesting bit was the discovery that the 32-bit scanline
routines in drawgfx.c are unused. I debated eliminating them but
decided instead to just export them. Various internal drawgfx
functions were conditionally removed by examining a new RAW define,
although one routine (blockmove_8toN_alphaone) was determined to be
dead code.
While investigating constifying MESS, I came across a few core APIs
that were missing const qualifiers which this patch fixes. I also
consted up tx1.c while I was at it.