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.
means of setting the minimum useful scheduling quantum, and clamping
all quanta to that value.
Changed interleave/boost handling to use scheduling quanta instead
of timers.
Added machine parameter to cpu_boost_interleave.
Updated cpuexec to compute the "perfect" interleave value taking into
account the minimum number of cycles per instruction specified by the
CPU core. Updated Z80 core to indicate that the minimum cpi is 2. Fixed
incorrect minimum cpi in the 68020+ cores.
Simplified a bit of logic in cpuexec_timeslice.
Sent: Sunday, November 02, 2008 1:04 AM
To: Aaron Giles
Subject: Z80 CPU change
Hello Aaron,
For a long time there was undiscovered internal register (MEMPTR) inside Z80 CPU which was visible by using BIT n,(HL) instruction in undocumented bits of flag, in
last few months lot of things have been discovered by team of Russian programmers. There was a test on real machine which showed status of flags after each instruction.
I am sending you now patch for Z80 with MEMPTR implemented, there is also one more bug fixed (BIT 6,(XY+o) was not implemented good it used BIT 4,(XY+o) code).
As a proof that things are now valid, I am sending screens before patch on Z80 cpu core, and after with compare of results on real machine.
I am also sending you a TZX file (for ZX Spectrum) since tests are done inside that driver.
Please inform me about status. Hope this could fix some issues in drivers using Z80, since some games used this flags.
Regards,
Miodrag Milanovic
Added preliminary LD-V1000 emulation. Not fully working yet, but mostly
there.
Cleaned up and normalized the three existing laserdisc emulations.
Removed obsolete code from the laserdisc core.
Added new item to the interface which is the tag of a CPU
to take the base clock from. Are there any known cases
where the base clock does NOT come from the CPU directly?
Changed Z80 daisy chain interface to simply be a list of
devices in the chain. Interrupt callback functions are now
fetched via the standard device interface and referenced by
the daisy chain code.
Changed Z80 PIO interrupt callback to pass a device instead
of the machine. All device callbacks should provide the
device.
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.
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.
Subject: [patch] Remove more Machine globals, #include "deprecat.h"
Hi mamedev,
The attached patch goes through and converts a number of Machine
globals to machine locals, and then removes #include "deprecat.h" if
appropriate. The script that generated it is included, since the
patch itself is rather large and would have been time consuming to
produce otherwise.
The script doesn't convert cases of Machine that aren't in common
macros. I'll try to tackle those later if someone doesn't beat me to
it.
~aa
trace through in a debug build, yet should operate the same as before.
Created a complete set of functions for all databus sizes (8,16,32,64) and
all endiannesses. A few functions are redundant, but it is now very clear
which functions to use in which scenarios. It is also now possible to rely
on being able to access values of 8, 16, 32 or 64 bits via the built-in
accessors without fear of crashing.
Updated all cores using 8-bit handlers to explicitly call the 8-bit handlers
with the appropriate endianness.
Fixed a few games which were calling n-bit handlers directly to use the
generic forms. In the future, this is all the access drivers will have.
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.
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
Updated all CPU cores to return a CPUINFO_INT_CLOCK_MULTIPLIER of 1.
Changed the core to actually respect both CPUINFO_INT_CLOCK_MULTIPLIER and CPUINFO_INT_CLOCK_DIVIDER.
Updated a number of drivers to use cpunum_get_clock() instead of Machine->drv->cpu[x].clock.
***** Raw input clock speeds should now be specified for all CPUs in the MACHINE_DRIVER. *****
Removed explicit divisors from all drivers using the following CPU types,
which were already specifying non-1 values for CPUINFO_INT_CLOCK_DIVIDER:
* COP4x0
* I8039/8048 families
* M68(7)05, HD63705
* M6809E
* PIC16C5X
* TMS32010
* TMS340x0
In a few cases, it appears that the divisor was not being used, so I guessed in those cases whether or not
the specified clock speed was raw.
- removed years from copyright notices
- removed redundant (c) from copyright notices
- updated "the MAME Team" to be "Nicola Salmoria and the MAME Team"
The attached patch adjusts most conditional logging in MAME to use the
idiom "do { if (VERBOSE) logerror x; } while (0)". This has the
benefit that the compiler checks the syntax of the logging even in the
case it will be eliminated, and in fact a number of cases here needed
adjustments to compile because of this.
Here is a fix I've done to the Z80 CPU core that removes the increasing
of the R register from each IX/IY related (FD xx or DD xx) instruction.
This corrects the amount the R register should increased to to 2,
instead of 3. Documentation I've read suggests that the R register is
increased by 1 for each instruction with no prefix, and by 2 for each
instruction with a prefix (DD, FD, ED, CB, DD CB and FD CB). This fixes
some protected cassette loaders in the MESS Amstrad CPC driver, and
maybe others, which require the R register to be correct for the next
routine to be decoded correctly. I'd doubt that there is much, if any,
noticeable impact for MAME, as the R register is really only useful to a
program as a simple random number generator (or seed).
I've tested the fix with Pacman, in MAME, and when it comes across a LD
IX,xxxx or ADD IX,xx it will increase R by 2, whereas previously, it
increased R by 3.