Skip to content

Commit

Permalink
rg350 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesofarrell committed Nov 9, 2019
1 parent acc2404 commit 3749e75
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 27 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
# Vars
#

SDLVERSION=$(shell /opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/bin/sdl-config --version 2>/dev/null)
SDLVERSION=$(shell sdl-config --version 2>/dev/null)
ROOTDIR=
#$(shell pwd)
TARGET=$(shell uname -s | tr [a-z] [A-Z])

PROFILE= APPLY
PROFILE=NO

OPTIMISE= -D_ZAURUS -O2 -ffast-math -fstrict-aliasing -fomit-frame-pointer -ftree-vectorize -funroll-all-loops -fpeel-loops -ftracer -funswitch-loops -finline-functions

Expand Down Expand Up @@ -85,8 +85,8 @@ all:
@echo "XOBJ=$(XOBJ)" >> Makefile.global
@echo "CFLAGS=-g -ansi -pedantic -Wall -W -O2 -I $(ROOTDIR)/include $(shell /opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/bin/sdl-config --cflags) $(OPTIMISE)" >> Makefile.global
@echo "LDFLAGS=-lz $(shell /opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/bin/sdl-config --libs) -fprofile-arcs" >> Makefile.global
@echo "CC=arm-miyoo-linux-uclibcgnueabi-gcc" >> Makefile.global
@echo "CPP=arm-miyoo-linux-uclibcgnueabi-gcc -E" >> Makefile.global
@echo "CC=mipsel-gcw0-linux-uclibc-gcc" >> Makefile.global
@echo "CPP=mipsel-gcw0-linux-uclibc-gcc -E" >> Makefile.global
$(MAKE) -C src all

clean:
Expand Down
30 changes: 30 additions & 0 deletions make_opk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh

OPK_NAME=xrick-`date +'%Y%m%d'`.opk

echo ${OPK_NAME}

# create default.gcw0.desktop
cat > default.gcw0.desktop <<EOF
[Desktop Entry]
Name=Rick Dangerous
Comment=xRick port. An action platformer.
Exec=xrick
Terminal=false
Type=Application
StartupNotify=true
Icon=xrick
Categories=games;
EOF

# create opk
FLIST="xrick"
FLIST="${FLIST} default.gcw0.desktop"
FLIST="${FLIST} data.zip"
FLIST="${FLIST} xrick.png"

rm -f ${OPK_NAME}
mksquashfs ${FLIST} ${OPK_NAME} -all-root -no-xattrs -noappend -no-exports

cat default.gcw0.desktop
rm -f default.gcw0.desktop
20 changes: 2 additions & 18 deletions src/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,6 @@
#endif


/*
* local typedefs
*/
typedef enum {
#ifdef ENABLE_DEVTOOLS
DEVTOOLS,
#endif
XRICK,
INIT_GAME, INIT_BUFFER,
INTRO_MAIN, INTRO_MAP,
PAUSE_PRESSED1, PAUSE_PRESSED1B, PAUSED, PAUSE_PRESSED2,
PLAY0, PLAY1, PLAY2, PLAY3,
CHAIN_SUBMAP, CHAIN_MAP, CHAIN_END,
SCROLL_UP, SCROLL_DOWN,
RESTART, GAMEOVER, GETNAME, EXIT
} game_state_t;


/*
* global vars
Expand Down Expand Up @@ -117,11 +100,12 @@ sound_t *WAV_ENTITY[10];
#endif


game_state_t game_state;

/*
* local vars
*/
static U8 isave_frow;
static game_state_t game_state;
#ifdef ENABLE_SOUND
static sound_t *music_snd;
#endif
Expand Down
16 changes: 16 additions & 0 deletions src/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ typedef struct {
U8 name[10];
} hscore_t;

typedef enum {
#ifdef ENABLE_DEVTOOLS
DEVTOOLS,
#endif
XRICK,
INIT_GAME, INIT_BUFFER,
INTRO_MAIN, INTRO_MAP,
PAUSE_PRESSED1, PAUSE_PRESSED1B, PAUSED, PAUSE_PRESSED2,
PLAY0, PLAY1, PLAY2, PLAY3,
CHAIN_SUBMAP, CHAIN_MAP, CHAIN_END,
SCROLL_UP, SCROLL_DOWN,
RESTART, GAMEOVER, GETNAME, EXIT
} game_state_t;

extern U8 game_lives; /* lives counter */
extern U8 game_bombs; /* bombs counter */
extern U8 game_bullets; /* bullets counter */
Expand All @@ -61,6 +75,8 @@ extern void game_run(void);
extern void game_setmusic(char *name, U8 loop);
extern void game_stopmusic(void);

extern game_state_t game_state;


#ifdef ENABLE_CHEATS
extern U8 game_cheat1; /* infinite lives, bombs and bullets */
Expand Down
14 changes: 9 additions & 5 deletions src/sysevt.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ processEvent() /* #dingoo-a320 - keys renamed so input does the right things */
SETBIT(control_status, CONTROL_RIGHT);
control_last = CONTROL_RIGHT;
}
else if (key == SDLK_BACKSPACE) {
else if (key == SDLK_RETURN) {
SETBIT(control_status, CONTROL_PAUSE);
control_last = CONTROL_PAUSE;
}
Expand All @@ -87,15 +87,19 @@ processEvent() /* #dingoo-a320 - keys renamed so input does the right things */
}
else if (key == SDLK_F3) {
sysvid_zoom(+1);
} else if (key == SDLK_HOME) {
game_state = EXIT;
} else if (key == SDLK_ESCAPE) {
game_state = GAMEOVER;
}
#ifdef ENABLE_SOUND
else if (key == SDLK_RETURN) {
else if (key == SDLK_F3) {
syssnd_toggleMute();
}
else if (key == SDLK_LSHIFT) {
else if (key == SDLK_F4) {
syssnd_vol(-1);
}
else if (key == SDLK_SPACE) {
else if (key == SDLK_F5) {
syssnd_vol(+1);
}
#endif
Expand Down Expand Up @@ -129,7 +133,7 @@ processEvent() /* #dingoo-a320 - keys renamed so input does the right things */
CLRBIT(control_status, CONTROL_RIGHT);
control_last = CONTROL_RIGHT;
}
else if (key == SDLK_BACKSPACE) {
else if (key == SDLK_RETURN) {
CLRBIT(control_status, CONTROL_PAUSE);
control_last = CONTROL_PAUSE;
}
Expand Down
Binary file added xrick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3749e75

Please sign in to comment.