typedef signed char s8;
typedef unsigned short int u16;
typedef signed short int s16;
- typedef unsigned long u32;
- typedef signed long s32;
+ typedef unsigned int u32;
+ typedef signed int s32;
typedef unsigned long long int u64;
typedef signed long long int s64;
char buffer[256]; \
sprintf(buffer, "bad jump %x (%x) (%x)\n", pc, reg[REG_PC], \
last_instruction); \
- printf(buffer); \
+ printf("%s", buffer); \
quit(); \
} \
block_address = (u8 *)(-1); \
invalidate_icache_region(ram_translation_cache,
(ram_translation_ptr - ram_translation_cache) + 0x100);
#endif
- ram_translation_ptr = ram_translation_cache;
+#ifdef ARM_ARCH
last_ram_translation_ptr = ram_translation_cache;
+#endif
+ ram_translation_ptr = ram_translation_cache;
ram_block_tag_top = 0x0101;
if(iwram_code_min != 0xFFFFFFFF)
{
invalidate_icache_region(rom_translation_cache,
rom_translation_ptr - rom_translation_cache + 0x100);
#endif
+#ifdef ARM_ARCH
+ last_rom_translation_ptr = rom_translation_cache;
+#endif
rom_translation_ptr = rom_translation_cache;
- last_rom_translation_ptr = rom_translation_cache;
memset(rom_branch_hash, 0, sizeof(rom_branch_hash));
}
invalidate_icache_region(bios_translation_cache,
bios_translation_ptr - bios_translation_cache + 0x100);
#endif
+#ifdef ARM_ARCH
+ last_bios_translation_ptr = bios_translation_cache;
+#endif
bios_block_tag_top = 0x0101;
bios_translation_ptr = bios_translation_cache;
- last_bios_translation_ptr = bios_translation_cache;
memset(bios_rom + 0x4000, 0, 0x4000);
}
{
u8 config_path[512];
- #if (defined(PSP_BUILD) || defined(ARM_ARCH)) && !defined(_WIN32_WCE)
- sprintf(config_path, "%s/%s", main_path, GPSP_CONFIG_FILENAME);
- #else
+ #if defined(_WIN32) || defined(_WIN32_WCE)
sprintf(config_path, "%s\\%s", main_path, GPSP_CONFIG_FILENAME);
+ #else
+ sprintf(config_path, "%s/%s", main_path, GPSP_CONFIG_FILENAME);
#endif
file_open(config_file, config_path, read);
# Platform specific definitions
VPATH += ..
-CFLAGS += -DPC_BUILD
+CFLAGS += -DPC_BUILD -m32
INCLUDES = -I${PREFIX}/include `sdl-config --cflags`
-LIBS = -L${PREFIX}/lib `sdl-config --libs` -mconsole -lz
+LIBS = -L${PREFIX}/lib `sdl-config --libs` -mconsole -lz -m32
# Compilation:
${CC} ${CFLAGS} ${INCLUDES} -c -o $@ $<
%.o: %.S
- ${AS} -o $@ $<
+ ${CC} ${CFLAGS} -c -o $@ $<
all: ${OBJS}
${CC} ${OBJS} ${LIBS} -o ${BIN}
.align 4
+#ifndef _WIN32
+#define _x86_update_gba x86_update_gba
+#define _x86_indirect_branch_arm x86_indirect_branch_arm
+#define _x86_indirect_branch_thumb x86_indirect_branch_thumb
+#define _x86_indirect_branch_dual x86_indirect_branch_dual
+#define _execute_store_u8 execute_store_u8
+#define _execute_store_u16 execute_store_u16
+#define _execute_store_u32 execute_store_u32
+#define _execute_store_cpsr execute_store_cpsr
+#define _execute_arm_translate execute_arm_translate
+#define _step_debug_x86 step_debug_x86
+#define _memory_map_read memory_map_read
+#define _memory_map_write memory_map_write
+#define _reg reg
+#define _oam_update oam_update
+#define _iwram iwram
+#define _ewram ewram
+#define _vram vram
+#define _oam_ram oam_ram
+#define _bios_rom bios_rom
+#define _io_registers io_registers
+#define _spsr spsr
+
+#define _step_debug step_debug
+#define _update_gba update_gba
+#define _block_lookup_address_arm block_lookup_address_arm
+#define _block_lookup_address_thumb block_lookup_address_thumb
+#define _block_lookup_address_dual block_lookup_address_dual
+#define _write_io_register8 write_io_register8
+#define _write_io_register16 write_io_register16
+#define _write_io_register32 write_io_register32
+#define _palette_ram palette_ram
+#define _palette_ram_converted palette_ram_converted
+#define _flush_translation_cache_ram flush_translation_cache_ram
+#define _write_eeprom write_eeprom
+#define _write_backup write_backup
+#define _write_rtc write_rtc
+#define _execute_store_cpsr_body execute_store_cpsr_body
+#endif
+
.global _x86_update_gba
.global _x86_indirect_branch_arm
.global _x86_indirect_branch_thumb
mov REG_CPSR(%ebx), %edx
shr $\shift, %edx
and $0x01, %edx
- mov %edx, _reg + \offset
+ mov %edx, \offset(%ebx)
.endm
.macro extract_flags
# eax: cycle counter
_execute_arm_translate:
- movl $_reg, %ebx # load base register
+ movl (_reg), %ebx # load base register
extract_flags # load flag variables
movl %eax, %edi # load edi cycle counter
.comm _memory_map_read 0x8000
.comm _memory_map_write 0x8000
-.comm _reg 0x100
+.comm _reg 4