From 13028d431eb4951fd641a27d6197e1ab27f7f50b Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 23 Jul 2019 23:01:17 -0400 Subject: [PATCH] recipes/sms/romasm: limit mmap size Otherwise, we overflow into the RAM mirror, which means we overwrite the beginning of the RAM. --- recipes/sms/romasm/glue.asm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/recipes/sms/romasm/glue.asm b/recipes/sms/romasm/glue.asm index a68ed0a..9379f5c 100644 --- a/recipes/sms/romasm/glue.asm +++ b/recipes/sms/romasm/glue.asm @@ -54,6 +54,7 @@ #include "stdio.asm" .equ MMAP_START 0xd800 +.equ MMAP_LEN RAMEND-MMAP_START #include "mmap.asm" .equ BLOCKDEV_RAMSTART STDIO_RAMEND @@ -94,16 +95,19 @@ init: inc hl ld a, 'S' ld (hl), a - call fsInit - xor a - call blkSel - - call kbdInit - call vdpInit ld hl, kbdGetC ld de, vdpPutC call stdioInit + call fsInit + xor a + ld de, BLOCKDEV_SEL + call blkSel + call fsOn + + call kbdInit + call vdpInit + call shellInit jp shellLoop