Commit Graph

103 Commits

Author SHA1 Message Date
Miodrag Milanovic
2e4ce7091e Display approximate matches if softlist item is not found (no whatsnew) 2011-06-15 17:51:47 +00:00
Miodrag Milanovic
7fd9b4fba0 Added support for starting softlist item directly without
marking image device to be mounted on. If soft item is found 
it will be loaded on first image device that have needed 
interface defined [Miodrag Milanovic]
2011-06-15 17:31:06 +00:00
Scott Stone
1d33744bd4 Fix for 04298: mame -h points to incorrect usage file (no whatsnew) 2011-06-06 18:02:19 +00:00
Fabio Priuli
93e2f248e2 I have no idea where this line got lost in the previous commit, anyway now it's in. no whatsnew. 2011-05-21 10:33:31 +00:00
Fabio Priuli
cb14c047e9 clifront.c: temporarily re-enabled -listsoftware to allow more work on support in qmc2 frontend. no whatsnew. 2011-05-21 08:18:52 +00:00
Angelo Salese
7878118446 Cleanups and version bump 2011-05-08 19:52:50 +00:00
Miodrag Milanovic
af35c8613f Support for dynamic devices added to the core. [Miodrag Milanovic]
- Added slot and slot card interfaces
 - Added SLOT_INTERFACE macros in order to simplify device adding
 - Added new menu option "Slot Devices" and support to change device in runtime
 - Updated emuopts to support command setting of slot cards
 - Update clifront and added listslots option to display available slots and 
   device options for each one
2011-05-05 15:18:47 +00:00
Aaron Giles
919913f118 Collapsed device_config and device_t into one class. Updated all
existing modern devices and the legacy wrappers to work in this
environment. This in general greatly simplifies writing a modern
device. [Aaron Giles]

General notes:
 * some more cleanup probably needs to happen behind this change,
   but I needed to get it in before the next device modernization 
   or import from MESS  :)

 * new template function device_creator which automatically defines
   the static function that creates the device; use this instead of
   creating a static_alloc_device_config function

 * added device_stop() method which is called at around the time
   the previous device_t's destructor was called; if you auto_free
   anything, do it here because the machine is gone when the 
   destructor is called

 * changed the static_set_* calls to pass a device_t & instead of
   a device_config *

 * for many devices, the static config structure member names over-
   lapped the device's names for devcb_* functions; in these cases
   the members in the interface were renamed to have a _cb suffix

 * changed the driver_enumerator to only cache 100 machine_configs
   because caching them all took a ton of memory; fortunately this
   implementation detail is completely hidden behind the 
   driver_enumerator interface

 * got rid of the macros for creating derived classes; doing it
   manually is now clean enough that it isn't worth hiding the
   details in a macro
2011-04-27 05:11:18 +00:00
Angelo Salese
486fbfa555 Cleanups again 2011-04-18 00:06:50 +00:00
Aaron Giles
7a63b54cee Make -romident use mame_printf_info consistently. 2011-04-17 14:38:09 +00:00
Fabio Priuli
67a8470e85 clifront.c: fixed -listmedia output (extensions were messed up). it's for MESS, so no whatsnew. 2011-04-16 14:17:49 +00:00
Miodrag Milanovic
a06d6444cb Added listmedia since it also applies now to MAME (no whatsnew) 2011-04-14 11:59:25 +00:00
Miodrag Milanovic
2cea488188 Removed various differences between MESS and MAME, all is now defined in mame.h.
This should allow hopefully easier maintenance (no whatsnew)
2011-04-14 10:52:08 +00:00
Aaron Giles
00d745ca77 (Big tangle of changes that all happened as I was looking into the ROM
loader rewrite, which is still in progress....)

Replaced mamedriv.c with a new driver list mechanism that is generated
by the build tools. The emulator core now expects the presence of a
file called src/$(TARGET)/$(SUBTARGET).lst which is just a raw list of
driver names, one per line. C and C++ comments are still permitted.
This file is parsed by a new build tool makelist which extracts the
driver names, sorts them, and generates a file called drivlist.c, which
is consumed by the core. [Aaron Giles]

Added new osdcore function osd_malloc_array() which is identical to
osd_malloc() but obviously hints that the underlying allocation is for
an array. Updated all callers to use the appropriate form. Modified the
Windows allocator to only use guard pages for array-style allocations,
allowing us to enable them once again in debug builds. [Aaron Giles]

Created new static class driver_list to wrap accesses to the list of
available drivers. Improved speed of driver lookups by relying on the
presorting done by makelist. [Aaron Giles]

Created helper class driver_enumerator as a helper for iterating through 
the list of drivers. This class supports basic filtering and iteration,
and also serves as a temporary cache of machine_configs. [Aaron Giles]

Created cli_frontend object to wrap all the CLI handling code in
clifront.c. Updated/simplified all the code to take advantage of the
driver_enumerator. [Aaron Giles]

Created media_auditor object to wrap all the auditing functions in
audit.c. Updated all users to the new interface. Note that the new
auditing mechanism is slightly out of sync with the romload code in
terms of finding ROMs owned by devices, so it may mis-report some
issues until the new ROM loading code is in. [Aaron Giles]

Added concept of a per-device searchpath. For most devices, their 
searchpath is just the short name of the device. For driver_devices, the
searchpath is driver[;parent[;bios]]. This searchpath will eventually be
used by the rom loader to find ROMs. For now it is used by the media
auditor only. [Aaron Giles]

Created info_xml_creator object to wrap all the info generation functions
in info.c. Converted the file to C++ and cleaned up the input processing
code. [Aaron Giles]

(not for whatsnew ... Known issues: auditing of CHDs appears busted, and 
debug builds report unfreed memory if you use the built-in game picker)
2011-04-13 20:31:00 +00:00
Fabio Priuli
54ee23b875 worked around a minor issue of the -showusage command for MESS (media and software do not appear among the options, making the usage example not so useful). I'm not fond of the solution, so if anyone has a better suggestion, please step up. no whatsnew. 2011-04-06 19:50:55 +00:00
Aaron Giles
68958f72db Cleanups and version bump. 2011-04-03 05:49:24 +00:00
Aaron Giles
1b5697945d If we get an error parsing options, see if there was no command and what
looks like an invalid system name. In that case, provide suggestions
for the system name instead of reporting the options error.
2011-03-29 16:43:54 +00:00
Fabio Priuli
ea0eaa46da clifront.c: fixed typos, not worth mention 2011-03-27 11:41:34 +00:00
Fabio Priuli
382e3998b1 minor DTD change to have fully correct xml lists (the ROM_FILL correspondent concept was not compliant with the DTD). no whatsnew. 2011-03-27 07:08:31 +00:00
Fabio Priuli
f25b3a9b88 softlist.c: split the <info> field (added some time ago to handle compatibility requirements) into <info> and <sharedfeat>.
the former stays tied to the whole software entry, the latter gets inherited by each part. 

out of whatsnew 1: Arbee, this change finalizes the xml format once for all. feel free to create an apple II or ||gs list, if you are interested

out of whatsnew 2: 
A bunch of comments about this change: with the latest code, each software entry can store three different kind of 'extrainfo' strings. They are thought to be used in specific cases, so let me briefly explain the big picture behind them.

1. <feature> fields: these are well established in current lists. they belong to a <part> element (i.e. a specific cart or cd disc or floppy disk) and they can be used to store hardware details that belongs to that specific <part>. typically, we have used these to describe the pcb_type of a cart (e.g. the board type in NES carts or in AES carts, to remove the need of specific mappers), so that at loading time they can be checked and the emulation can be setup accordingly. However, some lists (e.g. snes.xml and, in a few months, nes.xml as well) use these more creatively, to e.g. document the exact chip locations on the pcb

examples
<feature name="pcb_type" value="MMC3C"/>
<feature name="u3" value="SRAM-64M"/>

----------
2. <sharedfeat> fields: these are listed in the main <software> entry, but get stored together with the <feature> of each part of this software. E.g. if your software entry consists of 9 floppies, these shared features will be inherited by *all* the disks. The typical usage for this is to list the compatibility requirements of the software entry, e.g. a PAL system, or the presence of an expansion card, or the presence of additional RAM. These compatibility settings have to be manually parsed in the loading code by the driver author, but it makes more sense to define them only once for each software entry than to copy and paste it for each <part> (and believe me, it makes a difference both in terms of avoiding redundant lines and in terms of time necessary to create the xml list itself, when you deal with hundreds of multidisk entries like in the forthcoming pc8801 floppy list). consider this as a shortcut for 1. when you have multidisk software.

examples
<sharedfeat name="compatibility" value="EUR-JPN"/>  (the value can be freely chosen by the driver author as long as he also add the correct values in the loading routine ;) )
<sharedfeat name="addon" value="DVC"/> (this can be of use in cdi titles which won't work without the DigitalVideoCard expansion)

----------
3. <info> fields: these belongs directly to the main <software> entry, like the <sharedfeat>, but they do get stored in the main software entry, not with the <part>. They should be used to store additional info which might be of use for frontends, but that are not strictly necessary for emulation (if you have to describe some fundamental hardware characteristic that has to be checked during emulation, then you should use <sharedfeat> not <info>). Possible examples include the name of the development team, or the serial number of the cart, etc but it's up to the list creator to decide what to use this for and if to use it at all

examples
<info name="developer" value="Treasure"/>
<info name="serial" value="NUS-NSMJ-JPN"/>

As already said, imho the format can now be considered finalized. I cannot really think of anything else that we might want to include in the format, without getting redundant. 

p.s. In fact, some small change is still required in the core to fully support the new fields (e.g. at the moment <info> are not loaded by the core), but the xml format won't be touched.
2011-03-27 00:11:42 +00:00
Aaron Giles
fb5091182e Cleanups and version bump. 2011-03-25 16:14:09 +00:00
Aaron Giles
fe71058aa2 Don't pass both a machine_config and an emu_options, since the options
are now available via the config.
2011-03-11 06:01:58 +00:00
Aaron Giles
04c9a546b5 Attached emu_options to the machine_config, and the running_machine
inherits it now.
2011-03-10 10:17:30 +00:00
Aaron Giles
46550a475b Non-debug builds need to free those memory_entries. Fixes enormous
memory consumption when iterating through all drivers like -romident
does.

Also moved softlist scanning into the main loop so that machine_configs
are only constructed once.
2011-03-10 07:06:21 +00:00
Aaron Giles
af6c7a9dac MT04267: Fix -verifyroms to not consider NO_DUMP ROMs as matches to the parent. 2011-03-03 17:39:43 +00:00
Aaron Giles
06ee6804dd Converted core_options to a class. Removed a bunch of marginal
functionality in favor of alternate mechanisms. Errors are
now reported via an astring rather than via callbacks. Every
option must now specify a type (command, integer, float, string,
boolean, etc). Command behavior has changed so that only one
command is permitted. [Aaron Giles]

Changed fileio system to accept just a raw searchpath instead of
an options/option name combination. [Aaron Giles]

Created emu_options class dervied from core_options which wraps
core emulator options. Added mechanisms to cleanly change the
system name and add/remove system-specific options, versus the
old way using callbacks. Also added read accessors for all the
options, to ensure consistency in how parameters are handled.
Changed most core systems to access emu_options instead of
core_options. Also changed machine->options() to return emu_options.
[Aaron Giles]
 
Created cli_options class derived from emu_options which adds the
command-line specific options. Updated clifront code to leverage
the new class and the new core behaviors. cli_execute() now accepts
a cli_options object when called. [Aaron Giles]

Updated both SDL and Windows to have their own options classes,
derived from cli_options, which add the OSD-specific options on
top of everything else. Added accessors for all the options so
that queries are strongly typed and simplified. [Aaron Giles]

Out of whatsnew: I've surely screwed up some stuff, though I have
smoke tested a bunch of things. Let me know if you hit anything odd.
Also I know this change will impact the WINUI stuff, please let me 
know if there are issues. All the functionality necessary should 
still be present. If it's not obvious, please talk to me before 
adding stuff to the core_options class.
2011-03-03 17:05:24 +00:00
Aaron Giles
ed97fb8048 Fix -romident. 2011-02-15 04:59:43 +00:00
Aaron Giles
5e4df8c772 Hash generation and general cleanup. New class hash_collection holds
and manages a collection of hashes, and can be built from an internal
format string which is stored with each ROM. All core instances are
cleaned up to use the new interfaces, but it's likely that hashfile
code in MESS will need an update.

Also compacted the form of the hash strings used for ROMs, and fixed
verification/hashing of non-ZIPped files.
2011-02-14 08:41:08 +00:00
Aaron Giles
d2fac452a3 And woohoo, mame_options() is no more. 2011-02-12 04:14:00 +00:00
Aaron Giles
1b54456be5 mame_file is now emu_file and is a class. It is required
to pass a core_options object to the constructor, along with
a search path. This required pushing either a running_machine
or a core_options through some code that wasn't previously
ready to handle it. emu_files can be reused over multiple 
open/close sessions, and a lot of core code cleaned up
nicely as things were converted to them.

Also created a file_enumerator class for iterating over files
in a searchpath. This replaces the old mame_openpath functions.

Changed machine->options() to return a reference.

Removed public nvram_open() and fixed jchan/kaneko16 to
stop directly saving NVRAM.

Removed most of the mame_options() calls; this will soon go 
away entirely, so don't add any more.

Added core_options to device_validity_check() so they can be
used to validate things.
2011-02-12 03:47:37 +00:00
Miodrag Milanovic
bdb888faca Only display suggestions in case there were really no matching drivers, but display empty output in case there were really no clones for such machine same as before (no whatsnew) 2011-01-24 14:05:01 +00:00
Aaron Giles
b3d7e09292 Cleanups and version bump. 2011-01-24 05:09:05 +00:00
Miodrag Milanovic
9699603819 - Display suggestions in case commands that require game name are called and there were no matching games [Miodrag Milanovic]
- Display suggestions for driver even if there are additional parameters that do not match (used on MESS where we have driver dependent parameters)
2011-01-23 16:55:11 +00:00
Fabio Priuli
33e55958b0 fixed -listmedia ambiguous output (dating back to when it was -listdevice). no whatsnew. 2011-01-23 09:59:07 +00:00
Miodrag Milanovic
a3eb622950 Revert back change r11240 of clifront.c since errors caused for romident and similar commands (no whatsnew) 2011-01-19 08:15:53 +00:00
Miodrag Milanovic
d1d0edef59 Fixed order of parsing parameters, this way game name is checked first, so in case of optional parameters (like for image devices) it will first give you list of drivers with nearest name and not error that parameter doesn't exist (no whatsnew) 2011-01-18 15:38:10 +00:00
Fabio Priuli
db61ec6aa6 clifront.c: prevented -lsoft from output DTD if no list is found [Fabio Priuli] 2011-01-14 09:02:26 +00:00
Fabio Priuli
768e020c3a clifront.c: added "-lsoft" option as short version of "-listsoftware" [Fabio Priuli]
out of whatsnew: I also have modified best match for softlists to return 10 results, like in MAME, given that now only the correct list is parsed (thanks to Micko's change)
2011-01-14 07:56:29 +00:00
Fabio Priuli
b663d1a0bb ensuring that -listsoftware output is valid xml. no whatsnew. 2011-01-12 22:00:34 +00:00
Fabio Priuli
063c530849 fixed mistake in rev.11135 2011-01-12 21:44:35 +00:00
Fabio Priuli
614114ee56 clifront.c: added remaining loadflags to -listsoftware output [Fabio Priuli] 2011-01-12 21:31:48 +00:00
Fabio Priuli
1a907971d6 improved DTD, no whatsnew 2011-01-12 21:03:44 +00:00
Fabio Priuli
889709b104 clifront.c: improved the behavior of -listsoftware by updating DTD, by adding output of most missing elements and attributes (softlist description, features & diskdata) and by fixing size and offset formats [Fabio Priuli] 2011-01-12 20:56:24 +00:00
Miodrag Milanovic
2231fb32b4 Moved LCD layouts to emu section and removed some more ifdefs (no whatsnew) 2011-01-05 21:14:20 +00:00
Aaron Giles
e4beed95a6 Create new class osd_interface to house OSD callbacks. Added new
module osdepend.c with default empty implementations. Changed
mame_execute() and cli_execute() to accept a reference to an
osd_interface which is provided by the caller.

Updated SDL and Windows OSD to create an osd_interface-derived
class and moved their OSD callbacks to be members.
2010-10-21 15:59:44 +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
a9befd7970 Remove artificial SOUND_ prefix from sound device names.
[Atari Ace]

---------- Forwarded message ----------
From: Atari Ace <atari_ace@frontier.com>
Date: Tue, Aug 31, 2010 at 5:50 AM
Subject: [patch] Despecialize legacy sound devices
To: submit@mamedev.org
Cc: atariace@hotmail.com


Hi mamedev,

While poking around in the MAME source code, I came across the odd
type snes_sound_sound_device, which led me to the fact that legacy
sound devices are named a bit differently than other legacy devices,
probably a kludge intended to be changed later but forgotten.  Anyhow,
this patch fixes it.  The first patch goes part way, changing all but
the tag (which fixes the weird type issue).  It also changes type
names in the scsp and msm5232 cores to avoid a name collision if/when
the second patch is applied.  The second patch then touches a lot of
files, mostly removing the SOUND_ prefix from type asserts, but it
also needed to change the tags for the LASERDISC, S2636 and SPEAKER
sound cores to avoid collisions with other devices with the same name.

~aa
2010-09-02 08:14:41 +00:00
Miodrag Milanovic
dbf7afe106 Made options visible to device validate function when doing "-validate", this is used by MESS (example software list and messram devices) (no whatsnew) 2010-09-01 09:34:55 +00:00
Aaron Giles
30662dcdef Cleanups and version bump. 2010-07-06 17:30:28 +00:00
Miodrag Milanovic
16f14bc5f9 - Added MDRV_SOFTWARE_LIST_COMPATIBLE_ADD for adding compatible software lists (for documentation purposes) [Miodrag Milanovic]
- listsoftware option now return only original software lists
- UI is updated to enable mounting software items per device, it will display only items from list that are for specific device
- Separate compatible software lists in UI
2010-07-06 14:27:51 +00:00