--- sdl/opengl.c Fri Aug 10 10:15:18 2018 +++ sdl/opengl.c Thu Sep 20 21:13:19 2018 @@ -225,7 +225,8 @@ // create an OpenGL compatibility context, not a core or ES context #ifndef WIN // except on Windows, where some Nvidia drivers really don't like us doing this - SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY); +// zanac, these attributes don't work well in allwinner (rasbperry too?) +// SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY); #endif // get window and initialize OpenGL context @@ -235,8 +236,9 @@ printf("Failed to create OpenGL-compatible window (%s)...", SDL_GetError()); goto error; } - if((context = SDL_GL_GetCurrentContext())) - SDL_GL_DeleteContext(context); +// zanac, it seems that you should always create a new context without delete the old one, this happen in allwinner (rasbperry too?) +// if((context = SDL_GL_GetCurrentContext())) +// SDL_GL_DeleteContext(context); context = SDL_GL_CreateContext(window); // make sure the context was created successfully --- sdl/sdlport.c Fri Aug 10 10:15:18 2018 +++ sdl/sdlport.c Mon Sep 24 17:44:49 2018 @@ -137,7 +137,19 @@ dirExists(logsDir, 1); dirExists(screenShotsDir, 1); - Menu(); + // Test command line argument to launch MOD + int romArg = 0; + if(argc == 2) { + memcpy(packfile, argv[1], strlen(argv[1])); + if(fileExists(packfile)) { + romArg = 1; + } + } + + if(!romArg) { + Menu(); + } + #ifndef SKIP_CODE getPakName(pakname, -1); video_set_window_title(pakname); --- Makefile Fri Aug 10 10:15:18 2018 +++ Makefile Thu Sep 27 17:16:22 2018 @@ -139,21 +139,26 @@ TARGET_PLATFORM = PANDORA BUILD_LINUX = 1 BUILD_SDL = 1 +BUILD_GLES = 1 +BUILD_OPENGL = 1 +BUILD_LOADGL = 1 +BUILD_WEBM = 1 BUILD_GFX = 1 BUILD_PTHREAD = 1 BUILD_SDL_IO = 1 BUILD_TREMOR = 1 BUILDING = 1 -CC = $(PNDDEV)/bin/arm-none-linux-gnueabi-gcc +CC = gcc INCLUDES = $(PNDDEV)/include \ $(PNDDEV)/include/SDL OBJTYPE = elf -LIBRARIES = $(PNDDEV)/lib +LIBRARIES = . ifeq ($(BUILD_PANDORA), 0) BUILD_DEBUG = 1 endif endif + ifdef BUILD_WII TARGET = $(VERSION_NAME).elf TARGET_MAP = $(TARGET).map @@ -199,7 +204,7 @@ STRIP = $(PREFIX)strip $(TARGET) -o $(TARGET_FINAL) endif ifdef BUILD_PANDORA -STRIP = $(PNDDEV)/bin/arm-none-linux-gnueabi-strip $(TARGET) -o $(TARGET_FINAL) +STRIP = strip $(TARGET) -o $(TARGET_FINAL) endif ifdef BUILD_WII STRIP = elf2dol $< $@ @@ -444,6 +449,7 @@ CFLAGS += $(addprefix -I", $(addsuffix ", $(INCS))) $(ARCHFLAGS) -D$(TARGET_PLATFORM) CFLAGS += -g -Wall -Werror -fsigned-char -std=gnu99 +CFLAGS += -marm -mfloat-abi=hard -fomit-frame-pointer -ffast-math -O2 ifndef BUILD_DARWIN @@ -566,7 +572,7 @@ ifeq ($(findstring DGE, $(SDKPATH)), DGE) LIBS += -lSDL -lSDL_gfx -lts else -LIBS += -Wl,-rpath,$(LIBRARIES) -lSDL2 -lSDL2_gfx +LIBS += -Wl,-rpath,$(LIBRARIES) -lSDL2 -lSDL2_gfx -lGL endif endif