Commit Graph

11344 Commits

Author SHA1 Message Date
Aaron Giles
0e627f1a54 Convert emu_timers to objects. Move implementation and management of
timers into the scheduler. Retain TIMER devices as a separate wrapper
in timer.c/.h. Inline wrappers are currently provided for all timer
operations; a future update will bulk clean these up.

Rather than using macros which hide generation of a string-ified name
for callback functions, the new methods require passing both a function
pointer plus a name string. A new macro FUNC() can be used to output
both, and another macro MFUNC() can be used to output a stub-wrapped
class member as a callback.

Also added a time() method on the machine, so that machine->time() gives
the current emulated time. A wrapper for timer_get_time is currently
provided but will be bulk replaced in the future.

For this update, convert all classic timer_alloc, timer_set, 
timer_pulse, and timer_call_after_resynch calls into method calls on 
the scheduler. 

For new device timers, added methods to the device_t class that make 
creating and managing these much simpler. Modern devices were updated
to use these.

Here are the regexes used; some manual cleanup (compiler-caught) will
be needed since regex doesn't handle nested parentheses cleanly

1. Convert timer_call_after_resynch calls
timer_call_after_resynch( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\)
\3->scheduler().synchronize\1\(\2FUNC(\6), \5, \4\)

2. Clean up trailing 0, NULL parameters
(synchronize[^;]+), 0, NULL\)
\1)

3. Clean up trailing NULL parameters
(synchronize[^;]+), NULL\)
\1)

4. Clean up completely empty parameter lists
synchronize\(FUNC\(NULL\)\)
synchronize()

5. Convert timer_set calls
timer_set( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\)
\3->scheduler().timer_set\1\(\2\4, FUNC(\7), \6, \5\)

6. Clean up trailing 0, NULL parameters
(timer_set[^;]+), 0, NULL\)
\1)

7. Clean up trailing NULL parameters
(timer_set[^;]+), NULL\)
\1)

8. Convert timer_set calls
timer_pulse( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\)
\3->scheduler().timer_pulse\1\(\2\4, FUNC(\7), \6, \5\)

9. Clean up trailing 0, NULL parameters
(timer_pulse[^;]+), 0, NULL\)
\1)

10. Clean up trailing NULL parameters
(timer_pulse[^;]+), NULL\)
\1)

11. Convert timer_alloc calls
timer_alloc( *)\(( *)([^,;]+), *([^,;]+), *([^);]+)\)
\3->scheduler().timer_alloc\1\(\2FUNC(\4), \5\)

12. Clean up trailing NULL parameters
(timer_alloc[^;]+), NULL\)
\1)

13. Clean up trailing 0 parameters
(timer_alloc[^;]+), 0\)
\1)

14. Fix oddities introduced
\&m_machine->scheduler()
m_machine.scheduler()
2011-02-06 07:15:01 +00:00
Aaron Giles
f38d3384b6 Hack out mpu4ext.lh dependency since it was not included with the original
submission.
2011-02-06 06:30:48 +00:00
R. Belmont
52106024f9 New games added as GAME_NOT_WORKING
-----------------------------------
Samurai Spirits Tenkaichi Kenkakuden [Guru]
2011-02-06 05:49:03 +00:00
smf-
95582abbad non working mem n simulation. still can't see how it should work. 2011-02-06 05:31:22 +00:00
Jonathan Gevaryahu
259a401ad6 beezer audio: got rid of sh6840_LFSR_oldxor, was leftover of old code. no whatsnew. 2011-02-05 23:40:14 +00:00
Roberto Zandona
e6bf8f49f7 panicr: fixed sprite position 2011-02-05 19:45:36 +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
Phil Bennett
cc9ea396f7 Reimplemented fruit-machine mechanical meters to use timers [AGEMAME]
Various MPU4 changes [AGEMAME]:
 * Revised timing/input system to stop flickering
 * Tidied up the LED drawing code to remove flicker
 * Support for all known extenders and reel multiplex boards used in MPU4 H/W 
 * Partial support for OKI sampled sound card, need for some titles
 * Fixed Old Timer characteriser
 * Some general tidying up to allow better study of the BwB titles


New games added as GAME_NOT_WORKING:
------------------------------------
Reno Reels (20p/10GBP Cash, release A) [AGEMAME]
BwB Tetris v 2.2 [AGEMAME]
Red Hot Poker (20p/10GBP Cash, release 3) [AGEMAME]
2011-02-05 19:23:04 +00:00
Curt Coder
a99bd04a82 Added some information. (no whatsnew) 2011-02-05 18:33:38 +00:00
R. Belmont
3361ca5199 drcbex64: fix compile on Apple GCC (no whatsnew) 2011-02-05 18:07:18 +00:00
R. Belmont
3ec54f4216 drcuml: fix compile on systems that use the C backend [R. Belmont] 2011-02-05 17:18:15 +00:00
Scott Stone
f48cce39b9 Fixed 04225: gangwars: Samples incorrectly played. Since the new gangwars set was added, the sample placement was incorrect.
Comment:  You think the gangwars set might be a euro/japan combo?  There is english text but japanese speech in the game's introduction.
2011-02-05 16:16:03 +00:00
smf-
24a4fa3c9c non working banking based on guesswork that didn't pay off, but might help someone else. 2011-02-05 10:03:13 +00:00
smf-
f1eb7c07f6 increased ram to 16mb, set LOG_BIOSCALL in cpu/mips/psx.c for debugging output. 2011-02-05 03:33:21 +00:00
smf-
1d0cf8d526 stop LOG_BIOSCALL triggering dbe when outputting parameters. 2011-02-05 03:31:52 +00:00
Scott Stone
4e9b2ccf7a Added DEVICE_REMOVE for MACHINE_CONFIG involving set powerinsa. Fixes crash (no whatsnew) 2011-02-05 02:28:36 +00:00
smf-
2a80fd1dfb take two 2011-02-04 23:49:51 +00:00
Scott Stone
8dc8308b0b Delete unneeded MCFG_NMK112_ADD from MACHINE_CONFIG_START for smissin. Fixes crash. (no whatsnew) 2011-02-04 23:46:14 +00:00
smf-
f37e1e79ff fixed msvc compilation (min/max conflict) 2011-02-04 22:20:15 +00:00
smf-
a46cec5b59 fixed msvc compilation 2011-02-04 21:59:20 +00:00
Jonathan Gevaryahu
038f1828c4 68681 patch to fix dectalk's startup test in MESS [Hans Ostermeyer] 2011-02-04 10:42:46 +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
Michaël Banaan Ananas
2cd5e374ba undo prev commit + add improvements by LordN 2011-02-04 00:37:21 +00:00
Michaël Banaan Ananas
6a4a11f74f mask on input ports 2011-02-03 23:35:32 +00:00
Michaël Banaan Ananas
8f708d4b81 port 4 oopsjunk 2011-02-03 23:20:22 +00:00
Michaël Banaan Ananas
f7b1e68670 New non-working game
--------------------
18 Wheeler [hap, Siftware]
2011-02-03 22:08:42 +00:00
Scott Stone
c92c19f2d8 New Clones
----------
Hidden Catch 2 (pcb ver 1.00) (Kor/Eng/Jpn/Chi) [Yohji, Smitdogg, The Dumping Union]
2011-02-03 22:06:44 +00:00
Scott Stone
00a3403054 Add basic LOAD function to the debugger to complement the existing SAVE function. It allows you to load a binary file straight into writeable memory. The format is the same as the SAVE function with the exception that the <length> can be handled differently. [Pugsy] 2011-02-03 17:09:41 +00:00
Scott Stone
5ea7d4443f Added MCFG_SCREEN_RAW_PARAMS to twincobr.c and wardner.c, correcting their refresh rates. [Alex Jackson] 2011-02-03 16:51:55 +00:00
Aaron Giles
8805b57c22 From: Alex Jackson <awj_in_japan@hotmail.com>
Date: Wed, Jan 26, 2011 at 6:19 AM
Subject: cave.c savestate support + alpha
To: submit@mamedev.org

This patch contains the following changes to cave.c and toaplan2.c:

 - Added savestate support to all games in cave.c. Most of the work was 
already done by someone else; the blocker was a perpetually-running 
anonymous timer, which I converted to an allocated timer.

 - Changed OKI sample banking to use device address maps instead of 
memcpy() in all cave.c games except the nmk112-based games. If someone 
wants to try to convert nmk112.c to use device address maps and bank 
pointers, be my guest--you'll need 8 banks of varying sizes per OKI chip...

 - Fixed description of the Japanese Air Gallet set--the game's Japanese 
title is "Akuu Gallet".

 - Made machine/nmk112.c actually restore its state properly. Also 
refactored it a little (if you can talk about refactoring a source 
file that almost fits on one screen)

 - Fixed bgaregga's nmk112 interface to work with the refactored nmk112.c.

 - Removed excessive CPU interleaving from batsugun, left over from when 
I was initially hooking up the V25.

 - Removed a useless printf and some obsolete comments, more leftovers 
from the process of hooking up the V25.

--AWJ--
2011-02-03 16:47:13 +00:00
Scott Stone
4454195f3d Replaced anonymous timers used in video/segaic16.c, drivers/segaorun.c and drivers/segaxbd.c with allocated timers, making it possible to add save state support to these drivers. [Alex Jackson] 2011-02-03 16:39:57 +00:00
Miodrag Milanovic
6c490f558a Cleaned up shared implementation of CDi [David Haywood]
- merged MESS CDi driver file with the MAME CDi driver file (used for Quizard)
- the cdimono1 system is now the parent / bios of Quizard, the Quizard games run on a retail CDi unit with Jamma adapter / dongle for protection so this is a logical step.
2011-02-03 13:32:06 +00:00
Miodrag Milanovic
31717fe741 Fix compiling tools (no whatsnew) 2011-02-03 13:16:34 +00:00
Aaron Giles
659dc8ac6e From: Atari Ace
Hi mamedev,

This patch eliminates global/static variables in a number of
Taito/Irem drivers by introducing/using driver_device classes.

~aa
2011-02-03 10:38:15 +00:00
Aaron Giles
f534d245c0 Attotime bulk conversion step:
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)

Also, changed the following MCFG macros to require a full
attotime specification:

MCFG_TIMER_ADD_PERIODIC
MCFG_QUANTUM_TIME
MCFG_WATCHDOG_TIME_INIT
2011-02-03 09:06:34 +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
Scott Stone
78005b8ffe Mess related fix import (no whatsnew) 2011-02-03 00:17:31 +00:00
Angelo Salese
4a610a8d84 Mess specific code, don't need to be mentioned 2011-02-02 19:56:15 +00:00
Brian Troha
3182670f02 Now commit the drivers that changed :-p
new clones added

New Clones Added
---------------------------------
Prehistoric Isle in 1930 (Korea) [Artemio Urbina
Zero Hour (set 2) [Andrew Welburn, The Dumping Union]
2011-02-02 17:34:24 +00:00
Brian Troha
f432929ed9 new clones added
New Clones Added
---------------------------------
Prehistoric Isle in 1930 (Korea) [Artemio Urbina
Zero Hour (set 2) [Andrew Welburn, The Dumping Union]
2011-02-02 17:33:23 +00:00
Angelo Salese
ce8e3cb92d Added DU redumps, not worth 2011-02-02 14:54:37 +00:00
Roberto Zandona
42a31dc29a pollux: removed code used for test 2011-02-02 06:28:12 +00:00
Roberto Zandona
241d71cd5f pollux: fixed sprite flip x and y and removed old comments [Roberto Zandona'] 2011-02-02 06:00:10 +00:00
Brian Troha
f790fe8e15 new clone (not working) Top Skater (Japan)
New Clone Added
------------------------------------
Top Skater (Japan) [Pat Daderko]
2011-02-02 03:42:28 +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
Fabio Priuli
fdd736acef Added a reminder, in case I forgot what is going on... no whatsnew... 2011-02-01 18:50:37 +00:00
Roberto Fresca
3d3ffe3a59 Improvements to Magic's 10 driver. [Roberto Fresca]
* New inputs from the scratch for Music Sort.
 * Complete DIP Switches and DIP locations for Music Sort.
 * Added a new button-lamps layout for Music Sort.
 * Created a default NVRAM that allow Music Sort work properly.


New games added or promoted from NOT_WORKING status
---------------------------------------------------
Music Sort (ver 2.02, English) [Roberto Fresca, Team Europe]
2011-02-01 06:16:41 +00:00
Jonathan Gevaryahu
dc172c011b beezer now uses correct mm5837 noise source (clock may be a bit off though), and now has mm5837 properly hooked to audio via. May still be some issues with intermittent noise updating which need fixing. [Lord Nightmare] 2011-02-01 06:07:31 +00:00
Angelo Salese
b34fa47ece new not working game
----------------------
Funky Ball [krick, incog, Smitdogg, Guru, The Dumping Union]
2011-01-31 19:07:38 +00:00
Aaron Giles
6fa241b445 Converted TMS3203X to a modern device.
Also removed redundant m_machine from the state and execute
interfaces to fix ambiguity when using m_machine from within
a device that inherits from these.
2011-01-31 16:36:16 +00:00