42bs Posted June 19 Share Posted June 19 I added a set of macros to BLL to allow building a .LNX file directly from assembly using the uLoader. Also added macros to handle overlays or asset loading from cart. Example in demos/overlay. 3 1 Quote Link to comment Share on other sites More sharing options...
42bs Posted June 21 Author Share Posted June 21 And here a POC for those who use MADS: ;;; compile: mads -c -b:0 test.asm -o:test.lnx opt ?- opt c+ opt h- BlockSize = 1024 org $0 .def :?ROM_PC = 0 OVERLAY_BEGIN .macro .def :ROM_:1 = :?ROM_PC org :2 .def :start_:1 = * .endm OVERLAY_END .macro .def :end_:1 = * .def :size_:1 = :end_:1 - :start_:1 .def :?ROM_PC += :size_:1 .endm OVERLAY_DIR_ENTRY .macro .by (>size_:1)^$ff .by (<size_:1)^$ff .by (>start_:1) .by (<start_:1) .IF :0 == 2 .by :2 .ELSE .by 0 .ENDIF .by (>(ROM_:1 & (BlockSize-1)))^$ff .by (<(ROM_:1 & (BlockSize-1)))^$ff .by ROM_:1/BlockSize .endm LNX_HEADER .by "LYNX" .word 1024 .word 1024 .word 1 :32 .by "N" :16 .by "M" .by 0 ;rot .by 0 ; audin .by 0 ;eeprom :3 .by 0 bootsector ins "ml.enc" .def :?ROM_PC += 52 org $1ff .byte 1+(End-Start)/256 Start: lda #0 print: sta 0 sty 1 loop lda (0) beq done jsr putchar inc 0 bne loop inc 1 bra loop done: bra done putchar: rts fileDirectory OVERLAY_DIR_ENTRY overlay1 OVERLAY_DIR_ENTRY overlay2 :2000 .by 0 ; just to fill End: overlay_start: .print "ROM_PC",?ROM_PC .def :?ROM_PC += (End-Start) .print "ROM_PC",?ROM_PC OVERLAY_BEGIN overlay1,overlay_start lda #<info1 ldy #>info1 jsr print rts info1: .byte "overlay1",0 OVERLAY_END overlay1 OVERLAY_BEGIN overlay2,overlay_start lda #<info2 ldy #>info2 jsr print rts info2: .byte "overlay2",0 OVERLAY_END overlay2 Quote Link to comment Share on other sites More sharing options...
42bs Posted June 21 Author Share Posted June 21 Align works as well: ROM_BLOCK_ALIGN .macro .def :?ROM_PC += BlockSize-(?ROM_PC & (BlockSize-1)) .endm Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.