Commit Graph

118 Commits

Author SHA1 Message Date
Aaron Giles
57ef3a5ed6 Split the screen device into a separate module.
Converted global video routines into a video_manager.
Moved video manager initialization earlier in startup.
2010-12-02 17:26:38 +00:00
Aaron Giles
e4d8baf401 Changed driver_device to expose the game_driver's ROMs through the
device interface. This means all ROMs are now exposed via devices,
and thus the process of enumerating ROMs gets simpler.

Changed all instances of temporarily allocating machine_config objects 
to just put them on the stack for simplicity, letting the destructor 
handle the cleanup work automatically.

Changed machine_config constructor to take a game_driver, from which
the machine_config constructor is obtained. This also means the
resulting machine_config holds a reference to the game_driver.

Changed running_machine constructor to no longer take a game_driver,
since the game_driver is now obtainable via the machine_config.
2010-09-03 05:21:46 +00:00
Aaron Giles
0e672ba6eb Cleanups and version bump. 2010-08-30 15:20:58 +00:00
Aaron Giles
d5d2cd0bb9 Haha, recent change to astrings also revealed that validity checks
were busted for ROM_FILL/ROM_COPY (we didn't detect regions populated
this way were non-empty).
2010-08-21 19:37:32 +00:00
Aaron Giles
4d1fc8fafa Swap: (astring.len() != 0) -> astring
Swap: (astring.len() == 0) -> !astring
2010-08-21 19:27:14 +00:00
Aaron Giles
f5a217442a Fix crasher caused by new astring operators (original code
was buggy, but didn't crash before).
2010-08-19 19:59:16 +00:00
Aaron Giles
ab18e234b0 Cleanups and version bump. 2010-08-12 04:24:53 +00:00
Aaron Giles
fe47da274e Return to type safety. Changed address maps back into functions that build
up the definition, rather than the whole tokenizing system, which lost type
checking. Added a new module addrmap.c which implements the address map
classes, and changed the macros to call methods on the address_map and
address_map_entry classes which are strongly typed.

Fixed a few incorrectly specified memory map entries along the way. Please
double-check to make sure the behavior is expected in: twincobr.c, lordgun.c,
galaxold.c.

This change also means that since the address_maps are now constructor
functions, they are detected when not used, so a number of #ifdef UNUSED_CODE
were added around dangling address map definitions.

Also included with this change:
- removed cputag_clocks_to_attotime() and cputag_attotime_to_clocks() in
   favor of just expanding the class
- same for cputag_suspend() and cputag_resume()
2010-08-01 21:04:03 +00:00
Aaron Giles
41b9dbb9ac Made the machine_config a proper object. Added detokenize method to
this object which can be called multiple times to append new devices
after the initial machine configuration is set up. Updated member
variables to match new naming convention.

Changed the running_machine to take a constructed machine_config
object in the constructor, instead of creating one itself, for
consistency. Also added machine->total_colors() as a shortcut to 
machine->config->m_total_colors.
2010-06-28 06:40:44 +00:00
Aaron Giles
861db1eb49 Cleanups and version bump. 2010-06-17 06:55:54 +00:00
Aaron Giles
100564d412 WARNING: There are likely to be regressions in both functionality and
performance as a result of this change. Do not panic; report issues to the
list in the short term and I will look into them. There are probably also
some details I forgot to mention. Please ask questions if anything is not
clear.

NOTE: This is a major internal change to the way devices are handled in
MAME. There is a small impact on drivers, but the bulk of the changes are
to the devices themselves. Full documentation on the new device handling
is in progress at http://mamedev.org/devwiki/index.php/MAME_Device_Basics

Defined two new casting helpers: [Aaron Giles]

  downcast<type>(value) should be used for safe and efficient downcasting
  from a base class to a derived class. It wraps static_cast<> by adding
  an assert that a matching dynamic_cast<> returns the same result in 
  debug builds.
  
  crosscast<type>(value) should be used for safe casting from one type to
  another in multiple inheritance scenarios. It compiles to a 
  dynamic_cast<> plus an assert on the result. Since it does not optimize
  down to static_cast<>, you should prefer downcast<> over crosscast<>
  when you can.
  
Redefined running_device to be a proper C++ class (now called device_t).
Same for device_config (still called device_config). All devices and
device_configs must now be derived from these base classes. This means
each device type now has a pair of its own unique classes that describe
the device. Drivers are encouraged to use the specific device types
instead of the generic running_device or device_t classes. Drivers that
have a state class defined in their header file are encouraged to use
initializers off the constructor to locate devices. [Aaron Giles]

Removed the following fields from the device and device configuration
classes as they never were necessary or provided any use: device class,
device family, source file, version, credits. [Aaron Giles]

Added templatized variant of machine->device() which performs a downcast
as part of the device fetch. Thus machine->device<timer_device>("timer")
will locate a device named "timer", downcast it to a timer_device, and
assert if the downcast fails. [Aaron Giles]

Removed most publically accessible members of running_device/device_t in
favor of inline accessor functions. The only remaining public member is
machine. Thus all references to device->type are now device->type(), etc.
[Aaron Giles]

Created a number of device interface classes which are designed to be mix-
ins for the device classes, providing specific extended functionality and
information. There are standard interface classes for sound, execution,
state, nvram, memory, and disassembly. Devices can opt into 0 or more of
these classes. [Aaron Giles]

Converted the classic CPU device to a standard device that uses the
execution, state, memory, and disassembly interfaces. Used this new class
(cpu_device) to implement the existing CPU device interface. In the future
it will be possible to convert each CPU core to its own device type, but 
for now they are still all CPU devices with a cpu_type() that specifies
exactly which kind of CPU. [Aaron Giles] 

Created a new header devlegcy.h which wraps the old device interface using
some special template classes. To use these with an existing device,
simply remove from the device header the DEVICE_GET_INFO() declaration and
the #define mapping the ALL_CAPS name to the DEVICE_GET_INFO. In their
place #include "devlegcy.h" and use the DECLARE_LEGACY_DEVICE() macro.
In addition, there is a DECLARE_LEGACY_SOUND_DEVICE() macro for wrapping
existing sound devices into new-style devices, and a 
DECLARE_LEGACY_NVRAM_DEVICE() for wrapping NVRAM devices. Also moved the
token and inline_config members to the legacy device class, as these are
not used in modern devices. [Aaron Giles]

Converted the standard base devices (VIDEO_SCREEN, SPEAKER, and TIMER) 
from legacy devices to the new C++ style. Also renamed VIDEO_SCREEN to
simply SCREEN. The various global functions that were previously used to
access information or modify the state of these devices are now replaced
by methods on the device classes. Specifically:

  video_screen_configure()             == screen->configure()
  video_screen_set_visarea()           == screen->set_visible_area()
  video_screen_update_partial()        == screen->update_partial()
  video_screen_update_now()            == screen->update_now()
  video_screen_get_vpos()              == screen->vpos()
  video_screen_get_hpos()              == screen->hpos()
  video_screen_get_vblank()            == screen->vblank()
  video_screen_get_hblank()            == screen->hblank()
  video_screen_get_width()             == screen->width()
  video_screen_get_height()            == screen->height()
  video_screen_get_visible_area()      == screen->visible_area()
  video_screen_get_time_until_pos()    == screen->time_until_pos()
  video_screen_get_time_until_vblank_start() == 
                                 screen->time_until_vblank_start()
  video_screen_get_time_until_vblank_end() == 
                                 screen->time_until_vblank_end()
  video_screen_get_time_until_update() == screen->time_until_update()
  video_screen_get_scan_period()       == screen->scan_period()
  video_screen_get_frame_period()      == screen->frame_period()
  video_screen_get_frame_number()      == screen->frame_number()

  timer_device_adjust_oneshot()        == timer->adjust()
  timer_device_adjust_periodic()       == timer->adjust()
  timer_device_reset()                 == timer->reset()
  timer_device_enable()                == timer->enable()
  timer_device_enabled()               == timer->enabled()
  timer_device_get_param()             == timer->param()
  timer_device_set_param()             == timer->set_param()
  timer_device_get_ptr()               == timer->get_ptr()
  timer_device_set_ptr()               == timer->set_ptr()
  timer_device_timeelapsed()           == timer->time_elapsed()
  timer_device_timeleft()              == timer->time_left()
  timer_device_starttime()             == timer->start_time()
  timer_device_firetime()              == timer->fire_time()

Updated all drivers that use the above functions to fetch the specific
device type (timer_device or screen_device) and call the appropriate
method. [Aaron Giles]

Changed machine->primary_screen and the 'screen' parameter to VIDEO_UPDATE
to specifically pass in a screen_device object. [Aaron Giles]

Defined a new custom interface for the Z80 daisy chain. This interface
behaves like the standard interfaces, and can be added to any device that
implements the Z80 daisy chain behavior. Converted all existing Z80 daisy
chain devices to new-style devices that inherit this interface.
[Aaron Giles]

Changed the way CPU state tables are built up. Previously, these were data
structures defined by a CPU core which described all the registers and how
to output them. This functionality is now part of the state interface and
is implemented via the device_state_entry class. Updated all CPU cores
which were using the old data structure to use the new form. The syntax is
currently awkward, but will be cleaner for CPUs that are native new 
devices. [Aaron Giles]

Converted the okim6295 and eeprom devices to the new model. These were
necessary because they both require multiple interfaces to operate and it
didn't make sense to create legacy device templates for these single cases.
(okim6295 needs the sound interface and the memory interface, while eeprom
requires both the nvram and memory interfaces). [Aaron Giles]

Changed parameters in a few callback functions from pointers to references
in situations where they are guaranteed to never be NULL. [Aaron Giles]

Removed MDRV_CPU_FLAGS() which was only used for disabling a CPU. Changed
it to MDRV_DEVICE_DISABLE() instead. Updated drivers. [Aaron Giles]

Reorganized the token parsing for machine configurations. The core parsing
code knows how to create/replace/remove devices, but all device token
parsing is now handled in the device_config class, which in turn will make
use of any interface classes or device-specific token handling for custom
token processing. [Aaron Giles]

Moved many validity checks out of validity.c and into the device interface
classes. For example, address space validation is now part of the memory
interface class. [Aaron Giles]

Consolidated address space parameters (bus width, endianness, etc.) into
a single address_space_config class. Updated all code that queried for
address space parameters to use the new mechanism. [Aaron Giles]
2010-06-08 06:09:57 +00:00
Aaron Giles
ec586731b9 Made device->tag and devconfig->tag into private member variables (m_tag).
Added inline tag() function to return a const char * version. Updated
callers to use this instead of directly accessing tag.cstr() which
was awkward.
2010-03-08 17:06:27 +00:00
Aaron Giles
cfa887f3de Changed all driver_data structs into classes with a simple
constructor and a static allocation function.

Changed MDRV_DRIVER_DATA to reference driver_data::alloc
instead of just providing a size. This function is called
to allocate the driver data. This allows objects to be
embedded in the state data and be properly initialized.

Ideally, new driver_data constructors should perform
initialization actions in the constructor, but for now
most just use auto_alloc_clear() to blast everything to
zero.

Moved driver data allocation after device list construction
so that devices can be found when the driver data is
constructed.
2010-02-25 06:28:03 +00:00
Aaron Giles
6b663f66a7 Cleanups and version bump. 2010-02-14 16:59:22 +00:00
Miodrag Milanovic
0a6b13608d - Moved natural keyboard support from MESS to MAME
- Moved OSD file functions and clipboard access functions into OSD core
2010-02-12 15:40:11 +00:00
Miodrag Milanovic
ce85c7f748 Removed GAME_SHARE_ROMS flag and commented old check for duplicate ROM entries 2010-02-11 13:54:55 +00:00
Miodrag Milanovic
f058d3f6e0 Renamed GAME_CAN_SHARE_ROMS to GAME_SHARE_ROMS (sounds more logical) 2010-02-11 10:25:14 +00:00
Miodrag Milanovic
a8aedb92b0 - Renamed GAME_COMPUTER_MODIFIED to GAME_UNOFFICIAL to mark unofficial hardware modifications
- Removed GAME_COMPUTER it is distinct by IPT_KEYBOARD
- Added GAME_NO_SOUND_HW (to mark that there is no sound hardware) and marked drivers in dotrikun.c, minivadr.c and tgtpanic.c as such
- Added GAME_CAN_SHARE_ROMS - to mark that there can be other driver using same ROM as this one but with different hardware (common in computer/console world)
2010-02-11 09:44:23 +00:00
Miodrag Milanovic
312b80701c - Moved compatibility validation into MAME core from MESS.
- Made GAME_COMPUTER type visible for all, and removed ifdefs for it.
- Made GAME_NO_SOUND check done on MESS too.
2010-02-09 14:23:13 +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
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
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
Aaron Giles
aebc07a897 Cleanups and version bump. 2010-01-16 04:12:04 +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
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
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
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
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
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
Aaron Giles
bd24fb23c1 Results of running the latest srcclean. 2009-12-28 09:04:00 +00:00
Aaron Giles
f20a2e6b17 Fixes so we can compile as C++ again. 2009-12-28 07:34:17 +00:00
Aaron Giles
40bcc29e8a Cleanups and version bump. 2009-12-11 06:19:46 +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
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
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
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
b5c3081f3e Cleanups and version bump. 2009-11-30 01:46:32 +00:00
R. Belmont
e76480c990 Fixed 64-bit GCC build. 2009-11-23 17:28:24 +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
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
Aaron Giles
e0d437dc1d Enforce a minimum tag length of 3 characters. This will enable
future lookup optimizations. 

By and large, the only things that used 2-character tags were bulk-
converted sound chips which were generally mapped to "ym" or "ay" 
(and a few others). These were changed to "ymsnd" and "aysnd", 
mimicking the way CPUs were changed from "main" to "maincpu" a while
back.
2009-11-15 22:02:27 +00:00
Aaron Giles
f60bbef070 Rename osd_profiling_ticks() to get_profile_ticks(). Moved implemention into
inline functions in eminline.h and the ei* functions. [couriersud, Aaron Giles]
2009-09-06 23:30:26 +00:00
Nathan Woods
80f0e5be81 Sync with MESS 2009-08-21 22:30:58 +00:00
Aaron Giles
40cc74b98f > -----Original Message-----
> From: Atari Ace [mailto:atari_ace@verizon.net]
> Sent: Monday, August 03, 2009 10:52 PM
> To: submit@mamedev.org
> Cc: atariace@hotmail.com
> Subject: [patch] De-globalize romload.c/validity.c
> 
> Hi mamedev,
> 
> Static and global variables in the core of MAME have slowly been
> replaced with opaque structures latched onto the running machine. This
> patch extends this idiom to two more files, romload.c and validity.c.
> validity.c in fact didn't need any global state (it was used only to
> pass data between function calls), and romload.c already had a struct
> that largely served that purpose.
> 
> ~aa
2009-08-13 04:55:32 +00:00
Aaron Giles
7af2304c81 Removed PREDECODE_GFX compile flag, as the on-the-fly decoding seems
to be working reliably.

Deprecated the ROMREGION_DISPOSE flag, as 98% of the use of it no
longer is applicable with on-the-fly decoding, and the remaining
cases are difficult to identify among the others.
2009-07-09 08:03:31 +00:00
Aaron Giles
5201d52344 Expanded address maps from 3 to 4. Moved ADDRESS_SPACE_PROGRAM/DATA/IO
constants to cpuintrf, as those names are really only applicable to 
CPUs. Added new ADDRESS_MAP_0/1/2/3 constants to identify address maps 
more generically. 

Updated memory system to be more general about address map handling.
Added the concept of default address maps (in addition to the already
existing internal memory maps). The difference between internal and
default memory maps is that internal memory maps always override
everything (including user-specified maps), but default memory maps
simply provide a default that can be overridden.

Converted the okim6295 sound driver to use address maps for access.
By default, it defines a ROM address map that overlays its full
region. As a result, the validity checks require all okim6295 regions
to be at least 256k, unless you provide your own address map. Updated
all regions to meet this requirement.

Updated the atarijsa code to use a custom address space for its
okim6295 accesses (which are banked on the first half and static on
the second half), as an example of configuring a device with a
custom address space.

For now, attempts to use okim6295_set_bank_base() will still work,
though banking for the okim chips should be moved to custom address
maps in the drivers eventually. The first time okim6295_set_bank_base()
is called, it will install a banked memory handler over the region
and use memory_set_bankptr() to change the base on subsequent bank
switches.

Moved address map validity checks to be run for each device instead of
just each CPU.
2009-07-09 07:10:40 +00:00
Aaron Giles
e692918b34 Added casts to ensure proper values are passed to the ctype.h functions.
[Juergen Buchmueller]
2009-06-25 08:04:39 +00:00
Aaron Giles
446c154bb1 From: Oliver Stoeneberg [oliverst@online.de]
Sent: Friday, May 15, 2009 9:13 AM
To: submit@mamedev.org
Subject: Unused Variables - second try

This is a new version of the patch, that disables some unused
variables. It fixes some warnings, that came up in an optimized build
and adds a few more things.
2009-05-25 01:03:10 +00:00
Aaron Giles
09d58a6c7f Removed address_map2 items from the CPU config, etc. 2009-05-09 05:30:43 +00:00