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
uae4arm-libretro
Commits
f0c47e54
Commit
f0c47e54
authored
May 23, 2015
by
Chips-fr
Browse files
Use specific texture for emulation instead of screen one
parent
b7ad2692
Changes
7
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
f0c47e54
...
...
@@ -7,7 +7,7 @@ NAME = uae4arm
O
=
o
RM
=
rm
-f
CXX
=
g++-4.8
#
STRIP = strip
STRIP
=
strip
#AS = as
PROG
=
$(NAME)
...
...
@@ -148,9 +148,11 @@ src/osdep/neon_helper.o: src/osdep/neon_helper.s
$(PROG)
:
$(OBJS)
$(CXX)
$(CFLAGS)
-o
$(PROG)
$(OBJS)
$(LDFLAGS)
ifndef
DEBUG
$(STRIP)
$(PROG)
endif
clean
:
$(RM)
$(PROG)
$(OBJS)
README.md
View file @
f0c47e54
# uae4arm-rpi
Port of uae4arm on Raspberry Pi
v0.2:
Merge latest TomB improvements from Pandora version (Zorro3 memory, picasso...).
v0.1:
Use dispmanX for fast scaling and double buffering.
Enable hat usage on joystick.
...
...
src/inputdevice.cpp
View file @
f0c47e54
...
...
@@ -208,7 +208,9 @@ void do_mouse_hack (void)
//------------------------------------------
// New stylus<->follow mouse mode
//------------------------------------------
#ifndef RASPBERRY
printf
(
"do_mouse_hack: sprvbfl=%d
\n
"
,
sprvbfl
);
#endif
if
(
sprvbfl
&&
(
sprvbfl
--
>
1
))
{
int
stylusxpos
,
stylusypos
;
...
...
src/od-pandora/inputmode.cpp
View file @
f0c47e54
...
...
@@ -66,10 +66,15 @@ void inputmode_redraw(void)
SDL_Rect
r
;
SDL_Surface
*
surface
;
#ifdef RASPBERRY
r
.
x
=
(
prSDLScreen
->
w
-
160
)
/
2
;
r
.
y
=
(
prSDLScreen
->
h
-
160
)
/
2
;
#else
r
.
x
=
80
;
r
.
y
=
prSDLScreen
->
h
-
200
;
r
.
w
=
160
;
r
.
h
=
160
;
#endif
if
(
inputMode
[
0
]
&&
inputMode
[
1
]
&&
inputMode
[
2
])
{
...
...
src/od-pandora/keyboard.cpp
View file @
f0c47e54
...
...
@@ -262,7 +262,7 @@ int keycode2amiga(SDL_keysym *prKeySym)
{
int
iAmigaKeycode
=
kc_decode
(
prKeySym
);
if
(
iAmigaKeycode
==
-
1
)
return
decode_
us
(
prKeySym
);
return
decode_
fr
(
prKeySym
);
return
iAmigaKeycode
;
}
...
...
src/od-pandora/pandora.cpp
View file @
f0c47e54
...
...
@@ -495,6 +495,10 @@ void setCpuSpeed()
{
char
speedCmd
[
128
];
#ifdef RASPBERRY
return
;
#endif
currprefs
.
pandora_cpu_speed
=
changed_prefs
.
pandora_cpu_speed
;
if
(
currprefs
.
pandora_cpu_speed
!=
lastCpuSpeed
)
...
...
@@ -516,6 +520,9 @@ void setCpuSpeed()
void
resetCpuSpeed
(
void
)
{
#ifdef RASPBERRY
return
;
#endif
if
(
cpuSpeedChanged
)
{
FILE
*
f
=
fopen
(
"/etc/pandora/conf/cpu.conf"
,
"rt"
);
...
...
@@ -652,7 +659,11 @@ void handle_events (void)
// back to start of state
currprefs
.
pandora_custom_dpad
++
;
#ifdef RASPBERRY
if
(
currprefs
.
pandora_custom_dpad
>
1
)
#else
if
(
currprefs
.
pandora_custom_dpad
>
2
)
#endif
currprefs
.
pandora_custom_dpad
=
0
;
changed_prefs
.
pandora_custom_dpad
=
currprefs
.
pandora_custom_dpad
;
if
(
currprefs
.
pandora_custom_dpad
==
2
)
...
...
src/od-rasp/rasp_gfx.cpp
View file @
f0c47e54
...
...
@@ -25,8 +25,10 @@
extern
int
stylusClickOverride
;
/* SDL variable for output of emulation
and menu
*/
/* SDL
surface
variable for output of emulation */
SDL_Surface
*
prSDLScreen
=
NULL
;
/* Dummy SDL variable for screen init */
SDL_Surface
*
Dummy_prSDLScreen
=
NULL
;
static
SDL_Surface
*
current_screenshot
=
NULL
;
/* Possible screen modes (x and y resolutions) */
#define MAX_SCREEN_MODES 6
...
...
@@ -133,8 +135,8 @@ void graphics_subshutdown (void)
if
(
dispmanxresource_amigafb_1
!=
0
)
graphics_dispmanshutdown
();
// Dunno if below lines are usefull for Rpi...
SDL_FreeSurface
(
prSDLScreen
);
prSDLScreen
=
NULL
;
//
SDL_FreeSurface(prSDLScreen);
//
prSDLScreen = NULL;
}
...
...
@@ -171,7 +173,6 @@ static void open_screen(struct uae_prefs *p)
if
(
screen_is_picasso
)
{
printf
(
"Picasso96 mode detected
\n
"
);
width
=
picasso_vidinfo
.
width
;
height
=
picasso_vidinfo
.
height
;
}
else
...
...
@@ -200,21 +201,26 @@ static void open_screen(struct uae_prefs *p)
snprintf
(
layersize
,
20
,
"%dx%d"
,
picasso_vidinfo
.
width
,
picasso_vidinfo
.
height
);
}
if
(
prSDLScreen
==
NULL
)
if
(
Dummy_prSDLScreen
==
NULL
)
{
const
SDL_VideoInfo
*
videoInfo
=
SDL_GetVideoInfo
();
printf
(
"DispmanX: Current resolution: %d x %d %d bpp
\n
"
,
videoInfo
->
current_w
,
videoInfo
->
current_h
,
videoInfo
->
vfmt
->
BitsPerPixel
);
prSDLScreen
=
SDL_SetVideoMode
(
videoInfo
->
current_w
,
videoInfo
->
current_h
,
16
,
SDL_SWSURFACE
|
SDL_FULLSCREEN
);
//prSDLScreen = SDL_SetVideoMode(800,480,16,SDL_SWSURFACE );
Dummy_
prSDLScreen
=
SDL_SetVideoMode
(
videoInfo
->
current_w
,
videoInfo
->
current_h
,
16
,
SDL_SWSURFACE
|
SDL_FULLSCREEN
);
//
Dummy_
prSDLScreen = SDL_SetVideoMode(800,480,16,SDL_SWSURFACE );
}
SDL_ShowCursor
(
SDL_DISABLE
);
SDL_ShowCursor
(
SDL_DISABLE
);
// check if resolution hasn't change in menu. otherwise free the resources so that they will be re-generated with new resolution.
if
((
dispmanxresource_amigafb_1
!=
0
)
&&
((
blit_rect
.
width
!=
width
)
||
(
blit_rect
.
height
!=
height
)))
{
printf
(
"Emulation resolution change detected.
\n
"
);
if
(
prSDLScreen
!=
NULL
)
{
SDL_FreeSurface
(
prSDLScreen
);
prSDLScreen
=
0
;
}
graphics_dispmanshutdown
();
vc_dispmanx_resource_delete
(
dispmanxresource_amigafb_1
);
vc_dispmanx_resource_delete
(
dispmanxresource_amigafb_2
);
...
...
@@ -224,11 +230,17 @@ static void open_screen(struct uae_prefs *p)
if
(
dispmanxresource_amigafb_1
==
0
)
{
printf
(
"Emulation resolution: Width %i Height: %i
\n
"
,
width
,
height
);
prSDLScreen
=
SDL_CreateRGBSurface
(
SDL_SWSURFACE
,
width
,
height
,
16
,
Dummy_prSDLScreen
->
format
->
Rmask
,
Dummy_prSDLScreen
->
format
->
Gmask
,
Dummy_prSDLScreen
->
format
->
Bmask
,
Dummy_prSDLScreen
->
format
->
Amask
);
dispmanxdisplay
=
vc_dispmanx_display_open
(
0
);
vc_dispmanx_display_get_info
(
dispmanxdisplay
,
&
dispmanxdinfo
);
printf
(
"Emulation resolution: Width %i Height: %i
\n
"
,
width
,
height
);
dispmanxresource_amigafb_1
=
vc_dispmanx_resource_create
(
VC_IMAGE_RGB565
,
width
,
height
,
&
vc_image_ptr
);
dispmanxresource_amigafb_2
=
vc_dispmanx_resource_create
(
VC_IMAGE_RGB565
,
width
,
height
,
&
vc_image_ptr
);
vc_dispmanx_rect_set
(
&
blit_rect
,
0
,
0
,
width
,
height
);
...
...
@@ -351,20 +363,23 @@ void unlockscr (void)
void
flush_block
()
{
//SDL_UnlockSurface (prSDLScreen);
//SDL_UnlockSurface (prSDLScreen);
if
(
show_inputmode
)
{
inputmode_redraw
();
}
if
(
show_inputmode
)
inputmode_redraw
();
if
(
savestate_state
==
STATE_DOSAVE
)
{
if
(
savestate_state
==
STATE_DOSAVE
)
{
if
(
delay_savestate_frame
>
0
)
--
delay_savestate_frame
;
else
{
CreateScreenshot
();
save_thumb
(
screenshot_filename
);
savestate_state
=
0
;
CreateScreenshot
();
save_thumb
(
screenshot_filename
);
savestate_state
=
0
;
}
}
...
...
@@ -568,6 +583,7 @@ int graphics_init (void)
void
graphics_leave
(
void
)
{
graphics_subshutdown
();
SDL_FreeSurface
(
Dummy_prSDLScreen
);
bcm_host_deinit
();
SDL_VideoQuit
();
//dumpcustom ();
...
...
@@ -812,7 +828,7 @@ void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 depth, RGBFTYPE rgb
if
(
screen_is_picasso
)
{
open_screen
(
&
currprefs
);
picasso_vidinfo
.
rowbytes
=
blit_rect
.
width
*
2
;
picasso_vidinfo
.
rowbytes
=
prSDLScreen
->
pitch
;
}
}
...
...
@@ -823,7 +839,7 @@ void gfx_set_picasso_state (int on)
screen_is_picasso
=
on
;
open_screen
(
&
currprefs
);
picasso_vidinfo
.
rowbytes
=
blit_rect
.
width
*
2
;
picasso_vidinfo
.
rowbytes
=
prSDLScreen
->
pitch
;
if
(
on
)
DX_SetPalette
(
0
,
256
);
}
...
...
@@ -831,7 +847,7 @@ void gfx_set_picasso_state (int on)
uae_u8
*
gfx_lock_picasso
(
void
)
{
// We lock the surface directly after create and flip
picasso_vidinfo
.
rowbytes
=
blit_rect
.
width
*
2
;
picasso_vidinfo
.
rowbytes
=
prSDLScreen
->
pitch
;
return
(
uae_u8
*
)
prSDLScreen
->
pixels
;
}
...
...
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