]> git.sur5r.net Git - cc65/commitdiff
Correcting some bugs
authorjede <jede@oric.org>
Wed, 4 Jan 2017 19:03:19 +0000 (20:03 +0100)
committerjede <jede@oric.org>
Wed, 4 Jan 2017 19:03:19 +0000 (20:03 +0100)
include/telemon.h [new file with mode: 0644]
libsrc/telemon30/_open.s
libsrc/telemon30/ch376.s

diff --git a/include/telemon.h b/include/telemon.h
new file mode 100644 (file)
index 0000000..70033a9
--- /dev/null
@@ -0,0 +1,58 @@
+
+void print (char *);
+
+void hires();
+void text();
+void oups();
+void ping();
+void zap();
+void shoot();
+void explode();
+
+void paper(char color);
+void ink(char color);
+
+void kbdclick1();
+
+
+
+void curset(char x,char y);
+void circle(char rayon);
+
+char key(void);
+
+
+/* PEEK, POKE, DEEK, DOKE */
+
+#define POKE(addr,val)     (*(unsigned char*) (addr) = (val))
+
+
+#define PCHN_1   001
+#define PCHN_2   002
+#define PCHN_12  003
+#define PCHN_3   004
+#define PCHN_13  005
+#define PCHN_23  006
+#define PCHN_123 007
+
+#define ENV_DECAY       001  /* \_________ envelope */
+#define ENV_ATTACK_CUT  002  /* /_________ envelope */
+#define ENV_SAW_DOWN    003  /* \\\\\\\\\\ envelope */
+#define ENV_WAVE        004  /* /\/\/\/\/\ envelope */
+#define ENV_DECAY_CONT  005  /* \~~~~~~~~~ envelope */
+#define ENV_SAW_UP      006  /* ////////// envelope */
+#define ENV_ATTACK_CONT 007  /* /~~~~~~~~~ envelope */
+
+#define VOL_ENVELOPE  0x0
+#define VOL_QUIETEST  0x1
+#define VOL_LOUDEST   0xe
+
+extern int play(int soundchanels,int noisechanels,int envelop,int volume);
+
+
+/* Play a musical tone through the selected channel. */
+
+#define CHAN_1   1
+#define CHAN_2   2
+#define CHAN_3   3
+
index f308632d92e310f9c6a3d1c3430ca22e0cc0134a..a002bbce18bdb87c8ae22d578a9efc5d22d9e760 100644 (file)
@@ -3,7 +3,9 @@
                .importzp sp,tmp2,tmp3,tmp1
                ; int open (const char* name, int flags, ...);    /* May take a mode argument */
     .include        "telemon30.inc"
-               
+       .include                "errno.inc"
+       .include        "fcntl.inc"     
+       
 .proc _open
 ; Throw away any additional parameters passed through the ellipsis
 
 
 ; Parameters ok. Pop the flags and save them into tmp3
 
-parmok: jsr     popax           ; Get flags
+parmok: jsr     popax           ; Get flagss
+               sta             tmp3 ; save flags
+               
+               ;AND            #O_RDONLY
+               ;beq    READONLY
+               ;lda tmp3
+               ;AND #O_WRONLY
+               ;beq WRITEONLY
+               ;jmp next
 
+;READONLY:
+;              lda #'r'
+;              BRK_TELEMON XWR0
+;              jmp next
+;WRITEONLY:    
+;              lda #'w'
+;              BRK_TELEMON XWR0        
+               
+;next:         
 ; Get the filename from stack and parse it. Bail out if is not ok
 
         jsr     popax           ; Get name
-
+               
+               
+               ldy tmp3 ; Get flags
+               
                
                BRK_TELEMON XOPEN
                
index 90e2878e1a3528c5caa2130f6ba3867142530cc6..24df14471f8ae8e24e80cc1bece879f8e0c738ce 100644 (file)
@@ -1,3 +1,6 @@
+
+       ; For XA65 compatibily in the futur
+       .FEATURE        c_comments,labels_without_colons,pc_assignment, loose_char_term
        .export         _ch376_set_file_name
        .export         _ch376_file_open
        .export         _ch376_ic_get_version
@@ -5,10 +8,18 @@
        .export         _ch376_check_exist
        .export         _ch376_disk_mount
        .export         _ch376_set_usb_mode
+       .export         _ch376_file_create
+       .export         _ch376_fcreate
+       
+       ; High level function
+       .export         _ch376_fcreate
+       
        .import         popax
        .importzp       sp,tmp2,tmp3,tmp1
        .include    "telemon30.inc"
+/*
 
+*/
 ; CODE FOR CH376_SET_USB_MODE *************************************************
 
 CH376_SET_USB_MODE_CODE_USB_HOST_SOF_PACKAGE_AUTOMATICALLY := $06
@@ -17,8 +28,7 @@ CH376_USB_INT_DISK_READ := $1d
 CH376_USB_INT_SUCCESS  := $14
 CH376_ERR_MISS_FILE    := $42
        
-CH376_DATA             :=$340
-CH376_COMMAND  :=$341
+
 
 CH376_GET_IC_VER               := $01
 CH376_SET_BAUDRATE             := $02
@@ -34,6 +44,7 @@ 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_FILE_CLOSE               := $36
 CH376_BYTE_READ                        := $3A
 CH376_BYTE_RD_GO               := $3b
@@ -41,7 +52,19 @@ CH376_BYTE_WRITE             := $3C
 CH376_DISK_CAPACITY    := $3E
 CH376_DISK_RD_GO               := $55
 
+.proc _ch376_file_create
+       lda #CH376_FILE_CREATE
+       sta CH376_COMMAND
+       jsr _ch376_wait_response
+       rts
+.endproc
 
+; void _ch376_fcreate(char *filename)
+.proc _ch376_fcreate
+       jsr _ch376_set_file_name
+       jsr _ch376_file_open
+       jsr _ch376_file_create
+.endproc
 
 ; void ch376_set_file_name(char *filename)
 .proc _ch376_set_file_name