]> cloudbase.mooo.com Git - z180-stamp.git/commitdiff
loadcpm3(): set environment variable 'cpm3_scb' with base of scb (physical address)
authorLeo C <erbl259-lmu@yahoo.de>
Wed, 1 Jun 2016 19:19:47 +0000 (21:19 +0200)
committerLeo C <erbl259-lmu@yahoo.de>
Wed, 1 Jun 2016 19:19:47 +0000 (21:19 +0200)
avr/cmd_loadcpm3.c
avr/main.c
include/config.h

index f24ee19352d2722cc62181c8c2f5aedff40ac2ef..6b2f62fe320f9f4665e5b3fecb22d4a30697f411 100644 (file)
@@ -143,6 +143,9 @@ command_ret_t do_loadcpm3(cmd_tbl_t *cmdtp, int flag, int argc, char * const arg
                common_base = (uint16_t) buffer[0] + (buffer[1] << 8);
                setenv_hex(PSTR(ENV_CPM3_COMMON_BASE), common_base);
        }
+
+       setenv_hex(PSTR(ENV_CPM3_SCB), mem_top - ((res_len - (6 - 1)) << 8) + common_base);
+
        /* Main System Load     */
 
        /* Load Common Portion of System */
index 7796a36bf4d0245c5c6894eec3011d46cb5b8be5..423b48a7806e8a11ad7f528fdf99152af3c8f83b 100644 (file)
@@ -31,7 +31,7 @@ uint8_t mcusr __attribute__ ((section (".noinit")));
 __attribute__ ((naked)) __attribute__ ((section (".init3")))
 void preset_ram (void)
 {
-       for (uint8_t *p = RAMSTART; p <= (uint8_t *) RAMEND; p++)
+       for (uint8_t *p = (uint8_t *) RAMSTART; p <= (uint8_t *) RAMEND; p++)
                *p = 0xdd;
 
 }
index e20e094303a61a8f2614518a600c6af4454d883b..d0a1b31dc469d6213156ec993afcd7a1eec9c135 100644 (file)
@@ -19,6 +19,7 @@
 #define ENV_CPM3_SYSFILE               "cpm3_file"
 #define ENV_CPM3_COMMON_BASE   "cpm3_commonbase"
 #define ENV_CPM3_BANKED_BASE   "cpm3_bankedbase"
+#define ENV_CPM3_SCB                   "cpm3_scb"
 
 #define ENV_PINALIAS                   "pin_alias"
 #define ENV_STARTADDRESS               "startaddress"