mirror of
https://github.com/irmen/prog8.git
synced 2025-02-03 11:32:41 +00:00
cx16: added diskio.fastmode() to select the fast serial disk mode for the SD card
This commit is contained in:
parent
b385dc8c26
commit
9af4168ae2
@ -32,6 +32,17 @@ diskio {
|
||||
cbm.CHKOUT(WRITE_IO_CHANNEL)
|
||||
}
|
||||
|
||||
sub fastmode(ubyte mode) {
|
||||
; -- set fast serial mode (0=none, 1=auto_tx, 2=fast writes, 3=both) for the SD card
|
||||
list_filename[0] = 'u'
|
||||
list_filename[1] = '0'
|
||||
list_filename[2] = '>'
|
||||
list_filename[3] = 'b'
|
||||
list_filename[4] = mode | $30
|
||||
list_filename[5] = 0
|
||||
send_command(list_filename)
|
||||
}
|
||||
|
||||
sub directory() -> bool {
|
||||
; -- Prints the directory contents to the screen. Returns success.
|
||||
|
||||
|
@ -9,6 +9,7 @@ main {
|
||||
uword duration
|
||||
ubyte[256] bonkbuffer
|
||||
|
||||
;; diskio.fastmode(1)
|
||||
set_screen_mode()
|
||||
cbm.SETTIM(0,0,0)
|
||||
|
||||
|
@ -8,8 +8,6 @@ main {
|
||||
const ubyte HIRAM_START_BANK = 4
|
||||
uword large = memory("large", 20000, 256)
|
||||
|
||||
bool verify = false
|
||||
|
||||
ubyte[256] buffer = 0 to 255
|
||||
uword @zp buf_ptr
|
||||
|
||||
@ -17,10 +15,11 @@ main {
|
||||
txt.print("\n\ndisk benchmark on drive 8.\n")
|
||||
|
||||
txt.print("with verification? y/n: ")
|
||||
cx16.r0L = cbm.CHRIN()
|
||||
bool verify = cbm.CHRIN()=='y'
|
||||
txt.print("\nfast serial mode r+w? y/n: ")
|
||||
bool fastserial = cbm.CHRIN()=='y'
|
||||
txt.nl()
|
||||
if cx16.r0L=='y' {
|
||||
verify=true
|
||||
if verify {
|
||||
; fill the buffers with random data, and calculate the checksum
|
||||
for cx16.r0 in 0 to 19999 {
|
||||
large[cx16.r0] = math.rnd()
|
||||
@ -33,6 +32,11 @@ main {
|
||||
uword crc32_h = cx16.r15
|
||||
}
|
||||
|
||||
if fastserial
|
||||
diskio.fastmode(3)
|
||||
else
|
||||
diskio.fastmode(0)
|
||||
|
||||
test_save()
|
||||
test_save_blocks()
|
||||
test_load_hiram()
|
||||
|
@ -29,6 +29,7 @@ main {
|
||||
ubyte vera_rate
|
||||
|
||||
sub start() {
|
||||
;; diskio.fastmode(1)
|
||||
txt.print("name of .wav file to play on drive 8: ")
|
||||
while 0==txt.input_chars(MUSIC_FILENAME) {
|
||||
; until user types a name...
|
||||
|
@ -12,6 +12,7 @@ main {
|
||||
str filename = "?"*40
|
||||
|
||||
repeat {
|
||||
;; diskio.fastmode(1)
|
||||
txt.print("\nenter bmx image filename: ")
|
||||
if txt.input_chars(&filename)!=0 {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user