/* We use flexible 16K banks so use the helper */
#define CONFIG_BANK16
#define CONFIG_BANKS 4
+/* 512Kbyte RAM in 16K chunks is 32. 3 reserved?
+ Since we *could* have 1MByte this should be larger.. 64-3
+*/
#define MAX_MAPS 32-3
#define MAPBASE 0x0000
/* And swapping */
#define MAX_SWAPS 32
#define swap_map(x) ((uint8_t *)(x & 0x3fff ))
-/* The Drivewire block dev rawmode=1 doesn't work just now
- with the bank16k.c memory layout (yet), so we have to
- use legacy binary loading... */
-#define CONFIG_LEGACY_EXEC
+#undef CONFIG_LEGACY_EXEC
#define TICKSPERSEC 50 /* Ticks per second */
_devsd_write
pshs y
ldy #512 ; 512 bytes
+ tst _blk_op+2 ; test user/kernel xfer
+ beq WrBiz ; if zero then stay in kernel space
+ jsr map_process_always ; else flip to user space
WrBiz lda SDCTL
cmpa #$a0
bne WrBiz ; space not available
sta SDDATA ; store to SD
leay -1,y
bne WrBiz ; next
- puls y,pc
+ puls y
+ jmp map_kernel ; reset to kernel space (tail optimise)
;;; Read 512 bytes from SDC
_devsd_read
pshs y
ldy #512 ; 512 bytes
+ tst _blk_op+2 ; test user/kernel xfer
+ beq RdBiz ; if zero then stay in kernel space
+ jsr map_process_always ; else flip to user space
RdBiz lda SDCTL
cmpa #$e0
bne RdBiz ; byte not available
sta ,x+ ; store byte in sector buffer
leay -1,y
bne RdBiz ; next
- puls y,pc
+ puls y
+ jmp map_kernel ; reset to kernel space (tail optimise)