Wrathchild Posted April 6, 2004 Share Posted April 6, 2004 Just a little 'work-in-progress' wcl.zip Quote Link to comment Share on other sites More sharing options...
Goochman Posted April 6, 2004 Share Posted April 6, 2004 Interesting..........I couldnt really do anything and the screen draw has a few errant lines in Atariwin800 but it looks promising! Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted April 7, 2004 Author Share Posted April 7, 2004 I've got the tree drawing in now - after much debugging (BTW: these programs have no user actions at the moment) The top-view is almost there, but it gets some poly corruption as shown in this shot. These are caused by the difference in memory layout for the screen to the C64. wcl_wip2.zip Quote Link to comment Share on other sites More sharing options...
Goochman Posted April 7, 2004 Share Posted April 7, 2004 Nice! Is it possible to get a 'richer' green color in there for the grass? Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted April 7, 2004 Author Share Posted April 7, 2004 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 Quote Link to comment Share on other sites More sharing options...
Goochman Posted April 7, 2004 Share Posted April 7, 2004 A little bit better - how do I get the 'overhead' view - I dont seem to be able to see that from you .com file. It seems the C64 can generate a brighter green than the 8bit series can Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted April 7, 2004 Author Share Posted April 7, 2004 I'll enable that when it works properly The C64 colours do seem to be a bit more cheery than the A8's. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 3, 2004 Author Share Posted September 3, 2004 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 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 Quote Link to comment Share on other sites More sharing options...
Goochman Posted September 3, 2004 Share Posted September 3, 2004 Look better - maybe some 'brighter' blues for water? The good ole days when you had to watch every tree drawn Quote Link to comment Share on other sites More sharing options...
tschak909 Posted October 21, 2018 Share Posted October 21, 2018 Is there a way this can be done without floating point math? I'd love to be able to have a routine for this to run in CC65, for PLATOTerm. -Thom 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.