mirror of
https://github.com/irmen/prog8.git
synced 2024-11-17 13:05:53 +00:00
added missing cmp #0 after func()==0
cx16: diskio.fastmode() now returns success boolean
This commit is contained in:
parent
385dd6fc23
commit
08b8fe01ab
@ -1454,6 +1454,7 @@ internal class AssignmentAsmGen(private val program: PtProgram,
|
||||
in ByteDatatypes -> {
|
||||
assignExpressionToRegister(expr.left, RegisterOrPair.A, dt==DataType.BYTE)
|
||||
asmgen.out("""
|
||||
cmp #0
|
||||
beq +
|
||||
lda #1
|
||||
+ eor #1""")
|
||||
|
@ -32,8 +32,9 @@ 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
|
||||
sub fastmode(ubyte mode) -> bool {
|
||||
; -- set fast serial mode (0=none, 1=auto_tx, 2=fast writes, 3=both) for the SD card.
|
||||
; Returns success status (fails on emulator host fs for example)
|
||||
list_filename[0] = 'u'
|
||||
list_filename[1] = '0'
|
||||
list_filename[2] = '>'
|
||||
@ -41,6 +42,7 @@ diskio {
|
||||
list_filename[4] = mode | $30
|
||||
list_filename[5] = 0
|
||||
send_command(list_filename)
|
||||
return status_code()==0
|
||||
}
|
||||
|
||||
sub directory() -> bool {
|
||||
|
@ -7,7 +7,18 @@
|
||||
|
||||
main {
|
||||
sub start() {
|
||||
txt.iso()
|
||||
cx16.iso_cursor_char(iso:'_')
|
||||
str command = "u0>b1"
|
||||
diskio.send_command(command)
|
||||
;txt.print(diskio.status())
|
||||
txt.print_bool(diskio.status_code()==0)
|
||||
txt.nl()
|
||||
txt.print_bool(status_code()==0)
|
||||
txt.nl()
|
||||
;txt.print_bool(diskio.status_code()==0)
|
||||
}
|
||||
|
||||
sub status_code() -> ubyte {
|
||||
cx16.r0++
|
||||
return 30
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user