]> git.sur5r.net Git - cc65/blob - libsrc/atari/dio_stc.s
Comment the ATASCII to screen code conversion.
[cc65] / libsrc / atari / dio_stc.s
1 ;
2 ; Christian Groessler, October 2000
3 ;
4 ; this file provides the _dio_log_to_phys function
5 ; (previously called _dio_snum_to_chs, so the filename)
6 ;
7 ; on the Atari this function is a dummy, it returns
8 ; cylinder and head 0 and as sector the sectnum it got
9 ;
10 ; unsigned char __fastcall__ dio_log_to_phys(dhandle_t handle,
11 ;                                            unsigned *sectnum,         /* input */
12 ;                                            dio_phys_pos *physpos);    /* output */
13 ;
14 ; dhandle_t - 16bit (ptr)
15 ;
16
17         .export         _dio_log_to_phys
18         .include        "atari.inc"
19         .importzp       ptr1,ptr2,ptr3
20         .import         popax,popptr1,__oserror
21
22 .proc   _dio_log_to_phys
23
24         sta     ptr2
25         stx     ptr2+1          ; pointer to output structure
26
27         jsr     popptr1         ; save pointer to input data
28
29         jsr     popax
30         sta     ptr3
31         stx     ptr3+1          ; pointer to handle
32
33         ldy     #sst_flag
34         lda     (ptr3),y
35         and     #128
36         beq     _inv_hand       ; handle not open or invalid
37
38         lda     #0
39         tay
40         tax
41         sta     (ptr2),y        ; head
42         iny
43         sta     (ptr2),y        ; track (low)
44         iny
45         sta     (ptr2),y        ; track (high)
46         iny
47
48         lda     (ptr1,x)
49         sta     (ptr2),y
50         iny
51         inc     ptr1
52         bne     _l1
53         inc     ptr1+1
54 _l1:    lda     (ptr1,x)
55         sta     (ptr2),y
56
57         txa
58 ret:
59         sta     __oserror
60         rts                     ; return success
61
62 ; invalid handle
63
64 _inv_hand:
65         ldx     #0
66         lda     #BADIOC
67         bne     ret
68
69 .endproc
70