DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ G T ┃
Length: 12322 (0x3022) Types: TextFile Names: »GUI_INTERFACE_C«
└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13 └─ ⟦124ff5788⟧ »DATA« └─⟦this⟧ └─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11 └─ ⟦129cab021⟧ »DATA« └─⟦this⟧ └─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16 └─ ⟦6f12a12be⟧ »DATA« └─⟦this⟧ └─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04 └─ ⟦d65440be7⟧ »DATA« └─⟦this⟧
/*================================================================= ; IRP MULHOUSE AVRIL 92 ;------------------------------------------------------------------- ; PROJECT : Z80 SIMULATOR ; STUDENTS : MOREAUX & VERGER ; ; FILE : GUI_Interface.c ================================================================== ; DESCRIPTION : ; Fichier source principal pour la gestion de l'interface ; WINDOW SYSTEM ;----------------------------------------------------------------*/ #include "GUI_Interface.h" #include "Break.h" #include "FileOpen.h" #include "Memory.h" /* ----- Definitions ---------------------------*/ #define MESSAGE_LENGTH 80 #define INSTRUCTION_LENGTH 20 #define STATUS_LENGTH 60 #define A 0 #define F 2 #define B 4 #define C 6 #define D 8 #define E 10 #define H 12 #define L 14 #define I 16 #define AP 18 #define FP 20 #define BP 22 #define CP 24 #define DP 26 #define EP 28 #define HP 30 #define LP 32 #define IX 34 #define IY 38 #define SP 42 #define PC 46 #define IIX 50 #define IIY 52 #define ISP 54 #define STRING_Z80STATUS 0 #define STRING_FILENAME 1 #define STRING_BREAKLIST 2 #define STRING_MEMORYLIST 3 #define STRING_MEMORYDUMP 4 typedef int tWorkString; /*-------- Globales ---------------------------*/ int CntResetActivate = 0; int CntGoActivate = 0; int CntStopActivate = 0; int CntStepActivate = 0; int CntQuitActivate = 0; char avA[] = "00"; char avF[] = "00"; char avB[] = "00"; char avC[] = "00"; char avD[] = "00"; char avE[] = "00"; char avH[] = "00"; char avL[] = "00"; char avI[] = "00"; char avAP[] = "00"; char avFP[] = "00"; char avBP[] = "00"; char avCP[] = "00"; char avDP[] = "00"; char avEP[] = "00"; char avHP[] = "00"; char avLP[] = "00"; char avIX[] = "0000"; char avIY[] = "0000"; char avSP[] = "0000"; char avPC[] = "0000"; char avIIX[] = "00"; char avIIY[] = "00"; char avISP[] = "00"; char avInstruction [INSTRUCTION_LENGTH]; char avMessage [MESSAGE_LENGTH]; char Z80Status [STATUS_LENGTH]; tWorkString WorkString = STRING_Z80STATUS; int Iterator = 0 ; void ValueChangedCallback() { } /*------------------------------------------------- Initialisation --------------------------------------------------*/ void Init () { Widget TopLevel; Widget NewTopLevel; TopLevel = FmInitialize ("Z80", "Z80", NULL, 0, NULL, 0); NewTopLevel = FmCreateGUI ("Z80", TopLevel, NULL, 0); OpenFileInit(NewTopLevel); BreakInit(NewTopLevel); MemoryInit(NewTopLevel); /*------------------------------------------------------*/ FmAttachAv ( "A",avA); FmAttachAv ( "F",avF); FmAttachAv ( "B",avB); FmAttachAv ( "C",avC); FmAttachAv ( "D",avD); FmAttachAv ( "E",avE); FmAttachAv ( "H",avH); FmAttachAv ( "L",avL); FmAttachAv ( "I",avI); FmAttachAv ( "AP",avAP); FmAttachAv ( "FP",avFP); FmAttachAv ( "BP",avBP); FmAttachAv ( "CP",avCP); FmAttachAv ( "DP",avDP); FmAttachAv ( "EP",avEP); FmAttachAv ( "HP",avHP); FmAttachAv ( "LP",avLP); FmAttachAv ( "IX",avIX); FmAttachAv ( "IY",avIY); FmAttachAv ( "SP",avSP); FmAttachAv ( "PC",avPC); FmAttachAv ( "IIX",avIIX); FmAttachAv ( "IIY",avIIY); FmAttachAv ( "ISP",avISP); FmAttachAv ( "Instruction",avInstruction); FmAttachAv ( "Message", avMessage); } /*------------------------------------------------- Gestion PushButon par CallBacks + Compteur ( Appels depuis WINDOW ) --------------------------------------------------*/ void ResetActivate () { CntResetActivate++; } void QuitActivate () { CntQuitActivate++; } void GoActivate () { CntGoActivate++; } void StepActivate () { CntStepActivate ++; } void StopActivate() { CntStopActivate ++; } /*------------------------------------------------- Lecture des compteurs d'evenements ( Appels depuis Ada ) --------------------------------------------------*/ int GetCntResetActivate () { return CntResetActivate; } int GetCntQuitActivate () { return CntQuitActivate; } int GetCntGoActivate () { return CntGoActivate; } int GetCntStepActivate () { return CntStepActivate; } int GetCntStopActivate () { return CntStopActivate; } /*------------------------------------------------- Appels divers depuis Ada --------------------------------------------------*/ void Beep() { FmBeep(); } /*------------------------------------------------- Ecriture des variables actives ( Appels depuis Ada ) --------------------------------------------------*/ void SetMessage (char *message) { strcpy (avMessage, message); FmSetActiveValue ( 0, "Message" ); } void SetInstruction (char *instruction) { strcpy (avInstruction, instruction); FmSetActiveValue ( 0, "Instruction" ); } void Update (char *Z80StatusAda) { /* Recuperation des differentes valeurs definissant l'etat du Z80 */ avA[0] = Z80StatusAda[A]; avA[1] = Z80StatusAda[A+1]; avF[0] = Z80StatusAda[F]; avF[1] = Z80StatusAda[F+1]; avB[0] = Z80StatusAda[B]; avB[1] = Z80StatusAda[B+1]; avC[0] = Z80StatusAda[ C]; avC[1] = Z80StatusAda[C+1]; avD[0] = Z80StatusAda[D]; avD[1] = Z80StatusAda[D+1]; avE[0] = Z80StatusAda[E]; avE[1] = Z80StatusAda[E+1]; avH[0] = Z80StatusAda[H]; avH[1] = Z80StatusAda[H+1]; avL[0] = Z80StatusAda[L]; avL[1] = Z80StatusAda[L+1]; avI[0] = Z80StatusAda[I]; avI[1] = Z80StatusAda[I+1]; avAP[0] = Z80StatusAda[AP]; avAP[1] = Z80StatusAda[AP+1]; avFP[0] = Z80StatusAda[FP]; avFP[1] = Z80StatusAda[FP+1]; avBP[0] = Z80StatusAda[BP]; avBP[1] = Z80StatusAda[BP+1]; avCP[0] = Z80StatusAda[CP]; avCP[1] = Z80StatusAda[CP+1]; avDP[0] = Z80StatusAda[DP]; avDP[1] = Z80StatusAda[DP+1]; avEP[0] = Z80StatusAda[EP]; avEP[1] = Z80StatusAda[EP+1]; avHP[0] = Z80StatusAda[HP]; avHP[1] = Z80StatusAda[HP+1]; avLP[0] = Z80StatusAda[LP]; avLP[1] = Z80StatusAda[LP+1]; avIX[0] = Z80StatusAda[IX]; avIX[1] = Z80StatusAda[IX+1]; avIX[2] = Z80StatusAda[IX+2]; avIX[3] = Z80StatusAda[IX+3]; avIY[0] = Z80StatusAda[IY]; avIY[1] = Z80StatusAda[IY+1]; avIY[2] = Z80StatusAda[IY+2]; avIY[3] = Z80StatusAda[IY+3]; avSP[0] = Z80StatusAda[SP]; avSP[1] = Z80StatusAda[SP+1]; avSP[2] = Z80StatusAda[SP+2]; avSP[3] = Z80StatusAda[SP+3]; avPC[0] = Z80StatusAda[PC]; avPC[1] = Z80StatusAda[PC+1]; avPC[2] = Z80StatusAda[PC+2]; avPC[3] = Z80StatusAda[PC+3]; avIIX[0] = Z80StatusAda[IIX]; avIIX[1] = Z80StatusAda[IIX+1]; avIIY[0] = Z80StatusAda[IIY]; avIIY[1] = Z80StatusAda[IIY+1]; avISP[0] = Z80StatusAda[ISP]; avISP[1] = Z80StatusAda[ISP+1]; FmSetActiveValue ( 0, "A" ); FmSetActiveValue ( 0, "F" ); FmSetActiveValue ( 0, "B" ); FmSetActiveValue ( 0, "C" ); FmSetActiveValue ( 0, "D" ); FmSetActiveValue ( 0, "E" ); FmSetActiveValue ( 0, "H" ); FmSetActiveValue ( 0, "L" ); FmSetActiveValue ( 0, "I" ); FmSetActiveValue ( 0, "AP" ); FmSetActiveValue ( 0, "FP" ); FmSetActiveValue ( 0, "BP" ); FmSetActiveValue ( 0, "CP" ); FmSetActiveValue ( 0, "DP" ); FmSetActiveValue ( 0, "EP" ); FmSetActiveValue ( 0, "HP" ); FmSetActiveValue ( 0, "LP" ); FmSetActiveValue ( 0, "IX" ); FmSetActiveValue ( 0, "IY" ); FmSetActiveValue ( 0, "SP" ); FmSetActiveValue ( 0, "PC" ); FmSetActiveValue ( 0, "IIX" ); FmSetActiveValue ( 0, "IIY" ); FmSetActiveValue ( 0, "ISP" ); } /*------------------------------------------------ Iterateur pour la chaine Z80Status -------------------------------------------------*/ void StatusZ80IterInit () { FmGetActiveValue ( 0, "A" ); FmGetActiveValue ( 0, "F" ); FmGetActiveValue ( 0, "B" ); FmGetActiveValue ( 0, "C" ); FmGetActiveValue ( 0, "D" ); FmGetActiveValue ( 0, "E" ); FmGetActiveValue ( 0, "H" ); FmGetActiveValue ( 0, "L" ); FmGetActiveValue ( 0, "I" ); FmGetActiveValue ( 0, "AP" ); FmGetActiveValue ( 0, "FP" ); FmGetActiveValue ( 0, "BP" ); FmGetActiveValue ( 0, "CP" ); FmGetActiveValue ( 0, "DP" ); FmGetActiveValue ( 0, "EP" ); FmGetActiveValue ( 0, "HP" ); FmGetActiveValue ( 0, "LP" ); FmGetActiveValue ( 0, "IX" ); FmGetActiveValue ( 0, "IY" ); FmGetActiveValue ( 0, "SP" ); FmGetActiveValue ( 0, "PC" ); Z80Status[A] =avA[0]; Z80Status[A+1]=avA[1]; Z80Status[F] =avF[0]; Z80Status[F+1]=avF[1]; Z80Status[B] =avB[0]; Z80Status[B+1]=avB[1]; Z80Status[ C] =avC[0]; Z80Status[C+1]=avC[1]; Z80Status[D] =avD[0]; Z80Status[D+1]=avD[1]; Z80Status[E] =avE[0]; Z80Status[E+1]=avE[1]; Z80Status[H] =avH[0]; Z80Status[H+1]=avH[1]; Z80Status[L] =avL[0]; Z80Status[L+1]=avL[1]; Z80Status[I] =avI[0]; Z80Status[I+1]=avI[1]; Z80Status[AP] =avAP[0]; Z80Status[AP+1]=avAP[1]; Z80Status[FP] =avFP[0]; Z80Status[FP+1]=avFP[1]; Z80Status[BP] =avBP[0]; Z80Status[BP+1]=avBP[1]; Z80Status[CP] =avCP[0]; Z80Status[CP+1]=avCP[1]; Z80Status[DP] =avDP[0]; Z80Status[DP+1]=avDP[1]; Z80Status[EP] =avEP[0]; Z80Status[EP+1]=avEP[1]; Z80Status[HP] =avHP[0]; Z80Status[HP+1]=avHP[1]; Z80Status[LP] =avLP[0]; Z80Status[LP+1]=avLP[1]; Z80Status[IX] =avIX[0]; Z80Status[IX+1]=avIX[1]; Z80Status[IX+2]=avIX[2]; Z80Status[IX+3]=avIX[3]; Z80Status[IY] =avIY[0]; Z80Status[IY+1]=avIY[1]; Z80Status[IY+2]=avIY[2]; Z80Status[IY+3]=avIY[3]; Z80Status[SP] =avSP[0]; Z80Status[SP+1]=avSP[1]; Z80Status[SP+2]=avSP[2]; Z80Status[SP+3]=avSP[3]; Z80Status[PC] =avPC[0]; Z80Status[PC+1]=avPC[1]; Z80Status[PC+2]=avPC[2]; Z80Status[PC+3]=avPC[3]; Z80Status[IIX] =avIIX[0]; Z80Status[IIX+1]=avIIX[1]; Z80Status[IIY] =avIIY[0]; Z80Status[IIY+1]=avIIY[1]; Z80Status[ISP] =avISP[0]; Z80Status[ISP+1]=avISP[1]; Iterator = 0; } void StatusZ80IterNext () { Iterator ++; } Boolean StatusZ80IterDone () { return (Iterator == strlen (Z80Status)) ; } char StatusZ80IterValue() { return Z80Status[Iterator]; } /*------------------------------------------------ Iterateur ( Appels depuis Ada ) -------------------------------------------------*/ void IteratorFileName() { WorkString = STRING_FILENAME; } void IteratorZ80Status() { WorkString = STRING_Z80STATUS; } void IteratorBreakList() { WorkString = STRING_BREAKLIST; } void IteratorMemoryList() { WorkString = STRING_MEMORYLIST; } void IteratorMemoryDump() { WorkString = STRING_MEMORYDUMP; } void IterInit() { switch (WorkString) { case STRING_Z80STATUS : StatusZ80IterInit(); break; case STRING_FILENAME : FileNameIterInit(); break; case STRING_BREAKLIST : BreakListIterInit(); break; case STRING_MEMORYLIST: MemoryListIterInit(); break; case STRING_MEMORYDUMP: MemoryDumpIterInit(); break; } } int IterDone() { switch (WorkString) { case STRING_Z80STATUS : return StatusZ80IterDone(); case STRING_FILENAME : return FileNameIterDone(); case STRING_BREAKLIST : return BreakListIterDone(); case STRING_MEMORYLIST: return MemoryListIterDone(); case STRING_MEMORYDUMP: return MemoryDumpIterDone(); } } void IterNext () { switch (WorkString) { case STRING_Z80STATUS: StatusZ80IterNext(); break; case STRING_FILENAME : FileNameIterNext(); break; case STRING_BREAKLIST: BreakListIterNext(); break; case STRING_MEMORYLIST: MemoryListIterNext(); break; case STRING_MEMORYDUMP: MemoryDumpIterNext(); break; } } char IterValue() { switch (WorkString ) { case STRING_Z80STATUS : return StatusZ80IterValue(); case STRING_FILENAME : return FileNameIterValue(); case STRING_BREAKLIST : return BreakListIterValue(); case STRING_MEMORYLIST: return MemoryListIterValue(); case STRING_MEMORYDUMP: return MemoryDumpIterValue(); } } /*================= FIN DU FICHIER ======================================*/