diff --git a/c64/kernal/membot.s b/c64/kernal/membot.s index affd36ce..476eefab 100644 --- a/c64/kernal/membot.s +++ b/c64/kernal/membot.s @@ -1,7 +1,14 @@ ; Function defined on pp272-273 of C64 Programmers Reference Guide membot: ; p287 C64 Programmers reference guide - ; For now, we only read it, not allow setting it - LDX #<$0800 - LDY #>$0800 + ;; http://unusedino.de/ec64/technical/project64/mapping_c64.html + bcc membot_set + + LDX MEMSTR+0 + LDY MEMSTR+1 + rts +membot_set: + stx MEMSTR+0 + stx MEMSTR+1 + rts diff --git a/c64/kernal/memtop.s b/c64/kernal/memtop.s index 9ea705ef..548ba1a9 100644 --- a/c64/kernal/memtop.s +++ b/c64/kernal/memtop.s @@ -2,6 +2,14 @@ memtop: ; p288 C64 Programmer's reference guide ; but for now we only support reading it - LDX #<$9FFF - LDY #>$9FFF + ;; http://unusedino.de/ec64/technical/project64/mapping_c64.html + bcc memtop_set + + LDX MEMSIZ+0 + LDY MEMSIZ+1 + rts +memtop_set: + stx MEMSIZ+0 + stx MEMSIZ+1 + rts diff --git a/c64/kernal/ramtas.s b/c64/kernal/ramtas.s index 452907a8..c9fa503f 100644 --- a/c64/kernal/ramtas.s +++ b/c64/kernal/ramtas.s @@ -45,6 +45,9 @@ ramtas_l2: ;; Work out RAM size and put in MEMSTR and MEMSIZ ;; "Compute's Mapping the 64", p54 + ;; http://unusedino.de/ec64/technical/project64/mapping_c64.html + lda #>$0800 + sta MEMSTR+1 lda #$00 sta MEMSTR+0 sta MEMSIZ+0