Reenable native file IO on PSP
This commit is contained in:
parent
32eb4538c1
commit
89e55e9902
14
common.h
14
common.h
|
@ -49,7 +49,7 @@
|
||||||
// Huge thanks to pollux for the heads up on using native file I/O
|
// Huge thanks to pollux for the heads up on using native file I/O
|
||||||
// functions on PSP for vastly improved memstick performance.
|
// functions on PSP for vastly improved memstick performance.
|
||||||
|
|
||||||
#ifdef PSP_BUILD
|
#ifdef PSP
|
||||||
#define fastcall
|
#define fastcall
|
||||||
|
|
||||||
#include <pspkernel.h>
|
#include <pspkernel.h>
|
||||||
|
@ -90,12 +90,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define GBA_SCREEN_WIDTH (240)
|
|
||||||
#define GBA_SCREEN_HEIGHT (160)
|
|
||||||
#define GBA_SCREEN_PITCH (240)
|
|
||||||
|
|
||||||
void switch_to_main_thread(void);
|
|
||||||
|
|
||||||
typedef unsigned char u8;
|
typedef unsigned char u8;
|
||||||
typedef signed char s8;
|
typedef signed char s8;
|
||||||
typedef unsigned short int u16;
|
typedef unsigned short int u16;
|
||||||
|
@ -133,6 +127,12 @@ void switch_to_main_thread(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define GBA_SCREEN_WIDTH (240)
|
||||||
|
#define GBA_SCREEN_HEIGHT (160)
|
||||||
|
#define GBA_SCREEN_PITCH (240)
|
||||||
|
|
||||||
|
void switch_to_main_thread(void);
|
||||||
|
|
||||||
// These must be variables, not constants.
|
// These must be variables, not constants.
|
||||||
|
|
||||||
#define file_read_variable(filename_tag, variable) \
|
#define file_read_variable(filename_tag, variable) \
|
||||||
|
|
2
cpu.h
2
cpu.h
|
@ -119,7 +119,7 @@ s32 translate_block_arm(u32 pc, translation_region_type translation_region,
|
||||||
s32 translate_block_thumb(u32 pc, translation_region_type translation_region,
|
s32 translate_block_thumb(u32 pc, translation_region_type translation_region,
|
||||||
u32 smc_enable);
|
u32 smc_enable);
|
||||||
|
|
||||||
#if defined(PSP_BUILD)
|
#if defined(PSP)
|
||||||
|
|
||||||
#define ROM_TRANSLATION_CACHE_SIZE (1024 * 512 * 4)
|
#define ROM_TRANSLATION_CACHE_SIZE (1024 * 512 * 4)
|
||||||
#define RAM_TRANSLATION_CACHE_SIZE (1024 * 384)
|
#define RAM_TRANSLATION_CACHE_SIZE (1024 * 384)
|
||||||
|
|
|
@ -343,7 +343,7 @@ gamepak_swap_entry_type *gamepak_memory_map;
|
||||||
// This is global so that it can be kept open for large ROMs to swap
|
// This is global so that it can be kept open for large ROMs to swap
|
||||||
// pages from, so there's no slowdown with opening and closing the file
|
// pages from, so there's no slowdown with opening and closing the file
|
||||||
// a lot.
|
// a lot.
|
||||||
#ifdef PSP_BUILD
|
#ifdef PSP
|
||||||
|
|
||||||
file_tag_type gamepak_file_large = -1;
|
file_tag_type gamepak_file_large = -1;
|
||||||
|
|
||||||
|
@ -2391,9 +2391,7 @@ static s32 load_game_config(char *gamepak_title, char *gamepak_code, char *gamep
|
||||||
fclose(config_file);
|
fclose(config_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PSP_BUILD
|
|
||||||
printf("game config missing\n");
|
printf("game config missing\n");
|
||||||
#endif
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2418,7 +2416,7 @@ static s32 load_gamepak_raw(const char *name)
|
||||||
|
|
||||||
file_close(gamepak_file);
|
file_close(gamepak_file);
|
||||||
|
|
||||||
#ifdef PSP_BUILD
|
#ifdef PSP
|
||||||
gamepak_file_large = -1;
|
gamepak_file_large = -1;
|
||||||
#else
|
#else
|
||||||
gamepak_file_large = NULL;
|
gamepak_file_large = NULL;
|
||||||
|
|
6
main.c
6
main.c
|
@ -280,13 +280,15 @@ void reset_gba(void)
|
||||||
reset_sound();
|
reset_sound();
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 file_length(const char *dummy, FILE *fp)
|
#ifdef PSP
|
||||||
|
u32 file_length(const char *filename, s32 dummy)
|
||||||
{
|
{
|
||||||
#ifdef PSP_BUILD
|
|
||||||
SceIoStat stats;
|
SceIoStat stats;
|
||||||
sceIoGetstat(filename, &stats);
|
sceIoGetstat(filename, &stats);
|
||||||
return stats.st_size;
|
return stats.st_size;
|
||||||
#else
|
#else
|
||||||
|
u32 file_length(const char *dummy, FILE *fp)
|
||||||
|
{
|
||||||
u32 length;
|
u32 length;
|
||||||
|
|
||||||
fseek(fp, 0, SEEK_END);
|
fseek(fp, 0, SEEK_END);
|
||||||
|
|
4
main.h
4
main.h
|
@ -83,8 +83,8 @@ void main_write_savestate(void);
|
||||||
void main_read_savestate(void);
|
void main_read_savestate(void);
|
||||||
|
|
||||||
|
|
||||||
#ifdef PSP_BUILD
|
#ifdef PSP
|
||||||
u32 file_length(char *filename, s32 dummy);
|
u32 file_length(const char *filename, s32 dummy);
|
||||||
#else
|
#else
|
||||||
u32 file_length(const char *dummy, FILE *fp);
|
u32 file_length(const char *dummy, FILE *fp);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue