CH376_USB_INT_CONNECT = $15
CH376_USB_INT_DISCONNECT = $16
CH376_USB_INT_BUF_OVER = $17
-CH376_USB_INT_USB_READY = $18
-CH376_USB_INT_DISK_READ = $1D
+CH376_USB_INT_USB_READY = $18
+CH376_USB_INT_DISK_READ = $1D
CH376_USB_INT_DISK_WRITE = $1E
CH376_USB_INT_DISK_ERR = $1F
-CH376_ERR_OPEN_DIR = $41
-CH376_ERR_MISS_FILE = $42
+CH376_ERR_OPEN_DIR = $41
+CH376_ERR_MISS_FILE = $42
CH376_ERR_FOUND_NAME = $43
CH376_ERR_DISK_DISCON = $82
CH376_ERR_LARGE_SECTOR = $84
CH376_ERR_TYPE_ERROR = $92
-CH376_ERR_BPB_ERROR = $A1
-CH376_ERR_DISK_FULL = $B1
-CH376_ERR_FDT_OVER = $B2
+CH376_ERR_BPB_ERROR = $A1
+CH376_ERR_DISK_FULL = $B1
+CH376_ERR_FDT_OVER = $B2
CH376_ERR_FILE_CLOSE = $B4
-CH376_GET_IC_VER = $01
-CH376_SET_BAUDRATE = $02
+CH376_GET_IC_VER = $01
+CH376_SET_BAUDRATE = $02
CH376_GET_ENTER_SLEEP = $03
-CH376_RESET_ALL = $05
-CH376_CHECK_EXIST = $06
+CH376_RESET_ALL = $05
+CH376_CHECK_EXIST = $06
CH376_GET_FILE_SIZE = $0C
CH376_SET_USB_MODE = $15
CH376_GET_STATUS = $22
CH376_RD_USB_DATA0 = $27
-CH376_CMD_WR_REQ_DATA = $2D
-CH376_SET_FILE_NAME = $2F
+CH376_CMD_WR_REQ_DATA = $2D
+CH376_SET_FILE_NAME = $2F
CH376_DISK_CONNECT = $30 ; check the disk connection status
-CH376_DISK_MOUNT = $31
-CH376_FILE_OPEN = $32
-CH376_FILE_ENUM_GO = $33
-CH376_FILE_CREATE = $34
+CH376_DISK_MOUNT = $31
+CH376_FILE_OPEN = $32
+CH376_FILE_ENUM_GO = $33
+CH376_FILE_CREATE = $34
CH376_FILE_CLOSE = $36
-CH376_BYTE_LOCATE = $39
-CH376_BYTE_READ = $3A
-CH376_BYTE_RD_GO = $3B
-CH376_BYTE_WRITE = $3C
-CH376_BYTE_WR_GO = $3D
-CH376_DISK_CAPACITY = $3E
-CH376_DISK_RD_GO = $55
+CH376_BYTE_LOCATE = $39
+CH376_BYTE_READ = $3A
+CH376_BYTE_RD_GO = $3B
+CH376_BYTE_WRITE = $3C
+CH376_BYTE_WR_GO = $3D
+CH376_DISK_CAPACITY = $3E
+CH376_DISK_RD_GO = $55
.proc _ch376_file_close
lda #CH376_FILE_CLOSE
- .export _open
- .import addysp,popax
- .importzp sp,tmp2,tmp3,tmp1
+ .export _open
+ .import addysp,popax
+ .importzp sp,tmp2,tmp3,tmp1
- .include "telestrat.inc"
- .include "errno.inc"
- .include "fcntl.inc"
+ .include "telestrat.inc"
+ .include "errno.inc"
+ .include "fcntl.inc"
; int open (const char* name, int flags, ...); /* May take a mode argument */
.proc _open
; Throw away any additional parameters passed through the ellipsis
- dey ; Parm count < 4 shouldn't be needed to be...
- dey ; ...checked (it generates a c compiler warning)
- dey
- dey
- beq parmok ; Branch if parameter count ok
- jsr addysp ; Fix stack, throw away unused parameters
+ dey ; Parm count < 4 shouldn't be needed to be...
+ dey ; ...checked (it generates a c compiler warning)
+ dey
+ dey
+ beq parmok ; Branch if parameter count ok
+ jsr addysp ; Fix stack, throw away unused parameters
; Parameters ok. Pop the flags and save them into tmp3
parmok: jsr popax ; Get flagss
- sta tmp3 ; save flags
+ sta tmp3 ; save flags
; Get the filename from stack and parse it. Bail out if is not ok
-
- jsr popax ; Get name
- ldy tmp3 ; Get flags again
- BRK_TELEMON XOPEN ; launch primitive ROM
- rts
+ jsr popax ; Get name
+ ldy tmp3 ; Get flags again
+ BRK_TELEMON XOPEN ; launch primitive ROM
+ rts
.endproc
\ No newline at end of file