BASIC: Load Runlength-encoded Sprite data into VERA RAM

Tutorials and help articles.

(Posts require approval. See pinned post.)
Forum rules
Post guides, tutorials, and other instructional content here.

This topic area requires approval, so please be patient while we review content to make sure it fits the expectations for this topic area.

Tech support questions should be asked in Hardware or Software support.
rje
Posts: 1263
Joined: Mon Apr 27, 2020 10:00 pm
Location: Dallas Area

BASIC: Load Runlength-encoded Sprite data into VERA RAM

Post by rje »


An excellent upgrade suggestion, Guy, thank you.  As you can see from the data, there are several instances where that tweak would shrink the data size.

...sure enough, it trims 16 full lines of code, or (very roughly) about 1K.  As an example, here are the first four lines of the improved runlength encoding, which almost handle the first five lines of the old encoding.  So I predict it's around 16% more efficient.

240 DATA 3,$00,$12,$ae,185,$91,5,$14,$16,$14,$00,$12,189,$c9,1,$ae

245 DATA 130,$14,0,190,$c9,1,$17,133,$c9,2,$16,$ca,178,$c9,4,$cb

250 DATA $14,$91,$14,130,$c9,1,$af,133,$c9,3,$ca,$e9,$16,176,$c9,2

255 DATA $e7,$e9,133,$c9,1,$af,134,$c9,3,$e8,$e9,$cb,174,$c9,3,$e8


 

User avatar
Cyber
Posts: 482
Joined: Mon Apr 27, 2020 7:36 am

BASIC: Load Runlength-encoded Sprite data into VERA RAM

Post by Cyber »



On 1/15/2021 at 1:21 AM, rje said:




But how does VPOKE handle auto-increment?  (Because it doesn't out of the box...)



I always thought VPOKE should handle auto-increment, but I never tried. I understood it that way after David's video, where he described auto-increment feature. Do you think it's by design? Looks more like a bug or not implemented yet thing to me?

Lorin Millsap
Posts: 193
Joined: Wed Apr 29, 2020 6:46 pm

BASIC: Load Runlength-encoded Sprite data into VERA RAM

Post by Lorin Millsap »

I always thought VPOKE should handle auto-increment, but I never tried. I understood it that way after David's video, where he described auto-increment feature. Do you think it's by design? Looks more like a bug or not implemented yet thing to me?

No, VPOKE is not meant to take advantage of auto increment. VPOKE more fully takes advantage of direct access, but for speed once you set up auto increment you would just keep poking additional values. So if you are sending a sequence you would enable auto increment then VPOKE the first byte in the sequence and POKE the rest.


Sent from my iPhone using Tapatalk
User avatar
Cyber
Posts: 482
Joined: Mon Apr 27, 2020 7:36 am

BASIC: Load Runlength-encoded Sprite data into VERA RAM

Post by Cyber »



44 minutes ago, Lorin Millsap said:




No, VPOKE is not meant to take advantage of auto increment. VPOKE more fully takes advantage of direct access, but for speed once you set up auto increment you would just keep poking additional values. So if you are sending a sequence you would enable auto increment then VPOKE the first byte in the sequence and POKE the rest.



Now after your explanation and rethinking this myself it became logical and simple. I feel myself stupid now. ) Thank you for clarifying!

Post Reply