Skip to content

Commit 0619912

Browse files
jpm/jmpsys5cpp: Start working on inputs inputs, and added reel interface. (#10709)
1 parent 3178442 commit 0619912

File tree

619 files changed

+12180
-11905
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

619 files changed

+12180
-11905
lines changed

src/devices/machine/steppers.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ void stepper_device::advance_phase()
189189
{
190190
//Standard drive table is 2,6,4,5,1,9,8,a
191191
//NOTE: This runs through the stator patterns in such a way as to drive the reel forward (downwards from the player's view, clockwise on our rose)
192-
//The Heber 'Pluto' controller runs this in reverse
192+
//The Heber 'Pluto' controller runs this in reverse, this needs checking on real hardware
193193
switch (m_pattern)
194194
{ //Black Blue Red Yellow
195195
case 0x02:// 0 0 1 0
@@ -257,7 +257,8 @@ void reel_device::advance_phase()
257257
case STARPOINT_48STEP_REEL : /* STARPOINT RMxxx */
258258
case GAMESMAN_200STEP_REEL : /* Gamesman GMxxxx */
259259
case STARPOINT_144STEP_DICE :/* STARPOINT 1DCU DICE mechanism */
260-
case STARPOINT_200STEP_REEL :/* STARPOINT 1DCU DICE mechanism */
260+
case STARPOINT_200STEP_REEL :
261+
case SYS5_100STEP_REEL :
261262
stepper_device::advance_phase();
262263
break;
263264

src/devices/machine/steppers.h

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
#define SRU_200STEP_REEL 11
3737

38+
#define SYS5_100STEP_REEL 12
39+
3840

3941
class stepper_device : public device_t
4042
{

src/mame/jpm/jpmsys5.cpp

+68-26
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
Known Issues:
1919
* Some features used by the AWP games such as reels are not emulated.
2020
* Timing for reels, and other opto devices is controlled by a generated clock
21-
in a weird daisychain setup.
21+
in a weird daisychain setup. We're using the later direct drive approach for now
2222
2323
AWP game notes:
2424
The byte at 0x81 of the EVEN 68k rom appears to be some kind of
@@ -245,31 +245,32 @@ void jpmsys5_state::reel_0123_w(offs_t offset, uint16_t data, uint16_t mem_mask)
245245
{
246246
logerror("%s: reel_0123_w %04x %04x\n", machine().describe_context(), data, mem_mask);
247247

248+
248249
// only writes 0/1/2/3 to each reel?
249250
if (data & 0xcccc)
250251
popmessage("reel_0123_w upper bits set", data & 0xcccc);
251252

252253
if (m_reel[0])
253254
{
254-
m_reel[0]->update((data >> 0) & 0x03);
255+
m_reel[0]->update(reel_interface_table[(data >> 0) & 0x03]);
255256
awp_draw_reel(machine(), "reel1", *m_reel[0]);
256257
}
257258

258259
if (m_reel[1])
259260
{
260-
m_reel[1]->update((data >> 4) & 0x03);
261+
m_reel[1]->update(reel_interface_table[(data >> 4) & 0x03]);
261262
awp_draw_reel(machine(), "reel2", *m_reel[1]);
262263
}
263264

264265
if (m_reel[2])
265266
{
266-
m_reel[2]->update((data >> 8) & 0x03);
267+
m_reel[2]->update(reel_interface_table[(data >> 8) & 0x03]);
267268
awp_draw_reel(machine(), "reel3", *m_reel[2]);
268269
}
269270

270271
if (m_reel[3])
271272
{
272-
m_reel[3]->update((data >> 12) & 0x03);
273+
m_reel[3]->update(reel_interface_table[(data >> 12) & 0x03]);
273274
awp_draw_reel(machine(), "reel4", *m_reel[3]);
274275
}
275276
}
@@ -283,23 +284,23 @@ void jpmsys5_state::reel_4567_w(offs_t offset, uint16_t data, uint16_t mem_mask)
283284

284285
if (m_reel[4])
285286
{
286-
m_reel[4]->update((data >> 0) & 0x03);
287+
m_reel[4]->update(reel_interface_table[(data >> 0) & 0x03]);
287288
awp_draw_reel(machine(), "reel5", *m_reel[4]);
288289
}
289290
if (m_reel[5])
290291
{
291-
m_reel[5]->update((data >> 4) & 0x03);
292+
m_reel[5]->update(reel_interface_table[(data >> 4) & 0x03]);
292293
awp_draw_reel(machine(), "reel6", *m_reel[5]);
293294
}
294295
#if 0
295296
if (m_reel[6])
296297
{
297-
m_reel[6]->update(data >> 8) & 0x03);
298+
m_reel[6]->update(reel_interface_table[(data >> 8) & 0x03]);
298299
awp_draw_reel(machine(), "reel6", *m_reel[6]);
299300
}
300301
if (m_reel[7])
301302
{
302-
m_reel[7]->update((data >> 12) & 0x03);
303+
m_reel[7]->update(reel_interface_table[(data >> 12) & 0x03]);
303304
awp_draw_reel(machine(), "reel7", *m_reel[7]);
304305
}
305306
#endif
@@ -850,20 +851,17 @@ void jpmsys5v_state::jpmsys5v(machine_config &config)
850851

851852
void jpmsys5_state::reels(machine_config &config)
852853
{
853-
// probably incorrect reel types, but they do seem to only require 2 bits to write?
854-
// forcing 200 steps keeps j5fair main reels aligned, so probably needs a type
855-
// with the same write patterns as MPU3_48STEP_REEL, but with 200 steps defining?
856-
REEL(config, m_reel[0], MPU3_48STEP_REEL, 1, 3, 0x00, 2, 200);
854+
REEL(config, m_reel[0], SYS5_100STEP_REEL, 1, 3, 0x00, 2, 200);
857855
m_reel[0]->optic_handler().set(FUNC(jpmsys5_state::reel_optic_cb<0>));
858-
REEL(config, m_reel[1], MPU3_48STEP_REEL, 1, 3, 0x00, 2, 200);
856+
REEL(config, m_reel[1], SYS5_100STEP_REEL, 1, 3, 0x00, 2, 200);
859857
m_reel[1]->optic_handler().set(FUNC(jpmsys5_state::reel_optic_cb<1>));
860-
REEL(config, m_reel[2], MPU3_48STEP_REEL, 1, 3, 0x00, 2, 200);
858+
REEL(config, m_reel[2], SYS5_100STEP_REEL, 1, 3, 0x00, 2, 200);
861859
m_reel[2]->optic_handler().set(FUNC(jpmsys5_state::reel_optic_cb<2>));
862-
REEL(config, m_reel[3], MPU3_48STEP_REEL, 1, 3, 0x00, 2, 200);
860+
REEL(config, m_reel[3], SYS5_100STEP_REEL, 1, 3, 0x00, 2, 200);
863861
m_reel[3]->optic_handler().set(FUNC(jpmsys5_state::reel_optic_cb<3>));
864-
REEL(config, m_reel[4], MPU3_48STEP_REEL, 1, 3, 0x00, 2, 200);
862+
REEL(config, m_reel[4], SYS5_100STEP_REEL, 1, 3, 0x00, 2, 200);
865863
m_reel[4]->optic_handler().set(FUNC(jpmsys5_state::reel_optic_cb<4>));
866-
REEL(config, m_reel[5], MPU3_48STEP_REEL, 1, 3, 0x00, 2, 200);
864+
REEL(config, m_reel[5], SYS5_100STEP_REEL, 1, 3, 0x00, 2, 200);
867865
m_reel[5]->optic_handler().set(FUNC(jpmsys5_state::reel_optic_cb<5>));
868866
}
869867

@@ -953,7 +951,7 @@ INPUT_PORTS_START( popeye )
953951
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Back door") PORT_CODE(KEYCODE_R) PORT_TOGGLE
954952
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Cash door") PORT_CODE(KEYCODE_T) PORT_TOGGLE
955953
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Refill key") PORT_CODE(KEYCODE_Y) PORT_TOGGLE
956-
PORT_DIPNAME( 0x08, 0x00, "Direct 0x08" ) // These are the % key, at least for popeye?
954+
PORT_DIPNAME( 0x08, 0x00, "Direct 0x08" ) // These are the % key, at least for popeye? But there's a pin missing if so, usually these have 4 bits
957955
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
958956
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
959957
PORT_DIPNAME( 0x10, 0x10, "Direct 0x10" )
@@ -968,29 +966,73 @@ INPUT_PORTS_START( popeye )
968966
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM )
969967

970968
PORT_START("COINS")
969+
PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED )
971970
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("10p")
972971
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("20p")
973972
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("50p")
974973
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("100p")
975-
PORT_BIT( 0xc3, IP_ACTIVE_LOW, IPT_UNUSED )
974+
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN5 ) PORT_NAME("Token")
975+
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
976976

977977
PORT_START("STROBE0")
978-
PORT_BIT(0xFF, IP_ACTIVE_LOW, IPT_UNKNOWN)
978+
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("00")
979+
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("01")
980+
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("02")
981+
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("03")
982+
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("04")
983+
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("05")
984+
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("06")
985+
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("07")
979986

980987
PORT_START("STROBE1")
981-
PORT_BIT(0xFF, IP_ACTIVE_LOW, IPT_UNKNOWN)
988+
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("08")
989+
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("09")
990+
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("10")
991+
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("11")
992+
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("12")
993+
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("13")
994+
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("14")
995+
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("15")
982996

983997
PORT_START("STROBE2")
984-
PORT_BIT(0xFF, IP_ACTIVE_LOW, IPT_UNKNOWN)
998+
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start")
999+
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Exchange")
1000+
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Collect")
1001+
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Hold 3/Lo")
1002+
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Hold 2/Hi")
1003+
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Hold 1")
1004+
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Cancel")
1005+
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("23")
9851006

9861007
PORT_START("STROBE3")
987-
PORT_BIT(0xFF, IP_ACTIVE_LOW, IPT_UNKNOWN)
1008+
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("24")
1009+
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("25")
1010+
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("26")
1011+
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("27")
1012+
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("28")
1013+
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("29")
1014+
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("30")
1015+
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("31")
9881016

9891017
PORT_START("STROBE4")
990-
PORT_BIT(0xFF, IP_ACTIVE_LOW, IPT_UNKNOWN)
1018+
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("32")
1019+
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("33")
1020+
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("34")
1021+
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("35")
1022+
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("36")
1023+
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("37")
1024+
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("38")
1025+
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("39")
9911026

9921027
PORT_START("STROBE5")
993-
PORT_BIT(0xFF, IP_ACTIVE_LOW, IPT_UNKNOWN)
1028+
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("40")
1029+
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("41")
1030+
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("42")
1031+
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("43")
1032+
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("44")
1033+
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("45")
1034+
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("46")
1035+
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("47")
9941036

9951037
PORT_START("UNKNOWN_PORT")
9961038
PORT_DIPNAME( 0x0001, 0x0000, "Unknown 0x0001" ) // if this and 0x0008 are on then j5popeye boots, what is it? something opto related?

src/mame/jpm/jpmsys5.h

+2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ class jpmsys5_state : public driver_device
113113

114114
uint16_t unk_r(offs_t offset, uint16_t mem_mask = ~0);
115115

116+
static inline constexpr uint8_t reel_interface_table[4] = {0x0a, 0x09, 0x06, 0x05};//An interface maps the 2-bit values to meaningful Starpoint patterns (Proconn do this too, put in steppers?)
117+
116118
uint16_t reellamps_0123_r(offs_t offset, uint16_t mem_mask = ~0);
117119
void reellamps_0123_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
118120
uint16_t reellamps_4567_r(offs_t offset, uint16_t mem_mask = ~0);

0 commit comments

Comments
 (0)