From fb260ef17f28305321a9932b710bd8f30f243dfc Mon Sep 17 00:00:00 2001
From: Fabrizio Caruso <fabrizio_caruso@hotmail.com>
Date: Wed, 9 Oct 2019 09:23:57 +0200
Subject: [PATCH 056/170] Init is no longer in crt0.s
---
cfg/supervision.cfg | 2 +-
libsrc/supervision/crt0.s | 5 +----
samples/supervisionhello.c | 9 ++++++++-
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/cfg/supervision.cfg b/cfg/supervision.cfg
index 95f04976..d9f189f2 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;
- FFEA: load = ROM, type = ro, offset = $7FEA;
+ FFF0: load = ROM, type = ro, offset = $7FF0;
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 f1c65538..ac61c821 100644
--- a/libsrc/supervision/crt0.s
+++ b/libsrc/supervision/crt0.s
@@ -65,11 +65,8 @@ not_dma:
.endproc
; Removing this segment gives only a warning.
- .segment "FFEA"
+ .segment "FFF0"
.proc reset32kcode
- lda #160
- sta lcd_width
- sta lcd_height
lda #(6<<5) | SV_LCD_ON | SV_NMI_ENABLE_ON
sta sv_bank
; Now, the 32Kbyte image can reside in the top of 64Kbyte and 128Kbyte ROMs.
diff --git a/samples/supervisionhello.c b/samples/supervisionhello.c
index 7cc866e5..db2b5f66 100755
--- a/samples/supervisionhello.c
+++ b/samples/supervisionhello.c
@@ -60,8 +60,15 @@ void display_char(const unsigned char x, const unsigned char y, const unsigned c
}
}
+void init_lcd(void)
+{
+ SV_LCD.width = 160;
+ SV_LCD.height = 160;
+}
+
int main()
-{
+{
+ init_lcd();
clear_screen();
display_char(3,2, h_char);
--
2.26.0