Open dansanderson opened 7 months ago
Reset all mappings:
;; remove megabyte maps (setting them to 0 again)
lda #$00
ldx #$0f
ldy #$00
ldz #$0f
map
;; now zero all registers and remove all maps
tax
tay
taz
map
eom
@lydon42 Is the issue that the upper bytes of the MAP register are not reset when you do a <1MB MAP setting, or that they are? You're mentioning the zeroing sequence as if that needs emphasis, which suggests the former.
Full notes from @ki-bo (discord), emphasis mine:
Note also that if you enable >1MB mapping with
lda #$ff
ldx #$0f
ldy #$00
ldz #$00
map
then you won't disable the MB part with setting A,X,Y,Z to zero. The MB part will still stay. You need to disable MB mapping like this, too:
lda #$00
ldx #$0f
ldy #$00
ldz #$0f
map
So, to be really sure all mappings are reset, you can do this:
lda #$00
ldx #$0f
ldy #$00
ldz #$0f
map
tax
tay
taz
map
eom
You may want to edit the title to "Mention that >1MB MAP is not reset by the next MAP instruction"
Done. :)
The >1MB MAP register can be set by performing a MAP twice with special values. If you perform another MAP without the special >1MB values, the upper bytes of the register retain their values. This should be mentioned in the Memory section about >1MB mapping. If a program ever sets the upper bytes, it must reset them (with two calls to MAP) when re-mapping to lower addresses.