From bb86656068deafb69200f8735e0b067b91c61486 Mon Sep 17 00:00:00 2001 From: giomba Date: Fri, 14 Sep 2018 15:58:31 +0200 Subject: [PATCH] Moved costants to external file --- cost.asm | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ snake.asm | 51 +-------------------------------------------------- 2 files changed, 54 insertions(+), 50 deletions(-) create mode 100644 cost.asm diff --git a/cost.asm b/cost.asm new file mode 100644 index 0000000..ca37736 --- /dev/null +++ b/cost.asm @@ -0,0 +1,53 @@ +; Costants +; ---------------------------------------------------------------------- + +; Status of the game (costants pre-processor defined, sort of enum) +ST_INTRO0 = 0 +ST_INTRO1 = 1 +ST_PLAY = 2 +ST_OUTRO = 3 +ST_END = 4 +ST_PAUSE = 255 + +; Screen features +SCREEN_W = 40 +SCREEN_H = 24 +; Snake features +SNAKE_TILE = 81 +SNAKE_COLOR = 13 +; Food features +FOOD_TILE = 90 +FOOD_COLOR = 11 + +; Strings +; ---------------------------------------------------------------------- + +gameoverString: + BYTE "GAME IS OVER" + BYTE #0 +intro0string: +#if SYSTEM = 64 + BYTE " SNAKE BY GIOMBA " +#else + BYTE " SNAKE16 BY GIOMBA " +#endif + BYTE #0 +intro1string: + BYTE " PRESS SPACE TO PLAY " + BYTE #0 +intro2string: + BYTE "RETROFFICINA.GLGPROGRAMS.IT" + BYTE #0 +intro3string: +#if DEBUG = 1 + BYTE "DBG RELS" +#else + BYTE "(C) 2018" +#endif + BYTE #0 +colorshade: ; a gradient of dark-bright-dark (40 columns) + HEX 0b 0b 0b 0b 0b 0c 0c 0c 0c 0c 05 05 05 0d 0d 0d 0d 07 07 07 07 07 07 0d 0d 0d 0d 05 05 05 0c 0c 0c 0c 0c 0b 0b 0b 0b 0b +scoreString: + BYTE "POINTS" + BYTE #0 + diff --git a/snake.asm b/snake.asm index 4b4157c..58f9a22 100644 --- a/snake.asm +++ b/snake.asm @@ -87,56 +87,7 @@ introXinc: outroDelay BYTE #$ff -; Costants -; ---------------------------------------------------------------------- - -; Status of the game (costants pre-processor defined, sort of enum) -ST_INTRO0 = 0 -ST_INTRO1 = 1 -ST_PLAY = 2 -ST_OUTRO = 3 -ST_END = 4 -ST_PAUSE = 255 - -; Screen features -SCREEN_W = 40 -SCREEN_H = 24 -; Snake features -SNAKE_TILE = 81 -SNAKE_COLOR = 13 -; Food features -FOOD_TILE = 90 -FOOD_COLOR = 11 - -; Strings -gameoverString: - BYTE "GAME IS OVER" - BYTE #0 -intro0string: -#if SYSTEM = 64 - BYTE " SNAKE BY GIOMBA " -#else - BYTE " SNAKE16 BY GIOMBA " -#endif - BYTE #0 -intro1string: - BYTE " PRESS SPACE TO PLAY " - BYTE #0 -intro2string: - BYTE "RETROFFICINA.GLGPROGRAMS.IT" - BYTE #0 -intro3string: -#if DEBUG = 1 - BYTE "DBG RELS" -#else - BYTE "(C) 2018" -#endif - BYTE #0 -colorshade: ; a gradient of dark-bright-dark (40 columns) - HEX 0b 0b 0b 0b 0b 0c 0c 0c 0c 0c 05 05 05 0d 0d 0d 0d 07 07 07 07 07 07 0d 0d 0d 0d 05 05 05 0c 0c 0c 0c 0c 0b 0b 0b 0b 0b -scoreString: - BYTE "POINTS" - BYTE #0 + INCLUDE "cost.asm" #if DEBUG = 1 ECHO "End of Data. Space left: ",($e00 - .)