ascjulia.c and ascbrot.c
Forum rules
Be nice. No drama.
Be nice. No drama.
Re: ascjulia.c and ascbrot.c
This is current state of coding. Pictures added.
- Attachments
-
- ascbrot.jpg (62.34 KiB) Viewed 9445 times
-
- ascjulia.jpg (61.32 KiB) Viewed 9445 times
Re: ascjulia.c and ascbrot.c
Using the console directly instead of putchar() avoids the buffering effect and allows you to change colors and x/y positions.
giving
Code: Select all
...
/* Unchanged code above */
if(x+y < 4) { /* Why x+y < 4 btw? */
return i;
}
return 1;
}
#include <gigatron/console.h>
void main(void) {
int x, y, data;
float sx, sy;
for(y = 0; y < HEIGHT; y = y + YSTEP ) {
for(x = 0; x < WIDTH; x = x + XSTEP ) {
sx = SCALE * (WIDTH/2.0 - x) / (WIDTH/2.0);
sy = SCALE * (HEIGHT/2.0 - y) / (HEIGHT/2.0);
data = julia(sx, sy);
console_state.cx = x;
console_state.cy = y;
console_state.fgbg = (((data-48)*6+1) & 0x3f) << 8;
console_print((char*)&data, 1);
}
}
}
Re: ascjulia.c and ascbrot.c
Cool. Very colorful.
A couple of things in code that might be considered. Testing things takes time. Best place is start testing is with ascii-versions, graphics versions take hours to draw the screen.
A couple of things in code that might be considered. Testing things takes time. Best place is start testing is with ascii-versions, graphics versions take hours to draw the screen.
Last edited by veekoo on 02 May 2023, 18:42, edited 1 time in total.
Re: ascjulia.c and ascbrot.c
Latest sources and executables can be found at github:
Last edited by veekoo on 22 Nov 2023, 14:09, edited 1 time in total.
Re: ascjulia.c and ascbrot.c
Ascii fractal development has gone to solid version (ROMV4). Goal of code is to give full support for standard Gigatron TTL machine with stable rom. I hope many other coders publish some version of their programs for standard machine too.
- Attachments
-
- ascjulia.jpg (106 KiB) Viewed 7585 times
-
- ascbrot.jpg (137.17 KiB) Viewed 7585 times
-
- ascjulia.gt1
- (5.94 KiB) Downloaded 535 times
-
- ascbrot.gt1
- (6.05 KiB) Downloaded 519 times
Re: ascjulia.c and ascbrot.c
I have gone to ROMv6 era. So here is all in one ascii fractal program.
It has 3 diffrent fractals to choose from: Mandelbrot, Julia and Burning Ship
It has 3 diffrent fractals to choose from: Mandelbrot, Julia and Burning Ship
- Attachments
-
- ascfract.gt1
- (9.48 KiB) Downloaded 412 times
Re: ascjulia.c and ascbrot.c
Recompiled and faster? Works with 32K RAM and ROMv6. These are all-in-one programs with small changes.
- Attachments
-
- ascfract2.gt1
- (9.49 KiB) Downloaded 140 times