DL1 and DL2 - documentation not clear on a few things - Printable Version +- Beam Racer Forum (https://forum.beamracer.net) +-- Forum: BeamRacer (https://forum.beamracer.net/forum-1.html) +--- Forum: Programming (https://forum.beamracer.net/forum-3.html) +--- Thread: DL1 and DL2 - documentation not clear on a few things (/thread-88.html) |
DL1 and DL2 - documentation not clear on a few things - silverdr - 2021-06-05 ytm Wrote:I have a few questions - the documentation is not clear/explicit on those: I admit this might not be completely clear so I'll update the docs shortly. OTOH it is quite easy to verify with a few lines of VBASIC: Code: 10 RACER0:RACER2 RE: Documentation not clear on a few things - silverdr - 2021-06-05 ytm Wrote:2. Where do I set memory bank for DL1, and where for DL2? Or is it common for both? The description of DL2STROBE says: "Writing to this register will start execution of Display List pointed to by DLIST2(LH) from the next cycle. If MSB is set, also the RAM bank used by the Display List will change based on bits 0-2". It is unclear whether this affects only DL2 or both. There's no such description next to DLSTROBE There is one place where the programmer can set which memory bank the displaylist will be executed from => DL2STROBE. Three LSBs (0-2) set the bank number, bit 3 is a bank change trigger. IOW - when upon writing to DL2STROBE the value written has its bit 3 set, displaylist processing switches to the bank selected with the three LSBs of that value. Please note that there was an error in "VASYL registers" documenation - the trigger bit is NOT the MSB. It is bit #3 (well.. MSB of the lower nybble :-)). Already corrected. DLSTROBE register does not have this kind of description - there is no such functionality there. Now, there is a caveat. Imagine that we start displaylist in BANK 0 and at some point we jump to and continue in – say – BANK 1. Once we complete the frame, VASYL jumps to the address pointed by DLISTL/DLISTH in currently selected bank! This means that because we switched to another bank - there is a good chance that VASYL will run off the rails. Therefore – unless we keep the bank we switched to on purpose – we have to restore the "original" bank before the end of current frame. An adapted version of the BASIC program from previous post shows this: Code: 10 RACER0:RACER2:BANK 0 |