I haven't been able to fully test the 83 version, and don't know how LCD-driver friendly the 83+ version is for people with SEs.
It's been a little side project to keep me going and as a testbed for Brass and Latenite.

Moderator: MaxCoderz Staff
....... How can you even speak of trig as basic??? (OK, so what if I'm advanced 2 years already in math, whats your point?)Nothing here is really ground-breaking, but I've always enjoyed this sort of programming more. If anyone dares to read the source, it shouldn't be too difficult to follow. Lots of basic trig and Bresenham goes on in there, plus some cheating with precomputed tables (which might explain the massive binary size...)
Basic, as in nothing more complex than:thegamefreak0134 wrote:....... How can you even speak of trig as basic??? (OK, so what if I'm advanced 2 years already in math, whats your point?)
Code: Select all
x = centre_x + circle_radius * sin(angle)
y = centre_y + circle_radius * cos(angle)
You're so considerate of the lcd. Most people wouldn't think twice about leaving it happy, most people just order her around.; Leave the LCD driver in a happy state!
Very simply, and can easily be altered to change the effect. Each pixel of the area the lens is over is put through a transformation table. Like the tunnel, this is precomputed. The lens is 32x32 pixels, so the transformation table is 32x32 elements. Each element has an X and a Y, so the most basic transformation table would be:Timendus wrote:Yeah, it's huge, but very cool none the less
The lens is my favourite too. How exactely does that work..?
Code: Select all
.for y, 0, 31
.for x, 0, 31
.db x, y
.loop
.loop
Code: Select all
.for y, 0, 31
.for x, 0, 31
.db x/2, y/2
.loop
.loop
Code: Select all
.for y, 0, 31
.for x, 0, 31
.db 31-x, y
.loop
.loop
Code: Select all
transform[32][32] ; transformation table
lens_x = 10 ; \_ position of lens
lens_y = 10 ; /
old_area[32][32]; old area under the lens
; Copy the area under the lens to a temporary buffer
for x = 0 to 31
for y = 0 to 31
old_area[x][y] = get_pixel(lens_x+x, lens_y+y)
next y
next x
; Redraw the lens, applying the transformation:
for x = 0 to 31
for y = 0 to 31
set_pixel(lens_x+x, lens_y+y) = old_area[transform[x][y].x][transform[x][y].y]
next y
next x