machine configuration just as any other device, and the
standard CPU configuration is performed via the inline
configuration macros.
Change cpu_type from an enumeration into a pointer to the
CPU's get_info function, very similar to device behavior.
For now all CPUs are declared in cpuintrf.h, but
eventually they should be declared in the CPU's header
file, and the driver should #include that header.
Added function cpu_get_type() to return the CPU type.
Changed several cpu_* functions into macros that call
through to the equivalent device_* function.
The device system now maintains a parallel list of devices
based on type, for faster iteration through all devices
of a given type.
Cleaned up code that looped over CPUs via the machine->cpu
array to now loop using the type-based device list.
Removed start/stop/reset/nvram functions from the
device_config in favor of grabbing them as needed.
Cleaned up the generic interrupt_enable code to work with
CPU devices instead of numbers.
Mapped the devtag_* functions to device_* functions via
macros instead of parallel implementations.
Sent: Saturday, December 06, 2008 4:52 PM
To: submit@mamedev.org
Cc: atariace@hotmail.com
Subject: [patch] Deprecat.h cleanup
Hi mamedev,
This patch changes some global Machine references to use machine,
device->machine, ... instead, and removes any unneeded #include
"deprecat.h" lines as well (about 10% of them in fact). It was
generated using the attached script, and then reverting some cases
where it was overzealous.
~aa
appropriate, and to keep all global variables hanging off the
machine structure. Once again, this means all state registration
call sites have been touched:
- state_save_register_global* now takes a machine parameter
- state_save_register_item* now takes a machine parameter
- added new state_save_register_device_item* which now uses
the device name and tag to generate the base name
Extended the fake sound devices to have more populated fields.
Modified sound cores to use tags from the devices and simplified
the start function.
Renumbered CPU and sound get/set info constants to align with
the device constants, and shared values where they were perfectly
aligned.
Set the type field in the fake device_configs for CPU and sound
chips to a get_info stub which calls through to the CPU and sound
specific get_info functions. This means the device_get_info()
functions work for CPU and sound cores, even in their fake state.
Changed device information getters from device_info() to
device_get_info() to match the CPU and sound macros.
works. Added callback parameters to the expression engine. Improved
CPU parsing so you can use a CPU tag or index in most commands that
take one. Switched to passing CPU and address space objects around
where appropriate. Lots of other minor tweaks.
Removed opbase globals to the address_space structure.
Cleaned up names of pointers (decrypted and raw versus rom and ram).
Added inline functions to read/write data via any address space.
Added macros for existing functions to point them to the new functions.
Other related cleanups.
state_save_combine_module_and_tag() function in favor of passing
the tag when registering. Revisited all save state item registrations
and changed them to use the tag where appropriate.
working on something, hold off syncing.
Defined macros for core CPU functions: CPU_INIT, CPU_RESET, CPU_EXIT,
CPU_EXECUTE, along with macros for the name and for calling, in the
spirit of the devintrf.h macros. More will come later.
Changed init, reset, exit, and execute interfaces to be passed a
const device_config * object. This is a fake object for the moment,
but encapsulates the machine pointer and token. Eventually this will
be a real device.
Changed the CPU IRQ callbacks to a proper type, and added a device
parameter to them.
Updated all CPU cores to the new macros and parameters.
Note that this changes the way we "pointer"-ify cores. I'll send an
update shortly.
Sent: Fri 9/26/2008 10:15 AM
To: submit@mamedev.org
Cc: Philip Bennett
Subject: fix for Cube Quest Line CPU emulation
I found a bug in the emulation of the Cube Quest Line CPU.
Proof of bug:
After looking at .diff,
Assume 'ci' is 1, and assume 'r' and 's' are both 0xFFF
(0xFFF equals -1, as these numbers are 12-bit signed).
The result should be mathematically equivalent to -1 - (-1)
which is 0.
~0xFFF is 0xF000, so you'd have 0xF000 + 0x0FFF + 1 which equals
0x10000 but since 'res' is 16-bits this is truncated to 0x0.
'C' then becomes 0 and 'V' becomes 1 (as I recall). The result of
0 is correct, but the flags are wrong; V should be 0 and C should
be 1.
Under my proposed fix, you'd have 0x000 + 0x0FFF + 1, which equals
0x1000, so the lower 12 bits are 0 (correct) and C is 1 and V is 0
(correct).
I discovered this bug while disassembling the line CPU's ROM.
Sent: Sunday, September 21, 2008 10:45 AM
To: submit@mamedev.org
Cc: atariace@hotmail.com
Subject: [patch] More static qualifiers
Hi mamedev,
Another static function update from yours truly, almost entirely
affecting code added in the last few months to MAME. The fixes are
the usual lot, changing enum definitions so they aren't declared,
decorating dead code/declarations with #if...#endif, and of course,
adding static where appropriate. In addition, I fixed a bunch of
UNUSED_FUNCTON symbols to be spelled correctly (I didn't introduce
this).
~aa
Subject: [patch] Even more reset/multisession cleanup
Hi mamedev,
These two patches try to reduce the amount of variable in .data, which
usually point to multisession/reset bugs or missing const qualifiers.
The first patch just adds const to a number of items, moving them from
.data to .rdata. The second patch sets other items to zero (moving
them to .bss), adding reset/init code where appropriate.
~aa
This handler works for both disc-only games and those with overlays.
For disc-only games, the base macro is sufficient. For games with
overlays, an additional set of configuration macros are provided:
MDRV_LASERDISC_OVERLAY - specifies update function, width, height,
and bitmap format of the overlay
MDRV_LASERDISC_OVERLAY_CLIP - specifies the visible area of the
overlay bitmap
MDRV_LASERDISC_OVERLAY_POSITION - specifies default x,y position
MDRV_LASERDISC_OVERLAY_SCALE - specifies default x,y scale factors
The update function provided to MDRV_LASERDISC_OVERLAY is identical to
a normal VIDEO_UPDATE callback, so a standard one can be used. All
existing laserdisc drivers have been updated to support this new
rendering mechanism, removing much duplicated code.
Added the ability to configure the overlay position and scale
parameters at runtime. Added OSD menus to control them. Added logic
to save/restore the data in the game's configuration file.
Added new macros MDRV_LASERDISC_SCREEN_ADD_NTSC and _PAL, which
defines a standard screen with the correct video timing characteristics
and update function for laserdiscs. Updated all drivers to use these
macros instead of defining their own screens.
Added DISK_REGIONS to all laserdisc drivers.
Added DISK_IMAGE_READONLY_OPTIONAL to support games (like Cube Quest)
where the disk is non-essential to the game's operation.
Fixed bug in identifying the custom sound driver for the laserdisc.
Updated ldverify to identify blank regions of the disc for post-
processing.
Fixed rendering 16bpp with alpha using bilinear filters (fixes
screenshots of laserdisc games with overlays).
Included support for parsing .gdi files in chdman. [ElSemi]
Added new driver for Cube Quest. This includes CPU cores for the three
bitslice processors, as well as laserdisc support for the hacked
laserdisc that was used to drive the games.
[Philip Bennett, Joe Magiera, Warren Ondras]
Note that the SHA1/MD5 for the laserdisc will likely undergo at least
one more change before being finalized.