Commit Graph

574 Commits

Author SHA1 Message Date
Oliver Stöneberg
aab3cad57f fixed debugger window to just use fixed-pitch font and removed fallback since CreateFont will still return a font based on other characteristics when the face was not found (no whatsnew) 2012-08-18 10:01:13 +00:00
Miodrag Milanovic
10294b81ab Made UI mouse cursor optional (default is off for now), in games with clickable artwork cursor is visible, application is not taking mouse control anymore (no whatsnew) 2012-08-17 13:42:21 +00:00
Miodrag Milanovic
b2b8a48438 Added internal mouse cursor visible in menus and when clickable artwork is used [Miodrag Milanovic] 2012-08-15 14:39:48 +00:00
Oliver Stöneberg
765271cb05 removed redundant interlocked function wrappers from Windows code (no whatsnew) 2012-08-07 13:05:00 +00:00
Oliver Stöneberg
97dbb9484f removed unnecessary strlen() usage (no whatsnew) 2012-07-27 15:37:39 +00:00
Oliver Stöneberg
5864158d33 allow "windowname" in win_create_window_ex_utf8() to be NULL to match behavior of CreateWindowEx() (no whatsnew) 2012-07-27 15:24:08 +00:00
Oliver Stöneberg
eb937ea06a fixed version check in windows.mak (no whatsnew) 2012-07-26 19:36:30 +00:00
Miodrag Milanovic
ed9afac60c Clean-ups and version bump 2012-07-15 09:28:52 +00:00
Miodrag Milanovic
869a0ab7af fix for profiler memory leaks mtbug #04094 (no whatsnew) 2012-07-09 17:02:00 +00:00
Miodrag Milanovic
85cda51486 Make it compile on windows mingw 4.7.x (no whatsnew) 2012-06-18 16:06:11 +00:00
Michaël Banaan Ananas
d82cead34c fix mistake by me a while ago: sr(syncrefresh) clashed with emuopts sr(samplerate) 2012-06-10 21:24:15 +00:00
smf-
d52292616e fixed building with Visual Studio 11 RC 2012-06-02 22:31:32 +00:00
Miodrag Milanovic
63362efd37 fix for -video ddraw causing crash on 16bit video output (no whatsnew) 2012-05-19 17:06:03 +00:00
Miodrag Milanovic
206d7d92c6 Fixed display of icon in windows (no whatsnew) 2012-05-15 13:20:26 +00:00
Miodrag Milanovic
2139f1b17d end of line was missing (nw) 2012-05-15 12:29:40 +00:00
Miodrag Milanovic
eb43dbb7a3 MAME windows executable gets it's own icon (no whatsnew) 2012-05-15 12:21:20 +00:00
smf-
a7229679c7 fixes for building with visual studio 11 beta. 2012-05-10 19:02:23 +00:00
Miodrag Milanovic
0238c610f7 Clean-ups and version bump 2012-05-07 06:57:50 +00:00
Miodrag Milanovic
6231165166 -static is not needed anymore for latest tools (no whatsnew) 2012-05-03 16:45:36 +00:00
Aaron Giles
2a88e54278 ioport.c C++ conversion. Mostly internal changes, with no
intended differences from previous behavior. For drivers,
the main change is that input_port_read() no longer exists.
Instead, the port must be fetched from the appropriate device,
and then read() is called.

For member functions, this is actually simpler/cleaner:

  value = ioport("tag")->read()

For legacy functions which have a driver_data state, it goes:

  value = state->ioport("tag")->read()

For other legacy functions, they need to fetch the root device:

  value = machine.root_device().ioport("tag")->read()

The other big change for drivers is that IPT_VBLANK is gone.
Instead, it has been replaced by a device line callback on the
screen device. There's a new macro PORT_VBLANK("tag") which
automatically points things to the right spot.

Here's a set of imperfect search & replace strings to convert
the input_port_read calls and fix up IPT_VBLANK:

input_port_read( *\( *)(machine\(\)) *, *([^)]+ *\))
ioport\1\3->read\(\)

input_port_read( *\( *)(.*machine[()]*) *, *([^)]+ *\))
\2\.root_device\(\)\.ioport\1\3->read\(\)

(state = .*driver_data[^}]+)space->machine\(\)\.root_device\(\)\.
\1state->

(state = .*driver_data[^}]+)device->machine\(\)\.root_device\(\)\.
\1state->

input_port_read_safe( *\( *)(machine\(\)) *, *([^,]+), *([^)]+\))
ioport\1\3->read_safe\(\4\)

IPT_VBLANK( *\))
IPT_CUSTOM\1 PORT_VBLANK("screen")
2012-05-03 09:00:08 +00:00
Miodrag Milanovic
4296762a20 Killed unicows (no whatsnew) 2012-04-28 07:10:04 +00:00
Miodrag Milanovic
b9e61fd29b Fix linking for mingw GCC 4.6.3 and upper using libwinpthread (no whatsnew) 2012-04-24 12:24:57 +00:00
Angelo Salese
ded30e907e Clean-ups and version bump 2012-04-22 14:10:44 +00:00
Aaron Giles
9091010c87 Broke dependency between mcr68 and mcr by creating
sound devices for each of the Midway 8-bit sound
boards. This will also aid in eventually hooking them
up to pinballs.

Enhanced the mixer interface support to allow for
more than one output line. To use this you need to
use the MCFG_MIXER_ROUTE macro instead of 
MCFG_SOUND_ROUTE so that the mixer output index can
be specified. See midway_ssio_device for an example.
2012-04-17 14:58:05 +00:00
Aaron Giles
7d27b8c9ff Hooray for templates. 2012-04-12 07:35:57 +00:00
Michaël Banaan Ananas
67364cfe81 Change DirectInput joystick acquisition method to be non exclusive. [bdam] 2012-03-25 17:55:05 +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
Michaël Banaan Ananas
f84735dcef cmdline option shortcuts for:
waitvsync -> vs
syncrefresh -> sr
2012-02-10 19:26:14 +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
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
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
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
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
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
43245e3777 Fixed compile warning with 4.6.2 (no whatsnew) 2011-11-21 12:41:14 +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
Angelo Salese
e6b9af5ec6 Clean-ups and version bump 2011-10-23 15:06:49 +00:00
Miodrag Milanovic
a1f1b43fda Fixed compile under GCC 4.6 (no whatsnew) 2011-10-22 09:55:22 +00:00
Angelo Salese
5ee0c7d818 clean-ups and version bump 2011-10-10 21:17:54 +00:00
Michaël Banaan Ananas
6ee05f83d3 hide_cursor option for chess games and clickable artwork and such.
default to on means exactly the same behaviour as it was before, off means mousecursor is _always_ shown
2011-10-10 19:45:31 +00:00
Michaël Banaan Ananas
325dc41b5d revert r14152, good idea but please add a -grabcursor option instead 2011-10-10 18:37:18 +00:00
Olivier Galibert
07519ce890 Windows only - for evaluation - changed when mouse pointer goes off. Pointer will always be on in windowed mode. In full-screen, it will obey the -mouse / -nomouse option. This means that you will always have a mouse pointer in mouse-enabled artwork (such as chess), since these must always be run in windowed mode. 2011-10-10 07:56:14 +00:00
Ryan Holtz
2e76ba4306 - Fixed all HLSL stability issues except visible crease. [Ryan Holtz, Bat Country Entertainment]
No whatsnew: There is no creasing visible to me, using either -window -nomaximize or -nowindow on a 1920x1080 display. If someone can get me a consistently reproducible case, it will be fixed.
2011-09-29 06:49:36 +00:00
Miodrag Milanovic
f44e93375a uncommenting line in winmain (no whatsnew) 2011-09-22 13:34:16 +00:00
Miodrag Milanovic
9bfa6c5bc2 Fixed warnings found by GCC 4.6.2 without change of h63484.c since that one is wip (no whatsnew) 2011-09-22 12:48:44 +00:00
Angelo Salese
cb74ddd807 Clean-ups and version bump 2011-09-20 21:10:48 +00:00
Miodrag Milanovic
1063a955cc Added network support used by MESS implemented by Carl (no whatsnew)
part is disabled for now by compile options. Will be enabled,at least in MESS
when all platforms get their implementation.
2011-09-09 14:21:42 +00:00
Ryan Holtz
4523bfa2d0 HLSL "Hurricain't Keep A Good Dev Down" Bugfix Extravaganza: [Ryan Holtz, Bat
Country Entertainment]
- Created two flags, -hlsl_ini_write and -hlsl_ini_read. The former enables
  custom HLSL INI writing explicitly, the other enables loading of the same.
- Fixed disappearing aperture effect when using custom INI files.
- Fixed diagonal seam on some games, for serious real this time
- Fixed phosphor simulation, now works as expected
2011-08-28 09:10:53 +00:00
Scott Stone
b6cd64c7ab "English doesn't borrow from other languages. English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar!"
Hand-checked the most popular English word misspellings and made the appropriate changes.  Nearly all of the changes made were in commented areas. (no whatsnew)
2011-08-23 04:59:11 +00:00
Angelo Salese
fd97e3da4c Clean-ups and version bump 2011-08-14 23:01:08 +00:00
Miodrag Milanovic
1d67e27539 Various memory leaks and unnecessary checks removed by Oliver Stoneberg (no whatsnew) 2011-08-14 07:20:37 +00:00
Miodrag Milanovic
9856fdfb87 fixed potential NULL pointer dereferences / also removed unnecessary NULL checks by Oliver Stoneberg (no whatsnew) 2011-08-08 13:19:56 +00:00
Michaël Banaan Ananas
ec0f083375 DI_PROPNOEFFECT after dinput property change is not an error 2011-08-01 23:06:12 +00:00
Miodrag Milanovic
8449a9cbdc - Removing MD5 support in ROMLOAD_* [Oliver Stoneberg]
- Various core and tools memory leaks fixes [Oliver Stoneberg]
2011-07-31 15:46:18 +00:00
Jonathan Gevaryahu
471762e7df Fix for the hlsl scanline jitter effect [nimitz] 2011-07-28 21:16:50 +00:00
Miodrag Milanovic
38e4c3f09d Fix for VS2010 build (no whatsnew) 2011-07-28 15:34:33 +00:00
Miodrag Milanovic
919780a6bc Added socket support to windows osd [Miodrag Milanovic] 2011-07-28 11:23:37 +00:00
Miodrag Milanovic
dea70e7f6a Fixed hlsl mem leak by Firewave (no whatsnew) 2011-07-27 08:19:32 +00:00
Miodrag Milanovic
b39238d672 Fixed double-free of d3d->hlsl [Oliver Stoneberg] 2011-07-26 17:11:13 +00:00
R. Belmont
6ca8f8a8c3 Fixes for variable shadowing [Oliver Stöneberg] 2011-07-21 13:19:08 +00:00
Angelo Salese
ef7acc5d65 Cleanups (?) and version bump 2011-06-28 14:28:46 +00:00
Miodrag Milanovic
9704fb140c Fixed memory leaks in HLSL code (no whatsnew) 2011-06-28 08:14:45 +00:00
Angelo Salese
e6050ace10 Cleanups and version bump 2011-06-19 19:29:25 +00:00
Miodrag Milanovic
079e1fa5fa Cassette device modernized (no whatsnew) 2011-06-15 09:18:10 +00:00
Ryan Holtz
23976ade94 HLSL Updates: [Ryan Holtz, Bat Country Entertainment]
- MAME will now save an HLSL INI file on the first run of a game that doesn't already have an INI file.
- HLSL INI files must have their parameters left in the order in which they are saved out.
- Fixed a diagonal 'crease' visible on the screen in HLSL mode.
2011-06-13 23:09:41 +00:00
Ryan Holtz
5838be042b Next time feel free to apply the obvious fix, no whatsnew :-) 2011-06-12 08:42:23 +00:00
Ryan Holtz
80d66bb1d6 HLSL Cleanup, no whatsnew:
- Fixed set_vector functionality and simplified shaders as a result
- Fixed HLSL presets, 0 to 3, in increasing level of terribleness
- Reduced options footprint from RGB triplets

Next plan: Separate INI writing.
2011-06-11 23:46:24 +00:00
Miodrag Milanovic
3853306c85 Added image devices menu to debugger (windows only for now) [Miodrag Milanovic] 2011-06-08 12:59:11 +00:00
Ryan Holtz
1ec454197a HLSL Updates: [Ryan Holtz, Bat Country Entertainment, austere]
- Reworked default shadow mask settings, eliminating rainbow banding and matching reference shots more closely
- Moved color power to occur after shadow mask, as it is intended to simulate nonlinear phosphor response
- Added a variable-width notch filter to the Y channel in NTSC post-processing, eliminating luma banding on e.g. CoCo 2 and Apple II
2011-06-06 21:25:38 +00:00
Angelo Salese
a449c766a2 Cleanups and version bump 2011-06-05 22:35:20 +00:00
Ryan Holtz
ad8a4985f9 Memory leak fix, nwn 2011-06-03 14:41:30 +00:00
Ryan Holtz
771b77142f Fix for performance regression and slider regression in HLSL, also re-enabling pixel prescaling in yiq_encode.fx. No whatsnew. 2011-06-03 14:38:59 +00:00
Ryan Holtz
30b0cb9a6f De-regressing HLSL performance on certain resolutions of game, nwn 2011-06-02 17:01:08 +00:00
Ryan Holtz
844296b795 Split HLSL code into a separate file, d3dhlsl.c/.h. Also split drawd3d.c into a couple of headers. [Ryan Holtz, Bat Country Entertainment] 2011-06-02 06:22:09 +00:00
Ryan Holtz
b3406aac94 nwn: bad printf, bad! 2011-06-01 22:21:35 +00:00
Ryan Holtz
b6f85b8c26 Kill height-based HLSL prescaling, only prescale based on frame width. Brings Kangaroo's prescale down from 5 to 2 and thus within a more reasonable GPU budget. Games that have a ridiculously higher vertical resolution than horizontal resolution will still have issues. 2011-06-01 22:08:28 +00:00
Ryan Holtz
130b3fcabb Keep HLSL prescaling from blowing out VRAM when regular prescaling is enabled. 2011-05-31 15:58:49 +00:00
Ryan Holtz
61eda625cb NWN: Fixing the NTSC codec. Oops. 2011-05-31 14:43:47 +00:00
Ryan Holtz
f42b5ccda0 No whatsnew
Attempting to fix the HLSL 'blurriness' reported by a few people. Now HLSL will auto-prescale to the nearest texture size that is greater than the target screen size on both axes and is also an even multiple of the raw bitmap's size.
2011-05-31 13:53:25 +00:00
Ryan Holtz
103358104c nwn, reducing default scanline brightness offset to 0 2011-05-31 05:08:35 +00:00
Ryan Holtz
ed6689e2d4 Fixed scanlines, nwn. This took much longer to fix than it should have. :[ 2011-05-31 05:02:17 +00:00
Ryan Holtz
37e8c1d7e4 Fixing some scanline-alignment issues. 2011-05-31 02:04:28 +00:00
Ryan Holtz
773e35d79b Moved "color floor" functionality to occur after scanlines but before shadow mask. Scanlines look much better and no longer cut black lines through the shadow mask. No whatsnew. 2011-05-30 21:40:25 +00:00
Ryan Holtz
796e691522 HLSL Updates: [Ryan Holtz, Bat Country Entertainment, austere, SoltanGris42]
- Added the ability to render screenshots at arbitrary resolutions.
- Added the ability to record AVI videos (albeit with no audio) at arbitrary resolutions.
- Added a 43-tap-wide FIR-based NTSC filter with tunable Y, I and Q frequency response.
- Updated scanlines to have a user-tunable pixel-height ratio in addition to the current screen-height ratio.
- Fixed a VRAM leak that was causing many dynamic-resolution drivers to run out of memory mid-run.
2011-05-30 21:10:23 +00:00
Aaron Giles
e532e74a8a Should fix osd keys. 2011-05-30 20:58:55 +00:00
Aaron Giles
665d213ee4 (Finally found the time to finish this....)
Low-level input upgrade. Classes now exist for input_codes, input_items,
input_devices, and input_seqs. Also created an input_manager class to
hold machine-global state and made it accessible via machine.input().
Expanded the device index range (0-255, up from 0-16), and the OSD can
now specify the device index explicitly if they can better keep the 
indexes from varying run-to-run. [Aaron Giles]

Note that I've built and run SDL on Windows, but not all the code paths
were exercised. If you use mice/joysticks extensively double-check them
to be sure it all still works as expected.

This is mainly an OSD and core change. The only thing impacting drivers
is if they query for specific keys for debugging. The following S&Rs
took care of most of that:

S: input_code_pressed( *)\(( *)([^, ]+) *, *
R: \3\.input\(\)\.code_pressed\1\(\2

S: input_code_pressed_once( *)\(( *)([^, ]+) *, *
R: \3\.input\(\)\.code_pressed_once\1\(\2
2011-05-30 19:07:19 +00:00
Angelo Salese
81036ed1f9 Robbbert port from MESS, nw! 2011-05-29 12:42:57 +00:00
Ryan Holtz
0d2bc3300f Fix -nohlsl 2011-05-24 19:35:47 +00:00
Ryan Holtz
e97aa6b56d Internal HLSL cleanup - removed aux texcoords, restored software vertex processing due to low-end cards not doing hardware vertex processing, removed unnecessary tristrip->trilist splitting. Restores D3D functionality on integrated chipsets and marginal cards. [Ryan Holtz, Ashura-X] 2011-05-24 18:28:54 +00:00
Ryan Holtz
6760f6a40c HLSL bugfxes, nwn 2011-05-24 00:23:40 +00:00
Angelo Salese
95f06e11a8 Cleanups and version bump 2011-05-24 00:13:27 +00:00
Ryan Holtz
b63233e7a6 Call off the dogs, the OSD routing for OSD-side sliders has been fixed. nwn 2011-05-23 05:03:16 +00:00
Ryan Holtz
25029d2dbf Fixing broken Red Power slider 2011-05-23 00:15:18 +00:00
Ryan Holtz
01f16cb0f8 HLSL Updates: [Ryan Holtz, Bat Country Entertainment]
- Created a new OSD function, osd_get_slider_list, which allows OS-specific slider controls.
- Plumbed new OSD-specific slider controls for HLSL parameters on Direct3D 9 targets. And there was much rejoicing.
2011-05-22 23:59:27 +00:00
Curt Coder
dbe84fd73d Fixed MSVC warning. (nw) 2011-05-22 14:56:59 +00:00
Ryan Holtz
f38312b078 NULL crash fix, nwn 2011-05-22 02:50:39 +00:00
Ryan Holtz
53e20c168f Fixing multiscreen games, nwn 2011-05-22 02:27:31 +00:00
Ryan Holtz
2cd23c1476 Made texture_create display a verbose message if texture creation fails, as texture creation failure leads to a crash and thus the user should know about it, nwn 2011-05-22 01:43:35 +00:00
Ryan Holtz
99dffc122e HLSL: Added adjustable color carrier in YIQ processing mode. [Ryan Holtz, Bat Country Entertainment]
HLSL: Fixed resolution-change crash and likely D3D performance regression with -nohlsl on low-spec cards [Ryan Holtz, Bat Country Entertainment]
2011-05-22 01:30:55 +00:00
Ryan Holtz
0235cef534 Fix for -noyiq issues, nw 2011-05-20 07:51:59 +00:00
Ryan Holtz
fd7a110eba HLSL Updates [Ryan Holtz, Bat Country Entertainment]
- Re-worked render target handling to align pixels better, reducing unintentional blurring
- Made major fixes to CVBS simulation, significantly increasing color saturation
2011-05-20 07:37:34 +00:00
Aaron Giles
2625a01395 Update needed for new toolchain. 2011-05-20 00:49:03 +00:00
Ryan Holtz
cfd6731fa8 HLSL Post-Processing Updates: [Ryan Holtz, Bat Country Entertainment, cgwg]
- The defocus pass is now switched off when defocus_x and defocus_y are zero, allowing finer-grained performance tuning.
- Removed YIQ convolution from the main color-convolution shader and replaced it with a full composite encode/decode pass. This is slower, but looks amazing(ly like a terrible TV) and can be turned off.
- More authentic NTSC dot crawl and bandwidth limiting.
2011-05-19 19:14:20 +00:00
Ryan Holtz
2820e31451 HLSL Updates [Ryan Holtz, Bat Country Entertainment]
- Potential fix for some crashing reported by John IV
- Split color convolution and deconvergence into separate shaders for potential GPU savings down the line
- Added light and heavy variants of the color convolution shader, the former with YIQ colorspace removed
- Re-worked defocus to occur prior to shadow mask application, as it would be on a real monitor.
- Removed Edge Detection, as it was just for fun and can easily be added in by users if desired.
- Split "pincushion" into "Pincushion" and "Screen Curvature", the former affecting the only the displayed image and the latter only affecting the shadow mask.
2011-05-18 00:35:16 +00:00
Miodrag Milanovic
9cf16652c7 Enable Visual Studio basic run-time checks in non-optimized builds [Oliver Stoneberg]
Flush stderr, so the data is actually written when output is being redirected [Oliver Stoneberg]
2011-05-17 13:15:29 +00:00
Ryan Holtz
66756f18d9 Implemented experimental HLSL post-processing support on Direct3D 9 targets. [Ryan Holtz, Bat Country Entertainment]
- 5-pass post-processing: Upscale, Post-Process, Store Last Frame, Defocus 1, Defocus 2
- Many tunable effects including: Scanlines, defocus, linear deconvergence, radial deconvergence, pincushion, RGB colorspace convolution, YIQ colorspace convolution, saturation, simulated dot crawl, simulated chroma subsampling, aperture masking, and more.
- Requires a GPU that supports Shader Model 3.0 to be enabled and a powerful GPU, the entire pipeline consists of approximately 30 texel fetches and approximately 230 arthimetic ops.
- Will supersample the framebuffer up to 9x in both X and Y, but this requires an enormously powerful GPU that has not been invented; users with Radeon 5000-class cards should limit themselves to 3x, Radeon 4000 to 1.5x.
- The default configuration will NOT appear to do anything; it requires tuning to the user's liking.
- Should nicely fall back in all cases except missing shaders, and it might fall back correctly in that case as well. Report any anomalies.
- For obvious reasons, the Direct3D8 renderer cannont support this.
2011-05-16 18:23:25 +00:00
Aaron Giles
932a42eac4 Be consistent about template argument naming. 2011-04-30 20:37:06 +00:00
Aaron Giles
af94c692bb Switch to using delegates for some callbacks:
- non-device timer callbacks
 - machine state changing callbacks
 - configuration callbacks
 - per-screen VBLANK callbacks
 - DRC backend callbacks

For the timer case only, I added wrappers for the old-style functions.
Over time, drivers should switch to device timers instead, reducing the
number of timers that are directly allocated through the scheduler.
2011-04-27 20:34:45 +00:00
Aaron Giles
919913f118 Collapsed device_config and device_t into one class. Updated all
existing modern devices and the legacy wrappers to work in this
environment. This in general greatly simplifies writing a modern
device. [Aaron Giles]

General notes:
 * some more cleanup probably needs to happen behind this change,
   but I needed to get it in before the next device modernization 
   or import from MESS  :)

 * new template function device_creator which automatically defines
   the static function that creates the device; use this instead of
   creating a static_alloc_device_config function

 * added device_stop() method which is called at around the time
   the previous device_t's destructor was called; if you auto_free
   anything, do it here because the machine is gone when the 
   destructor is called

 * changed the static_set_* calls to pass a device_t & instead of
   a device_config *

 * for many devices, the static config structure member names over-
   lapped the device's names for devcb_* functions; in these cases
   the members in the interface were renamed to have a _cb suffix

 * changed the driver_enumerator to only cache 100 machine_configs
   because caching them all took a ton of memory; fortunately this
   implementation detail is completely hidden behind the 
   driver_enumerator interface

 * got rid of the macros for creating derived classes; doing it
   manually is now clean enough that it isn't worth hiding the
   details in a macro
2011-04-27 05:11:18 +00:00
Angelo Salese
d3a1560433 Ok, last spring cleaning, I hope ... 2011-04-19 14:36:17 +00:00
Miodrag Milanovic
23f4601cab Fix for exit error codes by Oliver Stoneberg (no whatsnew) 2011-04-19 06:49:31 +00:00
Aaron Giles
d971ce8f36 Privatized most of the m_machine pointers in the system to prevent
direct use.
2011-04-19 06:02:01 +00:00
Aaron Giles
00d745ca77 (Big tangle of changes that all happened as I was looking into the ROM
loader rewrite, which is still in progress....)

Replaced mamedriv.c with a new driver list mechanism that is generated
by the build tools. The emulator core now expects the presence of a
file called src/$(TARGET)/$(SUBTARGET).lst which is just a raw list of
driver names, one per line. C and C++ comments are still permitted.
This file is parsed by a new build tool makelist which extracts the
driver names, sorts them, and generates a file called drivlist.c, which
is consumed by the core. [Aaron Giles]

Added new osdcore function osd_malloc_array() which is identical to
osd_malloc() but obviously hints that the underlying allocation is for
an array. Updated all callers to use the appropriate form. Modified the
Windows allocator to only use guard pages for array-style allocations,
allowing us to enable them once again in debug builds. [Aaron Giles]

Created new static class driver_list to wrap accesses to the list of
available drivers. Improved speed of driver lookups by relying on the
presorting done by makelist. [Aaron Giles]

Created helper class driver_enumerator as a helper for iterating through 
the list of drivers. This class supports basic filtering and iteration,
and also serves as a temporary cache of machine_configs. [Aaron Giles]

Created cli_frontend object to wrap all the CLI handling code in
clifront.c. Updated/simplified all the code to take advantage of the
driver_enumerator. [Aaron Giles]

Created media_auditor object to wrap all the auditing functions in
audit.c. Updated all users to the new interface. Note that the new
auditing mechanism is slightly out of sync with the romload code in
terms of finding ROMs owned by devices, so it may mis-report some
issues until the new ROM loading code is in. [Aaron Giles]

Added concept of a per-device searchpath. For most devices, their 
searchpath is just the short name of the device. For driver_devices, the
searchpath is driver[;parent[;bios]]. This searchpath will eventually be
used by the rom loader to find ROMs. For now it is used by the media
auditor only. [Aaron Giles]

Created info_xml_creator object to wrap all the info generation functions
in info.c. Converted the file to C++ and cleaned up the input processing
code. [Aaron Giles]

(not for whatsnew ... Known issues: auditing of CHDs appears busted, and 
debug builds report unfreed memory if you use the built-in game picker)
2011-04-13 20:31:00 +00:00
Aaron Giles
792c76e741 Re-enable MALLOC_DEBUG for debug builds. Can't remember why I ever
turned it off in the first place.
2011-04-03 15:39:50 +00:00
Aaron Giles
68958f72db Cleanups and version bump. 2011-04-03 05:49:24 +00:00
Miodrag Milanovic
33c28764d1 Fixed compiling tools in MAME and MESS side (no whatsnew) 2011-03-31 13:21:58 +00:00
Angelo Salese
340571e69c Fix compile 2011-03-30 23:25:35 +00:00
smf-
00fb8baaff fixed build. 2011-03-30 18:45:05 +00:00
Aaron Giles
ee8ae2b1d8 Make the symbol table use a simple_list for its cache. 2011-03-29 17:01:49 +00:00
Aaron Giles
2ad5072023 BIG update.
Remove redundant machine items from address_space and device_t.
Neither machine nor m_machine are directly accessible anymore.
Instead a new getter machine() is available which returns a
machine reference. So:

  space->machine->xxx   ==>  space->machine().xxx
  device->machine->yyy  ==>  device->machine().yyy

Globally changed all running_machine pointers to running_machine
references. Any function/method that takes a running_machine takes
it as a required parameter (1 or 2 exceptions). Being consistent
here gets rid of a lot of odd &machine or *machine, but it does
mean a very large bulk change across the project.

Structs which have a running_machine * now have that variable
renamed to m_machine, and now have a shiny new machine() method
that works like the space and device methods above. Since most of
these are things that should eventually be devices anyway, consider
this a step in that direction.

98% of the update was done with regex searches. The changes are
architected such that the compiler will catch the remaining
errors:

// find things that use an embedded machine directly and replace
// with a machine() getter call
S: ->machine->
R: ->machine\(\)\.

// do the same if via a reference
S: \.machine->
R: \.machine\(\)\.

// convert function parameters to running_machine &
S: running_machine \*machine([^;])
R: running_machine \&machine\1

// replace machine-> with machine.
S: machine->
R: machine\.

// replace &machine() with machine()
S: \&([()->a-z0-9_]+machine\(\))
R: \1

// sanity check: look for this used as a cast
(running_machine &)
// and change to this:
*(running_machine *)
2011-03-29 15:50:04 +00:00
Aaron Giles
af071893a6 Cleanup of machine.h. Shuffled some fields around, and moved several
to private member variables with accessors:

machine->m_respool     ==> machine->respool()
machine->config        ==> machine->config()
machine->gamedrv       ==> machine->system()
machine->m_regionlist  ==> machine->first_region()
machine->sample_rate   ==> machine->sample_rate()

Also converted internal lists to use simple_list.
2011-03-28 09:10:17 +00:00
Curt Coder
b67f2d8e9d Mapped KEYCODE_BACKSLASH2 to the OEM_102 key (located between LShift and Z on international keyboard layouts). [Curt Coder] 2011-03-10 11:18:29 +00:00
Aaron Giles
06ee6804dd Converted core_options to a class. Removed a bunch of marginal
functionality in favor of alternate mechanisms. Errors are
now reported via an astring rather than via callbacks. Every
option must now specify a type (command, integer, float, string,
boolean, etc). Command behavior has changed so that only one
command is permitted. [Aaron Giles]

Changed fileio system to accept just a raw searchpath instead of
an options/option name combination. [Aaron Giles]

Created emu_options class dervied from core_options which wraps
core emulator options. Added mechanisms to cleanly change the
system name and add/remove system-specific options, versus the
old way using callbacks. Also added read accessors for all the
options, to ensure consistency in how parameters are handled.
Changed most core systems to access emu_options instead of
core_options. Also changed machine->options() to return emu_options.
[Aaron Giles]
 
Created cli_options class derived from emu_options which adds the
command-line specific options. Updated clifront code to leverage
the new class and the new core behaviors. cli_execute() now accepts
a cli_options object when called. [Aaron Giles]

Updated both SDL and Windows to have their own options classes,
derived from cli_options, which add the OSD-specific options on
top of everything else. Added accessors for all the options so
that queries are strongly typed and simplified. [Aaron Giles]

Out of whatsnew: I've surely screwed up some stuff, though I have
smoke tested a bunch of things. Let me know if you hit anything odd.
Also I know this change will impact the WINUI stuff, please let me 
know if there are issues. All the functionality necessary should 
still be present. If it's not obvious, please talk to me before 
adding stuff to the core_options class.
2011-03-03 17:05:24 +00:00
Aaron Giles
1b54456be5 mame_file is now emu_file and is a class. It is required
to pass a core_options object to the constructor, along with
a search path. This required pushing either a running_machine
or a core_options through some code that wasn't previously
ready to handle it. emu_files can be reused over multiple 
open/close sessions, and a lot of core code cleaned up
nicely as things were converted to them.

Also created a file_enumerator class for iterating over files
in a searchpath. This replaces the old mame_openpath functions.

Changed machine->options() to return a reference.

Removed public nvram_open() and fixed jchan/kaneko16 to
stop directly saving NVRAM.

Removed most of the mame_options() calls; this will soon go 
away entirely, so don't add any more.

Added core_options to device_validity_check() so they can be
used to validate things.
2011-02-12 03:47:37 +00:00
Michaël Banaan Ananas
45e080abeb (typofix) 2011-02-09 21:22:18 +00:00
Aaron Giles
4fa610aa02 Cleanups and version bump. 2011-02-09 15:01:01 +00:00
Aaron Giles
07a66f8c54 Move generic templates from emucore.h to emutempl.h.
Normalize the tagged_list template to wrap a regular standard_list
and have similar semantics. Updated a few direct callers to handle
the changes.
2011-02-07 05:47:17 +00:00
Curt Coder
097dd84fb7 Ensured that the debugger disassembly PC cursor is visible on startup. [Curt Coder] 2011-02-06 11:27:57 +00:00
Curt Coder
bfcb47e2da Implemented proper mouse wheel event handling in the Windows debugger. [Curt Coder] 2011-02-05 19:42:53 +00:00
Miodrag Milanovic
10da185c4e - Cleanup of WINUI depending compiling (no whatsnew)
- Rewritten some checks to be runtime instead of compile dependent
- Added winmenu.c and "menu" option in windows build
- winmenu.c provide just dummy implementation, and makes linking with actual menu implementation easier.
2011-02-04 10:13:13 +00:00
Miodrag Milanovic
dfdc249c0d Removed not used ifdef section from winmain.c and MESS dependent ifdef from saa5050.c, this doesn't affect MAME at all (no whatsnew) 2011-01-17 18:30:36 +00:00
Aaron Giles
f5c03d12e2 Redo most of the DRC/backend support as C++
Yes, it is intentional that the x86/x64 backends compile everywhere.

Backends are now derived from drcbe_interface and implement several
required overrides.

x86emit.h now uses namespaces so that the x86/x64 emitters can co-exist.

New file uml.h/uml.c actually describes the UML language, separating
out several concepts from drcuml.c.

Lots of other changes/fixes.
2011-01-17 03:43:54 +00:00
Miodrag Milanovic
b11eaf0e46 Cleaned OSD windows and emu part from NEWUI dependencies (no whatsnew) 2011-01-13 09:11:34 +00:00
Aaron Giles
1d226e8795 Build vconv in all circumstances as part of win32 build.
Always use gcc to build vconv.
Add missing extern "C" to intrinsic definitions.
Change vconv to call link.exe instead of lib.exe for libraries.
2011-01-07 05:28:57 +00:00
Miodrag Milanovic
12a5370d85 Moved image devices implementation and related UI functions to emu section from MESS [Miodrag Milanovic] 2011-01-05 15:59:06 +00:00
Michaël Banaan Ananas
6f5c23de2b mt bug 2283 fix 2011-01-04 19:42:50 +00:00
Aaron Giles
3b41606ca0 running_device -> device_t
They both already existed. No sense in having two names for the
same object type.
2010-12-31 21:42:55 +00:00
Aaron Giles
57ef3a5ed6 Split the screen device into a separate module.
Converted global video routines into a video_manager.
Moved video manager initialization earlier in startup.
2010-12-02 17:26:38 +00:00
Aaron Giles
4a032ab057 Fix F4 shortcut so it explicitly labels the address as a number
by preceding it with "0x". This allows F4 to work properly, for
example, on the 68000 stepping to address a6, which also happens
to be a register name.
2010-11-29 16:23:20 +00:00
Aaron Giles
92b3dd111f Cleanup & version bump. 2010-11-08 09:08:55 +00:00
Scott Stone
7f4071e1f1 Incorporate MESS change into MAME core. 2010-11-06 17:24:58 +00:00
Aaron Giles
a2ce61ac6c Converted the expression engine to C++, did the usual cleanup. 2010-11-01 07:48:02 +00:00
Aaron Giles
59559fe282 Added support for OSD-generated fonts. The OSD is queried first to see
if it owns a given font (based on the name), and if it does, it is
responsible for generating bitmaps on the fly as characters are requested.

Added new option -uifont to specify the UI font. It can be set to a filename,
in which case a BDF font will be loaded. It can also be set to a font name
(assuming the OSD support is present), in which case the OSD font by that
name is used. The default value is 'default' which can be used by the OSD
to substitute a default font or by the OSD, which will default to ui.bdf
as before. In all cases, it falls back to the built-in font by default if
none of the previous options works.

On Windows, the OSD will default to Tahoma as the font name. Also on
Windows, font names can be specified with [b] to indicate bold or [i] to
indicate italic.
2010-10-24 00:16:54 +00:00
Aaron Giles
e4beed95a6 Create new class osd_interface to house OSD callbacks. Added new
module osdepend.c with default empty implementations. Changed
mame_execute() and cli_execute() to accept a reference to an
osd_interface which is provided by the caller.

Updated SDL and Windows OSD to create an osd_interface-derived
class and moved their OSD callbacks to be members.
2010-10-21 15:59:44 +00:00
Scott Stone
f3be589604 Import from MESS which fixes throttle mapping for Windows (non-SDL builds) (no whatsnew) 2010-10-21 14:52:42 +00:00
Aaron Giles
3ae00656d4 Cleanups and version bump. 2010-10-21 06:01:17 +00:00
Aaron Giles
9c553510dd For MSVC, explicitly include assert.h so that we can override the MSVC
version of assert(), which gets implicitly included later.
2010-10-19 14:30:14 +00:00
Aaron Giles
ec93220f95 03937: Using CTRL-C to end MAME no longer works reliably
Added explicit control handler for the console. Ctrl+C/Ctrl+Break now
explicitly terminate the process forcefully, rather than unwinding
through the system in an unexpected state. Other console events 
(exit, shutdown, logoff) request a graceful exit.
2010-10-19 14:15:46 +00:00
Aaron Giles
d8edbd14f2 Convert rendlay objects into C++, reduce the number of unused textures
allocated.

Fix texture leak in crsshair.c.
2010-10-18 01:51:58 +00:00
Aaron Giles
c30bcb6948 Fix crash when specifying -effect.
Moved -effect implementation out of OSD code and into core since
the implementations were identical across Windows/SDL and implemented
in the core itself.
2010-10-16 00:55:11 +00:00
smf-
3c6c94c8a2 fixed 64bit compiling with visual studio 2010 2010-10-14 19:29:13 +00:00
Aaron Giles
3e621b169b Cleanups and version bump. 2010-10-14 07:04:16 +00:00
Aaron Giles
3beb0ec246 Converted render.c objects into C++ objects. Updated all callers. 2010-10-13 06:20:10 +00:00
Aaron Giles
748bbd2b07 Enable vertical scroll bars in debugger comboboxes, and resize them to
show the full text.
2010-09-21 05:20:05 +00:00
Andrew Gardner
79aab2108b **FOR REVIEW**
Log: Added preliminary support for saving debugger window locations. [Andrew Gardner]


(Notes)
* I only save the values for the SDL debugger for now.
* There is no loading of these values yet, but if this patch is confirmed good, 
  loading should be relatively straightforward to add.
* There is a slight chance this might not compile on OSes other than linux.  
  I will be available via e-mail for the next 10 hours and will assist 
  with any compilation problems if they occur.
* The patch seems like the "right way" to do things, but if I am doing anything
  suspect, please feel free to make suggestions and corrections.
2010-09-20 16:00:42 +00:00
Aaron Giles
7a4744d31d Cleanups and version bump. 2010-09-19 05:09:00 +00:00
Aaron Giles
3d1a55e19e On Windows, osd_break_into_debugger() will now dump a stack crawl
if there's no debugger attached. This means that asserts should have
a full crawl now, for easier debugging.
2010-09-10 17:34:52 +00:00
Aaron Giles
58f4f9025b Added -bench <emulated-seconds> option to standardize benchmarking. 2010-09-09 05:18:02 +00:00
Aaron Giles
0bfacc56e6 Cleanups and version bump. 2010-07-29 13:59:41 +00:00
Aaron Giles
364e13529e Add notification of orientation of all monitors at startup via the
output system. [Laszlo Schulteisz]
2010-07-29 08:41:24 +00:00
Aaron Giles
30662dcdef Cleanups and version bump. 2010-07-06 17:30:28 +00:00
Aaron Giles
f7ce43f8fb Cleanup debugger interface some more. 2010-07-06 16:12:53 +00:00
Aaron Giles
5d21c672af Moved debugging structure away from CPUs only and attached to all
devices. Debugger now creates one for each device. C++-ified most
debugger operations to hang off the debugging class, and updated
most callers. This still needs a little cleanup, but it fixes most
issues introduced when the CPUs were moved to their own devices.

Got rid of cpu_count, cpu_first, cpu_next, etc. as they were badly 
broken. Also removed cpu_is_executing, cpu_is_suspended,
cpu_get_local_time, and cpu_abort_timeslice.

Some minor name changes:
  state_value() -> state()
  state_set_value() -> set_state()
2010-07-06 00:52:36 +00:00
Aaron Giles
c70c5fee5a Created CPU-specific device types for all CPUs, using new macros
DECLARE_LEGACY_CPU_DEVICE and DEFINE_LEGACY_CPU_DEVICE. Changed CPUs
to be their own device types, rather than all of type CPU with a
special internal subtype. Note that as part of this process I removed
the CPU_ prefix from the ALL-CAPS device name, so CPU_Z80 is just
plain old Z80 now. This required changing a couple of names like
8080 to I8080 so that there was an alphabetic first character.

Added memory interfaces to the list of fast-access interfaces. To do
this properly I had to add a separate method to devices which is
called immediately after construction, when it is possible to perform
dynamic_casts on fully-constructed objects. (This is just internal,
no changes necessary to the devices themselves.)

Some additional notes:
 * SH2 and SH4 had typedefs that conflicted with their CPU_-less names
    so I bulk renamed to structures to sh2_state and sh4_state; RB, feel
    free to choose alternate names if you don't like 'em
 * SCSP was caught doing something to the 3rd indexed CPU. Since several
    systems that use SCSP don't even have 3 CPUs, I had no idea what
    this was supposed to do, so I changed to it reference "audiocpu"
    assuming that stv was the assumed target. This is really gross and
    should be a configuration parameter, not a hard-coded assumption.
2010-07-03 00:12:44 +00:00
Aaron Giles
fa2d8a88a4 Oops, forgot to remove some dead code. 2010-07-02 03:55:48 +00:00
Aaron Giles
b67fd48c9f Winmain cleanup:
* created dynamic_bind<> template class to handle dynamically binding to
    optionally-supported functions
 * wrapped stack walking code in a class
 * wrapped symbol lookup code in a class
 * added support for parsing objdump-produced symbol dumps which include
    non-global functions for much better stack dumps and profiling in gcc builds

Also: modified makefile for win32 targets to automatically run objdump and
produce a .sym file if SYMBOLS is enabled.
2010-07-02 03:49:56 +00:00
Aaron Giles
77f2ea0e3e Resurrect the old sampling profiler, and improve it to be useful:
- always available now, just specify -profile <n> to enable it
 - supports stack walking to uniquely identify call chains; the <n> parameter
    to the -profile option specifies how deep to go
 - automatically turns off throttling and multithreading, and sets the number of
    processors available to 1 (since we only sample the main thread)
 - output now uses the common symbol lookup, which actually uses the PDB for
    MSVC builds and gives excellent results (may eventually figure out how to
    extract gcc symbols someday)
 - the top 30 unique call chains are output
2010-06-30 20:29:12 +00:00
Aaron Giles
265c584899 Turn off the bool warning. 2010-06-30 20:23:49 +00:00
Aaron Giles
733b797a3d Split mame.c into mame.c and machine.c, the latter containing the
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.
2010-06-30 03:46:21 +00:00
smf-
779da649f0 fixed unused variable error. 2010-06-26 07:18:49 +00:00
Aaron Giles
50767de707 Changed device name from an overridable function to a parameter passed to
the device_config constructor. In situations where the proper name is not 
known at construction time, a generic name can be specified and then 
overridden later once the configuration is complete.
2010-06-25 15:30:51 +00:00
Aaron Giles
29b6b0de41 C++-ified the debugger views. Not quite architecturally where I would
like them, but it's a start. Split implementation of individual view
types out to separate files. Updated all callers.

Also:
 * fixed okim6295 memory view
 * changed emualloc to free resource pools from earliest to latest
    so that early objects can safely clean up stuff they allocated
2010-06-25 05:11:42 +00:00
Aaron Giles
8c2c643a7e Regression fixes:
atarijsa.c: just use a generic device for the tms5220 to handle variants until
we have a proper base class (fixes eprom, eprom2 - eprom.c
"assert: src/emu/emucore.h:328: dynamic_cast<_Dest>(src) == src")

decocass.c: invert sense of reset line to MCU (fixes All sets in decocass.c - 
Games no longer begin loading (countdown))

metro.c: use generic device for the YM sound since multiple YM chips are used.
(fixes 3kokushi, blzntrnd, dharma, dharmak, dokyusei, dokyusp, gstrik2, gstrik2j, 
karatour, ladykill, lastfort, lastforte, lastforte, lastfortg, lastfortk, skyalert, 
toride2g, toride2gg, toride2j  - metro.c
"assert: src/emu/emucore.h:328: dynamic_cast<_Dest>(src) == src")

mitchell.c: when swapping the OKIM6295 for an MSM5205, use a different tag.
(fixes pangba, spangbl - mitchell.c
"assert: src/emu/emucore.h:328: dynamic_cast<_Dest>(src) == src")

deco32.c: use a proper EEPROM device to fetch the space from.
(fixes tattass, tattassa - deco32.c - Crash while checking "Jack Ram" before start 
"assert: src/emu/emucore.h:328: dynamic_cast<_Dest>(src) == src")

system1.c: use a proper z80pio_device (cleanup)

vconv.c: support -g* options for MSVC builds (cleanup)

m377101.c/g65816.c: fix fault logic for mapping icount (fixes
All sets in namcofl.c, namcona1.c, namconb1.c, nss.c, sfcbox.c, snesb.c 
airco22b, cybrcycc, dirtdash, rrf, timecrs, timecrsa - namcos22.c
Hanging immediately or shortly after start.
"assert: src/emu/schedule.c:189: ran >= *exec->m_icount")

schedule.c/diexec.c/timer.c: add temporary logging to permit direct comparisons with
earlier games timing (cleanup)

generic.c: fix computation of time for turning off the IRQ when using 
generic_pulse_irq() to account for CPU-local time (fixes
Any sets in bublbobl.c which use the which use m6801 - Frequent/Random watchdog resets.)

z80pio.c: convert internal line states to bool, and fix typo (control_write should have
been data_write in one place) (fixes Any system1.c games which use z80pio - No sound)
2010-06-14 07:40:06 +00:00
Aaron Giles
ad12251785 Remove stray bitmap_free's. 2010-06-08 23:40:57 +00:00
Aaron Giles
100564d412 WARNING: There are likely to be regressions in both functionality and
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]
2010-06-08 06:09:57 +00:00
Fabio Priuli
7d09e1a3d8 small change required by MESS: TAB should not turn on the MAME Internal UI if the user has enabled newui. No effect in MAME and, hence, no whatsnew mention needed.
While at it, I also associated ESC to Menu bar toggling when in newui (like many other emulators for Windows), given that user would quit MESS with File > Exit in the menu bar.
2010-06-04 18:37:22 +00:00
Scott Stone
765aa09be9 Fixed a warning in Visual Studio 2010 that was introduced by a previous commit. [Oliver Stoneberg] 2010-05-28 00:15:39 +00:00
Scott Stone
2a0f9cdbb8 Corrected stack walk by using UNICODE_POSTFIX. Fixed some incorrect function declarations in winmain.c. [Oliver Stoneberg] 2010-05-15 21:07:54 +00:00
Michaël Banaan Ananas
b80779d95e work around gcc 4.5 (harmless) warning:
case value '13' not in enumerated type 'D3DTEXTURESTAGESTATETYPE'
(and other cases)
2010-05-13 20:37:19 +00:00
Michaël Banaan Ananas
87b8c8a6ab (gcc 4.5 compile error) 2010-05-05 17:32:32 +00:00
Scott Stone
ca0f74f334 Fix the memory leaks with the strconv.c function by
using osd_malloc() instead.  Fixed other memory leaks as well.  [Oliver Stoneberg]
2010-04-23 17:10:03 +00:00
Scott Stone
d90ce8dfe3 Remove some stray invalid code in start_profiler() [Oliver Stoneberg] 2010-04-23 16:51:51 +00:00
Fabio Priuli
c02b195ede several cleanups based on cppcheck and VS2008 Code Analysis [Oliver Stöneberg]
split.c: made the "split" return the actual result instead of just 0. [Oliver Stöneberg]

clifront.c: made the identation of the CPU device in -listdevices the same like the others [Oliver Stöneberg]

i386.c: gave some fatalerror() calls in the i386 proper messages [Oliver Stöneberg]

ssem.c: fixed compilation of SSEM core with SSEM_DISASM_ON_UNIMPL [Oliver Stöneberg]

srcclean.c: small wording change in the srcclean summary [Oliver Stöneberg]

sdl/window.c: fixed a potential memory leak in  sdlwindow_video_window_create() [Oliver Stöneberg]
2010-03-17 11:59:16 +00:00
Scott Stone
000351226a Corrected default assignment of F10 as the default throttle on/off key for MAME. The #ifdef MESS is needed here due to it's unique old/new UI setup. [Miodrag Milanovic] 2010-02-27 17:24:39 +00:00
Miodrag Milanovic
3a4544a651 ui.c,ui.h,windows/input.c: [Miodrag Milanovic]
- removed ui_use_new_ui check used by MESS code
- moved ui_mess_handler_ingame call in proper place, so device UI callbacks works again
- removed toggle of menu bar (MESS related)
2010-02-16 12:45:38 +00:00
Aaron Giles
28c18703aa osdcore files MUST NEVER include headers from the core emulator. 2010-02-14 22:07:25 +00:00
Miodrag Milanovic
d63d1711eb osd_get_emulator_directory removed (no credit) 2010-02-13 20:19:14 +00:00
Miodrag Milanovic
9758c13b82 - Removed not used OSD functions
- Placed new functions into sdlos subfiles since they need different implementation
(no whatsnew needed)
2010-02-13 17:20:25 +00:00
Miodrag Milanovic
0a6b13608d - Moved natural keyboard support from MESS to MAME
- Moved OSD file functions and clipboard access functions into OSD core
2010-02-12 15:40:11 +00:00
Couriersud
88946d721a Added DEBUG_FLAG_OSD_ENABLED to allow coexistence of debuggers going forward.
Replaced all occurrences of OPTION_DEBUG in src/osd/* by checking machine->debug_flags
Replaced all occurrences of DEBUG_FLAG_ENABLED in src/osd/* by DEBUG_FLAG_OSD_ENABLED 
For the time being, DEBUG_FLAG_OSD_ENABLED is default (set in mame.c)
Debugger: avoid clearing DEBUG_FLAG_OSD_ENABLED
2010-02-05 01:35:52 +00:00
Aaron Giles
fe3d7c4af4 Cleanups and version bump. 2010-01-28 08:03:44 +00:00
Phil Bennett
ff8cb78876 Converted the following drivers to use driver_data structs: [Atari Ace]
39in1, raiden2, safarir, sbowling, shougi, skeetsht, skyarmy, sliver,
spoker, spool99, srmp5, srmp6, ssingles, sstrangr, sub, supdrapo,
superdq, supertnk, suprgolf.


---------- Forwarded message ----------
From: Atari Ace <atari_ace@verizon.net>
Date: Thu, Jan 21, 2010 at 1:53 AM
Subject: [patch] Additional driver_data conversions, PCTSTR => LPCTSTR
To: submit@mamedev.org
Cc: atariace@hotmail.com

Another driver_data patch, this one converting the following single
file drivers

39in1, raiden2, safarir, sbowling, shougi, skeetsht, skyarmy, sliver,
spoker, spool99, srmp5, srmp6, ssingles, sstrangr, sub, supdrapo,
superdq, supertnk, suprgolf.

I also tossed in a one line fix to winmain.c (PCTSTR => LPCTSTR).  My
unofficial toolchain doesn't have a definition for PCTSTR, it
certainly looks like a typo.

~aa
2010-01-25 14:56:09 +00:00
Aaron Giles
093637cc29 Exit from the unhandled exception filter cleanly now.
Use SetErrorMode() to disable the appearance of dialog boxes
when crashes occur.
2010-01-20 06:59:01 +00:00
Couriersud
0328f34acb Autodetection of PTR64 can be inhibited now by specifying PTR64=0.
On mixed 32bit/64bit targets identifying themselves as 64bit this can be used to build a 32bit executable.
2010-01-19 22:09:45 +00:00
Aaron Giles
ba36521102 Fix compile error. 2010-01-18 19:51:30 +00:00
Aaron Giles
e738b79785 Correct a long-standing design flaw: device configuration state
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.
2010-01-18 09:34:43 +00:00
Couriersud
269e2cf4fc Removed stdlib.h from osdcomm.h.
- Added #include stdlib.h where now necessary
Fixed Solaris build
Fixed building unidasm for OSD=sdl on win32
2010-01-17 19:27:03 +00:00
Aaron Giles
0c191eac42 Compile fix for MSVC psikyosh (dynamic array sizes are a later
extension).

Improved stack walking on crash in Windows. Now using StackWalk64 to
do the stack walk, resulting in cleaner logs. Also will try to use
system function to look up symbol and source/line information if
present. End results:

- 32-bit gcc: parses symbol info from map file as before (this would
work better if we could coax gcc into outputting static functions in
the map)

- 64-bit gcc: has runtime issue that causes the exception handler to
not be invoked. Will work with mingw folks on it.

- 32/64-bit MSVC: nice stack dumps with symbol and source/line info,
if the PDB file is present. If not, falls back to the MAP file.
2010-01-16 21:14:23 +00:00
Aaron Giles
98c015372e Fix memory allocation issue in debug builds. 2010-01-16 11:57:58 +00:00
Aaron Giles
f373246c42 Fix PTR64 autodetect for Windows 2010-01-16 04:40:55 +00:00
Aaron Giles
aebc07a897 Cleanups and version bump. 2010-01-16 04:12:04 +00:00
Aaron Giles
971151c8d7 Cheesy autodetect for PTR64 on Windows using standard build tools. 2010-01-15 23:42:49 +00:00
Aaron Giles
470f843262 Within src/emu, basic conversions:
devtag_get_device ... machine->device()
  memory_find_address_space ... device->space()
2010-01-12 06:54:57 +00:00
Aaron Giles
2b23d7c017 Bulk driver.h -> emu.h switch. 2010-01-10 18:00:42 +00:00
Aaron Giles
4498faacd9 First round of an attempted cleanup of header files in the system.
- 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!)
2010-01-10 00:29:26 +00:00
Aaron Giles
91a1b8d634 NOTE: This change requires two new osd functions: osd_malloc() and
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.
2010-01-08 06:05:29 +00:00
Aaron Giles
5885e973db Makefile changes:
- Changed INLINE to map to "static inline"
 - (Windows only) Made -static-libgcc standard for both 32-bit and 64-bit
 - (Windows only) Some fixes for MSVC builds
2010-01-05 22:01:10 +00:00
Aaron Giles
a3b0cf0aea Make MSVC compile once again. 2010-01-04 01:30:53 +00:00
Aaron Giles
13c6148885 Fix debug build. 2010-01-04 00:06:45 +00:00
Aaron Giles
b4099c91bc Changes to sync with new toolchain:
1. Removed CPP_COMPILE option. All files (except expat and zlib)
are now compiled as C++ by default. For now, imagine nothing has
changed. The goal is not to go hog-wild with C++isms, but to
leverage it where it makes the most sense.

2. Mapped INLINE to plain old C++ inline now, fixing several
cases where this was problematic.

3. Marked global const structures explicitly extern since consts
are locally-scoped by default in C++.

4. Added new 'default' make target which just builds the emulator.
Use 'make all' to build everything including the tools.

5. 64-bit builds now get a '64' suffix on them. We might want to
just make this true for Windows builds, but it's on for everyone
at the moment.

6. (Windows) Removed UNICODE option. UNICODE is enabled by default
on all Windows builds now. The 32-bit version links against
libunicows.a for continued Win9x compatibility.

7. (Windows) Removed hacks surrounding unicode handling of main().
They are no longer necessary with the new tools.
2010-01-03 21:31:44 +00:00
Aaron Giles
81523f2e10 gcc 4.5.0 compilation fixes. 2009-12-29 14:35:54 +00:00
Aaron Giles
bd24fb23c1 Results of running the latest srcclean. 2009-12-28 09:04:00 +00:00
Aaron Giles
93d465ad3c Whitespace cleanup. (No, a release is not yet imminent.) 2009-12-28 08:49:12 +00:00
Aaron Giles
f20a2e6b17 Fixes so we can compile as C++ again. 2009-12-28 07:34:17 +00:00
Aaron Giles
67bef66987 Changed behavior of -watchdog option to act like a real watchdog. It now
specifies the number of seconds after the last video update that will
cause auto-termination of MAME. Also modified it to output a message
when the watchdog triggers the exit.

Updated windows.txt to reflect this option and the debugger_font options
which were never previously documented.
2009-12-24 02:52:17 +00:00
Phil Bennett
bc485032d7 03583: Windows Debug: Stack crawl is not generated anymore [Oliver Stoneberg]
---------- Forwarded message ----------
From: Oliver Stöneberg <oliverst@online.de>
Date: Tue, Dec 15, 2009 at 5:40 PM
Subject: Stack Crawl
To: submit@mamedev.org


This patch enables the stack crawl on windows platforms again (bug
3583).
2009-12-21 16:25:32 +00:00
Couriersud
3af4cd9bec Added option "numprocessors"
-numprocessors <auto|value>
        Specify the number of processors to use for work queues. Specifying
        "auto" will use the value reported by the system or environment 
        variable OSDPROCESSORS. To avoid abuse, this value is internally limited
        to 4 times the number of processors reported by the system. 
        The default is "auto".
2009-12-19 23:12:07 +00:00
Aaron Giles
2d22e450f2 Cleanups and version bump. 2009-10-12 08:45:25 +00:00
Aaron Giles
357e36fc84 Eliminated osd_cpu.h.
Types are pretty much unified now.
Multiply operations are handled by eminline.h.
Divide operations were just silly in macros.
64/32-bit combination/extraction macros moved to osdcomm.h and renamed.

Also fixed compile errors in recent 68k changes.
2009-10-12 08:37:04 +00:00
Aaron Giles
3851b425b7 Moved all the OSD/windows code over to straight BSD license.
Updated osdmini to work again and compile as an actual target
(doing nothing at the moment). Converted all of its code over
to straight BSD as well.
2009-10-12 05:56:47 +00:00
Aaron Giles
fe289e67f5 > -----Original Message-----
> From: Atari Ace [mailto:atari_ace@verizon.net]
> Sent: Sunday, September 27, 2009 7:58 AM
> To: submit@mamedev.org
> Cc: atariace@hotmail.com
> Subject: [patch] More _NAME macros
> 
> Hi mamedev,
> 
> MAME's idiom for function/data macros is to first implement
> <name>_NAME, then implement the other macros in terms of the _NAME
> macro.  Then in principle only a single line needs editing to change
> the naming convention.
> 
> This patchset implements this idiom more completely.  The first patch
> adds some missing _NAME macros and fixes cases in source files that
> should be using the macros.  The second patch then changes header
> files where the macros should have been used, but weren't.  This
> required changing the idiom for removing a machine driver function
> pointer from MDRV_<FUNCTION>(NULL) to MDRV_<FUNCTION>(0), to avoid
> problems with NULL being macro expanded.  This actually unifies the
> handling of all such cases, as we already had ipt_0 and driver_init_0.
> It also required reworking the devtempl.h implementation in a way that
> triggered a warning on MSVC about using empty macros, so vconv.c
> needed to be updated.  The third patch then renames all the _NAME and
> _0 macros to verify that all the cases have been covered, so it isn't
> intended to be applied.
> 
> ~aa
2009-10-01 17:27:29 +00:00
Aaron Giles
38978f878a Move MSVC clean out of core makefile and into windows.mak where it belongs. 2009-09-21 09:03:25 +00:00
Aaron Giles
f60bbef070 Rename osd_profiling_ticks() to get_profile_ticks(). Moved implemention into
inline functions in eminline.h and the ei* functions. [couriersud, Aaron Giles]
2009-09-06 23:30:26 +00:00
Aaron Giles
191fe9cdc3 > From: Atari Ace [mailto:atari_ace@verizon.net]
> Sent: Sunday, September 06, 2009 7:25 AM
> To: submit@mamedev.org
> Cc: atariace@hotmail.com
> Subject: [patch] Deglobalize input.c
> 
> Hi mamedev,
> 
> These patches deglobalize input.c.  The first adds running_machine to
> some driver apis.  The (large) second patch adds the machine parameter
> to the most input_code_pressed apis (generated by script, not
> compilable).  The last patch then actually changes those apis and
> others to take running_machine, and adds struct _input_private to hold
> the input state variables.
> 
> ~aa
2009-09-06 22:28:58 +00:00
Aaron Giles
f0ba9131eb osd_is_bad_read_ptr is no more. 2009-08-29 22:53:40 +00:00
Michaël Banaan Ananas
611e566967 Fixed insignificant 'file not found' compile error when using windows cmd.
It was (still is) fine on msys
2009-08-19 17:53:53 +00:00
Aaron Giles
564aa21bc1 Removed round() hack in favor of MSVC-specific #define in winprefix.h.
Changed bilinear filter to use faster rgbutil.h version. It would
be even faster if the texture code downconverted to fixed-point
earlier and then used the integer values when doing the texture
lookups.
2009-05-09 22:03:21 +00:00
Aaron Giles
c80c4730c4 From: Xander Xander [xander85@operamail.com]
Sent: Wednesday, May 06, 2009 12:01 PM
To: submit@mamedev.org
Subject: MAME Debugger

In some processors (like Z80), it is not possible to put the BPs to
0x000A, 0x000B, 0x000C, 0x000D, 0x000E with the key F9, and if it
is inserted more than 10 BP, the BP A, B, C, D, E cannot be removed
with the key F9.

Xander
2009-05-07 15:29:33 +00:00
Aaron Giles
9eb86548bb Added missing casts and made other tweaks. The entire project
can now be optionally compiled with the C++ compiler (mingw g++
only for the moment; MSVC still has issues).
2009-04-27 09:18:17 +00:00
Aaron Giles
ad4910a8a8 Bulk change alert.
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.
2009-04-26 23:54:37 +00:00
Derrick Renaud
415360fc4a removed a DirectX gun change that was not meant to be committed with my last update. 2009-04-20 16:24:47 +00:00
Derrick Renaud
36a7c1ffc9 When using RawInput - Fixed UI selection of Gun axis so Gun 1 is not always selected with the desired gun. 2009-04-20 02:01:38 +00:00
Derrick Renaud
2d85128b03 Fixed verbose output of RAW device names for XP. 2009-04-19 23:07:14 +00:00
Derrick Renaud
07ed3cdd71 Fixed mouse/lightgun buttons to individually select when using -mouse/-multimouse and -lightgun. Meaning you will not receive Mouse Button 0 Gun Button 0 when selecting in the UI. 2009-04-18 23:43:58 +00:00
Derrick Renaud
01962d4fc5 Crosshair update
* Added Crosshair Options menu
  - ability to individually enable/disable crosshairs
  - ability for them to automatically disappear after a set amount of time
  - ability to select crosshair graphic
  - all settings are saved in the cfg file
 * Removed F1 toggle for crosshairs
 * Added new command option -crsshairpath
  - store all selectable graphics here
  - see config.txt for further info

OSD NOTE: render_load_png() has been changed to no longer force usage of the artwork directory.
Do a search for "render_load_png(" and replace with "render_load_png(OPTION_ARTPATH, " if needed.

----------------------------
F1 is now free to use for something new.  I was thinking it would be perfect for a context sensitive help file.  Each menu item could have a help tag, that it would look up and display info from an HTML file.
2009-03-28 22:55:34 +00:00
Aaron Giles
475762a3fd Sound cores compile cleanly. 2009-03-12 15:25:58 +00:00
Aaron Giles
eb539cce9d Many casts added to the core files, and various other tweaks
to make them compile as either C or C++.
2009-03-12 07:43:03 +00:00
Aaron Giles
99d297a6fd Cleanups and version bump. 2009-03-05 09:38:53 +00:00