Skip to content

Commit

Permalink
Compile on newer gccs and 1.03
Browse files Browse the repository at this point in the history
Reduces the number of tiles and merges tile and font sets, so that the code
does not rely on both arrays being adjacent. Removes some outdated info
  • Loading branch information
flaviozavan committed Jan 26, 2021
1 parent ac8dbce commit 4abd543
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 109 deletions.
17 changes: 6 additions & 11 deletions UzeSnakes.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
#include <uzebox.h>

#include "data/tileset.inc"
#include "data/font.inc"
#include "data/patches.inc"
#include "data/snake60.inc"
#include "data/snake30.inc"


#define NUM_NON_FONT_TILES (61-22)
#define NUMERALSOFFSET 48
#define LETTEROFFSET 52
#define PLAYEROFFSET 9
Expand Down Expand Up @@ -82,7 +81,7 @@ const char strCopyright0[] PROGMEM = "@ FL?VIO ZAVAN 2010";
const char strCopyright1[] PROGMEM = "LICENSED UNDER GNU GPL V3";
const char strCopyright2[] PROGMEM = "MEDIA UNDER CC ASA 3 UNPORTED";
const char strCopyright3[] PROGMEM = "MUSIC BY IDERALDO LUIZ DA SILVA";
const char strCopyright4[] PROGMEM = "WWW DOT NEBOSOSO DOT COM";
const char strCopyright4[] PROGMEM = "V 1 03";
const char strMenu[MENUITEMS][11] PROGMEM = {{"1 PLAYER"},{"2 PLAYERS:"},
{"DELAY:"},{"MAZE:"},{"SOUND:"}};
const char strMazes[MAZES][8] PROGMEM = {{"NONE"},{"BORDERS"},{"ROOMS"},
Expand Down Expand Up @@ -181,7 +180,7 @@ unsigned char menu(){
usPrint(18,22,strCopyright1);
usPrint(16,23,strCopyright2);
usPrint(15,24,strCopyright3);
usPrint(19,25,strCopyright4);
usPrint(27,25,strCopyright4);
//Print the options
for (unsigned char i = 0; i < MENUITEMS; i++){
usPrint(OPTIONSX,OPTIONSY+i,strMenu[i]);
Expand Down Expand Up @@ -523,11 +522,9 @@ void reverseSnake(unsigned char i){
char nx = snake[i].tailx;
char ny = snake[i].taily;
//Real variables for setting and getting pos
char ox, oy, x, y, rx, ry, rox, roy, rnx, rny;
char ox, oy, x, y, rx, ry, rnx, rny;
ox = 0;
oy = 0;
rox = 0;
roy = 0;
rnx = nx;
rny = ny;
for(unsigned char n = 0; n < snake[i].size; n++){
Expand Down Expand Up @@ -575,10 +572,8 @@ void reverseSnake(unsigned char i){
}
ox = x;
oy = y;
rox = rx;
roy = ry;
}
//Swtich head and tail
//Switch head and tail
snake[i].tailx ^= snake[i].headx;
snake[i].headx ^= snake[i].tailx;
snake[i].tailx ^= snake[i].headx;
Expand Down Expand Up @@ -1166,7 +1161,7 @@ int main(){
InitMusicPlayer(patches);
SetMasterVolume(0xb0);
SetTileTable(tileset);
SetFontTilesIndex(TILESET_SIZE);
SetFontTilesIndex(NUM_NON_FONT_TILES);
ClearVram();
//Intro
DrawMap2(16,11,uze);
Expand Down
7 changes: 0 additions & 7 deletions data/font.gconvert.xml

This file was deleted.

49 changes: 0 additions & 49 deletions data/font.inc

This file was deleted.

Binary file removed data/font.png
Binary file not shown.
96 changes: 58 additions & 38 deletions data/tileset.inc

Large diffs are not rendered by default.

Binary file modified data/tileset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions default/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ COMMON = -mmcu=$(MCU)

## Compile options common for all C compilation units.
CFLAGS = $(COMMON)
CFLAGS += -Wall -gdwarf-2 -std=gnu99 -DF_CPU=28636360UL -Os -fsigned-char -ffunction-sections
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
CFLAGS += -Wall -Wextra -gdwarf-2 -std=gnu99 -DF_CPU=28636360UL -Os -fsigned-char -ffunction-sections
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
CFLAGS += $(KERNEL_OPTIONS)


Expand Down
4 changes: 2 additions & 2 deletions gameinfo.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=UzeSnakes 1.02
name=UzeSnakes 1.03
desc=An advanced snakes game using mode 9
author=Flávio Zavan (Nebososo)
author=Flavio Zavan (Nebososo)
year=2010
genre=0

0 comments on commit 4abd543

Please sign in to comment.