Commit Graph

23 Commits

Author SHA1 Message Date
Aaron Giles
98c40f06db Made CPUs into proper devices. CPUs are now added in the
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.
2008-12-16 15:02:15 +00:00
Aaron Giles
04ae2d8bc7 Removed get context/set context calls from the CPU interface entirely.
Pointer-ified the TMS99xx core (missed that one!)
2008-12-11 10:21:52 +00:00
Aaron Giles
12415fcdcb Pointer-ified the cubeqst CPUs. 2008-12-09 14:49:16 +00:00
Aaron Giles
872ec20658 From: Atari Ace [mailto:atari_ace@verizon.net]
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
2008-12-07 14:51:36 +00:00
Aaron Giles
3c6eacc96f Changed save state system to accept machine parameters where
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.
2008-12-05 08:00:13 +00:00
Aaron Giles
85b961f5af CPU_IS_LE -> ENDIANNESS_LITTLE
CPU_IS_BE -> ENDIANNESS_BIG

Also fixed help for step over/in to specify correct keys.
2008-12-04 06:08:32 +00:00
Aaron Giles
1d05ea6089 Cleanups and version bump for 0.128u4. 2008-11-24 04:10:18 +00:00
Aaron Giles
f86d66dc97 Removed NO_LEGACY_MEMORY_HANDLERS defines. 2008-11-24 01:42:27 +00:00
Aaron Giles
9ee2f770aa Converted a bunch of CPU cores over to the new memory functions. 2008-11-22 18:38:41 +00:00
Aaron Giles
5816061f8e Debugger interfaces cleanup. Still more to do but this compiles and
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.
2008-11-21 16:53:48 +00:00
Aaron Giles
e7c418ef0f Generalized the concept of opbase access into "direct" access.
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.
2008-11-17 18:33:10 +00:00
Aaron Giles
a5bf427929 Added "tag" parameter to state_save_register_item_* calls. Removed
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.
2008-11-17 06:21:26 +00:00
Aaron Giles
cbd240d0de This patch replaces the Machine parameter where an running_machine *
is available and removes the deprecat.h where unnecessary.

[Oliver Stoeneberg]
2008-11-13 07:23:50 +00:00
Aaron Giles
9407fecd2d Populated tag and static_config parts of fake CPU device. Removed 'config'
parameter from CPU_INIT. Modified CPU cores to pull config from the device
static_config.
2008-11-09 07:12:24 +00:00
Aaron Giles
2ba1a99283 Added macros for all CPU callbacks to ease future changes.
Updated all CPU cores to use them.
2008-11-08 09:20:43 +00:00
Aaron Giles
b44da3b748 WARNING: This is a significant change. If you are risk-averse and
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.
2008-11-06 18:42:37 +00:00
Phil Bennett
40520a87cd Fix MT 02140: "cube quest crashes mame when saving state" 2008-10-21 20:42:56 +00:00
Aaron Giles
adaaf55595 From: Matt Ownby [mailto:matt.ownby@gmail.com]
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.
2008-10-02 05:04:06 +00:00
Aaron Giles
0f3e79564d From: Atari Ace [mailto:atari_ace@verizon.net]
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
2008-09-26 05:25:11 +00:00
Aaron Giles
b10a182054 From: Atari Ace [mailto:atari_ace@verizon.net]
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
2008-09-11 15:14:39 +00:00
Aaron Giles
05915406d0 Missing include. 2008-09-04 15:11:10 +00:00
Aaron Giles
0523e9feb7 Cleanups and version bump. 2008-08-19 07:31:55 +00:00
Aaron Giles
284b5a0d95 Added new generic laserdisc VIDEO_UPDATE handler to the laserdisc code.
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.
2008-08-18 04:31:08 +00:00