Login
Back to forumSee the full topicGo to last reply

Posted By

gerliczer
on 2012-08-10
05:17:29
 Ideas to your latest BASIC example

Hi George,

First about the nested for loops. Your version should also work OK. Even if you write it as NEXT:NEXT, it should work.

Next about caching at $0800 or 0C00. Could you post the code and maybe a picture to see what went wrong? I think 770 bytes should not cause artefacts.

Then about the copy routine in the other topic. You should examine first its initial version which has some comments. Study the used system variables with the help of the RAM page in SVS's Ultimate Map. If you start to get it, then apply the version optimized by Csabo in your program.

Finally about speeding up the code. I cannot help you with this too much beyond the usual generic advices.
- Fill BASIC lines as much as possible to decrease overhead.
- Try to minimize the number of complex formula evaluations.
- Do not use DEC("XXXX"), calculate the value manually and use it that way, because it takes unnecessary time, especially in a loop.
- In line 60 you are calculating p in an unnecessarily complex way. It is linear as you use it in the colour restoring part, so initialize with the first address (which is 's') and then increment it by one.
- If I see it right, the terms r+(d*40)+DEC("XXXX") are constant in the luminance and colour copying loops, evaluate them once before the loops.
- Try to combine the two copying into one loop to decrease overhead.
- Variable k should run from 0 to 400 with step of 40.

I hope this will help you a bit.



Back to top


Copyright © Plus/4 World Team, 2001-2024