Commit Graph

374 Commits

Author SHA1 Message Date
Oliver Stöneberg
eb91a212ac added makefile define DEPRECATED to show warnings about deprecated code / added ATTR_DEPRECATED / flag some stuff in diexec.h as deprecated (nw) 2013-08-22 09:40:15 +00:00
Miodrag Milanovic
f1b81c7e98 Initial commit of internal web server, mostly to check compiling on various platforms (nw) 2013-08-07 07:20:01 +00:00
Oliver Stöneberg
e533ab056f added makefile define FASTDEBUG to disable some debug-specific stuff, that is causing performance hits (for e.g. profiling) [Oliver Stöneberg] 2013-08-02 13:43:10 +00:00
Oliver Stöneberg
171d43ead6 removed Visual Studio specific makefile define MAXOPT in favor of adding more generic define LTO [Oliver Stöneberg] 2013-08-02 09:48:25 +00:00
Oliver Stöneberg
6faeb5b078 cleaner way of disabling memory initialization with MemorySanitizer (nw) 2013-06-25 12:18:05 +00:00
Oliver Stöneberg
170a4c996a added some flags for SANITIZE=memory (nw) 2013-06-25 11:40:17 +00:00
Miodrag Milanovic
1615025734 makemak wip (nw) 2013-06-21 07:22:13 +00:00
Ryan Holtz
bb786b81fe Make FULLNAME use ?= instead of =, allows users to override the final executable name from the command line (nw) 2013-06-19 01:41:40 +00:00
Miodrag Milanovic
6fbd776a21 put optional cpu, video, sound and machine cores in one library in order to prevent linking issues on small builds, also created temp solution for subtargets for arcade,fruit and pinball machines (nw) 2013-06-17 10:27:14 +00:00
smf-
e48c8d3c11 Build dependencies for files in src/emu [smf] 2013-06-14 10:49:25 +00:00
Oliver Stöneberg
d9c98de098 some MemorySanitizer preparations:
- put memory initialization in src/emu/emualloc.c behind NO_MEMORY_INITIALIZATION define
- disable memory initialization when msan is used
- use origin tracking for msan when clang is used
2013-06-11 13:01:11 +00:00
Oliver Stöneberg
28aff9d786 removed obsolete "tests" target from makefile (nw) 2013-06-11 12:58:47 +00:00
smf-
dd3135cc47 uncommented it now that the .mak file is in (nw) 2013-06-10 23:37:34 +00:00
Curt Coder
c87dab4a64 Fixed build temporarily. (nw) 2013-06-10 21:49:51 +00:00
smf-
603f354635 Added support to jedutil for decoding 82S153, PLS153 & CK2605 [Kevin Eshbach, Charles MacDonald] 2013-06-10 19:33:46 +00:00
Miodrag Milanovic
6f2f772e70 Moved video and machine part of emu in separate mak files and libraries (nw) 2013-06-04 13:17:29 +00:00
Miodrag Milanovic
4a09e17523 LUA 5.2.2 added to libraries, did basic hookup of LUA VM into running machine [Miodrag Milanovic]
added -script (or -autoboot_script) command to execute LUA script after driver startup
2013-05-09 13:57:44 +00:00
Oliver Stöneberg
89df8ed41e added additional compiler and linker flags necessary for ThreadSanitizer (nw) 2013-05-04 09:54:42 +00:00
Oliver Stöneberg
e7c50f6019 added makefile define SANITIZE to specify the sanitizer to use (supported by latest GCC and clang versions) / added additional library necessary to link with clang on linux (nw) 2013-05-04 09:48:04 +00:00
Oliver Stöneberg
9ac5ce729c disabled another clang warning for now (nw) 2013-03-20 00:36:26 +00:00
Oliver Stöneberg
25c9594626 disabled another clang warning for now (nw) 2013-03-09 10:33:40 +00:00
Curt Coder
50f5a58821 Delete dependency makefiles on clean. (nw) 2013-02-09 16:32:21 +00:00
Oliver Stöneberg
bbfb99e515 removed additional DEBUG flags again - they are causing too much problems (nw) 2013-02-01 22:24:03 +00:00
Oliver Stöneberg
582ec9dce4 fixed typo in previous commit / fixed DEBUG compilation of pmwinmm.c and zlib 2013-02-01 08:31:09 +00:00
Oliver Stöneberg
55c4155a19 set proper DEBUG defines in makefile (nw) 2013-02-01 08:00:12 +00:00
Oliver Stöneberg
4a3e6c608c disabled some clang warning for now to improve out-of-the-box experience (nw) 2013-01-17 11:36:58 +00:00
Oliver Stöneberg
0c33249b57 fixed tests target for non-Windows platforms (nw) 2013-01-09 19:46:18 +00:00
Oliver Stöneberg
57c86b0b3f optimized tests target (nw) 2013-01-09 05:52:17 +00:00
Oliver Stöneberg
585ecc7c2e first version of chdman unit test / fixed dependies of tests target (nw) 2013-01-05 16:17:42 +00:00
Oliver Stöneberg
e18a790e69 added a "tests" target to the makefile / added chdman unittest placeholders (nw) 2013-01-05 14:20:15 +00:00
Oliver Stöneberg
85568b3f92 added CPPCHECK makefile define - it contains the path to the cppcheck binary (nw) 2013-01-05 12:37:58 +00:00
Oliver Stöneberg
ef2a555302 forgot to change library name in makefile (nw) 2013-01-01 21:01:14 +00:00
R. Belmont
13c3e056aa Enable compiling PortMidi (nw)
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.
2013-01-01 16:58:48 +00:00
Oliver Stöneberg
ab9137d652 reverted makefile change (nw) 2012-12-26 14:15:59 +00:00
Oliver Stöneberg
d8929ea694 removed duplicated build rule from makefile (nw) 2012-12-26 14:00:42 +00:00
R. Belmont
a9116a7973 SDL: Experimental Qt-based debugger [Andrew Gardner, R. Belmont] 2012-12-25 03:51:20 +00:00
Jonathan Gevaryahu
a73b2224f3 Fixed python to use env variable as described in root makefile; fixes builds on windows with spaces in the path. [Balrog, Lord Nightmare] 2012-12-06 22:12:59 +00:00
Miodrag Milanovic
fc20796818 Fix to make "make depend" work if on empty obj tree (no whatsnew) 2012-09-08 13:58:11 +00:00
Miodrag Milanovic
1f77747f86 made make depend to be defined per target to support special cases (no whatsnew) 2012-09-07 13:03:46 +00:00
Miodrag Milanovic
5f995d42a4 Added proper name of generated mak (no whatsnew) 2012-08-23 12:59:09 +00:00
Miodrag Milanovic
fc915eb2ff Made "make depend" to create files per target, also added "make depend_ume" as new target in case ume is used, since then it becomes complicated (no whatsnew) 2012-08-23 12:56:20 +00:00
Angelo Salese
2db7d3c1a9 A small unused code regarding ext i/o (not hooked because it then talks with the SCSI a lot) 2012-08-23 03:18:14 +00:00
Angelo Salese
5f1eb8b0bb Fixed Pad latch 2012-08-23 02:47:53 +00:00
smf-
68ba08589d swapped order of version.o linking for consistency 2012-06-11 18:55:35 +00:00
smf-
a2fa173090 stop repeated make all runs from toggling between building chdman & mame due to both being dependent on version.o, which is always recreated when either exe is built. 2012-06-11 18:11:48 +00:00
R. Belmont
c394be2133 Always miss a file (nw) 2012-05-28 18:16:17 +00:00
Miodrag Milanovic
07ee4afaba objdump doesn't work with VS binaries, so do not run it by Firewave (no whatsnew)
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
2012-05-15 06:56:17 +00:00
Aaron Giles
2a88e54278 ioport.c C++ conversion. Mostly internal changes, with no
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")
2012-05-03 09:00:08 +00:00
Michaël Banaan Ananas
651da72fe8 optimized optimization options :p 2012-04-29 21:47:31 +00:00
R. Belmont
647311cde1 Allow compilation with compatible system-installed versions of libjpeg and libflac [wallyweek, R. Belmont] 2012-03-29 21:56:18 +00:00
Miodrag Milanovic
97c3d0cb39 - removed need for *_dev.lst files [Miodrag Milanovic]
- 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
2012-02-23 14:19:37 +00:00
Aaron Giles
f0823886a6 Major CHD/chdman update. The CHD version number has been increased
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.
2012-02-16 09:47:18 +00:00
R. Belmont
d75dbab0de Add LZMA codec and .7z container support [David Haywood, R. Belmont] 2012-02-12 17:55:51 +00:00
Angelo Salese
39e3b5398b Doesn't compile, red card for ya 2012-02-05 16:54:00 +00:00
Aaron Giles
d60015dc9d Add -Woverloaded-virtual to catch mismatched overloaded
function signatures.
2012-01-25 05:11:03 +00:00
Aaron Giles
ed0207f126 Move devices into a proper hierarchy and handle naming
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.
2012-01-24 20:18:55 +00:00
R. Belmont
8703f92910 Added FLAC (lossless audio) codec support plus experimental hooks in samples and chdman. Bumped up CHD-CD hunk size to get better compression ratios on both zlib and flac. [David Haywood, R. Belmont] 2012-01-22 18:38:22 +00:00
R. Belmont
f6b2c736c4 Add libjpeg; converted Sliver to decompress pictures on the fly [David Haywood, R. Belmont] 2012-01-16 17:06:42 +00:00
Miodrag Milanovic
cda1b4765c Commented (per Kale's request) not removed libcothread usage in core (requires clean build), (no whatsnew)
We can safely remove comments and cothread.* from /emu and /lib/cothread if it's confirmed way to go
2011-11-30 16:00:43 +00:00
Miodrag Milanovic
c9891545fd Changed makefile in order to make sequential compilation of MAME and MESS and their sub targets less resource demanding [Miodrag Milanovic] 2011-11-22 09:10:58 +00:00
Miodrag Milanovic
be8bd3552f Move per emulator constants info into separate class [Miodrag Milanovic]
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...
2011-11-17 10:02:55 +00:00
Angelo Salese
ef6b961f2c Obviously makefile isn't supposed to change ... 2011-11-09 21:40:29 +00:00
Angelo Salese
28b51c152b Implemented FRC hook-up to Sega System 24 HW, fixes missing SFXs to Bonanza Bros. [Angelo Salese, Phil Bennett, Charles MacDonald] 2011-11-09 21:39:59 +00:00
R. Belmont
fd0be74ab4 SDL: Add TAP/TUN networking capability and shell script for configuration [Carl] 2011-10-31 01:30:24 +00:00
Miodrag Milanovic
3bdfb55b35 - Updated romload so devices are loaded from separate files [Miodrag Milanovic]
- 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
2011-08-02 15:09:21 +00:00
Aaron Giles
f8adbd63fa Added byuu's cothread library, along with a wrapper class. Switched to
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]
2011-06-25 07:03:07 +00:00
Scott Stone
dfa747f471 Removed duplicated includes from INCPATH. [Oliver Stoneberg] 2011-06-15 21:21:51 +00:00
Miodrag Milanovic
62d841c270 Moved format handling and all formats to separate library [Miodrag Milanovic] 2011-05-06 19:42:26 +00:00
Aaron Giles
00d745ca77 (Big tangle of changes that all happened as I was looking into the ROM
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)
2011-04-13 20:31:00 +00:00
Curt Coder
70efaaf040 Delete symbols file if defined when invoking clean target. [Curt Coder] 2011-02-12 22:17:46 +00:00
R. Belmont
28e34ea140 NetBSD support [Thomas Klausner]
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.
2011-02-02 03:29:54 +00:00
Andrew Gardner
ffc1d29080 Silly. 2010-12-30 06:50:24 +00:00
Andrew Gardner
ea5f8009fa plygonet.c : Fixed save state & device handler regressions. [Andrew Gardner] 2010-12-30 04:47:25 +00:00
Miodrag Milanovic
689a7d16d2 Made depend creation target independent (no whatsnew) 2010-09-28 07:33:09 +00:00
Aaron Giles
db797ba791 New build tool makedep.c, derived from src2html.c (really!).
Does basic dependency analysis and supports excluding paths.

Makefile now supports a depend target which will run makedep
on the src/$(TARGET) tree and create dependencies. It deliberately
excludes the root of src/emu as well as the osd directories in
order to keep the dependency file down to a reasonable size, so
if a core header file changes, you still need to clean and build
all.
2010-09-14 01:15:26 +00:00
Aaron Giles
c70c5fee5a Created CPU-specific device types for all CPUs, using new macros
DECLARE_LEGACY_CPU_DEVICE and DEFINE_LEGACY_CPU_DEVICE. Changed CPUs
to be their own device types, rather than all of type CPU with a
special internal subtype. Note that as part of this process I removed
the CPU_ prefix from the ALL-CAPS device name, so CPU_Z80 is just
plain old Z80 now. This required changing a couple of names like
8080 to I8080 so that there was an alphabetic first character.

Added memory interfaces to the list of fast-access interfaces. To do
this properly I had to add a separate method to devices which is
called immediately after construction, when it is possible to perform
dynamic_casts on fully-constructed objects. (This is just internal,
no changes necessary to the devices themselves.)

Some additional notes:
 * SH2 and SH4 had typedefs that conflicted with their CPU_-less names
    so I bulk renamed to structures to sh2_state and sh4_state; RB, feel
    free to choose alternate names if you don't like 'em
 * SCSP was caught doing something to the 3rd indexed CPU. Since several
    systems that use SCSP don't even have 3 CPUs, I had no idea what
    this was supposed to do, so I changed to it reference "audiocpu"
    assuming that stv was the assumed target. This is really gross and
    should be a configuration parameter, not a hard-coded assumption.
2010-07-03 00:12:44 +00:00
Aaron Giles
b67fd48c9f Winmain cleanup:
* created dynamic_bind<> template class to handle dynamically binding to
    optionally-supported functions
 * wrapped stack walking code in a class
 * wrapped symbol lookup code in a class
 * added support for parsing objdump-produced symbol dumps which include
    non-global functions for much better stack dumps and profiling in gcc builds

Also: modified makefile for win32 targets to automatically run objdump and
produce a .sym file if SYMBOLS is enabled.
2010-07-02 03:49:56 +00:00
Aaron Giles
7eb08a94fb Clean up profiling flags in the makefile. Removed GPROF flag, it is now just
PROFILE. When enabled, automatically turn on basic symbols. Also added new
SYMLEVEL option to control the symbols level (defaults to 2). [Aaron Giles]
2010-06-11 23:07:16 +00:00
Michaël Banaan Ananas
0035e1cd17 documentation: -march option core2 is in gcc since 4.3 2010-05-13 18:12:53 +00:00
Phil Bennett
37da163717 Added makefile PPC64 autodetection [Julian Sikorski] 2010-04-14 13:51:37 +00:00
Aaron Giles
717a11337e Added gprof support to the makefile. [Bryan Ischo]
Added a check for the OPTION_READCONFIG option before executing 
the code which would attempt to incorporate configuration file
settings into the current configuration, because if OPTION_READCONFIG 
is set to false, then there is no reason to even try to do this as 
every single configuration file will be ignored (because config files 
have been turned off by OPTION_READCONFIG). [Bryan Ischo]

Fixed small memory leak in mame.c. [Bryan Ischo]

Fixed double-free error in render.c. [Bryan Ischo]

Made core_strdup use osd_malloc instead of malloc. [Bryan Ischo]
2010-04-08 06:10:18 +00:00
R. Belmont
1afbd40efb [#3792, #3793] SDL compile fixes [Christian MArillat]
- Autodetect FreeBSD variant
- Altivec/VMX fixes for non-Mac PPC
2010-03-24 04:06:07 +00:00
R. Belmont
beeffeb5e7 Add MAME-ified version of SoftFloat library [John R. Hauser]
As previously discussed, this will be used for the MC680x0 FPU in 
order to handle high-precision floats portably.  The license is 
included in README.txt and is MAME compatible.
2010-03-02 04:26:48 +00:00
Couriersud
6d89d0cedf Fixed MT3698 (NOWERROR=1 casues -fno-strict-aliasing to be dropped).
[couriersud]
2010-03-01 21:59:28 +00:00
R. Belmont
f31c069a53 Fix for non-standard OS X builds [Scott Michel] 2010-02-14 17:44:34 +00:00
Couriersud
c55eb7889c Fix os2 auto-detect [Credit: KO Myung-Hun] 2010-02-03 20:00:10 +00:00
Couriersud
6815e7cf8f It's late, last fix for today to avoid introducing new ones. 2010-01-20 01:32:08 +00:00
Couriersud
eb9ed61a68 OpenBSD support in makefile/sdl.mak
Fix XBSD detection of PTR64 (uses amd64)
Cosmetic change to sdlprefix.h
2010-01-20 01:18:35 +00:00
Couriersud
0328f34acb Autodetection of PTR64 can be inhibited now by specifying PTR64=0.
On mixed 32bit/64bit targets identifying themselves as 64bit this can be used to build a 32bit executable.
2010-01-19 22:09:45 +00:00
Couriersud
d991c43b73 Add OS/2 autodetect to makefile 2010-01-19 21:53:06 +00:00
Couriersud
b423367224 Allow that zlib and expat can be linked dynamically without changing the makefile by specifying "=0":
make BUILD_ZLIB=0 BUILD_EXPAT=0

This was possible before as well but this is more what users (and myself) would expect.
2010-01-17 20:36:46 +00:00
Couriersud
ecec9ae9b1 Added checkautodetect target to makefile delivering e.g. on linux 64 bit:
TARGETOS=unix
PTR64=1
BIGENDIAN=
UNAME=Linux core 2.6.28-17-generic #58-Ubuntu SMP Tue Dec 1 21:27:25 UTC 2009 x86_64 GNU/Linux
2010-01-17 20:26:49 +00:00
Couriersud
feb8630108 Autotest for BIGENDIAN. A bit hacked, though. 2010-01-16 13:02:03 +00:00
Aaron Giles
f373246c42 Fix PTR64 autodetect for Windows 2010-01-16 04:40:55 +00:00
Couriersud
25b0e97ca1 - Fix TARGETOS detection on OS X.
- Do not try to check TARGETOS when cross-compiling
- For non-windows targets, try to auto-detect PTR64
2010-01-15 22:05:00 +00:00
R. Belmont
9ba62e6bce SDLMAME: improved OS X and SDL 1.3 SVN support, try to autodetect SDLMAME targets [Couriersud] 2010-01-15 21:05:29 +00:00
Aaron Giles
4169b811db Makefile changes:
1. If OSD is not defined, we look for the built-in Windows
environment variable 'OS' and if it is set to 'Windows_NT',
we assume OSD=windows; otherwise we assume OSD=sdl.

2. If TARGETOS is not defined, we look for the same variable
and set TARGETOS=win32 if it is set to 'Windows_NT'.

3. Windows SDL builds have an 'sdl' prefix on the executable
so they can live side-by-side.

The upshot of this is that on Windows systems:

make -> standard Windows build producing mame.exe
make OSD=sdl -> SDL Windows builds producing sdlmame.exe

On non-Windows systems:

make -> SDL build by default (don't need to say OSD=sdl)
2010-01-13 16:27:27 +00:00
R. Belmont
f8b28bd2f1 Merge makefile with outstanding SDLMAME changes (no whatsnew)
This turns off -Werror on a few OSes and fixes multithreaded version.c building.
2010-01-13 03:49:37 +00:00
Aaron Giles
5885e973db Makefile changes:
- Changed INLINE to map to "static inline"
 - (Windows only) Made -static-libgcc standard for both 32-bit and 64-bit
 - (Windows only) Some fixes for MSVC builds
2010-01-05 22:01:10 +00:00
Aaron Giles
b4099c91bc Changes to sync with new toolchain:
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.
2010-01-03 21:31:44 +00:00
Aaron Giles
3df8953bca Removed the various HAS_xxxx for sound cores. To select sound cores,
just choose them in the make system. Further granularity is not
necessary. This also means that the samples core is always required.
2010-01-02 20:21:00 +00:00
Phil Bennett
2fd263c18b Removed the global "includes" include and instead specify the "includes" path in all #include occurences. [Oliver Stoneberg]
---------- Forwarded message ----------
From: Oliver Stöneberg <oliverst@online.de>
Date: Sat, Dec 12, 2009 at 3:27 PM
Subject: includes cleanup
To: submit@mamedev.org


This patch removes the global "includes" include and explcitly
specifies the "includes" path in all #include occurances.
2009-12-21 23:09:02 +00:00
Aaron Giles
38978f878a Move MSVC clean out of core makefile and into windows.mak where it belongs. 2009-09-21 09:03:25 +00:00
Curt Coder
33bf61f326 Added deletion of MSVC specific files to clean task. 2009-09-16 07:20:32 +00:00
Aaron Giles
f474114e1d Added infrastructure to compile universal standalone disassembler:
- added unidasm to the tools build
 - split the disassemblers out of libcpu and into new libdasm
 - ensured the disassembly entry points for all disassemblers are
    in the source file for the disassembler (sometimes new generic
    versions were created)

Still needs command line options and file loading, but the 
fundamentals are present, and it links.
2009-08-22 06:25:07 +00:00
Ryan Holtz
98ca3ea7c1 Now turn symbols and mapfile generation off... man, I'm dumb. (no whatsnew) 2009-07-29 22:52:54 +00:00
Ryan Holtz
efe16bb749 Turning debug flag back off in the makefile (no whatsnew) 2009-07-29 22:46:08 +00:00
Andreas Naive
059b62aa1d Simplified Atomiswave's decryption routine & keys. [Andreas Naive]
-----
Furthermore, i have uploaded a new revision of the cracking tool to 
/encryption/aw_key_distiller.zip
2009-07-29 21:59:55 +00:00
Wilbert Pol
a35ef58b54 CPU cores are now enabled on a per cpu core family basis instead of per cpu core variant. As a result CPUDEFS is no longer needed in the makefile. 2009-03-25 19:39:41 +00:00
Aaron Giles
58d832602b Having decided to look at the MAME source again, I have a fairly minor patch:
* Fix build of ldplayer on OS X.  Since the CUSTOM sound module no longer exists, I 
arbitrarily changed it to WAVE, as ar gets upset if it has no input files.  I also 
removed the -all_load flag for ldplayer from the main makefile as it upsets the linker 
on OS X.

* Fix build for PPC64 Linux.  (This slightly messes up static branch prediction hints 
on OS X and AIX, but OS X for PPC64 is dead, and no- one builds MAME for AIX, and 
it will still build, anyway.)

* Paramaterise the arguments to check for NULL in the ATTR_NONNULL macro rather than 
just checking the first argument.  This requires compiler support for C99 variadic 
macros (MSVC2005 and GCC4 have this AFAIK).

Vas
2009-03-19 06:15:14 +00:00
Aaron Giles
e2757c60d2 Modified the makefile to support experimental optional C++
compilation:
 - new option CPP_COMPILE to trigger this (off by default)
 - split CFLAGS into common, C-only, and C++-only flags
 - when enabled, CPP_COMPILE causes 'pp' to be appended to 
    the target name

NOTE THAT THE SYSTEM CANNOT ACTUALLY BE COMPILED THIS WAY 
YET. IT IS JUST AN EXPERIMENT.

Modified lib.mak to always build zlib/expat as C regardless 
of CPP_COMPILE.

Modified windows.mak to fix warnings with MAXOPT=1, and to 
leverage the new CFLAGs definitions.

Modified vconv.c to do appropriate conversions for new C++ 
options.

Updated sources so that libutil, libocore (Windows), and 
libosd (Windows) can be cleanly compiled as C or C++. This
was mostly adding some casts against void *.

Fixed a few more general obvious problems at random 
locations in the source:
 - device->class is now device->devclass
 - TYPES_COMPATIBLE uses typeid() when compiled for C++
 - some functions with reserved names ('xor' in particular)
    were renamed
 - nested enums and structs were pulled out into separate
    definitions (under C++ these would need to be scoped to
    be referenced)
 - TOKEN_VALUE cannot use .field=x initialization in C++ :(
2009-02-28 22:10:06 +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
ed6ad8b4f9 PowerPC dynamic recompiler: [Aaron Giles]
- rewrote PowerPC implementation as a dynamic recompiler on top
    of the universal recompiler engine
 - wrote a front-end to analyze PowerPC code paths and register usage
 - wrote a common shared module with C implementations of tricky
    CPU behaviors
 - added separate CPU types for the variants supported, instead of
    relying on a hidden model enum
 - rewrote the serial port emulation for the 4xx series to be more
    accurate and not rely on separate DMA handlers
 - rewrote the MMU handling to implement a software TLB that faults
    in pages and handles changed bits appropriately
 - implemented emulation of the PowerPC 603's software TLB, which
    allows the model 3 games to run without a hack to disable the MMU

Updated the PowerPC disassembler to share constants with the rest of
the core, and to more aggressively use simplified mnemonics, especially
for branches. [Aaron Giles]

Universal recompiler:
 - fixed frontend to handle opcode widths different from bus width
 - added several new opcodes:
    * (D)GETFLGS - copies the UML flags to a destination operand
    * FDRNDS - rounds a double precision value to single precision
 - renamed several opcodes:
    * SETC   -> CARRY
    * XTRACT -> ROLAND
    * INSERT -> ROLINS
 - consolidated the following opcodes:
    * LOAD?U -> LOAD
    * LOAD?S -> LOADS
    * STORE? -> STORE
    * READ?U -> READ
    * READ?M -> READM
    * WRITE? -> WRITE
    * WRITM? -> WRITEM
    * SEXT?  -> SEXT
    * FTOI?? -> FTOINT
    * FFRI?  -> FFRINT
    * FFRF?  -> FFRFLT
 - removed some opcodes:
    * FLAGS - can be done with GETFLGS/LOAD4/ROLINS
    * ZEXT - can be achieved with AND
    * READ?S - can be achieved with READ/SEXT
 - updated C, x86, and x64 back-ends to support these opcode changes
 - updated disassembler to support these opcode changes
 
MIPS3 dynamic recompiler:
 - updated to use new/changed opcode forms
 - changed context switch so that it only swaps a single pointer

Konami Hornet changes: [Aaron Giles]
 - updated to new PowerPC configurations
 - updated some memory handlers to be native 8-bit handlers
 - cleaned up JVS implementation to work with new serial code
 - added fast RAM for the work RAM to give a small speed boost

Konami GTI Club changes: [Aaron Giles]
 - updated to new PowerPC configurations
 - updated some memory handlers to be native 8-bit handlers

Konami Viper/ZR107 changes: [Aaron Giles]
 - updated to new PowerPC configurations

Sega Model 3 changes: [Aaron Giles]
 - updated to new PowerPC configurations
 - reimplemented/centralized interrupt handling
 - these games are broken for the moment

Fixed crasher due to some Konami games using 8 layers in
the K056832 implementation, even though it was only written
for 4. [Aaron Giles]

Added fisttp opcode to i386 disassembler. [Aaron Giles]
2008-06-05 08:34:13 +00:00
Aaron Giles
b735b4be6c New universal dynamic recompiler system. The central module
is drcuml.c, which defines a universal machine language
syntax that can be generated by a frontend recompiler and
then retargeted via a generic backend interface to any of
a number of different architectures. A disassembler for the
UML is also included to allow examination of the generated
UML code.

Currently supported backend architectures include 32-bit x86,
64-bit x86, and a platform-neutral interpreted C backend that
can be used as a fallback for platforms without native 
support. The C backend also performs additional validation
to ensure assumptions are met.

Along with the new architecture is a new MIPS III/IV 
recompiler frontend. This frontend has been rewritten from 
the old x64-specific recompiler to generate UML opcodes
instead. This means that the single recompiler can be used
to target multiple backend architectures and should in
theory produce identical results across all of them.

The old 32-bit and 64-bit MIPS recompilers are now officially
retired. The new system provides similar performance (within
5% generally) to the old system and has similar compatibility.
The only currently known issues are some problems with the
two Gauntlet 3D games.
2008-05-11 22:15:13 +00:00
Aaron Giles
4328302538 From: Marc Sandusky
Subject: Minor patch submission - verbose build information for development in IDE

I am submitting this minor patch that adds verbose build information to the 
build output when the "VERBOSE" flag is set to "1", rather than the simple 
output normally seen, by adding the "-v" flag to the CFLAGS variable.  This 
is most useful for those that like to use an IDE (Eclipse in my case) for 
source browsing and development.  The IDE usually will parse the build 
information, which is currently not available, to determine include file 
locations, build definitions, etc. and will use that information to provide 
more advanced navigation features.
2008-04-02 08:28:58 +00:00
Couriersud
504337cfb1 Followup to r767:
* submit changes to makefile omitted in r767
2008-02-22 00:17:36 +00:00
Aaron Giles
aa16ee779d Changed debugger-related code to be based off a new makefile define (DEBUGGER) which sets
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.
2008-02-02 08:57:39 +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
314928a333 (From Oliver Stoneberg)
beastrzb097u2red.patch
- added GAME_NOT_WORKING flag, so this bogus bug report can be 
removed (not even worth 1 buck!)

20080104_1.patch
- fixes a memory in src/mame/machine/stvcd.c

memoryleak0118u1ora.patch
- fixes a memory leak, that only happened when no RawInput API was 
available

memory_leak0111u6ora_1.patch
- only a partial patch - model3.c still missing
2008-01-04 18:09:45 +00:00
Aaron Giles
507ca2d275 Changes for MAME 0.121u4. 2007-12-17 16:41:39 +00:00
Aaron Giles
df34329a47 Changes for MAME 0.121u3. 2007-12-17 16:39:40 +00:00
Aaron Giles
c82a966b3b Changes for MAME 0.121u2. 2007-12-17 16:37:57 +00:00
Aaron Giles
8a8ccc5949 Changes for MAME 0.121u1. 2007-12-17 16:33:33 +00:00
Aaron Giles
7b77f12186 Initial checkin of MAME 0.121. 2007-12-17 15:19:59 +00:00