#include #include #include #include #include #include #include #define Screen ((byte *)0x0400) #define Color ((byte *)0xd800) static const char * maze[16] = { "################", "#..........#...#", "#.###.####.###.#", "#........#.#.#.#", "##.#####.###.#.#", "#..#......##.#.#", "#.##.####......#", "#.#.....#.####.#", "#.#####.#....#.#", "#.......######.#", "#.##.####......#", "#.#..##....###.#", "#.##....#....#.#", "#.#####.######.#", "#..............#", "################", }; void maze_init(void) { } static char zxdist0[] = {18, 6, 4, 3, 2, 1, 0}; static char zxdist1[] = { 9, 5, 3, 2, 1, 0, 0}; // Put one char on screen inline void screen_put(byte x, byte y, char ch, char color) { __assume(y < 25); Screen[40 * y + x] = ch; Color[40 * y + x] = color; } // Get one char from screen inline char screen_get(byte x, byte y) { __assume(y < 25); return Screen[40 * y + x]; } sbyte px = 1, py = 3, dx = 1, dy = 0; void maze_draw(const char * zxdist) { sbyte ix = px, iy = py; sbyte sx = 0; for(char i=0; i<7; i++) { sbyte tx = 20 - zxdist[i]; sbyte ty = sx / 4; sbyte by = 25 - sx; if (maze[iy][ix] == '#') { for(char cy=0; cy