dasm wrangling

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andrew Davie

I'm trying to avoid typing bank, hi, low into three separate tables. The idea is I enter into a macro, and the macro builds the tables for me. Sort of.  I can't for the life of me figure out how to get dasm to auto-generate 10 lines with each line in the format string_#  where # is 0 to 9.  Tried every which way, passing to macros, concatenation, you name it.  So, here's my working version - which is literally working - but I have to manually add entries to those last 3 tables to make sure there are enough entries in each. Sucks.

I'd rather have them add 'KNO' entries, with consecutive numbering. Can't figure how to at all. And I don't want a gazillion pre-typed entries with an IF around each!

KNO SET 0

    MAC DEFINE
_KBANK_,KNO,"_" = <{1}
_KLO_,KNO,"_"   = <{2}
_KHI_,KNO,"_"   = >{2}
KNO SET KNO + 1
    ENDM

;-------------------------------------------------------------------------------
; TODO -- add new kernel info here (an entry for kernel, another for prep)

    ; kernels...

    DEFINE BANK1, kernel_Rainbow
    DEFINE BANK1, kernel_01
    DEFINE BANK1, kernelCopyright

VB_FN_OFFSET = KNO

    ; VB 'prep's...

    DEFINE BANK0, k_prep_00
    DEFINE BANK0, k_prep_01
    DEFINE BANK1, kernelCopyrightVB

;-------------------------------------------------------------------------------
; TODO:
; When adding kernels, add entries (below) to have sufficient

kernelBank_L

    .byte _KBANK_0_
    .byte _KBANK_1_
    .byte _KBANK_2_
    .byte _KBANK_3_
    .byte _KBANK_4_
    .byte _KBANK_5_
   
kernelRoutine_L

    .byte _KLO_0_
    .byte _KLO_1_
    .byte _KLO_2_
    .byte _KLO_3_
    .byte _KLO_4_
    .byte _KLO_5_


kernelRoutine_H

    .byte _KHI_0_
    .byte _KHI_1_
    .byte _KHI_2_
    .byte _KHI_3_
    .byte _KHI_4_
    .byte _KHI_5_

Al_Nafuur

You still need banking in CDFJ and CDFJ+ ?

You really should take a deep look at ELF and VCSLib.

Andrew Davie

Quote from: Al_Nafuur on 16 May 2026, 10:33 PMYou still need banking in CDFJ and CDFJ+ ?

You really should take a deep look at ELF and VCSLib.

The Elite and Sentinel demos were ELF.

Al_Nafuur

Interesting - if Elite and Sentinel are already using ELF, I'm curious what keeps you on CDFJ/CDFJ+ for other/new projects?

From my perspective, ELF with VCSLib feels much cleaner architecturally. You can hand the 2600 off to a routine in RIOT RAM that manages the "overblank" while the ARM side gets essentially all of that time to prepare the next frame. Also most of the actual kernel logic can live on the ARM side with VCSLib too ( basically just read joystick/collision values from the 2600 ), with only the occasional JMP $1000 to keep the 6502 PC in the ROM area.

That's more or less the approach I used in my TinyELF Basic project (https://forums.atariage.com/topic/386052-tinyelf-basic-for-the-atari-2600) and porting the 36Char kernel to VCSLib worked very nicely. 

So I'm wondering: is there a specific advantage of CDFJ/CDFJ+ that I'm missing?

Andrew Davie

Quote from: Al_Nafuur on 17 May 2026, 01:35 AMInteresting - if Elite and Sentinel are already using ELF, I'm curious what keeps you on CDFJ/CDFJ+ for other/new projects?

WenHop is not a "new" project. There is already a fairly complex codebase written for CDFJ which is not that dis-similar to CDFJ+.  I don't want to have to rewrite everyting. That's one reasonable reason.

Another is that I tried, twice, and failed... to write my own CDFJ+ template. Could not figure it for the life of me. I now think the issue was having writes to DSPTR backwards (low first), which was a holdover from the incoorect implementation in the Collect3 demo. That demo worked because the address was 0, so lo/hi being backwards did not matter. When I iplemented CDFJ+, address was non-zero.  I only found that error long after I'd abandoned CDFJ+.  But when Craig's template came along, I thought I'd give that a go/test to see how it should have been done.

And, there were a few nice things in there that made it quite nice to use. So I thought I might as well keep going with WenHop in "CDFJ-esque" to see how things went.

I do understand the betterness of ELF.