Commit Graph

476 Commits

Author SHA1 Message Date
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
R. Belmont
b53bb2c6ac SDLMAME initial import [R. Belmont, Couriersud] 2010-01-13 04:01:20 +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
Fabio Priuli
cbfecc9d6b Added driver data struct + save states to darius.c & othunder.c
Added driver data struct to ninjaw.c, slapshot.c, warriorb.c, wgp.c

There is still some TC0100SCN issue when reloading, which corrupts tilemap2, hence no save states in the latter drivers atm
2010-01-09 08:36:34 +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
Fabio Priuli
3b7a8c389c Misc Taito wip:
* added driver data struct to taito_l.c & opwolf.c

* added driver data struct + save states to asuka.c (cadash was not supporting saves), rainbow.c, rastan.c, taito_f2.c, taito_h.c, taito_o.c, taito_z.c, topspeed.c & volfied.c

not worth mentions:
* renamed a couple of megablst clones for consistency (as per stephh's remark)
* slightly changed tnzs RAM/ROM banks behaviour to avoid writes on ROM banks
2010-01-07 22:32:22 +00:00
Fabio Priuli
10b94ff0a7 added driver data struct to taitoair.c and taito_b.c
more taito drivers will follow...
2010-01-07 07:30:37 +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
Phil Bennett
f7e0c31d80 Metal Maniax improvements [Phil Bennett/luigi30]
* Fixed frame buffer display
* Started to add the other CPUs
* Added PCB layouts for layers 1 and 2
2010-01-06 20:37:21 +00:00
Fabio Priuli
2336b51f2f Forgot to commit these:
- added driver data struct & save states to gradius3.c
2010-01-06 11:38:48 +00:00
Fabio Priuli
005ca1d374 misc Konami wip:
* moved a few routines (used for sorting graphics layers) to konicdev.c since they are shared by several drivers

* added driver data struct to ajax.c and aliens.c

* added driver data struct + save states to: asterix.c, bishi.c, blockhl.c, bottom9.c, chqflag.c, crimfght.c, dbz.c,
gbusters.c, gijoe.c, lethal.c, mainevt.c, moo.c, overdriv.c, parodius.c, 
rollerg.c, rungun.c, simpsons.c, spy.c, surpratk.c, tail2nos.c, thunderx.c, 
tmnt.c, ultraman.c, vendetta.c, xexex.c and xmen.c

* updated some Konami drivers above to separately allocate palette/extra/work RAM instead of appending them to maincpu ROM; also, reduced maincpu rom regions where appropriate

* replaced memory_set_bankptr with memory_set_bank where necessary
2010-01-05 23:24:07 +00:00
Angelo Salese
e0b72fd796 new not working
---------------

Monza GP [Tomasz Slanina]

================================

roms at current/m/monzagp.zip
2010-01-04 19:37:50 +00:00
Angelo Salese
113e36effd new not working
---------------

Vega [David Haywood]

================================

roms at current/v/vega.zip
2010-01-04 16:40:47 +00:00
Phil Bennett
aba256db9a Converted the goldstar, liberate, sidearms and sidepckt drivers to use driver_data [Atari Ace]
---------- Forwarded message ----------
From: Atari Ace <atari_ace@verizon.net>
Date: Fri, Jan 1, 2010 at 5:27 PM
Subject: [patch][resubmit] Convert goldstar/liberate/sidearms/sidepckt
to use driver_data
To: submit@mamedev.org
Cc: atariace@hotmail.com


Hi mamedev,

This is a resubmit of my last driver_data patch.  It should be
non-controversial, although it contains some additional whitespace
cleanup in the affected files.

~aa
2010-01-03 17:03:27 +00:00
Aaron Giles
09d0cb8e12 Rename taiicdev.* -> taitoic.* 2009-12-30 03:28:44 +00:00
Aaron Giles
c05d24eb38 Delete old taitoic.* 2009-12-30 03:26:48 +00:00
Ryan Holtz
dc8b59fa8d Optimized RDP implementation further with more flattened branches. [Harmony] 2009-12-28 10:34:33 +00:00
Angelo Salese
c91275ca17 new clones
-----------

Spark Man (v 2.0, set 2) [Stefan Lindberg] (Not Working)


New not working
---------------

Race Drivin' Panorama
Metal Maniax
2009-12-28 00:49:59 +00:00
Aaron Giles
86a9e3e217 Rename eepromdev.c/h back to eeprom.c/h 2009-12-27 23:20:05 +00:00
Aaron Giles
ccc24c02f1 Remove old eeprom implementation. 2009-12-27 23:11:58 +00:00
Fabio Priuli
479c405c79 Misc Taito stuff:
* split I/O devices from video ones
* converted all taito drivers to use these I/O devices
* removed old I/O code from taitoic.c
* added preliminary tc0180vcu video device
2009-12-27 22:14:54 +00:00
Fabio Priuli
53f2a873a2 Added preliminary device version of Konami video ICs used in PowerPC games (001005, 001006, 001604 and 037122).
Added preliminary device version of Taito custom video ICs.
2009-12-26 02:02:17 +00:00
Angelo Salese
f64aa7e017 Basic driver for Cycle Mahbou 2009-12-24 17:17:17 +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
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
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
Ryan Holtz
9f1f17d6cd Forgot a few files. 2009-12-20 20:34:01 +00:00
Ryan Holtz
7ab8a6d8f6 More RDP optimization through branch flattening. [Harmony] 2009-12-20 20:12:04 +00:00
Ryan Holtz
d47b36dae1 Optimized N64 RDP renderer by using function pointers to function variants that eliminate costly branches. [Harmony] 2009-12-20 01:10:21 +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
Fabio Priuli
dc96a004e6 some more Konami work (again):
* fixed 053936 init which was giving problems to f1gp2 (in debug build only, apparently)

* removed banptr preventing proper save states in rockrage.c: now save works fine

* added driver data struct and saves states to f1gp.c, fastlane.c, flkatck.c, hcastle.c, labyrunr.c and suprslam.c
2009-12-16 21:59:36 +00:00
Fabio Priuli
334c553890 some more Konami wip:
* fixed 056832 device start order to avoid wrong settings for layer 0. updated asterix.c and moo.c to use the device implementation now that it's working correctly.

* added driver data struct to 88games.c, combatsc.c and rockrage.c

* added driver data struct and save states to battlnts.c, bladestl.c, crshrace.c and contra.c

* renamed combasc to combatsc now that clones can have longer names
2009-12-16 10:47:22 +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
Fabio Priuli
bf07322216 Added preliminary device versions of all the Konami custom ICs currently emulated in machine/konamiic.c and video/konamiic.c.
In particular, device-fied Konami 007121, 051733 and 053251 work fine and combatsc.c, contra.c, crshrace.c, f1gp.c, fastlane.c, flkatck.c, hcastle.c, labyrunr.c and suprslam.c have been converted to use the new code.


Side notes: 
* chips which have their own tilemap in MAME (e.g. 056832 and 052109) are not working yet, and other chips cannot be fully tested because they're used together with these... it's still wip
* some cleanup is in order (especially for interfaces), once I get the remaining chips to working state
* converting the drivers above, I noticed that f1gp2 was only using half of the k053936 regs: this is now fixed and, even if I don't know of any visible improvements, now there are definitely less unmapped writes logged by the debugger ;)
2009-12-14 01:32:51 +00:00
Fabio Priuli
d8e3212c7b Added driver data struct to 8080bw.c and mw8080bw.c. Also merged the .h files. 2009-12-14 01:17:45 +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
30e421aac2 Added driver data struct to cvs.c
Added driver data struct and save states to: cbasebal.c, chinsan.c, mitchell.c and quasar.c


Not to be mentioned: I also removed use of memory_set_bankptr from CPS1 sound banking and renamed a couple of rallyx.c constants to be less generic
2009-12-12 19:03:40 +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
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
72d156a858 of course, you could not compile without these files ;) 2009-12-11 10:54:02 +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
Fabio Priuli
4a396461b3 Added driver data struct and save states to the following drivers:
ladybug.c, ladyfrog.c, lastduel.c, lwings.c, redclash.c and yunsung8.c
2009-12-10 14:22:37 +00:00
Fabio Priuli
637085584b Added driver data struct and save states to the following drivers:
kangaroo.c, karnov.c, kchamp.c, kickgoal.c, kingobox.c, kncljoe.c, koikoi.c, kopunch.c, ksayakyu.c and kyugo.c
2009-12-09 23:42:28 +00:00
Fabio Priuli
3781da05a5 Added driver data struct and save states to jack.c 2009-12-09 14:10:54 +00:00
Fabio Priuli
eb9e1e53e5 Added common driver data struct to timeplt.c, tutankhm.c, junofrst.c, pooyan.c, rallyx.c and rocnrope.c (these drivers all use audio/timeplt.c). As a side effect, we now have save states in junofrst.c and rallyx.c.
Added driver data struct to jackal.c

out of the whatsnew, a couple of remarks: 
- rallyx and nrallyx might require a separate driver data struct to deal with namco_soundregs, but I'll take care of this eventually (if really needed)
- jackal does not properly save the work ram banks atm, hence no SUPPORTS_SAVE flag, but I keep looking for a clean solution to the problem
2009-12-09 14:09:22 +00:00
Fabio Priuli
970edeb987 Added driver data struct to ironhors.c 2009-12-09 00:46:57 +00:00
Fabio Priuli
0c3290533f Added save states and driver data struct to the following drivers: fromance.c, fromanc2.c, ikki.c, imolagp.c, inufuku.c
Added driver data struct to pipedrm.c and added devices to gameplan.c driver data struct (to remove a few cputag calls)

Also, removed a couple of memory_set_bankptr that I had forgotten (buggychl.c & homedata.c)
2009-12-09 00:45:33 +00:00
Fabio Priuli
d1a758c12a Added save states and driver data struct to glass.c & homedata.c
Added driver data struct to hyprduel.c
2009-12-08 10:36:43 +00:00