Jump to content
IGNORED

Now to fix that leaky tap...


Wrathchild

Recommended Posts

Thanks, I'm not sure what the 'closest' palette for A880WinPlus to real A8 - any recommendations?

 

I've knocked the Water brightness up and the grass down. See how this looks.

 

I'd written an approximator app to take R, G & B values (e.g. found using PSP looking at the C64 screenshot) and then returns the closest A8 palette value. This uses code lifted from the A800 sources:

#include <stdio.h>

#include <math.h>



#define R(i) (rgb[i][0])

#define G(i) (rgb[i][1])

#define B(i) (rgb[i][2])



#define CLIP_VAR(x) 

if (x > 0xff) 

 x = 0xff; 

if (x < 0) 

 x = 0;



#define M_PI  3.14159265358979323846

#define COLINTENS	80



static int min_y = 0, max_y = 0xe0;

static int colintens = COLINTENS;

static int colshift = 40;



static long calc[256];



static int rgb[256][3];



int main(int argc, char *argv[])

{

int ir, ig, ib, i, j;

long r2, g2, b2, m = 0xFFFFF;

float max_y2, min_y2;



if (argc == 4)

{

 ir = atoi(argv[1]);

 ig = atoi(argv[2]);

 ib = atoi(argv[3]);



 /* Make an RGB table from computed values */

 for (i = 0; i < 0x10; i++)

 {

 	int r, b;

 	double angle;



 	if (i == 0)

 	{

   r = b = 0;

 	}

 	else

 	{

   angle = M_PI * ((double) i * (1.0 / 7) - (double) colshift * 0.01);

   r = cos(angle) * (double) colintens;

   b = cos(angle - M_PI * (2.0 / 3)) * (double) colintens;

 	}

 	for (j = 0; j < 0x10; j++)

 	{

   int y, r1, g1, b1;



   y = (max_y * j + min_y * (0xf - j)) / 0xf;

   r1 = y + r;

   g1 = y - r - b;

   b1 = y + b;

   CLIP_VAR(r1)

   CLIP_VAR(g1)

   CLIP_VAR(b1)

   rgb[i * 16 + j][0] = r1;

   rgb[i * 16 + j][1] = g1;

   rgb[i * 16 + j][2] = b1;

 	}

 }



 for (i=0; i<256; i++)

 {

 	r2 = ir - R(i);

 	r2 = r2 * r2;

 	g2 = ig - G(i);

 	g2 = g2 * g2;

 	b2 = ib - B(i);

 	b2 = b2 * b2;

 	calc[i] = r2 + g2 + b2;

 }



 for (i=0; i<256; i++)

 {

 	if (calc[i] < m)

 	{

   m = calc[i];

   j = i;

 	}

 }



 printf("R=%3d G=%3d B=%3d : $%02X Hue = %d Lum = %dn", ir, ig, ib, j, j/16, j%16);

}

else

 printf("Format:ncols Red Green Bluen(values between 0 and 255)n");



return 0;

}

wcl3.zip

Link to comment
Share on other sites

  • 4 months later...

I had an opportunity to look into the drawing corruption.

It boiled down to the Atari's OS VBI routines updating some

zero-page registers I was using. Serves me right for using

mapping the C64 zeropage usage 1:1 :ponder:

 

So, this one draws correctly and I've added in the top view too.

Press and release a console key once a screen has drawn

to see the other view.

 

I think for a future demo I could cycle through all of the C64

holes, drawing the tee view and then the top view each.

(plus tidy up the text areas)

 

I'm away over the weekend, but promise to get back to the

Combat conversion next week.

 

Regards,

Mark

wcl.zip

Link to comment
Share on other sites

  • 14 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...