These are the necessary changes to port Spiralizer from Super Expander to MINIGRAFIK:
Code: Select all
SE: 100 IF FL=1 THEN:GRAPHIC 4
MG: 100 @RETURN:SX=5/32:SY=3/16
MG always returns to text mode here (the graphics area remains allocated). SX and SY are extra and define the scaling ratios for later use.
Code: Select all
SE: 170 FOR I=7TO0 STEP-1:FORJ=1TO50:NEXT J:POKE 38680,I:NEXT I
MG: 170 FOR I=7TO0 STEP-1:FORJ=1TO50:NEXT J:POKE 38168,I:NEXT I
Changed address in colour RAM because of different screen (and colour RAM) base address (unexpanded/+3K vs. >=+8K).
Code: Select all
SE: 260 FOR I=8120 TO 8163:POKE I,32:NEXT I
MG: 260 FOR I=4536 TO 4579:POKE I,32:NEXT I
Again change of screen RAM address.
Code: Select all
SE: 420 GRAPHIC 2:COLOR 1,2,C5,C5
MG: 420 POKE36879,26:POKE646,C5:@ON:@CLR
Set background (1=white), border (2=red) and foreground colour (C5=random), enable graphics, clear screen. No need to define the auxiliary colour.
Code: Select all
SE: 430 POINT C5,125+(Z+100)/1.3,130
MG: 430 CX=SX*(125+(Z+100)/1.3):CY=SY*(520-J-I)
The MG version just remembers the 'last drawn pixel' here in CX and CY and doesn't draw it. That pixel duly gets drawn with the first DRAW TO equivalent. Using "520-J-I" instead of plain "130" prevents a small glitch from being drawn. Using "C5" as colour source in the SE POINT command is in error and the value should actually be 1 (=foreground) instead.
Code: Select all
SE: 490 IF X<0 OR Y<0 THEN 650
MG: 490 IF X<0 OR X>=1024 OR Y<0 OR Y>=1024 THEN 650
Slightly improved bounds check, still in "SE coordinates".
Code: Select all
SE: 500 DRAW 1 TO X,Y:NEXT
MG: 500 @1,CX,CYTOSX*X,SY*Y:CX=SX*X:CY=SY*Y:NEXT
Transformation of SE coordinates into MG coordinates, update of CX and CY to continue the traverse with the next "DRAW TO" commands.
Code: Select all
SE: 660 GRAPHIC 4:PRINT"{CLR,2 DOWN}COORDINATES ARE OUR{3 SPACE}OF RANGE"
MG: 660 @RETURN:PRINT"{CLR,2 DOWN}COORDINATES ARE OUT{3 SPACE}OF RANGE"
Return to text mode for the error message. Again, the graphics area remains allocated. Typo corrected.
Code: Select all
SE: 690 FORV=15 TO 0 STEP -.5:SOUND245,0,0,0,V:NEXT:RETURN
MG: 690 FORV=15 TO 0 STEP -.5:POKE36874,245:POKE36878,V:NEXT:RETURN
That's what the SOUND command only does: syntactic sugar (only the "Alto" voice is written to in the MG port; "Tenore", "Soprano" and "Noise" are left out).
armypavarmy wrote:The version for Minigrafik which I am trying to do.
It works partly because the number entered in "Spin" is not shared. With Minigrafik the graphic is repeated beyond the number of sometimes referred to in "Spin- 1 to 18" and consequently if it does not stop it goes Out of screen. Also with the Movement or Decrement options. I do not understand why?
Whatever went wrong with your attempt to port the Spiralizer program - MINIGRAFIK was not the reason it didn't work.
Greetings,
Michael