@@ -107,6 +107,8 @@ class kn5000_state : public driver_device
107
107
, m_CPL_LED(*this , " CPL_%u" , 0U )
108
108
, m_CPR_LED(*this , " CPR_%u" , 0U )
109
109
, m_led_row(0 )
110
+ , m_mstat(0 )
111
+ , m_sstat(0 )
110
112
{ }
111
113
112
114
void kn5000 (machine_config &config);
@@ -122,6 +124,8 @@ class kn5000_state : public driver_device
122
124
output_finder<50 > m_CPL_LED;
123
125
output_finder<69 > m_CPR_LED;
124
126
uint8_t m_led_row;
127
+ uint8_t m_mstat;
128
+ uint8_t m_sstat;
125
129
126
130
virtual void machine_start () override ;
127
131
virtual void machine_reset () override ;
@@ -219,11 +223,11 @@ static INPUT_PORTS_START(kn5000)
219
223
PORT_DIPSETTING( 0x01 , DEF_STR(Off))
220
224
221
225
PORT_START(" COM_SELECT" )
222
- PORT_DIPNAME(0x0f , 0x0e , " Computer Interface Selection" )
223
- PORT_DIPSETTING( 0x0e , " MIDI" )
224
- PORT_DIPSETTING( 0x0d , " PC1" )
225
- PORT_DIPSETTING( 0x0b , " PC2" )
226
- PORT_DIPSETTING( 0x07 , " Mac" )
226
+ PORT_DIPNAME(0xf0 , 0xe0 , " Computer Interface Selection" )
227
+ PORT_DIPSETTING( 0xe0 , " MIDI" )
228
+ PORT_DIPSETTING( 0xd0 , " PC1" )
229
+ PORT_DIPSETTING( 0xb0 , " PC2" )
230
+ PORT_DIPSETTING( 0x70 , " Mac" )
227
231
228
232
PORT_START(" CPR_SEG0" )
229
233
PORT_BIT( 0x01 , IP_ACTIVE_HIGH, IPT_UNUSED )
@@ -672,6 +676,9 @@ void kn5000_state::cpanel_leds_w(offs_t offset, uint8_t data)
672
676
673
677
void kn5000_state::machine_start ()
674
678
{
679
+ save_item (NAME (m_mstat));
680
+ save_item (NAME (m_sstat));
681
+
675
682
#ifdef EXTENSION_VIEW
676
683
if (m_extension)
677
684
{
@@ -713,64 +720,79 @@ void kn5000_state::kn5000(machine_config &config)
713
720
// m_maincpu->port?_write().set(FUNC(kn5000_state::maincpu_port?_w));
714
721
//
715
722
716
- // PORT 7:
723
+
724
+ // MAINCPU PORT 7:
717
725
// bit 5 (~BUSRQ pin): RY/~BY pin of maincpu ROMs
718
726
m_maincpu->port7_read ().set ([] { return (1 << 5 ); }); // checked at EF3735 (v10 ROM)
719
727
720
- // PORT 8:
728
+
729
+ // MAINCPU PORT 8:
721
730
// bit 6 (~WAIT pin) (input): Something involving VGA.RDY, FDC.DMAACK
722
731
// and shift-register @ IC18
723
732
724
- // PORT A:
733
+
734
+ // MAINCPU PORT A:
725
735
// bit 0: sub_cpu ~RESET / SRST
726
736
727
- // PORT C:
737
+
738
+ // MAINCPU PORT C:
728
739
// bit 0 (input) = "check terminal" switch
729
740
// bit 1 (output) = "check terminal" LED
730
741
m_maincpu->portc_read ().set ([this ] { return ioport (" CN11" )->read (); });
731
742
m_maincpu->portc_write ().set ([this ] (u8 data) { m_checking_device_led_cn11->set_state (BIT (data, 1 ) == 0 ); });
732
743
733
- // PORT D:
744
+
745
+ // MAINCPU PORT D:
734
746
// bit 0 (output) = FDCRST
735
747
// bit 6 (input) = FD.I/O
736
748
m_maincpu->portd_write ().set ([this ] (u8 data) { m_fdc->reset_w (BIT (data, 0 )); });
737
749
// TODO: bit 6!
738
750
739
751
740
- // PORT E:
752
+ // MAINCPU PORT E:
741
753
// bit 0 (input) = +5v
742
754
// bit 2 (input) = HDDRDY
743
755
// bit 4 (?) = MICSNS
744
756
m_maincpu->porte_read ().set ([] { return 1 ; }); // checked at EF05A6 (v10 ROM)
745
- // FIXME: Bit 0 should only be 1 if the optional hard-drive extension board is disabled
757
+ // FIXME: Bit 0 should only be 1 if the
758
+ // optional hard-drive extension board is disabled;
759
+
746
760
747
- // PORT F:
761
+ // MAINCPU PORT F:
748
762
// bit 2 (OUTPUT) = Something related to "RESET CONTROL" circuits?
749
763
750
- // PORT G:
764
+
765
+ // MAINCPU PORT G:
751
766
// bit 2 (input) = FS1 (Foot Switches and Foot Controler ?)
752
767
// bit 3 (input) = FS2
753
768
// bit 4 (input) = FC1
754
769
// bit 5 (input) = FC2
755
770
// bit 6 (input) = FC3
756
771
// bit 7 (input) = FC4
757
772
758
- // PORT H:
773
+
774
+ // MAINCPU PORT H:
759
775
// bit 1 = TC1 Terminal count - microDMA
760
776
m_maincpu->porth_read ().set ([] { return 2 ; }); // area/region detection: checked at EF083E (v10 ROM)
761
- // FIXME: These are resistors on the pcb,
762
- // but could be declared in the driver as a 2 bit DIP-Switch for area/region selection.
763
-
764
- // PORT Z:
765
- // bit 0 = MSTAT0 SUBCPU: PORT D2
766
- // bit 1 = MSTAT1 SUBCPU: PORT D4
767
- // bit 2 = SSTAT0 SUBCPU: PORT D0
768
- // bit 3 = SSTAT1 SUBCPU: PORT D1
777
+ // FIXME: These are resistors on the pcb, but could be declared
778
+ // in the driver as a 2 bit DIP-Switch for area/region selection.
779
+
780
+
781
+ // MAINCPU PORT Z:
782
+ // bit 0 = (output) MSTAT0
783
+ // bit 1 = (output) MSTAT1
784
+ // bit 2 = (input) SSTAT0
785
+ // bit 3 = (input) SSTAT1
769
786
// bit 4 = COM.PC2
770
787
// bit 5 = COM.PC1
771
788
// bit 6 = COM.MAC
772
789
// bit 7 = COM.MIDI
773
- m_maincpu->portz_read ().set_ioport (" COM_SELECT" );
790
+ m_maincpu->portz_read ().set ([this ] {
791
+ return ioport (" COM_SELECT" )->read () | (m_sstat << 2 );
792
+ });
793
+ m_maincpu->portz_write ().set ([this ] (u8 data) {
794
+ m_mstat = data & 3 ;
795
+ });
774
796
775
797
776
798
// RX0/TX0 = MRXD/MTXD
@@ -786,6 +808,21 @@ void kn5000_state::kn5000(machine_config &config)
786
808
m_subcpu->set_addrmap (AS_PROGRAM, &kn5000_state::subcpu_mem);
787
809
// Interrupt 0: CLK on "to_subcpu_latch"
788
810
811
+
812
+ // SUBCPU PORT D:
813
+ // bit 0 = (output) SSTAT0
814
+ // bit 1 = (output) SSTAT1
815
+ // bit 2 = (input) MSTAT0
816
+ // bit 3 (not used)
817
+ // bit 4 = (input) MSTAT1
818
+ m_subcpu->portd_read ().set ([this ] {
819
+ return (BIT (m_mstat, 0 ) << 2 ) | (BIT (m_mstat, 1 ) << 4 );
820
+ });
821
+ m_subcpu->portd_write ().set ([this ] (u8 data) {
822
+ m_sstat = data & 3 ;
823
+ });
824
+
825
+
789
826
GENERIC_LATCH_8 (config, " to_maincpu_latch" ); // @ IC23
790
827
GENERIC_LATCH_8 (config, " to_subcpu_latch" ); // @ IC22
791
828
0 commit comments