Commit Graph

9 Commits

Author SHA1 Message Date
Zsolt Vasvari
3512bc695d Changes MDRV_TIMER_DURATION to MDRV_TIMER_START_DELAY
Renames duration to start_delay in timer_adjust_periodic() as well
Moves MDRV_ macros into proper header files
2008-03-15 03:13:57 +00:00
Zsolt Vasvari
e4a07ea688 Implements scanline based timer devices.
Converted Centipede, as an example.

To define a scanline timer, use something like this:

MDRV_TIMER_ADD("32V", SCANLINE, generate_interrupt)
MDRV_TIMER_SCANLINE("main", 0, 16)

The first number is the first scanline the timer will fire on, the 2nd number is the increment.
So in this case, the timer will fire on 0, 16, 32, ..., 224, 240, then wrap around
because the screen is defined as 256 lines high.
The current scanline is passed to the callback in its 'param' argument
2008-03-14 11:15:31 +00:00
Zsolt Vasvari
c0ca716e62 Added skeletion device interface for timers. Just wanted to get feedback.
- Where applicable, added a parallel set of timer functions that take a device_config instead of emu_timer:
	void timer_device_adjust_oneshot(const device_config *timer, attotime duration, INT32 param);
	void timer_device_adjust_periodic(const device_config *timer, attotime duration, INT32 param, attotime period);
	void timer_device_reset(const device_config *timer, attotime duration);
	int timer_device_enable(const device_config *timer, int enable);
	int timer_device_enabled(const device_config *timer);
	int timer_device_get_param(const device_config *timer);
	void *timer_device_get_param_ptr(const device_config *timer);
	attotime timer_device_timeelapsed(const device_config *timer);
	attotime timer_device_timeleft(const device_config *timer);
	attotime timer_device_starttime(const device_config *timer);
	attotime timer_device_firetime(const device_config *timer);

- Added MACHINE_CONFIG macros:
	MDRV_TIMER_ADD(_tag, _type, _callback)	/* type can only be PERIODIC right now (can scanline based later, or even NE555) */
	MDRV_TIMER_REMOVE(_tag)
	MDRV_TIMER_MODIFY(_tag)
	MDRV_TIMER_TYPE(_type)
	MDRV_TIMER_CALLBACK(_callback) 
	MDRV_TIMER_DURATION(_duration)
	MDRV_TIMER_PERIOD(_period)
	MDRV_TIMER_PARAM(_param)
	MDRV_TIMER_PTR(_ptr)

- Modified Space Encounters to create two timers and use those:

	MDRV_TIMER_ADD("STROBE_ON", PERIODIC, spcenctr_strobe_timer_callback)
	MDRV_TIMER_PARAM(TRUE)	/* indicates strobe ON */
	MDRV_TIMER_PERIOD(UINT64_ATTOTIME_IN_HZ(SPCENCTR_STROBE_FREQ))

	MDRV_TIMER_ADD("STROBE_OFF", PERIODIC, spcenctr_strobe_timer_callback)
	MDRV_TIMER_PARAM(FALSE)	/* indicates strobe OFF */
	MDRV_TIMER_DURATION(UINT64_ATTOTIME_IN_HZ(SPCENCTR_STROBE_FREQ * 100 / SPCENCTR_DUTY_CYCLE))
	MDRV_TIMER_PERIOD(UINT64_ATTOTIME_IN_HZ(SPCENCTR_STROBE_FREQ))
2008-03-14 00:27:07 +00:00
Aaron Giles
e31f9a6313 Normalized function pointer typedefs: they are now all
suffixed with _func. Did this throughout the core and
drivers I was familiar with.

Fixed gcc compiler error with recent render.c changes.
gcc does not like explicit (int) casts on float or
double functions. This is fracking annoying and stupid,
but there you have it.
2008-03-03 01:51:31 +00:00
Aaron Giles
adcdfd3e5b Converted MACHINE_DRIVER definitions from function
constructors to tokenized lists. For the most part
this is a non-invasive change, except for those drivers
using MDRV_WATCHDOG_TIME_INIT. In order to allow for
tokenization of attotimes, a set of new macros is
provided called UINT64_ATTOTIME_IN_x() which follows the
same pattern as ATTOTIME_IN_x() but packs the attotime
down into a single 64-bit value for easier tokenization.

Separated MDRV_DEVICE_CONFIG_DATA into 32-bit and 64-bit
versions. Added floating-point versions with configurable
resolutions.

Fixed several errors in the machine drivers which were
caught by the additional checks now done in the machine
config detokenization code.

Converted speakers into devices. Machine->config no
longer houses an array of speakers; instead they are
iterated through using the new macros (defined in sound.h)
speaker_output_first() and speaker_output_next(). Updated
all relevant code to do this.

Improved game info display with multiple screens. Fixed
bug which caused all screens to display equally.

Added typedefs for all the machine config callback 
functions at the top of driver.h.
2008-02-26 06:31:28 +00:00
Aaron Giles
abdb58671b Split timer_adjust() into timer_adjust_oneshot() and timer_adjust_periodic().
Updated all call sites.
Fixed recent build breaks.
2008-02-06 15:33:04 +00:00
Aaron Giles
ee9f88963c Copyright cleanup:
- removed years from copyright notices
 - removed redundant (c) from copyright notices
 - updated "the MAME Team" to be "Nicola Salmoria and the MAME Team"
2008-01-06 00:47:40 +00:00
Aaron Giles
c82a966b3b Changes for MAME 0.121u2. 2007-12-17 16:37:57 +00:00
Aaron Giles
7b77f12186 Initial checkin of MAME 0.121. 2007-12-17 15:19:59 +00:00