#include #include #include "const.h" #include #include "char_rom.h" volatile uint16_t frame; volatile uint16_t line; volatile char line_buffer[LINE_BUFFER_SIZE]; ISR(INT0_vect, ISR_NAKED) { asm("jmp int_vertical_sync"); } ISR(INT1_vect, ISR_NAKED) { asm("jmp int_horizontal_sync"); } ISR(TIMER0_COMPA_vect, ISR_NAKED) { asm("jmp int_timer_0"); } void setup_c() { /* for (int i = 0; i < LINE_BUFFER_SIZE; ++i) { line_buffer[i] = (i % 2) ? 0x0 : 0xff; } */ } void loop_c() { const char* text = "1010 RETROFF"; const text_len = strlen(text); for (;;) { const int current_line = line; if (current_line < 76) { memset(line_buffer, 0, LINE_BUFFER_SIZE); } else if (current_line < 80) { for (uint8_t i = 0; i < text_len; ++i) { memcpy(line_buffer + 12 * i, char_rom + (text[i] - '0') * 14 + 0, 10); } } else if (current_line < 88) { for (uint8_t i = 0; i < text_len; ++i) { memcpy(line_buffer + 12 * i, char_rom + (text[i] - '0') * 14 + 10, 10); } } else if (current_line < 96) { for (uint8_t i = 0; i < text_len; ++i) { memcpy(line_buffer + 12 * i, char_rom + (text[i] - '0') * 14 + 20, 10); } } else if (current_line < 104) { for (uint8_t i = 0; i < text_len; ++i) { memcpy(line_buffer + 12 * i, char_rom + (text[i] - '0') * 14 + 30, 10); } } else if (current_line < 112) { for (uint8_t i = 0; i < text_len; ++i) { memcpy(line_buffer + 12 * i, char_rom + (text[i] - '0') * 14 + 40, 10); } } else if (current_line < 120) { for (uint8_t i = 0; i < text_len; ++i) { memcpy(line_buffer + 12 * i, char_rom + (text[i] - '0') * 14 + 50, 10); } } else if (current_line < 128) { for (uint8_t i = 0; i < text_len; ++i) { memcpy(line_buffer + 12 * i, char_rom + (text[i] - '0') * 14 + 60, 10); } } /* else if (current_line < 136) { for (uint8_t i = 0; i < text_len; ++i) { memcpy(line_buffer + 12 * i, char_rom + (text[i] - '0') * 14 + 70, 10); } } else if (current_line < 144) { for (uint8_t i = 0; i < text_len; ++i) { memcpy(line_buffer + 12 * i, char_rom + (text[i] - '0') * 14 + 80, 10); } } else if (current_line < 152) { for (uint8_t i = 0; i < text_len; ++i) { memcpy(line_buffer + 12 * i, char_rom + (text[i] - '0') * 14 + 90, 10); } } else if (current_line < 160) { for (uint8_t i = 0; i < text_len; ++i) { memcpy(line_buffer + 12 * i, char_rom + (text[i] - '0') * 14 + 100, 10); } } else if (current_line < 168) { for (uint8_t i = 0; i < text_len; ++i) { memcpy(line_buffer + 12 * i, char_rom + (text[i] - '0') * 14 + 110, 10); } } else if (current_line < 176) { for (uint8_t i = 0; i < text_len; ++i) { memcpy(line_buffer + 12 * i, char_rom + (text[i] - '0') * 14 + 120, 10); } } else if (current_line < 184) { for (uint8_t i = 0; i < text_len; ++i) { memcpy(line_buffer + 12 * i, char_rom + (text[i] - '0') * 14 + 130, 10); } } */ else if (current_line < 192) { memset(line_buffer, 0, LINE_BUFFER_SIZE); } } }