Commit 3e6e55dc authored by Chips-fr's avatar Chips-fr
Browse files

First version for Raspberry Pi

parent a2c4a073
PREFIX =/usr
$(shell ./link_pandora_dirs.sh)
#SDL_BASE = $(PREFIX)/bin/
SDL_BASE =
......@@ -7,8 +6,7 @@ SDL_BASE =
NAME = uae4arm
O = o
RM = rm -f
#CC = gcc
#CXX = g++
CXX = g++-4.8
#STRIP = strip
#AS = as
......@@ -21,34 +19,34 @@ PANDORA=1
DEFAULT_CFLAGS = `$(SDL_BASE)sdl-config --cflags`
LDFLAGS = -lSDL -lpthread -lz -lSDL_image -lpng -lrt
MORE_CFLAGS += -DGP2X -DPANDORA -DDOUBLEBUFFER -DARMV6_ASSEMBLY -DUSE_ARMNEON
MORE_CFLAGS += -DGP2X -DPANDORA -DDOUBLEBUFFER -DARMV6_ASSEMBLY -DUSE_ARMNEON -DRASPBERRY -DSIX_AXIS_WORKAROUND
MORE_CFLAGS += -DSUPPORT_THREADS -DUAE_FILESYS_THREADS -DNO_MAIN_IN_MAIN_C -DFILESYS -DAUTOCONFIG -DSAVESTATE
MORE_CFLAGS += -DDONT_PARSE_CMDLINE
#MORE_CFLAGS += -DWITH_LOGGING
MORE_CFLAGS += -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads
MORE_CFLAGS += -DJIT -DCPU_arm -DARM_ASSEMBLY
MORE_CFLAGS += -Isrc -Isrc/gp2x -Isrc/menu -Isrc/include -Isrc/gp2x/menu -fomit-frame-pointer -Wno-unused -Wno-format -DUSE_SDL -DGCCCONSTFUNC="__attribute__((const))" -DUSE_UNDERSCORE -DUNALIGNED_PROFITABLE -DOPTIMIZED_FLAGS
LDFLAGS += -lSDL_ttf -lguichan_sdl -lguichan
MORE_CFLAGS += -fexceptions
MORE_CFLAGS += -Isrc -Isrc/gp2x -Isrc/threaddep -Isrc/menu -Isrc/include -Isrc/gp2x/menu -fomit-frame-pointer -Wno-unused -Wno-format -DUSE_SDL -DGCCCONSTFUNC="__attribute__((const))" -DUSE_UNDERSCORE -DUNALIGNED_PROFITABLE -DOPTIMIZED_FLAGS
LDFLAGS += -lSDL_ttf -lguichan_sdl -lguichan -lbcm_host -L/opt/vc/lib
MORE_CFLAGS += -fexceptions -fpermissive
MORE_CFLAGS += -DROM_PATH_PREFIX=\"./\" -DDATA_PREFIX=\"./data/\" -DSAVE_PREFIX=\"./saves/\"
MORE_CFLAGS += -msoft-float -ffast-math
MORE_CFLAGS += -mhard-float -ffast-math -mfpu=neon
ifndef DEBUG
MORE_CFLAGS += -O2
MORE_CFLAGS += -fstrict-aliasing -mstructure-size-boundary=32 -fexpensive-optimizations
MORE_CFLAGS += -O3
MORE_CFLAGS += -fstrict-aliasing
MORE_CFLAGS += -fweb -frename-registers -fomit-frame-pointer
#MORE_CFLAGS += -falign-functions=32 -falign-loops -falign-labels -falign-jumps
MORE_CFLAGS += -falign-functions=32
MORE_CFLAGS += -finline -finline-functions -fno-builtin
#MORE_CFLAGS += -S
else
MORE_CFLAGS += -ggdb
endif
ASFLAGS += -mfloat-abi=soft
ASFLAGS += -mfloat-abi=hard -mfpu=neon
CFLAGS = $(DEFAULT_CFLAGS) $(MORE_CFLAGS)
CFLAGS+= -DCPUEMU_0 -DCPUEMU_5 -DFPUEMU
......@@ -86,48 +84,48 @@ OBJS = \
src/unzip.o \
src/zfile.o \
src/machdep/support.o \
src/osdep/neon_helper.o \
src/osdep/fsdb_host.o \
src/osdep/joystick.o \
src/osdep/keyboard.o \
src/osdep/inputmode.o \
src/osdep/writelog.o \
src/osdep/pandora.o \
src/osdep/pandora_filesys.o \
src/osdep/pandora_gui.o \
src/osdep/pandora_gfx.o \
src/osdep/pandora_mem.o \
src/osdep/sigsegv_handler.o \
src/osdep/menu/menu_config.o \
src/sounddep/sound.o \
src/osdep/gui/UaeRadioButton.o \
src/osdep/gui/UaeDropDown.o \
src/osdep/gui/UaeCheckBox.o \
src/osdep/gui/UaeListBox.o \
src/osdep/gui/InGameMessage.o \
src/osdep/gui/SelectorEntry.o \
src/osdep/gui/ShowMessage.o \
src/osdep/gui/SelectFolder.o \
src/osdep/gui/SelectFile.o \
src/osdep/gui/EditFilesysVirtual.o \
src/osdep/gui/EditFilesysHardfile.o \
src/osdep/gui/PanelPaths.o \
src/osdep/gui/PanelConfig.o \
src/osdep/gui/PanelCPU.o \
src/osdep/gui/PanelChipset.o \
src/osdep/gui/PanelROM.o \
src/osdep/gui/PanelRAM.o \
src/osdep/gui/PanelFloppy.o \
src/osdep/gui/PanelHD.o \
src/osdep/gui/PanelDisplay.o \
src/osdep/gui/PanelSound.o \
src/osdep/gui/PanelInput.o \
src/osdep/gui/PanelMisc.o \
src/osdep/gui/PanelSavestate.o \
src/osdep/gui/main_window.o \
src/osdep/gui/Navigation.o
src/od-pandora/neon_helper.o \
src/od-pandora/fsdb_host.o \
src/od-pandora/joystick.o \
src/od-pandora/keyboard.o \
src/od-pandora/inputmode.o \
src/od-pandora/writelog.o \
src/od-pandora/pandora.o \
src/od-pandora/pandora_filesys.o \
src/od-pandora/pandora_gui.o \
src/od-rasp/rasp_gfx.o \
src/od-pandora/pandora_mem.o \
src/od-pandora/sigsegv_handler.o \
src/od-pandora/menu/menu_config.o \
src/sd-sdl/sound_sdl_new.o \
src/od-pandora/gui/UaeRadioButton.o \
src/od-pandora/gui/UaeDropDown.o \
src/od-pandora/gui/UaeCheckBox.o \
src/od-pandora/gui/UaeListBox.o \
src/od-pandora/gui/InGameMessage.o \
src/od-pandora/gui/SelectorEntry.o \
src/od-pandora/gui/ShowMessage.o \
src/od-pandora/gui/SelectFolder.o \
src/od-pandora/gui/SelectFile.o \
src/od-pandora/gui/EditFilesysVirtual.o \
src/od-pandora/gui/EditFilesysHardfile.o \
src/od-pandora/gui/PanelPaths.o \
src/od-pandora/gui/PanelConfig.o \
src/od-pandora/gui/PanelCPU.o \
src/od-pandora/gui/PanelChipset.o \
src/od-pandora/gui/PanelROM.o \
src/od-pandora/gui/PanelRAM.o \
src/od-pandora/gui/PanelFloppy.o \
src/od-pandora/gui/PanelHD.o \
src/od-pandora/gui/PanelDisplay.o \
src/od-pandora/gui/PanelSound.o \
src/od-pandora/gui/PanelInput.o \
src/od-pandora/gui/PanelMisc.o \
src/od-pandora/gui/PanelSavestate.o \
src/od-pandora/gui/main_window.o \
src/od-pandora/gui/Navigation.o
ifdef PANDORA
OBJS += src/osdep/gui/sdltruetypefont.o
OBJS += src/od-pandora/gui/sdltruetypefont.o
endif
OBJS += src/newcpu.o
......@@ -144,7 +142,7 @@ OBJS += src/compemu_support.o
CPPFLAGS = $(CFLAGS)
src/osdep/neon_helper.o: src/osdep/neon_helper.s
$(CXX) -O3 -pipe -falign-functions=32 -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -Wall -o src/osdep/neon_helper.o -c src/osdep/neon_helper.s
$(CXX) -O3 -pipe -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard -Wall -o src/osdep/neon_helper.o -c src/osdep/neon_helper.s
$(PROG): $(OBJS)
$(CXX) $(CFLAGS) -o $(PROG) $(OBJS) $(LDFLAGS)
......
# uae4arm-rpi
Port of uae4arm on Raspberry Pi
v0.1:
Use dispmanX for fast scaling and double buffering.
Enable hat usage on joystick.
Add Sony 6axis joystick workaround.
PREFIX =/usr
$(shell ./link_pandora_dirs.sh)
#SDL_BASE = $(PREFIX)/bin/
SDL_BASE =
NAME = uae4arm
O = o
RM = rm -f
#CC = gcc
#CXX = g++
#STRIP = strip
#AS = as
PROG = $(NAME)
all: $(PROG)
PANDORA=1
DEFAULT_CFLAGS = `$(SDL_BASE)sdl-config --cflags`
LDFLAGS = -lSDL -lpthread -lz -lSDL_image -lpng -lrt
MORE_CFLAGS += -DGP2X -DPANDORA -DDOUBLEBUFFER -DARMV6_ASSEMBLY -DUSE_ARMNEON
MORE_CFLAGS += -DSUPPORT_THREADS -DUAE_FILESYS_THREADS -DNO_MAIN_IN_MAIN_C -DFILESYS -DAUTOCONFIG -DSAVESTATE
MORE_CFLAGS += -DDONT_PARSE_CMDLINE
#MORE_CFLAGS += -DWITH_LOGGING
MORE_CFLAGS += -DJIT -DCPU_arm -DARM_ASSEMBLY
MORE_CFLAGS += -Isrc -Isrc/gp2x -Isrc/menu -Isrc/include -Isrc/gp2x/menu -fomit-frame-pointer -Wno-unused -Wno-format -DUSE_SDL -DGCCCONSTFUNC="__attribute__((const))" -DUSE_UNDERSCORE -DUNALIGNED_PROFITABLE -DOPTIMIZED_FLAGS
LDFLAGS += -lSDL_ttf -lguichan_sdl -lguichan
MORE_CFLAGS += -fexceptions
MORE_CFLAGS += -DROM_PATH_PREFIX=\"./\" -DDATA_PREFIX=\"./data/\" -DSAVE_PREFIX=\"./saves/\"
MORE_CFLAGS += -msoft-float -ffast-math
ifndef DEBUG
MORE_CFLAGS += -O2
MORE_CFLAGS += -fstrict-aliasing -mstructure-size-boundary=32 -fexpensive-optimizations
MORE_CFLAGS += -fweb -frename-registers -fomit-frame-pointer
#MORE_CFLAGS += -falign-functions=32 -falign-loops -falign-labels -falign-jumps
MORE_CFLAGS += -falign-functions=32
MORE_CFLAGS += -finline -finline-functions -fno-builtin
#MORE_CFLAGS += -S
else
MORE_CFLAGS += -ggdb
endif
ASFLAGS += -mfloat-abi=soft
CFLAGS = $(DEFAULT_CFLAGS) $(MORE_CFLAGS)
CFLAGS+= -DCPUEMU_0 -DCPUEMU_5 -DFPUEMU
OBJS = \
src/audio.o \
src/autoconf.o \
src/blitfunc.o \
src/blittable.o \
src/blitter.o \
src/cfgfile.o \
src/cia.o \
src/crc32.o \
src/custom.o \
src/disk.o \
src/drawing.o \
src/ersatz.o \
src/expansion.o \
src/filesys.o \
src/fpp.o \
src/fsdb.o \
src/fsdb_unix.o \
src/fsusage.o \
src/gfxutil.o \
src/hardfile.o \
src/inputdevice.o \
src/keybuf.o \
src/main.o \
src/memory.o \
src/missing.o \
src/native2amiga.o \
src/savestate.o \
src/scsi-none.o \
src/traps.o \
src/unzip.o \
src/zfile.o \
src/machdep/support.o \
src/osdep/neon_helper.o \
src/osdep/fsdb_host.o \
src/osdep/joystick.o \
src/osdep/keyboard.o \
src/osdep/inputmode.o \
src/osdep/writelog.o \
src/osdep/pandora.o \
src/osdep/pandora_filesys.o \
src/osdep/pandora_gui.o \
src/osdep/pandora_gfx.o \
src/osdep/pandora_mem.o \
src/osdep/sigsegv_handler.o \
src/osdep/menu/menu_config.o \
src/sounddep/sound.o \
src/osdep/gui/UaeRadioButton.o \
src/osdep/gui/UaeDropDown.o \
src/osdep/gui/UaeCheckBox.o \
src/osdep/gui/UaeListBox.o \
src/osdep/gui/InGameMessage.o \
src/osdep/gui/SelectorEntry.o \
src/osdep/gui/ShowMessage.o \
src/osdep/gui/SelectFolder.o \
src/osdep/gui/SelectFile.o \
src/osdep/gui/EditFilesysVirtual.o \
src/osdep/gui/EditFilesysHardfile.o \
src/osdep/gui/PanelPaths.o \
src/osdep/gui/PanelConfig.o \
src/osdep/gui/PanelCPU.o \
src/osdep/gui/PanelChipset.o \
src/osdep/gui/PanelROM.o \
src/osdep/gui/PanelRAM.o \
src/osdep/gui/PanelFloppy.o \
src/osdep/gui/PanelHD.o \
src/osdep/gui/PanelDisplay.o \
src/osdep/gui/PanelSound.o \
src/osdep/gui/PanelInput.o \
src/osdep/gui/PanelMisc.o \
src/osdep/gui/PanelSavestate.o \
src/osdep/gui/main_window.o \
src/osdep/gui/Navigation.o
ifdef PANDORA
OBJS += src/osdep/gui/sdltruetypefont.o
endif
OBJS += src/newcpu.o
OBJS += src/readcpu.o
OBJS += src/cpudefs.o
OBJS += src/cpustbl.o
OBJS += src/cpuemu_0.o
OBJS += src/cpuemu_5.o
OBJS += src/compemu.o
OBJS += src/compemu_fpp.o
OBJS += src/compstbl.o
OBJS += src/compemu_support.o
CPPFLAGS = $(CFLAGS)
src/osdep/neon_helper.o: src/osdep/neon_helper.s
$(CXX) -O3 -pipe -falign-functions=32 -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -Wall -o src/osdep/neon_helper.o -c src/osdep/neon_helper.s
$(PROG): $(OBJS)
$(CXX) $(CFLAGS) -o $(PROG) $(OBJS) $(LDFLAGS)
ifndef DEBUG
$(STRIP) $(PROG)
endif
clean:
$(RM) $(PROG) $(OBJS)
......@@ -1657,7 +1657,13 @@ void init_row_map (void)
int i;
gfxvidinfo.bufmem = (uae_u8 *)prSDLScreen->pixels;
#ifdef RASPBERRY
// When using DispmanX display resolution is not set to emulate one.
//gfx_rowbytes = visibleAreaWidth * 2;
#else
gfxvidinfo.rowbytes = prSDLScreen->pitch;
#endif
for (i = 0; i < gfxHeight + 1; i++)
row_map[i] = (uae_u8 *)(gfxvidinfo.bufmem + gfxvidinfo.rowbytes * i);
}
......@@ -2182,12 +2188,26 @@ static void finish_drawing_frame (void)
do_flush_screen ();
}
#ifdef RASPBERRY
int wait_for_vsync = 1;
extern uae_sem_t vsync_wait_sem;
#endif
void vsync_handle_redraw (int long_frame, int lof_changed)
{
count_frame ();
if (framecnt == 0)
{
#ifdef RASPBERRY
if (wait_for_vsync == 1)
uae_sem_wait (&vsync_wait_sem);
wait_for_vsync = 1;
#endif
finish_drawing_frame ();
}
/* At this point, we have finished both the hardware and the
* drawing frame. Essentially, we are outside of all loops and
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -328,7 +328,11 @@ extern void gui_message (const char *,...);
#endif
#ifndef STATIC_INLINE
#ifdef RASPBERRY
#define STATIC_INLINE static __inline__
#else
#define STATIC_INLINE static __inline__ __attribute__ ((always_inline))
#endif
#define NOINLINE __attribute__ ((noinline))
#define NORETURN __attribute__ ((noreturn))
#endif
......
File mode changed from 100755 to 100644
......@@ -344,8 +344,6 @@ void inputdevice_updateconfig (struct uae_prefs *prefs)
void inputdevice_default_prefs (struct uae_prefs *p)
{
inputdevice_init ();
p->input_joymouse_multiplier = 20;
p->input_autofire_framecnt = 8;
}
......@@ -353,7 +351,7 @@ void inputdevice_default_prefs (struct uae_prefs *p)
void inputdevice_init (void)
{
init_joystick ();
inputmode_init();
inputmode_init();
}
void inputdevice_close (void)
......
#!/bin/bash
cd ./src
# Link to our config.h
if ! [ -e "config.h" ]; then
ln -s od-pandora/config.h config.h
fi
# Link to our sysconfig.h
if ! [ -e "sysconfig.h" ]; then
ln -s od-pandora/sysconfig.h sysconfig.h
fi
# Link to our target.h
if ! [ -e "target.h" ]; then
ln -s od-pandora/target.h target.h
fi
# Link od-pandora to osdep
if ! [ -d "osdep" ]; then
ln -s od-pandora osdep
fi
# We use SDL-threads, so link td-sdl to threaddep
if ! [ -d "threaddep" ]; then
ln -s td-sdl threaddep
fi
# Link md-pandora to machdep
if ! [ -d "machdep" ]; then
ln -s md-pandora machdep
fi
# Link od-sound to sounddep
if ! [ -d "sounddep" ]; then
ln -s sd-pandora sounddep
fi
cd ..
File mode changed from 100755 to 100644
......@@ -267,6 +267,9 @@ void leave_program (void)
static void real_main2 (int argc, char **argv)
{
#ifdef RASPBERRY
printf("Uae4arm v0.1 for Raspberry Pi by Chips\n");
#endif
#ifdef PANDORA
SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_NOPARACHUTE | SDL_INIT_VIDEO);
#else
......
File mode changed from 100755 to 100644
......@@ -67,7 +67,13 @@ namespace sdl
//-------------------------------------------------
// Create new screen for GUI
//-------------------------------------------------
#if defined (RASPBERRY)
const SDL_VideoInfo* videoInfo = SDL_GetVideoInfo ();
printf("Current resolution: %d x %d %d bpp\n",videoInfo->current_w, videoInfo->current_h, videoInfo->vfmt->BitsPerPixel);
gui_screen = SDL_SetVideoMode(videoInfo->current_w,videoInfo->current_h,16,SDL_SWSURFACE |SDL_FULLSCREEN);
#else
gui_screen = SDL_SetVideoMode(GUI_WIDTH, GUI_HEIGHT, 16, SDL_SWSURFACE);
#endif
SDL_EnableUNICODE(1);
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
SDL_ShowCursor(SDL_ENABLE);
......@@ -328,7 +334,8 @@ namespace widgets
// Create container for main page
//-------------------------------------------------
gui_top = new gcn::Container();
gui_top->setDimension(gcn::Rectangle(0, 0, GUI_WIDTH, GUI_HEIGHT));
//gui_top->setDimension(gcn::Rectangle(0, 0, GUI_WIDTH, GUI_HEIGHT));
gui_top->setDimension(gcn::Rectangle((gui_screen->w - GUI_WIDTH) / 2, (gui_screen->h - GUI_HEIGHT) / 2, GUI_WIDTH, GUI_HEIGHT));
gui_top->setBaseColor(gui_baseCol);
uae_gui->setTop(gui_top);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment