(cross post from omni)
For the Walnut shell all machine executable programs will use the gxp format which is named after the popular 8xp extension used on the 83+. The packet design was originally designed by Qwerty.55 for use in a Prizm shell and has it's advantages in a variable size header that can be modified in the future with ease. The layout is in packets with each holding a different category. All are optional except for the first one which holds important information such as the name of the program. Other data such as the icon and advanced start up options are available in different packets. This is the current packet layout for the first version of Walnut. It is not set in stone and also keep in mind that the Walnut SDK will fill out these fields.
Code:
For the Walnut shell all machine executable programs will use the gxp format which is named after the popular 8xp extension used on the 83+. The packet design was originally designed by Qwerty.55 for use in a Prizm shell and has it's advantages in a variable size header that can be modified in the future with ease. The layout is in packets with each holding a different category. All are optional except for the first one which holds important information such as the name of the program. Other data such as the icon and advanced start up options are available in different packets. This is the current packet layout for the first version of Walnut. It is not set in stone and also keep in mind that the Walnut SDK will fill out these fields.
Code:
//all packets must be long word aligned
packet 0: required
word: identifier 0x0000
word: SDK version
long: Walnut identifier "wnut"
long: file offset to main
long: checksum of entire file excluding this
long: size of entire file
long: size of main
char: null terminated program name
char: null terminated description
//end of packet 0
packet 1: start-up info
word: identifier 0x0001
word: execution mode (0x0000: from flash in virtual memory, 0x0001: from ram in virtual memory, 0x0002: from flash in the p1 sector, 0x0003: from ram in the p1 sector, 0x0004: from flash in the p2 sector, 0x0005: from ram in the p2 sector)
long: requested origin (should be set to 0xffffffff in most cases for the default origin based off the previous mode choice)
long: value to be written to the FRQCR 0xffffffff for don't modify
//end of packet 1
packet 2: author info
word: identifier 0x0002
word: blank for alignment
long: author's 4 initial identifier eg "z80m"
char: null terminated author name
char: author logo compression mode (0x00: no image, 0x01: monochrome, 0x02: 8 color, 0x03: 256 color using Walnut's palatte, 0x04: 256 color with included palatte, 0x05: 16 bit bitmap, 0x06: 16 bit dxt)
image data: all author icons are 16x16 pixels
char: null terminated author name
//end of packet 2
packet 3: program icon
word: identifier 0x0003
word: height
word: width
char: icon compression mode (0x00: no image, 0x01: monochrome, 0x02: 8 color, 0x03: 256 color using Walnut's palatte, 0x04: 256 color with included palatte, 0x05: 16 bit bitmap, 0x06: 16 bit dxt)
image data:
//end of packet 3