- Declared uninitialized segment in zero page: used assembler directives
to reduce errors probability and improve code maintenance; now zeropage
variables addresses are automagically computed by assembler
- Added other debug messages, and rewritten some cycles for good readability and good software engineering
- Fixed more uninitialized stucture bug (maybe I had some sawdust in my
brain when I did this?)
- Fixed concurrency bug in home screen
Now program takes less space in RAM.
All variables, costants and Lists are moved before the SID song,
in a previously unused space (BASIC RAM).
SID song edit has been changed:
- same song but slightly different
- takes up a bit less than 4k
- more catchy :-)
- perfectly fits in $1000-$2000 and allows...
...the new custom charset to be put at $2000!
- Taken TGGS font and properly customized with tiles
Now actual program starts at $2800.
Also added some useful code for assembler to output debug infos when
assembling with -DDEBUG=1
In the meanwhile discovered tremendous subtle bug due to uninitialized
structure (listX and listY). Fixed.
Memory map now is:
+-------------------------------+
0000 | things in zero page |
| and low RAM |
+-------------------------------+
0800 | BASIC autostart |
| then data (variables, |
| costants and strings) | <-- this can be done better using segments. Reminder for the future.
| |
+-------------------------------+
0E00 | listX |
+-------------------------------+
0F00 | listY |
+-------------------------------+
1000 | SID song |
| |
| |
+-------------------------------+
2000 | TGGS Custom font charset |
| |
+-------------------------------+
2800 | ACTUAL CODE |
| | <-- plus some garbage data, see above (segments TODO)
. .
. .
- Added multicolor graphic mode with custom charset, for text and tiles
- Added some debug options in Makefile
NOTE: code is functioning and correct, but really needs a big cleanup a
logical reorganization!
Improved introPrint.
Adjusted gameover routine to work with the new intro.
This needs to be further improved anyway to give a sensible delay before
clearing the screen (to allow player to see her/his score)
Now it is ways better (it simply does `random number` modulo `screen rows`
- or columns, depends).
There also was an error in comparing snakeX,Y with new piece of food's X,Y
Now really fixed (I hope, at least, since the bug is terribly difficult to
reproduce)
Also improved printing routine: now it can print general hexadecimal numbers,
and can locate them everywhere across first line (and beyond also, since it
is not checked, but if you do, you are a moron). Simply put byte to be print
in accumulator, column in Y index, and then jsr.
the pseudo-random routine pseudo-randomly generated X,Y for new piece of food
that corresponded to immediately next snake head position.
This X,Y resulted empty when checked in the routine, but suddenly after it
is overwritten with snake head, so food simply disappears.
This leads to impossible game play, because no new pieces of food are
generated if no food is previously eaten, but there is no food to eat, so...
Hope to have fixed.