Commit f13f9c54 authored by pickle136's avatar pickle136

Removed wiz only makefile and update with a common ARM makefile

Gp2x/Wiz: Added memset code for clearing the screen
Gp2x: needs smaller samples then the standard
parent 39c8e8d7
# OpenJazz makefile
PROGRAM = OpenJazz
ifeq ($(BUILDTYPE),PANDORA)
PROGRAM = OpenJazz
PREFIX = /mythtv/media/devel/toolchains/pandora/arm-2007q3
TARGET = arm-none-linux-gnueabi-
else
ifeq ($(BUILDTYPE),WIZ)
PROGRAM = OpenJazzWiz
PREFIX = /mythtv/media/devel/toolchains/openwiz/arm-openwiz-linux-gnu
TARGET = arm-openwiz-linux-gnu-
else
ifeq ($(BUILDTYPE),GP2X)
PROGRAM = OpenJazzGp2x
PREFIX = /mythtv/media/devel/toolchains/open2x/gcc-4.1.1-glibc-2.3.6
TARGET = arm-open2x-linux-
else # default linux
PROGRAM = OpenJazz
PREFIX = /usr
TARGET =
endif
endif
endif
OBJS = src/bonus/bonus.o \
src/game/clientgame.o src/game/game.o src/game/gamemode.o \
src/game/servergame.o \
src/io/gfx/anim.o src/io/gfx/font.o src/io/gfx/paletteeffects.o \
src/io/gfx/sprite.o src/io/gfx/video.o \
src/io/controls.o src/io/file.o src/io/network.o src/io/sound.o \
src/level/event/bridge.o src/level/event/guardians.o \
src/level/event/event.o src/level/event/eventframe.o \
src/level/bullet.o src/level/demolevel.o src/level/level.o \
src/level/levelframe.o src/level/levelload.o \
src/menu/gamemenu.o src/menu/mainmenu.o src/menu/menu.o \
src/menu/menuutil.o src/menu/setupmenu.o \
src/player/bird.o src/player/player.o src/player/playerframe.o \
src/main.o src/movable.o src/planet.o src/scene.o src/util.o
CXX = $(PREFIX)/bin/$(TARGET)g++
ifeq ($(BUILDTYPE),PANDORA)
CXXFLAGS +=
LDFLAGS += -lts
else
ifeq ($(BUILDTYPE),WIZ)
OBJS += src/platforms/wiz.o
CXXFLAGS += -DWIZ -DFULLSCREEN_ONLY
LDFLAGS +=
else
ifeq ($(BUILDTYPE),GP2X)
OBJS += src/platforms/wiz.o
CXXFLAGS += -DGP2X -DFULLSCREEN_ONLY
LDFLAGS += -static -lpthread
else # default linux
CXXFLAGS +=
LDFLAGS +=
endif
endif
endif
CXXFLAGS += -g -Wall -O2 -fsigned-char -DUSE_SOCKETS -I$(PREFIX)/include -I$(PREFIX)/include/SDL -Isrc
LDFLAGS += -L$(PREFIX)/lib -lSDL
# Uncomment the following two lines for music (requires libmodplug)
CXXFLAGS += -DUSE_MODPLUG -I$(PREFIX)/include/libmodplug
LDFLAGS += -lmodplug
$(PROGRAM): $(OBJS)
$(CXX) $(CXXFLAGS) -o $(PROGRAM) $(OBJS) $(LDFLAGS)
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
rm -f $(PROGRAM) $(OBJS)
###############################################################################
# Makefile for a GP32 application.
###############################################################################
PREFIX =/mythtv/media/devel/toolchains/openwiz/arm-openwiz-linux-gnu
TARGET =arm-openwiz-linux-gnu
# Change the line below to the name of your program
PROGRAM = openjazz.gpe
# If you have any directories with include files, add them here with -I on
# the front of each
INCLUDES = -I. -I$(PREFIX)/include -I$(PREFIX)/include/modplug
# list all .c files here
CFILES = \
main.cpp \
movable.cpp \
planet.cpp \
scene.cpp \
util.cpp \
menu/gamemenu.cpp \
menu/menuutil.cpp \
menu/menu.cpp \
menu/setupmenu.cpp \
menu/mainmenu.cpp \
bonus/bonus.cpp \
io/file.cpp \
io/controls.cpp \
io/gfx/paletteeffects.cpp \
io/gfx/anim.cpp \
io/gfx/font.cpp \
io/gfx/sprite.cpp \
io/gfx/video.cpp \
io/sound.cpp \
io/network.cpp \
level/event/bridge.cpp \
level/event/guardians.cpp \
level/event/event.cpp \
level/event/eventframe.cpp \
level/levelframe.cpp \
level/bullet.cpp \
level/level.cpp \
level/levelload.cpp \
level/demolevel.cpp \
game/gamemode.cpp \
game/servergame.cpp \
game/clientgame.cpp \
game/game.cpp \
player/bird.cpp \
player/playerframe.cpp \
player/player.cpp \
platforms/wiz.cpp
##############################################################################
# You shouldn't need to change anything below here, really
##############################################################################
ALL_INCLUDES = $(INCLUDES)
ALL_LIBS = $(LIBS)
CFLAGS = -DWIZ -DUSE_MODPLUG -DFULLSCREEN_ONLY \
-Wall \
$(shell $(PREFIX)/bin/sdl-config --cflags) \
-O3 -ffast-math -fomit-frame-pointer \
LDFLAGS = -L$(PREFIX)/lib $(shell $(PREFIX)/bin/sdl-config --libs) -lmodplug
OFILES = $(CFILES:.cpp=.o)
CC = $(PREFIX)/bin/$(TARGET)-g++
$(PROGRAM): $(OFILES)
$(CC) $(OFILES) $(LDFLAGS) $(LIBDIRS) $(ALL_LIBS) -o $@
.PHONY: all clean
all: $(PROGRAM)
%.o: %.cpp
$(CC) $(ALL_INCLUDES) $(CFLAGS) -c $< -o $@
clean:
-rm -f $(OFILES) $(MAPFILE) $(PROGRAM)
install: all
$(CROSS)/bin/$(TARGET)-strip -o $(PROGRAM).gpe $(PROGRAM)
...@@ -61,7 +61,7 @@ SDL_Surface * createSurface (unsigned char * pixels, int width, int height) { ...@@ -61,7 +61,7 @@ SDL_Surface * createSurface (unsigned char * pixels, int width, int height) {
void createFullscreen () { void createFullscreen () {
#if defined(WIZ) || defined(GP2X) #if defined(WIZ) || defined(GP2X)
screen = SDL_SetVideoMode(320, 240, 8, screen = SDL_SetVideoMode(320, 240, 8,
SDL_FULLSCREEN | SDL_SWSURFACE | SDL_HWPALETTE); SDL_FULLSCREEN | SDL_SWSURFACE | SDL_HWPALETTE);
#else #else
...@@ -135,8 +135,12 @@ void restorePalette (SDL_Surface *surface) { ...@@ -135,8 +135,12 @@ void restorePalette (SDL_Surface *surface) {
void clearScreen (int index) { void clearScreen (int index) {
SDL_FillRect(screen, NULL, index); #if defined(WIZ) || defined(GP2X)
// always 240 lines cleared to black
memset(screen->pixels, index, 320*240);
#else
SDL_FillRect(screen, NULL, index);
#endif
return; return;
} }
......
...@@ -122,7 +122,11 @@ void openAudio () { ...@@ -122,7 +122,11 @@ void openAudio () {
asDesired.freq = SOUND_FREQ; asDesired.freq = SOUND_FREQ;
asDesired.format = AUDIO_S16; asDesired.format = AUDIO_S16;
asDesired.channels = 2; asDesired.channels = 2;
#if defined(GP2X)
asDesired.samples = 512;
#else
asDesired.samples = 2048; asDesired.samples = 2048;
#endif
asDesired.callback = audioCallback; asDesired.callback = audioCallback;
asDesired.userdata = NULL; asDesired.userdata = NULL;
......
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