Du kannst hier ein zip runterladen
Bitte melde dich an, um diesen Link zu sehen.
Dein Windows hat wohl noch kein Linux Subsystem?
Du kannst hier ein zip runterladen
Bitte melde dich an, um diesen Link zu sehen.
Dein Windows hat wohl noch kein Linux Subsystem?
vbcc kam ja später als gcc. Den vbcc hab ich nie getestet.
ok habe anderen PC mit Win7 64bit
Was brauche ich alles damit der gcc rennt ?
Ich hab den ganzen Kram in einer VirtualBox mit Linux laufen. Mit Windows möcht ich mir lieber nix anfangen?
C Alles anzeigenso ? #include "graphics.h" #include <stdio.h> #include <limits.h> #include <stdlib.h> #include <string.h> #define WIDTH (getMaxX()+1) #define HEIGHT (getMaxY()+1) const float xCentre = -0.75; const float yCentre = +0.0; const float dxy = 0.005; // Buffer to store iteration count per pixel unsigned char iterations[200][160]; // Enough for 160x200 mode unsigned char visited[200][160]; // Floodfill marker // Simple queue structure for floodfill #define QUEUE_SIZE (WIDTH * HEIGHT) typedef struct { int x, y; } Point; Point queue[QUEUE_SIZE]; int qhead = 0, qtail = 0; void enqueue(int x, int y) { if (qtail < QUEUE_SIZE) { queue[qtail].x = x; queue[qtail].y = y; qtail++; } } Point dequeue() { return queue[qhead++]; } int queue_not_empty() { return qhead < qtail; } int in_bounds(int x, int y) { return x >= 0 && x < WIDTH && y >= 0 && y < HEIGHT; } void floodfill_from_edges() { // Initialize queue with all edge pixels where iterations[y][x] == 255 for (int x = 0; x < WIDTH; x++) { if (iterations[0][x] == 255) enqueue(x, 0); if (iterations[HEIGHT-1][x] == 255) enqueue(x, HEIGHT-1); } for (int y = 0; y < HEIGHT; y++) { if (iterations[y][0] == 255) enqueue(0, y); if (iterations[y][WIDTH-1] == 255) enqueue(WIDTH-1, y); } // Floodfill while (queue_not_empty()) { Point p = dequeue(); int x = p.x; int y = p.y; if (!in_bounds(x, y)) continue; if (visited[y][x]) continue; if (iterations[y][x] != 255) continue; visited[y][x] = 1; enqueue(x+1, y); enqueue(x-1, y); enqueue(x, y+1); enqueue(x, y-1); } } int main() { float cx, cy; float zx, zy, new_zx; unsigned char n; grafmode(GRAFMODE_160_200_4); // Step 1: Berechne Iterationen pro Pixel for (int j = 0; j < HEIGHT; ++j) { cy = yCentre + (j - HEIGHT/2)*dxy; for (int i = 0; i < WIDTH; ++i) { cx = xCentre + (i - WIDTH/2)*dxy*2; zx = 0.0; zy = 0.0; n = 0; while ((zx*zx + zy*zy < 4.0) && (n != 255)) { new_zx = zx*zx - zy*zy + cx; zy = 2.0*zx*zy + cy; zx = new_zx; n++; } iterations[j][i] = n; } } // Step 2: Floodfill von Rand aus floodfill_from_edges(); // Step 3: Ausgabe for (int j = 0; j < HEIGHT; ++j) { for (int i = 0; i < WIDTH; ++i) { if (visited[j][i]) { // Außengebiet (kein Mandelbrot): zeichne mit n plot(i, j, iterations[j][i] & getMaxColor()); } else { // Inneres der Mandelbrot-Menge: direkt schwarz plot(i, j, 0); } } } textmode(); return 0; }
mal sehen ob cc65 das frisst - ansonsten ist es shitty den gcc will ich nicht auch noch am laptop haben....
oh shit ... ich bin raus:D:\c64\cc65\samples\ColorMandel>..\..\bin\cl65 mandel2.c -o mandel2.prg
mandel2.c:10: Fatal: Floating point type is currently unsupported
Das ist ja eben der Hauptvorteil des gcc6502. Ich hab aber irgendwo auch einen Code hier geposted, wo ich Floats mit dem cc65 gemacht hab. Ich glaub, das basierte auf ner Idee von Sauhund, wenn ich mich recht entsinne.
Bitte melde dich an, um diesen Link zu sehen.
Ich hab zu PC (-AT) Zeiten mal ein Apfelmännchen geschrieben, in das ich etwas Arbeit investiert hab, um es schneller zu bekommen. Das hat dann z.B. Linien gezeichnet. Aber das gcc Apfelmännchen war ja eher als Compilertest gedacht und weniger zum schnellen Apfelmännchen malen.
Aber diese Sources hab ich evtl. nur noch auf alten Disketten, für die ich gerade kein Laufwerk eingebaut hab.
Warum nur? Am Ende wirst Du die Grafik ja doch nicht auf den c64 übernehmen können, weil der c64 die Anzahl der Bitplanes gar nicht kann
Freiwillige vortreten?
Hmmh....das könnte doch aber auch auf dem c64 gehen, oder? Wenn man die Farbregister passend ändert?