Commit Graph

38 Commits

Author SHA1 Message Date
Scott Stone
30cda1d3e5 A round of spelling/typographical fixes to source comments (nw) 2016-11-24 09:24:01 -05:00
Vas Crabb
8179a84458 Introduce u8/u16/u32/u64/s8/s16/s32/s64
* New abbreviated types are in osd and util namespaces, and also in global namespace for things that #include "emu.h"
* Get rid of import of cstdint types to global namespace (C99 does this anyway)
* Remove the cstdint types from everything in emu
* Get rid of U64/S64 macros
* Fix a bug in dps16 caused by incorrect use of macro
* Fix debugcon not checking for "do " prefix case-insensitively
* Fix a lot of messed up tabulation
* More constexpr
* Fix up many __names
2016-11-19 05:38:48 +11:00
Miodrag Milanovic
2027d59e7f Do not use FUNC in delegate where applicable (nw) 2016-11-06 14:11:55 +01:00
Miodrag Milanovic
ddb290d5f6 NOTICE (TYPE NAME CONSOLIDATION)
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8
also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
2016-10-22 13:13:17 +02:00
Miodrag Milanovic
6e1adc4386 simplified memory management for save states and states (nw) 2016-07-01 19:51:07 +02:00
Miodrag Milanovic
89c5e1f681 Various cleanups suggested by static analyzer (nw) 2016-04-24 12:58:31 +02:00
Miodrag Milanovic
4e8e3066f8 reverting:
SHA-1: 1f90ceab07

* tags are now strings (nw)
fix start project for custom builds in Visual Studio (nw)
2016-01-20 21:42:13 +01:00
Miodrag Milanovic
7c9cd3feea Revert "rest of device parameters to std::string (nw)"
This reverts commit caba131d84.
2016-01-20 21:35:11 +01:00
Miodrag Milanovic
caba131d84 rest of device parameters to std::string (nw) 2016-01-16 20:05:32 +01:00
Miodrag Milanovic
1f90ceab07 tags are now strings (nw)
fix start project for custom builds in Visual Studio (nw)
2016-01-16 14:54:42 +01:00
Miodrag Milanovic
5a2f80dcde clang-modernize part 5 2015-12-04 07:06:18 +01:00
Miodrag Milanovic
91605d3f4d clang-modernize part 1 (nw) 2015-12-03 18:17:25 +01:00
couriersud
fe8e6aca65 Added seconds() and attoseconds() to attotime and prefixed members with
m_. Rewrote code accessing members to use seconds() and attoseconds(). 

The changes were triggered by a test how gcc __int128_t would perform as
the internal representation. This test revealed that the current
implementation is still faster. (nw)
2015-08-15 17:56:10 +02:00
Cowering
9306af2c50 some extremely low hanging pedantic fruit 2015-07-08 14:00:24 -05:00
Ivan Vangelista
0894a05722 Completed state_save_register_item* removal (nw) 2015-04-23 22:03:23 +02:00
Miodrag Milanovic
54f8b3ae5d moved all to std::string (nw) 2015-04-22 11:30:45 +02:00
Miodrag Milanovic
6a41d76a80 removed not used state_save_register_item_* calls (nw) 2015-04-18 15:18:05 +02:00
Olivier Galibert
278cf84e55 Replace dynamic_array with std::vector [O. Galibert] 2015-04-14 19:58:17 +02:00
Miodrag Milanovic
2edee0b811 updated astring constructors to have just one string param, to be more like std::string (nw) 2015-04-13 12:25:21 +02:00
Miodrag Milanovic
7faba31b1b There is no implicit conversion to char* in std::string (nw) 2015-04-12 08:05:43 +02:00
Olivier Galibert
eeedd8a4ca save: Give the device when available to the state save subsystem [O. Galibert] 2015-02-14 20:58:20 +01:00
Luca Bruno
39788873b0 save: factor-out presave/postload dispatchers
Signed-off-by: Luca Bruno <lucab@debian.org>
2015-01-18 20:13:11 +01:00
Aaron Giles
8063dd2953 Enable saving dynamic_arrays of all fundamental types. Also fix emupal
to save the indirection arrays properly when indirect color count is
provided up front.
2014-03-02 22:09:37 +00:00
Miodrag Milanovic
64ac8f6776 Huge update, palette is now device (nw)
note: Aaron please give more descriptive text for release log I have no more strength :)
2014-02-27 13:35:15 +00:00
Aaron Giles
57cfaa163e Switched rgb_t to a class, replacing macros with methods. Mappings are
as follows:

   MAKE_RGB(r,g,b)     == rgb_t(r,g,b)
   MAKE_ARGB(a,r,g,b)  == rgb_t(a,r,g,b)
   RGB_ALPHA(data)     == data.a()
   RGB_RED(data)       == data.r()
   RGB_GREEN(data)     == data.g()
   RGB_BLUE(data)      == data.b()
   RGB_BLACK           == rgb_t::black
   RGB_WHITE           == rgb_t::white

Implicit conversions to/from UINT32 are built in as well as simple
addition, subtraction, and scaling (with clamping).

As a result of being a class, some stricter typing was needed in
a few places but overall not too much.
2014-02-19 06:07:32 +00:00
Aaron Giles
5d0ce54f9e Bulk convert files that already had standard BSD license in my name
to new license tagged form.
2013-10-16 08:14:49 +00:00
Aaron Giles
b963a48cdf Split eeprom.c into a base class base_eeprom_device and a serial-specific
subclass serial_eeprom_device. Moved the latter into its own file
eepromser.c and significantly cleaned up/simplified the code. The new
code should be functionally the same as the previous code, but expect that
to change soon. As a side-effect, the size and bus width of the EEPROM is now
specified in the ADD macro rather than in the interface structure.
2013-07-27 03:28:25 +00:00
Aaron Giles
da8170e0af Memory system: added endianness to the memory_share class.
Tilemap system: numerous changes:

 * Moved remaining legacy macros and typedefs to tilelgcy.h. This revealed
   a few drivers mixing and matching modern & legcy, which have now been 
   fixed.

 * Changed get info callback signature to no longer pass the user_data
   pointer, but instead pass a reference to the tilemap object itself.
   Updated those few drivers using user_data to pull it out of the
   tilemap object with the new user_data() getter method.
 
 * Changed get info and mapping callbacks to be device_delegates so that
   they can be described at config time.
 
 * Added tilemap_memory object that is used internally for reading/
   writing to memory that backs a tilemap. This object is used to track
   a memory pointer that backs tilemap memory, and also is designed to
   transparently handle all bus width and endianness associated with
   reading and writing data in a tilemap.
   
 * Incorporated two tilemap_memory objects (basemem and extmem) into the 
   tilemap object and added accessors to them, as well as read/write 
   handlers for reading/writing to entries stored in the memory. This
   means that tilemap get info callbacks can now easily read data out of
   the tilemap in a generic way.
 
 * Rejiggered the initialization sequence for tilemap objects so that
   the tilemap_manager is not required to be present at instantiation.  
 
 * Created a new tilemap_device, which can be used to declare a tilemap
   in the machine config, and which also is a tilemap object itself.
   The tilemap device will look for shared memory regions called
   "<tag>" and "<tag>_ext" and automatically plug them into the tilemap.
   The device also provides write handlers that can be used to write
   to the tilemap memory and mark tiles dirty, saving the need for each 
   driver to write their own.
   
Device system: moved required/optional device finders to a new header
devfind.h.

Atari drivers: removed all playfield and alpha memory and tilemap
variables, apart from those needed by atarivc-using games (this will
become a device in a future update). Updated all Atari 16-bit drivers to
use the new tilemap_device instead, which provides all the needed
functionality in a more generic way.
2013-07-20 21:46:00 +00:00
Miodrag Milanovic
6a52173033 save state cleanup, converted state_save_register_global* into save_item/save_pointer (nw) 2013-05-08 14:34:11 +00:00
Miodrag Milanovic
0e19f641d3 Cleanups and version bump 2013-01-11 07:32:46 +00:00
Angelo Salese
d2c052dbef Clean-ups and version bump (yes, I know, it's too late) 2012-03-11 17:17:00 +00:00
Aaron Giles
2a04855fb3 Add save_item template specialization for dynamic_array. 2012-03-08 07:34:49 +00:00
Aaron Giles
e4238fb654 Major bitmap-related changes throughout the system. There are
almost certainly some regressions lurking. Let me know if
something seems busted.

Bitmaps are now strongly typed based on format. bitmap_t still
exists as an abstract base class, but it is almost never used.
Instead, format-specific bitmap classes are provided:

   bitmap_ind8 == 8bpp indexed
   bitmap_ind16 == 16bpp indexed
   bitmap_ind32 == 32bpp indexed
   bitmap_ind64 == 64bpp indexed
   bitmap_rgb32 == 32bpp RGB
   bitmap_argb32 == 32bpp ARGB
   bitmap_yuy16 == 16bpp YUY

For each format, a generic pix() method is provided which
references pixels of the correct type. The old pix8/pix16/pix32/
pix64 methods still exist in the short term, but the only one
available is the one that matches the bitmap's pixel size. Note
also that the old RGB15 format bitmaps are no longer supported
at all.

Converted model1, megadriv, and stv drivers away from the RGB15
format bitmaps.

New auto_bitmap_<type>_alloc() macros are provided for allocating
the appropriate type of bitmap.

Screen update functions now must specify the correct bitmap type
as their input parameters. For static update functions the
SCREEN_UPDATE macro is now replaced with SCREEN_UPDATE_RGB32 and
SCREEN_UPDATE_IND16 macros. All existing drivers have been 
updated to use the correct macros. 

Screen update functions are now required for all screens; there
is no longer any default behavior of copying a "default" bitmap
to the screen (in fact the default bitmap has been deprecated).
Use one of the following to specify your screen_update callback:

   MCFG_SCREEN_UPDATE_STATIC(name) - static functions
   MCFG_SCREEN_UPDATE_DRIVER(class, func) - driver members
   MCFG_SCREEN_UPDATE_DEVICE(tag, class, func) - device members

Because the target bitmap format can now be deduced from the
screen update function itself, the MCFG_SCREEN_FORMAT macro is
no longer necessary, and has been removed. If you specify a
screen update callback that takes a bitmap_ind16, then the screen
will be configured to use a 16bpp indexed bitmap, and if you
specify a callback that takes a bitmap_rgb32, then a 32bpp RGB
bitmap will be provided.

Extended the bitmap classes to support wrapping a subregion of
another bitmap, and cleaner allocation/resetting. The preferred
use of bitmaps now is to define them directly in drivers/devices
and use allocate() or wrap() to set them up, rather than 
allocating them via auto_bitmap_*_alloc().

Several common devices needed overhauls or changes as a result
of the above changes:

 * Reorganized the laserdisc base driver and all the laserdisc 
    drivers as modern C++ devices, cleaning the code up 
    considerably. Merged ldsound device into the laserdsc
    device since modern devices are flexible enough to handle
    it.

 * Reorganized the v9938 device as a modern C++ device. Removed
    v9938mod.c in favor of template functions in v9938.c directly.

 * Added independent ind16 and rgb32 callbacks for TMS340x0 devices.

 * All video devices are now hard-coded to either ind16 or rgb32
    bitmaps. The most notable is the mc6845 which is rgb32, and
    required changes to a number of consumers.

 * Added screen_update methods to most video devices so they can be
    directly called via MCFG_SCREEN_UPDATE_DEVICE instead of creating
    tons of stub functions.
2012-01-12 21:19:49 +00:00
Aaron Giles
9cae38e0d8 Converted bitmap_t and rectangle into proper classes. Replaced BITMAP_ADDR*
macros with bitmap->pix* functions, and moved bitmap_fill() to bitmap->fill()
among other similar changes. Bitmap fields now only available via accessors.
Replaced sect_rect with &= and union_rect with |= operators for rectangle
classes. Some general cleanup as a result of these changes. [Aaron Giles]
2011-12-31 07:52:26 +00:00
Miodrag Milanovic
be8bd3552f Move per emulator constants info into separate class [Miodrag Milanovic]
out of log:
This way it is possible to link two or more separated executables with different 
copyright/xml out/name/... in one compilation, just one step closer...
2011-11-17 10:02:55 +00:00
Aaron Giles
932a42eac4 Be consistent about template argument naming. 2011-04-30 20:37:06 +00:00
Aaron Giles
2465eb7e4e Converted presave/postload functions to delegates. In a lot of
cases, we can get rid of the postload function entirely and just
call directly to the target function. Drivers eventually should
just override device_postload() instead of registering for callbacks.
2011-04-30 05:12:28 +00:00
Aaron Giles
543fa08fd0 Rename state_manager -> save_manager since the term "state" is overloaded. 2011-04-20 15:14:54 +00:00