1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
|
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz, David Haywood
/* Senario 6 Player Poker systems
TODO:
improve controller hookup / simulation and remove PC-based hacks!
*/
#include "emu.h"
#include "includes/spg2xx.h"
#include "sentx6p.lh"
class sentx6p_state : public spg2xx_game_state
{
public:
sentx6p_state(const machine_config &mconfig, device_type type, const char *tag) :
spg2xx_game_state(mconfig, type, tag),
m_porta_data(0x0000),
m_suite1(*this, "SUITE_LEFT_BZ%u", 0U),
m_suite2(*this, "SUITE_RIGHT_BZ%u", 0U),
m_number1(*this, "NUMBER_LEFT_BZ%u", 0U),
m_number2(*this, "NUMBER_RIGHT_BZ%u", 0U),
m_select_fold(*this, "SELECT_FOLD_BZ%u", 0U),
m_select_check(*this, "SELECT_CHECK_BZ%u", 0U),
m_select_bet(*this, "SELECT_BET_BZ%u", 0U),
m_select_call(*this, "SELECT_CALL_BZ%u", 0U),
m_select_raise(*this, "SELECT_RAISE_BZ%u", 0U),
m_select_allin(*this, "SELECT_ALLIN_BZ%u", 0U),
m_option_fold(*this, "OPTION_FOLD_BZ%u", 0U),
m_option_check(*this, "OPTION_CHECK_BZ%u", 0U),
m_option_bet(*this, "OPTION_BET_BZ%u", 0U),
m_option_call(*this, "OPTION_CALL_BZ%u", 0U),
m_option_raise(*this, "OPTION_RAISE_BZ%u", 0U),
m_option_allin(*this, "OPTION_ALLIN_BZ%u", 0U),
m_led(*this, "LED_BZ%u", 0U)
{ }
void sentx6p(machine_config &config);
void init_sentx6p();
void init_sentx6puk();
void init_sentx6pd();
void mem_map_2m_texas(address_map &map);
DECLARE_INPUT_CHANGED_MEMBER(ok_latch)
{
if (newval == 1)
{
m_inputlatches[param] |= 0x02;
logerror("latching OK button for Player %d\n", param+1);
}
}
DECLARE_INPUT_CHANGED_MEMBER(select_latch)
{
if (newval == 1)
{
m_inputlatches[param] |= 0x01;
logerror("latching Select button for Player %d\n", param+1);
}
}
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
private:
uint16_t sentx_porta_r();
uint16_t sentx_portb_r();
uint16_t sentx_portc_r();
virtual void porta_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0) override;
virtual void portb_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0) override;
virtual void portc_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0) override;
void sentx_tx_w(uint8_t data);
uint8_t m_lcd_card1[6];
uint8_t m_lcd_card2[6];
uint8_t m_lcd_options[6];
uint8_t m_lcd_options_select[6];
uint8_t m_lcd_led[6];
void set_card1(uint8_t value, int select_bits);
void set_card2(uint8_t value, int select_bits);
void set_options(uint8_t value, int select_bits);
void set_options_select(uint8_t value, int select_bits);
void set_controller_led(uint8_t value, int select_bits);
void controller_send_data(int which);
uint8_t m_inputlatches[6];
uint16_t m_porta_data;
output_finder<6> m_suite1;
output_finder<6> m_suite2;
output_finder<6> m_number1;
output_finder<6> m_number2;
output_finder<6> m_select_fold;
output_finder<6> m_select_check;
output_finder<6> m_select_bet;
output_finder<6> m_select_call;
output_finder<6> m_select_raise;
output_finder<6> m_select_allin;
output_finder<6> m_option_fold;
output_finder<6> m_option_check;
output_finder<6> m_option_bet;
output_finder<6> m_option_call;
output_finder<6> m_option_raise;
output_finder<6> m_option_allin;
output_finder<6> m_led;
// for I/O hacks
uint32_t m_pchackaddress1 = 0;
uint32_t m_pchackaddress2 = 0;
uint16_t m_controller_sense_addr = 0;
};
void sentx6p_state::mem_map_2m_texas(address_map &map)
{
map(0x000000, 0x3fffff).bankr("cartbank");
map(0x3f0000, 0x3f7fff).ram();
}
static INPUT_PORTS_START( sentx6p )
PORT_START("P1")
PORT_DIPNAME( 0x0001, 0x0001, "Port 1" )
PORT_DIPSETTING( 0x0001, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0002, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0004, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0008, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0010, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0020, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0040, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0080, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0100, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0200, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0400, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0800, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x2000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x4000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
// is this really just the battery sensor, or does it have some other meaning, like data ready?
PORT_DIPNAME( 0x8000, 0x0000, "Low Battery" )
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x8000, DEF_STR( On ) )
PORT_START("P2")
// these must be sense lines
PORT_DIPNAME( 0x0001, 0x0001, "Player 1 Connected" )
PORT_DIPSETTING( 0x0000, DEF_STR( No ) )
PORT_DIPSETTING( 0x0001, DEF_STR( Yes ) )
PORT_DIPNAME( 0x0002, 0x0002, "Player 2 Connected" )
PORT_DIPSETTING( 0x0000, DEF_STR( No ) )
PORT_DIPSETTING( 0x0002, DEF_STR( Yes ) )
PORT_DIPNAME( 0x0004, 0x0004, "Player 3 Connected" )
PORT_DIPSETTING( 0x0000, DEF_STR( No ) )
PORT_DIPSETTING( 0x0004, DEF_STR( Yes ) )
PORT_DIPNAME( 0x0008, 0x0008, "Player 4 Connected" )
PORT_DIPSETTING( 0x0000, DEF_STR( No ) )
PORT_DIPSETTING( 0x0008, DEF_STR( Yes ) )
PORT_DIPNAME( 0x0010, 0x0010, "Player 5 Connected" )
PORT_DIPSETTING( 0x0000, DEF_STR( No ) )
PORT_DIPSETTING( 0x0010, DEF_STR( Yes ) )
PORT_DIPNAME( 0x0020, 0x0020, "Player 6 Connected" )
PORT_DIPSETTING( 0x0000, DEF_STR( No ) )
PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) )
PORT_DIPNAME( 0x0040, 0x0040, "Port 2" )
PORT_DIPSETTING( 0x0040, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0080, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0100, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0200, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0400, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0800, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x2000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x4000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_START("P3")
PORT_DIPNAME( 0x0001, 0x0001, "Port 3" )
PORT_DIPSETTING( 0x0001, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0002, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0004, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0008, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0010, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0020, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0040, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_5) PORT_NAME("Console Select") // the Console buttons also work for Player 1
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_1) PORT_NAME("Console Ok")
PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0200, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0400, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0800, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x2000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x4000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
// these are presuambly read through the UART as the LCD screens are driven by it, currently not hooked up
// using PORT_CHANGED_MEMBER because we assume the controller latches them for sending as inputs are only read every few frames
PORT_START("CTRL1")
PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 0)
PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 0)
PORT_START("CTRL2")
PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 1)
PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 1)
PORT_START("CTRL3")
PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 2)
PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 2)
PORT_START("CTRL4")
PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 3)
PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 3)
PORT_START("CTRL5")
PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(5) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 4)
PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(5) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 4)
PORT_START("CTRL6")
PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(6) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,select_latch, 5)
PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(6) PORT_CHANGED_MEMBER(DEVICE_SELF, sentx6p_state,ok_latch, 5)
INPUT_PORTS_END
void sentx6p_state::machine_start()
{
spg2xx_game_state::machine_start();
m_suite1.resolve();
m_suite2.resolve();
m_number1.resolve();
m_number2.resolve();
m_select_fold.resolve();
m_select_check.resolve();
m_select_bet.resolve();
m_select_call.resolve();
m_select_raise.resolve();
m_select_allin.resolve();
m_option_fold.resolve();
m_option_check.resolve();
m_option_bet.resolve();
m_option_call.resolve();
m_option_raise.resolve();
m_option_allin.resolve();
m_led.resolve();
}
void sentx6p_state::machine_reset()
{
spg2xx_game_state::machine_reset();
for (int i = 0; i < 6; i++)
{
m_lcd_card1[i] = 0x00;
m_lcd_card2[i] = 0x00;
m_lcd_options[i] = 0x00;
m_lcd_options_select[i] = 0x00;
m_lcd_led[i] = 0x00;
m_inputlatches[i] = 0x00;
}
/* HACK: this address needs to contain '1' so that it thinks the first controller
is present, otherwise it hangs on boot. How does this get set?
following addresses are for the other controllers, and get set based on Port B
status flags */
address_space &mem = m_maincpu->space(AS_PROGRAM);
mem.write_word(m_controller_sense_addr,0x0001);
}
void sentx6p_state::controller_send_data(int which)
{
// 0x78 have to be set, this is probably because there is an unused space in the commands
// going the other way at 0x78 - 0x7f
// bit 3 (0x04) can also be set, doesn't care
uint8_t send = m_inputlatches[which] | 0x78;
m_maincpu->uart_rx( send );
if (m_inputlatches[which] & 0x03)
{
m_inputlatches[which] = 0x00;
logerror("clearing input latches for player %d\n", which + 1);
}
}
uint16_t sentx6p_state::sentx_porta_r()
{
int select_bits = (m_porta_data >> 8) & 0x3f;
//logerror("%s: sentx_porta_r (with controller select bits %02x)\n", machine().describe_context(), select_bits);
/* 0000 = no controller? (system buttons only?)
0100 = controller 1?
0200 = controller 2?
0400 = controller 3?
0800 = controller 4?
1000 = controller 5?
2000 = controller 6?
this is an assumption based on startup, where the port is polled after writing those values
*/
// the code around 029811 uses a ram value shifted left 8 times as the select bits (select_bits) on write
// then does a mask with them on the reads from this port, without shifting, comparing with 0
// the 'select bits' must also be active when the controller wants to send data, the UART read function
// won't proceed if they're zero, but the port is written with 0 before that
//logerror("%08x\n", m_maincpu->pc());
// regular logic for writing to the LCDs
uint16_t ret = (m_io_p1->read() & 0xffc0) | select_bits;
// hacks needed for reading from the UART to work
// the select bit must be high here to read from the controller?
if (m_maincpu->pc() == m_pchackaddress1)
{
ret ^= 0x3f;
}
// but must be low again here after writing the select bits in order to not
// get stuck in a timeout loop
if (m_maincpu->pc() == m_pchackaddress2)
{
ret &= ~0x3f;
// presumably the inputs can only be sent once the controller is actually selected, otherwise
// there would be competing UART sources?
for (int i = 0; i < 6; i++)
{
if (select_bits & (1 << i))
{
controller_send_data(i);
}
}
}
return ret;
}
uint16_t sentx6p_state::sentx_portb_r()
{
return m_io_p2->read();
}
uint16_t sentx6p_state::sentx_portc_r()
{
return m_io_p3->read();
}
void sentx6p_state::porta_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
logerror("%s: sentx_porta_w %04x\n", machine().describe_context(), data);
COMBINE_DATA(&m_porta_data);
}
void sentx6p_state::portb_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
logerror("%s: sentx_portb_w %04x\n", machine().describe_context(), data);
}
void sentx6p_state::portc_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
logerror("%s: sentx_portc_w %04x\n", machine().describe_context(), data);
}
/*
Card Table
(the controller must contain an MCU under the glob to receive thes commands
and convert them to actual LCD segments)
off 00
| A diamonds 01 | A hearts 0e | A spades 1b | A clubs 28 |
| 2 diamonds 02 | 2 hearts 0f | 2 spades 1c | 2 clubs 29 |
| 3 diamonds 03 | 3 hearts 10 | 3 spades 1d | 3 clubs 2a |
| 4 diamonds 04 | 4 hearts 11 | 4 spades 1e | 4 clubs 2b |
| 5 diamonds 05 | 5 hearts 12 | 5 spades 1f | 5 clubs 2c |
| 6 diamonds 06 | 6 hearts 13 | 6 spades 20 | 6 clubs 2d |
| 7 diamonds 07 | 7 hearts 14 | 7 spades 21 | 7 clubs 2e |
| 8 diamonds 08 | 8 hearts 15 | 8 spades 22 | 8 clubs 2f |
| 9 diamonds 09 | 9 hearts 16 | 9 spades 23 | 9 clubs 30 |
| 10 diamonds 0a | 10 hearts 17 | 10 spades 24 | 10 clubs 31 |
| J diamonds 0b | J hearts 18 | J spades 25 | J clubs 32 |
| Q diamonds 0c | Q hearts 19 | Q spades 26 | Q clubs 33 |
| K diamonds 0d | K hearts 1a | K spades 27 | K clubs 34 |
*/
void sentx6p_state::set_card1(uint8_t value, int select_bits)
{
for (int i = 0; i < 6; i++)
{
if (select_bits & (1 << i))
{
m_lcd_card1[i] = value;
int val = m_lcd_card1[i];
if (val == 0)
{
m_suite1[i] = 0;
m_number1[i] = 0;
}
else
{
int suite = (val-1) / 13;
int number = (val-1) % 13;
m_suite1[i] = suite+1;
m_number1[i] = number+1;
}
}
}
}
void sentx6p_state::set_card2(uint8_t value, int select_bits)
{
for (int i = 0; i < 6; i++)
{
if (select_bits & (1 << i))
{
m_lcd_card2[i] = value;
int val = m_lcd_card2[i];
if (val == 0)
{
m_suite2[i] = 0;
m_number2[i] = 0;
}
else
{
int suite = (val-1) / 13;
int number = (val-1) % 13;
m_suite2[i] = suite+1;
m_number2[i] = number+1;
}
}
}
}
void sentx6p_state::set_options(uint8_t value, int select_bits)
{
for (int i = 0; i < 6; i++)
{
if (select_bits & (1 << i))
{
m_lcd_options[i] = value;
// assume same mapping as selector bit below
m_option_fold[i] = (value & 0x01) ? 1 : 0;
m_option_check[i] = (value & 0x02) ? 1 : 0;
m_option_bet[i] = (value & 0x04) ? 1 : 0;
m_option_call[i] = (value & 0x08) ? 1 : 0;
m_option_raise[i] = (value & 0x10) ? 1 : 0;
m_option_allin[i] = (value & 0x20) ? 1 : 0;
}
}
}
/*
c0 = no selection highlight (00)
c1 = fold selected (01)
c2 = check selected (02)
c4 = bet selected (04)
c8 = call selected (08)
d0 = raise selected (10)
e0 = all in selected (20)
*/
void sentx6p_state::set_options_select(uint8_t value, int select_bits)
{
for (int i = 0; i < 6; i++)
{
if (select_bits & (1 << i))
{
m_lcd_options_select[i] = value;
m_select_fold[i] = (value & 0x01) ? 1 : 0;
m_select_check[i] = (value & 0x02) ? 1 : 0;
m_select_bet[i] = (value & 0x04) ? 1 : 0;
m_select_call[i] = (value & 0x08) ? 1 : 0;
m_select_raise[i] = (value & 0x10) ? 1 : 0;
m_select_allin[i] = (value & 0x20) ? 1 : 0;
}
}
}
void sentx6p_state::set_controller_led(uint8_t value, int select_bits)
{
for (int i = 0; i < 6; i++)
{
if (select_bits & (1 << i))
{
m_lcd_led[i] = value;
m_led[i] = value ^ 1;
}
}
}
void sentx6p_state::sentx_tx_w(uint8_t data)
{
int select_bits = (m_porta_data >> 8) & 0x3f;
// TX function is at 0x029773
// starts by writing controller select, then checking if controller is selected, then transmits data
// RX function is at 0x029811
// similar logic to write controller ID, check if selected, then recieve data
switch (data)
{
case 0x00: // card 1 off
case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07: case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: // card 1 show Diamonds A,2,3,4,5,6,7,8,10,J,Q,K
case 0x0e: case 0x0f: case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: case 0x18: case 0x19: case 0x1a: // card 1 show Hearts A,2,3,4,5,6,7,8,10,J,Q,K
case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: // card 1 show Spades A,2,3,4,5,6,7,8,10,J,Q,K
case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: // card 1 show Clubs A,2,3,4,5,6,7,8,10,J,Q,K
set_card1(data & 0x3f, select_bits);
break;
case 0x40: // card 2 off
case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: // card 1 show Diamonds A,2,3,4,5,6,7,8,10,J,Q,K
case 0x4e: case 0x4f: case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: case 0x58: case 0x59: case 0x5a: // card 1 show Hearts A,2,3,4,5,6,7,8,10,J,Q,K
case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: // card 1 show Spades A,2,3,4,5,6,7,8,10,J,Q,K
case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: // card 1 show Clubs A,2,3,4,5,6,7,8,10,J,Q,K
set_card2(data & 0x3f, select_bits);
break;
// cases 0x78 - 0x7f are transmissions in the other direction (from controller to main unit, used for sending buttons)
case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f: // show selection options
case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97: case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f:
case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7: case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf:
case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf:
set_options(data & 0x3f, select_bits);
break;
case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7: case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf: // show selection cursor
case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf:
case 0xe0: case 0xe1: case 0xe2: case 0xe3: case 0xe4: case 0xe5: case 0xe6: case 0xe7: case 0xe8: case 0xe9: case 0xea: case 0xeb: case 0xec: case 0xed: case 0xee: case 0xef:
case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7: case 0xf8: case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff:
set_options_select(data & 0x3f, select_bits);
break;
case 0x38:
case 0x39:
set_controller_led(data & 0x01, select_bits);
break;
case 0x3a:
// reset controller? (the input code also seems to check for 3a in one place coming in the other direction)
break;
default:
logerror("unknown LCD command %02x with controller select %02x\n", data, select_bits);
break;
}
}
void sentx6p_state::sentx6p(machine_config &config)
{
SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen);
m_maincpu->set_addrmap(AS_PROGRAM, &sentx6p_state::mem_map_2m_texas);
m_maincpu->set_pal(true);
spg2xx_base(config);
m_screen->set_refresh_hz(50);
m_maincpu->porta_in().set(FUNC(sentx6p_state::sentx_porta_r));
m_maincpu->portb_in().set(FUNC(sentx6p_state::sentx_portb_r));
m_maincpu->portc_in().set(FUNC(sentx6p_state::sentx_portc_r));
m_maincpu->porta_out().set(FUNC(sentx6p_state::porta_w));
m_maincpu->portb_out().set(FUNC(sentx6p_state::portb_w));
m_maincpu->portc_out().set(FUNC(sentx6p_state::portc_w));
m_maincpu->uart_tx().set(FUNC(sentx6p_state::sentx_tx_w));
config.set_default_layout(layout_sentx6p);
}
ROM_START( sentx6p )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 )
ROM_LOAD16_WORD_SWAP( "vsmaxxtexasholdem.bin", 0x000000, 0x200000, CRC(d9d7ea1d) SHA1(ae531958d6074ea2034910f53e043d5fa10eaf8c) )
ROM_END
ROM_START( sentx6puk )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 )
// chksum:05B58350 is @ 0x3000.
// This is the correct sum of 0x3010 - 0x1fffff (the first half of the ROM area after the checksum string)
// The 2nd half is not summed (and not used by the game?) but definitely exists in ROM (same data on 2 units)
ROM_LOAD16_WORD_SWAP( "senario texas holdem.bin", 0x000000, 0x400000, CRC(7c7d2d33) SHA1(71631074ba66e3b0cdeb86ebca3931599f3a911c) )
ROM_END
ROM_START( sentx6pd )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 )
ROM_LOAD16_WORD_SWAP( "senariodeluxetvpoker.bin", 0x000000, 0x800000, CRC(e2b6844e) SHA1(2413195dfe7a08d16ca870c070a19034c9fe8c30) )
ROM_END
void sentx6p_state::init_sentx6puk()
{
m_pchackaddress1 = 0x2981e;
m_pchackaddress2 = 0x29834;
m_controller_sense_addr = 0x1e08;
}
void sentx6p_state::init_sentx6p()
{
m_pchackaddress1 = 0x29754;
m_pchackaddress2 = 0x2976a;
m_controller_sense_addr = 0x0804;
}
void sentx6p_state::init_sentx6pd()
{
m_pchackaddress1 = 0xca20;
m_pchackaddress2 = 0xca36;
m_controller_sense_addr = 0x1e3a;
}
CONS( 2004, sentx6p, 0, 0, sentx6p, sentx6p, sentx6p_state, init_sentx6p, "Senario", "Vs Maxx Texas Hold'em TV Poker - 6 Player Edition (US)", MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // from a US version, values in USD
CONS( 2004, sentx6puk, sentx6p, 0, sentx6p, sentx6p, sentx6p_state, init_sentx6puk, "Senario / Play Vision", "Vs Maxx Texas Hold'em TV Poker - 6 Player Edition (UK)", MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // from a UK Play Vision branded box, values in GBP
CONS( 2004, sentx6pd, 0, 0, sentx6p, sentx6p, sentx6p_state, init_sentx6pd, "Senario", "Deluxe TV Poker - Texas Hold'em, Blackjack & Video Poker (US)", MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
// Deluxe version wasn't released outside of US?
|