Commit Graph

50 Commits

Author SHA1 Message Date
Aaron Giles
2d6453c98a Made the Z80 daisy chain aware of referencing device-specific devices.
Added preliminary LD-V1000 emulation. Not fully working yet, but mostly
there.

Cleaned up and normalized the three existing laserdisc emulations.
Removed obsolete code from the laserdisc core.
2008-10-09 05:31:15 +00:00
Aaron Giles
aa2b6bd29a Cleanups and version bump. 2008-09-11 16:25:46 +00:00
Aaron Giles
9b94257dc8 In addition to this patch, I fixed up the Atari System 1 BIOS handling
and added an empty BIOS driver for it.

Here is a patch file with the following changes:

* Added new Atari System 1 Motherboard BIOS dump from a LSI motherboard
* Added a new ROM dump from a Marble Madness LSI Cartridge
* Changed the hardcoded MHz values in the Cave driver to the XTAL
equivalents
* Updated the Cave driver for the game Guwange with gals that need to be
dumped
* Updated the Jail Break driver with the dip locations
* Corrected the Jail Break driver sound chip from a SN76496 to a SN76489
* Corrected the Jail Break rom names
* Redumped the Jail Break VLM rom dump
* Corrected the Super Basketball Revision H rom dump
* Updated the Super Basketball driver with the dip locations
* Corrected the Super Basketball VLM XTAL
* Corrected the Super Basketball parent/child relationships by making
the
Revision H the parent
* Turned on save state support for the Super Basketball driver
* Updated the Sega System 1 driver with more board information on the
Choplifter bootleg and updated the placeholders for the pals that need
to be
dumped
* Updated the WWF Wrestlefest driver rom names
* Added save state support to the WWF Wrestlefest driver
2008-09-11 15:37:34 +00:00
Aaron Giles
e647d9be1a Adjusted tags in drivers to meet conformity checks. Promoted checks to
full errors.
2008-09-10 06:24:46 +00:00
Aaron Giles
f5d90dac56 CPUs, sound chips, devices, and ROM-regions which are specified by devices
now have their tags auto-prefixed with the device's tag. This allows for
multiple instances to be present. For example, the PR-8210 laserdisc player
has a CPU with a tag of "pr8210". When it is included as a device by a
driver, the driver may tag the device "laserdisc". The resulting final
CPU tag name will be "laserdisc:pr8210". Also updated the debugger
expression engine to support names with embedded colons.

Added warnings to ensure that tags used for CPUs, sound chips, regions, and
devices follow some basic rules: they should be less than 12 characters long,
be all lower-case, and only contain letters, numbers, underscores, or dots
(no spaces). This is to ensure that they can be used properly in debugger
expressions and don't get too long or unwieldy to type (even 12 chars is a
bit long).
2008-09-08 03:05:09 +00:00
Aaron Giles
c0b1419a96 Added concept of rom sources to the rom loader. Updated auditing,
CLI utilities, validity checks, and ROM loading to use these new
functions so that device-specific ROMs are handled properly.
2008-09-06 22:17:37 +00:00
Aaron Giles
8c9f7cbc76 Added new device interface selector: DEVINFO_PTR_ROM_REGION. This allows a
device to provide a set of ROM regions to be loaded along with the game
ROMs. It is expected that most regions defined for devices will use the
ROMREGION_LOADBYNAME flag to enable the ROMs to live in a central location.

Added new device interface selector: DEVINFO_PTR_MACHINE_CONFIG. This allows
a device to specify a partial machine driver which is appended to the end of
the machine driver for any game using that device. The intention for this is
to allow devices which have their own BIOS logic to specify CPUs and other
characteristics common to all systems using the device.

Added new ROMREGION flag: ROMREGION_LOADBYNAME, which means that if the ROMs
in that region are not found in the usual driver files, then the name of the
region will be used as a driver filename for loading.

Extended the ldcore interface structure to allow each player type to provide
its own ROM region and partial machine driver.

Moved preliminary PR-8210 emulation code from ldplayer.c to ldpr8210.c. It
is currently disabled behind the EMULATE_PR8210_ROM compile time flag.
2008-09-06 06:36:32 +00:00
Aaron Giles
0523e9feb7 Cleanups and version bump. 2008-08-19 07:31:55 +00:00
Aaron Giles
719eca9c82 Added validity check to ensure that ports referenced by a condition
actually exist. Fixed a case where this was violated.
2008-08-19 05:12:45 +00:00
Aaron Giles
6c21097922 Added validity check to ensure that AM_READ_PORT() macros reference
valid ports. Fixed several cases where the check failed.
2008-08-19 04:33:19 +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
57bd1856b5 Cleanups/version bump. 2008-07-31 09:00:13 +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
4a6fc8d5e5 Region classes go bye-bye. 2008-07-28 16:22:20 +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
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
Aaron Giles
cc03405ca2 Cleanups and version bump. 2008-07-06 23:19:23 +00:00
Nathan Woods
697181c8cd Adding per-device and per-CPU validity checks 2008-07-06 15:02:12 +00:00
Aaron Giles
48332dea92 Added compile-time error if PTR64 is incorrectly set. 2008-06-05 09:41:02 +00:00
Aaron Giles
a5abe031ca It is now an actual error to have duplicate input bits. 2008-06-05 09:36:23 +00:00
Aaron Giles
67db0742f0 Added TOKEN_SKIP_* macros to tokenize.h.
Changed error reporting during input port detokenization to fill a buffer
rather than fatalerror-ing immediately. Should now properly skip over
any invalid tokens.

Enhanced error detection during input port detokenization to catch 
duplicate bits. There are a lot of these!

Updated initialization code to print errors and fatal only if the input
ports were unable to be constructed at all.
2008-05-25 21:24:19 +00:00
Nathan Woods
0a624c8f7a Updates from MESS in response to 0.125u2 2008-05-25 12:58:14 +00:00
Aaron Giles
d5ff8c002a Cleanups and version bump. 2008-05-22 05:19:16 +00:00
Aaron Giles
11b1331d3f Fixed incorrectly sized array that led to stack corruption during validity checks.
Fixes CPS1 no-start issue.
2008-05-22 05:04:14 +00:00
Aaron Giles
096331c856 Restructured input port internals and cleaned up inptport.c:
* Input ports are now maintained hierarchically. At the top
level are input ports, which contain a list of fields. Each
field represents one or more bits of the port. Certain fields
such as DIP switches and configuration switches contain a
list of settings, which can be selected. DIP switch fields
can also contain a list of DIP switch locations.

* Normalized behavior of port overrides (via PORT_INCLUDE or
by defining multiple overlapping bits). All fields within a
port are kept in strict increasing bit order, so altered DIP
switches are now kept in the appropriate order. This addresses
MAMETesters bug 01671.

* Live port state is now fully separate from configured 
state. This is manifested in a similar way to devices, where
a const list of ports can be managed either offline or live.
Each port has a pointer to an opaque set of live state which
is NULL when offline or valid when live. Each port also has
a running_machine * which is also NULL when offline.

* Because of this new arrangement, the conversion from tokens
to a list of ports now requires reasonably complex memory
allocation, so these port lists must be explicitly allocated
and freed (they are not mantained by automatic resource
allocation).

* Custom and changed callbacks now take a pointer to a field
config instead of a running machine. This provides more
information about what field triggered the change notification.
The machine can be found by referenced field->port->machine.

* The inptport.c module has been cleaned up and many 
ambiguities resolved. Most of this is internal, though it did
result in osd_customize_inputport_list() being changed to
osd_customize_input_type_list(). The parameter to this function
is now a linked list instead of an array, and the structures
referenced have been reorganized somewhat.

* Updated config.c to pass machine parameters to its callbacks.

* Updated validity checks, XML output, and UI system to handle
the new structures.

* Moved large table of default input settings to a separate
include file inpttype.h.

* Removed gross hacks in trackfld and hyperspt NVRAM. These
may be broken as a result.
2008-05-15 16:25:03 +00:00
Wilbert Pol
446e65fb98 Changed the inline validity checks to work around GCC bug #35885. 2008-04-19 18:17:02 +00:00
Aaron Giles
9476c50ee6 Cleanups for 0.124. Marked Mermaid as working per checkin comment. 2008-03-24 04:07:46 +00:00
Aaron Giles
d77d9fdb64 Added validity check to ensure input port tags don't have duplicates.
Fixed several drivers where there were duplicates.
2008-03-24 01:33:12 +00:00
Aaron Giles
d5561a8e75 Removed cpu_scalebyfcount().
Changed input ports to register a frame callback, which is
called immediately after throttling and updating. This is the
proper "sync point" between emulated time and real time. Moved
all analog and digital port processing into a central place
here. Added tracking of time since the previous frame update
and use that as an estimate for the time of the current frame.
This is used to scale analog ports without the use of
cpu_scalebyfcount(). This is not perfect in the case where
frame rates are dynamic (vector games), but works well for
other cases.

Further cleanup of memory header and code.
2008-03-12 05:13:03 +00:00
Aaron Giles
c4cfa7bde4 Compilation fixes for my last checkin (sorry). 2008-03-10 16:22:01 +00:00
Aaron Giles
ddfc0c3259 WIP check-in. Things work now, but I'm still working on the code.
Converted address maps to tokens. Changed the address_map structure
to house global map-wide information and hung a list of entries off
of it corresponding to each address range. Introduced new functions
address_map_alloc() and address_map_free() to build/destroy these
structures. Updated all code as necessary.

Fixed several instances of porttagtohandler*() in the address maps.
Drivers should use AM_READ_PORT() macros instead.

ADDRESS_MAP_EXTERN() now is required to specify the number of 
databits, just like ADDRESS_MAP_START.

Removed ADDRESS_MAP_FLAGS() grossness. There are now three new macros
which replace its former usage. ADDRESS_MAP_GLOBAL_MASK(mask)
specifies a global address-space-wide mask on all addresses. Useful
for cases where one or more address lines simply are not used at
all. And ADDRESS_MAP_UNMAP_LOW/HIGH specifies the behavior of
unmapped reads (do they come back as 0 or ~0).

Changed internal memory mapping behavior to keep only a single
address map and store the byte-adjusted values next in the address
map entries rather than maintaining two separate maps. Many other
small internal changes/cleanups.
2008-03-09 21:59:57 +00:00
Zsolt Vasvari
d0f5196025 - the public screen_state is made to only contain items that are currently accessed by drivers
- populating screen_state is moved from mame.c to video.c
- defstate is gone -- the default screen parameters live in screen_config directly
2008-03-07 12:53:00 +00:00
Aaron Giles
0046339284 Removed AM_SPACE and matchmask support. Updated relevant drivers
to use AM_MIRROR() and AM_MASK() to achieve the same thing.
2008-03-06 07:02:10 +00:00
Aaron Giles
31bb5d3f3c Added new macros AM_DEVREAD, AM_DEVWRITE, and AM_DEVREADWRITE,
which specify device read/write handlers in address maps, along
with the type/tag of the device they reference.

Converted MC6845 read/write handlers to READ/WRITE8_DEVICE_HANDLERs.
Updated all MC6845-using drivers to use the new macros and call
the updated functions. Removed the many little helper functions
that used to do this work.

Added validity checks to ensure that the devices referenced
actually exist.
2008-03-05 15:12:58 +00:00
Zsolt Vasvari
7198a00e65 - Moves all video timing logic from cpuexec.c to video.c
- Added a video_screen_register_vbl_cb() function for registering VBLANK callbanks
- Changed inptport.c and debugcpu.c to make use the VBLANK callbacks
- Added video_screen_get_time_until_vblank_start()
- CCPU and anything using cpu_scalebyfcount() are currently broken
- I did some fairly extensive testing, but this is a very signficant internal change,
  so some things may have broke
2008-03-01 15:50:12 +00:00
Zsolt Vasvari
2fba8bdb8a - Removes a couple of unused items from the cpuexec_data structure
- Adds one more validty checks -- screenless drivers cannot have a VBLANK
2008-03-01 05:30:22 +00:00
Zsolt Vasvari
f126c9fc26 Most of this descriptions taken directly from an e-mail by Aaron:
- Define a new MDRV_CPU_VBLANK_INT_HACK() (ZV: defined in deprecat.h) which is a copy of the current MDRV_CPU_VBLANK_INT()
- Find all the places where VBLANK_INT is used with something other than 1 interrupt per frame and change it to the new macro
- Remove the "# per frame" parameter from the MDRV_SCREEN_VBLANK_INT() and add a screen tag in its place; updated all callers appropriately.
- ZV: Added some validation of the interrupt setup to validate.c 

The idea behind this is that using a VBLANK interrupt with more than one interrupt per frame in conceptually wrong.
The screen tag will allow us to move the interrupt timing code from cpuexec.c to video.c, where it really belongs.
2008-02-29 15:09:04 +00:00
Aaron Giles
adcdfd3e5b Converted MACHINE_DRIVER definitions from function
constructors to tokenized lists. For the most part
this is a non-invasive change, except for those drivers
using MDRV_WATCHDOG_TIME_INIT. In order to allow for
tokenization of attotimes, a set of new macros is
provided called UINT64_ATTOTIME_IN_x() which follows the
same pattern as ATTOTIME_IN_x() but packs the attotime
down into a single 64-bit value for easier tokenization.

Separated MDRV_DEVICE_CONFIG_DATA into 32-bit and 64-bit
versions. Added floating-point versions with configurable
resolutions.

Fixed several errors in the machine drivers which were
caught by the additional checks now done in the machine
config detokenization code.

Converted speakers into devices. Machine->config no
longer houses an array of speakers; instead they are
iterated through using the new macros (defined in sound.h)
speaker_output_first() and speaker_output_next(). Updated
all relevant code to do this.

Improved game info display with multiple screens. Fixed
bug which caused all screens to display equally.

Added typedefs for all the machine config callback 
functions at the top of driver.h.
2008-02-26 06:31:28 +00:00
Aaron Giles
9a359b370d Added new module: tokenize.h. This centralizes the behavior of
tokenizing data structures, as currently used by the input
port system. Redid the input port tokenization to be more
compact and make use of the new macros.
2008-02-25 01:35:48 +00:00
Aaron Giles
8436bec1e3 Cleanups and version bump for 0.123u2. 2008-02-21 17:43:00 +00:00
Aaron Giles
b7c4a537cd Most important thing to note about this change:
ALL DRIVERS MUST NOW EXPLICITLY DECLARE THEIR SCREENS.

Read on for more detail....

Added device tag as a parameter to the start function for devices.
Updated MC6845 to accept this tag.

Added new functions for iterating through the device list and 
counting devices of a given type. Updated search and iteration
functions to accept DEVICE_TYPE_WILDCARD to work across all
devices.

Added new macro MDRV_DEVICE_CONFIG_DATA() which is used to set a
single item in an inline data structure.

Removed the per-screen palette_base. This was an idea that never
really worked out, nor have we really needed it.

Defined a new device type VIDEO_SCREEN. Currently this has no
live functionality, but merely serves as a placeholder/identifier
for video screens. Eventually some of the screen management code
may move into the start/stop/reset functions.

Changed MDRV_SCREEN_* macros to build up VIDEO_SCREEN devices
rather than storing values in the screen[] array.

Changed MDRV_SCREEN_ADD to specify a screen type (RASTER, VECTOR,
LCD for the moment).

Removed the older VIDEO_TYPE_RASTER and VIDEO_TYPE_VECTOR; this
information is now determined by walking the screen list.

Removed the screen[] array from machine_config. Modified all code 
referencing Machine->config->screen[] and changed it to iterate 
over the devices using the new video_screen_first() and 
video_screen_next() functions.

(The next step will be to add video_* functions that accept a tag
instead of screen index, and then move systems over to always
referencing screens by tag instead of index.)

Removed implicit screen #0. This means that ALL DRIVERS MUST
EXPLICITLY DECLARE THEIR SCREENS. Updated all drivers to do
so. While there, grouped all MDRV_SCREEN_* parameters together.
Also removed unnecessary VIDEO_TYPE_RASTER and VIDEO_TYPE_VECTOR.
Also removed VBLANK and bitmap format information from vector
games. This was painful and very tedious.

Changed game information to display info about all screens.
2008-02-21 08:50:36 +00:00
Aaron Giles
671afc2661 Updated validity.c to current core style. 2008-02-19 18:02:59 +00:00
Aaron Giles
aad4c81ac4 Pulled remaining vestiges of old-style colortables:
* PALETTE_INIT no longer has a colortable parameter
 * removed game_colortable and remapped_colortable from machine_config
 * updated a few stragglers that still referenced these fields
 * removed tile_draw_colortable from tilemap.c

(From Zsolt): Added support for the new colortable object in the palette viewer

Changed the input port tokens to use a union instead of casting everything to FPTR.
In the future, C99-enabled compilers will be able to achieve type safety with
designated initializers.
2008-02-19 17:52:21 +00:00
Aaron Giles
3e34860ccc Removed expand_machine_driver().
Replaced with machine_config_alloc() and machine_config_free().
Updated all call sites.
Normalized info.c style and simplified some of the code.
2008-02-18 05:58:18 +00:00
Aaron Giles
a62870621a It's the end of uitext.c as we know it (and I feel fine) 2008-01-12 03:32:30 +00:00
Aaron Giles
fa3061392e (From Atari Ace)
0. This patch does minor cleanup to existing layouts, trimming/padding
entries as appropriate and reformating a few layouts.

1. This patch introduces a GFXLAYOUT_RAW() macro, and uses it
throughout.  It codifies the requirements for a raw layout in one
place.

2. This patch adds new validation code to the core for some previously
unchecked assumptions about layouts, and reduces the number of
references to the gfx_layout fields in preparation for a change in the
representation.

3. This patch constifies the remaining non-const gfx_layouts in MAME.
It does this by adjusting the code so that the only modification to a
layout ever needed is for the total field, which is then handled by
modifying a stack-based copy of the layout before invoking allocgfx. I
also spent some time consolidating and simplifying the layout code in
konamiic.c.
2008-01-06 01:21:33 +00:00
Aaron Giles
ee9f88963c Copyright cleanup:
- removed years from copyright notices
 - removed redundant (c) from copyright notices
 - updated "the MAME Team" to be "Nicola Salmoria and the MAME Team"
2008-01-06 00:47:40 +00:00
Aaron Giles
507ca2d275 Changes for MAME 0.121u4. 2007-12-17 16:41:39 +00:00
Aaron Giles
8a8ccc5949 Changes for MAME 0.121u1. 2007-12-17 16:33:33 +00:00
Aaron Giles
7b77f12186 Initial checkin of MAME 0.121. 2007-12-17 15:19:59 +00:00