Commit Graph

35 Commits

Author SHA1 Message Date
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
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
Couriersud
9861df0600 Fix font loading in sdlmame. BDF files are just loaded as TTF by TTF_OpenFont. Load is now protected by a magic check.
Also fixed a bug in SDL1.3 keyboard mapping and changed SDL1.3 code to be compatible with recent 1.3 API changes. [Couriersud]
2011-03-26 22:51:17 +00:00
Fabio Priuli
19b50e3ca6 Fixed parsing of uimodekey from .ini on SDL [Fabio Priuli] 2011-03-11 20:34:35 +00:00
R. Belmont
d12a22455d SDL: Fix uimodekey for MESS [Barry Rodewald, R. Belmont] 2011-03-07 01:33:03 +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
R. Belmont
b814401976 Fix SDL. Maybe. (no whatsnew) 2011-02-12 05:08:26 +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
Couriersud
c5892bda57 Added "-syncrefresh" option to osd/sdl. This will *limit* the game speed to the video refresh rate and works in -mt mode as well. The option has an effect only if "-waitsync" is specified. [Couriersud, Chris Kennedy] 2011-01-22 12:51:52 +00:00
Couriersud
5268d48065 "Copy-and-Paste" the "-bench" option from win32 to sdl. [Couriersud] 2011-01-02 21:19:32 +00:00
Couriersud
e7b559190f Only enable watchdog for sdlmame if "-str" set and smaller than 300 seconds. No whatsnew. 2011-01-02 21:02:59 +00:00
Couriersud
8386bf94a5 Implemented "-watchdog" option for SDLMame. [Couriersud] 2011-01-02 19:12:08 +00:00
Couriersud
8bc7fc5f76 Fix most-likely-to-fail SDL_TTF version check. Added a warning if strikethrough is specified but not supported. [Couriersud] 2010-12-28 23:31:12 +00:00
Couriersud
96ce772581 sdlmame now also looks for fonts in "-fontpath". In addition, moved font config stuff into function search_font_config. This is in preparation to add ttf support to windows sdlmame build. [couriersud] 2010-12-28 23:01:38 +00:00
Couriersud
e2686259a0 Fix compile on linux when using SDL_INSTALL_ROOT. All linux builds
now actually honour up the include path provided by sdl-config.
2010-12-26 23:50:09 +00:00
Aaron Giles
6bfc3413e4 Cleanups and version bump. 2010-12-08 07:01:03 +00:00
R. Belmont
b7fe2d497c SDL: Mac compile warning fix [Wilbert Pol] 2010-11-16 03:16:12 +00:00
R. Belmont
b2c5f44b25 SDL: Build fixes for Ubuntu, -uifont non-ASCII rendering fix [R. Belmont, Barry Rodewald] 2010-11-16 03:14:21 +00:00
R. Belmont
64141e7c07 SDL: OS X support for -uifont [Tim Lindner] 2010-11-15 17:34:03 +00:00
R. Belmont
fb70e23067 SDL: Fix OS X and Windows builds (no whatsnew) 2010-11-13 03:50:33 +00:00
R. Belmont
f75bcedd30 SDL: -uifont now can also look up system font families like Windows [R. Belmont] 2010-11-13 02:51:23 +00:00
R. Belmont
db0b32ddb0 SDL: Support -uifont for using arbitrary TrueType fonts on Linux/BSD builds.
This takes full pathname/filename to the font, and the name can have styles 
appended as in Windows: [b] for bold, [i] for italic, [s] for strikethrough, 
and [u] for underlined.  Fonts are rendered at a size of 120 points and scaled 
down by the core, which looks superb on high-res displays.  (Liberation Sans
that comes with most recent distros looks really good).

Warning: Linux/BSD builds now require SDL_ttf 2.x.  On Fedora the required 
package names are "SDL_ttf" and "SDL_ttf-devel".
2010-11-12 03:57:19 +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
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
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
R. Belmont
918535de88 SDL: remove problematic live render type toggle and default OS X to OpenGL 2010-06-02 02:15:58 +00:00
Miodrag Milanovic
d63d1711eb osd_get_emulator_directory removed (no credit) 2010-02-13 20:19:14 +00:00
Couriersud
5c2e28e845 No credit, please
- put code not actually required in MAME into "#ifdef MESS"
- Moved global definition of sdl_cwd from sdl_file.c back to sdl_main.c
2010-02-13 19:26:39 +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
Miodrag Milanovic
48e3d6cca0 Fix for MESS SDL build (checked only on windows platform).
Needed since getcwd function is used.
Couriersud and R.Belmont please check (no whatsnew)
2010-01-30 20:20:44 +00:00
Couriersud
10bee5ce78 The return of the "misc"
- Added sdlmisc_<targetos>.c again. This was necessary since
  certain tools create stubs for e.g. osd_break_into_debugger.
  If we do not have this in a separate file, the link stage may
  break.
- Applied OS/2 patch [Credit: KO Myung-Hun]
- Cleaned up #includes. Removed stdlib.h were possible.
- More malloc to osd_malloc rename.
- SDL monitor modes are read now when they are needed. This is now consistent across platforms.
2010-01-21 22:54:49 +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
aebc07a897 Cleanups and version bump. 2010-01-16 04:12:04 +00:00
R. Belmont
b53bb2c6ac SDLMAME initial import [R. Belmont, Couriersud] 2010-01-13 04:01:20 +00:00