summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/romload.c
Commit message (Collapse)AuthorAgeFilesLines
* From: Oliver Stoeneberg [mailto:oliverst@online.de] Aaron Giles2008-09-111-33/+32
| | | | | | | | Subject: Machine -> machine This is a big patch adding running_machine* parameters and using "machine" where available.
* CPUs, sound chips, devices, and ROM-regions which are specified by devices Aaron Giles2008-09-081-67/+74
| | | | | | | | | | | | | | | | | 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).
* Added concept of rom sources to the rom loader. Updated auditing, Aaron Giles2008-09-061-30/+102
| | | | | CLI utilities, validity checks, and ROM loading to use these new functions so that device-specific ROMs are handled properly.
* Added new device interface selector: DEVINFO_PTR_ROM_REGION. This allows a Aaron Giles2008-09-061-49/+89
| | | | | | | | | | | | | | | | | | | | | | 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.
* Added PR-8210 support to the ldplayer. Fixed step forward command on the ↵ Aaron Giles2008-08-221-7/+4
| | | | | | | | | | | | PR-8210. 02136: cubeqst: from minimal UI cubeqst requires the optional CHD 02127: xymg: The game name should be Xing Yun Man Guan and "Pin Yin:"should be omitted 02138: flamegun: Debugger/Cheat System upper case cpu tag of MAIN doesn't work 02139: In audio/system16.c, there is a reference to REGION_SOUND1 02133: chindrah: The title of Zhong Guo Long?(Hong Kong,V011H) is Dong Fang Zhi Zhu(Hong Kong, V011H) 02126: corrupt CHDs are reported as missing
* Added new generic laserdisc VIDEO_UPDATE handler to the laserdisc code. Aaron Giles2008-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This handler works for both disc-only games and those with overlays. For disc-only games, the base macro is sufficient. For games with overlays, an additional set of configuration macros are provided: MDRV_LASERDISC_OVERLAY - specifies update function, width, height, and bitmap format of the overlay MDRV_LASERDISC_OVERLAY_CLIP - specifies the visible area of the overlay bitmap MDRV_LASERDISC_OVERLAY_POSITION - specifies default x,y position MDRV_LASERDISC_OVERLAY_SCALE - specifies default x,y scale factors The update function provided to MDRV_LASERDISC_OVERLAY is identical to a normal VIDEO_UPDATE callback, so a standard one can be used. All existing laserdisc drivers have been updated to support this new rendering mechanism, removing much duplicated code. Added the ability to configure the overlay position and scale parameters at runtime. Added OSD menus to control them. Added logic to save/restore the data in the game's configuration file. Added new macros MDRV_LASERDISC_SCREEN_ADD_NTSC and _PAL, which defines a standard screen with the correct video timing characteristics and update function for laserdiscs. Updated all drivers to use these macros instead of defining their own screens. Added DISK_REGIONS to all laserdisc drivers. Added DISK_IMAGE_READONLY_OPTIONAL to support games (like Cube Quest) where the disk is non-essential to the game's operation. Fixed bug in identifying the custom sound driver for the laserdisc. Updated ldverify to identify blank regions of the disc for post- processing. Fixed rendering 16bpp with alpha using bilinear filters (fixes screenshots of laserdisc games with overlays). Included support for parsing .gdi files in chdman. [ElSemi] Added new driver for Cube Quest. This includes CPU cores for the three bitslice processors, as well as laserdisc support for the hacked laserdisc that was used to drive the games. [Philip Bennett, Joe Magiera, Warren Ondras] Note that the SHA1/MD5 for the laserdisc will likely undergo at least one more change before being finalized.
* Moved several include files from mame/ to emu/, as they were Aaron Giles2008-08-131-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Cleanups and version bump.mame0126u4 Aaron Giles2008-08-071-1/+1
|
* Disks opened by the romload module are no longer identified by index. Aaron Giles2008-08-011-14/+18
| | | | | | | | | | | | | | | | | Instead, they are identified by the region they were loaded in. This generally means one disk per region. get_disk_handle() now takes a region name in place of an index. Updated all callers to do this. The SCSI modules in particular posed a challenge to make this work, so watch out for potential bugs there. Changed the IDE interfaces to default to choosing the region with the same tag as the device for its master disk (assuming no slave). Added support for specifying explicit master/slave disk regions as part of the configuration, though slave disks are still not supported yet. Change the laserdisc interface to no longer require a disk number or a custom sound device. Both are now assumed to be tagged the same as the laserdisc device. Updated all drivers accordingly.
* Cleanups/version bump.mame0126u3 Aaron Giles2008-07-311-1/+1
|
* From: Oliver Stoeneberg [mailto:oliverst@online.de] Aaron Giles2008-07-311-2/+2
| | | | | | | | | | | | | | | | | Subject: a few cleanups This patch contains: - removal of unprintable chars (newlines) in SH-2 disassembler (I submitted this in the past nd it wasn't included) - a few unnecessary checks after malloc_ort_die() calls - changes two romload.c warnings to use GAMENOUN instead - adds "deprecat.h" in a few src/mame/drivers files (would be necessary, if the debugger.h one would be removed) - cleans up the mame.mak by adding all missing defines and grouping them based on cpu.mak - renamed video_exit() to winvideo_exit() for consistency in function names
* Moved region post-processing back to the end. Fixes endian issue on Aaron Giles2008-07-291-3/+4
| | | | | | | | | | second SH2 for ST-V games. Fixed buffer overrun in latest SCSP code. Not sure how that ever worked. colmns97 still asserts in SCSPDSP, but this happened before the region change.
* Region classes go bye-bye. Aaron Giles2008-07-281-26/+20
|
* Changed the way memory regions are referenced. Instead of a single Aaron Giles2008-07-281-62/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* From: Atari Ace [mailto:atari_ace@verizon.net] Aaron Giles2008-07-241-23/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Subject: [patch] Conditional code cleanup resubmit Hi mamedev, This is a resubmit of a previous patch. The earlier version would not compile with 32-bit MSVC, due to the fact that its linker required external dependencies in dead code to be met before dead code elimination was done, causing linker errors. The proper fix for this would be to add the necessary dependencies, so I instead simply left the conditional code in place in winalloc.c and chd.c. ~aa Original submission email below: ---- Conditionally compiled code tends to bitrot, so MAME should try to avoid it as much as possible. I sent a patch six months ago to eliminate conditional code associated with logging, here's another patch that does more of this. Some notes: 1. drc_ops.c: I couldn't find a LOG_CODE anywhere, so I used if (0). 2. romload.c: I converted all the users of debugload to use LOG((...)) instead, following the traditional conditional logging pattern. 3. windows/sound.c: I eliminated the separate sound log and directed the few outputs to the error log. ~aa
* Cleanups. Aaron Giles2008-07-171-2/+2
|
* Changed direct access EEPROM interface to return the "bus width" of the Aaron Giles2008-07-171-25/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EEPROM data, and the size is in terms of units, not bytes. Updated all drivers accordingly. Changed the ROM loading code to actually alter the region flags based on the CPU endianness and bus width when creating the region, rather than fixing them up on the fly. This means that callers to memory_region_flags() will get the correct results. Changed the expression engine to use two callbacks for read/write rather than relying on externally defined functions. Expanded memory access support in the expression engine. Memory accesses can now be specified as [space][num]<size>@<address>. 'space' can be one of the following: p = program address space of CPU #num (default) d = data address space of CPU #num i = I/O address space of CPU #num o = opcode address space of CPU #num (R/W access to decrypted opcodes) r = direct RAM space of CPU #num (always allows writes, even for ROM) e = EEPROM index #num c = direct REGION_CPU#num access u = direct REGION_USER#num access g = direct REGION_GFX#num access s = direct REGION_SOUND#num access The 'num' field is optional for p/d/i/o/r, where is defaults to the current CPU, and for e, where it defaults to EEPROM #0. 'num' is required for all region-related prefixes. Some examples: w@curpc = word at 'curpc' in the active CPU's program address space dd@0 = dword at 0x0 in the active CPU's data address space r2b@100 = byte at 0x100 from a RAM/ROM region in CPU #2's program space ew@7f = word from EEPROM address 0x7f u2q@40 = qword from REGION_USER2, offset 0x40 The 'size' field is always required, and can be b/w/d/q for byte, word, dword, and qword accesses.
* From: Atari Ace [mailto:atari_ace@verizon.net] Aaron Giles2008-06-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | Subject: [patch] memory_region madness reloaded Hi mamedev, The memory_region and memory_region_length functions are probably the two most common functions in MAME that don't take a machine parameter but should given the syntax of the related apis memory_region_type and memory_region_flags. Clearly they didn't get the parameter because of the sheer number of changes needed to change the apis. This pair of patches makes the change, and deals with the consequences. The second patch then changes the api for memory_region and memory_region_length, and fixes the fallout. It generally plumbs through machine parameters where needed, except for the case of sound apis which I deferred doing so till later. This increased the number of deprecat.h includes by ~50. Given it is a massive patch, there are bound to be a few mistakes in it (I had to make ~20% of the changes by hand), but I exercised care and reviewed the patch several times to minimize the problems.
* Credit Fabio Priuli: Remove port_input_read_indexed in favor of the use of ↵ Couriersud2008-06-021-1/+1
| | | | | proper tags in a number of drivers * Checked sprintf calls for sufficient buffer space [couriersud]
* This is a better fix for MAMETesters 00149: No error report for invalid BIOS ↵ Aaron Giles2008-05-011-13/+19
| | | | setting
* From: Atari Ace Aaron Giles2008-04-211-6/+9
| | | | | | | | | | | | | | Subject: [patch] Fix 00149: No error report for invalid BIOS setting. Hi mamedev, This small patch makes specifying an invalid bios a fatalerror and removes the need to expose system_bios to the drivers by reworking the code in playch10.c to determine its bios more directly (in other words, it removes an ugly hack). This should resolve bug 00149, although I did not implement the popmessage as suggested. ~aa
* The term "driver" is way overloaded in the system. Aaron Giles2008-02-181-1/+1
| | | | | machine->drv is now machine->config. Sorry.
* - Added deprecat.h that contains some deprecated/discouraged contructs (see ↵ Zsolt Vasvari2008-01-251-2/+1
| | | | | | | | | below) The idea is to create extra work if a driver wants to use these and hopefully gives an incentive to look for an alternate solution - Added #include of deprecat.h that rely on these contructs - Removed a bunch of unneccassary #include's from these files
* First in a series of updates to remove the use of the global Machine from as ↵ Zsolt Vasvari2008-01-241-1/+1
| | | | many places as possible
* Copyright cleanup: Aaron Giles2008-01-061-1/+1
| | | | | | - removed years from copyright notices - removed redundant (c) from copyright notices - updated "the MAME Team" to be "Nicola Salmoria and the MAME Team"
* (From Oliver Stoneberg) Aaron Giles2008-01-031-1/+1
| | | | | | | This is an updated version of my earlier ATTR_PRINTF patch. It was reviewed by Atari Ace to use ATTR_PRINTF properly and fixes even more format errors. I also reviewed the whole source again and it is now used in all possible places.
* Initial checkin of MAME 0.121.mame0121 Aaron Giles2007-12-171-0/+1169