Afegit soport per a GCW Zero

This commit is contained in:
2016-03-04 19:21:28 +01:00
parent 2a553b64e6
commit 7e41d76e55
5 changed files with 37 additions and 3 deletions

View File

@@ -12,5 +12,6 @@ data/*
*.opensdf *.opensdf
*.user *.user
*.dll *.dll
*.opk
.DS_Store .DS_Store
trick.ini trick.ini

10
default.gcw0.desktop Normal file
View File

@@ -0,0 +1,10 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=AEE
Comment=Aventures En Egipte
Icon=icon
Exec=aee
Categories=games;Game;SDL;
Terminal=false

15
gcwmake Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
mipsel-linux-gcc -D GCWZERO -O2 -I/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include/SDL2 -D_GNU_SOURCE=1 -D_REENTRANT -lSDL2 -lSDL2_mixer -lstdc++ *.cpp -o aee
mksquashfs ./default.gcw0.desktop ./icon.png ./aee ./data.jrf aee.opk -all-root -noappend -no-exports -no-xattrs
ftp -n -v 10.1.1.2 << EOT
ascii
user root ezahfm
pass
cd apps
put ./aee.opk
bye
EOT

BIN
icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -3,6 +3,14 @@
#include <fstream> #include <fstream>
#include "gif.c" #include "gif.c"
#ifdef GCWZERO
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
#else
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480
#endif
JD8_Surface screen = NULL; JD8_Surface screen = NULL;
JD8_Palette main_palette = NULL; JD8_Palette main_palette = NULL;
Uint32* pixel_data = NULL; Uint32* pixel_data = NULL;
@@ -23,7 +31,7 @@ void JD8_Init(const char *title) {
main_palette = (JD8_Palette)calloc( 1, 768 ); main_palette = (JD8_Palette)calloc( 1, 768 );
pixel_data = (Uint32*)calloc(1, 320 * 200 * 4); // 1048576 ); pixel_data = (Uint32*)calloc(1, 320 * 200 * 4); // 1048576 );
sdlWindow = SDL_CreateWindow( title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN ); sdlWindow = SDL_CreateWindow( title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
sdlRenderer = SDL_CreateRenderer(sdlWindow, -1, 0); sdlRenderer = SDL_CreateRenderer(sdlWindow, -1, 0);
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest"); SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest");
@@ -162,7 +170,7 @@ void JD8_BlitCKToSurface(int x, int y, JD8_Surface surface, int sx, int sy, int
} }
} }
SDL_Rect rect{0, 0, 640, 480}; SDL_Rect rect{0, 0, SCREEN_WIDTH, SCREEN_HEIGHT};
void JD8_Flip() { void JD8_Flip() {
for( int x = 0; x < 320; x++ ) { for( int x = 0; x < 320; x++ ) {