Commit Graph

1099 Commits

Author SHA1 Message Date
Aaron Giles
2e7d262931 02113: xymg: xymg title mispelled
02110: All sets in cps3.c: video from a DV cam proves the refresh rate of CPS3 in MAME is wrong 
02095: chqflag, chqflagj, -listxml: memory leaks
2008-08-14 07:36:27 +00:00
Aaron Giles
2ec0fea9c2 From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] Collapse timer callbacks

Hi mamedev,

The following patch collapses timer callbacks in some cases to avoid
duplicating code.  In the case of crystal.c, it also refactors two DMA
handlers and shuffles the init/reset code around a bit.  I noticed
while doing this that h8_itu_read8 is missing cases 0x96,0x97 which is
almost certainly a bug, but I left it alone.

~aa
2008-08-14 06:27:52 +00:00
Aaron Giles
0921968934 From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] Fix i386 bsr implementation

Hi mamedev,

The i386 cpu emulator will return the wrong result for bsr when the
highest bit is set (0 instead of 15 or 31).  The attached patch fixes
this.

~aa
2008-08-14 06:21:31 +00:00
Aaron Giles
51c1079953 From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] Fix 1802 cybrcomm, raveracw, raveracj, raveraja,
ridgerac, ridgerab, ridgeraj, acedrvrw, victlapw: No sound in games
after reloading via the MAME UI

Hi mamedev,

The problem with namcos22 games losing sound when running multisession
is actually an m37710 cpu initialization bug.  The attached patch
fixes it, and also collapses all the timer callbacks together as an
unrelated code cleanup.

Note: namcos22 has a lot of uninitialized state, so I wouldn't be
surprised if there are other multisession issues.
2008-08-14 06:13:56 +00:00
Aaron Giles
15893eeed0 Fixed includes of rescap.h. 2008-08-14 04:51:04 +00:00
Aaron Giles
a0574bb473 Moved several include files from mame/ to emu/, as they were
included by generic components in emu/ and thus should have no
dependencies on the MAME code.

Added new target ldplayer, which is based on MAME but serves as
a standalone laserdisc player for CHDs. Right now only the
Pioneer LD-V1000 is connected, and limited commands are available.
Each player type is a driver, so you specify the player type on
the command-line. The driver then opens the first CHD it finds
in your ROM path and uses that as the laserdisc. The intention is
that you specify the -rompath each time on the command-line, so
a typical approach might be:

   ldplayer ldv1000 -rompath j:\mach3

where it will pick up the mach3.chd lurking in your j:\mach3
folder. Several basic commands are supported:

   Space = play/pause
   Alt   = toggle frame display
   Left  = scan forward (when playing) or step forward (when paused)
   Right = scan backward (when playing) or step backward (when paused)
   0-9   = enter numbers for search
   Enter = execute search to frame
2008-08-13 15:09:08 +00:00
Aaron Giles
480df37d02 Added new flag to menu items: MENU_FLAG_DISABLE, which means the
item will be visible but not selectable.

Fixed bug that prevented the cheat engine from working when the
debugger was disabled.

Modified xmlfile.c to accept integer values in decimal or hex. The
default is decimal. Numbers may be prefixed by '#' for decimal
values, or by '$' or '0x' to indicate hexadecimal values. Also
added function xml_get_attribute_int_format() to return the format
of the attribute, so that it can be later replicated.

Updated cheat parser to preserve the format of attribute values
used for cheat parameters and items.

Added support for information-only cheat items, which will be
displayed in the menu but which are not selectable and have no
action associated with them. Empty information-only items are
automatically converted to menu separators.
2008-08-13 04:55:42 +00:00
R. Belmont
04239409b0 SH2DRC: Allow delay slot of a BSR to trash the PR if it wants. (Manis 2059) 2008-08-13 03:58:02 +00:00
Derrick Renaud
1daf41e218 Final CPU header updates. Mostly just re-naming the re-inclusions.
The structures/names were getting too complex for my macros to handle.  They would require hand editing and my computer is too slow to keep re-compiling.

Passes a clean compile.
2008-08-13 02:48:52 +00:00
davidhay
216a0b5c3b fix broken compile. 2008-08-12 22:28:40 +00:00
Aaron Giles
111a34fea5 Added video level detection and reporting to ldverify.
Removed channels parameter from avcomp decode configuration.

Fixed incorrect test in winwork that led to spinning instead
of using the nicely allocated events we had on hand.

Forced a sound synchronization on each vsync in the laserdisc
playback. This prevents overwriting the tail end of the
buffer which was fouling up the MACH 3 audio decoding.

Removed obsolete size check for uncompressable audio data.
2008-08-12 17:37:53 +00:00
Nicola Salmoria
82494e9da3 updated Alpha 8302 MCU simulation to match newly dumped internal ROM.
Added the ROM to Champion Baseball 2.
2008-08-12 14:50:34 +00:00
Aaron Giles
a85c4c754d Rejiggered huffman.c to support multiple interleaving
streams and a delta-RLE pre-encoding. Added optimized
case for the Y/Cb/Y/Cr video encoding case. Cleaned up
the code.

Updated avcomp.c to use the new huffman.c functions.
Reworked configuration options to allow for both input
and output of naturally aligned data streams. Updated
chdman and laserdsc to use the new interfaces. New
compression gives an additional 3-7% over previous
attempt and compresses the dummy CHDs down significantly.
2008-08-12 09:24:22 +00:00
Derrick Renaud
d5d5d9449b structure, lower-casing functions and re-inclusion updates of the src\emu\cpu headers J - M. 2008-08-12 03:40:09 +00:00
Derrick Renaud
3c2b00d332 structure, lower-casing functions and re-inclusion updates of the src\emu\cpu headers up to I.
It's mostly just re-inclusion renaming, but there are few other re-nameings.
2008-08-11 03:06:59 +00:00
Derrick Renaud
3710253aa7 This (mostly - see below) completes the structure, lower-casing functions and re-inclusion updates of the src\sound\emu headers.
I did not do much to the following files because I did not know the best way to name them.
aicadsp.h
sid.h
sidenvel.h
sidvoice.h
ymdeltat.h

I did not update structures only used in the src\emu\sound\*.c files.  They are only used locally in the file so they were not worth the effort.
2008-08-11 00:32:08 +00:00
R. Belmont
3fd8c0941b More FM OPN fixes [Eke, R. Belmont]
- Pass chip type around and restore Jarek's original behavior for YM2203/YM2610
- Always recalculate attack rate in set_ar_ksr, fixes Megadrive/Genesis "Batman & Robin"
2008-08-10 04:00:31 +00:00
Derrick Renaud
4f0cddd1a5 Updated src\emu\sound headers from K-S, so they use latest naming/structure and re-inclusion support. Also lowercased the handler names.
What a PITA.  :)  I'll have to go back and do A-J to lower case the handlers to match the new structure names I already did.

Sorry Mess and other port developers, but the code should match what is stated on the official WIKI.  But don't worry, I don't plan on updating anything but the sound cores.
2008-08-10 02:23:43 +00:00
Derrick Renaud
629498ef38 more sound core structure/renaming updates.
You may have to do a clean compile, or delete the affected driver object files.

struct C140interface       to c140_interface
struct cem3394_interface   to cem3394_interface
struct ES5503interface     to es5503_interface
struct ES5505interface     to es5505_interface
struct ES5506interface     to es5506_interface
struct ssg_callbacks       to ssg_callbacks
struct gaelcosnd_interface to gaelcosnd_interface
struct ics2115_interface   to ics2115_interface

I'll stop until my posted question about chip names and upper case is answered.
2008-08-09 05:28:19 +00:00
Derrick Renaud
e6cf588405 Some more structure/naming updates of sound cores.
FWIW, I first check for variables named name_interface and rename them as name_cofig, so they don't conflict with the new interface names.

struct YMF262interface  to ymf262_interface
struct YM2151interface  to ym2151_interface
struct YM2203interface  to ym2203_interface
struct YM2608interface  to ym2608_interface
struct YM2610interface  to ym2610_interface
struct YM2612interface  to ym2612_interface
struct YM3812interface  to ym3812_interface
struct Y8950interface   to y8950_interface
struct YM3526interface  to ym3526_interface
struct TMS5110interface to tms5110_interface
struct TMS5220interface to tms5220_interface
struct AICAinterface    to aica_interface
2008-08-09 00:55:07 +00:00
Derrick Renaud
7ea948666a lower cased sn76477_interface and ay8910_interface 2008-08-08 16:32:55 +00:00
Derrick Renaud
cc94c8207d Updated structure and naming conventions of the following sound interfaces.
struct CustomSound_interface to custom_sound_interface
struct Samplesinterface to samples_interface
struct SN76477interface to SN76477_interface
struct AY8910interface to AY8910_interface
2008-08-08 01:50:00 +00:00
R. Belmont
eec9dab98d Fix GCC warning. 2008-08-07 16:51:31 +00:00
Aaron Giles
b40a4f5531 Cleanups and version bump. 2008-08-07 16:02:05 +00:00
Aaron Giles
9df01a2896 Added expression validation callback to verify names for CPUs and
memory regions. Extended error codes to report incorrect memory 
spaces, memory names, or memory sizes. Added verification callback
to the debugger to validate CPU and memory region names, as well
as verifying that a requested address space exists for a given
CPU.

Added support for oneshot cheats (those with only an "on" script).
They are activated via UI_SELECT in the cheat menu, and pop up a
message when activated. Also added a "Reset All" item in the cheat
menu to reset all cheats back to their default state, and added
support for UI_SELECT on a non-oneshot cheat so that it resets that
cheat to its default value.

Restored previous behavior that allowed popmessage() messages to
overlay menus and other UI.
2008-08-07 15:53:58 +00:00
Aaron Giles
ce00409cce Added word alternates for operators in expressions:
+   plus
  -   minus
  *   times or mul
  /   div
  %   mod
  !   not
  ~   bnot
  &&  and
  &   band
  ||  or
  |   bor
  ^   bxor
  lt  <
  le  <=
  gt  >
  ge  >=
  eq  ==
  ne  !=

Changed cheat escaping to automatically escape && & < and <=
to and band lt and le.
2008-08-07 06:48:04 +00:00
Couriersud
c81b2cb24d Added module profiling to discrete sound core
* added DISCRETE_PROFILING macro to discrete.h
* Upon discrete_stop, the worst performing modules will be listed
2008-08-06 19:31:39 +00:00
Aaron Giles
d3c7e67622 This also includes a fix for the bug reported at the bottom.
From: Fabio Priuli [mailto:doge.fabio@gmail.com] 
Subject: to simplify cischeat inputs

Hi,

the enclosed diff has a twofold effect on cischeat.c:

on one side: it adds diplocations to bigrun, scudhamm, 
cischeat & f1gpstar

on the other side: it removes the current hacky handling of 
f1gpstar coinage dips (check video/cischeat.c to see what I 
mean with hacky!) to use conditional ports instead. BUT in 
order to do this, I had to add more possible values for the 
PORTCOND in iptport.c. The problem is that f1gpstar has a set 
of coinage settings when you set the region to JPN or USA and 
another one when you set the region to EUR or FRA. To implement 
this I added the following self-explanatory new PORTCOND: 
ISLARGER (>), ISNOTLARGER (<=), ISSMALLER (<), ISNOTSMALLER (<=). 
Only two were really needed to implement f1gpstar dips, but 
the other two seemed costless to me while offering even more 
flexibility to the PORT_CONDITION macro.


Also notice that the handling of conditional ports in 'TAB>Dip 
Switches' menu doesn't work well (in the current source, not 
affected by my patch) with contracted expressions like 
PORT_DIPUNKNOWN_DIPLOC: the wrong items remain listed in the 
UI menu even when you change the condition! If you leave the 
DEF_STR( Unknown ) with ON/OFF cases, everything is displayed 
correctly in the menu. However, I was not able to track down 
what part of code is responsible for this bug.

Regards,
    Fabio Priuli
2008-08-06 14:35:45 +00:00
Aaron Giles
6cad3b3231 Added support for DEL as well as BS for backspacing in the
game select menu. Also limited input to ASCII characters.
2008-08-06 14:04:16 +00:00
Aaron Giles
5dcdb1d1c3 NOTE: with this change, I have also removed PORT_START and renamed
PORT_START_TAG to PORT_START.


From: Fabio Priuli [mailto:doge.fabio@gmail.com] 
Subject: let's say goodbye to untagged input ports ;)

Hi,

enclosed please find a few patches against 126u3 source

* port01.diff -> port09.diff : these patches continues the 
cleanup of inputs in drivers starting with C (the remaining ones), 
D and E. No ambiguous situations this time, so I guess there should 
be no problem with the changes. Improvements include conditional dips 
added to dynduke and diplocations for chinagat, chqflag, circus, 
citycon, cloak, contra and dynduke

* tag01.diff -> tag09.diff : these patches add tag to EVERY input port 
in drivers starting with F->Z. Notice that only tags are added, no 
AM_READ_PORT, nor PORT_INCLUDE (and I saw a lot of drivers would need 
it ;) ), nor other cleanups contained in the patches above. I'll keep 
cleaning input next week, probably, but at least we can definitely 
remove the untagged version of PORT_START :) Notice I was able to 
compile the source commenting out the definition of PORT_START, so 
I guess every occurrence is covered...
2008-08-06 13:56:38 +00:00
Aaron Giles
4a36b515ed Changes to the cheat.xml format:
- new tag <comment> (within <cheat>) is read and preserved 
    when saved
 - removed variable attribute from <parameter>; it is now 
    assumed to be 'param'
 - added default attribute for <parameter>

Added new variable 'frame' accessible from cheat scripts. This
can be used in the conditional to prevent execution on every
frame, or for other effects (like displaying temporary messages).

Added new variable 'argindex' which is the index when processing
an <argument> with a count attribute greater than 1. Can be used
in expressions like:

  <argument count="3">main.pb@(1000+argindex)</argument>

Reinstated the cheat menu. It now displays all loaded cheats and
allows for them to be activated. All known cheat behaviors should
be working now.
2008-08-06 05:24:31 +00:00
Aaron Giles
2d165fe1c3 Fixed I/O watchpoints. 2008-08-06 05:04:05 +00:00
R. Belmont
661aae28dc Changes to avoid collisions with system globals on OpenSolaris. (qmc2) 2008-08-06 03:25:58 +00:00
R. Belmont
ebbd232ba3 Fix GCC 4.3 "array bounds overflow" error. This is obviously a bug, Couriersud please take a look :) 2008-08-06 03:19:52 +00:00
Jarek Burczynski
1bb6adec56 Forced synchronization (stream_update()) before the status is actually read. 2008-08-05 21:30:33 +00:00
Couriersud
8146898f14 Discrete sound core optimizations
* moved a couple of exp(x) from _step into _reset where appropriate
* use tabulated function values for the transfer function in DSS_INVERTER_OSC

==> 40% speed increase in dkong - from 520% to
$ ./mame64 -noautosave -nothrottle -str 30 -video none dkong -nomt -nosleep 
Average speed: 722.48% (29 seconds)
2008-08-05 20:25:44 +00:00
Aaron Giles
5e3764d0a0 Removed obsolete makemeta tool. Replaced it with new ldverify
tool which walks through either an AVI or CHD capture from a
laserdisc and ensures that there are no anomalies lurking in
the VBI data.

Added new option to chdman, where if you use -createav with
a special filename (either 2:2 or 3:2) it will create a fake
laserdisc files with the equivalent cadence. This can be used
for testing until full captures are available. Most games used
2:2 apart from Dragon's Lair and Space Ace, which were 3:2.
Note that even though these files are essentially blank, they 
are Huffman-compressed, meaning that the maximum compression
ratio you will get is 8:1, so they still end up ~5GB.

Moved error strings from chdman.c to chd.c, where they can be
fetched from any caller via the new chd_error_string()
function.

Updated vbiparse to improve Manchester code decoding. It now
assigns a confidence level per bit based on how solid the
data is. Also added a new function vbi_parse_all which parses
the white flag and all three lines of metadata from a 
laserdisc frame. It then compares line 17 and 18 against each
other and selects the most likely candidate based on per-bit
confidence and other factors.

Added frame number display to laserdsc.c. It is off by
default, though most players can be configured to turn it on
(not sure if any actually do). It can be manually toggled via
the backslash key during playback.
2008-08-05 16:30:35 +00:00
Wilbert Pol
0f20ccdc1e Set the initial timer output to 2 to indicate that it is undetermined. 2008-08-04 17:44:56 +00:00
Wilbert Pol
1c0a7fce3a Fix compile errors. 2008-08-04 15:41:01 +00:00
Aaron Giles
95e3753dd2 Added proper laserdisc support for MACH 3, Us vs. Them, and Cobra
Commander (MACH 3 hardware). Old laserdisc hacks are now removed.
The code now talks to the standard Pioneer PR-8210 interface. Also
removed hacky "target list" from the MACH 3 ROMs; this information
is now decoded on the fly from the right channel laserdisc audio.
 
Other Gottlieb cleanups:
 - moved sound inputs to audio/gottlieb and included them in
    all relevant drivers
 - ordered input ports and ROM definitions consistently
 
Other laserdisc changes:
 - changed PR-8210 interface to work consistently for both Gottlieb
    and Stern games
 - added audio callback mechanism to allow drivers to peek at the
    raw audio streams
 - extended the VBI parser to be even more lenient
2008-08-04 15:26:41 +00:00
Andrew Gardner
d20e6b6151 Improved Dsp56k CPU interrupt handling. Polygonet Commanders now advances past its first dsp handshake. 2008-08-04 04:07:29 +00:00
Couriersud
82eff3f75c Revert accidentially commited changes. Sorry! 2008-08-03 19:02:28 +00:00
Couriersud
54da9f29bd 8257dma and z80dma devices now require device callback handlers instead of machine handlers.
Updated affected drivers accordingly.
2008-08-03 18:54:39 +00:00
R. Belmont
86c919a2d7 Backported a bunch of FM OPN (YM2608/2612) fixes from Genesis Plus GX. All of
this was verified on real hardware.  [Eke-Eke, Nemesis, Alone Coder, AamirM]

- implemented PG overflow, aka "detune bug" (Ariel, Comix Zone, Shaq Fu, Spiderman...)
- fixed SSG-EG support
- modified EG rates and frequency
- fixed EG attenuation level on KEY ON (Ecco 2 splash sound)
- fixed LFO phase update for CH3 special mode (Warlock, Alladin)
2008-08-02 22:05:24 +00:00
Aaron Giles
6d5941e085 Disks opened by the romload module are no longer identified by index.
Instead, they are identified by the region they were loaded in. This
generally means one disk per region. get_disk_handle() now takes a
region name in place of an index. Updated all callers to do this.
The SCSI modules in particular posed a challenge to make this work,
so watch out for potential bugs there.

Changed the IDE interfaces to default to choosing the region with the
same tag as the device for its master disk (assuming no slave). Added
support for specifying explicit master/slave disk regions as part of
the configuration, though slave disks are still not supported yet.

Change the laserdisc interface to no longer require a disk number or
a custom sound device. Both are now assumed to be tagged the same as
the laserdisc device. Updated all drivers accordingly.
2008-08-01 23:11:08 +00:00
Aaron Giles
a0c9cf2939 More gottlieb cleanup. Fixed rev 2 sound again, fleshed out memory
maps and behaviors according to the schematics. Hooked up coin
counters.

Added new functions cputag_set_input_line() to assert input lines
via CPU tag instead of index.
2008-08-01 16:39:12 +00:00
Nathan Woods
6ddfa127af Minor MESS compilation fix 2008-08-01 10:59:32 +00:00
Aaron Giles
444cde4388 Added cropping of the VBI data. 2008-08-01 02:36:23 +00:00
Aaron Giles
776b251aa2 Removed per-frame metadata support from chdman. Creating an A/V
now simply requires an AVI file input.

Relaxed VBI Manchester code clocking to allow for a little bit
of wiggle when finding the clock.

Changed laserdisc support to parse white flags and other data
from the VBI data directly, rather than relying on the textual
metadata. Expanded video frame cache to 3. Changed the way
frames are assembled to decrease the likelihood of getting an
interlaced weave. Fixed sound creation so that it is done at
reset time instead of device start, when the sound devices aren't
yet live.

Fixed bug in winwork that caused the creation of single work 
items to return NULL, and thus lead to massive memory leaks when
using A/V CHDs.
2008-08-01 02:23:26 +00:00
Derrick Renaud
c43a103858 Minor optimization to the DISCRETE_INPUT modules. The node output is now calculated when a discrete_sound_w() is called instead of each step in the simulation.
Removed the Enable line from the DISCRETE_ADJUSTMENT modules.  They should never be disabled.

Some before/after speed tests:
dkong - from 203% to 204%
firetrk - from 418% to 429%
phoenix - from 253% to 257%
polaris - from 448% to 476%
2008-08-01 00:08:42 +00:00
Aaron Giles
57bd1856b5 Cleanups/version bump. 2008-07-31 09:00:13 +00:00
Aaron Giles
e8f2759a0c (From Atari Ace. Note that I only took the first patch, which applied
to whole functions. The other one I'm not so sure about. Commented
code is usually hilighted differently, making it very easy to spot.)

Hi mamedev,

This set of patches has one aim only, to identify chunks of code that
have been disabled by the use of C/C++ comments, and to disable them
instead by using the preprocessor.  The C comment approach to
disabling code isn't safe (embedded comments will trip it up), and the
C++ comment approach isn't elegant (you shouldn't need to touch every
line to disable a chunk of code).  Using #if...#endif is preferable
always, excepting perhaps if (0) { ... }.

The patch has three parts.  The first only handles cases where full
functions were disabled.  The second handles cases where parts of
functions were disabled.  The third then tries to restore the
whitespace that the use of comments converted from tabs to spaces via
srcclean.exe.  It also cleans up the whitespace in a handful of the
files in areas outside of the original two patches.

~aa
2008-07-31 08:30:22 +00:00
Aaron Giles
e0409bc7b1 From: Oliver Stoeneberg [mailto:oliverst@online.de]
Subject: a few cleanups

This patch contains:
- removal of unprintable chars (newlines) in SH-2 disassembler (I 
submitted this in the past nd it wasn't included)
- a few unnecessary checks after malloc_ort_die() calls
- changes two romload.c warnings to use GAMENOUN instead
- adds "deprecat.h" in a  few src/mame/drivers files (would be 
necessary, if the debugger.h one would be removed)
- cleans up the mame.mak by adding all missing defines and grouping 
them based on cpu.mak
- renamed video_exit() to winvideo_exit() for consistency in function 
names
2008-07-31 08:26:39 +00:00
Aaron Giles
a69088c498 Added new options 'cheatpath' to specify one or more paths for cheat
files. Removed old option 'cheat_file'.

Updated xmlfile.c to specify the line number for each node, for more
accurate error reporting.

Removed old cheat.c/.h and replaced them with code that will read and
write the new XML-based cheat format using the new cheatpath option
(cheats still need to be enabled in order to load at all). Note that
the cheats are not implemented yet, but they are fully parsed. To test
saving, whenever a cheat file is successfully loaded, it is immediately
written back out as 'output.xml' to the cheat directory for validation.
2008-07-31 08:19:53 +00:00
R. Belmont
818cfdc705 Fixed 64-bit GCC compile. 2008-07-31 04:49:54 +00:00
Aaron Giles
5a17b8a274 Changed symbol table reference parameters to void * from UINT32. 2008-07-31 00:19:30 +00:00
Aaron Giles
2583b3cb6a Fixed menu handling so it doesn't swallow the tab key. 2008-07-30 22:36:30 +00:00
Aaron Giles
975eccb12c Simplified shift/rotate instruction implementations.
The ROL/ROR/SHL/SHR opcodes provide the carry flags typically generated by
almost all CPUs. The RORC/ROLC opcdes map directly to the rotate through 
carry of most CPUs as well.
2008-07-30 14:49:40 +00:00
Aaron Giles
03c86e0aa7 Fixed several regressions due to the region changes. 2008-07-30 05:21:01 +00:00
Aaron Giles
53491603bb Added region and regionbytes fields to the deviceconfig, which are
auto-filled by the device manager before starting the device. This
simplifies the auto-binding process for devices.

Added new selector for device-specific ROM regions. Not yet wired
up in the ROM loader.
2008-07-30 02:57:19 +00:00
Wilbert Pol
c67737a40c i8051 cpu core timer updates:
- Added support for timer mode 0 (13 bit timer)
- Cleaned up timer code a bit, fixing some off-by-one errors when timers overflow.
2008-07-29 18:29:01 +00:00
Aaron Giles
e70d4b0a85 (Modified to allow for overwrites of RAM ranges only.)
From: Atari Ace [mailto:atari_ace@verizon.net] 
Subject: [patch] Stricter ADDRESS_MAP checks

Hi mamedev,

The current implementation of address maps is lacking some useful
checks of the initial tokens.  In particular, it doesn't validate that
a particular entry doesn't try to define the same handler multiple
times.

The attached patch adds this and some other validations as fatalerrors
in address_map_detokenize, and fixes the affected maps.  The errors
generally fall into the following categories.

1.  AM_RAM AM_WRITE(...).  Should have been AM_RAM_WRITE(...)
2.  AM_RAM AM_READWRITE(...).  The AM_RAM is a NOP.
3.  AM_RAM AM_RAMBANK(...).  The AM_RAM is a NOP.
4.  AM_ROM AM_ROMBANK(...).  The AM_ROM is a NOP.
5.  AM_ROM AM_READ(...).  The AM_ROM is a NOP.

One peculiar error was in equites.c, where there were two AM_BASE
entries.

~aa
2008-07-29 17:08:43 +00:00
Aaron Giles
27061ca599 Moved region post-processing back to the end. Fixes endian issue on
second SH2 for ST-V games.

Fixed buffer overrun in latest SCSP code. Not sure how that ever
worked.

colmns97 still asserts in SCSPDSP, but this happened before the
region change.
2008-07-29 15:12:09 +00:00
Aaron Giles
25e1504511 Oops, should have been using SETc versus GETFLGS in this case. 2008-07-29 05:52:05 +00:00
Aaron Giles
962daf6607 Implemented ADDV/SUBV with flags. Kept C versions behind a compile-time define
for comparison.
2008-07-29 05:16:02 +00:00
Aaron Giles
d9c66068e8 Changed space character for memory regions from re'g'ion to 'm'emory_region. 2008-07-29 04:53:20 +00:00
Aaron Giles
a7ae6a548f Fixed comment. 2008-07-29 01:45:34 +00:00
Aaron Giles
a22ab0d669 Fix for 02043: All games in cps2.c: All Parent Sets for CPS2 Games Abort
(Thanks to Firewave)
2008-07-29 01:39:22 +00:00
R. Belmont
76d5ed12a3 SH2DRC: add SUBV, replace ADDV with C version as a precaution. (Fixes most of Mantis #2026, except the part which is a separate bug). 2008-07-28 23:12:47 +00:00
Aaron Giles
4a6fc8d5e5 Region classes go bye-bye. 2008-07-28 16:22:20 +00:00
Aaron Giles
86022ddde4 Removed all instances of regions with different class but equal names. 2008-07-28 15:09:12 +00:00
R. Belmont
6211400d23 Slowness is portable. 2008-07-28 14:36:06 +00:00
smf-
765d90880d fixed inline of DecodeADPCM under visual studio. 2008-07-28 14:10:11 +00:00
Aaron Giles
27fed1ec97 Changed the way memory regions are referenced. Instead of a single
integer value, regions are now referred to by a region class and
a region tag. The class specifies the type of region (one of CPU,
gfx, sound, user, disk, prom, pld) while the tag uniquely specifies
the region. This change required updating all the ROM region
definitions in the project to specify the class/tag instead of
region number.

Updated the core memory_region_* functions to accept a class/tag
pair. Added new memory_region_next() function to allow for iteration
over all memory regions of a given class. Added new function
memory_region_class_name() to return the name for a given CPU
memory region class.

Changed the auto-binding behavior of CPU regions. Previously, the
first CPU would auto-bind to REGION_CPU1 (that is, any ROM references
would automatically assume that they lived in the corresponding
region). Now, each CPU automatically binds to the RGNCLASS_CPU region
with the same tag as the CPU itself. This behavior required ensuring
that all previous REGION_CPU* regions were changed to RGNCLASS_CPU
with the same tag as the CPU.

Introduced a new auto-binding mechanism for sound cores. This works
similarly to the CPU binding. Each sound core that requires a memory
region now auto-binds to the RGNCLASS_SOUND with the same tag as the
sound core. In almost all cases, this allowed for the removal of the
explicit region item in the sound configuration, which in turn 
allowed for many sound configurations to removed altogether.

Updated the expression engine's memory reference behavior. A recent
update expanded the scope of memory references to allow for referencing
data in non-active CPU spaces, in memory regions, and in EEPROMs.
However, this previous update required an index, which is no longer
appropriate for regions and will become increasingly less appropriate
for CPUs over time. Instead, a new syntax is supported, of the form:
"[tag.][space]size@addr", where 'tag' is an optional tag for the CPU
or memory region you wish to access, followed by a period as a 
separator; 'space' is the memory address space or region class you
wish to access (p/d/i for program/data/I/O spaces; o for opcode space;
r for direct RAM; c/u/g/s for CPU/user/gfx/sound regions; e for 
EEPROMs); and 'size' is the usual b/w/d/q for byte/word/dword/qword.

Cleaned up ROM definition flags and removed some ugly hacks that had
existed previously. Expanded to support up to 256 BIOSes. Updated
ROM_COPY to support specifying class/tag for the source region.

Updated the address map AM_REGION macro to support specifying a
class/tag for the region.

Updated debugger windows to display the CPU and region tags where
appropriate.

Updated -listxml to output region class and tag for each ROM entry.
2008-07-28 09:35:36 +00:00
R. Belmont
1b81188229 SH2DRC: Add PC-relative load optimization and ability to disable if necessary [R. Belmont, based on an idea by Mariusz Wojcieszek] 2008-07-28 05:57:29 +00:00
R. Belmont
67faaeb473 AICA updates [Deunan Knute, ajax16384, R. Belmont]
- Fixed ADPCM decoder to remove bad optimization and match YMZ280B.  DC offset is fixed and output quality is higher
- Improved handling of slot monitor and timers B and C
- Simplified interpolation code
2008-07-28 05:46:29 +00:00
Andrew Gardner
6e13a53ff7 DSP56156 CPU Core updates.
- Rewrote core logic, communications, and interfaces.
- Added three parallel memory moves to the disassembler.
- Initial interrupt logic in place.

Plygonet.c updates.
- All communication hacks have been removed.
- Memory maps have been temporarily reverted while new DSP56k cpu core catches up.
2008-07-28 01:19:21 +00:00
Nathan Woods
251b59b069 Cleaned up MESS-specific hooks 2008-07-27 12:08:09 +00:00
Nathan Woods
a08d7977c3 Added some assertions 2008-07-26 20:49:28 +00:00
Nathan Woods
b3ee2ffd1f Added the ability to optionally pass a destructor to ui_menu_alloc_state() 2008-07-26 18:34:17 +00:00
Aaron Giles
fcf08639ee A bit more cleanup, still half-WIP now that I'm distracted with votrax. 2008-07-25 15:46:39 +00:00
Aaron Giles
7a14f21c15 Cleanups and version bump. 2008-07-24 09:07:49 +00:00
Aaron Giles
4900606a62 Minor gameplan changes in attempts to get leprechn music playing again.
No success yet.
2008-07-24 08:38:06 +00:00
Aaron Giles
0b77a69691 From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] Conditional code cleanup resubmit

Hi mamedev,

This is a resubmit of a previous patch.  The earlier version would not
compile with 32-bit MSVC, due to the fact that its linker required
external dependencies in dead code to be met before dead code
elimination was done, causing linker errors.  The proper fix for this
would be to add the necessary dependencies, so I instead simply left
the conditional code in place in winalloc.c and chd.c.

~aa

Original submission email below:
----
Conditionally compiled code tends to bitrot, so MAME should try to
avoid it as much as possible.  I sent a patch six months ago to
eliminate conditional code associated with logging, here's another
patch that does more of this.  Some notes:

1.  drc_ops.c: I couldn't find a LOG_CODE anywhere, so I used if (0).
2.  romload.c: I converted all the users of debugload to use
LOG((...)) instead, following the traditional conditional logging
pattern.
3.  windows/sound.c: I eliminated the separate sound log and directed
the few outputs to the error log.

~aa
2008-07-24 06:26:47 +00:00
Aaron Giles
9b63c42203 From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] .data removals to fix reset/multisession bugs

Hi mamedev,

One nice artifact of properly constifying data structures in MAME is
that it makes it relatively easy to spot a class of reset/multisession
bugs, namely that almost any object in .data is probably in error.
Unless the value is properly initialized in a reset routine the
initial non-zero value can't be relied upon, so there's no need to
have a non-zero value to begin with.

With that in mind, here's a patch to move more items out of .data by
either applying const, removing the non-zero initializer (if its
overwritten by init/reset) or by adding appropriate initialization
code.  In most cases I tried to add initialization code to a reset
routine, but in some cases I chose an init routine, possibly leaving a
reset bug intact.

Some interesting bits:
1.  tms9900 core.  The use of .data to initialize the irq_level wasn't
correct in some cases as the layout of the structure was core
dependent.
2.  bfcobra.c.  By introducing a VIDEO_START routine a hack in
VIDEO_UPDATE could be removed.

~aa
2008-07-24 06:18:01 +00:00
Aaron Giles
0865f72a9a Made DIP switch renderings consistent regardless of UI aspect 2008-07-24 06:16:18 +00:00
Aaron Giles
61971ae92e Made input_port_read_indexed() private to machine/generic.c.
Eventually it will probably disappear altogether. Fixed the
two remaining instances.
2008-07-24 05:34:45 +00:00
Aaron Giles
81abccd04b Make the tinklpit keycus implementation cuter
There is not enough data to be sure it's a LFSR, but it doesn't look
bad as one.

  OG.
2008-07-24 05:03:19 +00:00
Aaron Giles
96a01c9d29 From: Micko [mailto:mmicko@gmail.com]
Subject: 8257dma
Hi Aaron,
 
Small changes for 8257.
 
Fixed terminal count stop for autoload mode and added callback function existance check [Miodrag Milanovic]
 
Regards,
Miodrag
2008-07-24 03:58:40 +00:00
Aaron Giles
8e7a1a2553 Added new functions attotime_to_ticks() and ticks_to_attotime() to
convert between attotimes and a clock tick at an integral frequency.

Changed the 6532 RIOT device into a proper device. Rewrote the
logic to be simpler and leverage the new attotime functions. Changed
the I/O port setters to specify a mask, and changed the I/O port
callbacks to pass in the previous value. Updated tourtabl and
gameplan drivers to use the new device interface.

Converted audio/starwars.c, audio/exidy.c, and audio/gottlieb.c to 
use the new RIOT implementation instead of rolling their own.

Began gottlieb.c cleanup. Converted palette calculations to resistor
weights. Corrected video timing. Reduced the number of separate
machine drivers. Fixed incorrect spriteram sizes. Populated full
memory maps for the main CPU and the rev 1 sound board. More to
come.
2008-07-24 03:49:19 +00:00
Aaron Giles
5e3116fd87 Merged some memory maps. 2008-07-21 17:09:40 +00:00
Aaron Giles
2f823ff24f Laserdiscs are now devices. Updated all drivers accordingly. 2008-07-21 17:02:59 +00:00
Andrew Gardner
6a3af45257 Dsp56156 Disassembler rewrite.
- Rearranged decoding behavior.
 - Updated code style to MAME standards.
 - Tested each single-word opcode with custom ROMs.


(This is a precursor to other major dsp56k changes I have made.  I just gotta' get plygonet commanders up and running to do some tests)
2008-07-19 16:09:10 +00:00
davidhay
cce1d8b88e TGP / Model 2 fixes [ElSemi]
- TGP now correctly uses table roms (model1/2 updated accordingly)
 - removed FIFO hack on srallyc (game now runs)
 - added analog ports reading for model 2A/B/C
 - fixed some loading instructions in the TGP. that fixes srallyc automatic transmission bug
2008-07-19 09:58:31 +00:00
Aaron Giles
5bb72fa08e Changed MDRV_CPU_ADD to require a tag. Removed MDRV_CPU_ADD_TAG.
Tagged all CPUs. Now I will take a break until my fingers stop
cramping. :)
2008-07-19 05:26:09 +00:00
Aaron Giles
73aaf0db7e Tagged all the first CPUs for drivers (mostly as "main").
Added validity checks to ensure no duplicate sound or CPU tags.
Fixed several duplicate sound tags from the last checkin.

-listxml now outputs the tag names for CPUs and sound chips.
2008-07-19 03:13:34 +00:00
Brian Troha
b3b2c01fe5 ElSemi's fix for the i960 issue:
well, the fix is not that but changing them this way:
 
 program_write_dword_32le(i960.r[I960_FP]-16, i960.PC);
 program_write_dword_32le(i960.r[I960_FP]-12, i960.AC);

in take_interrupt.
 
It seems it came from a partial fix in the ret instruction. the manual says that PC is saved at FP-16 and AC at FP-12
it was reversed in mame, so when trying to fix it, i suppose Ernesto forgot to change the push too.
 
I've tested this fix and apart from having daytona working, pilot kids 2A works too (that I think has been broken for ages).
2008-07-18 19:53:37 +00:00
Aaron Giles
023423726f Removed MDRV_SOUND_ADD. Renamed MDRV_SOUND_ADD_TAG to
MDRV_SOUND_ADD. All sound chips must now include a tag.

Laboriously changed all existing drivers to define a
unique tag for each sound chip.

CPUs are next, but will require a more hands-on manual
process to produce reasonable tags.
2008-07-18 17:08:58 +00:00
Aaron Giles
e5a0b682da Minor cleanup from last checkin. 2008-07-17 16:10:46 +00:00
Aaron Giles
517a24c0ef Robustified key behavior when the debugger is visible. Should now
properly ignore the "break into debugger" keypress and not allow
related characters to filter through. Removed some hacks related to
making that work in the past.

Changed osd_wait_for_debugger() to take a machine parameter and a
"firsttime" parameter, which is set to 1 the first time the function
is called after a break. The Windows debugger uses this to ensure
that the debugger has focus when you break into it.
2008-07-17 16:09:52 +00:00
Aaron Giles
5244807bf3 Cleanups. 2008-07-17 08:09:52 +00:00
Aaron Giles
b5f2aa1240 Changed direct access EEPROM interface to return the "bus width" of the
EEPROM data, and the size is in terms of units, not bytes. Updated all
drivers accordingly.

Changed the ROM loading code to actually alter the region flags based
on the CPU endianness and bus width when creating the region, rather
than fixing them up on the fly. This means that callers to
memory_region_flags() will get the correct results.

Changed the expression engine to use two callbacks for read/write rather
than relying on externally defined functions.

Expanded memory access support in the expression engine. Memory accesses
can now be specified as [space][num]<size>@<address>. 'space' can be
one of the following:

   p = program address space of CPU #num (default)
   d = data address space of CPU #num
   i = I/O address space of CPU #num
   o = opcode address space of CPU #num (R/W access to decrypted opcodes)
   r = direct RAM space of CPU #num (always allows writes, even for ROM)
   e = EEPROM index #num
   c = direct REGION_CPU#num access
   u = direct REGION_USER#num access
   g = direct REGION_GFX#num access
   s = direct REGION_SOUND#num access

The 'num' field is optional for p/d/i/o/r, where is defaults to the
current CPU, and for e, where it defaults to EEPROM #0. 'num' is required
for all region-related prefixes. Some examples:

   w@curpc = word at 'curpc' in the active CPU's program address space
   dd@0    = dword at 0x0 in the active CPU's data address space
   r2b@100 = byte at 0x100 from a RAM/ROM region in CPU #2's program space
   ew@7f   = word from EEPROM address 0x7f
   u2q@40  = qword from REGION_USER2, offset 0x40
   
The 'size' field is always required, and can be b/w/d/q for byte, word,
dword, and qword accesses.
2008-07-17 08:07:12 +00:00
R. Belmont
b859963772 SH2DRC: cleanups and tweeks from Aaron's suggestions. 2008-07-17 03:46:51 +00:00
R. Belmont
847b927e8d Fixed simple but deadly typo in previous update. 2008-07-15 16:44:25 +00:00
R. Belmont
837d59500a i960: respect the rounding mode for CVTRI [ElSemi] 2008-07-15 16:42:05 +00:00
Nathan Woods
efcaebaea2 Changed ui_menu_get_selection() and ui_menu_set_selection() to use itemrefs
instead of indexes as per Aaron's guidance.
2008-07-15 11:04:30 +00:00
R. Belmont
a0ae9b4bb6 SH-4 update [Samuele Zannoli]
- Fixed TRAPA and some versions of FMOV
- Improved disassembly for MOV.W, MOVA, MOV.L, FIPR, and FSCA.
2008-07-14 23:27:27 +00:00
Aaron Giles
26b6c2cf16 Fixed popmessage. 2008-07-14 15:00:58 +00:00
Nicola Salmoria
89675377ca added save state suport to Konami CPU & Aliens 2008-07-14 14:56:20 +00:00
Aaron Giles
484efe776b Added an exit function to the SH2 drc so that it doesn't leak
memory like crazy.
2008-07-14 14:53:08 +00:00
Nathan Woods
83f6ced61e Added accessors to get/set the currently selected menu item in a menu 2008-07-14 11:34:20 +00:00
R. Belmont
a18b3c3eeb [SH2DRC] Removed remnant of outdated interrupt design. 2008-07-14 01:55:02 +00:00
R. Belmont
1f9a29d7fa UDRC-based SH-2 dynamic recompiler.
- All games on all drivers should work as before except "colmns97" and "stress" which crash due to sound system trouble.
- All idle skips are still included.  They are quite a bit less effective than they were on the interpreter, but they still give a boost.
- Fast RAM bypass is not included yet so this does not represent final performance.  That said, it's consistently faster than the interpreter even now.  Example: sfiii3 on 0.126 gets 609% on the interpreter and 961% on the DRC.

Major thanks to Aaron for his assistance with several sticky core bugs and other issues encountered writing this.
2008-07-13 23:40:54 +00:00
Aaron Giles
dabae9787b Replaced the crazy number of get/set functions for render containers with
a single get/set of a user settings struct.
2008-07-13 08:03:43 +00:00
Aaron Giles
c4e5ae4e41 Fixed edge case in the DRC front-end that would incorrectly tag the
end of a sequence as "return to start" even if the last instruction
did not abet the starting instruction.
2008-07-13 07:03:30 +00:00
Aaron Giles
4860b171b2 Fix game selection menu. Changed so that it only computes available
drivers once per instantiation instead of on every change.
2008-07-13 06:52:32 +00:00
R. Belmont
90a6836226 64-bit GCC fixes. 2008-07-12 21:23:48 +00:00
Aaron Giles
86fbc45266 Converted UI startup screens to use astrings. 2008-07-12 20:30:47 +00:00
Aaron Giles
d8715ab4ac Note: I have done some testing, but there are probably more bugs
lurking. If you run into anything odd, please let me know.

Added new module uiinput.c which manages input for the user interface.
The OSD is responsible for pushing mouse events and character events
to this interface in order to support mouse movement and text-based
input (currently only used for the select game menu). Added support
for navigating through the menus using the mouse. 
[Nathan Woods, Aaron Giles]

Redesigned the UI menus so that they can maintain a richer state. Now
the menus can be generated once and reused, rather than requiring them
to be regenerated on each frame. All menus also share a comment eventing
system and navigation through them is managed centrally. Rewrote all the 
menus to use the new system, apart from the cheat menus, which are now 
disabled. Reorganized the video menu to make it easier to understand.
[Aaron Giles]
2008-07-12 20:18:25 +00:00
Wilbert Pol
e379509455 Removed a no longer needed #ifdef MESS part 2008-07-12 07:43:50 +00:00
Wilbert Pol
740ebd5401 pit8253 updates:
- Changed the implementation to use timers internally.
- Removed the frequency change callbacks.
2008-07-11 20:16:30 +00:00
Nathan Woods
bc9879f754 MESS-specific fix 2008-07-08 10:05:41 +00:00
Aaron Giles
7c2e170a5a Crazy idea: run mame -valid after altering the validity checks.... 2008-07-06 23:40:25 +00:00
Aaron Giles
cc03405ca2 Cleanups and version bump. 2008-07-06 23:19:23 +00:00
Aaron Giles
1794fddf8d 01965: driveyes: Access Violation
01951: cybrcycc: Crash during intro.
01964: gtg2j: Access Violation
2008-07-06 22:48:41 +00:00
Couriersud
b261a88395 01983: Force Range cheats not working 2008-07-06 18:49:27 +00:00
Nathan Woods
697181c8cd Adding per-device and per-CPU validity checks 2008-07-06 15:02:12 +00:00
Couriersud
84e9ab7d4e Fix scrolling speed in case a cheat dat has invalid (i.e. 0) settings 2008-07-06 10:37:52 +00:00
Aaron Giles
6105826fb8 01971: Cheat menu flickers
Also made it display (null) only in debug builds.
2008-07-06 06:45:29 +00:00
Aaron Giles
161b2a86e8 01963: screenless systems: memory leak with -mngwrite 2008-07-06 06:07:23 +00:00
Roberto Zandona
342b2370be update cheat system (fix mantis #01969) (credit ShimaPong) 2008-07-04 16:49:20 +00:00
Nathan Woods
a0866bcacd MESS-specific tweak 2008-07-04 03:10:33 +00:00
Aaron Giles
e376a53661 Cleanups and version bump. 2008-07-03 15:50:46 +00:00
Aaron Giles
b82b111e69 Lighter weight debugger optimization for ADSP2100. 2008-07-03 15:34:27 +00:00
Couriersud
b97ff5fcca Credit ShimaPong - Updated cheat system
- Roll back older periodic function
   Now standard/old format work in this function
   Otherwords, several operations which doesn't exist in older
   function and added recently are now disabled
 - Separated load_cheat_code() to 3 indipendent functions
   And added new cheat options, "Load New/Standard/Old Format Code"
   (Default : load all format codes)
     NOTE : delete all cheat options in the database before start
            or reload default options (Shift + Reload key)
            in cheat general menu
 - Added format strings structure to accept huge size strings
   in loading a database to prevent from breaking other strings
 - Changed Link in new format
   Label code is now "Link-Label" and sub-label is "Label-Sub-Link"
   "Standard-Link" is no longer label
 - Added choose_label_index() to manage label selection
 - Fixed build_label_index_table() to prevent from crashing
   And disabled to build label index table in case of
   standard/old format
 - Fixed memory free problem in case of standard/old code
 - Fixed several reported/found bugs
2008-07-01 22:53:31 +00:00
Wilbert Pol
8b8ff45369 I80286: Fixed POP ES in protected mode. 2008-07-01 18:16:42 +00:00
Aaron Giles
fc9f7d2fa6 01942: All konamim2.c sets: hang
heatof11 gets to the color bars but only if you enable the debugger.
Not sure why.
2008-07-01 16:49:23 +00:00
Aaron Giles
fc20a0e0c3 Fixed sense of debugger flag in ADSP-2100 optimization. 2008-07-01 09:05:22 +00:00
Aaron Giles
32b803dad5 Fixed LWXC1/LDXC1; corrects gauntleg camera. 2008-07-01 08:09:23 +00:00
Aaron Giles
0773e2550d Fixed 64-bit writes in C back-end. 2008-07-01 07:38:42 +00:00
Aaron Giles
10bca54ab0 Fixed incorrect assumption in HASHJMP that the base table for a mode
will always be allocated when a fixed mode is first used.
2008-07-01 04:40:25 +00:00
Jonathan Gevaryahu
3efbf0333d s14001a.c: fix a minor bug with the 4-bit dac range. wolfpack clips again, and I'm almost sure its an encoding error on the original speech 2008-06-30 18:57:41 +00:00
Aaron Giles
f33daa0877 01948: All alg.c and cliffhgr.c sets: Access Violation when taking a snapshot 2008-06-30 16:27:56 +00:00
Aaron Giles
7d1d630f91 Fixed some save state problems in the DCS driver. Still comes out garbled
on a load, however. Extended memory.c to support up to 4096 banks.
2008-06-30 16:03:49 +00:00
Jonathan Gevaryahu
05946c0fda s14001a.c: Remove a TODO line for a bug which has been fixed. 2008-06-30 08:32:00 +00:00
Aaron Giles
1b941383f0 MIPS recompiler:
* marked IDT instructions for R4650 only
 * accounted for time taken in throwaway likely branch slots
 * fixed jalr to respect the correct link register
 * fixed c.eq, c.lt, c.le to fail if unordered
 * fixed swxc1, sdxc1 to use the correct source register (fixes many Gauntlet problems)
 * fixed CCR31 display in debugger
2008-06-30 08:23:20 +00:00
Jonathan Gevaryahu
785f4c5898 Update S14001A core: improved filtering to be more accurate to the chip, changed internal audio renderer to produce 4 bit sound as the real chip does. Moved filter outside of the main rendering loop into the glue code. Note: with this update, you may hear a whining noise that was not previously present. This is accurate to the chip! The real chip would almost always have an analog filter placed on its output to suppress this whine. 2008-06-30 07:36:44 +00:00
Aaron Giles
df4f70a0a7 Split ADSP2100 execution loop between debug/non-debug. 2008-06-29 16:45:55 +00:00
Aaron Giles
bc5eecc7a2 Stash jump target address before executing delay slot.
Also, don't update link register until delay slot has finished
executing.

Fixes hang in gauntleg, though there are math problems lurking still.
2008-06-29 06:19:59 +00:00
Aaron Giles
66360324c1 Fixed 32031 so that it doesn't call the debugger if not enabled. 2008-06-28 21:04:16 +00:00
Aaron Giles
64048d74f7 Oops, forgot to shift addresses for 16,32,64-bit watchpoint stubs. 2008-06-28 17:55:58 +00:00
Couriersud
9e41bb9864 Partial fix: 01945: All asteriod.c sets: Assertions
* fixes assert: src/emu/video.c:664: visarea->min_x < width
* Test whether screen type is vector and ignore min_x < width in this case
* This affected a number of vector games and the only other fix would be to rewrite the vector code
2008-06-28 13:22:41 +00:00
Aaron Giles
75d18b3a33 Changed how watchpoints work so that supporting them adds 0 overhead
unless some are actually live.

Changed a few call sites from using memory_set_context() to cpuintrf_push_context().
2008-06-28 07:21:54 +00:00
Couriersud
9ce918c465 01937: All Sets: Fatal Exception on In-Game Menu 2008-06-28 00:06:29 +00:00
R. Belmont
7a3449f968 SH2: convert context struct to go through a pointer 2008-06-27 19:42:58 +00:00
Aaron Giles
96d3879704 Don't generate compare interrupts unless the compare register was written
to. Fixes hangs in blitz, calspeed, and others. Also fixed vegas input
ports.
2008-06-27 14:23:50 +00:00
Yasuhiro Ogawa
246e71dccf Pitch calculation fix (by h0pdmiYX0) 2008-06-27 09:44:10 +00:00
R. Belmont
f6c3274df2 Refactor SH2 to separate out things that aren't part of the interpreter. 2008-06-27 05:33:54 +00:00
Nathan Woods
aa3dfa8811 MESS-specific compilation fix 2008-06-27 01:10:39 +00:00
Couriersud
08308f1f36 01935: All output commands (-listxml, -cc, -listfull, ETC) crash with error 2008-06-26 21:32:50 +00:00
Aaron Giles
1e7bfa9b94 Update docs a bit. Turn off debugger by default. 2008-06-26 16:51:19 +00:00
R. Belmont
077cd49d2e GCC 64-bit compile fix 2008-06-26 16:33:51 +00:00
Aaron Giles
3d1376ed97 Cleanups/version bump. 2008-06-26 16:05:46 +00:00
Aaron Giles
652fc279ae From: Oliver Stoeneberg [mailto:oliverst@online.de]
Subject: another Machine -> machine cleanup
This cleans up most of the Machine stuff in src/emu/machine. There is
a bit left to clean up, but it's mostly stuck at some interfaces now.
2008-06-26 15:34:42 +00:00
Aaron Giles
ba2fb8554b From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] make MSVC_BUILD=1 -j<n> build fix

Hi mamedev,

The following build tweak fixes make MSVC_BUILD=1 -j2.  It also fixes
an oversight in the cross-build support.

~aa
2008-06-26 15:27:12 +00:00
Aaron Giles
ea3780417a From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] Fix minor CPU/SOUND core build issues

Hi mamedev,

This small patch fixes a few build problems with the cpu/sound cores
M65CE02, ALPHA8201, TMC0285, TMS5200 and corrects the dependencies for
the mips core.

~aa
2008-06-26 15:24:55 +00:00
Aaron Giles
01f5d8cb93 From: Corrado Tomaselli [mailto:corrado.to@tiscali.it]
Subject: the fairyland story clocks
Verified clocks on Fairyland Story
2008-06-26 14:57:56 +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
Couriersud
9e2e2fd776 Fixes menu scrolling speed as described by Haze 2008-06-25 22:17:15 +00:00
Couriersud
37ad515d2a Updated cheat system / Credit Shimapong
- Merged 3 different search menu functions to search_main_menu()
 - Added new cheat options, "Vertical/Horizontal Key Repeat Speed"
     NOTE : delete all cheat options in the database before start
            or reload default options (Shift + Reload key)
            in cheat general menu
 - Changed assignment of Entry for Activation Key and Pre-enable
   command code. Now there are check the tag in comment field
   instead of index number. But it's only for new format command
   and old is as before
 - Added tag output in save_activation_key() and save_pre_enable()
 - Cleaned up save_cheat_options() to output description
 - Changed memory read function in watchpoints
   No longer "Debugger" watchpoint mis-hit "Cheat" watchpoint
 - Fixed several reported/found bugs
 - Renamed funcitons/enum based on coding guidlines
   All functions are completed in this update
2008-06-25 18:24:55 +00:00
Aaron Giles
25abe2749d Hornet driver:
- connected EEPROM (doesn't seem to affect much)
 - cleaned up system register access

GTI Club driver:
 - altered network IRQ clear to fix several problems
 - added Guru readme
 - fixed crashes due to missing inputs
 - gticlub "works" again

ZR107 driver:
 - added Guru readme
 - cleaned up system register access
 - these games work again with altered network IRQ timing

NWK-TR driver:
 - added Guru readme

DRC frontend:
 - now passes pointer to previous instruction when describing

PPC frontend:
 - attempts to roughly take into account branch and CR logical
    folding in timing computations
2008-06-25 15:02:07 +00:00
davidhay
1ab9a6bd40 Promoted to Working
-------------------

Survival [nuapete]
2008-06-24 20:17:59 +00:00
Wilbert Pol
88e208dce0 Fixed typo in changelog 2008-06-24 20:03:08 +00:00
Wilbert Pol
9a76a3e65d i8x41 cpu core changes:
- Updated the ram sizes. 8041 uses 128 bytes, 8042
    8042 uses 256 bytes.
  - Added support for re-enabling interrupts inside
    an interrupt handler.
  - Fixed cycle count for DJNZ instruction.
2008-06-24 19:36:34 +00:00
Aaron Giles
870607fe7b 01886: gradius4: 3D gfx problem
Fixed LZCNT opcode in x86 and x64 back-ends
Added support for flags in LZCNT and BSWAP opcodes on x86 and x64 back-ends
2008-06-24 16:05:36 +00:00
Aaron Giles
a39d6ed967 01927: Effects overlay showing in snapshots
Explicitly disabled overlays for non-native snapshots (native snapshots already had them disabled)
2008-06-24 05:28:58 +00:00
Aaron Giles
2ac4c9da66 01901: kinst13, kinst14, kinstp: Attract mode graphics regression
Fixed DCMP opcode on the 32-bit back-end
2008-06-24 05:22:30 +00:00
Aaron Giles
75a009ac40 Do not stop in the debugger while we are waiting for a pending
event to occur. This eliminates some confusion during reset and
state loading.
2008-06-24 05:21:19 +00:00
Aaron Giles
2be66a245c Fixed WRITEM opcode on 64-bit to call through memory instead of directly. 2008-06-24 04:46:15 +00:00
Wilbert Pol
6f4b3add14 I8x41 cpu core fixes:
- Added configurable i8x41/i8x42 subtype support.
- Fixed carry flag handling in ADDC A,#N instruction.
- Fixed carry flag handling in RLC A instruction.
2008-06-23 18:52:12 +00:00
Wilbert Pol
f4f26cdd1a i8x41: Fixed disassembly for opcode 0x67. 2008-06-23 17:59:03 +00:00
R. Belmont
1d2a733d95 Fixed compile where DEBUG=1 and DEBUGGER=0. 2008-06-23 17:00:18 +00:00
Aaron Giles
a4918351e1 Save state support:
* added save state support to the SHARC CPU core
 * added save state support to the PowerPC recompiler
 * added save state support to the virtual TLB system
 * added save state support to the RF5C400 sound core
 * added save state support to konppc module
 * added save state support to K056800 host controller
 * added save state support to the Konami hornet driver

Fixed poor default CLUT handling in the voodoo driver
2008-06-23 16:37:34 +00:00
R. Belmont
dfb5755f25 Fixed placement of stream_update in the NiLe emulation. 2008-06-23 13:15:28 +00:00
Aaron Giles
57c35a0efc From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] memory_region madness reloaded
Hi mamedev,

The memory_region and memory_region_length functions are probably the
two most common functions in MAME that don't take a machine parameter
but should given the syntax of the related apis memory_region_type and
memory_region_flags.  Clearly they didn't get the parameter because of
the sheer number of changes needed to change the apis.  This pair of
patches makes the change, and deals with the consequences.

The second patch then changes the api for memory_region and
memory_region_length, and fixes the fallout.  It generally plumbs
through machine parameters where needed, except for the case of sound
apis which I deferred doing so till later.  This increased the number
of deprecat.h includes by ~50.  Given it is a massive patch, there are
bound to be a few mistakes in it (I had to make ~20% of the changes by
hand), but I exercised care and reviewed the patch several times to
minimize the problems.
2008-06-23 08:32:42 +00:00
Aaron Giles
b3743812df From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] memory_region madness reloaded
Hi mamedev,

The memory_region and memory_region_length functions are probably the
two most common functions in MAME that don't take a machine parameter
but should given the syntax of the related apis memory_region_type and
memory_region_flags.  Clearly they didn't get the parameter because of
the sheer number of changes needed to change the apis.  This pair of
patches makes the change, and deals with the consequences.

The first patch makes some changes to help the second patch
along, as well as moves some uses of the memory_region apis within for
loops outside the loops.
2008-06-23 08:17:42 +00:00
Aaron Giles
ec54e3911d Save state support:
* added save state support to the MIPS3 recompiler
 * added save state support to CAGE audio system
 * added save state support to the voodoo emulator
 * added save state support to the smc91c9x emulator
 * added save state support to the kinst, seattle, and vegas drivers
 * fixed core video handling of save states with dynamic screen resolutions

SMC91C9x:
 * converted to proper device
 * updated seattle and vegas drivers to allocate devices
 * added separate 91C96 device for eventual 2049 use
 * cleaned up code
2008-06-23 07:58:17 +00:00
R. Belmont
bdd608f8ba Various NiLe fixups. Music in-game now sounds quite acceptable, if not yet perfect. 2008-06-23 02:07:52 +00:00
Aaron Giles
0dc00ab33f Converted voodoo into a proper device.
Updated drivers accordingly.
2008-06-23 01:28:05 +00:00
R. Belmont
167df11887 Correct the loop flag in the NiLe. Still more to do. 2008-06-23 01:14:48 +00:00
Wilbert Pol
a01d5624a3 Removed i8x41.ram hack from the i8x41 cpu core. 2008-06-22 20:21:51 +00:00
Tomasz Slanina
cecb9c22a9 Preliminary emulation of ST-0026 NiLe (sound).
Added audio (imperfect) to Super Real Mahjong P6.
(2nd attempt)
2008-06-22 20:14:14 +00:00
Couriersud
f18db5b067 implemented 8257 dma controller as proper device
* rewrote 8257dma.[ch]
* updated dkong.c accordingly
2008-06-22 13:48:55 +00:00
Couriersud
0bee46b0ac x86emit.h: Back out commit #2007 which accidentally commited this file as well 2008-06-22 11:44:26 +00:00
Couriersud
b85a4f86e5 Cleaned up z80dma interface - missing files from last commit)
* removed compatibility to old z80dma driver
* now uses std. callbacks (READ8_HANDLER, WRITE8_HANDLER)
* updated mario and dkong3 accordingly
2008-06-22 11:41:50 +00:00
Aaron Giles
8138105277 01916: srmvs: Assertion
Removed erroneous assertion.
2008-06-22 03:03:43 +00:00
Aaron Giles
d4b702bf33 01900: All sets in kinst.c: Mass coin input disables dipswitch access, and thus further coin input during a fight 2008-06-22 01:40:28 +00:00
Aaron Giles
3245688ccf 01905: Many Sets: Fatal Error crash - Fatal error: Input ports cannot be read at init time! (src/emu/inptport.c:1278)
Removed call to discrete_reset() in the initialization code. It is already
called by the sound system during reset, at which point it is safe to read
input ports.
2008-06-21 05:25:19 +00:00
Aaron Giles
02ad5125b1 01912: Various: Unable to construct input ports! (part 2) 2008-06-21 04:57:44 +00:00
Aaron Giles
587c6c7176 01908: Various: Access Violation when saving a snapshot 2008-06-20 14:42:34 +00:00