Commit Graph

392 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
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
Wilbert Pol
446be9ae42 Fix osx compile. 2011-03-30 20:29:36 +00:00
Olivier Galibert
9300bf632c The scripts did an interesting number on the sdl/debugwin.c file :-) 2011-03-30 20:13:55 +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
Wilbert Pol
f3916bed57 Fix osx compile. 2011-03-28 20:50:41 +00:00
Miodrag Milanovic
da5fb6dd0d Another fix for SDL build, not seen by win32 build (no whatsnew) 2011-03-28 12:00:04 +00:00
Miodrag Milanovic
09b83b1c61 Fix compile for SDL build (no whatsnew) 2011-03-28 11:24:52 +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
Couriersud
9ad9840545 sdl-config flags are now separated into INCFLAGS and COMFLAGS in sdl.mak. This fixes "make depend". [Couriersud] 2011-03-26 22:53:01 +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
Aaron Giles
fb5091182e Cleanups and version bump. 2011-03-25 16:14:09 +00:00
Fabio Priuli
19b50e3ca6 Fixed parsing of uimodekey from .ini on SDL [Fabio Priuli] 2011-03-11 20:34:35 +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
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
65ba686867 Fix OS/2 compile [K.O. Myung-Hun] 2011-02-28 18:07:37 +00:00
Aaron Giles
9ef0bcf8f2 Cleanups and version bump. 2011-02-28 09:27:05 +00:00
R. Belmont
64736f5f19 Fix pastebin hash (no whatsnew) 2011-02-17 05:34:19 +00:00
R. Belmont
3aac5c3440 SDL: GLSL now works for all pixel formats; fixed memory leak on textures [cgwg] 2011-02-17 04:49:05 +00:00
Couriersud
fb0d7484bc osd/sdl again compiles against latest SVN 1.3. SDL 1.3 still is WIP so expect more changes. No whatsnew. 2011-02-12 13:36:42 +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
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
Aaron Giles
ae5dfca0bf Fix build break from last checkin.
Also replace timer_get_time() with machine->time()

1. Main conversion
timer_get_time( *)\( *([^)]+) *\)
\2->time\1()

2. Cleanup #1
&machine->time
machine.time

3. Cleanup #2
&m_machine->time
m_machine.time
2011-02-06 07:29:03 +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
Aaron Giles
1e88333178 Converted attotime to a class, with proper operators. Removed old
global functions which are now superceded by the operators and
methods on the class. [Aaron Giles]

Required mappings are:

attotime_make(a,b)            => attotime(a,b)
attotime_to_double(t)         => t.as_double()
double_to_attotime(d)         => attotime::from_double(d)
attotime_to_attoseconds(t)    => t.as_attoseconds()
attotime_to_ticks(t,f)        => t.as_ticks(f)
ticks_to_attotime(t,f)        => attotime::from_ticks(t,f)
attotime_add(a,b)             => a + b
attotime_add_attoseconds(a,b) => a + attotime(0, b)
attotime_sub(a,b)             => a - b
attotime_sub_attoseconds(a,b) => a - attotime(0, b)
attotime_compare(a,b) == 0    => a == b
attotime_compare(a,b) != 0    => a != b
attotime_compare(a,b) < 0     => a < b
attotime_compare(a,b) <= 0    => a <= b
attotime_compare(a,b) > 0     => a > b
attotime_compare(a,b) >= 0    => a >= b
attotime_mul(a,f)             => a * f
attotime_div(a,f)             => a / f
attotime_min(a,b)             => min(a,b)
attotime_max(a,b)             => max(a,b)
attotime_is_never(t)          => t.is_never()
attotime_string(t,p)          => t.as_string(p)

In addition, some existing #defines still exist but will go away:

attotime_zero                 => attotime::zero
attotime_never                => attotime::never
ATTOTIME_IN_SEC(s)            => attotime::from_seconds(s)
ATTOTIME_IN_MSEC(m)           => attotime::from_msec(m)
ATTOTIME_IN_USEC(u)           => attotime::from_usec(u)
ATTOTIME_IN_NSEC(n)           => attotime::from_nsec(n)
ATTOTIME_IN_HZ(h)             => attotime::from_hz(h)
2011-02-03 07:52:45 +00:00
R. Belmont
28e34ea140 NetBSD support [Thomas Klausner]
Not for whatsnew: I added -Wno-conversion unconditionally to disable the 
warnings Thomas reported.  That setting is the default for GCC out-of-the-box 
but apparently not on NetBSD.  As far as I know it shouldn't cause a problem 
with any GCC version back to at least 4.0.0 so we're safe even on PPC OSX, 
but do let me know if hilarity ensues.
2011-02-02 03:29:54 +00:00
Aaron Giles
b3d7e09292 Cleanups and version bump. 2011-01-24 05:09:05 +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
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
R. Belmont
e5cc3338d9 Same fix for sockets (no whatsnew) 2011-01-16 21:05:59 +00:00
R. Belmont
2f1b7f3468 Fix inability to detect an error in sdl_write_ptty (no whatsnew) 2011-01-16 21:01:14 +00:00
Miodrag Milanovic
b11eaf0e46 Cleaned OSD windows and emu part from NEWUI dependencies (no whatsnew) 2011-01-13 09:11:34 +00:00
R. Belmont
2d32a07198 SDL OS/2 fixes [K.O. Myung-Hun] 2011-01-10 14:32:42 +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
Couriersud
956e96048f Remove "makedep" stuff from sdl.mak now that the core supports it. Also split sdl-config output between INCPATH and CCOMFLAGS for linux targets. makedepend now works. [Couriersud] 2011-01-03 20:40:20 +00:00
R. Belmont
a8cc3824f1 Fix Mac compile error (no whatsnew) 2011-01-02 22:04:03 +00:00