-
Notifications
You must be signed in to change notification settings - Fork 2
/
bos.src
511 lines (505 loc) · 15.8 KB
/
bos.src
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
; BOS jump table functions
public _boot_os
public _handle_interrupt
public _HandleInstruction
public _sc_HandleSysCall
public _handle_offsetinstruction
public _sys_ExecuteFile
public _os_GetOSInfo
public _fs_OpenFile
public _fs_GetSectorAddress
public _fs_CheckDirExists
public _fs_CeilDivBySector
public _fs_CopyFileName
public _fs_Read
public _fs_Write
public _sys_AddHLAndA
public _sys_AnyKey
public _sys_FreeAll
public _sys_GetKey
public _sys_KbScan
public _sys_Malloc
public _fs_CreateRamFile
public _sys_MemSet
public _fs_AllocRam
public _sys_WaitKey
public _sys_WaitKeyCycle
public _asm_gui_DrawConsoleWindow
public _gui_Input
public _gui_NewLine
public _asm_gui_Print
public _asm_gui_PrintInt
public _gui_Scroll
public _bosgfx_BlitBuffer
public _asm_bosgfx_PrintString
public __MemClear
public __PushOP1
public __PopOP1
public __Mov9ToOP1
public __CpHLDE
public __Mov8b
public __ChkFindSym
public __LoadDEInd_s
public __EnoughMem
public __InsertMem
public __SetHLUTo0
public __PutS
public __GetCSC
public __NewLine
public __ClrScrn
public __HomeUp
public __ErrMemory
public __DrawStatusBar
public __os_GetSystemInfo
public __UsbPowerVbus
public __UsbUnpowerVbus
public _sys_EraseFlashSector
public _sys_FlashUnlock
public _sys_FlashLock
public _fs_CreateFile
public _strupper
public _strlower
public _fs_AbsPath
public _fs_MultByBytesPerSector
public __LoadLibraryOP1
public _fs_OpenFileInDir
public _fs_SetSize
public _fs_WriteFile
public _sys_HLToString
public _fs_DeleteFile
public __DelVar
public __CreateVar
public _gui_InputNoClear
public _fs_InitClusterMap
public _sys_WriteFlash
public _sys_WriteFlashA
public _sys_JoinArgv
public _fs_PathLen
public _fs_ParentDir
public _fs_StrToFileEntry
public _fs_DirList
public _sys_Free
public _sys_CallExecuteFile
public _sys_JumpExecuteFile
public _drv_InitDevice
public _fs_CopyFile
public _sys_GetRandomAddress
public _sys_Random8
public _sys_Random32
public _fs_GetSector
public _fs_WriteByte
public _fs_RenameFile
public __SetCursorPos
public _fs_CreateDir
public _bosgfx_BufClear
public _bosgfx_LcdClear
public _fs_SanityCheck
public _sys_SetOnInterruptHandler
public _asm_gui_PrintChar
public _bosgfx_SetDraw
public _asm_gui_PrintString
public _asm_gui_PrintLine
public _asm_gui_PrintUInt
public _fs_GetFilePtrRaw
public _sys_ExecuteFileHL
public _sys_TurnOff
public _sys_NextProcessId
public _sys_PrevProcessId
public _sys_FreeProcessId
public _fs_GarbageCollect
public _bosgfx_SwapTextColors
public _fs_WriteNewFile
public _bosgfx_SetFont
public _bosgfx_SetDefaultFont
public _sys_FreeRunningProcessId
public _util_Zx7Decompress
public _sys_CheckMallocRAM
public _bosgfx_Compute
public _bosgfx_FillRectangle
public _bosgfx_FillScreen
public _bosgfx_GetFontPtr
public _bosgfx_HorizLine
public _bosgfx_InitStdPalette
public _bosgfx_NextLine
public _bosgfx_PrintChar
public _bosgfx_PrintHexA
public _bosgfx_PrintUInt
public _bosgfx_Rectangle
public _bosgfx_Set8bpp
public _bosgfx_Set16bpp
public _bosgfx_SetTextXY
public _bosgfx_Sprite
public _bosgfx_Sprite2x
public _bosgfx_VertLine
public _sys_Malloc32Align32
public _sys_Malloc64Align256
public _asm_bosgfx_PrintStringXY
public _bosgfx_GetTextX
public _bosgfx_GetTextY
public _sys_OpenFileInPath
public _sys_VarString
public _fs_GetFreeSpace
public _fs_GetFDPtrRaw
public _fs_GetFDLenRaw
public __OP1ToPath
public _th_WaitKeyCycle
public _fs_JoinPath
public _sys_MallocPersistent
public _sys_OpenFileInVar
public _fs_BaseName
public _fs_MoveFile
public _fs_WriteDirectly
public __UnpackUpdates
public _sys_ReadSectorCache
public _sys_WriteSectorCache
public _sys_OpenFileInLib
public _sys_LoadHookThreads
public _bosgfx_BlitScreen
public _th_CreateThread
public _bosgfx_ZeroVRAM
public _th_KillThread
public _fs_GetFilePtr
public _fs_GetFDPtr
public _fs_GetFDLen
public _fs_ArcUnarcFD
public _util_Zx0Decompress
public _sys_WaitKeyUnpress
public _sys_MallocDupStr
public _sys_MallocDupStrN
public __SearchSymTable
public _fs_Rename
public _fs_AllocChk
public _sys_GetExecType
public _sys_GetExecTypeFD
public _util_Zx7Compress
public _sys_OpenRecoveryMenu
public _util_Relocate
public _fs_GetFDAttr
public _util_InitAllocSymList
public _util_AppendSymList
public _util_RemoveFromSymList
public _util_SearchSymList
public _util_FreeSymList
public _sys_Exec
public _sys_ExecV
public _sys_ExecData
public _sys_ExecBegin
public _sys_ExecContinue
public _fs_IsOSBackupPresent
public _util_SHA256
public _str_FromByte
public _str_FromInt
public _str_FromLong
public _str_ToInt
public _gui_CharFromCode
public _sys_ExecuteFileArgcArgv
public _drv_OpenDevice
public _drv_OpenDeviceFD
public _drv_GetDMA
public _drv_GetChar
public _drv_PutChar
public _drv_Read
public _drv_Write
public _asm_gui_PrintStdout
public _sys_CallExecuteFileHere
public _fsd_Open
public _fsd_Close
public _fsd_CloseAll
public _fsd_Read
public _fsd_Write
public _fsd_Resize
public _fsd_WriteStr
public _fsd_InRam
public _fsd_IsOpen
public _fsd_Archive
public _fsd_UnArchive
public _fsd_Seek
public _fsd_Tell
public _fsd_ForceClose
public _fsd_GetSize
public _fsd_GetDataPtr
public _sys_AllocHeap
public _fs_ExtractRootDir
public _fs_ExtractOSBinaries
public _fs_ExtractOSOptBinaries
_boot_os := $20108
_handle_interrupt := $2010C
_HandleInstruction := $20110
_sc_HandleSysCall := $20114
_handle_offsetinstruction := $2011C
_sys_ExecuteFile := $22400
_os_GetOSInfo := $22404
_fs_OpenFile := $22408
_fs_GetSectorAddress := $2240C
_fs_CheckDirExists := $22410
_fs_CeilDivBySector := $22414
_fs_CopyFileName := $22418
_fs_Read := $2241C
_fs_Write := $22420
_sys_AddHLAndA := $22424
_sys_AnyKey := $22428
_sys_FreeAll := $2242C
_sys_GetKey := $22430
_sys_KbScan := $22434
_sys_Malloc := $22438
_fs_CreateRamFile := $2243C
_sys_MemSet := $22440
_fs_AllocRam := $22444
_sys_WaitKey := $22448
_sys_WaitKeyCycle := $2244C
_asm_gui_DrawConsoleWindow := $22450
_gui_Input := $22454
_gui_NewLine := $22458
_asm_gui_Print := $2245C
_asm_gui_PrintInt := $22460
_gui_Scroll := $22464
_bosgfx_BlitBuffer := $22468
_asm_bosgfx_PrintString := $2246C
__MemClear := $22470
__PushOP1 := $22474
__PopOP1 := $22478
__Mov9ToOP1 := $2247C
__CpHLDE := $22480
__Mov8b := $22484
__ChkFindSym := $22488
__LoadDEInd_s := $2248C
__EnoughMem := $22490
__InsertMem := $22494
__SetHLUTo0 := $22498
__PutS := $2249C
__GetCSC := $224A0
__NewLine := $224A4
__ClrScrn := $224A8
__HomeUp := $224AC
__ErrMemory := $224B0
__DrawStatusBar := $224B4
__os_GetSystemInfo := $224B8
__UsbPowerVbus := $224BC
__UsbUnpowerVbus := $224C0
_sys_EraseFlashSector := $224C4
_sys_FlashUnlock := $224C8
_sys_FlashLock := $224CC
_fs_CreateFile := $224D0
_strupper := $224D4
_strlower := $224D8
_fs_AbsPath := $224DC
_fs_MultByBytesPerSector := $224E0
__LoadLibraryOP1 := $224E4
_fs_OpenFileInDir := $224E8
_fs_SetSize := $224EC
_fs_WriteFile := $224F0
_sys_HLToString := $224F4
_fs_DeleteFile := $224F8
__DelVar := $224FC
__CreateVar := $22500
_gui_InputNoClear := $22504
_fs_InitClusterMap := $22508
_sys_WriteFlash := $2250C
_sys_WriteFlashA := $22510
_sys_JoinArgv := $22514
_fs_PathLen := $22518
_fs_ParentDir := $2251C
_fs_StrToFileEntry := $22520
_fs_DirList := $22524
_sys_Free := $22528
_sys_CallExecuteFile := $2252C
_sys_JumpExecuteFile := $22530
_drv_InitDevice := $22534
_fs_CopyFile := $22538
_sys_GetRandomAddress := $2253C
_sys_Random8 := $22540
_sys_Random32 := $22544
_fs_GetSector := $22548
_fs_WriteByte := $2254C
_fs_RenameFile := $22550
__SetCursorPos := $22554
_fs_CreateDir := $22558
_bosgfx_BufClear := $2255C
_bosgfx_LcdClear := $22560
_fs_SanityCheck := $22564
_sys_SetOnInterruptHandler := $22568
_asm_gui_PrintChar := $2256C
_bosgfx_SetDraw := $22570
_asm_gui_PrintString := $22574
_asm_gui_PrintLine := $22578
_asm_gui_PrintUInt := $2257C
_fs_GetFilePtrRaw := $22588
_sys_ExecuteFileHL := $22590
_sys_TurnOff := $22594
_sys_NextProcessId := $22598
_sys_PrevProcessId := $2259C
_sys_FreeProcessId := $225A0
_fs_GarbageCollect := $225A4
_bosgfx_SwapTextColors := $225A8
_fs_WriteNewFile := $225AC
_bosgfx_SetFont := $225B0
_bosgfx_SetDefaultFont := $225B4
_sys_FreeRunningProcessId := $225B8
_util_Zx7Decompress := $225BC
_sys_CheckMallocRAM := $225C0
_bosgfx_Compute := $225C4
_bosgfx_FillRectangle := $225C8
_bosgfx_FillScreen := $225CC
_bosgfx_GetFontPtr := $225D0
_bosgfx_HorizLine := $225D4
_bosgfx_InitStdPalette := $225D8
_bosgfx_NextLine := $225DC
_bosgfx_PrintChar := $225E0
_bosgfx_PrintHexA := $225E4
_bosgfx_PrintUInt := $225E8
_bosgfx_Rectangle := $225EC
_bosgfx_Set8bpp := $225F0
_bosgfx_Set16bpp := $225F4
_bosgfx_SetTextXY := $225F8
_bosgfx_Sprite := $225FC
_bosgfx_Sprite2x := $22600
_bosgfx_VertLine := $22604
_sys_Malloc32Align32 := $22608
_sys_Malloc64Align256 := $2260C
_asm_bosgfx_PrintStringXY := $22610
_bosgfx_GetTextX := $22614
_bosgfx_GetTextY := $22618
_sys_OpenFileInPath := $22624
_sys_VarString := $22628
_fs_GetFreeSpace := $2262C
_fs_GetFDPtrRaw := $22630
_fs_GetFDLenRaw := $22634
__OP1ToPath := $22638
_th_WaitKeyCycle := $2263C
_fs_JoinPath := $22640
_sys_MallocPersistent := $22644
_sys_OpenFileInVar := $22648
_fs_BaseName := $2264C
_fs_MoveFile := $22650
_fs_WriteDirectly := $22654
__UnpackUpdates := $22658
_sys_ReadSectorCache := $2265C
_sys_WriteSectorCache := $22660
_sys_OpenFileInLib := $22664
_sys_LoadHookThreads := $22668
_bosgfx_BlitScreen := $2266C
_th_CreateThread := $22670
_bosgfx_ZeroVRAM := $22674
_th_KillThread := $22678
_fs_GetFilePtr := $2267C
_fs_GetFDPtr := $22680
_fs_GetFDLen := $22684
_fs_ArcUnarcFD := $22688
_util_Zx0Decompress := $2268C
_sys_WaitKeyUnpress := $22690
_sys_MallocDupStr := $22694
_sys_MallocDupStrN := $22698
__SearchSymTable := $2269C
_fs_Rename := $226A0
_fs_AllocChk := $226A4
_sys_GetExecType := $226A8
_sys_GetExecTypeFD := $226AC
_util_Zx7Compress := $226B0
_sys_OpenRecoveryMenu := $226B4
_util_Relocate := $226B8
_fs_GetFDAttr := $226BC
_util_InitAllocSymList := $226C0
_util_AppendSymList := $226C4
_util_RemoveFromSymList := $226C8
_util_SearchSymList := $226CC
_util_FreeSymList := $226D0
_sys_Exec := $226D4
_sys_ExecV := $226D8
_sys_ExecData := $226DC
_sys_ExecBegin := $226E0
_sys_ExecContinue := $226E4
_fs_IsOSBackupPresent := $226E8
_util_SHA256 := $226EC
_str_FromByte := $226F0
_str_FromInt := $226F4
_str_FromLong := $226F8
_str_ToInt := $226FC
_gui_CharFromCode := $22700
_sys_ExecuteFileArgcArgv := $22704
_drv_OpenDevice := $22708
_drv_OpenDeviceFD := $2270C
_drv_GetDMA := $22710
_drv_GetChar := $22714
_drv_PutChar := $22718
_drv_Read := $2271C
_drv_Write := $22720
_asm_gui_PrintStdout := $22724
_sys_CallExecuteFileHere := $22728
_fsd_Open := $2272C
_fsd_Close := $22730
_fsd_CloseAll := $22734
_fsd_Read := $22738
_fsd_Write := $2273C
_fsd_Resize := $22740
_fsd_WriteStr := $22744
_fsd_InRam := $22748
_fsd_IsOpen := $2274C
_fsd_Archive := $22750
_fsd_UnArchive := $22754
_fsd_Seek := $22758
_fsd_Tell := $2275C
_fsd_ForceClose := $22760
_fsd_GetSize := $22764
_fsd_GetDataPtr := $22768
_sys_AllocHeap := $2276C
_fs_ExtractRootDir := $22770
_fs_ExtractOSBinaries := $22774
_fs_ExtractOSOptBinaries := $22778
public ram_executable
public ram_executable_at
public flash_executable
macro ram_executable?
ram_executable_at ti.userMem
end macro
macro ram_executable_at? addr
org addr
db $18,$04,"REX",$00
end macro
macro flash_executable?
local fex_prog
element fex_prog
virtual at fex_prog+0
fex_prog:
db $18,$04,"FEX",$00
macro call? addr
if addr relativeto fex_prog
rst $28
end if
call addr-fex_prog
end macro
macro jp? addr
if addr relativeto fex_prog
rst $28
end if
jp addr-fex_prog
end macro
macro ld? lhs, rhs
match (addr), lhs
if addr relativeto fex_prog
rst $28
ld (addr-fex_prog), rhs
else
ld (addr), rhs
end if
else match (addr), rhs
if addr relativeto fex_prog
rst $28
ld lhs, (addr-fex_prog)
else
ld lhs, (addr)
end if
else
if rhs relativeto fex_prog
rst $28
ld lhs, rhs-fex_prog
else
ld lhs, rhs
end if
end match
end macro
postpone
load fex_prog.data: $-$$ from $$
end virtual
db fex_prog.data
end postpone
end macro