diff --git a/src/devices/machine/rescap.h b/src/devices/machine/rescap.h index 851a7c25528..d96347bacbc 100644 --- a/src/devices/machine/rescap.h +++ b/src/devices/machine/rescap.h @@ -3,7 +3,7 @@ #ifndef MAME_MACHINE_RESCAP_H #define MAME_MACHINE_RESCAP_H -/* Little helpers for magnitude conversions */ +// Little helpers for magnitude conversions #define RES_R(res) ((double)(res)) #define RES_K(res) ((double)(res) * 1e3) #define RES_M(res) ((double)(res) * 1e6) @@ -15,7 +15,7 @@ #define IND_N(ind) ((double)(ind) * 1e-9) #define IND_P(ind) ((double)(ind) * 1e-12) -/* vin --/\r1/\-- out --/\r2/\-- gnd */ +// vin --/\r1/\-- out --/\r2/\-- gnd #define RES_VOLTAGE_DIVIDER(r1, r2) ((double)(r2) / ((double)(r1) + (double)(r2))) #define RES_2_PARALLEL(r1, r2) (((r1) * (r2)) / ((r1) + (r2))) @@ -26,4 +26,15 @@ #define RES_2_SERIAL(r1,r2) ((r1)+(r2)) +// macro for the RC time constant on a 74LS123 with C > 1000pF +// R is in ohms, C is in farads +#define TIME_OF_74LS123(r,c) (0.45 * (double)(r) * (double)(c)) + +// macros for the RC time constant on a 555 timer IC +// R is in ohms, C is in farads +#define PERIOD_OF_555_MONOSTABLE_NSEC(r,c) ((attoseconds_t)(1100000000 * (double)(r) * (double)(c))) +#define PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c) ((attoseconds_t)( 693000000 * ((double)(r1) + 2.0 * (double)(r2)) * (double)(c))) +#define PERIOD_OF_555_MONOSTABLE(r,c) attotime::from_nsec(PERIOD_OF_555_MONOSTABLE_NSEC(r,c)) +#define PERIOD_OF_555_ASTABLE(r1,r2,c) attotime::from_nsec(PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c)) + #endif // MAME_MACHINE_RESCAP_H diff --git a/src/emu/schedule.h b/src/emu/schedule.h index b7658c682ac..67f6d945898 100644 --- a/src/emu/schedule.h +++ b/src/emu/schedule.h @@ -24,17 +24,6 @@ #define TIMER_CALLBACK_MEMBER(name) void name(void *ptr, s32 param) -// macro for the RC time constant on a 74LS123 with C > 1000pF -// R is in ohms, C is in farads -#define TIME_OF_74LS123(r,c) (0.45 * (double)(r) * (double)(c)) - -// macros for the RC time constant on a 555 timer IC -// R is in ohms, C is in farads -#define PERIOD_OF_555_MONOSTABLE_NSEC(r,c) ((attoseconds_t)(1100000000 * (double)(r) * (double)(c))) -#define PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c) ((attoseconds_t)( 693000000 * ((double)(r1) + 2.0 * (double)(r2)) * (double)(c))) -#define PERIOD_OF_555_MONOSTABLE(r,c) attotime::from_nsec(PERIOD_OF_555_MONOSTABLE_NSEC(r,c)) -#define PERIOD_OF_555_ASTABLE(r1,r2,c) attotime::from_nsec(PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c)) - //************************************************************************** // TYPE DEFINITIONS diff --git a/src/mame/audio/williams.cpp b/src/mame/audio/williams.cpp index c78684aa3dc..582b7f9bb48 100644 --- a/src/mame/audio/williams.cpp +++ b/src/mame/audio/williams.cpp @@ -33,6 +33,7 @@ #include "emu.h" #include "williams.h" #include "machine/6821pia.h" +#include "machine/rescap.h" #include "cpu/m6809/m6809.h" #include "sound/ym2151.h" #include "sound/okim6295.h" diff --git a/src/mame/drivers/bfm_sc1.cpp b/src/mame/drivers/bfm_sc1.cpp index b3a0a3d6ba5..6018a8374fd 100644 --- a/src/mame/drivers/bfm_sc1.cpp +++ b/src/mame/drivers/bfm_sc1.cpp @@ -101,6 +101,7 @@ Optional (on expansion card) (Viper) #include "machine/gen_latch.h" #include "machine/watchdog.h" #include "machine/bfm_comn.h" +#include "machine/rescap.h" #include "speaker.h" #include "sc1_vfd.lh" diff --git a/src/mame/drivers/bfm_sc2.cpp b/src/mame/drivers/bfm_sc2.cpp index f976ba2cd75..64e6a8ae3fc 100644 --- a/src/mame/drivers/bfm_sc2.cpp +++ b/src/mame/drivers/bfm_sc2.cpp @@ -160,6 +160,7 @@ Adder hardware: #include "machine/bfm_bd1.h" // vfd #include "machine/meters.h" +#include "machine/rescap.h" #include "speaker.h" diff --git a/src/mame/drivers/capbowl.cpp b/src/mame/drivers/capbowl.cpp index 96a31ab31ea..c98bc2a67f5 100644 --- a/src/mame/drivers/capbowl.cpp +++ b/src/mame/drivers/capbowl.cpp @@ -90,6 +90,7 @@ #include "emu.h" #include "includes/capbowl.h" +#include "machine/rescap.h" #include "machine/ticket.h" #include "cpu/m6809/m6809.h" #include "sound/2203intf.h" diff --git a/src/mame/drivers/gottlieb.cpp b/src/mame/drivers/gottlieb.cpp index 2270b468c7b..cd626844e2f 100644 --- a/src/mame/drivers/gottlieb.cpp +++ b/src/mame/drivers/gottlieb.cpp @@ -200,6 +200,7 @@ VBlank duration: 1/VSYNC * (16/256) = 1017.6 us #include "includes/gottlieb.h" #include "machine/nvram.h" +#include "machine/rescap.h" #include "machine/watchdog.h" #include "sound/dac.h" #include "speaker.h" diff --git a/src/mame/drivers/lockon.cpp b/src/mame/drivers/lockon.cpp index 8a38382647b..ec1497f273e 100644 --- a/src/mame/drivers/lockon.cpp +++ b/src/mame/drivers/lockon.cpp @@ -19,6 +19,7 @@ #include "cpu/nec/nec.h" #include "cpu/z80/z80.h" #include "machine/adc0808.h" +#include "machine/rescap.h" #include "sound/2203intf.h" #include "sound/flt_vol.h" #include "speaker.h" diff --git a/src/mame/drivers/mpu3.cpp b/src/mame/drivers/mpu3.cpp index 484ca9bc24a..2da8102b82f 100644 --- a/src/mame/drivers/mpu3.cpp +++ b/src/mame/drivers/mpu3.cpp @@ -112,6 +112,7 @@ TODO: - Distinguish door switches using manual #include "machine/steppers.h" #include "machine/roc10937.h" #include "machine/meters.h" +#include "machine/rescap.h" #include "mpu3.lh" diff --git a/src/mame/drivers/pcw.cpp b/src/mame/drivers/pcw.cpp index 370639c1611..04b2563e543 100644 --- a/src/mame/drivers/pcw.cpp +++ b/src/mame/drivers/pcw.cpp @@ -104,6 +104,7 @@ // pcw/pcw16 beeper #include "sound/beep.h" #include "machine/ram.h" +#include "machine/rescap.h" #include "render.h" #include "softlist.h" #include "speaker.h" diff --git a/src/mame/machine/mpu4.cpp b/src/mame/machine/mpu4.cpp index 25ecc5d8c4e..dfb871d00d7 100644 --- a/src/mame/machine/mpu4.cpp +++ b/src/mame/machine/mpu4.cpp @@ -264,6 +264,7 @@ TODO: - Distinguish door switches using manual #include "video/awpvid.h" //Fruit Machines Only +#include "machine/rescap.h" #include "speaker.h" #include "mpu4.lh"