microdrive: map the correct page
authorAlan Cox <alan@linux.intel.com>
Mon, 20 Apr 2015 21:40:33 +0000 (22:40 +0100)
committerAlan Cox <alan@linux.intel.com>
Mon, 20 Apr 2015 21:40:33 +0000 (22:40 +0100)
Kernel/platform-zx128/microdrive.s

index a0ce7de..009b63c 100644 (file)
@@ -447,7 +447,7 @@ _mdv_bread:
                ld de, (current_map)            ; Current map into e
                ld a, (_mdv_page)
                or a
-               ld a, e                         ; Save old map
+               push de
                push af
                call nz, switch_bank            ; Switch if mdv_page set
                call mdv_fetch                  ; Do the I/O
@@ -459,6 +459,8 @@ poprete:
                xor a
                ld h, a
                pop af
+               pop de
+               ld a, e
                call nz, switch_bank            ; Switch bank if needed
                ret
 
@@ -466,7 +468,7 @@ _mdv_bwrite:
                ld de, (current_map)
                ld a, (_mdv_page)
                or a
-               ld a, e
+               push de
                push af
                call nz, switch_bank
                call mdv_store