You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently scripting seems to be limited to visualization and jsr/jsl/brk checking. While formatting some repetitive data (a table of DCI strings followed by 2 16-bit integers) I yearned for a way to automate it.
TFBD and ORCA/Disassembler both have scripts to format data.
Example from orca/disassembler:
**
* GSOS_Create - CreateGS parameter block
*
SCRIPT GSOS_Create
@A=@ARG
@P=[@A]
DC @A,I2
COMMENT @A,pCount
@A=@A+2
DC @A,I4
COMMENT @A,pathname
@A=@A+4
IF @P<2,doneCreate
DC @A,I2
COMMENT @A,access
@A=@A+2
IF @P<3,doneCreate
DC @A,I2
COMMENT @A,file type
@A=@A+2
IF @P<4,doneCreate
DC @A,I4
COMMENT @A,aux type
@A=@A+4
IF @P<5,doneCreate
DC @A,I2
COMMENT @A,storage type
@A=@A+2
IF @P<6,doneCreate
DC @A,I4
COMMENT @A,eof
@A=@A+4
IF @P<7,doneCreate
DC @A,I4
COMMENT @A,resource eof
.doneCreate
ENDS
Example from the flaming bird:
**
* GSOS_Create - CreateGS parameter block
*
GSOS_Create SCRIPT
@P=[@A]|W-1
DW @A
COM @A,pCount
@A=@A+2
ADRL @A
COM @A,pathname ptr
@A=@A+4
ON @P,:done,:access,:type,:aux,:storage,:eof
:res ADRL @A+E
COM @A+E,resource eof
:eof ADRL @A+A
COM @A+A,eof
:storage DW @A+8
COM @A+8,storage type
:aux ADRL @A+4
COM @A+4,auxtype
:type DW @A+2
COM @A+2,type
:access DW @A
COM @A,access
:done ENDS
It would be nice if there was similar functionality in SourceGen -- either a data-centric language like they have or just use c# scripting. (with file access the c# script could even execute orca disasm or fb files).
The text was updated successfully, but these errors were encountered:
The SourceGen equivalent to the scripts you posted is this. As you note, it's triggered by a JSL, but it's not limited to just formatting the bytes near the JSL. The ProDOS and GS/OS scripts follow the pointers and format the parameter block.
The JSR/JSL/BRK mechanism is essentially passive: you add the script to the project, and magic happens. For visualizers, you add an element that invokes a script with a set of parameters. What you're proposing is essentially a visualizer that applies formatting instead of generating graphics.
I've resisted adding a separate data script mechanism because it's hard to find something that handles all situations without being excessively complex. (Also, I'd be shocked if the number of people who actually used it required more than one hand to count.)
Currently scripting seems to be limited to visualization and jsr/jsl/brk checking. While formatting some repetitive data (a table of DCI strings followed by 2 16-bit integers) I yearned for a way to automate it.
TFBD and ORCA/Disassembler both have scripts to format data.
Example from orca/disassembler:
Example from the flaming bird:
It would be nice if there was similar functionality in SourceGen -- either a data-centric language like they have or just use c# scripting. (with file access the c# script could even execute orca disasm or fb files).
The text was updated successfully, but these errors were encountered: