Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in 
CSDb User Forums


Forums > CSDb Entries > Release id #178956 : Plant
2019-06-23 05:55
Moloch

Registered: Jan 2002
Posts: 2328
Release id #178956 : Plant

Submitted by Compyx [PM] on 23 June 2019
Probably this (from Lemon64 of all places):

There is an even better way to do it - let's abuse the DIM-command!!

Since DIM normally clears an array, why not use it for clearing a bitmap as well?

Try this:
POKE 88,0:POKE 89,63:POKE 113,64:POKE 114,31:POKE 12,1:SYS 45760

This will fill memory from 8192-16191 ($2000-$3F3F) will nullbytes.

- Catboy


Fucking BASIC weirdos :)

User Comment
Submitted by Oswald [PM] on 22 June 2019
IIRC you can clear memory faster with declaring a large array :)

User Comment
Submitted by Oswald [PM] on 22 June 2019
80 mem=8192+int(v/8)*320+int(u/8)*8+(vand7):pokemem,peek(mem)or2^(7-(uand7))

lol :D
 
... 6 posts hidden. Click here to view all posts....
 
2019-06-27 13:30
Trash

Registered: Jan 2002
Posts: 118
Further optimization may be to dim more frequently used variables later (or earlier), not sure but I am pretty sure the order affects the speed IIRC
2019-06-27 15:00
ChristopherJam

Registered: Aug 2004
Posts: 1081
The REMs are all after the mainloop so I suspect they wouldn't things change much, but I was indeed wondering about dropping all the active variables down to a single letter.

I forgot about the fast parsing of "." as 0; think I saw that somewhere too.

Trash, that's an excellent point about predeclaring variables; probably applies to the scalars as much as the arrays.

Anyone want to measure the effect of any of these?

(I was initially benchmarking by checking TI before and after a thousand iterations, but counting iterations affects the timing, so at some point I switched to setting a watch in VICE on writes to 2000-3fff, then counting ten iterations and calculating the difference in the cycle counter you get in the monitor)
2019-06-28 21:00
Rastah Bar

Registered: Oct 2012
Posts: 231
Turning off interrupts?
2019-07-05 03:10
Rudi

Registered: May 2010
Posts: 124
how is
x and 504
different than
x and 248
? (in that code specifically?)
2019-07-05 16:47
ChristopherJam

Registered: Aug 2004
Posts: 1081
Rudi - you need 504 ($01f8) to support X values greater than 255

That said, -8 also works to clear the low three bits, and a quick test shows it's considerably faster! I guess it avoids a couple of multiply-by-10s in the parser.

I just compared
a=ti:fori=1to1000:j=iand-8:next:?ti-a
to
a=ti:fori=1to1000:j=iand504:next:?ti-a

The latter is around 420 ticks, compared to 320 for the former.
2019-07-07 06:06
Rudi

Registered: May 2010
Posts: 124
ok neat
2019-07-07 21:54
bugjam

Registered: Apr 2003
Posts: 2015
*waitingfornewversion* :-)
2019-07-08 04:24
Rudi

Registered: May 2010
Posts: 124
bugjam: ChristopherJam is the Master of size and speed optimizing Basic programs so let him do it :) I can come up with wrong ideas that will lead to some lesser ticks perhaps, but.
2019-07-08 22:36
bugjam

Registered: Apr 2003
Posts: 2015
Don't be too modest, you triggered the whole thing, which is an achievement as well. :-)
2019-07-09 02:41
Rudi

Registered: May 2010
Posts: 124
Thanks bugjam.
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
cba
Visage/Lethargy
Mr. SID
Peeshaya/Airsomjith ..
Harry Potthead
Mikael/P.L/CEN
ZeSmasher/F4CG
Metal Maniac/Dual Crew
Sokrates
Thunder.Bird/HF/MYD!..
Digger/Elysium
The MeatBall
The Sarge/Fairlight
Guests online: 75
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.6)
3 Coma Light 13  (9.6)
4 Memento Mori  (9.6)
5 Comaland 100%  (9.6)
6 The Shores of Reflec..  (9.6)
7 Unboxed  (9.6)
8 Lunatico  (9.6)
9 Remains  (9.5)
10 C=Bit 18  (9.5)
Top onefile Demos
1 Dawnfall V1.1  (9.5)
2 Gumbo Revised  (9.5)
3 Smile to the Sky  (9.5)
4 Daah, Those Acid Pil..  (9.5)
5 Bad Boy  (9.5)
6 Crystal Gazer  (9.5)
7 Cuarentenauta  (9.5)
8 Instinct  (9.5)
9 The Night It Snowed  (9.5)
10 Rewind  (9.4)
Top Groups
1 PriorArt  (9.4)
2 Booze Design  (9.4)
3 Censor Design  (9.4)
4 Fossil  (9.4)
5 Performers  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Horizon  (9.9)
3 Stormbringer  (9.7)
4 The Shadow  (9.6)
5 Fungus  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2020
Page generated in: 0.048 sec.