Search found 1322 matches

by dafhi
Apr 24, 2011 2:18
Forum: Tips and Tricks
Topic: Visual sorts
Replies: 37
Views: 4272

Here's my bi-di selection sort Dim as Integer Position_of_Hi, Position_of_Lo, S_, J ' Pass lowerbound and upperbound as Start_ and End_ Sub BiDiSelectSort(Ary() As Single, Start_ As Integer, End_ As Integer) Do While Start_ < End_ Position_of_Hi = Start_ Position_of_Lo = Start_ S_ = ...
by dafhi
Apr 22, 2011 4:44
Forum: Tips and Tricks
Topic: Visual sorts
Replies: 37
Views: 4272

vdecampo's post on qsort got me hyped. I intended to speed up the bubble sort by storing location of lowest and highest values, and researched thereafter, finding that I had coded a bi-directional selection sort. It's about twice as fast as bubble
by dafhi
Feb 26, 2011 12:01
Forum: Tips and Tricks
Topic: Sprite Sheet fast sprite grabbing
Replies: 6
Views: 1959

I had a quick look, and might have a better idea of what's happening from comments, than code (where I feel mostly clueless).

Recently I developed a sprite sheet tile dims estimator that messes up when there's only 1 tile!

I'll need to get back to it.
by dafhi
Feb 06, 2011 0:38
Forum: Tips and Tricks
Topic: line & floodfill
Replies: 0
Views: 1024

line & floodfill

Howdy folks. Here are 2 low level gfx routines I've been sitting on. DrawLine() is unique in that x and y become meaningless after I've passed control to nested subs. AreaFill() is my second attempt at a flood fill algorithm. My first, while running perfectly (after many wrinkles), crashed from stac...
by dafhi
Jan 24, 2011 21:57
Forum: Tips and Tricks
Topic: Time constant Bezier Splines
Replies: 4
Views: 1200

ah, without really understanding the code, I posted this.

I assumed sample size to be applied in a manner affecting 'line segments'
by dafhi
Jan 24, 2011 8:32
Forum: Tips and Tricks
Topic: Time constant Bezier Splines
Replies: 4
Views: 1200

move points near wind corners and reduce the sampling
by dafhi
Jan 21, 2011 19:01
Forum: General
Topic: perplexing error
Replies: 2
Views: 713

I use FbEdit, which shows 'fbc -s console'

My output:

1,1
5,3
3,3
1,1
0,0

--------------------

Thanks for your input. I'll just go ahead and rework my Linked List, which should side-step the issue.
by dafhi
Jan 21, 2011 6:53
Forum: General
Topic: perplexing error
Replies: 2
Views: 713

perplexing error

Hi guys. In module "GfxBase.bi" I have With scanAF_(scanLI_.Posi) .X = X__ .Y = Y__ Open "Test.txt" For Append As #1 write #1, .Y, Y__ ' ************** .Y and Y__ should come out the same, but they don't, as seen from the 2nd line of outputted Test.txt Y__ and .Y are both Integer, as Y__ is either Y...
by dafhi
Jan 02, 2011 22:49
Forum: General
Topic: How can this be made faster?
Replies: 17
Views: 2872

multiply isn't necessarily that slow. one of my newest projects now uses multiply, and the old code which uses addition actually seems slower! ''New Code If (min1 + slope * maj1) >= PixelEdge Then ''Old Code min1 += slope If min1 >= PixelEdge Then Speed will depend on the processor, just make sure y...
by dafhi
Dec 22, 2010 1:53
Forum: General
Topic: How to write to screen.... in a FASTER way?
Replies: 11
Views: 1577

@Fox My latest edit has a working sample of animated random pixels - if you haven't seen that, do check it out =) In short, if the only *source* data is your 8 bit, you'll want to do this: For y = For x = .. mycolor = Pal32(Image8(x,y)) For yDest = .. For xDest = .. sPtr32 = yDest * Buf32Width + xDe...
by dafhi
Dec 21, 2010 2:24
Forum: General
Topic: Bleak Mid Winter Cheer
Replies: 5
Views: 788

That's awesome!!!!!

It's a bit chilly in here, but I wear a coat and sit in front of the fire that is my laptop =)
by dafhi
Dec 20, 2010 12:20
Forum: General
Topic: How to write to screen.... in a FASTER way?
Replies: 11
Views: 1577

I just visualized exactly what this sub is for .. magnification. I'll share some tidbits I've found over the years. There's a commercial basic, and online documentation at their website (a long time ago) mentioned that its own compiler was designed to put inner-most nested veriables into CPU registe...
by dafhi
Dec 20, 2010 10:47
Forum: General
Topic: How to write to screen.... in a FASTER way?
Replies: 11
Views: 1577

hey Fox! Dim SHARED AS UBYTE ScaleStepX, ScaleStepY Dim Shared As UInteger GWxGSF, GraphicScaleFactorM ' ... ' ... ' ... Sub RefreshScreen() Dim As UInteger PTR sPtr32 = Screenptr DIM As UInteger x, y Dim As UINTEGER a, b, c DetectScreenChanges() IF (LcdModifiedFirstY < 255) ...
by dafhi
Sep 25, 2010 23:12
Forum: Tips and Tricks
Topic: ASM Mul and Div
Replies: 1
Views: 2403

ASM Mul and Div

[2013 Sept 9] - Div code sample updated per MichaelW's correction. Div and Mul are often confusing for the ASM newb. I developed these two samples to unconfuse. '-----------------' ' ASM DIV EXAMPLE '-----------------' Dim As UInteger Numerator, Denominator, edx_, eax_ Numerator = 1003 Denominator =...
by dafhi
Sep 24, 2010 4:18
Forum: Tips and Tricks
Topic: Very simple random generator (VERY simple).
Replies: 4
Views: 1429

Thor, I applied your technique in one of my graphics projects with spectacular results Benchmark update: This appears to be at least 2% faster than Rnd!!! Dim Shared As UInteger t_rng_z, t_rng_d #Macro tRNG( g_, multiplier_ ) Asm mov ecx, [t_rng_z] mov eax, [t_rng_d] rol eax,7 Add eax,ecx mo...

Go to advanced search