msx2: fix memory sizing
authorgeijoenr <enric.geijo@gmail.com>
Tue, 27 Jan 2015 18:41:59 +0000 (18:41 +0000)
committergeijoenr <enric.geijo@gmail.com>
Tue, 27 Jan 2015 23:13:19 +0000 (23:13 +0000)
no need to write a byte on every page, specially
after we have already copied the kernel on it.

Kernel/platform-msx2/msx2.s

index 5da5342..16d43eb 100644 (file)
@@ -141,12 +141,12 @@ init_hardware:
             .area _COMMONMEM
 
 ;
-; Size currently selected memory mapper
+; Size currently selected memory mapper (this should be done during bootstrap)
 ;
 size_memory:
            ld bc, #0x03FC              ; make sure ram page 3 is selected
            out (c), b
-           ld hl, #8                   ; good a target as any
+           ld hl, #3FFF                ; careful, there is code in page 3
            ld (hl), #0xAA              ; we know there is a low page!
            ld bc, #0x04FC              ; continue with page 4
 ramscan_2:
@@ -155,9 +155,6 @@ ramscan:
            out (c), b
            cp (hl)                     ; is it 0xAA
            jr z, ramwrapped            ; we've wrapped (hopefully)
-           ld (hl), a
-           cp (hl)
-           jr nz, ramerror             ; ermm.. help ???
            inc b
            jr nz, ramscan
            jr ramerror                 ; not an error we *could* have 256 pages!