]> git.sur5r.net Git - cc65/blob - libsrc/geos-common/dlgbox/dlgboxfileselect.s
Merge remote-tracking branch 'upstream/master'
[cc65] / libsrc / geos-common / dlgbox / dlgboxfileselect.s
1 ;
2 ; Maciej 'YTM/Elysium' Witkowiak
3 ;
4 ; 25.12.99
5
6 ; char DlgBoxFileSelect       (char *class, char ftype, char *fname);
7
8             .export _DlgBoxFileSelect
9             .import popa, popax
10             .import _DoDlgBox
11
12             .include "jumptab.inc"
13             .include "diskdrv.inc"
14             .include "geossym.inc"
15             .include "geosmac.inc"
16             .include "const.inc"
17
18 _DlgBoxFileSelect:
19         sta tmp_r5
20         stx tmp_r5+1
21         jsr popa
22         sta tmp_r7L
23         jsr popax
24         sta tmp_r10
25         stx tmp_r10+1
26
27 DB_FS_reload:
28         MoveW tmp_r5, r5
29         MoveW tmp_r10, r10
30         MoveB tmp_r7L, r7L
31
32         lda #<paramStrFileSelect
33         ldx #>paramStrFileSelect
34         jsr _DoDlgBox
35         cmp #DISK
36         bne DB_FS_Fin
37         jsr OpenDisk
38         txa
39         beq DB_FS_reload
40 DB_FS_Fin:
41         rts
42
43 .rodata
44
45 paramStrFileSelect:
46         .byte DEF_DB_POS | 1
47         .byte DBGETFILES, 4, 4
48         .byte OPEN, DBI_X_2, DBI_Y_0+16
49         .byte DISK, DBI_X_2, DBI_Y_0+32+1
50         .byte CANCEL, DBI_X_2, DBI_Y_0+64+3
51         .byte NULL
52
53 .bss
54
55 tmp_r5:
56         .res 2
57 tmp_r7L:
58         .res 1
59 tmp_r10:
60         .res 2