Commit Graph

17 Commits

Author SHA1 Message Date
Aaron Giles
32bc986ec0 Moved some of the CPU cores over to use get_safe_token like other devices.
Also cleaned them so they compile.
2009-03-12 16:54:49 +00:00
Aaron Giles
f36fc8641e This update is the below two patches, plus the remaining changes
necessary to remove 12 of the final 14 references to the global
Machine. The remaining 2 are in fatalerror() and logerror(), which
are both local to mame.c, so Machine is now fully static.

--

From: Atari Ace [mailto:atari_ace@verizon.net] 
Sent: Thursday, December 18, 2008 5:47 PM
To: submit@mamedev.org
Cc: atariace@hotmail.com
Subject: [patch] Make Machine static followup

Hi mamedev,

This incremental patch to my last patch undoes the change that caches
the ppu2c0x videorom.  I changed the code back to how it behaved
originally, using an existing machine on the chip struct to eliminate
the one troublesome Machine reference.

~aa

--

From: Atari Ace [mailto:atari_ace@verizon.net] 
Sent: Thursday, December 18, 2008 2:54 PM
To: submit@mamedev.org
Cc: atariace@hotmail.com
Subject: [patch] Make Machine static!

Hi mamedev,

This large patch completes the removal of the use of Machine
throughout MAME.  It does so primarily by adding machine, device or
space to various apis and modifying the callers, but for some
remaining cases it adds a new api, mame_get_running_machine(), which
will be called instead.  There are only 14 uses of this api currently,
and that number should drop over time.

There are a few changes of note:
1.  6821pia.c.  I attached machine to the 'device' structure.  I'm
working on converting this to a proper device, but that change isn't
ready.
2.  fddebug.c.  I added a proper header so that the apis won't get
accidentally converted to static again.
3.  scsi.c.  I added a machine to SCSIInstance.
4.  system16.c.  I modified sys16_patch_code to take an array of
patches.
4.  custom.h.  I added the owning sound device to the reset/stop
routines as well as the token.  Note that passing only the device
would require exposing the internals of custom_sound, as the token
passed is not the device token, but the token returned from the
CUSTOM_START routine.  Better ideas here are welcome.
4.  ppc2c0x.c.  To avoid changing more interfaces, the init routine
saves the videorom location rather than looks it up each time.

I tried to choose what I felt was the natural parameter for an api,
rather than always pass machine, but in some cases I used machine to
limit the number of additional changes.  Some additional cleanup here
is probably warranted, I'll look into that later once I'm recovered
from this two-week project.

~aa
2008-12-19 19:40:22 +00:00
Aaron Giles
5d89160f3b Further debugger cleanup. Symbol tables now have a global ref
as well as a per-symbol ref. Debugcpu is now clear of active
CPU references and global Machine references.
2008-11-22 16:50:00 +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
371cd0a56d Another big one.
Moved memory global state into a struct hanging off of the machine.
Updated almost all memory APIs to take an address_space * where
appropriate, and updated all callers. Changed memory internals to
use address spaces where appropriate. Changed accessors to point
to the memory_* functions instead of the address space-specific
functions. Improved internal handling of watchpoints.

Added cputag_* functions: cputag_reset(), cputag_get_index(),
cputag_get_address_space(). These just expand via macros to an
initial fetch of the CPU via cputag_get_cpu() followed by the
standard CPU call.

Added debugger_interrupt_hook() and debugger_exception_hook() calls
which intelligently look at the debugger flags before calling.

Did minimal cleanup of debugger, mainly moving CPU-specific data
to hang off of the CPU classdata for more direct access.
2008-11-20 09:50:31 +00:00
Aaron Giles
92f3053105 Major cpuintrf changes:
* added a set of cpu_* calls which accept a CPU device object;
  these are now the preferred means of manipulating a CPU

* removed the cpunum_* calls; added an array of cpu[] to the
  running_machine object; converted all existing cpunum_* calls
  to cpu_* calls, pulling the CPU device object from the new
  array in the running_machine

* removed the activecpu_* calls; added an activecpu member to
  the running_machine object; converted all existing activecpu_*
  calls to cpu_* calls, pulling the active CPU device object
  from the running_machine

* changed cpuintrf_push_context() to cpu_push_context(), taking
  a CPU object pointer; changed cpuintrf_pop_context() to
  cpu_pop_context(); eventually these will go away

* many other similar changes moving toward a model where all CPU
  references are done by the CPU object and not by index
2008-11-10 07:42:09 +00:00
Aaron Giles
990ef98b53 02280: any set with multiple CPUs: Disassembler freezes when doing a Run on any CPU other than CPU 0 2008-09-22 06:06:23 +00:00
Aaron Giles
cffe201094 From Oliver Stoeneberg [oliverst@online.de]
This contains three different patches:

20080829.patch
Introducing the running_machine* parameter in a few more places. Next 
step would be to make the execute_* function aware of it, if that's 
OK. Also used the machine parameter in memory.c were it's available.

20080829_1.patch
The already discussed and probably being rejected removal of 
dreprecat.h from debugger.h. I think this is a low-risk patch (we had 
worse cleanups) and it lowers the risk of new code using deprecated 
function beign introduced in MAME/MESS, because there is no invisible 
inclusion of deprecat.h anymore (I think one driver - kofball.c - got 
it with deprecated code).

20080829_2.patch
The last Machine -> machine conversion I had sitting in my local 
tree. I know the proper way is to turn them into devices, but I still 
haven't looked into that.
2008-09-04 08:55:01 +00:00
Aaron Giles
e5a0b682da Minor cleanup from last checkin. 2008-07-17 16:10:46 +00:00
Aaron Giles
517a24c0ef Robustified key behavior when the debugger is visible. Should now
properly ignore the "break into debugger" keypress and not allow
related characters to filter through. Removed some hacks related to
making that work in the past.

Changed osd_wait_for_debugger() to take a machine parameter and a
"firsttime" parameter, which is set to 1 the first time the function
is called after a break. The Windows debugger uses this to ensure
that the debugger has focus when you break into it.
2008-07-17 16:09:52 +00:00
Aaron Giles
3d1376ed97 Cleanups/version bump. 2008-06-26 16:05:46 +00:00
Aaron Giles
68f3a9ab9e Removed DEBUGGER flag from makefile and ENABLE_DEBUGGER
macro from the source code. All MAME builds now include
the debugger, and it is enabled/disabled exclusively by
the runtime command-line/ini settings. This is a minor 
speed hit for now, but will be further optimized going 
forward.

Changed the 'd' suffix in the makefile to apply to DEBUG
builds (versus DEBUGGER builds as it did before).

Changed machine->debug_mode to machine->debug_flags.
These flags now indicate several things, such as whether
debugging is enabled, whether CPU cores should call the
debugger on each instruction, and whether there are live
watchpoints on each address space.

Redesigned a significant portion of debugcpu.c around
the concept of maintaining these flags globally and a
similar, more complete set of flags internally for each
CPU. All previous functionality should work as designed
but should be more robust and faster to work with.

Added new debugger hooks for starting/stopping CPU
execution. This allows the debugger to decide whether
or not a given CPU needs to call the debugger on each
instruction during the coming timeslice.

Added new debugger hook for reporting exceptions.
Proper exception breakpoints are not yet implemented.

Added new module debugger.c which is where global
debugger functions live.
2008-06-26 14:51:23 +00:00
Aaron Giles
a910dafd37 From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] Small deprecat.h related cleanup

Hi mamedev,

While doing some work on eliminating some uses of deprecat.h, I came
across a few files that didn't have it that used deprecated features.
A little investigation revealed they were getting it through
debugger.h, typically by referencing m68000.h.  Since deprecat.h is
intended to document the files that need updating (otherwise it would
just be included in a common header), I reworked debugger.h to not
import it when the debugger is not enabled, and fixed the files that
broke as a result.

~aa
2008-05-01 13:52:28 +00:00
Aaron Giles
2a9d6c09bf Added missing #include. 2008-04-02 08:17:56 +00:00
Aaron Giles
aa16ee779d Changed debugger-related code to be based off a new makefile define (DEBUGGER) which sets
a new compile-time define (ENABLE_DEBUGGER). This means that MAME_DEBUG no longer means
"enable debugger", it simply enables debugging features such as assertions and debug code
in drivers.

Also removed the various levels of opbase protection in memory.h and always just turned 
on full bounds checking.

Fixed build break due to missing ampoker.lay -> ampoker2.lay renaming.
2008-02-02 08:57:39 +00:00
Aaron Giles
ee9f88963c Copyright cleanup:
- removed years from copyright notices
 - removed redundant (c) from copyright notices
 - updated "the MAME Team" to be "Nicola Salmoria and the MAME Team"
2008-01-06 00:47:40 +00:00
Aaron Giles
7b77f12186 Initial checkin of MAME 0.121. 2007-12-17 15:19:59 +00:00