starpath: update basic versions

This commit is contained in:
Vince Weaver 2025-02-25 01:50:25 -05:00
parent 0d210d0804
commit 2493a73e8c
4 changed files with 66 additions and 52 deletions

View File

@ -1,15 +1,11 @@
0 GOTO 8:SPEED=$)%DEL$LRUSR:SPEED=$)%DEL$LRUSR
8 POKE 2068,9:DIM CL(32):FOR I=0 TO 31:READ CL(I):NEXT:GR:POKE 49234,0
30 FOR Y=0 TO 47:FOR X=0 TO 39:D=14
40 YP=Y*4*D:T=(X*6)-D:IF T>=0 THEN 70
50 C=11:A=(X*6)+YP
55 IF A>256 THEN A=A-256:GOTO 55
57 IF A<6 THEN 95
60 C=(C*16)+((Y*4)/16):C=C-160:GOTO 95
70 XP=T*D:POKE 2067,XP/256:POKE 2069,YP/256:CALL 2066:T=PEEK(36)
75 POKE2057,T:POKE2059,D+F:CALL 2056:C=PEEK(36):D=D+1
80 IF C<16 THEN 40
90 C=C-16
95 COLOR=CL(C):PLOT X,Y:NEXT X,Y:F=F+1:GOTO 30
97 DATA 0,5,0,5,5,5,10,10,5,5,10,10,7,7,15,15,1,2,1,2,3,9,3,9,13,12,13,12,4,4,4,4
100 REM APPLE II VERSION OF HELLMOOD'S 64B STARPATH
0GOTO1:SPEED=$)%DEL$LRUSR:SPEED=$)%DEL$LRUSR
1P=2060:POKEP+8,9:DIML(16):FORI=0TO15:READL(I):NEXT:GR:POKE49234,0
2FORY=0TO47:FORX=0TO39:D=14
3Z=Y*4*D:T=(X*6)-D:IFT<0THENC=31:A=(X*6)+Z:GOTO7
4POKEP+7,(T*D)/256:POKEP+9,Z/256:CALLP+6:T=PEEK(36)
5POKEP-3,T:POKEP-1,D+F:CALLP-4:C=PEEK(36):D=D+1:IFC<16THEN3
6GOTO9:DATA0,5,10,5,10,7,15,15,1,2,3,9,13,12,4,4
7IFA>256THENA=A-256:GOTO7
8IFA>6THENC=(Y/4)+32
9COLOR=L((C-16)/2):PLOTX,Y:NEXTX,Y:F=F+1:GOTO2

View File

@ -0,0 +1,15 @@
0 GOTO 8:SPEED=$)%DEL$LRUSR:SPEED=$)%DEL$LRUSR
8 POKE 2068,9:DIM CL(32):FOR I=0 TO 31:READ CL(I):NEXT:GR:POKE 49234,0
30 FOR Y=0 TO 47:FOR X=0 TO 39:D=14
40 YP=Y*4*D:T=(X*6)-D:IF T>=0 THEN 70
50 C=11:A=(X*6)+YP
55 IF A>256 THEN A=A-256:GOTO 55
57 IF A<6 THEN 95
60 C=(C*16)+((Y*4)/16):C=C-160:GOTO 95
70 XP=T*D:POKE 2067,XP/256:POKE 2069,YP/256:CALL 2066:T=PEEK(36)
75 POKE2057,T:POKE2059,D+F:CALL 2056:C=PEEK(36):D=D+1
80 IF C<16 THEN 40
90 C=C-16
95 COLOR=CL(C):PLOT X,Y:NEXT X,Y:F=F+1:GOTO 30
97 DATA 0,5,0,5,5,5,10,10,5,5,10,10,7,7,15,15,1,2,1,2,3,9,3,9,13,12,13,12,4,4,4,4
100 REM APPLE II VERSION OF HELLMOOD'S 64B STARPATH

View File

@ -1,24 +1,15 @@
10 REM APPLE II VERSION OF HELLMOOD'S 64B STARPATH
20 REM CR=[0,5,0,5,5,5,10,10,5,5,10,10,7,7,15,15,1,2,1,2,3,9,3,9,13,12,13,12,4,4,4,4]
30 GR:REM PEEK FULLSCREEN
40 FOR X=0 TO 39
50 FOR Y=0 TO 48
60 D=14
70 YP=Y*4*D REM L:
80 T=(X*6)-D
90 IF T>256 THEN 200
100 C=11
110 REM RANDOM START
120 C=(C*16)+((Y*4)/16)
130 C=C-160
140 GOTO 300
200 XP=T*D
210 T=(XP+YP)/256
220 C=T&(D+F)
230 D=D+1
240 IF C&0x10=0 THEN GOTO 70
250 C=C-16 }
300 COLOR=C:PLOT X,Y
999 NEXT X,Y
1000 F=F+1:GOTO 40
0 GOTO 8:SPEED=$)%DEL$LRUSR:SPEED=$)%DEL$LRUSR
8 POKE 2068,9:DIM CL(32):FOR I=0 TO 31:READ CL(I):NEXT:GR:POKE 49234,0
30 FOR Y=0 TO 47:FOR X=0 TO 39:D=14
40 YP=Y*4*D:T=(X*6)-D:IF T>=0 THEN 70
50 C=11:A=(X*6)+YP
55 IF A>256 THEN A=A-256:GOTO 55
57 IF A<6 THEN 95
60 C=(C*16)+((Y*4)/16):C=C-160:GOTO 95
70 XP=T*D:POKE 2067,XP/256:POKE 2069,YP/256:CALL 2066:T=PEEK(36)
75 POKE2057,T:POKE2059,D+F:CALL 2056:C=PEEK(36):D=D+1
80 IF C<16 THEN 40
90 C=C-16
95 COLOR=CL(C):PLOT X,Y:NEXT X,Y:F=F+1:GOTO 30
97 DATA 0,5,0,5,5,5,10,10,5,5,10,10,7,7,15,15,1,2,1,2,3,9,3,9,13,12,13,12,4,4,4,4
100 REM APPLE II VERSION OF HELLMOOD'S 64B STARPATH

View File

@ -37,7 +37,7 @@ static void framebuffer_putpixel(unsigned int x, unsigned int y,
int main(int argc, char **argv) {
int frame,color,depth,x,y,yprime,xprime;
double frame,color,depth,x,y,yprime,xprime,a;
int temp,ch;
// set_default_pal();
@ -64,39 +64,53 @@ L:
temp=(x*6)-depth; // curve X by the current depth
// if left of the curve, jump to "sky"
if (temp&0x100) {
// if (temp&0x100) {
if (temp<0) {
color=27-16; // is both the star color and
color=15; // is both the star color and
// palette offset into sky
// pseudorandom multiplication leftover DL added to
// truncated pixel count
// 1 in 256 chance to be a star
if ((((x*6)+yprime)&0xff)!=0) {
a=(x*6)+yprime;
while(a>256) a-=256;
// if (( (int)((x*6)+yprime) %256)!=0) {
// if (a<4) printf("a=%lf (%d,%d)\n",a,(int)x,(int)y);
if (a>6) {
// if not, shift the starcolor and add scaled pixel count
color=(color<<4)|((y*4)>>4);
color-=160;
// want 16 .. 32
color=(y/4)+16;
//color-=160;
}
}
else {
// multiply X by current depth (into AH)
xprime=temp*depth;
// OR for geometry and texture pattern
temp=((xprime)|(yprime))>>8;
// temp=((int)(xprime)|(int)(yprime))/256;
temp=((int)(xprime/256)|(int)(yprime/256));
// get (current depth) + (current frame)
// mask geometry/texture by time shifted depth
color=(temp&(depth+frame));
//
color=((int)temp&(int)(depth+frame));
// (increment depth by one)
depth++;
// ... to create "gaps"
if ((color&0x10)==0) goto L;
// color is always 0..16 here?
// so gap if it is 16 or 32?
// if (((int)color&0x10)==0) {
if (color<16) {
// printf("yeah %d!\n",(int)color);
goto L;
}
// if ray did not hit, repeat pixel loop
@ -109,8 +123,6 @@ L:
frame++; // increment frame counter
// dump_framebuffer_gr();
grsim_update();
usleep(10000);