ascjulia.c and ascbrot.c

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice. No drama.
veekoo
Posts: 126
Joined: 07 Jun 2021, 07:07

Re: ascjulia.c and ascbrot.c

Post by veekoo »

This is current state of coding. Pictures added.
Attachments
ascbrot.jpg
ascbrot.jpg (62.34 KiB) Viewed 6595 times
ascjulia.jpg
ascjulia.jpg (61.32 KiB) Viewed 6595 times
lb3361
Posts: 374
Joined: 17 Feb 2021, 23:07

Re: ascjulia.c and ascbrot.c

Post by lb3361 »

Using the console directly instead of putchar() avoids the buffering effect and allows you to change colors and x/y positions.

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);
    }
  }
}
giving
Screenshot from 2021-09-15 21-10-47.png
Screenshot from 2021-09-15 21-10-47.png (11.76 KiB) Viewed 6579 times
veekoo
Posts: 126
Joined: 07 Jun 2021, 07:07

Re: ascjulia.c and ascbrot.c

Post by veekoo »

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.
Last edited by veekoo on 02 May 2023, 18:42, edited 1 time in total.
veekoo
Posts: 126
Joined: 07 Jun 2021, 07:07

Re: ascjulia.c and ascbrot.c

Post by veekoo »

Latest sources and executables can be found at github:
Last edited by veekoo on 22 Nov 2023, 14:09, edited 1 time in total.
veekoo
Posts: 126
Joined: 07 Jun 2021, 07:07

Re: ascjulia.c and ascbrot.c

Post by veekoo »

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
ascjulia.jpg (106 KiB) Viewed 4735 times
ascbrot.jpg
ascbrot.jpg (137.17 KiB) Viewed 4735 times
ascjulia.gt1
(5.94 KiB) Downloaded 430 times
ascbrot.gt1
(6.05 KiB) Downloaded 424 times
veekoo
Posts: 126
Joined: 07 Jun 2021, 07:07

Re: ascjulia.c and ascbrot.c

Post by veekoo »

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
Attachments
ascfract.gt1
(9.48 KiB) Downloaded 320 times
veekoo
Posts: 126
Joined: 07 Jun 2021, 07:07

Re: ascjulia.c and ascbrot.c

Post by veekoo »

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 40 times
Post Reply