Commit Graph

2680 Commits

Author SHA1 Message Date
R. Belmont
01efae2c12 Preliminary Panasonic MN10200 CPU core and Taito ZOOM ZSG-1 sound system [Olivier Galibert]
---

This is just stage one of converting OG's stuff, please do not touch any 
of it yet.  Next up is the skeleton of the ZOOM chip, finishing up 
the missing bits of the CPU core (the interrupt controller and timers), and
debugging the results.
2010-02-04 05:20:18 +00:00
Miodrag Milanovic
573018005b [PDP1] Display the PC in hex as well as octal. [Robbbert] 2010-02-01 12:41:06 +00:00
Miodrag Milanovic
a461dfee73 [APEXC] 1. Added pseudo PC register for the debugger, it will now highlight the next instruction to be executed.
2. Added "normal" addresses to disassembler output, so anyone can see the program flow. [Robbbert]
2010-01-31 13:19:16 +00:00
Phil Bennett
662a0aafda 00993: sharrier: [debug] Crashes when a specific sample is being played during gameplay. 2010-01-30 19:52:06 +00:00
Miodrag Milanovic
3c29474089 Fixed disassembly of PDP1,TX0 and APEXC [Robbbert] 2010-01-30 14:29:45 +00:00
Miodrag Milanovic
6e568917c8 Fixed forgotten device_config to running_device change (no whatsnew) 2010-01-30 14:04:06 +00:00
R. Belmont
940c2b4e9a am29k: fix PPC GCC compile error 2010-01-28 18:01:51 +00:00
Aaron Giles
24352008a0 Compile fix for 64-bit Win32 SDL. 2010-01-28 09:41:37 +00:00
Aaron Giles
fe3d7c4af4 Cleanups and version bump. 2010-01-28 08:03:44 +00:00
Couriersud
9dae23fc0e Small optimization, no credit 2010-01-27 23:57:17 +00:00
Couriersud
77cc6538e1 UI menu interface changes
- all ui functions now expect a render_container
- removed all macros referencing render_container_get_ui
- ui_menu_alloc now is passed a container to which to render the menu.
This is a first round of changes to allow using ui_* functions in a more generic way.
2010-01-27 23:52:28 +00:00
Miodrag Milanovic
b981d4f5a1 Fixed compile for s14001a.c and updated MESS dependent code in wave.c (no whatsnew needed) 2010-01-27 09:44:06 +00:00
Jonathan Gevaryahu
57ec780797 comment was cut off. no whatsnew. 2010-01-27 07:07:03 +00:00
Jonathan Gevaryahu
ca5665910f s14001a: updated comments; got rid of the squealing noise (hidden behind a #define now, code is still there) until some other issues can be resolved. [Lord Nightmare] 2010-01-27 07:03:18 +00:00
Roberto Fresca
da865ee557 Some clean-ups... :) 2010-01-26 08:29:55 +00:00
Roberto Fresca
e717512127 Moved HD63484 ACRTC device from mame/video to emu/video. 2010-01-26 07:46:49 +00:00
Curt Coder
eace925516 Popmessages can now be used in drivers which have an MC6845. 2010-01-25 12:58:56 +00:00
Jonathan Gevaryahu
f79dfb098a Fixed sn76489a periodic noise once again (and simplified a bit of code), now should be closer to or match real chips as sampled.
Added true clock divider emulation, so emulation may be a bit slower. [Lord Nightmare, PlgDavid, Kold666]
2010-01-24 10:38:09 +00:00
R. Belmont
0f6b9fc7a8 ARM: preliminary SA-1110 support 2010-01-23 03:40:02 +00:00
Curt Coder
b05bd546aa CIA 6526: Fixed serial port transfer. 2010-01-21 18:30:50 +00:00
Aaron Giles
771a8b4ecc Whoops, typo. 2010-01-21 06:21:26 +00:00
Aaron Giles
1a2c20441f Remove some aliases between CPUINFO_ and DEVINFO_ to help clarify
usage.

Also converted a few more places to use the new accessors.
2010-01-21 06:05:57 +00:00
Aaron Giles
a5668c2eb9 Made direct accessors for device configuration state. Currently they
just call through to the get info function. Removed old macros that
wrapped calls.
2010-01-21 03:56:53 +00:00
Aaron Giles
c6cd01a95d Make an actual enum type for endianness. 2010-01-20 17:24:42 +00:00
Miodrag Milanovic
87e0102733 Fixed listmedia dependent code (no whatsnew needed) 2010-01-20 15:29:00 +00:00
Curt Coder
aa31b23824 CIA 6526: fixed serial transfer 2010-01-20 13:55:42 +00:00
Aaron Giles
392f02e3ff Fix bug that mistook a non-NULL token to mean that a device was started.
Fixes -video ddraw issue.
2010-01-20 06:11:44 +00:00
Aaron Giles
9dd322ab7f Mark these virtual before I forget and later waste time debugging it. 2010-01-20 03:42:17 +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
Aaron Giles
409add88bb Convrted the rest of devintrf to classes and moved management
functions into methods of those classes. The most wide-ranging
change was converting device_reset() to device->reset(). Apart
from that it was mostly internal shuffling in the core.
2010-01-19 15:08:18 +00:00
Fabio Priuli
576dfd4d9d Added back the hook to -listmedia option used by MESS 2010-01-19 14:37:52 +00:00
Curt Coder
2244f9274d Refactored the CIA 6526 interface, adding SP/CNT callbacks. 2010-01-19 14:26:51 +00:00
Scott Stone
c6c534dbb6 Minor documentation change. No whatsnew needed. 2010-01-19 14:20:11 +00:00
Curt Coder
22f672af59 Fixed compilation error. 2010-01-19 14:14:59 +00:00
Miodrag Milanovic
04875f17b7 - Added MESS dependent code missing in emu.h
- Fixed compiling CPU core of V30MZ (only used by MESS)
- Fixed MESS dependent code of wave.c
- Added include of emu.h in sid (used only by MESS)

no whatsnew needed
2010-01-19 13:00:22 +00:00
Aaron Giles
6c47c80e04 Fix bug where memory regions were not properly enumerated for the
memory view.

Also, stop creating empty regions for disk regions.
2010-01-18 17:34:04 +00:00
Aaron Giles
bfc69c877f Fix bug introduced with astring changes that caused malformed tokens
when writing out cfg files.
2010-01-18 17:01:31 +00:00
Aaron Giles
e738b79785 Correct a long-standing design flaw: device configuration state
is now separate from runtime device state. I have larger plans
for devices, so there is some temporary scaffolding to hold
everything together, but this first step does separate things
out.

There is a new class 'running_device' which represents the
state of a live device. A list of these running_devices sits
in machine->devicelist and is created when a running_machine
is instantiated.

To access the configuration state, use device->baseconfig()
which returns a reference to the configuration.

The list of running_devices in machine->devicelist has a 1:1
correspondance with the list of device configurations in
machine->config->devicelist, and most navigation options work
equally on either (scanning by class, type, etc.)

For the most part, drivers will now deal with running_device
objects instead of const device_config objects. In fact, in
order to do this patch, I did the following global search &
replace:

  const device_config -> running_device
  device->static_config -> device->baseconfig().static_config
  device->inline_config -> device->baseconfig().inline_config

and then fixed up the compiler errors that fell out.

Some specifics:

  Removed device_get_info_* functions and replaced them with
  methods called get_config_*.
  
  Added methods for get_runtime_* to access runtime state from
  the running_device.
  
  DEVICE_GET_INFO callbacks are only passed a device_config *.
  This means they have no access to the token or runtime state
  at all. For most cases this is fine.
  
  Added new DEVICE_GET_RUNTIME_INFO callback that is passed
  the running_device for accessing data that is live at runtime.
  In the future this will go away to make room for a cleaner
  mechanism.
  
  Cleaned up the handoff of memory regions from the memory
  subsystem to the devices.
2010-01-18 09:34:43 +00:00
Couriersud
5eebfe6ba6 Fix a bug preventing SUBTARGET=tiny compiles 2010-01-17 20:11:00 +00:00
Couriersud
89d20f9866 Undef two defines from Solaris stdlib.h which collide with mame. 2010-01-17 19:21:04 +00:00
Couriersud
91c5f19bf3 All files modified here solely depend on osdcore.h. Therefore changed all malloc/free to osd_malloc and osd_free. 2010-01-17 19:19:48 +00:00
Phil Bennett
2860295205 New games added or promoted from NOT_WORKING
--------------------------------------------
F-15 Strike Eagle (2 sets) [Phil Bennett]
Battle of the Solar System (rev. 1.1) [Phil Bennett]
Tank Battle (prototype rev. 4/21/92) [Phil Bennett]


Added Am29000 CPU core [Phil Bennett]
2010-01-17 16:21:57 +00:00
Aaron Giles
4ec052a035 device_find_child_by_tag() -> device->subdevice() 2010-01-17 15:50:08 +00:00
Aaron Giles
d061ced592 Created new template class tagged_list which manages a simple list
along with a tagmap. Changed memory regions, input ports, and devices
to use this class. For devices, converted typenext and classnext
fields into methods which dynamically search for the next item.
Changed a number of macros to use the features of the class, removing
the need for a bunch of helper functions.
2010-01-17 09:26:29 +00:00
R. Belmont
14e2b9acf3 Changed DSP56k macros to avoid collision with OS X 10.6+ system headers 2010-01-17 02:58:59 +00:00
Aaron Giles
0c191eac42 Compile fix for MSVC psikyosh (dynamic array sizes are a later
extension).

Improved stack walking on crash in Windows. Now using StackWalk64 to
do the stack walk, resulting in cleaner logs. Also will try to use
system function to look up symbol and source/line information if
present. End results:

- 32-bit gcc: parses symbol info from map file as before (this would
work better if we could coax gcc into outputting static functions in
the map)

- 64-bit gcc: has runtime issue that causes the exception handler to
not be invoked. Will work with mingw folks on it.

- 32/64-bit MSVC: nice stack dumps with symbol and source/line info,
if the PDB file is present. If not, falls back to the MAP file.
2010-01-16 21:14:23 +00:00
R. Belmont
6ec1f9c3a4 Missed another one (no whatsnew) 2010-01-16 18:58:37 +00:00
R. Belmont
c6d4f5faa8 YM2612: More accurate LFO implementation and channel clipping [Eke-Eke, Nemesis, R. Belmont] 2010-01-16 05:01:55 +00:00
Aaron Giles
aebc07a897 Cleanups and version bump. 2010-01-16 04:12:04 +00:00
Aaron Giles
d35a800134 Added casting operators to the region_info class so you can assign
a region to a generic type pointer and have it automatically convert.
Also added a bytes() method which is safe if the region is NULL
(useful for saying machine->region("foo")->bytes() and not crashing
if foo doesn't exist).

Changed the region field in the device_config to be a region_info *,
and removed the regionbytes field. Updated all users of these fields
to use the new casting operators and bytes() methods instead.

Added subdevice and subregion methods to the device_config class, so
you can easily query for devices and regions that are device-specific.
The device prefix ("devicename:") is automatically prepended.
2010-01-16 00:53:57 +00:00
R. Belmont
51fd1fa822 More PPC GCC warning fixes. 2010-01-15 23:48:40 +00:00
R. Belmont
64c285cf17 More PPC GCC warning fixes. 2010-01-15 23:18:08 +00:00
Jonathan Gevaryahu
4b257e2c66 Fixed period for both sn76489 and sn76489A periodic noise; fixes pitch in 'smooth criminal' demo for colecovision and fixes pitch (but not the waveform, which will require more work) of music in dorunrun; More work is required before the code will be bit accurate due to the way the real LFSR and periodic generator work. [Lord Nightmare, Kold666, PlgDavid] 2010-01-15 21:31:39 +00:00
Dirk Best
3997330a94 i386: Improved accuracy of the various emulated models, makes CPU detection programs detect the correct CPU (in MESS).
- eflags mask added
- Initial values for the EAX and EDX registers fixed
- cpuid values improved
- feature flags improved
- initial value for the cr0 register improved
- changed 486 to not support the cpuid instruction by default
- take a trap on invalid instructions instead of throwing a fatalerror
- emulated the undefined flag behavior for the DIV/IDIV instructions on Intel CPUs
2010-01-15 18:54:23 +00:00
Ryan Holtz
8d183da738 Added a mostly-complete SunPlus u'nSP core based on the one in Segher's "Unununium". [Harmony] 2010-01-14 05:35:34 +00:00
Paul Priest
84352b22f3 MT03233: Fix multisession crash in SE3208 affecting crystal.c [anonymous] 2010-01-12 21:26:20 +00:00
Paul Priest
a9baa7b23d Fix for MT00111 - rom region overrun in YMF278B core on loop j=0 of SAMPLE_UPDATE(). Fixes sporadic crashes in many psikyosh games which had been worked around with the exception of gunbird2 which is now also fixed [PsikyoFan]
RB: Feel free to help me correct it if you believe this isn't correct.
2010-01-12 14:31:13 +00:00
Curt Coder
5cdcb8ab63 Added xtal for MESS. 2010-01-12 14:11:14 +00:00
Aaron Giles
1f1672d6cc Enforce that numbers are all the same exact width when loading fonts. 2010-01-12 07:03:11 +00:00
Aaron Giles
470f843262 Within src/emu, basic conversions:
devtag_get_device ... machine->device()
  memory_find_address_space ... device->space()
2010-01-12 06:54:57 +00:00
Aaron Giles
46b81c390e Explicitly allow PAIR and PAIR64 in save states. 2010-01-12 03:32:07 +00:00
Aaron Giles
a9c5a5a27e Fixed memory freeing so that is it released in the opposite order
it was originally allocated.

Changed machine->region() to return a pointer to the now-public
region_info class.

Added new member function space() to the device_config, along with
shorter constants to be used (AS_PROGRAM, AS_DATA, AS_IO). With no 
parameters, space() returns the first address space, which is 
commonly the only space present. Updated a few devices that referenced 
the old space[] array to call the new function instead.

Added #define to emualloc to ensure delete can't be freely used.
2010-01-11 18:02:38 +00:00
Angelo Salese
968ef7b835 03649: gekisha: Unknown DIP 4-2 toggles Auto Tsumo after Reach. If it is enabled and declare Reach, MAME crashes. 2010-01-11 13:33:43 +00:00
Phil Bennett
d51770b70f Added the mameconfig version to the -listxml output [Oliver Stoneberg]
---------- Forwarded message ----------
From: Oliver Stöneberg <oliverst@online.de>
Date: Thu, Dec 31, 2009 at 2:45 PM
Subject: mameconfig version in -listxml
To: submit@mamedev.org


This patch adds the mameconfig version to the -listxml output
2010-01-11 12:55:43 +00:00
Phil Bennett
7304faaece Added a PCM sample end/loop callback to the RF5C68 core [Barry Rodewald]
---------- Forwarded message ----------
From: Barry Rodewald <bsr@xnet.co.nz>
Date: Sat, Jan 2, 2010 at 10:13 AM
Subject: RF5C68 addition
To: submit@mamedev.org


Hi,

Here is a small update for the RF5C68 PCM core.  For the FM Towns MESS
driver, there needs to be some way to tell when a PCM sample has ended
or looped, as the system can generate an interrupt at this point,
usually to end the sample playback on the specified channel.  From the
RF5C68(A) datasheet, there appears to be no obvious way for an IRQ
signal to be sent, so I figure the PCM IRQ setup must be external to
the PCM chip itself.

Thus, I've added a simple callback, which should be called when the
end of a sample is reached, and with a parameter for the device
itself, and the channel on which the sample has ended.

Example of the result, with callback implemented:
http://mahlemiut.marpirc.net/mess_raiden.mp3  (sound effects are done
by the RF5C68, music is CD-DA).

Thanks,
Barry Rodewald
mailto:bsr@xnet.co.nz
2010-01-11 12:24:53 +00:00
Aaron Giles
317da101d8 Try using type_traits for detection of valid save types. 2010-01-11 09:53:25 +00:00
Aaron Giles
51e6cbf6cd Fixed bogus empty ROM region warnings. 2010-01-11 08:42:05 +00:00
Aaron Giles
d51551f303 Fix cheat crash and comment display. 2010-01-11 02:37:17 +00:00
Paul Priest
6605a2e3e5 Fix crash if exit scheduled before cpus ready.e.g. clicking close on window. No whatsnew. 2010-01-10 23:40:01 +00:00
Aaron Giles
bec93ce35b Fix a few stray delete's that didn't pair with global_alloc/auto_alloc.
Fixes "attempt to free untracked memory" in several games.
2010-01-10 22:57:03 +00:00
Aaron Giles
c845d1c4fd sprintf -> vsprintf, oops. Requires a recompile, but at least
fatalerrors will have the right text.
2010-01-10 21:48:28 +00:00
Aaron Giles
567ab7c3c8 Fix typo causing crash in laserdisc games. 2010-01-10 21:32:09 +00:00
Aaron Giles
2b23d7c017 Bulk driver.h -> emu.h switch. 2010-01-10 18:00:42 +00:00
Aaron Giles
4498faacd9 First round of an attempted cleanup of header files in the system.
- Created new central header "emu.h"; this should be included
    by pretty much any driver or device as the first include. This
    file in turn includes pretty much everything a driver or device
    will need, minus any other devices it references. Note that
    emu.h should *never* be included by another header file.
 - Updated all files in the core (src/emu) to use emu.h.
 - Removed a ton of redundant and poorly-tracked header includes
    from within other header files.
 - Temporarily changed driver.h to map to emu.h until we update
    files outside of the core.

Added class wrapper around tagmap so it can be directly included
and accessed within objects that need it. Updated all users to
embed tagmap objects and changed them to call through the class.

Added nicer functions for finding devices, ports, and regions in
a machine:

   machine->device("tag") -- return the named device, or NULL
   machine->port("tag") -- return the named port, or NULL
   machine->region("tag"[, &length[, &flags]]) -- return the
      named region and optionally its length and flags
      
Made the device tag an astring. This required touching a lot of 
code that printed the device to explicitly fetch the C-string
from it. (Thank you gcc for flagging that issue!)
2010-01-10 00:29:26 +00:00
Aaron Giles
e338ba361a Compile fix. 2010-01-08 21:57:29 +00:00
Aaron Giles
838b3b13c2 Oops, forgot this. 2010-01-08 17:19:41 +00:00
Aaron Giles
a92de5930c Extended the astring class wrapper into something useful, and
useable as a stack object. Also designed the interfaces to allow
for chaining operations. And added a casting operator to const
char * for seamless use in most functions that take plain old C
strings.

Changed all uses of astring to use the object directly on the
stack or embedded in objects instead of explicitly allocating 
and deallocating it. Removed a lot of annoying memory management
code as a result.

Changed interfaces that accepted/returned an astring * to
use an astring & instead.

Removed auto_alloc_astring(machine). Use 
auto_alloc(machine, astring) instead.
2010-01-08 17:18:54 +00:00
Couriersud
a0a40f8815 Provide location in "attempt to free untracked memory" message 2010-01-08 14:53:52 +00:00
Couriersud
4f32209c06 Fix an issue which may cause a division by zero or undefined behaviour. 2010-01-08 14:38:52 +00:00
Aaron Giles
8e261f62c8 Re-enabled malloc/free but routed them to the file+line versions. 2010-01-08 08:24:22 +00:00
Aaron Giles
ab68710ce5 Oops, forgot these files. 2010-01-08 06:11:00 +00:00
Aaron Giles
91a1b8d634 NOTE: This change requires two new osd functions: osd_malloc() and
osd_free(). They take the same parameters as malloc() and free().

Renamed mamecore.h -> emucore.h.

New C++-aware memory manager, implemented in emualloc.*. This is a
simple manager that allows you to add any type of object to a
resource pool. Most commonly, allocated objects are added, and so
a set of allocation macros is provided to allow you to manage
objects in a particular pool:

  pool_alloc(p, t) = allocate object of type 't' and add to pool 'p'
  pool_alloc_clear(p, t) = same as above, but clear the memory first
  pool_alloc_array(p, t, c) = allocate an array of 'c' objects of type
                              't' and add to pool 'p'
  pool_alloc_array_clear(p, t, c) = same, but with clearing
  pool_free(p, v) = free object 'v' and remove it from the pool

Note that pool_alloc[_clear] is roughly equivalent to "new t" and
pool_alloc_array[_clear] is roughly equivalent to "new t[c]". Also
note that pool_free works for single objects and arrays.

There is a single global_resource_pool defined which should be used
for any global allocations. It has equivalent macros to the pool_*
macros above that automatically target the global pool.

In addition, the memory module defines global new/delete overrides
that access file and line number parameters so that allocations can
be tracked. Currently this tracking is only done if MAME_DEBUG is
enabled. In debug builds, any unfreed memory will be printed at
the end of the session.

emualloc.h also has #defines to disable malloc/free/realloc/calloc.
Since emualloc.h is included by emucore.h, this means pretty much
all code within the emulator is forced to use the new allocators.
Although straight new/delete do work, their use is discouraged, as
any allocations made with them will not be tracked.

Changed the familar auto_alloc_* macros to map to the resource pool
model described above. The running_machine is now a class and contains
a resource pool which is automatically destructed upon deletion. If
you are a driver writer, all your allocations should be done with
auto_alloc_*.

Changed all drivers and files in the core using malloc/realloc or the 
old alloc_*_or_die macros to use (preferably) the auto_alloc_* macros 
instead, or the global_alloc_* macros if necessary.

Added simple C++ wrappers for astring and bitmap_t, as these need
proper constructors/destructors to be used for auto_alloc_astring and
auto_alloc_bitmap.

Removed references to the winalloc prefix file. Most of its 
functionality has moved into the core, save for the guard page 
allocations, which are now implemented in osd_alloc and osd_free.
2010-01-08 06:05:29 +00:00
smf-
6c5d471f03 The starting value for an output port is now the default value, which is based on whether it is active high or low. So the device will be called the first time the line becomes active.
Changed the eeprom device to assume that the reset and clock are cleared until it's told otherwise.
Reverted the eeprom workround in cps1
2010-01-07 19:51:57 +00:00
Curt Coder
a37b9332fa VIA6522: Refactored interface to use READ/WRITE_LINE. 2010-01-07 13:06:45 +00:00
Phil Bennett
5be4dc8d54 Added some missing header declarations and static qualifiers. Added validity.h to the core for consistency as well as an explicit foo.h in each foo.c. [Atari Ace]
---------- Forwarded message ----------
From: Atari Ace <atari_ace@verizon.net>

Date: Sat, Dec 26, 2009 at 5:01 PM
Subject: [patch] Header/static cleanups
To: submit@mamedev.org
Cc: atariace@hotmail.com

- Hide quoted text -
Hi mamedev,

This patch add some missing header declarations and static qualifiers,
and adjusts a few names.  In the core, it adds validity.h for
consistency as well as an explicit foo.h in each foo.c.

~aa
2010-01-06 21:09:25 +00:00
smf-
8d88859471 moved the fix for the crash when you toggle cheats inside cheat.c, to avoid duplicating the checks and looking up whether cheats are enabled. 2010-01-06 17:30:05 +00:00
Fabio Priuli
49b2d89ab2 Fix for MT03621: Hitting F6 without -cheat trigger causes crash
now cheat toggling has no effect if there is no OPTION_CHEAT among mame_options().
2010-01-06 16:03:02 +00:00
Fabio Priuli
a406d628ff Replaced all occurrences of cputag_get_cpu with devtag_get_device: the former function was just an alias and now cpus are no different from other devices
Removed cputag_get_cpu and cputag_reset (another alias, not even used in the source) from cpuexec.h
2010-01-06 13:26:30 +00:00
Miodrag Milanovic
fd4e438cdb [PIT8253] Corrected timer update, makes at586 show correct speed (no whatsnew needed) 2010-01-06 09:54:04 +00:00
Phil Bennett
52613ad118 Changed berlwall, arkanoid, bakubrkr, mgcrystl to use YM2149 [Corrado Tomaselli]
Verified and corrected clocks in halleys and exctsccr [Corrado Tomaselli]

New clones added
----------------

Exciting Soccer (Japan set 2) [Corrado Tomaselli]
2010-01-05 12:48:14 +00:00
Miodrag Milanovic
be42e6caae Forgot to save last changes in latest commit. 2010-01-04 13:32:31 +00:00
Miodrag Milanovic
bd0c65cb91 [PIT8253] Update PIT counter even if there was no elapsed cycles (this only affects fast drivers like at586 in MESS) 2010-01-04 13:05:45 +00:00
Aaron Giles
200b21dff7 Get rid of setjmp/longjmp for error handling in favor of exceptions.
Fatalerror now maps to throwing an exception. Requires a full
recompile.
2010-01-04 07:05:53 +00:00
Aaron Giles
a3b0cf0aea Make MSVC compile once again. 2010-01-04 01:30:53 +00:00
Aaron Giles
fe40adfb2b Fix codegen bug that broke kinst. 2010-01-04 00:27:45 +00:00
Aaron Giles
ba0d55cad5 Fix linker warning. 2010-01-04 00:09:40 +00:00
Aaron Giles
a1cdc22b5a Fix typo in 8-bit eeprom case. 2010-01-03 22:42:52 +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
Wilbert Pol
2baf956ec5 Configured port A on the uPD7801 to an output port. 2010-01-03 10:15:24 +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
Wilbert Pol
22c5856130 Implemented uPD7801 timers. 2010-01-02 10:02:47 +00:00
Wilbert Pol
a83b755c7d uPD7801 core changes:
- Fixed incorrect disassembly of some instructions.
- Updated the handling of interrupts to match the documentation.
2010-01-02 08:58:38 +00:00
Aaron Giles
cb6fcbbcfa Allocate inline_config separately to avoid alignment issues. 2010-01-01 19:29:12 +00:00
R. Belmont
b08f51e0aa Trivial BIGENDIAN=1 rsp compile fix, no whatsnew needed. 2010-01-01 16:36:08 +00:00
Aaron Giles
0f6f7ba842 Converted RSP callbacks into device callbacks. Removed a ton of
tag-based queries in favor of using the device passed.
2010-01-01 00:18:16 +00:00
Aaron Giles
b3a8dd2113 Oops, fixed misaligned 32-bit accesses in RSP DRC.
Also  disabled DRC_SQV implementation as it breaks music in mtetrisc.
2010-01-01 00:16:45 +00:00
Aaron Giles
289a309cd3 Cleanups and version bump. 2009-12-31 22:03:37 +00:00
Phil Bennett
4106d2aaf6 Added additional information to the dipswitches and configurations sections in the -listxml output [Oliver Stoneberg]
---------- Forwarded message ----------
From: Oliver Stöneberg <oliverst@online.de>
Date: Thu, Dec 31, 2009 at 1:06 AM
Subject: enhanced dipswitch/configuration information in -listxml
To: submit@mamedev.org


This patch adds some additional information to the dipswitches and
configurations in the -listxml output, so I can test
dipswitches/configurations in mame_regtest by creating .cfg files.

By using this I already found two issues in MESS and the 1943
"Service Mode" issue in MAME would have been detected.

I am also wondering, if there are any dipswitches, that rely on more
than one port. If that's the case I might have to look at them and
change the output.
2009-12-31 11:15:12 +00:00
Phil Bennett
f7b4dbfea1 Fixed x86 HLT instruction handling [Phill Harvey-Smith]
Date: Mon, 28 Dec 2009 00:29:31 +0000
From: Phill Harvey-Smith <afra@aurigae.demon.co.uk>
To: submit@mamedev.org
Subject: i86 patch

Hi,

Attatched is a patch correcting the operation of the hlt instruction in 
the i86 core. I have done test builds with both the current mame and 
mess source for both debug and normal builds, and all seems to be ok.

Cheers.

Phill.

-- 
Phill Harvey-Smith, Programmer, Hardware hacker, and general eccentric !

"You can twist perceptions, but reality won't budge" -- Rush.
2009-12-31 00:56:09 +00:00
Phil Bennett
6f4011f247 Corrected a couple of typos in tilemap.c (not whatsnew worthy) 2009-12-31 00:33:55 +00:00
Ryan Holtz
c0d0d89d1b Fixed a few DRC-ized vector load/store opcodes in the RSP core. [Harmony] 2009-12-30 07:56:09 +00:00
Aaron Giles
152d8a7db0 Explicitly sign-extend 32-bit indexes for load/loads/store on 64-bit
machines to prevent overflow issues. Fixes DRC crash in mtetrisc.
2009-12-30 06:51:42 +00:00
Aaron Giles
31c7c2c219 Fixed error in codegen for drol/dror opcodes in the x86 back-end.
Re-implemented misaligned memory handling in the RSP DRC as before.
2009-12-30 06:19:08 +00:00
Aaron Giles
ad010bc54e Fix some errors the 4.4.3 compiler complains about in C++ mode. 2009-12-30 02:57:38 +00:00
Roberto Zandona
1284b17000 added two opcodes in the nec cpu; this is a temporary fix; we need to check if cb2001 use a custom cpu; in this case we need to split different cpu
cb2001: added more opcodes
2009-12-29 21:39:49 +00:00
Aaron Giles
81523f2e10 gcc 4.5.0 compilation fixes. 2009-12-29 14:35:54 +00:00
Ryan Holtz
50fbe1b27c Fixes the debug build. 2009-12-28 22:08:29 +00:00
Aaron Giles
f5730e89ef Exposed an address space for EEPROM devices. This has several
side-effects:
 - EEPROM memory is now visible in the debugger
 - EEPROM memory can be accessed like any CPU/device memory
    (i.e., use eeprom.b@<addr> instead of eeprom.eb@<addr>)

Removed support in the expression engine for EEPROM-specific
accesses.

Updated all systems that muck directly with EEPROM memory to
use memory accessors instead on the EEPROM address space.

Extended the devtempl.h file to support device address spaces.

Cleaned up romload a bit to make it clear that region flags are
enforced for any device with an address space, not just CPUs.
2009-12-28 18:04:50 +00:00
Ryan Holtz
7858c436fc Converted a number of vector opcodes to the RSP DRC core. [Harmony]
Unrolled and optimized a number of vector opcodes in the interpreter RSP core. [Harmony]
2009-12-28 16:50:06 +00:00
Aaron Giles
45d1ff4d1e Cleaned up braces in the code so that they are properly balanced. [Atari Ace] 2009-12-28 09:09:20 +00:00
Aaron Giles
bd24fb23c1 Results of running the latest srcclean. 2009-12-28 09:04:00 +00:00
Aaron Giles
93d465ad3c Whitespace cleanup. (No, a release is not yet imminent.) 2009-12-28 08:49:12 +00:00
Aaron Giles
7819b1fce7 Fix for INP recording ports that have changed notification. Also prevents
new inputs from affecting recorded inputs during playback. [mahlemiut]
2009-12-28 08:23:42 +00:00
Aaron Giles
f20a2e6b17 Fixes so we can compile as C++ again. 2009-12-28 07:34:17 +00:00
Aaron Giles
4e9be151f7 Renamed tilemap -> tilemap_t, as the name 'tilemap' is too commonly
used for statics and structure members, and some compilers (esp. C++
compilers) don't allow that.
2009-12-28 05:45:20 +00:00
Fabio Priuli
0c6ad781dc Converted Fujitsu MB87078 Volume Controller to be a device and updated taito_b.c to use the new code (it's the only driver emulating this chip atm) 2009-12-27 23:58:00 +00:00
Aaron Giles
86a9e3e217 Rename eepromdev.c/h back to eeprom.c/h 2009-12-27 23:20:05 +00:00
Aaron Giles
4717d53cac Rename functions and other references to eepromdev_* back to eeprom_* 2009-12-27 23:16:59 +00:00
Aaron Giles
ccc24c02f1 Remove old eeprom implementation. 2009-12-27 23:11:58 +00:00
Aaron Giles
96f9302a8c Allow any device memory (not just CPU's) to be accessed via debug expressions.
Change eeprom accessors to require the eeprom device name.
2009-12-27 23:10:25 +00:00
Wilbert Pol
dd7b96b1b1 i8237: removed old MESS hack leftover. No whatsnew. 2009-12-26 13:16:04 +00:00
Aaron Giles
aee2295323 Converted darkhors to eeprom device. Also trimmed obvious overdump of
EEPROM data.

Updated EEPROM device to initialize EEPROM at NVRAM load time rather
than init time, giving DEVICE_INIT handlers a chance to muck with the
data first.
2009-12-26 08:19:13 +00:00
Miodrag Milanovic
48a799c97d - Removed sysconfig section from game_driver struct
- Made compatible_with attribute available for MAME too (with NULL value set in GAMEL macro)

This patch require full recompile due to change of GAMEL macro
2009-12-25 19:59:44 +00:00
Aaron Giles
43dda8844d Removed _NODEFAULT_ forms of EEPROM driver macros. If you need to add
default data, follow the MDRV_EEPROM_ADD() with MDRV_EEPROM_DATA().
2009-12-25 01:08:43 +00:00
Scott Stone
f548c1cce3 taito_1.c - Added XTALs to driver, fixing MT bug #03598.
Comment:  Added a MACHINE_START for LAGIRL, which doesn't want to work properly (assumes I have service mode ON?)  The working method is still in place (using cachat's startup).  The clock changes were per the source notes above the ROM_START.  If anyone wants to get it working with the proper speeds, be my guest.
2009-12-24 23:33:36 +00:00
Scott Stone
64f770d382 Reverted 'bad code' mistakenly submitted in r7745. I'll keep the other code I submitted mistakenly as commented below:
sub.c - Put in board ETAL and came up with some seeming better clock speed approximations until board readings can be done.
tron.c - Sets tron3 and tron4 don't appear to have a valid working cocktail mode video or controls (upright player2 works fine).  Flagged as GAME_NO_COCKTAIL.
subs.c - Added DIP LOCATIONS.
2009-12-24 14:52:02 +00:00
Fabio Priuli
b99e364eae Split ADC1038, Konami 033906 and Konami 056230 emulation from gticlub.c and konppc.c. Also, converted them to be devices and updated PPC Konami games to use the new code
Just out of curiosity: did sscope/sscope2 ever pass through the initial hw checks or did they regressed at some point?
2009-12-24 11:38:43 +00:00
Aaron Giles
047af689a7 Converted gaelco2, xorworld, and vamphalf over to the eeprom device. 2009-12-24 04:39:59 +00:00
Scott Stone
25a430ea9b Fixed 03597: outrun, outrunra, outruno, outrundx, outrunb: Incorrect vsync speed on Outrun
Comment:  I failed to look at the video timing when Guru's readme, this should correct the behavior.  I also added the cpu/video bd numbers listed on Stefan Lindberg's reference board for Outrun.
2009-12-24 03:51:45 +00:00
Aaron Giles
75b4c8078e Fixed auto EEPROM region to properly handle 16-bit data.
Updated mitchell.c to use the EEPROM device. Removed spang hacks in
favor of preloaded eeprom data.
2009-12-24 03:36:44 +00:00
Aaron Giles
c285eb9bcd Cleanups and version bump. 2009-12-23 18:10:25 +00:00
Aaron Giles
79b8f09ad8 From: Samuele Zannoli <samuele.zannoli@sparkbio.it>
Date: Tue, Dec 22, 2009 at 11:57 AM
Subject: Core for PIC 16c62x series of processors
To: submit@mamedev.org


Hello,
         this patch contains a core for the PIC 16c62x series of processors.

It has been made starting from the pic16c5x that is already present.
This version stil misses the various internal devices, however the
opcodes and i/o ports work, and it is enough to run the emulation of
the security pics used with the gd-roms.

Bye,
       Samuele Zannoli
2009-12-23 18:01:49 +00:00
Aaron Giles
505f0d7caf From: Atari Ace <atari_ace@verizon.net>
Date: Tue, Dec 22, 2009 at 4:44 PM
Subject: [patch] Fix srcclean/src2html bugs, misbalanced tokens and
visible whitespace errors
To: submit@mamedev.org
Cc: atariace@hotmail.com


Hi mamedev,

While experimenting with srcclean and src2html as indentation
validators, I stumbled across a couple of bugs.  The first is that
srcclean doesn't properly handle /*...*//.  It sees the last / char at
the end as the second / of an inline comment, where it might be a
division token or the start of either type of comment.

The second bug is that src2html improperly handles strings with
embedded quotes preceded by escaped backslashes, e.g. "ab\\\"cd".  It
believes the string terminated in the middle, and the last quote
starts a new string.  This issue is unlikely in actual code, but
should be handled correctly.

The first patch fixes these, and a some cases where there are
dangling/missing tokens which my validation tools are noticing.  These
occur in some unused macros, dead code sections, and in some macros
that are deliberately misbalanced (v9938.c, psx.c).  In the deliberate
cases, I balanced the braces by making exactly one open and one close
macro and using those throughout.

The second patch is then a set of visible whitespace "problems". Cases
where the closing brace isn't at the same indent level as the open
brace, and some cases where the indent level isn't a multiple of four.
In the case of ssv.c I folded the assignments into init_ssv() to
simplify the code and restore the brace balance, otherwise I kept to
simply adding or removing whitespace.

~aa
2009-12-23 17:59:08 +00:00
Aaron Giles
a825a2427f ---------- Forwarded message ----------
From: Barry Rodewald <bsr@xnet.co.nz>
Date: Wed, Dec 23, 2009 at 2:37 AM
Subject: Yet more i386 fixes
To: submit@mamedev.org


Hi,

Here's two more small i386 fixes.

First, is an implementation of the LSL protected mode instruction.
While it's far from perfect (ie: it doesn't check for anything other
than a null segment selector), it does help get a little bit further
for some FM Towns applications.

Second, is a fix for the REP instruction when used with a segment
prefix.  Essentially, it reverses the use of the segment_override and
segment_prefix variables compared to other instructions.  This fixes
sprite data copied into sprite RAM on the FM Towns version of Raiden
Trad.

Thanks,
Barry Rodewald
mailto:bsr@xnet.co.nz
2009-12-23 17:53:33 +00:00
Aaron Giles
de3ffd84b3 Removed old index-based DISCRETE_ADJUSTMENT, and renamed
DISCRETE_ADJUSTMENT_TAG to replace it. Updated all callers.

Removed input_port_by_index, as it is no longer needed.
2009-12-23 17:23:51 +00:00
Aaron Giles
6f4ff3c823 Moved machine->gfx initialization out of the video module and
into drawgfx. We now call this before devices are initialized,
so that devices can dynamically append to the machine->gfx as
needed.
2009-12-23 17:15:41 +00:00
Aaron Giles
201ea424db Get rid of explicit resource tracking for state saving. Now we just use
the auto_ allocators, since registration is restricted to initialization.
2009-12-23 16:44:55 +00:00
Aaron Giles
680184085a Added "new" command -listdevices (or -ld) to list the devices attached
to a driver. I notice that MESS has a command with the same name; hopefully
the behaviors can be combined eventually.
2009-12-23 16:37:09 +00:00
Aaron Giles
caf41f8f39 Fixed recent regression reports.
Converted rtc65271 to a device.
2009-12-23 16:16:12 +00:00
Aaron Giles
7eace0d29e EEPROM device now looks for a matching memory region to fetch the
default values from. Fixed bug in ROM loader that would change the
memory region flags to match devices with no address bus. Updated
groundfx to use the new default loading scheme.
2009-12-23 06:06:20 +00:00
Aaron Giles
953ef60d7b Quick cleaning of eepromdev. 2009-12-22 15:33:36 +00:00
Fabio Priuli
ff7213f6f1 Added save states to ics2115 sound device
Added driver data struct and save states to psikyo.c and pgm.c

Added driver data struct to psikyo4.c and psikyosh.c
2009-12-22 14:49:27 +00:00
Phil Bennett
2434ce3fab Eliminated the use of generic.colorram and generic.videoram in several drivers [Atari Ace]
---------- Forwarded message ----------
From: Atari Ace <atari_ace@verizon.net>
Date: Mon, Dec 14, 2009 at 5:43 AM
Subject: [patch] Eliminate generic.colorram
To: submit@mamedev.org
Cc: atariace@hotmail.com


Hi mamedev,

generic.colorram and generic.videoram are unused by the MAME core, and
are simply slots convenient for driver use.  As such, the drivers are
better off using their own driver_data slots for these.  To discourage
further use of colorram, this patch eliminates all current uses of it,
and the uses of videoram as well in the affected drivers.  This is
partially a retrograde step, since ideally we'd like to introduce the
driver_data structs as well for these drivers, but eliminating
colorram and disentangling the various uses of generic makes it on the
balance an improvement IMHO.

~aa
2009-12-21 23:26:32 +00:00
Phil Bennett
685bac3770 Removed deprecated core function decodegfx() [Christophe Jaillet]
---------- Forwarded message ----------
From: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Date: Mon, Dec 14, 2009 at 9:56 PM
Subject: Removal of a deprecated function
To: submit@mamedev.org


Hi,

a function in "drawgfx.c" is declared in "deprecat.h"
This function ("decodegfx(...)") is not used any more in the code, so it
could be removed.

Hope this help.
Best regards,

CJ
2009-12-21 16:32:45 +00:00
Aaron Giles
ead42740ca And some more. Converted the ds2404 to a device along the way. 2009-12-21 16:10:00 +00:00
Aaron Giles
a9697769d9 A few more fixes. 2009-12-21 10:06:40 +00:00
Aaron Giles
90c6e390f0 2nd batch of initialization cleanups. 2009-12-21 08:34:28 +00:00
Aaron Giles
d0af9ba1e8 First round of fixes for post-initialization allocs.
In the process, converted 7474, 74148, and 74153 to
devices.
2009-12-20 23:57:25 +00:00
Aaron Giles
30d57e3f48 Minor drc improvments:
- simplified RSP's misaligned memory accesses
 - removed now-unnecessary shifts from direct memory accesses in
    mips3/powerpc drcs
 - optimized AND with 0xff/0xffff/0xffffffff cases for x86/x64
 - added rudimentary memory/register tracking in x86 backend to
    remove redundant loads
2009-12-20 15:21:26 +00:00
Couriersud
c58957452c Fix 64-bit compile 2009-12-19 23:37:21 +00:00
Phil Bennett
b1293d18ac Fix crash in tilemap viewer when driver has no tilemaps (no whatsnew) 2009-12-19 14:28:22 +00:00
Phil Bennett
123f4decc7 Fixed NULL pointer dereference in tilemap_set_flip_all() when game has no tilemaps (no whatsnew) 2009-12-19 14:04:10 +00:00
Aaron Giles
c3fb047204 Added new profiler bucket for DRC recompilation.
Removed a number of extraneous sign extensions from the RSP DRC.
2009-12-19 08:50:34 +00:00
Ryan Holtz
2e65d4a968 RSP recompiler improvements / optimizations: [Harmony]
- Split SATURATE_ACCUM into a signed and unsigned version to reduce stack usage.
 - Corrected an issue with the 0h variants of VMRG, VAND, VNAND, VOR, VNOR, VXOR and VNXOR.
 - Slightly optimized unaligned reads and writes
 - Optimized unaligned dword reads
 - Corrected an issue where badly-written RSP programs could jump to invalid addresses
2009-12-18 23:14:19 +00:00
Miodrag Milanovic
ef4d608713 SCMP assert fix (No whatsnew is needed) 2009-12-18 11:55:30 +00:00
Aaron Giles
e6e51ca4bc Fix MSVC warning. 2009-12-18 06:41:20 +00:00
Ryan Holtz
0534f875b9 Fixing the RSP disassembler, no whatsnew. 2009-12-17 02:18:15 +00:00
Ryan Holtz
f9045e7268 [RSP] Preliminary RSP recompiler, with all vector ops stubbed out to C functions for now. [Harmony] 2009-12-16 23:26:58 +00:00
Curt Coder
3dde298da4 CIA6526: fixed FLAG handling 2009-12-16 12:11:52 +00:00
Curt Coder
ff5c33c8d1 CIA6526: slight interface cleanup 2009-12-15 12:36:38 +00:00
Aaron Giles
f43747b221 Some misc cleanups:
- added warning messages for auto_malloc, timer, and save state
    allocations done after init time. These should be fixed when
    detected, as I would eventually like to disallow them entirely.
 - changed state registration functions to pass through the caller's
    file and line number to facilitate fixing the above warnings
 - converted Taito F3 sound to a separate machine driver which is
    imported into games that use it
 - converted the balsente driver to driver_data structure
 - converted harddriv timers into devices
 - fixed crash in cps2 games due to not configuring the qsound bank
 - cleaned up initialization in taito_l to allocate at init time
    instead of reset time
2009-12-15 02:37:46 +00:00
Aaron Giles
c1c28e486b Fix crash on exit for systems with no tilemaps. 2009-12-15 00:28:30 +00:00
Fabio Priuli
f2a4c06f27 Misc Konami updates:
* moved k056800 sound device to emu/sound and removed the old code (mame/machine/konamiic.c )
* updated gticlub.c, hornet.c, nwk-tr.c, ultrsprt.c and zr107.c to use this implementation
* fixed various small (and not so small) problems in konicdev.c
* as a result Konami 007342, 007420, 052109, 052160 and 051316 devices are now working and 88games.c, battlnts.c, bladestl.c and rockrage.c have been updated to use them
2009-12-14 17:58:20 +00:00
Aaron Giles
eb025378a9 Fix tilemaps so they can be initialized at device start time. 2009-12-14 07:33:54 +00:00
Fabio Priuli
5424444497 Added SET_TILE_INFO_DEVICE to tilemap.h (it should be correct) 2009-12-14 01:15:48 +00:00
Aaron Giles
8bccdbd5cc Enhanced the UML opcodes for LOAD, LOADS, and STORE to support
arbitrary scaling factors. Previously, specifying a size implied
a scaling factor equal to the size (i.e., specifying DWORD meant
the index was scaled by 4). This is still the default. However,
now you can specify the scale explicitly for other cases. For
example, you can specify DWORD_x1 to fetch a DWORD but don't
scale the index at all, or BYTE_x8 to fetch a BYTE while scaling
the index by 8. Updated all backends to make this work.
2009-12-13 20:01:26 +00:00
Fabio Priuli
8bdb970d1d Made MB14241 Shifter IC a device and moved its source to emu/machine. Updated mw8080bw.c and 8080bw.c accordingly. Also converted fgoal.c to use this implementation in place of its own version. 2009-12-13 12:03:51 +00:00
Fabio Priuli
4d2eba9882 Added TILE_GET_INFO_DEVICE macro to tilemap.c
Added driver data struct and save states to malzak.c
2009-12-13 11:59:35 +00:00
Fabio Priuli
9ccef5fb60 Imported SAA5050 emulation from MESS and made it a device. Updated malzak.c to use it, removing the almost identical implementation in the driver.
Out of whatsnew: Unfortunately, I was unable to make both malzak and p2000t (in MESS) to work without a small kludge, clearly documented in the source. I plan to further investigating the problem once I manage to merge the other 505x variants (later)
2009-12-12 18:22:43 +00:00
Aaron Giles
26ef740b4b Fix MT03444. Global arrays are now included once again in the memory view.
ALso changed the memory views to determine the list of subviews at
creation time, not init time, allowing for new stuff to appear later.
2009-12-12 08:52:16 +00:00
Fabio Priuli
66f8650aac misc small updates:
* added saves to 6522via.c. this fixes problems of gameplan.c and trvquest.c games with -autosave
* added driver data struct and save states to toratora.c and sf.c
* enable GAME_SUPPORTS_SAVE flag to dday.c because some of the core changes have fixed the sound problem at loading
* added a couple of comments about header inclusions
2009-12-11 23:59:11 +00:00
Fabio Priuli
fe3420b40f Fixed stupid copy&paste mistake in s2636.c
This is what you get when you forget to press save before the commit :(
2009-12-11 18:20:35 +00:00
Aaron Giles
40bcc29e8a Cleanups and version bump. 2009-12-11 06:19:46 +00:00
Fabio Priuli
dcd164adc7 Converted Signetics 2636 video chip to be a MAME device and updated drivers using it accordingly
Also, added driver data struct and save states to laserbas.c, laserbat.c, lastfght.c, lazercmd.c and lemmings.c

Finally, added driver data struct to lasso.c
2009-12-11 01:34:38 +00:00
Aaron Giles
64a35dfe95 Added tilemap_create_device() function which lets you create a tilemap
from within a device, and be passed that device in your callback.
2009-12-10 15:42:56 +00:00
Aaron Giles
8ba04b825a Apply mirrors and global masks at address map detokenizing time rather
than later. Also added disabled code to detect address maps with
overlapping regions for future analysis.
2009-12-10 15:32:44 +00:00
Phil Bennett
907c61c43e i386 core improvements: [Barry Rodewald]
* Fixed EIP displacement when executing FPU instructions with no 80387 present
* Added 32-bit implementations of SLDT and STR


---------- Forwarded message ----------
From: Barry Rodewald <bsr@xnet.co.nz>
Date: Wed, Dec 9, 2009 at 2:02 AM
Subject: More i386 fixes
To: submit@mamedev.org


Hi,

Here's two more small fixes for the i386 core.

First, is FPU instructions used on 80386.  On a system without a
80387, FPU instructions should have no effect.  Part of the FM Towns
TBIOS (runs as an MS-DOS device driver, providing extra system
functions) initialises the FPU, and tries to detect it.  Upon hitting
the FSTCW instruction, though, it doesn't increase EIP enough when an
extra displacement byte is needed.  So, I've added a call to GetEA to
the escape() function (called when there is no FPU) which will fetch
the extra byte if necessary.

Second, is a 32-bit implementation of the SLDT and STR instructions.
Basically, I copied it from the 16-bit versions, and modified it to
use 32-bit registers.

Thanks,
Barry Rodewald
mailto:bsr@xnet.co.nz
2009-12-10 09:12:35 +00:00
Aaron Giles
a0375128a0 Fixed DMADAC wrapping behavior. [Tim Schuerewegen] 2009-12-09 15:40:16 +00:00
Aaron Giles
e349350227 Converted atari drivers over to using driver_data for the most
part. Some shared systems still exist with globals, but this
tackles the atarigen module and the variables local to each
driver.

Also added validity check that AM_BASE_MEMBER and AM_SIZE_MEMBER
items point within the bounds of the driver_data structure.
2009-12-09 15:34:23 +00:00
Phil Bennett
c8608dcc22 Cleaned-up several drivers; added missing prototypes and removed dead ones,
marked non-exported functions as static and removed cases of #include "deprecat.h" [Atari Ace]

---------- Forwarded message ----------
From: Atari Ace <atari_ace@verizon.net>

Date: Sat, Dec 5, 2009 at 7:18 AM
Subject: [patch] Header cleanups
To: submit@mamedev.org
Cc: atariace@hotmail.com

Hi mamedev,

This patch improves the quality of the mame driver headers, by adding
missing prototypes and source comments, removing dead prototypes, and
marking some non-exported functions as static within the drivers.  It
also eliminates about a dozen cases of #include "deprecat.h".

~aa
2009-12-08 14:54:29 +00:00
Phil Bennett
54570e176e Fixed srcclean handling of embedded comments within strings [Atari Ace]
(Update of r7501)

---------- Forwarded message ----------
From: Atari Ace <atari_ace@verizon.net>
Date: Sun, Dec 6, 2009 at 5:51 PM
Subject: [patch] srcclean bugfix
To: submit@mamedev.org
Cc: atariace@hotmail.com


Hi mamedev,

My srcclean changes to track C-style quotes didn't handle all the
special cases correctly (for instance, '\"' and "\\\"").  This fixes
it, and adds some /* ... */ to m68k_in.c so that src2html.exe does a
better job on it.

~aa
2009-12-07 11:13:54 +00:00
Aaron Giles
fd34a32091 Added new functions:
memory_install_ram() to assign a un-named bank to a region and specify
    a pointer to where the RAM lives. If this is called in the DRIVER_INIT
    function or MACHINE/SOUND/VIDEO_START functions, then it is permissible
    to specify NULL, in which case the memory system will allocate memory
    and register it for save states.

  memory_install_rom() is like the above except that it only installs a
    read handler.

  memory_install_writeonly() is like the above except that it only installs
    a write handler.

Updated several instances in the code that were assigning banks to these
sorts of static RAM regions and simplified the code.

Also fixed several regressions reported by Tafoid.
2009-12-07 08:32:02 +00:00
R. Belmont
c165519e07 Fix 64-bit issue noted by Juergen. 2009-12-06 17:30:10 +00:00
Aaron Giles
98484d44b0 Internal memory system shuffling. Address maps initialized internally
now call the same installation handlers that drivers do for dynamic
installation. Cleaned up some parameter ordering and error detection.
2009-12-06 08:18:34 +00:00
smf-
0be7db3893 replaced char * pointer comparison with strcmp. 2009-12-06 02:19:12 +00:00
smf-
2c3c41b08f fixed compiling after share were changed to a tag, not tested if this is the correct behaviour. 2009-12-06 02:03:29 +00:00
Aaron Giles
0fd8c755ff Memory shares are now specified by tag instead of index.
The AM_SHARE() macro now takes a tag parameter. All existing
shares have been bulk renamed to "share##". However, the name
does not matter, so please use descriptive tags going forward.

Also added tag validation for bank and share tags.

Added flag to tagmap_add functions that optionally will
replace existing objects if a duplicate is found.
2009-12-05 20:19:04 +00:00
Aaron Giles
ee315fe99d Renamed functions:
memory_install_read/write_port_handler -> 
        memory_install_read/write_port

   memory_install_read/write_bank_handler -> 
        memory_install_read/write_bank
2009-12-05 07:59:31 +00:00
Aaron Giles
9eda9e163e More memory system cleanup. Removed SMH_* macros entirely. In
their place are a series of expanded macros and new memory
installation helpers. Some mappings below (not all are new):

   AM_READ(SMH_RAM)                       -> AM_READONLY
   AM_WRITE(SMH_RAM)                      -> AM_WRITEONLY
   AM_READWRITE(SMH_RAM, SMH_RAM)         -> AM_RAM
   AM_READ(rhandler) AM_WRITE(SMH_RAM)    -> AM_RAM_READ(rhandler)
   AM_READ(SMH_RAM) AM_WRITE(whandler)    -> AM_RAM_WRITE(whandler)
   AM_DEVREAD(tag, rhandler) AM_WRITE(SMH_RAM) 
                                  -> AM_RAM_DEVREAD(tag, rhandler)
   AM_READ(SMH_RAM) AM_DEVWRITE(tag, whandler) 
                                  -> AM_RAM_DEVWRITE(tag, whandler)

   AM_READ(SMH_ROM)                       -> AM_ROM
   AM_WRITE(SMH_ROM)                      -> (was a no-op)

   AM_READ(SMH_NOP)                       -> AM_READNOP
   AM_WRITE(SMH_NOP)                      -> AM_WRITENOP
   AM_READWRITE(SMH_NOP, SMH_NOP)         -> AM_NOP

For dynamic memory handler installation of the various types,
use the new functions:

   memory_unmap_read()
   memory_unmap_write()
   memory_unmap_readwrite() -- unmaps a section of address space

   memory_nop_read()
   memory_nop_write()
   memory_nop_readwrite() -- nops a section of address space

Cleaned up the internals of the address_map_entry structure, and
also normalized the way the address map macros work to remove a
lot of redundancy.
2009-12-05 07:54:11 +00:00
Aaron Giles
0069237f20 Memory banks are now referenced by tag rather than index.
Changed all memory_bank_* functions to specify a tag.
Bulk-converted existing banks to be tagged "bank##" in
order to ensure consistency. However, going forward, the
tags don't matter, so please name them something useful.

Added AM_BANK_READ/AM_BANK_WRITE macros to let you specify
bank tags. Also changed AM_ROMBANK and AM_RAMBANK macros to
accept tags as well.

Added new functions memory_install_read_bank_handler and
memory_install_write_bank_handler to install banks by tag
name, similar to input ports.

Changed internals of memory system to dynamically allocate
all banks. The first time a bank with an unknown tag is
installed, a new bank object is created and tracked 
internally. Removed all SMH_BANK(n) references outside of
the main code; these should never, ever be useful anymore.
2009-12-03 08:16:38 +00:00
Jonathan Gevaryahu
5dffcb6c6c mostly resolved mix of intel and motorola notation in tms32025 disassembler 2009-12-02 15:32:57 +00:00
R. Belmont
8bc10109ca One more Clang warning fix.
Anyone who's ever been confused by the meaning of a given GCC or MSVC error diagnostic will enjoy this (it's color-coded in real life for added "wow"):

src/emu/memory.c:2148:5: error: comparison of distinct pointer types ('genf *' and 'void *')                                                           
                                check_entry_handler(write);                                                                                            
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                             
src/emu/memory.c:2052:63: note: instantiated from:                                                                                                     
        if (entry->handler.generic != NULL && entry->handler.generic != SMH_RAM) \                                                                     
                                              ~~~~~~~~~~~~~~~~~~~~~~ ^
2009-12-02 03:51:45 +00:00
Fabio Priuli
0180f1b0a8 > Subject: Fix for cp1610 cpu
>
> The cp1610 CPU is only used by the Intellivision (in MESS). However the
> disassembler produces garbage. Also I noticed a tiny error in the CPU
> itself.
>
> Here are the fixes:
>
> Firstly, the CPU, a one-line change. In cp1610.c, at line 3515, you may
> notice that 2 flags are sharing the same bit. Please change the V flag
> to
> use 0x20 (instead of 0x10). That's all there.
>
> Next, the disassembler. It assumes oprom to be 16 bits when in fact it
> is 8.
> I could not see a way of specifying the size of oprom, so assuming it
> is
> always 8 bits. If that's the case, please replace 1610dasm.c with the
> enclosed one.
>
> Thanks and have a great day :)
>
> - Robbbert
2009-12-01 10:56:41 +00:00
Phil Bennett
0cd4d21890 Converted cabal, mappy, toypop and zaxxon to use driver_data structure [Atari Ace]
---------- Forwarded message ----------
From: Atari Ace <atari_ace@verizon.net>
Date: Sun, Nov 29, 2009 at 3:28 AM
Subject: [patch] Convert cabal/mappy/toypop/zaxxon to use driver_data
To: submit@mamedev.org
Cc: atariace@hotmail.com


Hi mamedev,

This patch is a resubmit of my earlier patch to have mappy and zaxxon
store their state in driver_data.  It extends the patch to toypop
(which uses some mappy code), and also converts cabal which I also did
some time ago.  cabal.h and toypop.h are new header files.

~aa
2009-12-01 10:56:22 +00:00
Curt Coder
dc5bb22a05 Changed CDP1869 PAL/NTSC signal to use devcb. 2009-12-01 09:04:13 +00:00
R. Belmont
5dc02c1d32 Fix assert on valid 68k variant. (no credit necessary) 2009-12-01 01:41:41 +00:00
Aaron Giles
b5c3081f3e Cleanups and version bump. 2009-11-30 01:46:32 +00:00
Aaron Giles
93671925bd Memory regions now use a tagmap for lookups. 2009-11-30 00:48:31 +00:00
Aaron Giles
6895fc3b66 Added AM_BASE_SIZE_MEMBER() macro for specifying both base and size
structure members at once. Updated all cases where this could be
used.
2009-11-28 19:41:12 +00:00
Aaron Giles
90560a421d From: Atari Ace <atari_ace@verizon.net>
Date: Sat, Nov 28, 2009 at 5:49 PM
Subject: [patch] Eliminate spriteram3
To: submit@mamedev.org
Cc: atariace@hotmail.com


Aaron's patch to move the generic pointers into machine conflicts with
a patch I'd worked on some time ago to start eliminating those globals
altogether, so I've become motivated to finally submit it ;-).  This
patch eliminates spriteram3, which unlike the other spriteram
variables, is only a convenience for some drivers.

~aa
2009-11-28 19:33:18 +00:00
Phil Bennett
a6dc556396 Fixed i386 REP prefix to use segment:SI when address size is 16-bit (ie: when using OUTSB or OUTSW). [Barry Rodewald]
---------- Forwarded message ----------
From: Barry Rodewald <bsr@xnet.co.nz>
Date: Sat, Nov 28, 2009 at 6:55 AM
Subject: Another i386 fix
To: submit@mamedev.org


Hi,

Small fix this time.  This fixes an issue with the FM Towns version of
MS-DOS where it was feeding nonsense parameters to the CD-ROM
controller.  MS-DOS uses REP OUTSB to send the parameters, and I
noticed that the expected data was not what was sent to the I/O port.
Looking at the i386 code, I saw that it always used segment:ESI,
regardless of address size.  This fix makes it use segment:SI when
address size is 16-bit (ie: when using OUTSB or OUTSW).

Patch is based on 0.135u1.

Thanks,
Barry Rodewald
mailto:bsr@xnet.co.nz
2009-11-28 18:26:43 +00:00
Aaron Giles
5e643c1251 Purged remaining globals from video/generic.c and audio/generic.c 2009-11-28 08:31:22 +00:00
Aaron Giles
6bfe172c78 Removed global videoram, colorram, paletteram, and spriteram.
Added equivalent pointers to machine->generic. Updated all
references.

Now that accessing these is more awkward, it is probably best
to put these pointers in the driver data structures instead
of using the generic pointers. The main reason to continue
using generic pointers is to allow use of paletteram shortcuts
and buffered spriteram handling.
2009-11-28 03:06:46 +00:00
Curt Coder
abb8ad1fb6 Actually use the speaker interface if provided. 2009-11-27 13:11:19 +00:00
Curt Coder
a2e82426fe Intel 8255A: clear input latch after reading it 2009-11-27 13:10:50 +00:00
Aaron Giles
cdd9d7c757 Introduced a generic_pointers structure within machine that is
designed to hold generic pointers that are commonly used. For
now, only generic_nvram has moved there. Added AM_BASE_GENERIC
and AM_SIZE_GENERIC macros for initializing generic pointers
in memory maps. Also added AM_BASE_SIZE_GENERIC to set both
base and size in one step.

Moved global variables out of machine/generic and into a private
data structure hanging off of the running_machine. Added newly-
needed machine parameters to coin_counter_w, coin_lockout_w, and
coin_lockout_global_w. Also added machine parameter to 
set_led_state.

Added interface functions to get the number of dispensed tickets
and to increment the count, to remove the need for direct access
to these global variables. Also added functions to get the
current count on a particular coin counter and to determine the
lockout state.

Future checkins will move the remaining generic pointers (for
paletteram, videoram, spriteram, colorram, etc.) into the new
generic_pointers structure.
2009-11-26 23:43:19 +00:00
smf-
4f90eda49b DEVCB_INPUT_PORT(tag) can be used for write callbacks. 2009-11-26 17:25:09 +00:00
Miodrag Milanovic
149c6aa7ca CF clear after binary operations on Intel 8008 CPU core 2009-11-26 09:37:12 +00:00
Aaron Giles
409223e919 Switched from linear interpolation to antialiased point sampling
when upconverting low-frequency sound streams. This should
de-muffle low-frequency streams, treating them has having
hard edges at sample boundaries.
2009-11-25 14:41:09 +00:00
Curt Coder
f47855ec04 CDP1869 changes:
- converted page RAM functions to use devcb
- added pull interface for predisplay
2009-11-25 11:15:10 +00:00
smf-
8836834f08 added memory_install_write_port_handler & memory_install_readwrite_port_handler to be consistent with installing handlers. 2009-11-25 09:48:44 +00:00
smf-
2877513af1 Hooked up eepromdev.c using PORT_READ_LINE_DEVICE/PORT_WRITE_LINE_DEVICE in groundfx.c.
Output ports are now affected by IP_ACTIVE_HIGH/IP_ACTIVE_LOW (eepromdev.c has active low cs).
The previous value for callbacks in inptport.c is now tracked per field. This saves recalculating it for PORT_CHANGED & conditional fields wouldn't always get updated correctly.
Tidied up eepromdev.c interface.
2009-11-24 12:05:35 +00:00
Ryan Holtz
603ebf6ac7 (from MESS) Added support for SCSI command 0x2a (Write w/ 32-bit LBA), upped input buffer size in WD33C93 controller [Harmony] 2009-11-23 23:29:56 +00:00
R. Belmont
c80aaff52c Fixed GCC compile error in SC/MP.
I assumed the as-edited line was the intent of the code, if not Micko will need to fix it :)
2009-11-23 17:44:36 +00:00
R. Belmont
e76480c990 Fixed 64-bit GCC build. 2009-11-23 17:28:24 +00:00
Miodrag Milanovic
7b1aa92c4d INS 8060 SC/MP II support (using clock divider 2), main model renamed to INS 8050 SC/MP 2009-11-23 11:19:15 +00:00
Miodrag Milanovic
d98fa09e1f Added Intel 8008 and National Semiconductor SC/MP CPU cores 2009-11-23 08:19:29 +00:00
Aaron Giles
9072c7f911 Added new module tagmap which is a simple hashed string map.
Updated device and input port lists to use the tagmap for
tag searches. Also removed the whole "quark" thing from the
validity checker in favor of using the tagmaps.
2009-11-23 04:55:26 +00:00
Fabio Priuli
1847675e7f Added nodefault eeprom macro for 93c46 and 93c66b eeprom device (not worth any credits) 2009-11-21 23:44:29 +00:00
smf-
7a3cc980ed added set name to -romident 2009-11-21 12:00:38 +00:00
smf-
dd1d8777a9 added device support to the input system. internally this replaces PORT_CUSTOM/PORT_CHANGED, backward compatibility is achieved with an internal dummy device.
added output lines (IPT_OUTPUT), which can be written using new input_port_write* functions or directly from a memory map using AM_WRITE_PORT
converted adc083x to use io lines.
adc08x chips are all hooked up using input/output ports
reversed racing force steering wheel input and gas pedal, which is enough to get the game to boot.
reversed steering wheel input on winding heat, the usa cabinets are however hooked up the other way.
renamed adc0831_interface to adc083x_interface.
fixed adc083x gnd input
removed stray call logerror from adc083x.c
fixed default adc083x sars value
adc083x reset only affects outputs
2009-11-20 22:36:52 +00:00
Wilbert Pol
bcd6cff1fe tms7000: Fixed disassembly of PCREL addressing mode. 2009-11-20 18:53:06 +00:00
Aaron Giles
f0cdba5b11 Cleanups and version bump. 2009-11-20 06:50:40 +00:00
Wilbert Pol
d28c77d4fb Added missing sound type check. 2009-11-19 19:31:04 +00:00
Aaron Giles
cf62f4e8bc Put minimum tag length back to 2 characters for now. 2009-11-19 05:34:46 +00:00
Aaron Giles
ad062c9e43 Fix TLBMOD exceptions so they also properly set BadVAddr. 2009-11-18 15:46:52 +00:00
Fabio Priuli
ea72b5770d Added tentative PORT_CUSTOM(eepromdev_bit_r) for EEPROM devices.
Not 100% sure this is the better way to implement this (we pass the eeprom tag as parameter of the PORT_CUSTOM), but I haven't been able to find a better solution.

No driver uses this yet, so I'm open to any suggestion before to use it extensively ;)
2009-11-18 13:26:30 +00:00
Fabio Priuli
514c637bbe Added a MDRV_EEPROM_NODEFAULT_ADD macro for drivers which do not need default data size / data
I don't like too much this solution, but now the code is self contained: hence, better fixes (e.g. no MDRV_DEVICE_CONFIG_DATAPTR(eeprom_config, default_data, &_data) at all for the NODEFAULT eeprom?) could be added without further modifying the behavior across the drivers.
2009-11-18 12:56:36 +00:00
Jonathan Gevaryahu
2aa28ef3d9 fix crash bug 2009-11-18 08:56:19 +00:00
Jonathan Gevaryahu
3dbbc11f0d Got rid of R->OldNoise since it causes problems for gamegear/sms. Changed noise taps accordingly. Redid change to gamegear/sms for XOR vs XNOR, now verified by Justin Kerk. Verified gamegear noise taps thanks to sample provided by Justin Kerk.
Add stereo sound support to sn76496.c for gamegear. [Lord Nightmare, Justin Kerk]
2009-11-18 08:09:19 +00:00
Aaron Giles
693024974e Fix assertion in DRC. 2009-11-18 06:12:50 +00:00
Aaron Giles
aeca44b1ca Fix PowerPC 603 translation so it doesn't get stuck in an infinite
loop after the first fixup.
2009-11-17 15:43:06 +00:00
Aaron Giles
39957739fd Fix broken DRC logging. 2009-11-17 15:40:48 +00:00
Jonathan Gevaryahu
0a647b65c9 revert gamegear/sms psg change, was probably correct before, but need a better sample of the waveform to make sure. 2009-11-17 13:34:30 +00:00
Aaron Giles
ccefa6749d MIPS3 TLB fixes:
- fixed bug in vtlb code that caused us to lose track of previously
    registered fixed page ranges
 - fixed MIPS3 behavior that would not clear out invalid page ranges
    from the VTLB under certain circumstances
 - added support for TLB sizes less than 48 entries
2009-11-17 06:09:38 +00:00
Jonathan Gevaryahu
315b992f44 Add NCR7496 variant to sn76496.c
Switched the SMS and Game gear PSGs to use an XOR instead of XNOR feedback, but this needs further verification. Updated comments to show which chips are currently verified. Cleaned up comments.
2009-11-16 09:06:00 +00:00
Aaron Giles
19bf1b46ea MIPS3 TLB fixes:
- now properly generating TLB fill exceptions under correct circumstances
 - TLB exceptions no longer trash low 4 bits of Context
 - exceptions with the EXL bit set always go to vector 0x180
2009-11-16 06:45:54 +00:00
Jonathan Gevaryahu
a04f60c0f4 Fix screeching in regulus: When summing together four equal channels, the size of the max amplitude per channel should be 1/4 of the max range, not 1/3. oops. No idea when this bug is from, but its OLD. 2009-11-16 05:58:42 +00:00
Ryan Holtz
2a9387c49d Reverting bad fix 2009-11-16 02:45:46 +00:00
Ryan Holtz
4cef27ecc9 - Fixed Context usage and TLB exception vectors in the MIPS core [Harmony] 2009-11-16 00:04:37 +00:00