---
This is just stage one of converting OG's stuff, please do not touch any
of it yet. Next up is the skeleton of the ZOOM chip, finishing up
the missing bits of the CPU core (the interrupt controller and timers), and
debugging the results.
functions into methods of those classes. The most wide-ranging
change was converting device_reset() to device->reset(). Apart
from that it was mostly internal shuffling in the core.
- Fixed compiling CPU core of V30MZ (only used by MESS)
- Fixed MESS dependent code of wave.c
- Added include of emu.h in sid (used only by MESS)
no whatsnew needed
is now separate from runtime device state. I have larger plans
for devices, so there is some temporary scaffolding to hold
everything together, but this first step does separate things
out.
There is a new class 'running_device' which represents the
state of a live device. A list of these running_devices sits
in machine->devicelist and is created when a running_machine
is instantiated.
To access the configuration state, use device->baseconfig()
which returns a reference to the configuration.
The list of running_devices in machine->devicelist has a 1:1
correspondance with the list of device configurations in
machine->config->devicelist, and most navigation options work
equally on either (scanning by class, type, etc.)
For the most part, drivers will now deal with running_device
objects instead of const device_config objects. In fact, in
order to do this patch, I did the following global search &
replace:
const device_config -> running_device
device->static_config -> device->baseconfig().static_config
device->inline_config -> device->baseconfig().inline_config
and then fixed up the compiler errors that fell out.
Some specifics:
Removed device_get_info_* functions and replaced them with
methods called get_config_*.
Added methods for get_runtime_* to access runtime state from
the running_device.
DEVICE_GET_INFO callbacks are only passed a device_config *.
This means they have no access to the token or runtime state
at all. For most cases this is fine.
Added new DEVICE_GET_RUNTIME_INFO callback that is passed
the running_device for accessing data that is live at runtime.
In the future this will go away to make room for a cleaner
mechanism.
Cleaned up the handoff of memory regions from the memory
subsystem to the devices.
--------------------------------------------
F-15 Strike Eagle (2 sets) [Phil Bennett]
Battle of the Solar System (rev. 1.1) [Phil Bennett]
Tank Battle (prototype rev. 4/21/92) [Phil Bennett]
Added Am29000 CPU core [Phil Bennett]
- eflags mask added
- Initial values for the EAX and EDX registers fixed
- cpuid values improved
- feature flags improved
- initial value for the cr0 register improved
- changed 486 to not support the cpuid instruction by default
- take a trap on invalid instructions instead of throwing a fatalerror
- emulated the undefined flag behavior for the DIV/IDIV instructions on Intel CPUs
- Created new central header "emu.h"; this should be included
by pretty much any driver or device as the first include. This
file in turn includes pretty much everything a driver or device
will need, minus any other devices it references. Note that
emu.h should *never* be included by another header file.
- Updated all files in the core (src/emu) to use emu.h.
- Removed a ton of redundant and poorly-tracked header includes
from within other header files.
- Temporarily changed driver.h to map to emu.h until we update
files outside of the core.
Added class wrapper around tagmap so it can be directly included
and accessed within objects that need it. Updated all users to
embed tagmap objects and changed them to call through the class.
Added nicer functions for finding devices, ports, and regions in
a machine:
machine->device("tag") -- return the named device, or NULL
machine->port("tag") -- return the named port, or NULL
machine->region("tag"[, &length[, &flags]]) -- return the
named region and optionally its length and flags
Made the device tag an astring. This required touching a lot of
code that printed the device to explicitly fetch the C-string
from it. (Thank you gcc for flagging that issue!)
useable as a stack object. Also designed the interfaces to allow
for chaining operations. And added a casting operator to const
char * for seamless use in most functions that take plain old C
strings.
Changed all uses of astring to use the object directly on the
stack or embedded in objects instead of explicitly allocating
and deallocating it. Removed a lot of annoying memory management
code as a result.
Changed interfaces that accepted/returned an astring * to
use an astring & instead.
Removed auto_alloc_astring(machine). Use
auto_alloc(machine, astring) instead.
osd_free(). They take the same parameters as malloc() and free().
Renamed mamecore.h -> emucore.h.
New C++-aware memory manager, implemented in emualloc.*. This is a
simple manager that allows you to add any type of object to a
resource pool. Most commonly, allocated objects are added, and so
a set of allocation macros is provided to allow you to manage
objects in a particular pool:
pool_alloc(p, t) = allocate object of type 't' and add to pool 'p'
pool_alloc_clear(p, t) = same as above, but clear the memory first
pool_alloc_array(p, t, c) = allocate an array of 'c' objects of type
't' and add to pool 'p'
pool_alloc_array_clear(p, t, c) = same, but with clearing
pool_free(p, v) = free object 'v' and remove it from the pool
Note that pool_alloc[_clear] is roughly equivalent to "new t" and
pool_alloc_array[_clear] is roughly equivalent to "new t[c]". Also
note that pool_free works for single objects and arrays.
There is a single global_resource_pool defined which should be used
for any global allocations. It has equivalent macros to the pool_*
macros above that automatically target the global pool.
In addition, the memory module defines global new/delete overrides
that access file and line number parameters so that allocations can
be tracked. Currently this tracking is only done if MAME_DEBUG is
enabled. In debug builds, any unfreed memory will be printed at
the end of the session.
emualloc.h also has #defines to disable malloc/free/realloc/calloc.
Since emualloc.h is included by emucore.h, this means pretty much
all code within the emulator is forced to use the new allocators.
Although straight new/delete do work, their use is discouraged, as
any allocations made with them will not be tracked.
Changed the familar auto_alloc_* macros to map to the resource pool
model described above. The running_machine is now a class and contains
a resource pool which is automatically destructed upon deletion. If
you are a driver writer, all your allocations should be done with
auto_alloc_*.
Changed all drivers and files in the core using malloc/realloc or the
old alloc_*_or_die macros to use (preferably) the auto_alloc_* macros
instead, or the global_alloc_* macros if necessary.
Added simple C++ wrappers for astring and bitmap_t, as these need
proper constructors/destructors to be used for auto_alloc_astring and
auto_alloc_bitmap.
Removed references to the winalloc prefix file. Most of its
functionality has moved into the core, save for the guard page
allocations, which are now implemented in osd_alloc and osd_free.
Verified and corrected clocks in halleys and exctsccr [Corrado Tomaselli]
New clones added
----------------
Exciting Soccer (Japan set 2) [Corrado Tomaselli]
1. Removed CPP_COMPILE option. All files (except expat and zlib)
are now compiled as C++ by default. For now, imagine nothing has
changed. The goal is not to go hog-wild with C++isms, but to
leverage it where it makes the most sense.
2. Mapped INLINE to plain old C++ inline now, fixing several
cases where this was problematic.
3. Marked global const structures explicitly extern since consts
are locally-scoped by default in C++.
4. Added new 'default' make target which just builds the emulator.
Use 'make all' to build everything including the tools.
5. 64-bit builds now get a '64' suffix on them. We might want to
just make this true for Windows builds, but it's on for everyone
at the moment.
6. (Windows) Removed UNICODE option. UNICODE is enabled by default
on all Windows builds now. The 32-bit version links against
libunicows.a for continued Win9x compatibility.
7. (Windows) Removed hacks surrounding unicode handling of main().
They are no longer necessary with the new tools.
Date: Mon, 28 Dec 2009 00:29:31 +0000
From: Phill Harvey-Smith <afra@aurigae.demon.co.uk>
To: submit@mamedev.org
Subject: i86 patch
Hi,
Attatched is a patch correcting the operation of the hlt instruction in
the i86 core. I have done test builds with both the current mame and
mess source for both debug and normal builds, and all seems to be ok.
Cheers.
Phill.
--
Phill Harvey-Smith, Programmer, Hardware hacker, and general eccentric !
"You can twist perceptions, but reality won't budge" -- Rush.
Date: Tue, Dec 22, 2009 at 11:57 AM
Subject: Core for PIC 16c62x series of processors
To: submit@mamedev.org
Hello,
this patch contains a core for the PIC 16c62x series of processors.
It has been made starting from the pic16c5x that is already present.
This version stil misses the various internal devices, however the
opcodes and i/o ports work, and it is enough to run the emulation of
the security pics used with the gd-roms.
Bye,
Samuele Zannoli
Date: Tue, Dec 22, 2009 at 4:44 PM
Subject: [patch] Fix srcclean/src2html bugs, misbalanced tokens and
visible whitespace errors
To: submit@mamedev.org
Cc: atariace@hotmail.com
Hi mamedev,
While experimenting with srcclean and src2html as indentation
validators, I stumbled across a couple of bugs. The first is that
srcclean doesn't properly handle /*...*//. It sees the last / char at
the end as the second / of an inline comment, where it might be a
division token or the start of either type of comment.
The second bug is that src2html improperly handles strings with
embedded quotes preceded by escaped backslashes, e.g. "ab\\\"cd". It
believes the string terminated in the middle, and the last quote
starts a new string. This issue is unlikely in actual code, but
should be handled correctly.
The first patch fixes these, and a some cases where there are
dangling/missing tokens which my validation tools are noticing. These
occur in some unused macros, dead code sections, and in some macros
that are deliberately misbalanced (v9938.c, psx.c). In the deliberate
cases, I balanced the braces by making exactly one open and one close
macro and using those throughout.
The second patch is then a set of visible whitespace "problems". Cases
where the closing brace isn't at the same indent level as the open
brace, and some cases where the indent level isn't a multiple of four.
In the case of ssv.c I folded the assignments into init_ssv() to
simplify the code and restore the brace balance, otherwise I kept to
simply adding or removing whitespace.
~aa
From: Barry Rodewald <bsr@xnet.co.nz>
Date: Wed, Dec 23, 2009 at 2:37 AM
Subject: Yet more i386 fixes
To: submit@mamedev.org
Hi,
Here's two more small i386 fixes.
First, is an implementation of the LSL protected mode instruction.
While it's far from perfect (ie: it doesn't check for anything other
than a null segment selector), it does help get a little bit further
for some FM Towns applications.
Second, is a fix for the REP instruction when used with a segment
prefix. Essentially, it reverses the use of the segment_override and
segment_prefix variables compared to other instructions. This fixes
sprite data copied into sprite RAM on the FM Towns version of Raiden
Trad.
Thanks,
Barry Rodewald
mailto:bsr@xnet.co.nz
- simplified RSP's misaligned memory accesses
- removed now-unnecessary shifts from direct memory accesses in
mips3/powerpc drcs
- optimized AND with 0xff/0xffff/0xffffffff cases for x86/x64
- added rudimentary memory/register tracking in x86 backend to
remove redundant loads
- Split SATURATE_ACCUM into a signed and unsigned version to reduce stack usage.
- Corrected an issue with the 0h variants of VMRG, VAND, VNAND, VOR, VNOR, VXOR and VNXOR.
- Slightly optimized unaligned reads and writes
- Optimized unaligned dword reads
- Corrected an issue where badly-written RSP programs could jump to invalid addresses
arbitrary scaling factors. Previously, specifying a size implied
a scaling factor equal to the size (i.e., specifying DWORD meant
the index was scaled by 4). This is still the default. However,
now you can specify the scale explicitly for other cases. For
example, you can specify DWORD_x1 to fetch a DWORD but don't
scale the index at all, or BYTE_x8 to fetch a BYTE while scaling
the index by 8. Updated all backends to make this work.
* Fixed EIP displacement when executing FPU instructions with no 80387 present
* Added 32-bit implementations of SLDT and STR
---------- Forwarded message ----------
From: Barry Rodewald <bsr@xnet.co.nz>
Date: Wed, Dec 9, 2009 at 2:02 AM
Subject: More i386 fixes
To: submit@mamedev.org
Hi,
Here's two more small fixes for the i386 core.
First, is FPU instructions used on 80386. On a system without a
80387, FPU instructions should have no effect. Part of the FM Towns
TBIOS (runs as an MS-DOS device driver, providing extra system
functions) initialises the FPU, and tries to detect it. Upon hitting
the FSTCW instruction, though, it doesn't increase EIP enough when an
extra displacement byte is needed. So, I've added a call to GetEA to
the escape() function (called when there is no FPU) which will fetch
the extra byte if necessary.
Second, is a 32-bit implementation of the SLDT and STR instructions.
Basically, I copied it from the 16-bit versions, and modified it to
use 32-bit registers.
Thanks,
Barry Rodewald
mailto:bsr@xnet.co.nz
marked non-exported functions as static and removed cases of #include "deprecat.h" [Atari Ace]
---------- Forwarded message ----------
From: Atari Ace <atari_ace@verizon.net>
Date: Sat, Dec 5, 2009 at 7:18 AM
Subject: [patch] Header cleanups
To: submit@mamedev.org
Cc: atariace@hotmail.com
Hi mamedev,
This patch improves the quality of the mame driver headers, by adding
missing prototypes and source comments, removing dead prototypes, and
marking some non-exported functions as static within the drivers. It
also eliminates about a dozen cases of #include "deprecat.h".
~aa
(Update of r7501)
---------- Forwarded message ----------
From: Atari Ace <atari_ace@verizon.net>
Date: Sun, Dec 6, 2009 at 5:51 PM
Subject: [patch] srcclean bugfix
To: submit@mamedev.org
Cc: atariace@hotmail.com
Hi mamedev,
My srcclean changes to track C-style quotes didn't handle all the
special cases correctly (for instance, '\"' and "\\\""). This fixes
it, and adds some /* ... */ to m68k_in.c so that src2html.exe does a
better job on it.
~aa
memory_install_ram() to assign a un-named bank to a region and specify
a pointer to where the RAM lives. If this is called in the DRIVER_INIT
function or MACHINE/SOUND/VIDEO_START functions, then it is permissible
to specify NULL, in which case the memory system will allocate memory
and register it for save states.
memory_install_rom() is like the above except that it only installs a
read handler.
memory_install_writeonly() is like the above except that it only installs
a write handler.
Updated several instances in the code that were assigning banks to these
sorts of static RAM regions and simplified the code.
Also fixed several regressions reported by Tafoid.
The AM_SHARE() macro now takes a tag parameter. All existing
shares have been bulk renamed to "share##". However, the name
does not matter, so please use descriptive tags going forward.
Also added tag validation for bank and share tags.
Added flag to tagmap_add functions that optionally will
replace existing objects if a duplicate is found.
their place are a series of expanded macros and new memory
installation helpers. Some mappings below (not all are new):
AM_READ(SMH_RAM) -> AM_READONLY
AM_WRITE(SMH_RAM) -> AM_WRITEONLY
AM_READWRITE(SMH_RAM, SMH_RAM) -> AM_RAM
AM_READ(rhandler) AM_WRITE(SMH_RAM) -> AM_RAM_READ(rhandler)
AM_READ(SMH_RAM) AM_WRITE(whandler) -> AM_RAM_WRITE(whandler)
AM_DEVREAD(tag, rhandler) AM_WRITE(SMH_RAM)
-> AM_RAM_DEVREAD(tag, rhandler)
AM_READ(SMH_RAM) AM_DEVWRITE(tag, whandler)
-> AM_RAM_DEVWRITE(tag, whandler)
AM_READ(SMH_ROM) -> AM_ROM
AM_WRITE(SMH_ROM) -> (was a no-op)
AM_READ(SMH_NOP) -> AM_READNOP
AM_WRITE(SMH_NOP) -> AM_WRITENOP
AM_READWRITE(SMH_NOP, SMH_NOP) -> AM_NOP
For dynamic memory handler installation of the various types,
use the new functions:
memory_unmap_read()
memory_unmap_write()
memory_unmap_readwrite() -- unmaps a section of address space
memory_nop_read()
memory_nop_write()
memory_nop_readwrite() -- nops a section of address space
Cleaned up the internals of the address_map_entry structure, and
also normalized the way the address map macros work to remove a
lot of redundancy.
Changed all memory_bank_* functions to specify a tag.
Bulk-converted existing banks to be tagged "bank##" in
order to ensure consistency. However, going forward, the
tags don't matter, so please name them something useful.
Added AM_BANK_READ/AM_BANK_WRITE macros to let you specify
bank tags. Also changed AM_ROMBANK and AM_RAMBANK macros to
accept tags as well.
Added new functions memory_install_read_bank_handler and
memory_install_write_bank_handler to install banks by tag
name, similar to input ports.
Changed internals of memory system to dynamically allocate
all banks. The first time a bank with an unknown tag is
installed, a new bank object is created and tracked
internally. Removed all SMH_BANK(n) references outside of
the main code; these should never, ever be useful anymore.
>
> The cp1610 CPU is only used by the Intellivision (in MESS). However the
> disassembler produces garbage. Also I noticed a tiny error in the CPU
> itself.
>
> Here are the fixes:
>
> Firstly, the CPU, a one-line change. In cp1610.c, at line 3515, you may
> notice that 2 flags are sharing the same bit. Please change the V flag
> to
> use 0x20 (instead of 0x10). That's all there.
>
> Next, the disassembler. It assumes oprom to be 16 bits when in fact it
> is 8.
> I could not see a way of specifying the size of oprom, so assuming it
> is
> always 8 bits. If that's the case, please replace 1610dasm.c with the
> enclosed one.
>
> Thanks and have a great day :)
>
> - Robbbert
---------- Forwarded message ----------
From: Barry Rodewald <bsr@xnet.co.nz>
Date: Sat, Nov 28, 2009 at 6:55 AM
Subject: Another i386 fix
To: submit@mamedev.org
Hi,
Small fix this time. This fixes an issue with the FM Towns version of
MS-DOS where it was feeding nonsense parameters to the CD-ROM
controller. MS-DOS uses REP OUTSB to send the parameters, and I
noticed that the expected data was not what was sent to the I/O port.
Looking at the i386 code, I saw that it always used segment:ESI,
regardless of address size. This fix makes it use segment:SI when
address size is 16-bit (ie: when using OUTSB or OUTSW).
Patch is based on 0.135u1.
Thanks,
Barry Rodewald
mailto:bsr@xnet.co.nz
- fixed bug in vtlb code that caused us to lose track of previously
registered fixed page ranges
- fixed MIPS3 behavior that would not clear out invalid page ranges
from the VTLB under certain circumstances
- added support for TLB sizes less than 48 entries