summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/video.c
Commit message (Collapse)AuthorAgeFilesLines
* Made CPUs into proper devices. CPUs are now added in the Aaron Giles2008-12-161-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | machine configuration just as any other device, and the standard CPU configuration is performed via the inline configuration macros. Change cpu_type from an enumeration into a pointer to the CPU's get_info function, very similar to device behavior. For now all CPUs are declared in cpuintrf.h, but eventually they should be declared in the CPU's header file, and the driver should #include that header. Added function cpu_get_type() to return the CPU type. Changed several cpu_* functions into macros that call through to the equivalent device_* function. The device system now maintains a parallel list of devices based on type, for faster iteration through all devices of a given type. Cleaned up code that looped over CPUs via the machine->cpu array to now loop using the type-based device list. Removed start/stop/reset/nvram functions from the device_config in favor of grabbing them as needed. Cleaned up the generic interrupt_enable code to work with CPU devices instead of numbers. Mapped the devtag_* functions to device_* functions via macros instead of parallel implementations.
* From: Atari Ace [mailto:atari_ace@verizon.net] Aaron Giles2008-12-141-1/+1
| | | | | | | | | | | | | | | | | | | Sent: Saturday, December 13, 2008 5:07 PM To: submit@mamedev.org Cc: atariace@hotmail.com Subject: [patch] Add machine to allocgfx Hi mamedev, This patch eliminates the #include "deprecat.h" from drawgfx.h. It does so in a fashion similar to my recent tilemap patch, adding the machine pointer to gfx_element, changing allocgfx to take a machine, and then adjusting the internals to use the machine field as needed. The changes outside of drawgfx.[ch] were done with the attached script. ~aa
* Changed save state system to accept machine parameters where Aaron Giles2008-12-051-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | appropriate, and to keep all global variables hanging off the machine structure. Once again, this means all state registration call sites have been touched: - state_save_register_global* now takes a machine parameter - state_save_register_item* now takes a machine parameter - added new state_save_register_device_item* which now uses the device name and tag to generate the base name Extended the fake sound devices to have more populated fields. Modified sound cores to use tags from the devices and simplified the start function. Renumbered CPU and sound get/set info constants to align with the device constants, and shared values where they were perfectly aligned. Set the type field in the fake device_configs for CPU and sound chips to a get_info stub which calls through to the CPU and sound specific get_info functions. This means the device_get_info() functions work for CPU and sound cores, even in their fake state. Changed device information getters from device_info() to device_get_info() to match the CPU and sound macros.
* Changed timer_alloc, timer_set, timer_pulse, timer_call_after_resynch, Aaron Giles2008-11-261-16/+16
| | | | | and timer_get_time to pass the machine parameter. Moved timer globals to hang off of the running_machine.
* Added "tag" parameter to state_save_register_item_* calls. Removed Aaron Giles2008-11-171-21/+16
| | | | | | state_save_combine_module_and_tag() function in favor of passing the tag when registering. Revisited all save state item registrations and changed them to use the tag where appropriate.
* 02488: All sets with using 2+ monitors: Crash to desktop on second play Aaron Giles2008-10-091-1/+2
| | | | | 02439: tx1: TX1 quits out on second launch 02266: tceptor: Thunder Ceptor crashes out when run as the second game
* Plumbed machine parameters through the renderer. Removed need for Aaron Giles2008-09-291-9/+12
| | | | | | | | | | | | | | | | | | | | | | | deprecat.h. Changed render_texture_set_bitmap() to accept a palette object instead of a palette index. The renderer remains optimized for the system palette but will work if objects have their own palette as well. Changed renderer to permit palettes for RGB and YUY textures. If specified, these palettes specify a 32-entry (RGB15) or 256-entry (others) lookup for applying additional brightness/contrast/gamma on a per-texture basis. Removed rescale notification. It never really worked that well and violated proper layering. Renamed palette_set_brightness() to palette_set_pen_contrast() for clarity. Changed palette objects to support global brightness/contrast/gamma in addition to per-group and per-entry controls.
* 02442: -aviwrite produces faulty files Aaron Giles2008-09-271-2/+2
|
* Cleanups and version bump.mame0127u3 Aaron Giles2008-09-111-1/+1
|
* Changed DEVICE_START functions to return an error code. Currently this Aaron Giles2008-09-091-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Cleanups and version bump.mame0127u2 Aaron Giles2008-09-041-1/+1
|
* Changed refreshspeed target to 0.25Hz below rate provided, in order to ↵ Aaron Giles2008-09-031-2/+4
| | | | | | guarantee that inexact timings do not lead to sound stuttering.
* Changed slider controls into a menu. For now, removed the old direct access Aaron Giles2008-08-281-1/+1
| | | | | | mechanism; instead, you must access the sliders via the main menu. While in the menu, you can use the ~ key to turn off the menu display and leave only the bar display, in order to see more of the screen.
* Region classes go bye-bye. Aaron Giles2008-07-281-3/+3
|
* Changed the way memory regions are referenced. Instead of a single Aaron Giles2008-07-281-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Replaced the crazy number of get/set functions for render containers with Aaron Giles2008-07-131-4/+7
| | | | a single get/set of a user settings struct.
* 01963: screenless systems: memory leak with -mngwrite Aaron Giles2008-07-061-5/+2
|
* Partial fix: 01945: All asteriod.c sets: Assertions Couriersud2008-06-281-2/+2
| | | | | * fixes assert: src/emu/video.c:664: visarea->min_x < width * Test whether screen type is vector and ignore min_x < width in this case * This affected a number of vector games and the only other fix would be to rewrite the vector code
* Cleanups/version bump.mame0125u7 Aaron Giles2008-06-261-2/+2
|
* Removed DEBUGGER flag from makefile and ENABLE_DEBUGGER Aaron Giles2008-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | macro from the source code. All MAME builds now include the debugger, and it is enabled/disabled exclusively by the runtime command-line/ini settings. This is a minor speed hit for now, but will be further optimized going forward. Changed the 'd' suffix in the makefile to apply to DEBUG builds (versus DEBUGGER builds as it did before). Changed machine->debug_mode to machine->debug_flags. These flags now indicate several things, such as whether debugging is enabled, whether CPU cores should call the debugger on each instruction, and whether there are live watchpoints on each address space. Redesigned a significant portion of debugcpu.c around the concept of maintaining these flags globally and a similar, more complete set of flags internally for each CPU. All previous functionality should work as designed but should be more robust and faster to work with. Added new debugger hooks for starting/stopping CPU execution. This allows the debugger to decide whether or not a given CPU needs to call the debugger on each instruction during the coming timeslice. Added new debugger hook for reporting exceptions. Proper exception breakpoints are not yet implemented. Added new module debugger.c which is where global debugger functions live.
* 01927: Effects overlay showing in snapshots Aaron Giles2008-06-241-8/+12
| | | | Explicitly disabled overlays for non-native snapshots (native snapshots already had them disabled)
* From: Atari Ace [mailto:atari_ace@verizon.net] Aaron Giles2008-06-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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.
* Save state support: Aaron Giles2008-06-231-41/+79
| | | | | | | | | | | | | | | * added save state support to the MIPS3 recompiler * added save state support to CAGE audio system * added save state support to the voodoo emulator * added save state support to the smc91c9x emulator * added save state support to the kinst, seattle, and vegas drivers * fixed core video handling of save states with dynamic screen resolutions SMC91C9x: * converted to proper device * updated seattle and vegas drivers to allocate devices * added separate 91C96 device for eventual 2049 use * cleaned up code
* Cleanups and version bump.mame0125u6 Aaron Giles2008-06-171-8/+8
|
* Added new function video_get_view_for_target() which selects a view based Aaron Giles2008-06-161-18/+78
| | | | | | on a command-line parameter and the configuration. Changed Windows OSD code to use this instead of its own logic. Changed -snapview to share the logic as well, enabling 'auto' as a -snapview option.
* Cleaned up software bilinear filtering code. Added bounds checking. Aaron Giles2008-06-161-134/+221
| | | | | | | | | | | | | | | | | | | | | Enabled by default for snapshots and movie rendering. Added new option: -snapsize, which lets you specify the target resolution for snapshots and movies. The existing behavior is still the default: create snapshots and movies at native pixel resolutions. Added new option: -snapview, which lets you specify a particular view to use for rendering snapshots and movies. The existing behavior is still the default: use a special internal view and render each screen to its own snapshot in its own file. When using this option to specify a view other than 'internal', only a single snapshot file will be produced regardless of how many screens the game has. Improved AVI and MNG recording to properly duplicate/skip frames as appropriate to keep the correct framerate.
* 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]
* Cleanups for 0.125u3. Aaron Giles2008-05-291-8/+8
|
* Added new option -snapname which lets you provide a template for how snapshot Aaron Giles2008-05-291-15/+50
| | | | | | | names are generated. Added new astring functions astring_del, astring_replace, and astring_replacec to help perform simple search/replace substitution.
* Cleanups and version bump.mame0125u1 Aaron Giles2008-05-151-8/+8
|
* Added uncompressed AVI recording. Extended aviio to be able Aaron Giles2008-05-131-41/+195
| | | | | | | | | | | | | | | | | | | to write RGB bitmaps. Unfortunately, the only option is fully uncompressed, which means the resulting AVIs are *HUGE* and may not play correctly in realtime due to high data rate. The intention is that these uncompressed AVIs are post-processed by other utilities to compress the video and produce a realtime playable result. Added new command-line option -aviwrite which works just like -mngwrite, except it produces AVIs and streams sound to them. Updated documentation accordingly. Shift+F12 still produces MNGs for now, though this might change in the future. Modified fileio.c to retain the full pathname to the file so that it can be queried while the file is open.
* Fix 01742: punchout, armwrest + many vsnes.c and playch10.c games: ↵ Aaron Giles2008-04-241-4/+6
| | | | Refreshspeed causes fatal exception in punchout.
* From: Atari Ace Aaron Giles2008-04-211-6/+5
| | | | | | | | | | | Subject: [patch] Fix 01711: connect4, mpu4met0, mpu4tst2, mpu4utst, bctvidbs: Using -CHEAT trigger causes a crash Hi mamedev, This patch fixes bug 01711. Given the location of the original assert it is clear the original code wasn't quite right. ~aa
* Cleanups and version bump to 0.124u2.mame0124u2 Aaron Giles2008-04-121-3/+3
|
* 01609: Various - tested srmp4 (ssv.c), ttmahjng (route16.c), vsmahjng ↵ Aaron Giles2008-04-061-0/+11
| | | | | | | | | | | | | | | (vsnes,c), tokkae (konamigx.c), sf2 (cps1.c): INP playback loses sync quickly Rewrote INP recording from scratch, since all old INPs are broken anyways. Header now includes timestamp, which overrides the default time base for MAME's system time. Each frame recorded now gets a timestamp. Analog ports are recorded once per frame and interpolated. Analog port calculations are all done in fixed point for consistent results. A bunch of other minor tweaks in the input port code. There may still be a few changes to the final INP format (considering adding NVRAM data directly in the INP file, for example....) but this at least seems to work for the games I've tried.
* Actually fixed -refreshspeed. Aaron Giles2008-04-041-17/+45
|
* Minor cleanup and simplification. Removed palette_config(). Aaron Giles2008-03-281-13/+12
|
* Fixed: Aaron Giles2008-03-281-6/+15
| | | | | - 01622: [Core] -refreshspeed has no effect (aaron) - Resolved.
* From: Duke [mailto:startaq@gmail.com] Aaron Giles2008-03-231-1/+0
| | | | | | | | | | | | | | | Subject: Unnecessary assert in video.c The assert assert(machine->config->devicelist != NULL); in video.c causes the MESS mk1 driver to fail because it doesn't have any devices - no screens and no sound devices. It works fine when the assert is removed. --Dirk
* Cleanups and version bump.mame0123u6 Aaron Giles2008-03-191-2/+2
|
* Added return value to video_screen_update_partial() indicating whether Aaron Giles2008-03-191-4/+7
| | | | | | | | | or not the VIDEO_UPDATE was called as a result. Modified amiga.c to use this information so that we guarantee a call to amiga_render_scanline() regardless of the video state. Fixes 01521: ar_sdwr: Game hangs on title screen
* Moved per-screen initialization into DEVICE_START and per-screen cleanup Aaron Giles2008-03-171-110/+95
| | | | into DEVICE_STOP.
* Fix chicken and egg problem with device_start callbacks. Aaron Giles2008-03-171-6/+3
| | | | | | | | | | | | | | | | | | Added DEVINFO_INT_TOKEN_BYTES, which is queried before device startup. It should return the size of the structure that will be hung off of device->token. It must not return 0. Changed the core device interface to allocate and zero a block of memory the size of DEVINFO_INT_TOKEN_BYTES before calling device_start. The pointer to this memory is already attached to device->token at the time device_start is called. The primary motivation for this is to allow the device_start function to make internal calls and pass the device_config * around as if the object were fully constructed. Since the token is used to indicate whether or not a device is live, this makes the device "live" at the time device_start is called rather than after it completes.
* Fixed: 01508: most vector-based drivers: Assertions Zsolt Vasvari2008-03-151-3/+3
|
* Renamed *_vbl_cb to *_vblank_callback. Aaron Giles2008-03-141-43/+66
| | | | | | Fixed 01475: Screenless systems are broken because of a vblank callback. We now create an artificial update mechanism when there are no screens.
* Cleanups and version bump to 0.123u5.mame0123u5 Aaron Giles2008-03-131-2/+2
|
* - Removes the public screen_state object -- all access is via functions Zsolt Vasvari2008-03-131-199/+211
| | | | | - Removes screen[] object from running_machine - Removed MAX_SCREENS constant -- there is no longer a hardcoded upper bound
* video_screen_get_vblank() was also incorrect for games with ↵ Zsolt Vasvari2008-03-121-3/+6
| | | | MDRV_SCREEN_VBLANK_TIME, this could easily explain a bunch of changed screenshots.
* Forgot to state save a variable Zsolt Vasvari2008-03-121-1/+3
|
* Fixed VBLANK end time computation -- it wasn't taking into account games ↵ Zsolt Vasvari2008-03-121-5/+26
| | | | | | that use MDRV_SCREEN_VBLANK_TIME Aaron, could you please double check what I did?