From fadcda80505dc0f0d27feead7802e22b2c4d751d Mon Sep 17 00:00:00 2001 From: Brad Grantham Date: Sat, 28 Jul 2018 12:12:40 -0700 Subject: [PATCH] use 40 columns for screen --- main.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index 75b2d90..ec50434 100644 --- a/main.c +++ b/main.c @@ -1,21 +1,24 @@ char *title = "Apple IIa"; unsigned char title_length = 9; -unsigned char *text_page1_base = (unsigned char *)0x400; +volatile unsigned char *text_page1_base = (unsigned char *)0x400; +volatile unsigned char *text_page2_base = (unsigned char *)0x800; int main(void) { - int offset = (80 - title_length) / 2; + int offset = (40 - title_length) / 2; - unsigned char *loc = text_page1_base + offset; + volatile unsigned char *loc = text_page1_base + offset; int i; - for(i = 0; i < 80 * 24; i++) + for(i = 0; i < (40 + 40 + 65) * 8; i++) { text_page1_base[i] = ' ' | 0x80; + } - for(i = 0; i < title_length; i++) + for(i = 0; i < title_length; i++) { loc[i] = title[i] | 0x80; + } while(1); }