#include #define LCD_BYTES_COLS 20 #define LCD_ROW_BYTES 30 //#define LCD_BOTTOM_ROW (0x4C00 + 30 * 99 + 1) #define LCD_BOTTOM_ROW (void *)0x579A unsigned long blocks = 0; //0xBA3E6000; char spacing_count, platform_row = 0; void scroll_up() { memcpy(LCD_MEM, LCD_MEM + LCD_ROW_BYTES, LCD_ROW_BYTES * LCD_HEIGHT); } void draw_platform() { if (platform_row == 4) { } else { int i; unsigned long bits = 0x80000000; char *lcd = LCD_BOTTOM_ROW; for (i = 0; i < 20; i++){ if (blocks & bits) { if (platform_row == 0 || platform_row == 3) { lcd[i] = 0xFF; } else { lcd[i] = random(0xFF); } } bits >>= 1; } platform_row++; } } void _main(void) { unsigned char ball[] = {0x78,0x9C,0xBC,0xFC,0xFC,0x78}; int i; //clrscr(); // memset((char *)0x4C00 + (30 * 100), 0, 20); // Not needed due to ClrScr() for (i = 0; i < 100; i++) { scroll_up(); } randomize(); for (i = 0; i < 300; i++) { blocks = random(0xFFFFFFFF); draw_platform(); scroll_up(); draw_platform(); scroll_up(); draw_platform(); scroll_up(); draw_platform(); int j; for (j = 0; j < 10; j++) { scroll_up(); } } // long int *mem = (void *)0x4C00; // *mem = 0xFFFFFFFF; // clrscr(); // Sprite8(0, 0, 6, ball, LCD_MEM, SPRT_XOR); ngetchx(); }