mirror of https://github.com/LIJI32/SameBoy.git
Move things around some more
This commit is contained in:
parent
fe2c868d6c
commit
b4fc2ff7ba
|
@ -2432,3 +2432,33 @@ bool GB_is_background_rendering_disabled(GB_gameboy_t *gb)
|
||||||
return gb->background_disabled;
|
return gb->background_disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned GB_get_screen_width(GB_gameboy_t *gb)
|
||||||
|
{
|
||||||
|
switch (gb->border_mode) {
|
||||||
|
default:
|
||||||
|
case GB_BORDER_SGB:
|
||||||
|
return GB_is_hle_sgb(gb)? 256 : 160;
|
||||||
|
case GB_BORDER_NEVER:
|
||||||
|
return 160;
|
||||||
|
case GB_BORDER_ALWAYS:
|
||||||
|
return 256;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned GB_get_screen_height(GB_gameboy_t *gb)
|
||||||
|
{
|
||||||
|
switch (gb->border_mode) {
|
||||||
|
default:
|
||||||
|
case GB_BORDER_SGB:
|
||||||
|
return GB_is_hle_sgb(gb)? 224 : 144;
|
||||||
|
case GB_BORDER_NEVER:
|
||||||
|
return 144;
|
||||||
|
case GB_BORDER_ALWAYS:
|
||||||
|
return 224;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
double GB_get_usual_frame_rate(GB_gameboy_t *gb)
|
||||||
|
{
|
||||||
|
return GB_get_clock_rate(gb) / (double)LCDC_PERIOD;
|
||||||
|
}
|
||||||
|
|
|
@ -102,6 +102,10 @@ void GB_set_color_correction_mode(GB_gameboy_t *gb, GB_color_correction_mode_t m
|
||||||
void GB_set_light_temperature(GB_gameboy_t *gb, double temperature);
|
void GB_set_light_temperature(GB_gameboy_t *gb, double temperature);
|
||||||
void GB_set_pixels_output(GB_gameboy_t *gb, uint32_t *output);
|
void GB_set_pixels_output(GB_gameboy_t *gb, uint32_t *output);
|
||||||
|
|
||||||
|
unsigned GB_get_screen_width(GB_gameboy_t *gb);
|
||||||
|
unsigned GB_get_screen_height(GB_gameboy_t *gb);
|
||||||
|
double GB_get_usual_frame_rate(GB_gameboy_t *gb);
|
||||||
|
|
||||||
bool GB_is_odd_frame(GB_gameboy_t *gb);
|
bool GB_is_odd_frame(GB_gameboy_t *gb);
|
||||||
uint32_t GB_convert_rgb15(GB_gameboy_t *gb, uint16_t color, bool for_border);
|
uint32_t GB_convert_rgb15(GB_gameboy_t *gb, uint16_t color, bool for_border);
|
||||||
|
|
||||||
|
|
36
Core/gb.c
36
Core/gb.c
|
@ -1936,42 +1936,6 @@ void GB_set_border_mode(GB_gameboy_t *gb, GB_border_mode_t border_mode)
|
||||||
gb->border_mode = border_mode;
|
gb->border_mode = border_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned GB_get_screen_width(GB_gameboy_t *gb)
|
|
||||||
{
|
|
||||||
switch (gb->border_mode) {
|
|
||||||
default:
|
|
||||||
case GB_BORDER_SGB:
|
|
||||||
return GB_is_hle_sgb(gb)? 256 : 160;
|
|
||||||
case GB_BORDER_NEVER:
|
|
||||||
return 160;
|
|
||||||
case GB_BORDER_ALWAYS:
|
|
||||||
return 256;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned GB_get_screen_height(GB_gameboy_t *gb)
|
|
||||||
{
|
|
||||||
switch (gb->border_mode) {
|
|
||||||
default:
|
|
||||||
case GB_BORDER_SGB:
|
|
||||||
return GB_is_hle_sgb(gb)? 224 : 144;
|
|
||||||
case GB_BORDER_NEVER:
|
|
||||||
return 144;
|
|
||||||
case GB_BORDER_ALWAYS:
|
|
||||||
return 224;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned GB_get_player_count(GB_gameboy_t *gb)
|
|
||||||
{
|
|
||||||
return GB_is_hle_sgb(gb)? gb->sgb->player_count : 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
double GB_get_usual_frame_rate(GB_gameboy_t *gb)
|
|
||||||
{
|
|
||||||
return GB_get_clock_rate(gb) / (double)LCDC_PERIOD;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GB_set_joyp_write_callback(GB_gameboy_t *gb, GB_joyp_write_callback_t callback)
|
void GB_set_joyp_write_callback(GB_gameboy_t *gb, GB_joyp_write_callback_t callback)
|
||||||
{
|
{
|
||||||
if (!callback) {
|
if (!callback) {
|
||||||
|
|
|
@ -990,11 +990,6 @@ uint32_t GB_get_clock_rate(GB_gameboy_t *gb);
|
||||||
uint32_t GB_get_unmultiplied_clock_rate(GB_gameboy_t *gb);
|
uint32_t GB_get_unmultiplied_clock_rate(GB_gameboy_t *gb);
|
||||||
void GB_set_clock_multiplier(GB_gameboy_t *gb, double multiplier);
|
void GB_set_clock_multiplier(GB_gameboy_t *gb, double multiplier);
|
||||||
|
|
||||||
unsigned GB_get_screen_width(GB_gameboy_t *gb);
|
|
||||||
unsigned GB_get_screen_height(GB_gameboy_t *gb);
|
|
||||||
double GB_get_usual_frame_rate(GB_gameboy_t *gb);
|
|
||||||
unsigned GB_get_player_count(GB_gameboy_t *gb);
|
|
||||||
|
|
||||||
/* Handy ROM info APIs */
|
/* Handy ROM info APIs */
|
||||||
// `title` must be at least 17 bytes in size
|
// `title` must be at least 17 bytes in size
|
||||||
void GB_get_rom_title(GB_gameboy_t *gb, char *title);
|
void GB_get_rom_title(GB_gameboy_t *gb, char *title);
|
||||||
|
|
|
@ -909,3 +909,7 @@ static void render_jingle(GB_gameboy_t *gb, size_t count)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned GB_get_player_count(GB_gameboy_t *gb)
|
||||||
|
{
|
||||||
|
return GB_is_hle_sgb(gb)? gb->sgb->player_count : 1;
|
||||||
|
}
|
||||||
|
|
|
@ -67,3 +67,4 @@ internal void GB_sgb_render(GB_gameboy_t *gb);
|
||||||
internal void GB_sgb_load_default_data(GB_gameboy_t *gb);
|
internal void GB_sgb_load_default_data(GB_gameboy_t *gb);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
unsigned GB_get_player_count(GB_gameboy_t *gb);
|
||||||
|
|
Loading…
Reference in New Issue