Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
Fmsx
Commits
fc676f2c
Commit
fc676f2c
authored
Aug 04, 2018
by
Carlos Herrero
Browse files
Fixed framerate depending on selected MSX Video Mode (50 fps for PAL, 60 fps for NTSC)
parent
d170d296
Changes
1
Hide whitespace changes
Inline
Side-by-side
libretro.c
View file @
fc676f2c
...
...
@@ -10,6 +10,7 @@
#include "EMULib.h"
#include "Sound.h"
static
uint
fps
;
static
uint16_t
*
image_buffer
;
static
unsigned
image_buffer_width
;
static
unsigned
image_buffer_height
;
...
...
@@ -263,7 +264,7 @@ void retro_get_system_av_info(struct retro_system_av_info *info)
info
->
geometry
.
max_width
=
640
;
info
->
geometry
.
max_height
=
480
;
info
->
geometry
.
aspect_ratio
=
0
;
info
->
timing
.
fps
=
60
.
0
;
info
->
timing
.
fps
=
fps
;
info
->
timing
.
sample_rate
=
SND_RATE
;
}
...
...
@@ -420,10 +421,14 @@ void retro_set_input_poll(retro_input_poll_t cb) { input_poll_cb = cb; }
void
retro_set_input_state
(
retro_input_state_t
cb
)
{
input_state_cb
=
cb
;
}
void
retro_set_audio_sample_batch
(
retro_audio_sample_batch_t
cb
)
{
audio_batch_cb
=
cb
;
}
static
void
update_fps
(
void
)
{
fps
=
(
Mode
&
MSX_PAL
)
?
50
:
60
;
}
void
retro_reset
(
void
)
{
ResetMSX
(
Mode
,
RAMPages
,
VRAMPages
);
update_fps
();
}
size_t
retro_serialize_size
(
void
)
...
...
@@ -567,6 +572,8 @@ static void check_variables(void)
{
VRAMPages
=
ModeVRAM
;
}
update_fps
();
}
bool
retro_load_game
(
const
struct
retro_game_info
*
info
)
...
...
@@ -649,6 +656,7 @@ bool retro_load_game(const struct retro_game_info *info)
ExitNow
=
1
;
StartMSX
(
Mode
,
RAMPages
,
VRAMPages
);
update_fps
();
printf
(
"Mode %i, RAMPages %i, VRAMPages %i"
,
Mode
,
RAMPages
,
VRAMPages
);
return
true
;
}
...
...
@@ -795,7 +803,7 @@ void retro_run(void)
RunZ80
(
&
CPU
);
RenderAndPlayAudio
(
SND_RATE
/
60
);
RenderAndPlayAudio
(
SND_RATE
/
fps
);
fflush
(
stdout
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment