Commit Graph

202 Commits

Author SHA1 Message Date
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
Couriersud
3e7ae30094 GTK-Debugger (SDL)
- implement key handling (Up, down, ..) like in windows
- Tab and ESC not yet handled
2010-01-24 22:14:14 +00:00
Couriersud
e5dc859628 Removed duplicate declarations from debug-cb.h 2010-01-24 21:25:55 +00:00
R. Belmont
eaf0d1b924 SDL: fixed GTK debugger compile 2010-01-23 03:39:46 +00:00
Couriersud
fb5b325830 GTK-Debugger
- Run to cursor (main view)
- In place memory editing (memory view)

There are still some issue with e.g. scrolling. 
However, it is usable.
2010-01-23 01:08:15 +00:00
Couriersud
3a35df8d63 GTK Debugger work
- glade-2 can now be used again to edit the debug.glade file. 
- No more need to edit the files created by glade-2
- All "activate" handlers now pass the parent window pointer.
- malloc ==> osd_malloc to prevent mixed c++/c window allocations.
2010-01-22 22:16:27 +00:00
Couriersud
3003882f9b Fix DEBUG build 2010-01-22 21:14:06 +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
a63d3b5de4 malloc ==> osd_malloc, free ==> osd_free 2010-01-21 20:12:33 +00:00
Couriersud
8611469df7 Fix a typo 2010-01-20 17:37:23 +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
Aaron Giles
4aa2483e57 Attempt to fix OS X debugger. 2010-01-20 03:41:48 +00:00
Couriersud
eb9ed61a68 OpenBSD support in makefile/sdl.mak
Fix XBSD detection of PTR64 (uses amd64)
Cosmetic change to sdlprefix.h
2010-01-20 01:18:35 +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
Couriersud
98b6824982 sdl.mak updates
- On targets supporting "-m64" and "-m32" use them.
- On unix ppc targets, add -Dpowerpc automatically
2010-01-19 21:58:26 +00:00
Couriersud
81e85ffd7a Bring sdl in line with windows 2010-01-18 23:55:14 +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
Couriersud
b347a5135a Minor cosmetic changes:
- order of includes
- remove duplicate code
2010-01-16 22:21:11 +00:00
Couriersud
f702582726 Added GTL_INSTLL_ROOT to optionally build win32 with the mame debugger. 2010-01-16 22:18:47 +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
Couriersud
ec71e879db It worked on OSX, broke on windows ... 2010-01-16 19:45:53 +00:00
Couriersud
ab8ac327eb sdl.mak rewrite
- TARGETOS=freebsd may now be given on make invocation
- modular approach, separate sections for opengl, x11, debugger
- most target specific settings parametrized.
2010-01-16 19:34:04 +00:00
R. Belmont
cfa1a02096 Add SDLMAME keymaps (no whatsnew) 2010-01-16 14:40:50 +00:00
Aaron Giles
98c015372e Fix memory allocation issue in debug builds. 2010-01-16 11:57:58 +00:00
Aaron Giles
1c38c3eb87 Fix SDL Win32 build to build as unicode. 2010-01-16 05:55:15 +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
Couriersud
f6c832ea90 - testkeys now builds again
- for unix targets, added a depend rule to sdl.mak which builds a .depend file.
2010-01-16 02:20:45 +00:00
Aaron Giles
971151c8d7 Cheesy autodetect for PTR64 on Windows using standard build tools. 2010-01-15 23:42:49 +00:00
Couriersud
2a0dcc679e Cosmetic changes, no credit 2010-01-15 23:28:30 +00:00
Couriersud
b998026736 SDLMAME: add BGRA support to -video soft 2010-01-15 21:13:12 +00:00
R. Belmont
9ba62e6bce SDLMAME: improved OS X and SDL 1.3 SVN support, try to autodetect SDLMAME targets [Couriersud] 2010-01-15 21:05:29 +00:00
Couriersud
997a17cc2d Changed all CFLAGS to CCOMFLAGS to be consistent to what windows.mak does 2010-01-14 22:53:04 +00:00
R. Belmont
b53bb2c6ac SDLMAME initial import [R. Belmont, Couriersud] 2010-01-13 04:01:20 +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
46b81c390e Explicitly allow PAIR and PAIR64 in save states. 2010-01-12 03:32:07 +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