My header:


Code:

.org $A60B

BinaryStart:
.db $EF,$11     ;OpenLib(                                    2    2
.db "D",$BB,$BF,$BB,$BF,$BB,$C2,$BB,$C3,"CSE",$11,$3F  ;    14   16 (tokenized "DoorsCSE"
.db $EF,$12,$3F ;ExecLib                                     3   19
.db $D5,$3F     ;Return                                      2   21
.db $ef,$68,$3F ;                                3   24 bytes total
HeaderStart:
.dw ASMStart-HeaderStart        ;offset to code
; Header sections start here

;Description Section:
.dw DescriptionEnd-DescriptionStart
.db 0
DescriptionStart:
.db "Eat the flies, avoid the spiders!",0
DescriptionEnd:

;Icon Section:
.dw IconEnd-IconStart
.db 1
IconStart:
.dw 2
IconPalette:
.db $7D, $A4, $95, $A4, $7D, $06, $6D, $02, $7D, $04, $7D, $A2, $4A, $A3, $00, $00
.db $6D, $04, $7D, $02, $95, $A6, $A6, $49, $F8, $00, $A5, $14, $FF, $FF, $7D, $A6
.db 2
.db 16
IconData:
.db $01, $23, $43, $15, $00, $12, $34, $61, $41, $66, $66, $66, $44, $10, $26, $76
.db $86, $77, $77, $77, $68, $05, $86, $76, $46, $76, $66, $67, $64, $59, $56, $76
.db $06, $76, $A4, $67, $66, $66, $66, $76, $46, $76, $44, $67, $77, $77, $77, $76
.db $96, $76, $4A, $26, $66, $66, $66, $62, $16, $76, $31, $50, $14, $31, $0B, $48
.db $16, $76, $40, $94, $01, $23, $43, $15, $06, $76, $00, $48, $41, $02, $44, $09
.db $56, $76, $00, $44, $8C, $7C, $40, $04, $67, $77, $64, $40, $DE, $7E, $D0, $04
.db $6D, $7D, $64, $24, $DE, $7E, $D4, $44, $67, $77, $62, $A9, $DE, $7E, $D4, $42
.db $36, $66, $48, $44, $9D, $AD, $4A, $2A, $25, $11, $1F, $44, $43, $10, $B4, $84
IconEnd:

;Author Section:
.dw AuthorEnd-AuthorStart
.db 2
AuthorStart:
.db "~AssemblyBandit~",0
AuthorEnd:

;Library Section:
.dw LibraryEnd-LibraryStart
.db 3
LibraryStart:
.db "DoorsCSE",8,0              ;Lib name, min major version, min minor version
LibraryEnd:

;End:
.dw 0     ;End of header field: 0 bytes of data
.db $ff   ;End of header field: type 255

ASMStart:

.org $A60B

 jp ProgStart


Is there any problem with that header?
I see no flaw. The only thing that might go wrong is your double .org. What assembler are you using?
I'm using Assembly Studio 8x, I thought it was the equivalent of .relocate, what does .relocate do?

Some edits for the header doc:

The general header format code under HeaderStart:
.dw ASMHEADER_FIELD_TYPE_LIB ;== 3

Should be .db I think and the include file should be updated with the type definitions.

Under the Icon field type:
Offset 1+(palette size): Icon width, in bytes. For example, 8 bytes for Type 0

Maybe a width of 4 for 32*32 (I used 2 for 16x16)
assemblybandit wrote:
I'm using Assembly Studio 8x, I thought it was the equivalent of .relocate, what does .relocate do?
.org and .relocate (and .rorg?) have subtly different syntax. I believe a .org followed by another .org can affect the output binary if the input program dictates overlapping areas. I know that .org followed by .rorg tends to avoid that problem, so you could do .org $0000 before the header, and .rorg UserMem right before the code. I'm not exactly sure about .relocate. Best thing to do would be to test. Smile

Quote:
Some edits for the header doc:

The general header format code under HeaderStart:
.dw ASMHEADER_FIELD_TYPE_LIB ;== 3

Should be .db I think and the include file should be updated with the type definitions.
Absolutely, both good calls.

Edit: Both done.

Quote:
Under the Icon field type:
Offset 1+(palette size): Icon width, in bytes. For example, 8 bytes for Type 0

Maybe a width of 4 for 32*32 (I used 2 for 16x16)
8 bytes for 32*32 with a 4-color palette; 4 bytes for a 2-color palette.
Ahh, thats where the problem is! (8 bytes for 32*32 with a 4-color palette; 4 bytes for a 2-color palette.) I was thinking pixel width in bytes.

.org in ASM Studio 8x just offsets the label addresses, I assume the program is recopied after the header to the original userMem ($a60b)?
assemblybandit wrote:
Ahh, thats where the problem is! (8 bytes for 32*32 with a 4-color palette; 4 bytes for a 2-color palette.) I was thinking pixel width in bytes.
Makes sense. Smile

Quote:
.org in ASM Studio 8x just offsets the label addresses, I assume the program is recopied after the header to the original userMem ($a60b)?
Yes. The header is left higher in memory. You'll therefore have a full 6645 bytes of code before the $C000 limit, and as many bytes as you want of data after that. The only thing missing from the routines that DCSE provides to programs is Runer112's new, optimized, clipping set of sprite routines coming in a few days. The other routines are all in place.
Still nothing, no icon, easy prog just resets calc.


Code:

.org $A60B

BinaryStart:
.db $EF,$11     ;OpenLib(                                    2    2
.db "D",$BB,$BF,$BB,$BF,$BB,$C2,$BB,$C3,"CSE",$11,$3F  ;    14   16 (tokenized "DoorsCSE"
.db $EF,$12,$3F ;ExecLib                                     3   19
.db $D5,$3F     ;Return                                      2   21
.db $ef,$68,$3F ;                                3   24 bytes total
HeaderStart:
.dw ASMStart-HeaderStart ;offset to code
; Header sections start here

;Description Section:
.dw DescriptionEnd-DescriptionStart
.db 0
DescriptionStart:
.db "Eat the flies, avoid the spiders!",0
DescriptionEnd:

;Icon Section:
.dw IconEnd-IconStart
.db 1
IconStart:
.db 2
IconPalette:
.db $7D, $A4, $95, $A4, $7D, $06, $6D, $02, $7D, $04, $7D, $A2, $4A, $A3, $00, $00
.db $6D, $04, $7D, $02, $95, $A6, $A6, $49, $F8, $00, $A5, $14, $FF, $FF, $7D, $A6
.db 8
.db 16
IconData:
.db $01, $23, $43, $15, $00, $12, $34, $61, $41, $66, $66, $66, $44, $10, $26, $76
.db $86, $77, $77, $77, $68, $05, $86, $76, $46, $76, $66, $67, $64, $59, $56, $76
.db $06, $76, $A4, $67, $66, $66, $66, $76, $46, $76, $44, $67, $77, $77, $77, $76
.db $96, $76, $4A, $26, $66, $66, $66, $62, $16, $76, $31, $50, $14, $31, $0B, $48
.db $16, $76, $40, $94, $01, $23, $43, $15, $06, $76, $00, $48, $41, $02, $44, $09
.db $56, $76, $00, $44, $8C, $7C, $40, $04, $67, $77, $64, $40, $DE, $7E, $D0, $04
.db $6D, $7D, $64, $24, $DE, $7E, $D4, $44, $67, $77, $62, $A9, $DE, $7E, $D4, $42
.db $36, $66, $48, $44, $9D, $AD, $4A, $2A, $25, $11, $1F, $44, $43, $10, $B4, $84
IconEnd:

;Author Section:
.dw AuthorEnd-AuthorStart
.db 2
AuthorStart:
.db "~AssemblyBandit~",0
AuthorEnd:

;Library Section:
.dw 10 ;fixed length
.db 3
.db "DoorsCSE",8,0 ;Lib name, min major version, min minor version

;Set Low Res:
;.dw 0
;.db 4

;End:
.dw 0     ;End of header field: 0 bytes of data
.db $ff   ;End of header field: type 255

ASMStart:

.org $A60B
 ret
Works great for me if I swap your second .org with a .relocate, add the corresponding .endrelocate at the end, and assemble with Brass. I can also run the program. I can only assume that your assembler is overlapping stuff with two .orgs.

Can you post the program so I can look at it in hex?
assemblybandit wrote:
Can you post the program so I can look at it in hex?
Absolutely; here it is.
Thanks Kerm! $69ef is omitted, my Asm Studio 8x plugin automatically adds it, so I created one that doesn't.

Here is the header file that I use with Asm Studio 8x:


Code:

.org $A60B ;userMem

BinaryStart:
.db $EF,$11     ;OpenLib(                                    2    2
.db "D",$BB,$BF,$BB,$BF,$BB,$C2,$BB,$C3,"CSE",$11,$3F  ;    14   16 (tokenized "DoorsCSE"
.db $EF,$12,$3F ;ExecLib                                     3   19
.db $D5,$3F     ;Return                                      2   21
.db $ef,$68,$3F ;                                3   24 bytes total
HeaderStart:
.dw ASMStart-HeaderStart ;offset to code
; Header sections start here

;Description Section:
.dw DescriptionEnd-DescriptionStart
.db 0
DescriptionStart:
.db "Eat the flies!",0
DescriptionEnd:

;Icon Section:
.dw IconEnd-IconStart
.db 1
IconStart:
.db 2
IconPalette:
.db $7D, $A4, $95, $A4, $7D, $06, $6D, $02, $7D, $04, $7D, $A2, $4A, $A3, $00, $00
.db $6D, $04, $7D, $02, $95, $A6, $A6, $49, $F8, $00, $A5, $14, $FF, $FF, $7D, $A6
.db 8 ;type 0=8, 1=4, 2=8 (bit size*pixel width/8)
.db 16
IconData:
.db $01, $23, $43, $15, $00, $12, $34, $61, $41, $66, $66, $66, $44, $10, $26, $76
.db $86, $77, $77, $77, $68, $05, $86, $76, $46, $76, $66, $67, $64, $59, $56, $76
.db $06, $76, $A4, $67, $66, $66, $66, $76, $46, $76, $44, $67, $77, $77, $77, $76
.db $96, $76, $4A, $26, $66, $66, $66, $62, $16, $76, $31, $50, $14, $31, $0B, $48
.db $16, $76, $40, $94, $01, $23, $43, $15, $06, $76, $00, $48, $41, $02, $44, $09
.db $56, $76, $00, $44, $8C, $7C, $40, $04, $67, $77, $64, $40, $DE, $7E, $D0, $04
.db $6D, $7D, $64, $24, $DE, $7E, $D4, $44, $67, $77, $62, $A9, $DE, $7E, $D4, $42
.db $36, $66, $48, $44, $9D, $AD, $4A, $2A, $25, $11, $1F, $44, $43, $10, $B4, $84
IconEnd:

;Author Section:
.dw AuthorEnd-AuthorStart
.db 2
AuthorStart:
.db "~AssemblyBandit~",0
AuthorEnd:

;Library Section:
.dw 10 ;fixed length
.db 3
.db "DoorsCSE",8,0 ;Lib name, min major version, min minor version

;Set Low Res:
;.dw 0
;.db 4

;End:
.dw 0     ;End of header field: 0 bytes of data
.db $ff   ;End of header field: type 255

ASMStart:

.org $A60B ;userMem

 jp ProgStart
Great, and that works for you? With your permission, I'd like to strip that down and put it on the Wiki as an example for Asm Studio 8x users.
Yeah, I posted it so that anyone can use it as a rough example, as long as they read the above comments pertaining to the use of .org, .rorg, and .relocate. I plan to use this as template myself and thats why I added the commented out type 4. I would keep this line in though: ;type 0=8, 1=4, 2=8 (bit size*pixel width/Cool or something similar, its easy to misinterpret the icon width. And point out that .org userMem-2 .db $69ef or equivalent will not work. I'm pretty stubborn and won't change assemblers, and I'm sure there are others out there!
By the way, due to a change in how the sprite routines work, the byte width field will now be a pixel width field. However, for backwards-compatibility, Doors CSE overwrites that field with a 32 anyway, so no need to change your existing Snake game.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement