@@ -95,7 +95,7 @@ namespace {
95
95
/* Didact base class */
96
96
class didact_state : public driver_device
97
97
{
98
- public:
98
+ public:
99
99
didact_state (const machine_config &mconfig, device_type type, const char * tag)
100
100
: driver_device(mconfig, type, tag)
101
101
, m_cass(*this , " cassette" )
@@ -107,6 +107,7 @@ class didact_state : public driver_device
107
107
108
108
DECLARE_INPUT_CHANGED_MEMBER (trigger_reset);
109
109
DECLARE_INPUT_CHANGED_MEMBER (trigger_shift);
110
+
110
111
protected:
111
112
virtual void machine_start () override { m_led.resolve (); }
112
113
@@ -327,14 +328,12 @@ void md6802_state::md6802_map(address_map &map)
327
328
*/
328
329
/* Didact mp68a driver class */
329
330
330
- // Just a statement that the real mp68a hardware was designed with 6820 and not 6821
331
+ // The real mp68a hardware was designed with 6820 and not 6821.
331
332
// They are functional equivalents BUT has different electrical characteristics.
332
333
// 2019-07-27 Cassette added: saves ok, load is unreliable, probably an original design problem.
333
- #define pia6820_device pia6821_device
334
- #define PIA6820 PIA6821
335
334
class mp68a_state : public didact_state
336
335
{
337
- public:
336
+ public:
338
337
mp68a_state (const machine_config &mconfig, device_type type, const char * tag)
339
338
: didact_state(mconfig, type, tag)
340
339
, m_maincpu(*this , " maincpu" )
@@ -361,9 +360,10 @@ class mp68a_state : public didact_state
361
360
virtual void machine_start () override ATTR_COLD;
362
361
void mp68a (machine_config &config);
363
362
void mp68a_map (address_map &map) ATTR_COLD;
363
+
364
364
protected:
365
- required_device<pia6820_device > m_pia1;
366
- required_device<pia6820_device > m_pia2;
365
+ required_device<pia6821_device > m_pia1;
366
+ required_device<pia6821_device > m_pia2;
367
367
};
368
368
369
369
INPUT_CHANGED_MEMBER (didact_state::trigger_shift)
@@ -425,13 +425,13 @@ uint8_t mp68a_state::pia2_kbB_r()
425
425
while (a012 > 0 && !(line & (1 << --a012)));
426
426
a012 += 8 ;
427
427
}
428
- if ( a012 == 0 && (line = ((m_lines[2 ]) | m_lines[3 ])) != 0 )
428
+ if (a012 == 0 && (line = ((m_lines[2 ]) | m_lines[3 ])) != 0 )
429
429
{
430
430
a012 = 8 ;
431
431
while (a012 > 0 && !(line & (1 << --a012)));
432
432
}
433
433
434
- pb = a012; // A0-A2 -> PB0-PB3
434
+ pb = a012; // A0-A2 -> PB0-PB3
435
435
436
436
if (m_shift)
437
437
{
@@ -486,8 +486,8 @@ void mp68a_state::machine_start()
486
486
void mp68a_state::mp68a_map (address_map &map)
487
487
{
488
488
map (0x0000 , 0x00ff ).ram ().mirror (0xf000 );
489
- map (0x0500 , 0x0503 ).rw (m_pia1, FUNC (pia6820_device ::read ), FUNC (pia6820_device ::write )).mirror (0xf0fc );
490
- map (0x0600 , 0x0603 ).rw (m_pia2, FUNC (pia6820_device ::read ), FUNC (pia6820_device ::write )).mirror (0xf0fc );
489
+ map (0x0500 , 0x0503 ).rw (m_pia1, FUNC (pia6821_device ::read ), FUNC (pia6821_device ::write )).mirror (0xf0fc );
490
+ map (0x0600 , 0x0603 ).rw (m_pia2, FUNC (pia6821_device ::read ), FUNC (pia6821_device ::write )).mirror (0xf0fc );
491
491
map (0x0700 , 0x07ff ).ram ().mirror (0xf000 );
492
492
map (0x0800 , 0x0bff ).rom ().mirror (0xf400 ).region (" maincpu" , 0x0800 );
493
493
}
@@ -536,7 +536,7 @@ void mp68a_state::mp68a_map(address_map &map)
536
536
/* Didact modulab driver class */
537
537
class modulab_state : public didact_state
538
538
{
539
- public:
539
+ public:
540
540
modulab_state (const machine_config &mconfig, device_type type, const char * tag)
541
541
: didact_state(mconfig, type, tag)
542
542
, m_maincpu(*this , " maincpu" )
@@ -553,10 +553,12 @@ class modulab_state : public didact_state
553
553
virtual void machine_reset () override ATTR_COLD;
554
554
virtual void machine_start () override ATTR_COLD;
555
555
void modulab (machine_config &config);
556
+
556
557
protected:
557
558
uint8_t io_r (offs_t offset);
558
559
void io_w (offs_t offset, u8 data);
559
560
void da_w (int state);
561
+
560
562
private:
561
563
void modulab_map (address_map &map) ATTR_COLD;
562
564
// Offsets for display and keyboard i/o
@@ -571,7 +573,7 @@ class modulab_state : public didact_state
571
573
class shift8
572
574
{
573
575
public:
574
- shift8 (){ byte = 0 ; }
576
+ shift8 () { byte = 0 ; }
575
577
void shiftIn (uint8_t in){ byte = ((byte << 1 ) & 0xfe ) | (in & 1 ? 1 : 0 ); }
576
578
uint8_t byte;
577
579
};
@@ -850,10 +852,10 @@ void mp68a_state::mp68a(machine_config &config)
850
852
851
853
/* Devices */
852
854
/* PIA #1 0x500-0x503 - used differently by laborations and loaded software */
853
- PIA6820 (config, m_pia1, 0 );
855
+ PIA6821 (config, m_pia1, 0 ); // actually 6820
854
856
855
857
/* PIA #2 Keyboard & Display 0x600-0x603 */
856
- PIA6820 (config, m_pia2, 0 );
858
+ PIA6821 (config, m_pia2, 0 ); // actually 6820
857
859
/* --PIA inits----------------------- */
858
860
/* 0x0BAF 0x601 (Control A) = 0x30 - CA2 is low and enable DDRA */
859
861
/* 0x0BB1 0x603 (Control B) = 0x30 - CB2 is low and enable DDRB */
@@ -886,12 +888,12 @@ void mp68a_state::mp68a(machine_config &config)
886
888
/* 0x086B 0x600 (Port A) = 0x70 */
887
889
/* 0x086B 0x600 (Port A) = 0x50 */
888
890
/* 0x086B 0x600 (Port A) = 0x70 */
889
- DM9368 (config, m_digits[0 ], 0 ).update_cb ().set (FUNC (mp68a_state::digit_w<0 >));
890
- DM9368 (config, m_digits[1 ], 0 ).update_cb ().set (FUNC (mp68a_state::digit_w<1 >));
891
- DM9368 (config, m_digits[2 ], 0 ).update_cb ().set (FUNC (mp68a_state::digit_w<2 >));
892
- DM9368 (config, m_digits[3 ], 0 ).update_cb ().set (FUNC (mp68a_state::digit_w<3 >));
893
- DM9368 (config, m_digits[4 ], 0 ).update_cb ().set (FUNC (mp68a_state::digit_w<4 >));
894
- DM9368 (config, m_digits[5 ], 0 ).update_cb ().set (FUNC (mp68a_state::digit_w<5 >));
891
+ DM9368 (config, m_digits[0 ]).update_cb ().set (FUNC (mp68a_state::digit_w<0 >));
892
+ DM9368 (config, m_digits[1 ]).update_cb ().set (FUNC (mp68a_state::digit_w<1 >));
893
+ DM9368 (config, m_digits[2 ]).update_cb ().set (FUNC (mp68a_state::digit_w<2 >));
894
+ DM9368 (config, m_digits[3 ]).update_cb ().set (FUNC (mp68a_state::digit_w<3 >));
895
+ DM9368 (config, m_digits[4 ]).update_cb ().set (FUNC (mp68a_state::digit_w<4 >));
896
+ DM9368 (config, m_digits[5 ]).update_cb ().set (FUNC (mp68a_state::digit_w<5 >));
895
897
896
898
/* Cassette */
897
899
SPEAKER (config, " mono" ).front_center ();
0 commit comments