Tested on: Linux x64, Mac OS X 10.8, Windows 8 x64 w/latest toolchain for both OSD=windows and OSD=sdl. MIDI should auto-disable on other OSes (*BSD) but there may be problems. Works fine on Linux when set to use the system's copy of the library as well, which many distros prefer.
fixed uninitialized field in ioport_field.m_chars (fixes stack
corruption with three PORT_CHAR definitions) / added some sanity
checks for PORT_CHAR adding and lookup by Firewave
Intel 28F320J3D flash support by Lukasz Markowski
snapquik.c fixed uninitialized variable that causes random assertion
failure by Sandro Ronco
intended differences from previous behavior. For drivers,
the main change is that input_port_read() no longer exists.
Instead, the port must be fetched from the appropriate device,
and then read() is called.
For member functions, this is actually simpler/cleaner:
value = ioport("tag")->read()
For legacy functions which have a driver_data state, it goes:
value = state->ioport("tag")->read()
For other legacy functions, they need to fetch the root device:
value = machine.root_device().ioport("tag")->read()
The other big change for drivers is that IPT_VBLANK is gone.
Instead, it has been replaced by a device line callback on the
screen device. There's a new macro PORT_VBLANK("tag") which
automatically points things to the right spot.
Here's a set of imperfect search & replace strings to convert
the input_port_read calls and fix up IPT_VBLANK:
input_port_read( *\( *)(machine\(\)) *, *([^)]+ *\))
ioport\1\3->read\(\)
input_port_read( *\( *)(.*machine[()]*) *, *([^)]+ *\))
\2\.root_device\(\)\.ioport\1\3->read\(\)
(state = .*driver_data[^}]+)space->machine\(\)\.root_device\(\)\.
\1state->
(state = .*driver_data[^}]+)device->machine\(\)\.root_device\(\)\.
\1state->
input_port_read_safe( *\( *)(machine\(\)) *, *([^,]+), *([^)]+\))
ioport\1\3->read_safe\(\4\)
IPT_VBLANK( *\))
IPT_CUSTOM\1 PORT_VBLANK("screen")
- enforced short names for slot card devices
- updated validation, romverify and listxml output accordingly
- slotoptions now also contain shortnames so it's possible to link
slot option and device
from 4 to 5. This means any diff CHDs will no longer work. If you
absolutely need to keep the data for any existing ones you have,
find both the diff CHD and the original CHD for the game in question
and upgrade using these commands:
rename diff\game.dif diff\game-old.dif
chdman copy -i diff\game-old.dif -ip roms\game.chd -o diff\game.dif -op roms\game.chd -c none
Specifics regarding this change:
Defined a new CHD version 5. New features/behaviors of this version:
- support for up to 4 codecs; each block can use 1 of the 4
- new LZMA codec, which tends to do better than zlib overall
- new FLAC codec, primarily used for CDs (but can be applied anywhere)
- upgraded AVHuff codec now uses FLAC for encoding audio
- new Huffman codec, used to catch more nearly-uncompressable blocks
- compressed CHDs now use a compressed map for significant savings
- CHDs now are aware of a "unit" size; each hunk holds 1 or more units
(in general units map to sectors for hard disks/CDs)
- diff'ing against a parent now diffs at the unit level, greatly
improving compression
Rewrote and modernized chd.c. CHD versions prior to 3 are unsupported,
and version 3/4 CHDs are only supported for reading. Creating a new
CHD now leaves the file open. Added methods to read and write at the
unit and byte level, removing the need to handle this manually. Added
metadata access methods that pass astrings and dynamic_buffers to
simplify the interfaces. A companion class chd_compressor now
implements full multithreaded compression, analyzing and compressing
multiple hunks independently in parallel. Split the codec
implementations out into a separate file chdcodec.*
Updated harddisk.c and cdrom.c to rely on the caching/byte-level read/
write capabilities of the chd_file class. cdrom.c (and chdman) now also
pad CDs to 4-frame boundaries instead of hunk boundaries, ensuring that
the same SHA1 hashes are produced regardless of the hunk size.
Rewrote chdman.exe entirely, switching from positional parameters to
proper options. Use "chdman help" to get a list of commands, and
"chdman help <command>" to get help for any particular command. Many
redundant commands were removed now that additional flexibility is
available. Some basic mappings:
Old: chdman -createblankhd <out.chd> <cyls> <heads> <secs>
New: chdman createhd -o <out.chd> -chs <cyls>,<heads>,<secs>
Old: chdman -createuncomphd <in.raw> <out.chd> ....
New: chdman createhd -i <in.raw> -o <out.chd> -c none ....
Old: chdman -verifyfix <in.chd>
New: chdman verify -i <in.chd> -f
Old: chdman -merge <parent.chd> <diff.chd> <out.chd>
New: chdman copy -i <diff.chd> -ip <parent.chd> -o <out.chd>
Old: chdman -diff <parent.chd> <compare.chd> <diff.chd>
New: chdman copy -i <compare.chd> -o <diff.chd> -op <parent.chd>
Old: chdman -update <in.chd> <out.chd>
New: chdman copy -i <in.chd> -o <out.chd>
Added new core file coretmpl.h to hold core template classes. For now
just one class, dynamic_array<> is defined, which acts like an array
of a given object but which can be appended to and/or resized. Also
defines dynamic_buffer as dynamic_array<UINT8> for holding an
arbitrary buffer of bytes. Expect to see these used a lot.
Added new core helper hashing.c/.h which defines classes for each of
the common hashing methods and creator classes to wrap the
computation of these hashes. A future work item is to reimplement
the core emulator hashing code using these.
Split bit buffer helpers out into C++ classes and into their own
public header in bitstream.h.
Updated huffman.c/.h to C++, and changed the interface to make it
more flexible to use in nonstandard ways. Also added huffman compression
of the static tree for slightly better compression rates.
Created flac.c/.h as simplified C++ wrappers around the FLAC interface.
A future work item is to convert the samples sound device to a modern
device and leverage this for reading FLAC files.
Renamed avcomp.* to avhuff.*, updated to C++, and added support for
FLAC as the audio encoding mechanism. The old huffman audio is still
supported for decode only.
Added a variant of core_fload that loads to a dynamic_buffer.
Tweaked winwork.c a bit to not limit the maximum number of processors
unless the work queue was created with the WORK_QUEUE_FLAG_HIGH_FREQ
option. Further adjustments here are likely going to be necessary.
Fixed bug in aviio.c which caused errors when reading some AVI files.
and paths consistently for devices, I/O ports, memory
regions, memory banks, and memory shares. [Aaron Giles]
NOTE: there are likely regressions lurking here, mostly
due to devices not being properly found. I have temporarily
added more logging to -verbose to help understand what's
going on. Please let me know ASAP if anything that is being
actively worked on got broken.
As before, the driver device is the root device and all
other devices are owned by it. Previously all devices
were kept in a single master list, and the hierarchy was
purely logical. With this change, each device owns its
own list of subdevices, and the hierarchy is explicitly
manifest. This means when a device is removed, all of its
subdevices are automatically removed as well.
A side effect of this is that walking the device list is
no longer simple. To address this, a new set of iterator
classes is provided, which walks the device tree in a depth
first manner. There is a general device_iterator class for
walking all devices, plus templates for a device_type_iterator
and a device_interface_iterator which are used to build
iterators for identifying only devices of a given type or
with a given interface. Typedefs for commonly-used cases
(e.g., screen_device_iterator, memory_interface_iterator)
are provided. Iterators can also provide counts, and can
perform indexed lookups.
All device name lookups are now done relative to another
device. The maching_config and running_machine classes now
have a root_device() method to get the root of the hierarchy.
The existing machine->device("name") is now equivalent to
machine->root_device().subdevice("name").
A proper and normalized device path structure is now
supported. Device names that start with a colon are
treated as absolute paths from the root device. Device
names can also use a caret (^) to refer to the owning
device. Querying the device's tag() returns the device's
full path from the root. A new method basetag() returns
just the final tag.
The new pathing system is built on top of the
device_t::subtag() method, so anyone using that will
automatically support the new pathing rules. Each device
has its own internal map to cache successful lookups so
that subsequent lookups should be very fast.
Updated every place I could find that referenced devices,
memory regions, I/O ports, memory banks and memory shares
to leverage subtag/subdevice (or siblingtag/siblingdevice
which are built on top).
Removed the device_list class, as it doesn't apply any
more. Moved some of its methods into running_machine
instead.
Simplified the device callback system since the new
pathing can describe all of the special-case devices that
were previously handled manually.
Changed the core output function callbacks to be delegates.
Completely rewrote the validity checking mechanism. The
validity checker is now a proper C++ class, and temporarily
takes over the error and warning outputs. All errors and
warnings are collected during a session, and then output in
a consistent manner, with an explicit driver and source file
listed for each one, as well as additional device and/or
I/O port contexts where appropriate. Validity checkers
should no longer explicitly output this information, just
the error, assuming that the context is provided.
Rewrote the software_list_device as a modern device, getting
rid of the software_list_config abstraction and simplifying
things.
Changed the way FLAC compiles so that it works like other
external libraries, and also compiles successfully for MSVC
builds.
out of log:
This way it is possible to link two or more separated executables with different
copyright/xml out/name/... in one compilation, just one step closer...
- Removed LOADBYNAME, since it is deprecated by using per device rom load_software_part_region
- Created makedev tool to generate array of devices, and created lst file according to current devices usage.
- Changed listxml command to output device roms too
using one cothread for each executable device. This functionality is
strictly internal and should result in no changes in scheduling
behavior. However, it now becomes possible to exit out of a device's
execution in the midst of an instruction by calling
machine().scheduler().make_active(). Note that this is somewhat dangerous
for cores that have logic at the start of their execute loop to check for
interrupts or other conditions, as those checks will be skipped upon
resume, so consider this sort of early exiting to be highly experimental
for now. [Aaron Giles, Miodrag Milanovic, byuu]
loader rewrite, which is still in progress....)
Replaced mamedriv.c with a new driver list mechanism that is generated
by the build tools. The emulator core now expects the presence of a
file called src/$(TARGET)/$(SUBTARGET).lst which is just a raw list of
driver names, one per line. C and C++ comments are still permitted.
This file is parsed by a new build tool makelist which extracts the
driver names, sorts them, and generates a file called drivlist.c, which
is consumed by the core. [Aaron Giles]
Added new osdcore function osd_malloc_array() which is identical to
osd_malloc() but obviously hints that the underlying allocation is for
an array. Updated all callers to use the appropriate form. Modified the
Windows allocator to only use guard pages for array-style allocations,
allowing us to enable them once again in debug builds. [Aaron Giles]
Created new static class driver_list to wrap accesses to the list of
available drivers. Improved speed of driver lookups by relying on the
presorting done by makelist. [Aaron Giles]
Created helper class driver_enumerator as a helper for iterating through
the list of drivers. This class supports basic filtering and iteration,
and also serves as a temporary cache of machine_configs. [Aaron Giles]
Created cli_frontend object to wrap all the CLI handling code in
clifront.c. Updated/simplified all the code to take advantage of the
driver_enumerator. [Aaron Giles]
Created media_auditor object to wrap all the auditing functions in
audit.c. Updated all users to the new interface. Note that the new
auditing mechanism is slightly out of sync with the romload code in
terms of finding ROMs owned by devices, so it may mis-report some
issues until the new ROM loading code is in. [Aaron Giles]
Added concept of a per-device searchpath. For most devices, their
searchpath is just the short name of the device. For driver_devices, the
searchpath is driver[;parent[;bios]]. This searchpath will eventually be
used by the rom loader to find ROMs. For now it is used by the media
auditor only. [Aaron Giles]
Created info_xml_creator object to wrap all the info generation functions
in info.c. Converted the file to C++ and cleaned up the input processing
code. [Aaron Giles]
(not for whatsnew ... Known issues: auditing of CHDs appears busted, and
debug builds report unfreed memory if you use the built-in game picker)
Not for whatsnew: I added -Wno-conversion unconditionally to disable the
warnings Thomas reported. That setting is the default for GCC out-of-the-box
but apparently not on NetBSD. As far as I know it shouldn't cause a problem
with any GCC version back to at least 4.0.0 so we're safe even on PPC OSX,
but do let me know if hilarity ensues.