Commit Graph

543 Commits

Author SHA1 Message Date
Wilbert Pol
e3cf71776b Fixed typo (nw) 2012-03-07 19:46:01 +00:00
R. Belmont
11a3efc873 abort() is intended in this instance (nw) 2012-02-29 14:12:38 +00:00
Miodrag Milanovic
bef76826c9 fixed several Visual Studio compiler warnings and 64-bit libflac compilation by Firewave, and idectrl change from Carl (no whatsnew) 2012-02-29 09:13:22 +00:00
R. Belmont
a0b7883fa3 SDL: support unofficial (not in the OSD class) num_processors API used by chdman. Allows chdman to use multiple cores/processors on non-Windows. [R. Belmont] 2012-02-26 22:55:18 +00:00
Angelo Salese
cf4b58b6f6 Clean-ups and version bump 2012-02-19 15:23:23 +00:00
Miodrag Milanovic
4ba8461f7c Added windows implementation of pseudo tty access functions over pipes [Carl] 2012-02-19 08:50:03 +00:00
Aaron Giles
f0823886a6 Major CHD/chdman update. The CHD version number has been increased
from 4 to 5. This means any diff CHDs will no longer work. If you
absolutely need to keep the data for any existing ones you have,
find both the diff CHD and the original CHD for the game in question 
and upgrade using these commands:

  rename diff\game.dif diff\game-old.dif
  chdman copy -i diff\game-old.dif -ip roms\game.chd -o diff\game.dif -op roms\game.chd -c none

Specifics regarding this change:

Defined a new CHD version 5. New features/behaviors of this version:
  - support for up to 4 codecs; each block can use 1 of the 4
  - new LZMA codec, which tends to do better than zlib overall
  - new FLAC codec, primarily used for CDs (but can be applied anywhere)
  - upgraded AVHuff codec now uses FLAC for encoding audio
  - new Huffman codec, used to catch more nearly-uncompressable blocks
  - compressed CHDs now use a compressed map for significant savings
  - CHDs now are aware of a "unit" size; each hunk holds 1 or more units
     (in general units map to sectors for hard disks/CDs)
  - diff'ing against a parent now diffs at the unit level, greatly
     improving compression

Rewrote and modernized chd.c. CHD versions prior to 3 are unsupported,
and version 3/4 CHDs are only supported for reading. Creating a new
CHD now leaves the file open.  Added methods to read and write at the 
unit and byte level, removing the need to handle this manually. Added
metadata access methods that pass astrings and dynamic_buffers to
simplify the interfaces. A companion class chd_compressor now
implements full multithreaded compression, analyzing and compressing
multiple hunks independently in parallel. Split the codec 
implementations out into a separate file chdcodec.*

Updated harddisk.c and cdrom.c to rely on the caching/byte-level read/
write capabilities of the chd_file class. cdrom.c (and chdman) now also 
pad CDs to 4-frame boundaries instead of hunk boundaries, ensuring that
the same SHA1 hashes are produced regardless of the hunk size.

Rewrote chdman.exe entirely, switching from positional parameters to
proper options. Use "chdman help" to get a list of commands, and
"chdman help <command>" to get help for any particular command. Many 
redundant commands were removed now that additional flexibility is
available. Some basic mappings:

  Old: chdman -createblankhd <out.chd> <cyls> <heads> <secs>
  New: chdman createhd -o <out.chd> -chs <cyls>,<heads>,<secs>

  Old: chdman -createuncomphd <in.raw> <out.chd> ....
  New: chdman createhd -i <in.raw> -o <out.chd> -c none ....

  Old: chdman -verifyfix <in.chd>
  New: chdman verify -i <in.chd> -f

  Old: chdman -merge <parent.chd> <diff.chd> <out.chd>
  New: chdman copy -i <diff.chd> -ip <parent.chd> -o <out.chd>

  Old: chdman -diff <parent.chd> <compare.chd> <diff.chd>
  New: chdman copy -i <compare.chd> -o <diff.chd> -op <parent.chd>

  Old: chdman -update <in.chd> <out.chd>
  New: chdman copy -i <in.chd> -o <out.chd>

Added new core file coretmpl.h to hold core template classes. For now
just one class, dynamic_array<> is defined, which acts like an array
of a given object but which can be appended to and/or resized. Also
defines dynamic_buffer as dynamic_array<UINT8> for holding an 
arbitrary buffer of bytes. Expect to see these used a lot.

Added new core helper hashing.c/.h which defines classes for each of
the common hashing methods and creator classes to wrap the 
computation of these hashes. A future work item is to reimplement
the core emulator hashing code using these.

Split bit buffer helpers out into C++ classes and into their own
public header in bitstream.h.

Updated huffman.c/.h to C++, and changed the interface to make it
more flexible to use in nonstandard ways. Also added huffman compression
of the static tree for slightly better compression rates.

Created flac.c/.h as simplified C++ wrappers around the FLAC interface.
A future work item is to convert the samples sound device to a modern
device and leverage this for reading FLAC files.

Renamed avcomp.* to avhuff.*, updated to C++, and added support for
FLAC as the audio encoding mechanism. The old huffman audio is still
supported for decode only.

Added a variant of core_fload that loads to a dynamic_buffer.

Tweaked winwork.c a bit to not limit the maximum number of processors
unless the work queue was created with the WORK_QUEUE_FLAG_HIGH_FREQ
option. Further adjustments here are likely going to be necessary.

Fixed bug in aviio.c which caused errors when reading some AVI files.
2012-02-16 09:47:18 +00:00
Couriersud
ebe89a47d3 Fixed testkeys to work with SDL2.0. Keymaps can now contain SDL1.3 and SDL2.0 mappings. Updated km-de.txt as an example. [Couriersud] 2012-02-16 01:38:13 +00:00
Couriersud
19c3217408 Added support for (track)balls to osd/sdl. [Couriersud]
To test it, I used my Logitech Trackball (normally a mouse) and configured it as a joystick.

Prerequisites:

- Locate your linux input device for the trackball. In my case that's /dev/input/event3
- "sudo chmod a+r /dev/input/event3"
- "export SDL_JOYSTICK_DEVICE=/dev/input/event3"

This forces sdl to recognize the trackball as a input device.

-mame64 missile -nomouse -w

Configure the trackball axis. Make sure the mouse pointer is outside the window and window still has keyboard focus - most modern window manager should support this. 

Quit and restart with

-mame64 missile -mouse -now

to hide the mouse. Voila. Works.
2012-02-15 21:40:35 +00:00
R. Belmont
634199ff6e (nw) 2012-02-13 23:38:49 +00:00
R. Belmont
0419f03478 (nw) 2012-02-13 23:23:41 +00:00
Couriersud
5344166555 updated sdl os-core to compile against stock SDL-2.0 [couriersud].
- The SDL team has moved from 1.3 to 2.0. At the same time, changes were made to allow SDL1.2 and SDL2.0 to coexist. All SDL2.0 include files are now in /usr/include/SDL2.
- Added sdlinc.h to avoid having tons of #ifdef .. #include in the code.
- Scalemode is no longer a per-window setting
- Fixed a bug in YUV rendering.
- Use SDL_GetClipboard (SDL2.0)
- Updated README_SDL20.txt

Currently, SDL 2.0 is only supported on *nix. Volunteers welcome.
2012-02-12 20:59:24 +00:00
Michaël Banaan Ananas
f84735dcef cmdline option shortcuts for:
waitvsync -> vs
syncrefresh -> sr
2012-02-10 19:26:14 +00:00
R. Belmont
d58200c58c SDL: don't show misleading message for .BDF UI fonts [R. Belmont, The Flying Ape] 2012-01-29 02:32:28 +00:00
Miodrag Milanovic
41324054a1 Fixed pcap network device search [Carl] 2012-01-25 09:56:25 +00:00
Aaron Giles
ed0207f126 Move devices into a proper hierarchy and handle naming
and paths consistently for devices, I/O ports, memory
regions, memory banks, and memory shares. [Aaron Giles]

NOTE: there are likely regressions lurking here, mostly
due to devices not being properly found. I have temporarily
added more logging to -verbose to help understand what's
going on. Please let me know ASAP if anything that is being
actively worked on got broken.

As before, the driver device is the root device and all 
other devices are owned by it. Previously all devices
were kept in a single master list, and the hierarchy was
purely logical. With this change, each device owns its
own list of subdevices, and the hierarchy is explicitly
manifest. This means when a device is removed, all of its
subdevices are automatically removed as well.

A side effect of this is that walking the device list is
no longer simple. To address this, a new set of iterator
classes is provided, which walks the device tree in a depth
first manner. There is a general device_iterator class for
walking all devices, plus templates for a device_type_iterator
and a device_interface_iterator which are used to build
iterators for identifying only devices of a given type or
with a given interface. Typedefs for commonly-used cases
(e.g., screen_device_iterator, memory_interface_iterator)
are provided. Iterators can also provide counts, and can
perform indexed lookups.

All device name lookups are now done relative to another 
device. The maching_config and running_machine classes now
have a root_device() method to get the root of the hierarchy. 
The  existing machine->device("name") is now equivalent to
machine->root_device().subdevice("name").

A proper and normalized device path structure is now
supported. Device names that start with a colon are
treated as absolute paths from the root device. Device
names can also use a caret (^) to refer to the owning
device. Querying the device's tag() returns the device's
full path from the root. A new method basetag() returns
just the final tag.

The new pathing system is built on top of the 
device_t::subtag() method, so anyone using that will 
automatically support the new pathing rules. Each device
has its own internal map to cache successful lookups so
that subsequent lookups should be very fast.

Updated every place I could find that referenced devices,
memory regions, I/O ports, memory banks and memory shares
to leverage subtag/subdevice (or siblingtag/siblingdevice
which are built on top).

Removed the device_list class, as it doesn't apply any
more. Moved some of its methods into running_machine
instead.

Simplified the device callback system since the new 
pathing can describe all of the special-case devices that
were previously handled manually.

Changed the core output function callbacks to be delegates.

Completely rewrote the validity checking mechanism. The
validity checker is now a proper C++ class, and temporarily
takes over the error and warning outputs. All errors and 
warnings are collected during a session, and then output in
a consistent manner, with an explicit driver and source file
listed for each one, as well as additional device and/or
I/O port contexts where appropriate. Validity checkers 
should no longer explicitly output this information, just
the error, assuming that the context is provided.

Rewrote the software_list_device as a modern device, getting
rid of the software_list_config abstraction and simplifying
things.

Changed the way FLAC compiles so that it works like other
external libraries, and also compiles successfully for MSVC
builds.
2012-01-24 20:18:55 +00:00
R. Belmont
87c3d68343 Changes for GCC 4.7 compatibility [Belegdol] 2012-01-21 20:39:52 +00:00
R. Belmont
e981a9771e fix 64-bit Intel OS X compile w/latest Xcode (nw) 2012-01-16 16:52:54 +00:00
Angelo Salese
7b631e4c5b Clean-ups and version bump 2012-01-15 21:40:54 +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
R. Belmont
b4ab914f21 OS/2 updates [KO Myung-Hun] 2012-01-05 03:23:51 +00:00
Phil Bennett
2187468105 Revert r14902 for sdlmain.c. Fixes compilation on Intel OS X. 2012-01-03 09:50:40 +00:00
Aaron Giles
64f1231c63 Removed old C-based interface to astrings. astring exists only as
a class now. Updated all stragglers (mostly tools) to use the class
form. [Aaron Giles]
2012-01-03 00:21:13 +00:00
R. Belmont
0e7eaf5d24 SDL stopped compiling again. Imagine that! (nw) 2012-01-02 06:36:58 +00:00
Aaron Giles
80cd316a2a Bulk conversion of bitmap_t * to bitmap_t & . With this change the
parameters for the global SCREEN_UPDATE callback match the parameters
for the driver_device version. Added allocate() and deallocate()
methods to bitmap_t to permit cleaner handling of bitmaps in drivers
and modern devices. [Aaron Giles]
2012-01-02 04:59:11 +00:00
R. Belmont
c8680b9ca3 (nw) 2011-12-31 23:02:03 +00:00
R. Belmont
fcc664268b Et tu, Aaron? (nw) 2011-12-31 23:00:08 +00:00
Wilbert Pol
8ba7ddeec6 Fix OSX compile.
RB: Please verify if this fix is ok with you.
2011-12-31 11:58: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
Angelo Salese
7e812d10d3 Clean-ups and version bump 2011-12-24 21:49:38 +00:00
Miodrag Milanovic
a2cf6501ea less ugly way to silence gcc 4.6 (no whatsnew) 2011-12-15 14:10:46 +00:00
Miodrag Milanovic
f23a3ef001 Added GCC check in windows.mak and win32 part of sdl.mak and also did silence of gcc 4.6 in win32 specific video.c (no whatsnew) 2011-12-15 08:17:18 +00:00
Angelo Salese
f0649b4e22 cleanups and version bump 2011-12-14 21:33:51 +00:00
Miodrag Milanovic
6e79bb2629 Sync with MESS all credited there (no whatsnew) 2011-12-12 14:20:12 +00:00
Miodrag Milanovic
72212fbbba Handling error where filenames are too long [Chad] 2011-12-07 07:54:47 +00:00
Scott Stone
5bceba7caa Moved a condition check (tex->d3dtex == tex->d3dfinaltex) to happen before one of them was set to NULL (tex->d3dfinaltex). Fixes MT Bug #4538. [Antonio Giner] 2011-11-29 19:20:25 +00:00
Scott Stone
74deaabe33 This change makes sure that the watchdog message will be displayed in case other messages are also waiting to be displayed. Useful in regression testing where such messages were not being displayed in some cases. (nw) 2011-11-27 14:46:34 +00:00
Angelo Salese
9f8125a24e Clean-ups and version bump 2011-11-27 14:06:49 +00:00
Aaron Giles
4a3512c756 Fix obvious use-after-free error in device_delete().
Remove explicit freeing of HLSL shadow_texture, since it is allocated
by texture_create() which does its own tracking and freeing.
2011-11-27 04:58:47 +00:00
R. Belmont
d5581057e1 (nw) 2011-11-22 14:21:24 +00:00
R. Belmont
0e513db597 (nw) 2011-11-22 13:14:23 +00:00
Miodrag Milanovic
98c917e0a1 Fixed memory leaks in networking, used core functions for allocating memory, fix sdl win32 building with network enabled (no whatsnew) 2011-11-22 11:25:14 +00:00
Miodrag Milanovic
6aadd7d787 Sync with MESS, also placed back sdlmain change since it proved working on BSD (no whatsnew) 2011-11-22 09:07:58 +00:00
Miodrag Milanovic
43245e3777 Fixed compile warning with 4.6.2 (no whatsnew) 2011-11-21 12:41:14 +00:00
R. Belmont
1ad9d735c7 Various SDL netdev fixes (nw) 2011-11-21 02:43:59 +00:00
R. Belmont
f5a4b7dc30 SDL updates [R. Belmont, Carl, cgwg]
- pcap network support for OS X and Windows SDL targets
- GLSL tweaks to better support the "CRT" shader
2011-11-18 22:16:21 +00:00
R. Belmont
fbf346da6f Not yet, *BSD stops compiling otherwise (nw) 2011-11-18 13:02:28 +00:00
Miodrag Milanovic
17006c8890 Updated sdlmain.c due to fact that there is no more -DMESS compile option (no whatsnew)
Functionality stay the same.
2011-11-18 10:04:56 +00:00
Ryan Holtz
9063cb221f - Fixed HLSL memory leak and crash on exit on 32-bit targets. [Ryan Holtz, Bat Country Entertainment]
Word around the campfire is this totally works and stuff. More technically, it eliminates a number of double-frees and also now cleans up the shadow mask PNG and hlsl_options allocations. (nw)
2011-11-18 06:23:04 +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