path: root/src/ldplayer (follow)
Commit message (Collapse)AuthorAgeFilesLines
* > -----Original Message----- Aaron Giles2009-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | > From: Atari Ace [] > Sent: Monday, August 03, 2009 10:52 PM > To: > Cc: > 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
* Bulk change alert. Aaron Giles2009-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This update changes the way we handle memory allocation. Rather than allocating in terms of bytes, allocations are now done in terms of objects. This is done via new set of macros that replace the malloc_or_die() macro: alloc_or_die(t) - allocate memory for an object of type 't' alloc_array_or_die(t,c) - allocate memory for an array of 'c' objects of type 't' alloc_clear_or_die(t) - same as alloc_or_die but memset's the memory to 0 alloc_array_clear_or_die(t,c) - same as alloc_array_or_die but memset's the memory to 0 All original callers of malloc_or_die have been updated to call these new macros. If you just need an array of bytes, you can use alloc_array_or_die(UINT8, numbytes). Made a similar change to the auto_* allocation macros. In addition, added 'machine' as a required parameter to the auto-allocation macros, as the resource pools will eventually be owned by the machine object. The new macros are: auto_alloc(m,t) - allocate memory for an object of type 't' auto_alloc_array(m,t,c) - allocate memory for an array of 'c' objects of type 't' auto_alloc_clear(m,t) - allocate and memset auto_alloc_array_clear(m,t,c) - allocate and memset All original calls or auto_malloc have been updated to use the new macros. In addition, auto_realloc(), auto_strdup(), auto_astring_alloc(), and auto_bitmap_alloc() have been updated to take a machine parameter. Changed validity check allocations to not rely on auto_alloc* anymore because they are not done in the context of a machine. One final change that is included is the removal of SMH_BANKn macros. Just use SMH_BANK(n) instead, which is what the previous macros mapped to anyhow.
* Fixed Analog Settings to return to default when IPT_UI_SELECT (enter) pressed. Derrick Renaud2009-04-101-4/+4
| | | Fixed misplaced brackets, allowing upper/lower case extensions for crosshair graphics and ldplayer chd files.
* Having decided to look at the MAME source again, I have a fairly minor patch: Aaron Giles2009-03-191-1/+1
| | | | | | | | | | | | | | | | | | | * Fix build of ldplayer on OS X. Since the CUSTOM sound module no longer exists, I arbitrarily changed it to WAVE, as ar gets upset if it has no input files. I also removed the -all_load flag for ldplayer from the main makefile as it upsets the linker on OS X. * Fix build for PPC64 Linux. (This slightly messes up static branch prediction hints on OS X and AIX, but OS X for PPC64 is dead, and no- one builds MAME for AIX, and it will still build, anyway.) * Paramaterise the arguments to check for NULL in the ATTR_NONNULL macro rather than just checking the first argument. This requires compiler support for C99 variadic macros (MSVC2005 and GCC4 have this AFAIK). Vas
* Another batch of tagging, this time for speakers/screens: Aaron Giles2009-02-251-3/+3
| | | | | | | | | | | SPEAKER/"left" -> "lspeaker" SPEAKER/"right" -> "rspeaker" SCREEN/"left" -> "lscreen" SCREEN/"right" -> "rscreen" SCREEN/"middle" -> "mscreen" SCREEN/"center" -> "cscreen" Added "left" and "right" to the validity check.
* Device tag renaming. Moving away from generic names like "main" Aaron Giles2009-02-251-3/+3
| | | | | | | | | | | | | | | to names that capture the device type as well. Added validity checks for the short-term to prevent the continuance of this pattern (which I started :) Changes: CPU/"main" -> "maincpu" CPU/"audio" -> "audiocpu" CPU/"sound" -> "soundcpu" SCREEN/main -> "screen" (since it's the only one) Eventually, devices will be required to have unique tags within a machine, regardless of type.
* Ok, this is The Big One. Aaron Giles2009-02-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Please note: regression testing is in progress, but the first round of glaring regressions have already been taken care of. That said, there is likely to be a host of regressions as a result of this change. Also note: There are still a few rough edges in the interfaces. I will try to clean them up systematically once the basic system is working. All sound chips are now proper devices. Merged the sound chip interface into the device interface, removing any differences (such as the whole ALIASing concept). Modified every sound chip in the following ways: * updated to match the device interface * reduced read/write handlers down to the minimal number * added the use of get_safe_token() for ensuring correctness * other minor cleanup Removed the custom sound device. The additional work to just make custom sound cases into full devices is minimal, so I just converted them all over to be actual devices. Vastly simplified the sound interfaces, removing the ghastly sndti_* business and moving everyone over to using tags for sound identity. sndintrf, like cpuintrf, is now just a header file with no implementation. Modified each and every driver that references a sound chip: * all memory maps explicitly reference the targeted device via AM_DEVREAD/AM_DEVWRITE/AM_DEVREADWRITE * 16-bit and 32-bit accesses to 8-bit chips no longer use trampoline functions but instead use the 8-bit AM_DEVREAD/WRITE macros * all references to sound chips are now done via tags * note that these changes are brute force, not optimal; in many cases drivers should grab pointers to devices in MACHINE_START and stash them away
* Cleanups and version bump.mame0129 Aaron Giles2009-01-041-1/+1
* ldplayer works again. Added MDRV_LASERDISC_GET_DISC callback hook Aaron Giles2009-01-011-66/+76
| | | | | which allows for dynamically finding the CHD, rather than relying on the DRIVER_INIT hackery that was there before.
* 02758: linking ldplayer fails Aaron Giles2008-12-261-1/+1
| | | | | | Cleaned up mcs48 to be dependent on a single makefile define, rather than separate defines for each CPU which didn't really buy us anything in terms of code size or performance.
* Changed timer_alloc, timer_set, timer_pulse, timer_call_after_resynch, Aaron Giles2008-11-261-4/+4
| | | | | and timer_get_time to pass the machine parameter. Moved timer globals to hang off of the running_machine.
* Made the Z80 daisy chain aware of referencing device-specific devices. Aaron Giles2008-10-091-0/+1
| | | | | | | | 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.
* Cleanups and version bump.mame0127u4 Aaron Giles2008-09-181-1/+1
* Changed requirements for laserdisc CHDs to require a new chunk of Aaron Giles2008-09-181-64/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | metadata with pre-decoded frame information. Modified chdman to automatically produce this for CHDs that are of the appropriate parameters. To fix up existing CHDs, use chdman -fixavdata on the CHD. Modified the laserdisc core to leverage the pre-decoded frame metadata, which is now required. This improves seek times when searching and allows the player-specific emulation access to the VBI data as soon as it would really be available. Changed update callback timing to fire just before the first line of VBI data would be read; at that point, the frame selection is assumed to be committed. Converted PR-8210 emulation over to using the actual MCU from the laserdisc player. This MCU controls low-level functions such as slider position and laser on/off, and receives decoded vertical blanking data in order to make decisions. Removed old HLE behavior. Note that the overlay text is displayed via the UI; this is temporary and will be fixed shortly. Converted Simutrek-hacked laserdisc emulation to using the actual MCU from the game, which in turn hands off commands to the PR-8210 MCU. This is still not 100% but is pretty close at this point and achieves the correct behaviors in most cases. Fixed Cube Quest overlay scaling to cover the whole screen. Changed laserdisc video parameters to position the screen area at the bottom rather than the top, since this corresponds more closely to standard line numbering. Extended the vbiparse code to support pack/unpack, and to more fully document all the meanings of the VBI codes. Updated ldplayer to support slow/fast forward movement, frame/chapter display, and separate controls for scanning/stepping. Added new built-in variable "frame" to the debugger. Fixed device-based ROM loading to support loading ROMs from the game's ZIP as well.
* Changed DEVICE_START functions to return an error code. Currently this Aaron Giles2008-09-093-21/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is either DEVICE_START_OK or DEVICE_START_MISSING_DEPENDENCY. The latter should be returned by a device if there is another device it depends on which hasn't been started yet. Added new flag in the device interface to indicate whether a device has been started. Changed laserdisc interface to explicitly specify the screen and sound devices it should route to. Drivers no longer have to manually call laserdisc_vsync(). Instead, the laserdisc code connects up to the routed screen device and works based on that screen's VBLANK timing. Removed all existing calls to laserdisc_vsync(). Changed laserdisc behavior so that it completes the previous video read and initiates the next read at the end of VBLANK instead of the beginning. This gives player logic time during VBLANK to alter the slider position prior to fetching the next frame. Added new laserdisc callback for vsync begin and changed the update callback to be called at the end of VBLANK. Also added functions to set the slider speed, advance the slider, and directly control the video/ audio squelch. In addition, there is a new status function to get the slider position in general terms. Added parameter to the VBLANK callbacks supported in emu/video.c. Updated all callers to provide a callback value. Fixed bug that would cause watchpoints to trigger if you had a memory window open to the watchpoint address. Further updates to the PR-8210 ROM simulation. Still not quite there but the system is much better understood now. Added layout to the PR-8210 which displays the state of the front-panel LEDs.
* Added new device interface selector: DEVINFO_PTR_ROM_REGION. This allows a Aaron Giles2008-09-061-197/+0
| | | | | | | | | | | | | | | | | | | | | | 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.
* Split core laserdisc functionality into separate file ldcore.c. Aaron Giles2008-09-041-42/+24
| | | | | | | | | | Each player now gets its own source file, along with new hooks which enable more precise control over the behavior. Updated the PR-8210 and LD-V1000 implementations to the new spec. Other players will come online shortly. Changed scan behavior so that it requires a constant stream of signals to continue scanning. Updated ldplayer accordingly.
* Cleanups and version bump.mame0127u1 Aaron Giles2008-08-281-80/+80
* Significant cleanup/rewrite of the MCS-48 CPU core: Aaron Giles2008-08-261-3/+3
| | | | | | | | | | | | * removed redundant and unused definitions from header file * renamed constants and functions to be MCS48* prefixed * re-verified all opcode behaviors and timing * changed illegal opcodes to count 1 cycle to avoid infinite loops * changed EA behavior so that it is a push from the driver instead of a pull on each opcode fetch (this may change further in the future). * reimplemented IRQ generation and timer behavior according to documentation * updated all drivers accordingly * fixed several uses of PULSE_LINE, which no longer works
* i8039 -> mcs48 Aaron Giles2008-08-261-1/+1
* Changed i8039 core to use the data address space for internal RAM. Aaron Giles2008-08-252-0/+200
| | | | | | | | | | | | | | | | | | Register access is still performed using direct memory accesses, but the pointers are fetched through the memory system. Now you can see i8039 RAM in the debugger. Added internal memory maps of the appropriate size so that drivers don't need to declare this RAM. Added a number of variants from the MCS-48 family as it was not clear which variants had what capabilities. All documented variants now have internal memory maps for internal ROM and RAM. Removed memory maps from drivers using embedded ROM/EPROM/OTPROM since they are defined by the core now. Added some initial logic to boot and run the PR-8210 ROM (i8049) in ldplayer.c. Currently this is disabled behind a compile-time switch. Once this is working, the plan is to incorporate this into the existing PR-8210 emulation, but we're not there yet.
* Added PR-8210 support to the ldplayer. Fixed step forward command on the ↵ Aaron Giles2008-08-222-85/+257
| | | | | | | | | | | | 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
* From: Atari Ace [] Aaron Giles2008-08-201-16/+139
| | | | | | | | | | | | Subject: [patch] fd1089 external keys Hi mamedev, The attached patch moves the fd1089 decryption keys out of the source of MAME and into the ROM files. Nicola suggested this would now be reasonable, so long as the incomplete ones were marked with BAD_DUMP. ~aa
* Added new generic laserdisc VIDEO_UPDATE handler to the laserdisc code. Aaron Giles2008-08-181-47/+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.
* Cleanups and version bump.mame0126u5 Aaron Giles2008-08-141-15/+15
* Moved several include files from mame/ to emu/, as they were Aaron Giles2008-08-133-0/+426
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