Skip to content

data scripts #163

Description

@ksherlock

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions