summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine/steppers.h
diff options
context:
space:
mode:
author Ramiro Polla <ramiro.polla@gmail.com>2014-11-12 03:22:56 +0100
committer Ramiro Polla <ramiro.polla@gmail.com>2014-11-19 23:53:00 +0100
commit755b2d65645cd59004221d1534a386e88b7cd0db (patch)
treeb6aff3e43788442d2a2853ae60eaf0908174b3d9 /src/emu/machine/steppers.h
parentaf790a7dcf8be74bb805869f2c5d9071942b38ba (diff)
steppers: move to emu/machine
Diffstat (limited to 'src/emu/machine/steppers.h')
-rw-r--r--src/emu/machine/steppers.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/emu/machine/steppers.h b/src/emu/machine/steppers.h
new file mode 100644
index 00000000000..db1b30cb1e9
--- /dev/null
+++ b/src/emu/machine/steppers.h
@@ -0,0 +1,65 @@
+///////////////////////////////////////////////////////////////////////////
+// //
+// steppers.c steppermotor emulation //
+// //
+// Emulates : stepper motors driven with full step or half step //
+// also emulates the index optic //
+// //
+// //
+// TODO: add further types of stepper motors if needed (Konami/IGT?) //
+// Someone who understands the device system may want to convert //
+// this //
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifndef INC_STEPPERS
+#define INC_STEPPERS
+
+#define MAX_STEPPERS 8 /* maximum number of steppers */
+
+#define STARPOINT_48STEP_REEL 0 /* STARPOINT RMXXX reel unit */
+#define STARPOINT_144STEP_DICE 1 /* STARPOINT 1DCU DICE mechanism */
+#define STARPOINT_200STEP_REEL 2
+
+#define BARCREST_48STEP_REEL 3 /* Barcrest bespoke reel unit */
+#define MPU3_48STEP_REEL 4
+
+#define ECOIN_200STEP_REEL 5 /* Probably not bespoke, but can't find a part number */
+
+#define GAMESMAN_48STEP_REEL 6
+#define GAMESMAN_100STEP_REEL 7
+#define GAMESMAN_200STEP_REEL 8
+
+#define PROJECT_48STEP_REEL 9
+
+/*------------- Stepper motor interface structure -----------------*/
+
+struct stepper_interface
+{
+ UINT8 type; /* Reel unit type */
+ INT16 index_start;/* start position of index (in half steps) */
+ INT16 index_end; /* end position of index (in half steps) */
+ INT16 index_patt; /* pattern needed on coils (0=don't care) */
+ UINT8 initphase; /* Phase at 0, for opto linkage */
+};
+
+extern const stepper_interface starpoint_interface_48step;
+extern const stepper_interface starpointrm20_interface_48step;
+
+extern const stepper_interface starpoint_interface_200step_reel;
+extern const stepper_interface ecoin_interface_200step_reel;
+
+void stepper_config(running_machine &machine, int which, const stepper_interface *intf);
+
+void stepper_reset_position(int id); /* reset a motor to position 0 */
+
+int stepper_optic_state( int id); /* read a motor's optics */
+
+int stepper_update(int id, UINT8 pattern); /* update a motor */
+
+int stepper_get_position(int id); /* get current position in half steps */
+
+int stepper_get_absolute_position(int id); /* get current absolute position in half steps */
+
+int stepper_get_max(int id); /* get maximum position in half steps */
+#endif