ScumSoft, on Wed May 25, 2011 4:01 PM, said:
No reply on this for a while, just curious if what I posted above is how it's supposed to work because it doesn't seem to.
Yes, PARAMETER increments internally with every store, and our example above seems correct, but with a possible snag.
lda #<Source2Copy
sta PARAMETER ;byte pointer increments on write?
lda #>Source2Copy
sta PARAMETER
The address from which to copy is not the literal assembled address of 2600 code but the offset into the binary file itself (less the 3k DPC+.arm). Therefore, it's unlikely that your addressing will work for both 2600 code and the DPC+ copy function.
A workaround is to purposely set RORGs for the 6 code banks as $3000, $5000, $7000, $9000, $B000, and $D000 then use some creative manipulation of the upper address byte:
lda #<Source2Copy
sta PARAMETER ;byte pointer increments on write?
lda #((>Source2Copy) & $0f) | (((>(Source2Copy - $2000)) / 2) & $70)
sta PARAMETER
In case anyone was wondering why I didn't start at $1000, that's because this can lead to a higher incidence of hazards when assembling fastfetch kernels here - for example, a JMP $xxA9 will fail under fastfetch when assembled at $1000-$1FFF but not at $3000-$FFFF.
Edited by batari, Fri May 27, 2011 2:32 PM.