+
+// quick paste
+#define FCEUNPCMD_RESET 0x01
+#define FCEUNPCMD_POWER 0x02
+
+#define FCEUNPCMD_VSUNICOIN 0x07
+#define FCEUNPCMD_VSUNIDIP0 0x08
+#define FCEUNPCMD_FDSINSERT 0x18
+#define FCEUNPCMD_FDSSELECT 0x1A
+
+
+void FCEU_DoSimpleCommand(int cmd)
+{
+ switch(cmd)
+ {
+ case FCEUNPCMD_FDSINSERT: FCEU_FDSInsert();break;
+ case FCEUNPCMD_FDSSELECT: FCEU_FDSSelect();break;
+// case FCEUNPCMD_FDSEJECT: FCEU_FDSEject();break;
+ case FCEUNPCMD_VSUNICOIN: FCEU_VSUniCoin(); break;
+ case FCEUNPCMD_VSUNIDIP0 ... (FCEUNPCMD_VSUNIDIP0 + 7): FCEU_VSUniToggleDIP(cmd - FCEUNPCMD_VSUNIDIP0);break;
+ case FCEUNPCMD_POWER: PowerNES();break;
+ case FCEUNPCMD_RESET: ResetNES();break;
+ default: printf("FCEU_DoSimpleCommand: can't handle cmd %i\n", cmd); break;
+ }
+}
+
+void FCEU_QSimpleCommand(int cmd)
+{
+// if(FCEUnetplay)
+// FCEUNET_SendCommand(cmd, 0);
+// else
+ {
+ // totally wrong:
+// if(!FCEUMOV_IsPlaying())
+// FCEU_DoSimpleCommand(cmd);
+// else
+// FCEUMOV_AddCommand(cmd);
+
+ FCEU_DoSimpleCommand(cmd);
+// if(FCEUMOV_IsRecording())
+// FCEUMOV_AddCommand(cmd);
+ }
+}
+
+void FCEUI_FDSSelect(void)
+{
+ FCEU_QSimpleCommand(FCEUNPCMD_FDSSELECT);
+}
+
+int FCEUI_FDSInsert(void)
+{
+ FCEU_QSimpleCommand(FCEUNPCMD_FDSINSERT);
+ return(1);
+}
+
+/*
+int FCEUI_FDSEject(void)
+{
+ FCEU_QSimpleCommand(FCEUNPCMD_FDSEJECT);
+ return(1);
+}
+*/
+void FCEUI_VSUniToggleDIP(int w)
+{
+ FCEU_QSimpleCommand(FCEUNPCMD_VSUNIDIP0 + w);
+}
+
+void FCEUI_VSUniCoin(void)
+{
+ FCEU_QSimpleCommand(FCEUNPCMD_VSUNICOIN);
+}
+
+void FCEUI_ResetNES(void)
+{
+ FCEU_QSimpleCommand(FCEUNPCMD_RESET);
+}
+
+void FCEUI_PowerNES(void)
+{
+ FCEU_QSimpleCommand(FCEUNPCMD_POWER);
+}
+
+
+
+SFORMAT FCEUCTRL_STATEINFO[]={
+ { joy_readbit, 2, "JYRB"},
+ { joy, 4, "JOYS"},
+ { &LastStrobe, 1, "LSTS"},
+ { 0 }
+};
+
+