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
4efa19d5
Unverified
Commit
4efa19d5
authored
Nov 16, 2021
by
Libretro-Admin
Committed by
GitHub
Nov 16, 2021
Browse files
Merge pull request #64 from cayce-msx/support-screen-6-and-7
support screen 6 & 7 (512px wide)
parents
9287a971
0642dbd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
libretro.c
View file @
4efa19d5
...
...
@@ -27,8 +27,11 @@ extern int RAMPages ;
#define SND_RATE 48000
#define WIDTH 272
#define HEIGHT 228
// in screen mode 6 & 7 (512px wide), Wide.h doubles WIDTH
#define BORDER 8
#define WIDTH (256+(BORDER<<1))
#define HEIGHT (212+(BORDER<<1))
#ifdef PSP
#define PIXEL(R,G,B) (pixel)(((31*(B)/255)<<11)|((63*(G)/255)<<5)|(31*(R)/255))
#elif defined(PS2)
...
...
@@ -595,9 +598,36 @@ static void check_variables(void)
update_fps
();
}
bool
retro_load_game
(
const
struct
retro_game_info
*
info
)
void
set_image_buffer_size
(
byte
screen_mode
)
{
static
Image
fMSX_image
;
if
((
screen_mode
==
6
)
||
(
screen_mode
==
7
)
||
(
screen_mode
==
MAXSCREEN
+
1
))
image_buffer_width
=
WIDTH
<<
1
;
else
image_buffer_width
=
WIDTH
;
image_buffer_height
=
HEIGHT
;
fMSX_image
.
Cropped
=
0
;
#if defined(BPP24)
fMSX_image
.
D
=
24
;
#elif defined(BPP16)
fMSX_image
.
D
=
16
;
#elif defined(BPP8)
fMSX_image
.
D
=
8
;
#else
fMSX_image
.
D
=
32
;
#endif
fMSX_image
.
Data
=
image_buffer
;
fMSX_image
.
W
=
image_buffer_width
;
fMSX_image
.
H
=
image_buffer_height
;
fMSX_image
.
L
=
image_buffer_width
;
GenericSetVideo
(
&
fMSX_image
,
0
,
0
,
image_buffer_width
,
image_buffer_height
);
}
bool
retro_load_game
(
const
struct
retro_game_info
*
info
)
{
int
i
;
static
char
ROMName_buffer
[
MAXCARTS
][
1024
];
static
char
DSKName_buffer
[
MAXDRIVES
][
1024
];
...
...
@@ -612,8 +642,6 @@ bool retro_load_game(const struct retro_game_info *info)
}
image_buffer
=
(
uint16_t
*
)
malloc
(
640
*
480
*
sizeof
(
uint16_t
));
image_buffer_width
=
272
;
image_buffer_height
=
228
;
environ_cb
(
RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY
,
&
ProgDir
);
...
...
@@ -650,17 +678,9 @@ bool retro_load_game(const struct retro_game_info *info)
CasName
=
NULL
;
}
SETJOYTYPE
(
0
,
1
);
fMSX_image
.
Cropped
=
0
;
fMSX_image
.
D
=
16
;
fMSX_image
.
Data
=
image_buffer
;
fMSX_image
.
W
=
image_buffer_width
;
fMSX_image
.
H
=
image_buffer_height
;
fMSX_image
.
L
=
image_buffer_width
;
GenericSetVideo
(
&
fMSX_image
,
0
,
0
,
image_buffer_width
,
image_buffer_height
);
set_image_buffer_size
(
0
);
for
(
i
=
0
;
i
<
80
;
i
++
)
SetColor
(
i
,
0
,
0
,
0
);
...
...
@@ -842,9 +862,12 @@ void retro_run(void)
JOY_SET
(
joymap
[
i
].
fmsx
,
1
);
}
byte
currentScreenMode
=
ScrMode
;
RunZ80
(
&
CPU
);
RenderAndPlayAudio
(
SND_RATE
/
fps
);
if
(
currentScreenMode
!=
ScrMode
)
{
set_image_buffer_size
(
ScrMode
);
}
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