-
Notifications
You must be signed in to change notification settings - Fork 0
/
mos_api.inc
138 lines (129 loc) · 2.92 KB
/
mos_api.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
;
; Title: AGON MOS - API for user projects
; Author: Dean Belfield
; Updated by: Leigh Brown
; Created: 03/08/2022
; Last Updated: 13/10/2022
;
; Modinfo:
; 05/08/2022: Added mos_feof
; 09/08/2022: Added system variables: cursorX, cursorY
; 18/08/2022: Added system variables: scrchar, scrpixel, audioChannel, audioSuccess, vpd_pflags
; 05/09/2022: Added mos_ren, vdp_pflag_mode
; 24/09/2022: Added mos_getError, mos_mkdir
; 13/10/2022: Added mos_oscli
; MOS high level functions
;
mos_getkey: EQU 00h
mos_load: EQU 01h
mos_save: EQU 02h
mos_cd: EQU 03h
mos_dir: EQU 04h
mos_del: EQU 05h
mos_ren: EQU 06h
mos_mkdir: EQU 07h
mos_sysvars: EQU 08h
mos_editline: EQU 09h
mos_fopen: EQU 0Ah
mos_fclose: EQU 0Bh
mos_fgetc: EQU 0Ch
mos_fputc: EQU 0Dh
mos_feof: EQU 0Eh
mos_getError: EQU 0Fh
mos_oscli: EQU 10h
mos_fread: EQU 1Ah
mos_fwrite: EQU 1Bh
mos_flseek: EQU 1Ch
; FatFS file access functions
;
ffs_fopen: EQU 80h
ffs_fclose: EQU 81h
ffs_fread: EQU 82h
ffs_fwrite: EQU 83h
ffs_fseek: EQU 84h
ffs_ftruncate: EQU 85h
ffs_fsync: EQU 86h
ffs_fforward: EQU 87h
ffs_fexpand: EQU 88h
ffs_fgets: EQU 89h
ffs_fputc: EQU 8Ah
ffs_fputs: EQU 8Bh
ffs_fprintf: EQU 8Ch
ffs_ftell: EQU 8Dh
ffs_feof: EQU 8Eh
ffs_fsize: EQU 8Fh
ffs_ferror: EQU 90h
; FatFS directory access functions
;
ffs_dopen: EQU 91h
ffs_dclose: EQU 92h
ffs_dread: EQU 93h
ffs_dfindfirst: EQU 94h
ffs_dfindnext: EQU 95h
; FatFS file and directory management functions
;
ffs_stat: EQU 96h
ffs_unlink: EQU 97h
ffs_rename: EQU 98h
ffs_chmod: EQU 99h
ffs_utime: EQU 9Ah
ffs_mkdir: EQU 9Bh
ffs_chdir: EQU 9Ch
ffs_chdrive: EQU 9Dh
ffs_getcwd: EQU 9Eh
; FatFS volume management and system configuration functions
;
ffs_mount: EQU 9Fh
ffs_mkfs: EQU A0h
ffs_fdisk EQU A1h
ffs_getfree: EQU A2h
ffs_getlabel: EQU A3h
ffs_setlabel: EQU A4h
ffs_setcp: EQU A5h
; File access modes
;
fa_read: EQU 01h
fa_write: EQU 02h
fa_open_existing: EQU 00h
fa_create_new: EQU 04h
fa_create_always: EQU 08h
fa_open_always: EQU 10h
fa_open_append: EQU 30h
; System variable indexes for api_sysvars
; Index into _sysvars in globals.asm
;
sysvar_time: EQU 00h
sysvar_vpd_pflags: EQU 04h
sysvar_keyascii: EQU 05h
sysvar_keymods: EQU 06h
sysvar_cursorX: EQU 07h
sysvar_cursorY: EQU 08h
sysvar_scrchar: EQU 09h
sysvar_scrpixel: EQU 0Ah
sysvar_audioChannel: EQU 0Dh
sysvar_audioSuccess: EQU 0Eh
sysvar_scrwidth EQU 0Fh
sysvar_scrheight EQU 11h
sysvar_scrcols EQU 13h
sysvar_scrrows EQU 14h
sysvar_scrcolours EQU 15h
sysvar_scrPixelIndex EQU 16h
sysvar_keycode EQU 17h
sysvar_keydown EQU 18h
sysvar_keycount EQU 19h
; Flags for the VPD protocol
;
vdp_pflag_cursor: EQU 00000001b
vdp_pflag_scrchar: EQU 00000010b
vdp_pflag_point: EQU 00000100b
vdp_pflag_audio: EQU 00001000b
vdp_pflag_mode: EQU 00010000b
;
; Macro for calling the API
; Parameters:
; - function: One of the function numbers listed above
;
MOSCALL: MACRO function
LD A, function
RST.LIS 08h
ENDMACRO