+ S74LS374NSynco();
+}
+
+void S74LS374N_Init(CartInfo *info)
+{
+ info->Power=S74LS374NPower;
+ GameStateRestore=S74LS374NRestore;
+ AddExState(latch, 5, 0, "LATC");
+ AddExState(&cmd, 1, 0, "CMD");
+}
+
+static void S74LS374NASynco(void)
+{
+ setprg32(0x8000,latch[0]);
+ setchr8(latch[1]);
+ S74LS374MSync(latch[2]);
+}
+
+static DECLFW(S74LS374NAWrite)
+{
+ A&=0x4101;
+ if(A==0x4100)
+ cmd=V&7;
+ else
+ {
+ switch(cmd)
+ {
+ case 0:latch[0]=0;latch[1]=3;break;
+ case 2:latch[3]=(V&1)<<3;break;
+ case 4:latch[1]=(latch[1]&6)|(V&3);break;
+ case 5:latch[0]=V&1;break;
+ case 6:latch[1]=(latch[1]&1)|latch[3]|((V&3)<<1);break;
+ case 7:latch[2]=V&1;break;
+ }
+ S74LS374NASynco();
+ }