misc cleanup
This commit is contained in:
parent
db8bb987c8
commit
7c934dfcd2
5 changed files with 28 additions and 27 deletions
|
|
@ -112,6 +112,12 @@ struct owlfb_mem_info {
|
|||
|
||||
///////////////////////////////
|
||||
|
||||
uint32_t RGB_WHITE;
|
||||
uint32_t RGB_BLACK;
|
||||
uint32_t RGB_LIGHT_GRAY;
|
||||
uint32_t RGB_GRAY;
|
||||
uint32_t RGB_DARK_GRAY;
|
||||
|
||||
static struct GFX_Context {
|
||||
int mode;
|
||||
int fb;
|
||||
|
|
@ -276,6 +282,7 @@ void GFX_flip(SDL_Surface* screen) {
|
|||
static int ticks = 0;
|
||||
ticks += 1;
|
||||
#ifdef GFX_ENABLE_VSYNC
|
||||
// TODO: this condition doesn't make sense when using the threaded renderer
|
||||
#define FRAME_BUDGET 17 // 60fps
|
||||
if (frame_start==0 || SDL_GetTicks()-frame_start<FRAME_BUDGET) { // only wait if we're under frame budget
|
||||
int arg = 1;
|
||||
|
|
|
|||
|
|
@ -20,11 +20,11 @@ void LOG_note(int level, const char* fmt, ...);
|
|||
|
||||
///////////////////////////////
|
||||
|
||||
uint32_t RGB_WHITE;
|
||||
uint32_t RGB_BLACK;
|
||||
uint32_t RGB_LIGHT_GRAY;
|
||||
uint32_t RGB_GRAY;
|
||||
uint32_t RGB_DARK_GRAY;
|
||||
extern uint32_t RGB_WHITE;
|
||||
extern uint32_t RGB_BLACK;
|
||||
extern uint32_t RGB_LIGHT_GRAY;
|
||||
extern uint32_t RGB_GRAY;
|
||||
extern uint32_t RGB_DARK_GRAY;
|
||||
|
||||
enum {
|
||||
ASSET_WHITE_PILL,
|
||||
|
|
|
|||
|
|
@ -60,24 +60,12 @@
|
|||
#define COLOR_DARK_TEXT (SDL_Color){TRIAD_DARK_TEXT}
|
||||
#define COLOR_BUTTON_TEXT (SDL_Color){TRIAD_GRAY}
|
||||
|
||||
#define SCREEN_WIDTH 640
|
||||
#define SCREEN_HEIGHT 480
|
||||
#define SCREEN_SCALE 2 // SCREEN_HEIGHT / 240
|
||||
|
||||
#define BASE_WIDTH 320
|
||||
#define BASE_HEIGHT 240
|
||||
|
||||
// SNES (stretched to 4:3)
|
||||
// #define SCREEN_WIDTH 1024
|
||||
// #define SCREEN_HEIGHT 896
|
||||
|
||||
// GBA
|
||||
// #define SCREEN_WIDTH 960
|
||||
// #define SCREEN_HEIGHT 720
|
||||
|
||||
// GB converted to 4:3 with full height
|
||||
// #define SCREEN_WIDTH 768
|
||||
// #define SCREEN_HEIGHT 576
|
||||
#define SCREEN_WIDTH 640
|
||||
#define SCREEN_HEIGHT 480
|
||||
#define SCREEN_SCALE 2 // SCREEN_HEIGHT / 240
|
||||
|
||||
#define SCREEN_DEPTH 16
|
||||
#define SCREEN_BPP 2
|
||||
|
|
|
|||
|
|
@ -146,12 +146,10 @@ static struct Core {
|
|||
} core;
|
||||
|
||||
///////////////////////////////////////
|
||||
// saves and states
|
||||
|
||||
static void SRAM_getPath(char* filename) {
|
||||
sprintf(filename, "%s/%s.sav", core.saves_dir, game.name);
|
||||
}
|
||||
|
||||
static void SRAM_read(void) {
|
||||
size_t sram_size = core.get_memory_size(RETRO_MEMORY_SAVE_RAM);
|
||||
if (!sram_size) return;
|
||||
|
|
@ -196,11 +194,12 @@ static void SRAM_write(void) {
|
|||
sync();
|
||||
}
|
||||
|
||||
///////////////////////////////////////
|
||||
|
||||
static int state_slot = 0;
|
||||
static void State_getPath(char* filename) {
|
||||
sprintf(filename, "%s/%s.st%i", core.config_dir, game.name, state_slot);
|
||||
}
|
||||
|
||||
static void State_read(void) { // from picoarch
|
||||
size_t state_size = core.serialize_size();
|
||||
if (!state_size) return;
|
||||
|
|
@ -289,7 +288,9 @@ static void State_resume(void) {
|
|||
|
||||
///////////////////////////////
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
///////////////////////////////
|
||||
|
||||
// TODO: tmp, naive options
|
||||
static int tmp_options_changed = 0;
|
||||
|
|
@ -1857,6 +1858,10 @@ void Menu_loop(void) {
|
|||
}
|
||||
|
||||
int main(int argc , char* argv[]) {
|
||||
// force a stack overflow to ensure asan is linked and actually working
|
||||
// char tmp[2];
|
||||
// tmp[2] = 'a';
|
||||
|
||||
char core_path[MAX_PATH];
|
||||
char rom_path[MAX_PATH];
|
||||
char tag_name[MAX_PATH];
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ TARGET = minarch.elf
|
|||
CC = $(CROSS_COMPILE)gcc
|
||||
CFLAGS = -marm -mtune=cortex-a9 -mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv7-a -fomit-frame-pointer
|
||||
CFLAGS += -I. -I../common -I./libretro-common/include -DPLATFORM=\"$(UNION_PLATFORM)\" -Ofast # -Wall -Wno-unused-variable -Wno-unused-function
|
||||
LDFLAGS = -ldl -lSDL -lSDL_image -lSDL_ttf -lmsettings -lpthread
|
||||
# CFLAGS += -fsanitize=address -fno-common
|
||||
LDFLAGS = -ldl -lSDL -lSDL_image -lSDL_ttf -lmsettings -lpthread # -lasan
|
||||
|
||||
all:
|
||||
$(CC) main.c ../common/scaler_neon.c ../common/utils.c ../common/api.c -o $(TARGET) $(CFLAGS) $(LDFLAGS)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue