Search found 133 matches

by David Williams
Sun 14 Feb 2021, 22:37
Forum: Assembly language
Topic: floating point comparison
Replies: 2
Views: 75

Re: floating point comparison

Replace

Code: Select all

        je equal
        jg greater
        jl lower
with

Code: Select all

        jz equal
        ja greater
        jb lower
I'm so rusty with this FPU stuff that I had to consult this old web page:

https://www.website.masmforum.com/tutor ... uchap7.htm
by David Williams
Sat 13 Feb 2021, 19:13
Forum: Graphics and Games
Topic: Creative Retro Coding - 1000 Tweet Gallery
Replies: 1
Views: 65

Creative Retro Coding - 1000 Tweet Gallery

I have only just discovered this large collection of BBC Micro / BBC BASIC graphical ditties. Some of them work quite well with BB4W (and presumably BBCSDL): https://www.bbcmicrobot.com/owlet-test2.html Some really amazing stuff there. Click on the thumb images to open up the JavaScript-based Beeb e...
by David Williams
Sat 13 Feb 2021, 18:34
Forum: Graphics and Games
Topic: One-liner wave animation
Replies: 6
Views: 168

Re: One-liner wave animation

Code: Select all

VDU22,17,19,128,16,72,58,170,19,7,16,134,122,222,23,128,192,224,112,56,28,14,7,3,23,129,3,7,14,28,56,112,224,192,12
OFF:REPEAT:PRINTCHR$(128.5+RND(1));:WAIT 1:UNTILFALSE
Inspiration: https://www.youtube.com/watch?v=m9joBLOZVEo
by David Williams
Sat 13 Feb 2021, 02:58
Forum: Graphics and Games
Topic: One-liner wave animation
Replies: 6
Views: 168

Re: One-liner wave animation

Can you save a few characters by using I rather than I%? It'll run a fraction slower, but that won't matter. Yes, I spotted that one a few minutes after I posted. Always annoying when that happens! Am I right that IF statements will fail in a one-liner, or can you get away with it, if only by addin...
by David Williams
Fri 12 Feb 2021, 20:25
Forum: Graphics and Games
Topic: One-liner wave animation
Replies: 6
Views: 168

Re: One-liner wave animation

I guess you can make it a little more compact by reprogramming (say) the characters A-G (by changing 130 to 65), and then you can just print the string "ABCDEFGGFEDCB" Good point - I must have thought of that myself, but perhaps considered it "better practice" to redefine only the top-bit-set (> 12...
by David Williams
Fri 12 Feb 2021, 14:48
Forum: Graphics and Games
Topic: One-liner wave animation
Replies: 6
Views: 168

One-liner wave animation

A 'port' of this YouTube video that appeared on my timeline: https://www.youtube.com/watch?v=0yKwJJw6Abs

http://www.proggies.uk/misc/OneLineWaves.txt

Copy and paste into BB4W or a BBSDL IDE.

I'm sure others here can come up with a cleverer/shorter method.
by David Williams
Thu 14 Jan 2021, 22:28
Forum: Graphics and Games
Topic: Delaunay triangulation
Replies: 6
Views: 772

Re: Delaunay triangulation

Delaunay triangulation and Voronoi diagrams are intimately related so, inspired by this pretty animation (one of many) at Shadertoy... https://www.shadertoy.com/view/ldl3W8 I made this very quickly with BB4W + GfxLib2, purely for a few seconds of entertainment: http://www.proggies.uk/misc/voronoi2.z...
by David Williams
Thu 14 Jan 2021, 16:02
Forum: Graphics and Games
Topic: Delaunay triangulation
Replies: 6
Views: 772

Re: Delaunay triangulation

I'll have a look at Delaunay triangulation, to see if I can make sense of it.... I've done an integer-only C version, the main optimisation being reducing (drastically) the number of 3-point circumcircles to check, and whilst much faster as you'd expect, the algorithm remains naive (and there's an ...
by David Williams
Wed 13 Jan 2021, 16:59
Forum: Graphics and Games
Topic: Delaunay triangulation
Replies: 6
Views: 772

Re: Delaunay triangulation

I've made progress by rejecting large triangles (which imply large or huge 'circumcircles'). A pretty obvious speed-up.
by David Williams
Wed 13 Jan 2021, 13:18
Forum: Graphics and Games
Topic: Delaunay triangulation
Replies: 6
Views: 772

Re: Delaunay triangulation

Using a revised PROCcalc_circle subroutine, this version lops about 2 seconds compared with the original version. One alternative approach to computing the circumcircle of a triangle does away with at least 2 divisions, but I don't think it will make much difference in terms of speed. REM Delaunay t...