2 ; Ullrich von Bassewitz, 2003-03-07
3 ; Maciej Witkowiak, 2003-05-02
5 ; Setup arguments for main
7 ; There is always either 1 or 3 arguments:
10 ; <program name>, <data file name>, <data disk name>, 0
11 ; the 2nd case is when using DeskTop user drags an icon of a file and drops it
12 ; on icon of your application
15 .constructor initmainargs, 24
16 .import __argc, __argv
19 .include "geossym.inc"
21 ;---------------------------------------------------------------------------
22 ; Setup arguments for main
28 ; Setup a pointer to our argv vector
39 lda dirEntryBuf+OFF_FNAME,y
55 ; Check if there are any more arguments
59 ldx #0 ; no dataFileName - NULL the 2nd argument
62 inx ; there is only one argument
65 ldx #3 ; there are three arguments
72 ;---------------------------------------------------------------------------
77 argv: .word argv0 ; Pointer to program name
78 .word dataFileName ; dataFileName or NULL if last one
79 .word dataDiskName ; dataDiskName
80 .word $0000 ; last one must be NULL
83 argv0: .res 17 ; Program name