cleanups
This commit is contained in:
parent
a926a68eb3
commit
f10da5d664
6 changed files with 0 additions and 107 deletions
4
common.h
4
common.h
|
@ -214,8 +214,4 @@ typedef u32 fixed8_24;
|
||||||
#include "arm/warm.h"
|
#include "arm/warm.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PSP_BUILD
|
|
||||||
#define printf pspDebugScreenPrintf
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
53
main.c
53
main.c
|
@ -20,21 +20,11 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#ifdef PSP_BUILD
|
|
||||||
void vblank_interrupt_handler(u32 sub, u32 *parg);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
timer_type timer[4];
|
timer_type timer[4];
|
||||||
|
|
||||||
frameskip_type current_frameskip_type = auto_frameskip;
|
|
||||||
u32 global_cycles_per_instruction = 1;
|
u32 global_cycles_per_instruction = 1;
|
||||||
|
|
||||||
u64 last_frame_interval_timestamp;
|
|
||||||
|
|
||||||
u32 frameskip_counter = 0;
|
|
||||||
|
|
||||||
u32 cpu_ticks = 0;
|
u32 cpu_ticks = 0;
|
||||||
u32 frame_ticks = 0;
|
|
||||||
|
|
||||||
u32 execute_cycles = 960;
|
u32 execute_cycles = 960;
|
||||||
s32 video_count = 960;
|
s32 video_count = 960;
|
||||||
|
@ -123,7 +113,6 @@ void init_main()
|
||||||
timer[1].direct_sound_channels = TIMER_DS_CHANNEL_NONE;
|
timer[1].direct_sound_channels = TIMER_DS_CHANNEL_NONE;
|
||||||
|
|
||||||
cpu_ticks = 0;
|
cpu_ticks = 0;
|
||||||
frame_ticks = 0;
|
|
||||||
|
|
||||||
execute_cycles = 960;
|
execute_cycles = 960;
|
||||||
video_count = 960;
|
video_count = 960;
|
||||||
|
@ -133,32 +122,6 @@ void init_main()
|
||||||
flush_translation_cache_bios();
|
flush_translation_cache_bios();
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_memory_stats(u32 *counter, u32 *region_stats, char *stats_str)
|
|
||||||
{
|
|
||||||
u32 other_region_counter = region_stats[0x1] + region_stats[0xE] +
|
|
||||||
region_stats[0xF];
|
|
||||||
u32 rom_region_counter = region_stats[0x8] + region_stats[0x9] +
|
|
||||||
region_stats[0xA] + region_stats[0xB] + region_stats[0xC] +
|
|
||||||
region_stats[0xD];
|
|
||||||
u32 _counter = *counter;
|
|
||||||
|
|
||||||
printf("memory access stats: %s (out of %d)\n", stats_str, _counter);
|
|
||||||
printf("bios: %f%%\tiwram: %f%%\tewram: %f%%\tvram: %f\n",
|
|
||||||
region_stats[0x0] * 100.0 / _counter, region_stats[0x3] * 100.0 /
|
|
||||||
_counter,
|
|
||||||
region_stats[0x2] * 100.0 / _counter, region_stats[0x6] * 100.0 /
|
|
||||||
_counter);
|
|
||||||
|
|
||||||
printf("oam: %f%%\tpalette: %f%%\trom: %f%%\tother: %f%%\n",
|
|
||||||
region_stats[0x7] * 100.0 / _counter, region_stats[0x5] * 100.0 /
|
|
||||||
_counter,
|
|
||||||
rom_region_counter * 100.0 / _counter, other_region_counter * 100.0 /
|
|
||||||
_counter);
|
|
||||||
|
|
||||||
*counter = 0;
|
|
||||||
memset(region_stats, 0, sizeof(u32) * 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
u32 no_alpha = 0;
|
u32 no_alpha = 0;
|
||||||
|
|
||||||
u32 update_gba()
|
u32 update_gba()
|
||||||
|
@ -257,7 +220,6 @@ u32 update_gba()
|
||||||
{
|
{
|
||||||
// Transition from vblank to next screen
|
// Transition from vblank to next screen
|
||||||
dispstat &= ~0x01;
|
dispstat &= ~0x01;
|
||||||
frame_ticks++;
|
|
||||||
|
|
||||||
/* printf("frame update (%x), %d instructions total, %d RAM flushes\n",
|
/* printf("frame update (%x), %d instructions total, %d RAM flushes\n",
|
||||||
reg[REG_PC], instruction_count - last_frame, flush_ram_count);
|
reg[REG_PC], instruction_count - last_frame, flush_ram_count);
|
||||||
|
@ -320,21 +282,6 @@ void reset_gba()
|
||||||
reset_sound();
|
reset_sound();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PSP_BUILD
|
|
||||||
void delay_us(u32 us_count)
|
|
||||||
{
|
|
||||||
sceKernelDelayThread(us_count);
|
|
||||||
}
|
|
||||||
|
|
||||||
void get_ticks_us(u64 *tick_return)
|
|
||||||
{
|
|
||||||
u64 ticks;
|
|
||||||
sceRtcGetCurrentTick(&ticks);
|
|
||||||
|
|
||||||
*tick_return = (ticks * 1000000) / sceRtcGetTickResolution();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
u32 file_length(const char *dummy, FILE *fp)
|
u32 file_length(const char *dummy, FILE *fp)
|
||||||
{
|
{
|
||||||
#ifdef PSP_BUILD
|
#ifdef PSP_BUILD
|
||||||
|
|
12
main.h
12
main.h
|
@ -54,18 +54,8 @@ typedef struct
|
||||||
timer_status_type status;
|
timer_status_type status;
|
||||||
} timer_type;
|
} timer_type;
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
auto_frameskip,
|
|
||||||
manual_frameskip,
|
|
||||||
no_frameskip
|
|
||||||
} frameskip_type;
|
|
||||||
|
|
||||||
extern u32 cpu_ticks;
|
extern u32 cpu_ticks;
|
||||||
extern u32 frame_ticks;
|
|
||||||
extern u32 execute_cycles;
|
extern u32 execute_cycles;
|
||||||
extern frameskip_type current_frameskip_type;
|
|
||||||
extern u32 frameskip_value;
|
|
||||||
extern u32 global_cycles_per_instruction;
|
extern u32 global_cycles_per_instruction;
|
||||||
|
|
||||||
extern u32 cycle_memory_access;
|
extern u32 cycle_memory_access;
|
||||||
|
@ -88,8 +78,6 @@ void reset_gba();
|
||||||
|
|
||||||
void init_main();
|
void init_main();
|
||||||
|
|
||||||
void delay_us(u32 us_count);
|
|
||||||
void get_ticks_us(u64 *tick_return);
|
|
||||||
void game_name_ext(char *src, char *buffer, char *extension);
|
void game_name_ext(char *src, char *buffer, char *extension);
|
||||||
void main_write_savestate(void);
|
void main_write_savestate(void);
|
||||||
void main_read_savestate(void);
|
void main_read_savestate(void);
|
||||||
|
|
6
sound.c
6
sound.c
|
@ -587,12 +587,6 @@ void reset_sound()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sound_exit()
|
|
||||||
{
|
|
||||||
gbc_sound_buffer_index =
|
|
||||||
(sound_buffer_base + audio_buffer_size) % BUFFER_SIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void init_sound(int need_reset)
|
void init_sound(int need_reset)
|
||||||
{
|
{
|
||||||
gbc_sound_tick_step =
|
gbc_sound_tick_step =
|
||||||
|
|
9
video.c
9
video.c
|
@ -3140,10 +3140,6 @@ render_scanline_window_builder(bitmap);
|
||||||
|
|
||||||
static const u32 active_layers[6] = { 0x1F, 0x17, 0x1C, 0x14, 0x14, 0x14 };
|
static const u32 active_layers[6] = { 0x1F, 0x17, 0x1C, 0x14, 0x14, 0x14 };
|
||||||
|
|
||||||
u32 small_resolution_width = 240;
|
|
||||||
u32 small_resolution_height = 160;
|
|
||||||
u32 resolution_width, resolution_height;
|
|
||||||
|
|
||||||
void update_scanline()
|
void update_scanline()
|
||||||
{
|
{
|
||||||
u32 pitch = get_screen_pitch();
|
u32 pitch = get_screen_pitch();
|
||||||
|
@ -3195,11 +3191,6 @@ void update_scanline()
|
||||||
affine_reference_y[1] += (s16)io_registers[REG_BG3PD];
|
affine_reference_y[1] += (s16)io_registers[REG_BG3PD];
|
||||||
}
|
}
|
||||||
|
|
||||||
video_scale_type screen_scale = scaled_aspect;
|
|
||||||
video_scale_type current_scale = scaled_aspect;
|
|
||||||
video_filter_type screen_filter = filter_bilinear;
|
|
||||||
|
|
||||||
|
|
||||||
#define video_savestate_builder(type) \
|
#define video_savestate_builder(type) \
|
||||||
void video_##type##_savestate(void) \
|
void video_##type##_savestate(void) \
|
||||||
{ \
|
{ \
|
||||||
|
|
23
video.h
23
video.h
|
@ -21,17 +21,9 @@
|
||||||
#define VIDEO_H
|
#define VIDEO_H
|
||||||
|
|
||||||
void update_scanline();
|
void update_scanline();
|
||||||
void init_video();
|
|
||||||
void video_resolution_large();
|
|
||||||
void video_resolution_small();
|
|
||||||
void clear_screen(u16 color);
|
|
||||||
void video_write_savestate(void);
|
void video_write_savestate(void);
|
||||||
void video_read_savestate(void);
|
void video_read_savestate(void);
|
||||||
|
|
||||||
extern u32 frame_speed;
|
|
||||||
|
|
||||||
extern u32 resolution_width, resolution_height;
|
|
||||||
|
|
||||||
extern s32 affine_reference_x[2];
|
extern s32 affine_reference_x[2];
|
||||||
extern s32 affine_reference_y[2];
|
extern s32 affine_reference_y[2];
|
||||||
|
|
||||||
|
@ -56,27 +48,12 @@ typedef struct
|
||||||
bitmap_render_function normal_render;
|
bitmap_render_function normal_render;
|
||||||
} bitmap_layer_render_struct;
|
} bitmap_layer_render_struct;
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
unscaled,
|
|
||||||
scaled_aspect,
|
|
||||||
fullscreen,
|
|
||||||
} video_scale_type;
|
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
filter_nearest,
|
filter_nearest,
|
||||||
filter_bilinear
|
filter_bilinear
|
||||||
} video_filter_type;
|
} video_filter_type;
|
||||||
|
|
||||||
extern video_scale_type screen_scale;
|
|
||||||
extern video_scale_type current_scale;
|
|
||||||
extern video_filter_type screen_filter;
|
|
||||||
|
|
||||||
void set_gba_resolution(video_scale_type scale);
|
|
||||||
|
|
||||||
#ifdef __LIBRETRO__
|
|
||||||
extern u16 gba_screen_pixels[GBA_SCREEN_PITCH * GBA_SCREEN_HEIGHT];
|
extern u16 gba_screen_pixels[GBA_SCREEN_PITCH * GBA_SCREEN_HEIGHT];
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue