summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/video
Commit message (Collapse)AuthorAgeFilesLines
* Fix MT04059: Add new method reset_origin() to screen devices to allow Aaron Giles2010-10-181-0/+3
| | | | | | | | | | manual synchronization of VBLANK start against an external timing source. Updated the MC6845 device to call reset_origin() on its screen at the start of each frame if a screen is present. The practical upshot is that now the screen timing and MC6845 timing is once against synchronized, but by tying the screen timing to the MC6845 and not the other way around.
* Cleanups and version bump. Aaron Giles2010-10-141-1/+1
|
* Converted render.c objects into C++ objects. Updated all callers. Aaron Giles2010-10-131-3/+3
|
* v9938 - Set default value for status register 4 and 6 [Michael Zapf] Miodrag Milanovic2010-10-061-0/+12
|
* Cleanups and version bump.mame0139u3 Aaron Giles2010-09-191-1/+1
|
* Removed generic.videoram and generic.videoram_size. These generics Aaron Giles2010-09-082-27/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | have no core use, they are simply there for the convenience of drivers. Now that drivers are required to have devices, the data should move there. [Atari Ace] ---------- Forwarded message ---------- From: Atari Ace <atari_ace@frontier.com> Date: Sun, Sep 5, 2010 at 4:45 PM Subject: [patch] Eliminate generic.videoramm generic.videoram_size To: submit@mamedev.org Cc: atariace@hotmail.com Hi mamedev, This set of patches removes generic.videoram and generic.videoram_size. These generics have no core use, they are simply there for the convenience of drivers. Now that drivers are required to have devices, the data should move there. The first patch sets the stage for the rest of the patch. It includes several changes. 1. It replaces all the uses of generic.videoram_size with appropriate constants. 2. It eliminates the write handlers from pc_video.c. These are unused in MAME and MESS appears to have a private copy. 3. It splits some drivers: a. It separates mcr68 from the mcr driver, mostly by dividing machine/mcr.c. b. It separates naughtyb from the phoenix driver by introducing an audio/pleiads.h include. c. It replaces video/system1.h with includes/system1.h. 4. It fixes some videoram related bugs. a. balsente, mole didn't need videoram. b. sbowling has a dangling reference to videoram from an earlier driver_data conversion 5. It expands some namcona functions to multiple lines so that later scripted-edits look sensible. The second patch is generated by vram01_1.pl. It introduces videoram local variables in function that use videoram read-only and removes AM_SIZE_GENERIC(videoram). The third patch is generated by vram01_2.pl. It replaces all occurances of generic.videoram with state->videoram, introducing/modifying driver_device classes as needed. The fourth patch then actually removes the generics, and fixes one issue the scripts didn't handle. ~aa
* Changed the MACHINE_DRIVER_* macros, as follows: Aaron Giles2010-09-014-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Renamed MACHINE_DRIVER_* to MACHINE_CONFIG_* to match the name of the object it actually describes. The MDRV_* prefix may eventually be bulk updated at some point, but not now. 2. MACHINE_CONFIG_START() now takes a driver_data_t-derived class as a required second parameter. This means that MDRV_DRIVER_DATA() is no longer required, and every "root" machine config *must* specify a driver data class (or driver_data_t itself if the driver has not yet been updated to use driver data). 3. New MACHINE_CONFIG_DERIVED() macro defines a machine_config that is derived from another machine_config. This takes the place of the very typical MACHINE_DRIVER_START()/MDRV_IMPORT_FROM() combination. 4. New MACHINE_CONFIG_FRAGMENT() macro defines a partial machine_config that can only be included in another "root" machine_config. This is also used for machine_configs that are specified as part of a device. 5. Changed MDRV_IMPORT_FROM() to MDRV_FRAGMENT_ADD() to more accurately describe what is happening. 6. Added asserts to the above three macros to ensure they are properly used. Updated all machine drivers to use the new macros. Search & replace lists below cover 99% of the changes, with just a few manual fixups. S: MACHINE_DRIVER_START\( *([a-zA-Z0-9_]+) *\)[\r\n\t ]*MDRV_DRIVER_DATA\( *([a-zA-Z0-9_]+) *\) R: MACHINE_CONFIG_START\( \1, \2 \) S: MACHINE_DRIVER_START\( *([a-zA-Z0-9_]+) *\)[\r\n\t ]*/\* driver data \*/[\r\n\t ]*MDRV_DRIVER_DATA\( *([a-zA-Z0-9_]+) *\) R: MACHINE_CONFIG_START\( \1, \2 \) S: MACHINE_DRIVER_START\( *([a-zA-Z0-9_]+) *\)[\r\n\t ]*MDRV_IMPORT_FROM\( *([a-zA-Z0-9_]+) *\) R: MACHINE_CONFIG_DERIVED\( \1, \2 \) S: MACHINE_DRIVER_START\( *([a-zA-Z0-9_]+) *\)[\r\n\t ]*/\* basic machine hardware \*/[\r\n\t ]*MDRV_IMPORT_FROM\( *([a-zA-Z0-9_]+) *\) R: MACHINE_CONFIG_DERIVED\( \1, \2 \)\r\n\r\n\t/\* basic machine hardware \*/ For all files outside of mame/drivers.... S: MACHINE_DRIVER_START R: MACHINE_CONFIG_FRAGMENT in all non-drivers For all files within mame/drivers.... S: MACHINE_DRIVER_START\( *([a-zA-Z0-9_]+) *\) R: MACHINE_CONFIG_START\( \1, driver_data_t \) S: MDRV_IMPORT_FROM R: MDRV_FRAGMENT_ADD S: MACHINE_DRIVER_END R: MACHINE_CONFIG_END S: MACHINE_DRIVER_NAME R: MACHINE_CONFIG_NAME S: MACHINE_DRIVER_EXTERN R: MACHINE_CONFIG_EXTERN Final step: run mame -valid and fix the incorrect macros at the lines where the asserts show up.
* mc6845.c: Rewritten to allow mid frame changes to the counter registers. ↵ Wilbert Pol2010-08-311-222/+232
| | | | | | | | | | | | | | | This enables drivers to use advanced split screen and scrolling effects using a regular mc6845. [Wilbert Pol] Interface change: The screen tag is no longer mandatory. If a screen tag is provided then the mc6845 device will resize the screen and visible area based on the parameters set in the 6845 config and registers. If the screen tag is not provided then the driver is supposed to be in charge of setting the proper screen configuration. Warning: This breaks the relationship between the timing of a screen device and the signals generated by the 6845.
* Fixed MT#04036: astrowar: [debug] Severe graphic corruption Scott Stone2010-08-311-1/+1
|
* Put a BSD license on the voodoo emulation so the DOSbox guys can stop Aaron Giles2010-08-213-13/+114
| | | | fretting over it.
* I had originally wanted to convert the profiler to use scopes (e.g., Aaron Giles2010-08-211-8/+8
| | | | | | | | | | | | | | | | | create a stack class that started the profiler in the constructor and stopped it in the destructor). Sadly, doing that causes gcc to call out to hook up the unwind chain, and this tanks performance quite badly, even when the profiler is off. Since I had already class-ified profiler.c, I decided to keep the old way of doing things but wrap it in the newer classes. So at least it wasn't a complete waste of my time. Search & replace: profiler_mark_start -> g_profiler.start profiler_mark_end -> g_profiler.end
* Replace "const address_space" with "address_space" throughout the system. Aaron Giles2010-08-193-10/+10
| | | | | | | | | | | The purpose of making it const before was to discourage direct tampering, but private/protected does a better job of that now anyhow, and it is annoying now. s/const[ \t]+address_space\b/address_space/g; Is basically what I did.
* 03992: btoads: Reload of state cause major graphic corruption [Phil Bennett] Phil Bennett2010-08-162-96/+121
| | | Converted TLC34076 to a device [Phil Bennett]
* Removed several exported non-const global variables from the core [Atari Ace] Phil Bennett2010-08-136-10/+4
| | | | | | | | | | | | | | | | | | | | | ---------- Forwarded message ---------- From: Atari Ace <atari_ace@frontier.com> Date: Sat, Aug 7, 2010 at 9:38 PM Subject: [patch] Eliminate more exported non-const globals from MAME core To: submit@mamedev.org Cc: atariace@hotmail.com - Hide quoted text - Hi mamedev, This patch eliminates a few more non-const global vars coming out of the MAME core. Vectorram/vectorram_size from vector.h in fact is unused by the core, it's really for avgdvg support, and is also confusingly used by segag80, so most of the patch is disentangling those uses. ~aa
* Added sound support to Signetics S2636 (by using VC4000 sound support from ↵ mariuszw12010-08-122-0/+11
| | | | MESS). Hooked up sound to Malzak, Galaxia and Astro Wars [Mariusz Wojcieszek]
* - Updated SAA5050 to form 12x20 chars as noted in documentation [Miodrag ↵ Miodrag Milanovic2010-08-051-3/+3
| | | | | | Milanovic] - Updated malzak driver to support SAA5050 changes
* Split mame.c into mame.c and machine.c, the latter containing the Aaron Giles2010-06-301-3/+3
| | | | | | | | | | | | | | | | | | | running_machine definition and implementation. Moved global machine-level operations and accessors into methods on the running_machine class. For the most part, this doesn't affect drivers except for a few occasional bits: mame_get_phase() == machine->phase() add_reset_callback() == machine->add_notifier(MACHINE_NOTIFY_RESET, ...) add_exit_callback() == machine->add_notifier(MACHINE_NOTIFY_EXIT, ...) mame_get_base_datetime() == machine->base_datetime() mame_get_current_datetime() == machine->current_datetime() Cleaned up the region_info class, removing most global region accessors except for memory_region() and memory_region_length(). Again, this doesn't generally affect drivers.
* Made the machine_config a proper object. Added detokenize method to Aaron Giles2010-06-282-11/+11
| | | | | | | | | | | | 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.
* Cleanups and version bump. Aaron Giles2010-06-173-3/+3
|
* Split implementation for legacy devices into a separate macro. Updated all Aaron Giles2010-06-116-0/+22
| | | | | | | | devices to use this macro in their .c file. This greatly reduces the amount of work the linker has to do to combine all the instances, and reduces the final binary size when building with symbols. Unfortunately, in order to do it I had to switch back to macros from templates, but I can live with that for legacy devices.
* WARNING: There are likely to be regressions in both functionality and Aaron Giles2010-06-0821-192/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* pcat_nit.c update [Mariusz Wojcieszek] mariuszw12010-06-054-0/+1893
| | | | | | | - added VGA emulation from MESS - added INS8250 emulation from MESS - added format decimal support to Microtouch - added rom banking and inputs to pcat_nit games - streetg(2) now boot properly
* New driver: sigmab98.c [Luca Elia] Luca Elia2010-05-162-0/+7
| | | | | | | | | | | | | New games added or promoted from NOT_WORKING status --------------------------------------------------- GeGeGe no Kitarou Youkai Slot [A. Hoekman, ranger_lennier, Smitdogg, The Dumping Union, Luca Elia] New games marked as GAME_NOT_WORKING ------------------------------------ Win Win Bingo (2 sets) [f205v, Filippo Tarderia] Zoo [Brian Troha, The Dumping Union]
* Cleanups and version bump. Aaron Giles2010-04-081-2/+2
|
* Duh. Olivier Galibert2010-04-041-2/+0
|
* poly.c: Make the parameter interpolation more robust [O. Galibert] Olivier Galibert2010-04-041-34/+34
| | | | | | | | | | | | | | The code now computes start/dpdx/dpdy to start at (0, 0) of the bitmap and not at the polygon origin. It's a more precise when the polygon is a tad big, and a lot more precise when the coordinates are big enough not to fit in an int. The code is still somewhat broken when the coordinates do not fit in an int. I'll have to see about that later. I can ignore it for now by z-clipping a little further. The subpixel correction is missing, I wasn't sure if we needed to add or substract 0.5*(dpdx+dpdy) to start. And I don't really know how to test for it either.
* [#3792, #3793] SDL compile fixes [Christian MArillat] R. Belmont2010-03-242-1/+2
| | | | | - Autodetect FreeBSD variant - Altivec/VMX fixes for non-Mac PPC
* Made device->tag and devconfig->tag into private member variables (m_tag). Aaron Giles2010-03-081-1/+1
| | | | | | Added inline tag() function to return a const char * version. Updated callers to use this instead of directly accessing tag.cstr() which was awkward.
* Cleanups and version bump.mame0136u3 Aaron Giles2010-02-141-2/+2
|
* hooked up (with a hack) gfx rom in hd63484 memory map Roberto Zandona2010-02-071-0/+8
|
* Cleanups and version bump. Aaron Giles2010-01-281-11/+11
|
* Some clean-ups... :) Roberto Fresca2010-01-262-7/+7
|
* Moved HD63484 ACRTC device from mame/video to emu/video. Roberto Fresca2010-01-262-0/+1639
|
* Popmessages can now be used in drivers which have an MC6845. Curt Coder2010-01-251-2/+0
|
* Correct a long-standing design flaw: device configuration state Aaron Giles2010-01-1815-102/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Created new template class tagged_list which manages a simple list Aaron Giles2010-01-171-1/+1
| | | | | | | | 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.
* Within src/emu, basic conversions: Aaron Giles2010-01-126-7/+7
| | | | | | devtag_get_device ... machine->device() memory_find_address_space ... device->space()
* Bulk driver.h -> emu.h switch. Aaron Giles2010-01-1013-19/+13
|
* First round of an attempted cleanup of header files in the system. Aaron Giles2010-01-109-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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!)
* NOTE: This change requires two new osd functions: osd_malloc() and Aaron Giles2010-01-085-41/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Replaced all occurrences of cputag_get_cpu with devtag_get_device: the ↵ Fabio Priuli2010-01-061-1/+1
| | | | | former function was just an alias and now cpus are no different from other devices Removed cputag_get_cpu and cputag_reset (another alias, not even used in the source) from cpuexec.h
* Cleaned up braces in the code so that they are properly balanced. [Atari Ace] Aaron Giles2009-12-282-41/+60
|
* Results of running the latest srcclean. Aaron Giles2009-12-2811-83/+83
|
* Cleanups and version bump.mame0135u4 Aaron Giles2009-12-231-7/+7
|
* From: Atari Ace <atari_ace@verizon.net> Aaron Giles2009-12-231-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Date: Tue, Dec 22, 2009 at 4:44 PM Subject: [patch] Fix srcclean/src2html bugs, misbalanced tokens and visible whitespace errors To: submit@mamedev.org Cc: atariace@hotmail.com Hi mamedev, While experimenting with srcclean and src2html as indentation validators, I stumbled across a couple of bugs. The first is that srcclean doesn't properly handle /*...*//. It sees the last / char at the end as the second / of an inline comment, where it might be a division token or the start of either type of comment. The second bug is that src2html improperly handles strings with embedded quotes preceded by escaped backslashes, e.g. "ab\\\"cd". It believes the string terminated in the middle, and the last quote starts a new string. This issue is unlikely in actual code, but should be handled correctly. The first patch fixes these, and a some cases where there are dangling/missing tokens which my validation tools are noticing. These occur in some unused macros, dead code sections, and in some macros that are deliberately misbalanced (v9938.c, psx.c). In the deliberate cases, I balanced the braces by making exactly one open and one close macro and using those throughout. The second patch is then a set of visible whitespace "problems". Cases where the closing brace isn't at the same indent level as the open brace, and some cases where the indent level isn't a multiple of four. In the case of ssv.c I folded the assignments into init_ssv() to simplify the code and restore the brace balance, otherwise I kept to simply adding or removing whitespace. ~aa
* Some misc cleanups: Aaron Giles2009-12-151-1/+1
| | | | | | | | | | | | | | | | - added warning messages for auto_malloc, timer, and save state allocations done after init time. These should be fixed when detected, as I would eventually like to disallow them entirely. - changed state registration functions to pass through the caller's file and line number to facilitate fixing the above warnings - converted Taito F3 sound to a separate machine driver which is imported into games that use it - converted the balsente driver to driver_data structure - converted harddriv timers into devices - fixed crash in cps2 games due to not configuring the qsound bank - cleaned up initialization in taito_l to allocate at init time instead of reset time
* Imported SAA5050 emulation from MESS and made it a device. Updated malzak.c ↵ Fabio Priuli2009-12-122-0/+452
| | | | | to use it, removing the almost identical implementation in the driver. Out of whatsnew: Unfortunately, I was unable to make both malzak and p2000t (in MESS) to work without a small kludge, clearly documented in the source. I plan to further investigating the problem once I manage to merge the other 505x variants (later)
* Fixed stupid copy&paste mistake in s2636.c Fabio Priuli2009-12-111-1/+1
| | | This is what you get when you forget to press save before the commit :(
* Cleanups and version bump.mame0135u3 Aaron Giles2009-12-112-2/+2
|
* Converted Signetics 2636 video chip to be a MAME device and updated drivers ↵ Fabio Priuli2009-12-112-53/+152
| | | | | | | using it accordingly Also, added driver data struct and save states to laserbas.c, laserbat.c, lastfght.c, lazercmd.c and lemmings.c Finally, added driver data struct to lasso.c