PSP-EMU rev 57
Un emulador en c++ para SONY PSP
|
00001 00009 #ifndef CALLEGREX_H_ 00010 #define CALLEGREX_H_ 00011 00012 #include <stdlib.h> 00013 #include "general_emu.h" 00014 #include "cLib.h" 00015 #include "cAllegrexDefs.h" 00016 #include "cEstadoCPU.h" 00017 #include "cControladorMemoria.h" 00018 #include "cMemOrden.h" 00019 #include "cCop0.h" 00020 00021 class cAllegrex 00022 { 00023 private: 00024 // Estado del procesador 00025 cEstadoCPU estado; 00026 00027 // Registros 00028 tRegistro regGenericos[NUM_REG_GENERICOS]; 00029 00030 tRegistroDoble regHiLo; 00031 tRegistro regPc; 00032 tRegistroInst regRi[TAM_PIPLINE]; 00033 00034 // Controlador de memoria 00035 cControladorMemoria* controlador_memoria; 00036 00037 // Coprocesador 0: System Control 00038 cCop0 cop0; 00039 00040 // Decodificador de instrucciones 00041 tError (cAllegrex::* InstruccionesOpcode[NUM_OPCODES])(); 00042 00043 // Inicializaciones del emulador 00044 tError inicializarRegistros(void); 00045 00046 // Pipeline 00047 tError pipeSigInstruccion(void); 00048 tError pipeVaciar(void); 00049 00050 // Decodificar instrucción 00051 tError ejecutarInstNoValida(void); 00052 00053 tError ejecutarInstTipoR(void); 00054 tError ejecutarInstTipoCP(void); 00055 00056 tError ejecutarInstTipoJ(void); 00057 tError ejecutarInstTipoJAL(void); 00058 tError ejecutarInstTipoBEQ(void); 00059 tError ejecutarInstTipoBNE(void); 00060 tError ejecutarInstTipoBLEZ(void); 00061 tError ejecutarInstTipoBGTZ(void); 00062 tError ejecutarInstTipoAddI(void); 00063 tError ejecutarInstTipoAddIU(void); 00064 tError ejecutarInstTipoSLTI(void); 00065 tError ejecutarInstTipoSLTIU(void); 00066 tError ejecutarInstTipoAndI(void); 00067 tError ejecutarInstTipoOrI(void); 00068 tError ejecutarInstTipoXorI(void); 00069 tError ejecutarInstTipoL(tLongitud longitud, bool extender_signo); 00070 tError ejecutarInstTipoLB(void); 00071 tError ejecutarInstTipoLH(void); 00072 tError ejecutarInstTipoLW(void); 00073 tError ejecutarInstTipoLBU(void); 00074 tError ejecutarInstTipoLHU(void); 00075 tError ejecutarInstTipoLUI(void); 00076 tError ejecutarInstTipoS(tLongitud longitud); 00077 tError ejecutarInstTipoSB(void); 00078 tError ejecutarInstTipoSH(void); 00079 tError ejecutarInstTipoSW(void); 00080 tError ejecutarInstTipoREGIMM(void); 00081 tError ejecutarInstTipoBNEL(void); 00082 tError ejecutarInstTipoBEQL(void); 00083 tError ejecutarInstTipoBLEZL(void); 00084 tError ejecutarInstTipoBGTZL(void); 00085 00086 // Ciclo de instrucciones 00087 tError recoger(void); 00088 tError decodificar(void); 00089 00090 public: 00091 // Constructores/destructor 00092 cAllegrex(); 00093 ~cAllegrex(); 00094 00095 // Manejo del procesador 00096 tError ejecutarCiclo(void); 00097 tError encender(void); 00098 tError parar(void); 00099 tError reiniciar(void); 00100 tError apagar(void); 00101 00102 // Estado del procesador 00103 bool estaEncendido(void); 00104 bool estaEjecutando(void); 00105 00106 // Interconexión 00107 tError ponerControladorMemoria(cControladorMemoria* controlador); 00108 }; 00109 00110 00111 #endif /* CALLEGREX_H_ */