-
Notifications
You must be signed in to change notification settings - Fork 6
Creating own program
THIS INFORMATION IS OUTDATED (for v1.1) AND WILL BE UPDATED BIT LATER
If you want create own program for this OS, then here instruction:
For example you want to create some graphics program what will draw on EGP, then:
- Create file "testprog" inside alx_pc\gpu\alxos\ folder.
- Place this content here:
@name Test Prog
if (INCLUDE) {
#include "alx_pc/gpu/alxos/_main_"
function alxos_testprog_init(Args:table) {
print("HELLO")
#DsHandler = "alxos_testprog_ds"
#KeyHandler = "alxos_testprog_key"
}
}
- Open file alx_pc\gpu\alxos_prog_.txt and add to the end (before last }):
ALXOS_PROGS["alxos_testprog",number] = 1
function alxos_testprog(Args:table) {
INCLUDE = 1
#include "alx_pc/gpu/alxos/testprog"
INCLUDE = 0
alxos_testprog_init(Args)
}
- Open file alx_pc\cpu\alxos_prog_.txt and add to the end (same before last }):
ALXOS_PROGS["alxos_testprog",number] = 1
function alxos_testprog(FInfo:table) {
dsSendDirect("alxos_runprog",E2_GPU,table("alxos_testprog"))
}
- Save all files what you edited.
- Open alx_pc\CPU.txt file and upload it into CPU chip.
- Open alx_pc\GPU.txt file and upload it into GPU chip.
- Reboot system.
- Create text file with content "alxos_testprog", then upload it to some folder and name as testprog.e2e (extension is important!).
- If everything done correct - if you execute created file it will print "HELLO" into your chat/console.
Now you have to use some build-in functions for manage what you want, you need to look inside other programs to understand how it works. You can add own persist and inputs/outputs in your program and it will be added to gpu automatically. But please keep in mind - variable names/functions must have unique names to prevent share problems!
Anyway small list of main functions/variables (for GPU):
egpClear() - clear EGP and gpudata
DsHandler - data signal handler function
KeyHandler - keyboard handler
Much of other things look inside alx_pc\gpu_main_.txt file and alx_pc\gpu\alxos_main_.txt file. Also some other useful functions inside alx_pc\shared\ files.
Good luck! And sorry for lack of documentation how to use all this stuff.