I may have found something ...TMD2003 wrote: - but I will get that "G" problem fixed. Somehow...
2165 IF h%(n)>16 THEN d2h_carry(n)
Perhaps it should be >15 ... That could explain why it only happens with 16 and not any greater values.
I may have found something ...TMD2003 wrote: - but I will get that "G" problem fixed. Somehow...
No, BLOCK uses pixel coordinates.TMD2003 wrote:I won't be able to use LINE/FILL or BLOCK, because these will all be affected by the SCALE and will be distorted.
First attempt:TMD2003 wrote:I will briefly awake from hiding under a rock, because earlier today I remembered a project I thought of taking on. It's a QL version of Kaleidoscope, originally written for the ZX81.
Code: Select all
100 REMark ZX81 programme: Kaleidoscope
110 REMark Sinclair QL version
120 :
130 setup_screen
140 :
150 LET n=INT(RND*250)+200
160 FOR a=1 TO n
170 LET v =INT (RND*22)
180 LET h = INT (RND*32)
190 LET rv = 21+(22-v)
200 LET rh = 31+(32-v)
210 PLOT h,v
220 PLOT rh,rv
230 PLOT h,rv
240 END FOR a
250 :
260 REMark Emulate ZX81 PLOT command
270 :
280 DEFine PROCedure PLOT(x,y)
290 POINT #ch;x,y
300 LINE_R #ch;0,0 TO x,y
310 END DEFine PLOT
320 :
330 REMark setup screen
335 :
340 DEFine PROCedure setup_screen
350 ch=FOPEN("scr_255x256a0x0")
360 PAPER #ch;7
370 INK #ch;0
380 CLS #ch
390 SCALE #ch;175,0,0
400 END DEFine setup_screen
Well, that's interesting. Am I right in thinking it'll be useful to plot single pixels? I've been looking for a way to do that.mk79 wrote:No, BLOCK uses pixel coordinates.
Crikey, that was quick - however, this isn't what the original does. For the ZX81, PLOT 0,0 makes a 4x4 square from 0,0 to 3,3 - then PLOT 1,0 would be a 4x4 square from 4,0 to 7,3. That should be easy enough to emulate with BLOCK, now that it's more obvious how it works. It's not the same coordinate system, so I will attempt to recreate my own ZX81 PLOT this way.Derek_Stewart wrote:100 REMark ZX81 programme: Kaleidoscope
Sure. No speed records will lay this way, but it's easy to use and does work.TMD2003 wrote:Well, that's interesting. Am I right in thinking it'll be useful to plot single pixels? I've been looking for a way to do that.mk79 wrote:No, BLOCK uses pixel coordinates.
I think you missed a Plot command - and a close#chDerek_Stewart wrote: First attempt:
Code: Select all
100 REMark ZX81 programme: Kaleidoscope
110 REMark Sinclair QL version #1, 2x2 areas
120 :
130 setup_screen
140 :
150 REPeat loop
160 LET v =INT (RND(127))
170 LET h = INT (RND(255))
180 LET rv = 128+(127-v)
190 LET rh = 256+(255-h)
200 PLOT h,v
210 PLOT rh,v
220 PLOT rh,rv
230 PLOT h,rv
240 IF RND>.97 THEN ik=(ik+7)MOD 14: INK#ch, ik : END IF
250 IF KEYROW(1) && 64 THEN EXIT loop
260 END REPeat loop
270 CLOSE#ch
280 :
290 REMark Emulate ZX81 PLOT command
300 :
310 DEFine PROCedure PLOT(x,y)
320 POINT #ch,x*.7375,y
330 END DEFine PLOT
340 :
350 REMark setup screen
360 :
370 DEFine PROCedure setup_screen
380 ch=FOPEN("scr_512x256a0x0")
390 PAPER #ch;7
400 ik=0: INK #ch,ik
410 CLS #ch
420 SCALE #ch;255,0,0
430 RANDOMISE (DATE)
440 END DEFine setup_screen
Code: Select all
100 REMark ZX81 programme: Kaleidoscope
110 REMark Sinclair QL version #2 - 2x2 areas, 4x4pixels
120 :
130 setup_screen
140 :
150 LET n=INT(RND*250)+2000
160 REPeat loop
170 LET v =INT (RND(31))
180 LET h = INT (RND(63))
190 LET rv = 32+(31-v)
200 LET rh = 64+(63-h)
210 PLOT h,v
220 PLOT rh,v
230 PLOT rh,rv
240 PLOT h,rv
250 IF RND>.97 THEN ik=(ik+7)MOD 14: END IF
260 IF KEYROW(1) && 64 THEN EXIT loop
270 END REPeat loop
280 CLOSE#ch
290 :
300 REMark Emulate ZX81 PLOT command
310 :
320 DEFine PROCedure PLOT(x,y)
330 BLOCK#ch, 4,4, x*4,y*4, ik
340 END DEFine PLOT
350 :
360 REMark setup screen
370 :
380 DEFine PROCedure setup_screen
390 ch=FOPEN("scr_512x256a0x0")
400 PAPER #ch;7
410 ik=0
420 CLS #ch
430 RANDOMISE(DATE)
440 END DEFine setup_screen
Code: Select all
100 REMark ZX81 programme: Kaleidoscope
110 REMark Sinclair QL version #3 - 8x4
120 :
130 setup_screen
140 :
150 REPeat loop
160 v =INT (RND(63))
170 h = INT (RND(63))
180 FOR j=0 TO 1
190 FOR i=0 TO 3
200 PLOT h+i*128,v+j*128
210 PLOT 127+i*128-h,v+j*128
220 PLOT h+i*128,127+j*128-v
230 PLOT 127+i*128-h,127+j*128-v
240 NEXT i
250 NEXT j
260 IF RND>.97 THEN ik=(ik+7)MOD 14: INK#ch, ik : END IF
270 IF KEYROW(1) && 64 THEN EXIT loop
280 END REPeat loop
290 CLOSE#ch
300 :
310 REMark Emulate ZX81 PLOT command
320 :
330 DEFine PROCedure PLOT(x,y)
340 POINT #ch,x*.7375,y
350 END DEFine PLOT
360 :
370 REMark setup screen
380 :
390 DEFine PROCedure setup_screen
400 ch=FOPEN("scr_512x256a0x0")
410 PAPER #ch;7
420 ik=0: INK #ch,ik
430 CLS #ch
440 SCALE #ch;255,0,0
450 RANDOMISE (DATE)
460 END DEFine setup_screen