PSP-EMU rev 57
Un emulador en c++ para SONY PSP

general_emu.h

Ir a la documentación de este archivo.
00001 
00009 #ifndef GENERAL_EMU_H_
00010 #define GENERAL_EMU_H_
00011 
00012 #include <iostream>
00013 #include <fstream>
00014 #include <sys/types.h>
00015 #include <sys/stat.h>
00016 #include <unistd.h>
00017 
00018 using namespace std;
00019 
00020 /* GENÉRICOS */
00021 
00022 typedef unsigned char tByte;
00023 typedef unsigned short int tHalfWord;
00024 typedef unsigned int tWord;
00025 
00026 #define VALOR_DEFECTO 0xDEADBEEF
00027 #define NO_INDICE -1
00028 
00033 typedef enum
00034 {
00035         ERR_OK,
00036         ERR_PUNTERO_NULL,
00037         ERR_COMP_DESCONOCIDO,
00038         ERR_CPU_NO_PREPARADA,
00039         ERR_CPU_YA_ARRANCADA,
00040         ERR_CPU_SIN_MEMORIA,
00041         ERR_CPU_COD_OP_GRUESO,
00042         ERR_CPU_INSTR_DESCONOCIDA,
00043         ERR_CPU_NO_ALINEADO,
00044         ERR_MEM_DIRECCION_INVALIDA,
00045         ERR_MEM_NO_SE_PUDO_RESERVAR,
00046         ERR_MEM_LONGITUD_INVALIDA,
00047         ERR_MEM_MAX_BLOQUES,
00048         ERR_MAP_MAX_MAPAS,
00049         ERR_MAP_DIRECCION_BASE,
00050         ERR_MAP_COMPONENTE,
00051         ERR_MAP_LONGITUD,
00052         ERR_MAP_DIRECCION_FIN,
00053         ERR_MAP_VALIDACION,
00054         ERR_FICH_NO_ENCONTRADO,
00055         ERR_LIB_LONG_DESCONOCIDA
00056 } tError;
00057 
00058 /* DIRECCIONES */
00059 
00060 typedef unsigned int tDireccion;
00061 
00062 #define MAX_DIRECCION 0xFFFFFFFF
00063 
00064 /* DATOS */
00065 
00066 typedef unsigned int tDato;
00067 
00068 /* TAMAÑO */
00069 
00070 typedef unsigned int tLongitud;
00071 
00072 /* COMPONENTES */
00073 
00074 typedef enum
00075 {
00076         COMP_NINGUNO,
00077         COMP_CPU,
00078         COMP_MEMORIA,
00079         COMP_VRAM
00080 } tComponente;
00081 
00082 /* MAPA DE MEMORIA */
00083 
00084 // ROM interna de arranque
00085 #define MAPMEM_EMROM_DIR        0xBFC00000
00086 #define MAPMEM_EMROM_LONG       0x00001000 // 4 KiB
00087 
00088 // Scratchpad
00089 #define MAPMEM_SCRATCH_DIR      0x00010000
00090 #define MAPMEM_SCRATCH_LONG     0x00001000 // 4 KiB
00091 
00092 // Memoria de usuario
00093 #define MAPMEM_USUARIO_DIR      0x08800000
00094 #define MAPMEM_USUARIO_LONG 0x01800000 // 24 MiB
00095 
00096 // Memoria kernel
00097 #define MAPMEM_KERNEL_DIR       0x88000000
00098 #define MAPMEM_KERNEL_LONG      0x00800000 // 8 MiB
00099 
00100 /* PRE-IPL */
00101 #define RUTA_PRE_IPL "./boot/preipl.bin"
00102 
00103 #endif /* GENERAL_EMU_H_ */
 Todo Clases Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones 'defines'