| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* Move around the debugger hooks to get a small but measurable performance increase
* Remove emucore from external tools
* Improve performance of DSP16 interpreter a little by generating six variants of execution loop
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This reverts commit 54155441e9ba9941e85d80c4834a66376a11e791.
|
|
|
|
|
| |
This reverts commit f537428e5a40ba6dde8ca9bf0fe9ae6b1f189ac4, reversing
changes made to 0d70d798107d4e4e8fb9f230410aeb1e888d65c5.
|
| |
|
|\
| |
| | |
Rewind feature and RAM savestates.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This starts the work requested in #2398.
How RAM states work.
Implemented using util::vectorstream. Instead of dumping m_save.m_entry_list to file, it writes them as binary to vectorstream. Compression is not used, as it would slow down the process. The header is written as usual, also in binary. When a state is loaded, the savestate data gets binary-read from vectorstream.
How rewind works.
Rewind is optional, it can be turned off through MAME GUI while not running. Rewind capacity is available there too. Rewind step hotkey is available from the standard hotkey menu. In the debugger you have the "rewind" command ("rw" shortcut) that works the same as the hotkey.
Every time you advance a frame (pause step), rewinder captures a RAM savestate of the frame you were at. It does the same when you do step into/over/out in the debugger. Every time it captures a new state (and when you unpause), it marks as invalid all its states that go after the current machine time, because input might change, so they are not relevant anymore. It keeps their buffers allocated though, for future use. When rewinder runs out of allowed amount of savestates it can have, it invalidates the first state in the list and tosses its unique_ptr to the end of the list, then it uses its buffer to capture a new state. When you hit the rewind step key, or use "rewind" command in the debugger, it loads a state that is immediately before the current machine time. Invalid states between valid ones are not allowed to appear, as that breaks rewinder integrity and causes problems. Rewinder keeps its own set of ram states as a vector of unique_ptr's. All rewinder operations and errors get reported using machine().popmessage().
|
|/ |
|
| |
|
|
|
|
|
| |
rid of reference constants in the debugger in favour of capturing the
value in the bind/lambda (less ugly casting)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* direct_read_data is now a template which takes the address bus shift
as a parameter.
* address_space::direct<shift>() is now a template method that takes
the shift as a parameter and returns a pointer instead of a
reference
* the address to give to {read|write}_* on address_space or
direct_read_data is now the address one wants to access
Longer explanation:
Up until now, the {read|write}_* methods required the caller to give
the byte offset instead of the actual address. That's the same on
byte-addressing CPUs, e.g. the ones everyone knows, but it's different
on the word/long/quad addressing ones (tms, sharc, etc...) or the
bit-addressing one (tms340x0). Changing that required templatizing
the direct access interface on the bus addressing granularity,
historically called address bus shift. Also, since everybody was
taking the address of the reference returned by direct(), and
structurally didn't have much choice in the matter, it got changed to
return a pointer directly.
Longest historical explanation:
In a cpu core, the hottest memory access, by far, is the opcode
fetching. It's also an access with very good locality (doesn't move
much, tends to stay in the same rom/ram zone even when jumping around,
tends not to hit handlers), which makes efficient caching worthwhile
(as in, 30-50% faster core iirc on something like the 6502, but that
was 20 years ago and a number of things changed since then). In fact,
opcode fetching was, in the distant past, just an array lookup indexed
by pc on an offset pointer, which was updated on branches. It didn't
stay that way because more elaborate access is often needed (handlers,
banking with instructions crossing a bank...) but it still ends up with
a frontend of "if the address is still in the current range read from
pointer+address otherwise do the slowpath", e.g. two usually correctly
predicted branches plus the read most of the time.
Then the >8 bits cpus arrived. That was ok, it just required to do
the add to a u8 *, then convert to a u16/u32 * and do the read. At
the asm level, it was all identical except for the final read, and
read_byte/word/long being separate there was no test (and associated
overhead) added in the path.
Then the word-addressing CPUs arrived with, iirc, the tms cpus used in
atari games. They require, to read from the pointer, to shift the
address, either explicitely, or implicitely through indexing a u16 *.
There were three possibilities:
1- create a new read_* method for each size and granularity. That
amounts to a lot of copy/paste in the end, and functions with
identical prototypes so the compiler can't detect you're using the
wrong one.
2- put a variable shift in the read path. That was too expensive
especially since the most critical cpus are byte-addressing (68000 at
the time was the key). Having bit-adressing cpus which means the
shift can either be right or left depending on the variable makes
things even worse.
3- require the caller to do the shift himself when needed.
The last solution was chosen, and starting that day the address was a
byte offset and not the real address. Which is, actually, quite
surprising when writing a new cpu core or, worse, when using the
read/write methods from the driver code.
But since then, C++ happened. And, in particular, templates with
non-type parameters. Suddendly, solution 1 can be done without the
copy/paste and with different types allowing to detect (at runtime,
but systematically and at startup) if you got it wrong, while still
generating optimal code. So it was time to switch to that solution
and makes the address parameter sane again. Especially since it makes
mucking in the rest of the memory subsystem code a lot more
understandable.
|
|
|
|
|
|
|
|
| |
Disassemblers are now independant classes. Not only the code is
cleaner, but unidasm has access to all the cpu cores again. The
interface to the disassembly method has changed from byte buffers to
objects that give a result to read methods. This also adds support
for lfsr and/or paged PCs.
|
|
|
|
| |
Note that the internal debugger's expression interpreter is not set up to handle floating point values at all, so they remain disabled there.
|
|
|
|
|
|
|
|
|
|
|
| |
* device_state_interface: Polymorphism and std::function for entries (nw)
- Create a templated subclass of device_state_entry to provide separate read/write interfaces for registers of varying widths. The efficiency impact of this should be minimal, given that this eliminates the need to make each byte width a subcase for reads and writes.
- Create similarly templated "pseudo-register" versions of device_state_entry that provides custom read/write interfaces through std::function. The intent of this is to eventually replace the dummy register + state_export interface hitherto necessary to provide debugger access to bankswitched or computed state registers.
- State registers can now be made read-only, and this is automatically done now when state_add is called with a std::function read handler but no write handler. This property is honored by MAME debug expressions.
* Add override keyword (nw)
* Remove explicit instantiations that were causing linking errors in tools build (nw)
|
|
|
|
|
|
| |
Revert "Changes to debugger memory address translation"
This reverts commit bb0964f9a284b15851773f5428bd602ca01cc28b.
|
|
|
|
|
|
| |
- memory_translate now returns an address space number rather a boolean flag, permitting addresses in part of one space to map to an entirely different space. This is primarily intended to help MCUs which have blocks of internal memory that can be dynamically remapped, but may also allow for more accurate emulation of MMUs that drive multiple external address spaces, since the old limit of four address spaces per MAME device has been lifted.
- memory_translate has also been made a const method, in spite of a couple of badly behaved CPU cores that can't honestly treat it as one.
- The (read|write)_(byte|word|dword|qword|memory|opcode) accessors have been transferred from debugger_cpu to device_memory_interface, with somewhat modified arguments corresponding to the translate function it calls through to if requested.
|
| |
|
|
|
|
| |
watchpoint_update_flags(), which fixes the hotspot command. (nw)
|
|
|
|
| |
* Save/restore a little more of Cocoa debugger state
|
|
|
|
|
|
|
|
|
|
|
|
| |
that was removed as part of this commit (nw)
SHA-1: 56bd36c5ef3960874628bc08cbfcedf4c6057a19
* Major refactoring of debugger core [Ryan Holtz]
* Eliminate globals/file statics
* Remove lots of stuff from global scope
* Use std::function for custom command registration
* Eliminate some trampolines
* Build fixes from Vas Crabb and balr0g
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
display I/O error
I've discovered a scenario where reading to the end of file seems to trigger the fail bit, in addition to the eof bit. Because of this, I've changed the error message to display when we can't read from the stream, but the eof bit is _not_ set
|
|
|
|
| |
(#2170)
|
|
|
|
|
|
|
|
|
|
|
| |
* move rarely-used output and pty interfaces out of emu.h
* consolidate and de-duplicate forward declarations, also remove some obsolete ones
* clean up more #include guard macros
* scope down a few more things
(nw) Everyone, please keep forward declarations for src/emu in src/emu/emufwd.h -
this will make it far easier to keep them in sync with declarations than having
them scattered through all the other files.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Fixes problem in the debugger and the cheat engine as currently the writes to opcode memory are not handled correctly, so separated EXPSPACE_RAMWRITE and EXPSPACE_OPCODE case statements to allow opcode writes to access the correct memory.
Example:
In flicky this will now disable cat collisions with the main sprite:
maincpu.ob@3ac6=c3
This is the simplest way of updating this, EXPSPACE_OPCODE is now a copy of EXPSPACE_RAMWRITE except it uses AS_DECRYPTED_OPCODES instead of AS_PROGRAM. This method means I've got a lot of work updating a lot of cheat file warnings ...but this is the correct way of doing this.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Fixes problem in the debugger and the cheat engine as currently the writes to opcode memory are not handled correctly, so separated EXPSPACE_RAMWRITE and EXPSPACE_OPCODE case statements to allow opcode writes to access the correct memory.
Example:
In flicky this will now disable cat collisions with the main sprite:
maincpu.ob@3ac6=c3
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Make device_creator a variable template and get rid of the ampersands
* Remove screen.h and speaker.h from emu.h and add where necessary
* Centralise instantiations of screen and speaker finder templates
* Add/standardise #include guards in many hearers
* Remove many redundant #includes
* Order #includesr to help catch headers that can't be #included alone
(nw) This changes #include order to be prefix, unit header if applicable
then other stuff roughly in order from most dependent to least dependent
library. This helps catch headers that don't #include things that they
use.
|
| |
|
|\
| |
| | |
Created a new debugger command 'tracesym'
|
| |
| |
| |
| | |
'tracesym' is intended to be a shorthand of 'tracelog', whereby the user doesn't have to specify a format string; the default format string is used
|