Commit Graph

45 Commits

Author SHA1 Message Date
Roberto Zandona
33e828c111 fix for bug #01092: debugger crashes when exiting during "run to cursor" 2008-12-29 23:04:28 +00:00
Andrew Gardner
2485660bfd Fixes 'run to cursor' and 'toggle breakpoint' operations in the win32 debugger. [Andrew Gardner]
(It was doing a double-shift for CPUs with a address shift)
(The bpset command seems to occasionally behave oddly for cpus with address shifts as well.  Didn't figure that problem out in the few minutes i looked at it.)
2008-12-22 04:51:20 +00:00
Aaron Giles
54db8f077b Cleanups and version bump. 2008-12-15 01:46:32 +00:00
Aaron Giles
04fbf4f825 Removed unnecessary masking in disassembly view.
Changed console subview computations to leave the registers portion
fixed.
2008-12-14 21:34:02 +00:00
Aaron Giles
cfadc42b71 02740: resizing the debug window, the text is only in the old area
(Can't believe people still run with live resizing/dragging turned off :)
2008-12-14 00:33:42 +00:00
Aaron Giles
5b64c00674 Added logic to track OSD updates separately from internal view updates in the
debugger. In order to get the OSD to update, a new function 
debug_view_flush_updates() must be called. Currently this is automatically
called before osd_wait_for_debugger(), and during the periodic updates while
executing. The OSD code may occasionally need to call it under other
circumstances (for example, the Windows code calls it explicitly while
tracking scrollbar thumbs to get live scrolling).
2008-12-08 10:11:29 +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
d92a2e0c4e Cleanups/version bump/added missing drivers. 2008-12-06 17:54:42 +00:00
Aaron Giles
e2c9b10241 Fixed some memory view-related issues:
* select correct memory region by default when created
   (should be first address space of visible CPU)
* when created, default bytes/chunk is correct
* when changing width, cursor no longer moves around
* memory regions display more than all 0xff now

Also fixed:

* qword big-endian memory reads no longer call little-endian handlers
* memory regions are tracked in creation order (show up in order
   in the menu now)
* ROMREGION_DISPOSE memory regions are not disposed if the debugger
   is enabled
2008-12-05 16:02:22 +00:00
Aaron Giles
ec6dcfc192 02702: [Sound] tturf: no audio
Fixed debugger cursor positioning when scrolled.
2008-12-04 09:44:18 +00:00
Aaron Giles
8169eeefca 02687: emuopts.c: CORE INPUT AUTOMATIC ENABLE OPTIONS
02683: Pressing F5 while running debugger causes access violation 
02669: pandoras: music tempo is too fast 
02691: Some drivers with z80/ay8910 Audio: Audio tempo has changed 

Also fixed debugger memory leak.

Added a number of new cputag_* macros to cpuexec.h.
2008-12-04 09:34:38 +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
30aa31f163 More debugger changes.
Added the concept of 'subviews' to the debugger views. The core
now creates a list of possible subviews, and the OSD can select
between them. This removes code from the OSD that was previously
required to find all possible memory and disassembly views.

Added machine parameters to debugger console output functions.

Fixed some oddities in the memory view.

Moved globals to hang off of the machine structure.

Fixed bug where the visiblecpu was not updated immediately upon
a break.
2008-12-03 17:31:20 +00:00
Aaron Giles
d924407859 Big debugger cleanup.
Important note for OSD ports: the get/set property functions have 
been retired for debug_views. Instead, there are specific functions
to perform each get/set operation. In addition, the format of the
update callback has changed to pass the osd private data in, and
the update callback/osd private data must be passed in at view
allocation time. And osd_wait_for_debugger() now gets a CPU object
instead of the machine.

Removed extra debugger tracking for address spaces and added some
of the useful data to the address_space structure. Updated all
debugger commands and views to use CPU and address space objects
where appropriate.

Added new memory functions for converting between bytes and
addresses, and for performing translations for a given address
space. Removed debugger macros that did similar things in favor
of calling these functions.

Rewrote most of the memory view handling. Disasm and register views
still need some additional tweaking.
2008-12-03 06:35:34 +00:00
Aaron Giles
1d05ea6089 Cleanups and version bump for 0.128u4. 2008-11-24 04:10:18 +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
62a2f2fba0 This patch:
- removed unnecessary deprecat.h includes
- replaces Machine with existing running_machine* instances
- re-adds a peroid I accidentally removed when changed a message to
use defines
- adds a running_machine* to win_window_info and debugwin_info to get
rid of most Machine occurances and clean up the running_machine*
parameters I added in the past

[Oliver Stoeneberg]
2008-11-13 07:33:00 +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
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
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
3d1dbafcc2 From: Oliver Stoeneberg [mailto:oliverst@online.de]
Subject: Machine -> machine

This is a big patch adding running_machine* parameters and using 
"machine" where available.
2008-09-11 15:57:52 +00:00
Aaron Giles
57bd1856b5 Cleanups/version bump. 2008-07-31 09:00:13 +00:00
Aaron Giles
4a6fc8d5e5 Region classes go bye-bye. 2008-07-28 16:22:20 +00:00
Aaron Giles
27fed1ec97 Changed the way memory regions are referenced. Instead of a single
integer value, regions are now referred to by a region class and
a region tag. The class specifies the type of region (one of CPU,
gfx, sound, user, disk, prom, pld) while the tag uniquely specifies
the region. This change required updating all the ROM region
definitions in the project to specify the class/tag instead of
region number.

Updated the core memory_region_* functions to accept a class/tag
pair. Added new memory_region_next() function to allow for iteration
over all memory regions of a given class. Added new function
memory_region_class_name() to return the name for a given CPU
memory region class.

Changed the auto-binding behavior of CPU regions. Previously, the
first CPU would auto-bind to REGION_CPU1 (that is, any ROM references
would automatically assume that they lived in the corresponding
region). Now, each CPU automatically binds to the RGNCLASS_CPU region
with the same tag as the CPU itself. This behavior required ensuring
that all previous REGION_CPU* regions were changed to RGNCLASS_CPU
with the same tag as the CPU.

Introduced a new auto-binding mechanism for sound cores. This works
similarly to the CPU binding. Each sound core that requires a memory
region now auto-binds to the RGNCLASS_SOUND with the same tag as the
sound core. In almost all cases, this allowed for the removal of the
explicit region item in the sound configuration, which in turn 
allowed for many sound configurations to removed altogether.

Updated the expression engine's memory reference behavior. A recent
update expanded the scope of memory references to allow for referencing
data in non-active CPU spaces, in memory regions, and in EEPROMs.
However, this previous update required an index, which is no longer
appropriate for regions and will become increasingly less appropriate
for CPUs over time. Instead, a new syntax is supported, of the form:
"[tag.][space]size@addr", where 'tag' is an optional tag for the CPU
or memory region you wish to access, followed by a period as a 
separator; 'space' is the memory address space or region class you
wish to access (p/d/i for program/data/I/O spaces; o for opcode space;
r for direct RAM; c/u/g/s for CPU/user/gfx/sound regions; e for 
EEPROMs); and 'size' is the usual b/w/d/q for byte/word/dword/qword.

Cleaned up ROM definition flags and removed some ugly hacks that had
existed previously. Expanded to support up to 256 BIOSes. Updated
ROM_COPY to support specifying class/tag for the source region.

Updated the address map AM_REGION macro to support specifying a
class/tag for the region.

Updated debugger windows to display the CPU and region tags where
appropriate.

Updated -listxml to output region class and tag for each ROM entry.
2008-07-28 09:35:36 +00:00
Aaron Giles
7a14f21c15 Cleanups and version bump. 2008-07-24 09:07:49 +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
d8715ab4ac Note: I have done some testing, but there are probably more bugs
lurking. If you run into anything odd, please let me know.

Added new module uiinput.c which manages input for the user interface.
The OSD is responsible for pushing mouse events and character events
to this interface in order to support mouse movement and text-based
input (currently only used for the select game menu). Added support
for navigating through the menus using the mouse. 
[Nathan Woods, Aaron Giles]

Redesigned the UI menus so that they can maintain a richer state. Now
the menus can be generated once and reused, rather than requiring them
to be regenerated on each frame. All menus also share a comment eventing
system and navigation through them is managed centrally. Rewrote all the 
menus to use the new system, apart from the cheat menus, which are now 
disabled. Reorganized the video menu to make it easier to understand.
[Aaron Giles]
2008-07-12 20:18:25 +00:00
Aaron Giles
0e6397d14d 01957: Access Violation on hardreset with -debug 2008-06-30 15:03:24 +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
57c35a0efc From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] memory_region madness reloaded
Hi mamedev,

The memory_region and memory_region_length functions are probably the
two most common functions in MAME that don't take a machine parameter
but should given the syntax of the related apis memory_region_type and
memory_region_flags.  Clearly they didn't get the parameter because of
the sheer number of changes needed to change the apis.  This pair of
patches makes the change, and deals with the consequences.

The second patch then changes the api for memory_region and
memory_region_length, and fixes the fallout.  It generally plumbs
through machine parameters where needed, except for the case of sound
apis which I deferred doing so till later.  This increased the number
of deprecat.h includes by ~50.  Given it is a massive patch, there are
bound to be a few mistakes in it (I had to make ~20% of the changes by
hand), but I exercised care and reviewed the patch several times to
minimize the problems.
2008-06-23 08:32:42 +00:00
Aaron Giles
096331c856 Restructured input port internals and cleaned up inptport.c:
* Input ports are now maintained hierarchically. At the top
level are input ports, which contain a list of fields. Each
field represents one or more bits of the port. Certain fields
such as DIP switches and configuration switches contain a
list of settings, which can be selected. DIP switch fields
can also contain a list of DIP switch locations.

* Normalized behavior of port overrides (via PORT_INCLUDE or
by defining multiple overlapping bits). All fields within a
port are kept in strict increasing bit order, so altered DIP
switches are now kept in the appropriate order. This addresses
MAMETesters bug 01671.

* Live port state is now fully separate from configured 
state. This is manifested in a similar way to devices, where
a const list of ports can be managed either offline or live.
Each port has a pointer to an opaque set of live state which
is NULL when offline or valid when live. Each port also has
a running_machine * which is also NULL when offline.

* Because of this new arrangement, the conversion from tokens
to a list of ports now requires reasonably complex memory
allocation, so these port lists must be explicitly allocated
and freed (they are not mantained by automatic resource
allocation).

* Custom and changed callbacks now take a pointer to a field
config instead of a running machine. This provides more
information about what field triggered the change notification.
The machine can be found by referenced field->port->machine.

* The inptport.c module has been cleaned up and many 
ambiguities resolved. Most of this is internal, though it did
result in osd_customize_inputport_list() being changed to
osd_customize_input_type_list(). The parameter to this function
is now a linked list instead of an array, and the structures
referenced have been reorganized somewhat.

* Updated config.c to pass machine parameters to its callbacks.

* Updated validity checks, XML output, and UI system to handle
the new structures.

* Moved large table of default input settings to a separate
include file inpttype.h.

* Removed gross hacks in trackfld and hyperspt NVRAM. These
may be broken as a result.
2008-05-15 16:25:03 +00:00
Aaron Giles
7b927dff67 From: Oliver Stoenberg
I cleaned up the Machine usage in the osd/windows files and added the 
running_machine parameter where possible.
I didn't add it to osd_wait_for_debugger() yet, but I would make 
sense to have it.
2008-04-11 14:05:25 +00:00
Aaron Giles
109bb332f0 The term "driver" is way overloaded in the system.
machine->drv is now machine->config.
Sorry.
2008-02-18 06:08:39 +00:00
Zsolt Vasvari
4930b2dbfd - Added deprecat.h that contains some deprecated/discouraged contructs (see below)
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
2008-01-25 09:30:43 +00:00
Aaron Giles
ba63d916a3 Fixed default memory view width for CPUs with >byte-sized minimum
Made menu updating dynamic at click time, fixing issues with incorrect checkmarks
2008-01-21 00:29:29 +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
f0c52b57ba Fixed altf4_0111u4gre.
Also fixed potential issue using F10.
2008-01-04 17:57:59 +00:00
Aaron Giles
eafea60950 Enabled UNICODE by default for 64-bit builds.
Fixed several issues with building for Unicode on MSVC.
Almost certainly broke things for MESS/MAMEUI. (Sorry.)
2008-01-03 10:19:41 +00:00
Aaron Giles
d73ea1bf01 (From Oliver Stoneberg)
This patch fixes a few UNICODE=1 issues in the disassembly and memory 
windows of the MAME debugger. I also removed two redundant arrays.
2008-01-03 09:03:31 +00:00
Aaron Giles
76278ddf02 Spacing cleanups. 2007-12-24 04:03:00 +00:00
Aaron Giles
997890a56d Fixed bug that would cause events to leak through to the game when the debugger was up. 2007-12-21 17:46:00 +00:00
Aaron Giles
7b77f12186 Initial checkin of MAME 0.121. 2007-12-17 15:19:59 +00:00