| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
| |
std::string (nw)
|
| |
|
| |
|
|
|
|
| |
method rather than a palette_device method (nw)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Moved graphics decoding to a new device interface class: device_gfx_interface.
The gfxdecode device is now a device that simply inherits this interface and
does nothing else. Devices that draw tilemaps or sprites using gfx_elements
should in time be updated to use this interface rather than connect to a
machine-global gfxdecode device. Updated toaplan_scu.c as an example (also
fixed off-by-one sprite alignment in twincobr and rallybik while I was at it).
gfx_elements are normally created in interface_post_start(), making it
possible to dynamically create or modify the graphics decoding info during
device_start() if you need to. On the other hand, if you need the gfx_elements
during device_start(), you can directly call decode_gfx() to create them early.
This interface also provides a standard and init-order-safe way to connect to
a palette device (similarly to how device_video_interface helps devices
connect to a screen), so it's handy for any device that does palettized
drawing even if it doesn't use gfx_elements. Updated k053250.c as an example
of this usage.
gfxdecode info entries can now reference shared RAM regions by tag as well as
ROM regions, automatically handle endianness, and have some other new
capabilities. Updated nemesis.c and pgm.c to showcase the new features.
Removed validate_display() (it was just a commented out stub already) since
its only function, checking that drivers don't have an ind16 screen without
a palette, is now done by screen_device::device_validity_check().
Updated obsolete comments about GFXLAYOUT_RAW (cps1.c hasn't used raw gfx for
years, and "to save memory" is no longer a good reason to use it)
|
| |
|
|
|
|
| |
all devices that create tilemaps, this should fix the recent tilemap-related crashes (nw)
|
|
|
|
|
|
| |
gfxdecode devices must now be assigned a palette in MCFG. Added palette devices to several MESS drivers and devices to comply with this requirement. This palette is assigned as a default to the gfx_elements created by the device (but still not used for drawing yet, except in the UI graphics viewer)
Tilemaps now have a pointer to a palette device and use that palette for rgb32 drawing, rather than the palette of the screen or bitmap they are drawing to (since rgb32 screens don't have palettes now). When a tilemap is created, it takes its palette from the gfxdecode device it was created with, but you can change a tilemap's palette device with set_palette() at any time (doing this does not mark the tilemap dirty, since all tilemaps use indexed bitmaps internally)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[Aaron Giles]
* these classes now no longer take a resource_pool; everything is
managed globally -- this means that objects added to lists must be
allocated with global_alloc
* added new auto_pointer<> template which wraps a pointer and auto-frees
it upon destruction; it also defaults to NULL so it doesn't need to
be explicitly initialized
* moved tagged_list template to tagmap.h
Redo of the low-level memory tracking system: [Aaron Giles]
* moved low-level tracking out of emu\emualloc into lib\util\corealloc
so it can be shared among all components and used by core libraries
* global_alloc and friends no longer use a resource pool to track
allocations; turns out this was a wholly redundant system that wasted
a lot of memory
* removed global_resource_pool entirely
* added global_free_array to delete arrays allocated with
global_alloc_array
* added tracking of object versus array allocation; we will now error
if you use global_free on an array, or global_free_array on an object
Added new utility helper const_string_pool which can be used to
efficiently accumulate strings that are not intended to be modified.
Used by updated makelist and software list code. [Aaron Giles]
Updated png2bdc and makelist tools to not leak memory and use more modern
techniques (no more MAX_DRIVERS in makelist, for example). [Aaron Giles]
Deprecated auto_strdup and removed all uses by way of caller-managed
astrings and the software list rewrite. [Aaron Giles]
Rewrote software list management: [Aaron Giles]
* removed the notion of a software_list that is separate from a
software_list_device; they are one and the same now
* moved several functions into device_image_interface since they really
didn't belong in the core software list class
* lots of simplification as a result of the above changes
Additional notes (no whatsnew):
Moved definition of FPTR to osdcomm.h.
Some changes happened in the OSD code to fix issues, especially regarding
freeing arrays. SDL folks may need to fix up some of these.
The following devices still are using tokens and should be modernized
(I found them because they kept their token as void * and tried to
delete it, which you can't):
namco_52xx_device (mame/audio/namco52.c)
namco_54xx_device (mame/audio/namco54.c)
namco_06xx_device (mame/machine/namco06.c)
namco_50xx_device (mame/machine/namco50.c)
namco_51xx_device (mame/machine/namco51.c)
namco_53xx_device (mame/machine/namco53.c)
voodoo_device (emu/video/voodoo.c)
mos6581_device (emu/sound/mos6581.c)
aica_device (emu/sound/aica.c)
scsp_device (emu/sound/scsp.c)
dmadac_sound_device (emu/sound/dmadac.c)
s3c2440_device (emu/machine/s3c2440.c)
wd1770_device (emu/machine/wd17xx.c)
latch8_device (emu/machine/latch8.c)
duart68681_device (emu/machine/68681.c)
s3c2400_device (emu/machine/s3c2400.c)
s3c2410_device (emu/machine/s3c2410.c)
strataflash_device (mess/machine/strata.c)
hd63450_device (mess/machine/hd63450.c)
tap_990_device (mess/machine/ti99/990_tap.c)
omti8621_device (mess/machine/omti8621.c)
vdt911_device (mess/video/911_vdt.c)
apollo_graphics_15i (mess/video/apollo.c)
asr733_device (mess/video/733_asr.c)
|
|
|
|
| |
than each time in the tile info callback. Updated all drivers accordingly [Alex Jackson]
|
| |
|
|
|
| |
note: Aaron please give more descriptive text for release log I have no more strength :)
|
| |
|
|
|
|
| |
tilemap device to use them [Alex Jackson]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
as follows:
MAKE_RGB(r,g,b) == rgb_t(r,g,b)
MAKE_ARGB(a,r,g,b) == rgb_t(a,r,g,b)
RGB_ALPHA(data) == data.a()
RGB_RED(data) == data.r()
RGB_GREEN(data) == data.g()
RGB_BLUE(data) == data.b()
RGB_BLACK == rgb_t::black
RGB_WHITE == rgb_t::white
Implicit conversions to/from UINT32 are built in as well as simple
addition, subtraction, and scaling (with clamping).
As a result of being a class, some stricter typing was needed in
a few places but overall not too much.
|
|
|
|
| |
cleanup.
|
|
|
|
|
|
|
|
|
|
| |
Milanovic]
Updated all devices and drivers for using it.
out of whatsnew:
Note that it is made to work same as before, in some cases it can be more
logic to move gfxdevice into subdevice itself then to keep it in main driver.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tilemap flipping is now calculated relative to the center of the visible area
rather than to the total screen size, and the generic flip screen functions
no longer reconfigure the actual screen.
These changes ensure that in most cases flipping should Just Work for drivers
that use MCFG_RAW_PARAMs, games that have a programmable CRTC, and games that
have raster effects, and should fix many longstanding flip/cocktail-related
regressions.
(nw)
Unfortunately, it also means that all the thankless work that Osso and hap
have been doing over the last few months fixing flipscreen regressions will
have to be reverted now. I've also undoubtedly caused new regressions in
drivers that handle flipscreen in unusual ways. But now we can share video
device implementations between drivers that have been updated to RAW_PARAMs
and drivers that haven't without kludges all over the place.
And now I can hook up the programmable CRTC in toaplan1.c without abandoning
all hope of flipscreen ever working again in that driver.
(also nw)
I also added savestate registration for the generic soundlatches, which seemed
like a good idea. Any particular reason why these weren't being saved?
|
|
|
|
| |
to new license tagged form.
|
|
|
|
|
|
|
| |
more generally useful than just in tilemaps. Code is now in memarray.*
Converted the Atari RLE motion objects device from a half-assed
device into a full-assed device, leveraging the memory_array class.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
by the tilemap system, and no longer exists globally in the machine. Instead
it is allocated per-screen for all systems. This has several side-effects:
1. Previously, the pdrawgfx* functions were already changed to take the priority
bitmap as a parameter. Now all other hand-crafted functions that mess with
the priority bitmap generally must do so as well, and have been updated.
2. Calls to the tilemap system now need to provide a screen_device. This is not
just for the priority_bitmap, but also for screen flipping, which previously
always assumed the "primary screen" when doing flipping calculations.
3. All devices that implemented tilemap-like functionality have been updated
to follow the same pattern, since they largely tend to call through to the
core tilemap system at some point.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tilemap system: numerous changes:
* Moved remaining legacy macros and typedefs to tilelgcy.h. This revealed
a few drivers mixing and matching modern & legcy, which have now been
fixed.
* Changed get info callback signature to no longer pass the user_data
pointer, but instead pass a reference to the tilemap object itself.
Updated those few drivers using user_data to pull it out of the
tilemap object with the new user_data() getter method.
* Changed get info and mapping callbacks to be device_delegates so that
they can be described at config time.
* Added tilemap_memory object that is used internally for reading/
writing to memory that backs a tilemap. This object is used to track
a memory pointer that backs tilemap memory, and also is designed to
transparently handle all bus width and endianness associated with
reading and writing data in a tilemap.
* Incorporated two tilemap_memory objects (basemem and extmem) into the
tilemap object and added accessors to them, as well as read/write
handlers for reading/writing to entries stored in the memory. This
means that tilemap get info callbacks can now easily read data out of
the tilemap in a generic way.
* Rejiggered the initialization sequence for tilemap objects so that
the tilemap_manager is not required to be present at instantiation.
* Created a new tilemap_device, which can be used to declare a tilemap
in the machine config, and which also is a tilemap object itself.
The tilemap device will look for shared memory regions called
"<tag>" and "<tag>_ext" and automatically plug them into the tilemap.
The device also provides write handlers that can be used to write
to the tilemap memory and mark tiles dirty, saving the need for each
driver to write their own.
Device system: moved required/optional device finders to a new header
devfind.h.
Atari drivers: removed all playfield and alpha memory and tilemap
variables, apart from those needed by atarivc-using games (this will
become a device in a future update). Updated all Atari 16-bit drivers to
use the new tilemap_device instead, which provides all the needed
functionality in a more generic way.
|
| |
|
|
|
|
|
| |
necessary elements. Updated some of the more, ah, creative
uses/abuses of the gfx_elements. [Aaron Giles]
|
|
|
|
|
|
| |
to the original functions. The only change is to all-caps since
these are constants, e.g., tilemap_scan_rows -> TILEMAP_SCAN_ROWS.
|
|
|
|
| |
use emu.h (nw)
|
|
|
|
|
|
|
| |
of machine->pens to lookup RGB32 values if the palette is present (it
is on all screen bitmaps). Today these are identical, but it's part of
a long-term effort to move away from a global palette and allowing
each bitmap or screen to have their own if that is preferred.
|
| |
|
|
|
|
|
|
|
| |
for drivers that used GFX_RAW support for 4bpp systems, and yet
we had a bunch of extra code to support it. Updated these drivers
to do without it and removed all the extra code for supporting
it.
|
|
|
|
| |
Only thing left is tilemap_create.
|
|
|
|
|
|
|
|
| |
functions and just inline mapped them to the class. Will do
a pass soon to actually update drivers to use the C++
methods directly. Also, the tilemap callbacks are now
delegates which should make for cleaner integrating into
modern devices and drivers going forward.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
allocates a given bitmap to match the screen size and resizes
it as appropriate when the screen size changes. Updated all
the obvious spots in the code where this could be leveraged.
Move allocate/resize methods in the bitmap classes down into
bitmap_t because they no longer have any dependency on the
bitmap format or type.
Ensured that the bitmap's palette remains set across a resize
call (it is lost doing an allocate).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
and SCREEN_UPDATE(generic_bitmapped). In their place, each screen_device
now maintains a default bitmap which is automatically copied to the
screen on each update if no SCREEN_UPDATE function is provided and if
no driver_device::video_update override is present. This bitmap can be
found by querying the screen's new default_bitmap() method. [Aaron Giles]
|
|
|
|
|
|
|
|
| |
parameters for the global SCREEN_UPDATE callback match the parameters
for the driver_device version. Added allocate() and deallocate()
methods to bitmap_t to permit cleaner handling of bitmaps in drivers
and modern devices. [Aaron Giles]
|
|
|
|
|
|
|
|
|
|
| |
cliprects mandatory everywhere. In general, cliprects were being
correctly passed through the video side of most drivers already, so
it is mostly a semantic change. Note that with my previous change,
bitmaps have cliprects, so if you just want to clip to the bitmap's
boundaries, pass bitmap->cliprect() instead of NULL (which is no
longer permitted). [Aaron Giles]
|
|
|
|
|
|
|
|
| |
macros with bitmap->pix* functions, and moved bitmap_fill() to bitmap->fill()
among other similar changes. Bitmap fields now only available via accessors.
Replaced sect_rect with &= and union_rect with |= operators for rectangle
classes. Some general cleanup as a result of these changes. [Aaron Giles]
|
| |
|
|
|
|
|
|
| |
cases, we can get rid of the postload function entirely and just
call directly to the target function. Drivers eventually should
just override device_postload() instead of registering for callbacks.
|
|
|
|
|
|
|
|
|
|
|
|
| |
- non-device timer callbacks
- machine state changing callbacks
- configuration callbacks
- per-screen VBLANK callbacks
- DRC backend callbacks
For the timer case only, I added wrappers for the old-style functions.
Over time, drivers should switch to device timers instead, reducing the
number of timers that are directly allocated through the scheduler.
|
| |
|
|
|
|
| |
direct use.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove redundant machine items from address_space and device_t.
Neither machine nor m_machine are directly accessible anymore.
Instead a new getter machine() is available which returns a
machine reference. So:
space->machine->xxx ==> space->machine().xxx
device->machine->yyy ==> device->machine().yyy
Globally changed all running_machine pointers to running_machine
references. Any function/method that takes a running_machine takes
it as a required parameter (1 or 2 exceptions). Being consistent
here gets rid of a lot of odd &machine or *machine, but it does
mean a very large bulk change across the project.
Structs which have a running_machine * now have that variable
renamed to m_machine, and now have a shiny new machine() method
that works like the space and device methods above. Since most of
these are things that should eventually be devices anyway, consider
this a step in that direction.
98% of the update was done with regex searches. The changes are
architected such that the compiler will catch the remaining
errors:
// find things that use an embedded machine directly and replace
// with a machine() getter call
S: ->machine->
R: ->machine\(\)\.
// do the same if via a reference
S: \.machine->
R: \.machine\(\)\.
// convert function parameters to running_machine &
S: running_machine \*machine([^;])
R: running_machine \&machine\1
// replace machine-> with machine.
S: machine->
R: machine\.
// replace &machine() with machine()
S: \&([()->a-z0-9_]+machine\(\))
R: \1
// sanity check: look for this used as a cast
(running_machine &)
// and change to this:
*(running_machine *)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
calls on the device object.
Regex used:
state_save_register_device_item( *)\(( *)([^,]+), *([^,]+),( *)([^ )]+)( *)\)
\3->save_item\1\(\2NAME\(\6\),\5\4\7\)
state_save_register_device_item_array( *)\(( *)([^,]+), *([^,]+),( *)([^ )]+)( *)\)
\3->save_item\1\(\2NAME\(\6\),\5\4\7\)
state_save_register_device_item_2d_array( *)\(( *)([^,]+), *([^,]+),( *)([^ )]+)( *)\)
\3->save_item\1\(\2NAME\(\6\),\5\4\7\)
state_save_register_device_item_bitmap( *)\(( *)([^,]+), *([^,]+),( *)([^ )]+)( *)\)
\3->save_item\1\(\2NAME\(\*\6\),\5\4\7\)
state_save_register_device_item_pointer( *)\(( *)([^,]+), *([^,]+),( *)([^,]+), *([^ )]+)( *)\)
\3->save_pointer\1\(\2NAME\(\6\),\5\7,\5\4\8\)
this->save_
save_
(save_item[^;]+), *0( *)\);
\1\2\);
(save_pointer[^;]+), *0( *)\);
\1\2\);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
are still intact. The new state_manager class has templatized methods
for saving the various types, and through template specialization can
save more complex system types cleanly (like bitmaps and attotimes).
Added new mechanism to detect proper state save types. This is much
more strict and there will likely be some games/devices that fatalerror
at startup until they are remedied. Spot checking has caught the more
common situations.
The new state_manager is embedded directly in the running_machine,
allowing objects to register state saving in their constructors now.
Added NAME() macro which is a generalization of FUNC() and can be
used to wrap variables that are registered when directly using the
new methods as opposed to the previous macros. For example:
machine->state().save_item(NAME(global_item))
Added methods in the device_t class that implicitly register state
against the current device, making for a cleaner interface.
Just a couple of required regexes for now:
state_save_register_postload( *)\(( *)([^,;]+), *
\3->state().register_postload\1\(\2
state_save_register_presave( *)\(( *)([^,;]+), *
\3->state().register_presave\1\(\2
|