Blob Blame History Raw
From cdb8035cf0228a2194c7bfe9216e4897777b60a9 Mon Sep 17 00:00:00 2001
From: Fabrizio Caruso <fabrizio_caruso@hotmail.com>
Date: Thu, 3 Oct 2019 23:32:16 +0200
Subject: [PATCH 049/170] Move screen init into crt0.s

---
 cfg/supervision.cfg        | 2 +-
 libsrc/supervision/crt0.s  | 5 ++++-
 samples/supervisionhello.c | 9 ---------
 3 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/cfg/supervision.cfg b/cfg/supervision.cfg
index d9f189f2..6a71f468 100644
--- a/cfg/supervision.cfg
+++ b/cfg/supervision.cfg
@@ -19,7 +19,7 @@ SEGMENTS {
     CODE:     load = ROM,            type = ro,  define   = yes;
     RODATA:   load = ROM,            type = ro,  define   = yes;
     DATA:     load = ROM, run = RAM, type = rw,  define   = yes;
-    FFF0:     load = ROM,            type = ro,  offset   = $7FF0;
+    FFF0:     load = ROM,            type = ro,  offset   = $7FEA;
     VECTOR:   load = ROM,            type = ro,  offset   = $7FFA;
     BSS:      load = RAM,            type = bss, define   = yes;
 }
diff --git a/libsrc/supervision/crt0.s b/libsrc/supervision/crt0.s
index 6c128786..ab147efb 100644
--- a/libsrc/supervision/crt0.s
+++ b/libsrc/supervision/crt0.s
@@ -67,7 +67,10 @@ not_dma:
 ; Removing this segment gives only a warning.
         .segment "FFF0"
 .proc reset32kcode
-        lda     #(6<<5)
+        lda     #$A0
+        sta     lcd_width
+        sta     lcd_height
+        lda     #$C9
         sta     sv_bank
 ; Now, the 32Kbyte image can reside in the top of 64Kbyte and 128Kbyte ROMs.
         jmp     reset
diff --git a/samples/supervisionhello.c b/samples/supervisionhello.c
index 9b09a773..5996d219 100755
--- a/samples/supervisionhello.c
+++ b/samples/supervisionhello.c
@@ -34,19 +34,10 @@ unsigned char bit_reverse(unsigned char n)
     return (bit_reverse_lookup[n&0b1111] << 4) | bit_reverse_lookup[n>>4];
 }
 
-void init_screen(void)
-{
-    SV_LCD.height = 0xA0;
-    SV_LCD.width = 0xA0;
-    SV_BANK = 0xC9;     
-}
-
 int main()
 {
     unsigned char i;
     
-    init_screen();
-    
     clear_screen();
     
     for(i=0;i<8;++i)
-- 
2.26.0