Commit 8684555c authored by Robert Sprowson's avatar Robert Sprowson

Add 4k and 64k sprite output options

Update ChangeFSI's 16bpp output code paths to convert to 4k and 64k sprites (as well as the pre existing 32k RISC OS 3.5 style).
Also, simplify the sprite output dialogue a little by grouping the colours together and the DPI as an option, to halve the number of radio buttons.
If ChangeFSI is run on a kernel without 4k/64k support, those two depths are greyed out in the GUI (since after processing the desktop frontend expects to SpriteOp plot them), however at the command line the 2 new depths are always available (as S12 and S16).

ChangeFSI: Add the conversion code
DesktopFE: Rework dialogue with fewer radio icons, add fading logic

Version 1.63. Tagged as 'ChangeFSI-1_63'
parent 8728ed25
......@@ -6,7 +6,3 @@ various different graphics formats.
Several components of the application exist under various
different licences described by comments in source files.
Only some of the files herein fall under the shared source
release, including all RISC OS binary formats (sprites,
BASIC or template files for example) and obey scripts.
......@@ -36,8 +36,12 @@ Parameters
p5 output as pgm (grey), binary encoded
p6 output as ppm (colour), binary encoded
p15 output as CFSI packed portable bitmap
S12,<x>,<y> output as 4k colour 16bpp sprite; <x> and <y>
give pixels per inch in x and y directions
S15,<x>,<y> output as 32k colour 16bpp sprite; <x> and <y>
give pixels per inch in x and y directions
S16,<x>,<y> output as 64k colour 16bpp sprite; <x> and <y>
give pixels per inch in x and y directions
S32,<x>,<y> output as 16M colour 32bpp sprite; <x> and <y>
give pixels per inch in x and y directions
<mode>[c|d|t|r] output as 1/2/4/8bpp sprite, in the given
......
......@@ -210,12 +210,11 @@ box (you can't enter anything into it). When Use current mode is selected,
the mode number generated with new style screen displays has no
significance.
Colours: The two rows of 2, 4, 16, 256, 32K and 16M buttons set the number
of colours in the output image. The top row beside the square box chooses a
square pixel mode, and the lower row beside the oblong box chooses a
non-square (90 × 45dpi) screen mode. For monochrome output the 2, 4, 16 and
256 buttons set 2, 4, 8 and 16 greys respectively, and you cannot use the
32K and 16M buttons.
Colours: The two rows of 2, 4, 16, 256, 4K, 32K, 64K and 16M buttons set the
number of colours in the output image. The buttons to their right select a
square pixel mode (90 × 90dpi) or non-square (90 × 45dpi) screen mode.
For monochrome output the 2, 4, 16 and 256 buttons set 2, 4, 8 and 16 greys
respectively, and you cannot use the 4K, 32K, 64K and 16M buttons.
JPEG Output options
···················
......
......@@ -21,7 +21,7 @@ list of the closest colours in the current screen mode.
The SpriteExtend module can then use this list to paint sprites. Images can
thus be displayed in a screen mode that does not provide all the colours
used by the image. SpeiteExtend can also change the size of an image.
used by the image. SpriteExtend can also change the size of an image.
Since these facilities are widely used by interactive programs, they must
be fast; indeed, a normal sprite plot takes only one ARM instruction per
......@@ -185,7 +185,9 @@ measure up against the desirable properties above:
2^24 24 Y Y - S32/p3/p6/Irlam/JPEG
2^21 21 Y Y - p6,7
2^18 18 Y Y - p6,6
2^16 16 Y Y - S16
2^15 15 Y Y - S15/p15/p6,5
2^12 12 Y Y - S12
2^12 12 Y Y - p6,4
512 9 Y Y - p6,3
256 grey 8 n Y - AIM/JPEGMONO
......
No preview for this file type
No preview for this file type
/* (1.62)
/* (1.63)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.62
#define Module_MajorVersion_CMHG 1.63
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 30 Sep 2018
#define Module_Date_CMHG 16 Nov 2018
#define Module_MajorVersion "1.62"
#define Module_Version 162
#define Module_MajorVersion "1.63"
#define Module_Version 163
#define Module_MinorVersion ""
#define Module_Date "30 Sep 2018"
#define Module_Date "16 Nov 2018"
#define Module_ApplicationDate "30-Sep-18"
#define Module_ApplicationDate "16-Nov-18"
#define Module_ComponentName "ChangeFSI"
#define Module_ComponentPath "mixed/RiscOS/Sources/Apps/ChangeFSI"
#define Module_FullVersion "1.62"
#define Module_HelpVersion "1.62 (30 Sep 2018)"
#define Module_LibraryVersionInfo "1:62"
#define Module_FullVersion "1.63"
#define Module_HelpVersion "1.63 (16 Nov 2018)"
#define Module_LibraryVersionInfo "1:63"
......@@ -201,9 +201,15 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
m=-4
m$=""
p6bits=8
WHEN "S15","S16"
WHEN "S12"
m=-5
m$=""
WHEN "S15"
m=-6
m$=""
WHEN "S16"
m=-7
m$=""
WHEN "S32"
m=-8
m$=""
......@@ -2901,11 +2907,11 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
x%=sx%
y%=sy%
IF spm=18 ncol=1 ELSE ncol=15
WHEN -3,-6
WHEN -3,-5,-6,-7
x%=sx%
y%=sy%
ncol=2^15-1
WHEN -4,-7,-8
WHEN -4,-8
x%=sx%
y%=sy%
ncol=2^24-1
......@@ -2947,12 +2953,17 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
ENDIF
ENDIF
ENDCASE
IF m=-6 OR m=-7 OR m=-8 THEN
REM 32k/16M RISC OS 3.5+ sprite
IF m=-5 OR m=-6 OR m=-7 OR m=-8 THEN
REM 4k/32k/64k/16M RISC OS sprite
nx=VAL MID$(pnm$,5)
ny=VAL MID$(pnm$,INSTR(pnm$,",",5)+1)
IF nx<>0 AND ny=0 THEN ny=nx:REM No y DPI given,make it square pixels
IF nx=0 AND ny=0 THEN nx=90:ny=90:REM Silly user forgot to specify any x or y DPI at all
IF m=-5 THEN
REM RISC OS 5 sprite only has 2 bits for DPI, quantise to 22.5/45/90/180
nx=22.5*((100*nx+1225)DIV2250)
ny=22.5*((100*ny+1225)DIV2250)
ENDIF
IF scaleo% THEN
IF rotate% THEN
IF xdiv% ymul%=ymul%*nx
......@@ -3410,7 +3421,7 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
CASE m OF
WHEN -1,-9
col=0:REM Monochrome AIM and JPEG
WHEN -3,-4,-6,-7,-8,-10
WHEN -3,-4,-5,-6,-7,-8,-10
col=2
OTHERWISE
col=0
......@@ -3581,6 +3592,14 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
MOV PC,R14
]
WHEN 2^15-1
[ OPT Z%(Z)
.div15
]
FOR I%=0 TO 31
[ OPT Z%(Z)
EQUD I%/15*F
]
NEXT
[ OPT Z%(Z)
.div31
]
......@@ -3589,11 +3608,37 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
EQUD I%/31*F
]
NEXT
[ OPT Z%(Z)
.div63
]
FOR I%=0 TO 63
[ OPT Z%(Z)
EQUD I%/63*F
]
NEXT
IF m=-5 THEN
bitsRB=4
bitsG=4:REM 444
divRB=div15
divG =div15
ELSE
IF m=-7 THEN
bitsRB=5
bitsG=6:REM 565
divRB=div31
divG =div63
ELSE
bitsRB=5
bitsG=5:REM 555
divRB=div31
divG =div31
ENDIF
ENDIF
[ OPT Z%(Z)
.fs%
FNcpsr_to_r(1)
STMFD SP !,{R1,R14}
ADR R7,div31
ADR R7,divRB
LDR R1,[R9,#6*8]
LDR R1,[R1] REM incr
LDR R10,[R9,#5*8] REM addr current
......@@ -3605,6 +3650,7 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
LDR R14,[R9]
LDR R14,[R14] REM base addr
ADD R12,R12,R14
ADR R14,divG
LDR R9,[R9,#8]
LDR R9,[R9] REM count
LDR R4,[R10] REM r
......@@ -3615,27 +3661,27 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
CMP R4,#F
MOVCS R4,#0
MOVGE R4,#F
SUB R0,R4,R4,LSR #5
ADD R0,R0,#1<<(bits-6)
MOV R0,R0,LSR #(bits-5)
SUB R0,R4,R4,LSR #bitsRB
ADD R0,R0,#1<<(bits-bitsRB-1)
MOV R0,R0,LSR #(bits-bitsRB)
LDR R2,[R7,R0,LSL #2]
SUB R4,R4,R2
CMP R5,#F
MOVCS R5,#0
MOVGE R5,#F
SUB R3,R5,R5,LSR #5
ADD R3,R3,#1<<(bits-6)
MOV R3,R3,LSR #(bits-5)
ORR R0,R0,R3,LSL #5
LDR R2,[R7,R3,LSL #2]
SUB R3,R5,R5,LSR #bitsG
ADD R3,R3,#1<<(bits-bitsG-1)
MOV R3,R3,LSR #(bits-bitsG)
ORR R0,R0,R3,LSL #bitsRB
LDR R2,[R14,R3,LSL #2]
SUB R5,R5,R2
CMP R6,#F
MOVCS R6,#0
MOVGE R6,#F
SUB R3,R6,R6,LSR #5
ADD R3,R3,#1<<(bits-6)
MOV R3,R3,LSR #(bits-5)
ORR R0,R0,R3,LSL #10
SUB R3,R6,R6,LSR #bitsRB
ADD R3,R3,#1<<(bits-bitsRB-1)
MOV R3,R3,LSR #(bits-bitsRB)
ORR R0,R0,R3,LSL #bitsRB+bitsG
LDR R2,[R7,R3,LSL #2]
SUB R6,R6,R2
STRB R0,[R12]
......@@ -7304,7 +7350,7 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
=100
ENDIF
IF m>=0 oname$="p"+ STR$m+m$ ELSE oname$=m$
IF m=-6 OR m=-7 OR m=-8 oname$=pnm$
IF m=-5 OR m=-6 OR m=-7 OR m=-8 oname$=pnm$
IF range% oname$+="r"
IF equal% oname$+="e"
IF sharpen% oname$+="s"+ STR$sharpen%
......@@ -7339,7 +7385,7 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
Y%=ysp%
PROCgetoutput(sz%,0,xwords%,Y%)
base%=ram%
WHEN -6
WHEN -5,-6,-7
xwords%=xsp%*2+3 AND NOT 3
sz%=xwords%*ysp%
Y%=ysp%
......@@ -7354,18 +7400,19 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
base%!(5*4)=A%-1
!base%=!base%-Y%*xwords%+A%*xwords%
ram%!12=ram%!12-Y%*xwords%+A%*xwords%
base%!(10*4)=5<<27 OR nx<<1 OR ny<<14 OR 1
IF m=-6 THEN
base%!(10*4)=5<<27 OR nx<<1 OR ny<<14 OR 1
ELSE
IF m=-5 THEN
ex%=3-INT(0.5+(3/8*(nx/22.5))):REM Eigen-ify 180/90/45/22.5 -> 0/1/2/3
ey%=3-INT(0.5+(3/8*(ny/22.5)))
base%!(10*4)=16<<20 OR ex%<<4 OR ey%<<6 OR &78000001
ELSE
base%!(10*4)=10<<27 OR nx<<1 OR ny<<14 OR 1
ENDIF
ENDIF
base%+=base%!(8*4):REM Base of the sprite pixel array
IF o% SYS 12,2,o%,ram%+4,base%-(ram%+4):REM Flush the sprite header
WHEN -7
REM 24bpp is an alias for 32bpp for now
REM xwords%=xsp%*3+3ANDNOT3:sz%=xwords%*ysp%:Y%=ysp%
REM A%=Y%:PROCgetoutput(sz%,64,xwords%,Y%)
REM ram%!4=0:ram%!8=16:ram%!12=16:SYS&2E,&109,ram%
REM SYS&2E,&10f,ram%,oname$,0,xsp%*3,Y%,28
REM base%=ram%+ram%!8:base%!(5*4)=A%-1:!base%=!base%-Y%*xwords%+A%*xwords%
REM ram%!12=ram%!12-Y%*xwords%+A%*xwords%
REM base%!(10*4)=8<<27 OR nx<<1 OR ny<<14 OR 1:base%+=base%!(8*4)
WHEN -8
xwords%=xsp%*4
sz%=xwords%*ysp%
......@@ -7569,8 +7616,8 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
rowstep%=xwords%*size%
colstep%=1
dist%=xsp%-1
IF m=-3 OR m=-6 dist%=dist%*2
IF m=-4 OR m=-7 OR m=-10 OR m=-12 dist%=dist%*3
IF m=-3 OR m=-5 OR m=-6 OR m=-7 dist%=dist%*2
IF m=-4 OR m=-10 OR m=-12 dist%=dist%*3
IF m=-8 dist%=dist%*4
IF rotate% THEN
odist%=dist%
......@@ -7587,8 +7634,8 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
dist%=(ysp%-1)*colstep%
REM -90
ENDIF
IF m=-3 OR m=-6 colstep%=colstep%/2:rowstep%=rowstep%*2
IF m=-4 OR m=-7 OR m=-10 OR m=-12 colstep%=colstep%/3:rowstep%=rowstep%*3
IF m=-3 OR m=-5 OR m=-6 OR m=-7 colstep%=colstep%/2:rowstep%=rowstep%*2
IF m=-4 OR m=-10 OR m=-12 colstep%=colstep%/3:rowstep%=rowstep%*3
IF m=-8 colstep%=colstep%/4:rowstep%=rowstep%*4
ENDIF
IF hflip% THEN
......
......@@ -218,17 +218,24 @@ IF task% THEN
q%!4=I%
SYS SetI,,q%
NEXT
IF stateoutput%>>17 AND 1 q%!8=1<<22 ELSE q%!8=0
REM If kernel can't plot 4k/64k, fade on the frontend. This is because
REM after processing the sprite is plotted using the kernel and will be
REM shown grossly in error. In contrast, at the CLI, no plotting is done
REM so it's OK to allow these outputs that way.
kernspt%=%1111111100
SYS "XOS_ReadModeVariable",&79005051,9 TO,,m : REM Log2bpp 4k
IF m<>4 THEN kernspt%=kernspt% AND NOT(1<<6)
SYS "XOS_ReadModeVariable",&501680B5,9 TO,,m : REM Log2bpp 64k
IF m<>4 THEN kernspt%=kernspt% AND NOT(1<<8)
REM If monochrome, fade true colours
!q%=output%
q%!12=1<<22
q%!4=7
SYS SetI,,q%
q%!4=8
SYS SetI,,q%
q%!4=13
SYS SetI,,q%
q%!4=14
SYS SetI,,q%
FOR I%=6 TO 9
IF kernspt%>>I% AND1 q%!8=0 ELSE q%!8=1<<22
IF stateoutput%>>17 AND1 q%!8=1<<22
q%!4=I%
SYS SetI,,q%
NEXT
PROCshowscaletofit
$z%(0)="1"
$z%(1)="1"
......@@ -485,12 +492,14 @@ DEF PROCcallFSI
A$+=$adspcl%
ELSE
IF FNgeticonstate(output%,16) THEN
IF FNgeticonstate(output%,5) OR FNgeticonstate(output%,11) A$+="R"
IF FNgeticonstate(output%,3) AND FNgeticonstate(output%,11) A$+="R"
ELSE
SYS 53,VAL A$,3 TO ,,A%
IF A%=63 THEN
IF FNgeticonstate(output%,6) A$="27t"
IF FNgeticonstate(output%,12) A$="12t"
IF FNgeticonstate(output%,5) THEN
IF FNgeticonstate(output%,11) A$="27t":REM Square 256
IF FNgeticonstate(output%,10) A$="12t":REM Rect 256
ENDIF
ELSE
IF A%=255 A$+="d"
ENDIF
......@@ -746,7 +755,7 @@ ENDPROC
:
REM
DEF PROCcheckmouse(mousex%,mousey%,b%,handle%,icon%,ob%)
LOCAL moved%,imenu$,pmenu$
LOCAL moved%,sqr$,imenu$,pmenu$
REM Picture menu structure
pmenu$= FNmsg0("Pimg")+">sinfo%,"+FNmsg0("Psrc")+">srcinfo%,"+FNmsg0("Prange")+">raninfo%,"
pmenu$=pmenu$+FNmsg0("Pzoom")+">zoom%,"+FNmsg0("Psave")+">save%,"+FNmsg0("PIredo")
......@@ -802,45 +811,14 @@ DEF PROCcheckmouse(mousex%,mousey%,b%,handle%,icon%,ob%)
CASE handle% OF
WHEN output%
IF dest%=0 THEN dest%=1:PROCdomenu(101,imenu$,FNmsg0("_TaskName")):SYS Getcaret%,,q%:moved%= TRUE
IFFNgeticonstate(output%,11) THENsqr$="90" ELSEsqr$="45"
CASE icon% OF
WHEN 3,4,5,6
PROCkillcurrent( STR$(22+icon%))
!q%=output%
q%!4=18
q%!8=0
q%!12=1<<21
SYS SetI,,q%
q%!4=24
SYS SetI,,q%
WHEN 7
PROCkillcurrent("S15,90,90")
!q%=output%
q%!4=18
q%!8=0
q%!12=1<<21
SYS SetI,,q%
q%!4=24
SYS SetI,,q%
WHEN 8
PROCkillcurrent("S32,90,90")
!q%=output%
q%!4=18
q%!8=0
q%!12=1<<21
SYS SetI,,q%
q%!4=24
SYS SetI,,q%
WHEN 9
PROCkillcurrent("0")
!q%=output%
q%!4=18
q%!8=0
q%!12=1<<21
SYS SetI,,q%
q%!4=24
SYS SetI,,q%
WHEN 10
PROCkillcurrent("8")
WHEN 2,3,4,5
IFsqr$="90" THEN
PROCkillcurrent(MID$("25262728",(2*icon%)-3,2))
ELSE
PROCkillcurrent(MID$(" 0 81215",(2*icon%)-3,2))
ENDIF
!q%=output%
q%!4=18
q%!8=0
......@@ -848,8 +826,8 @@ DEF PROCcheckmouse(mousex%,mousey%,b%,handle%,icon%,ob%)
SYS SetI,,q%
q%!4=24
SYS SetI,,q%
WHEN 11
PROCkillcurrent("12")
WHEN 6
PROCkillcurrent("S12,90,"+sqr$)
!q%=output%
q%!4=18
q%!8=0
......@@ -857,8 +835,8 @@ DEF PROCcheckmouse(mousex%,mousey%,b%,handle%,icon%,ob%)
SYS SetI,,q%
q%!4=24
SYS SetI,,q%
WHEN 12
PROCkillcurrent("15")
WHEN 7
PROCkillcurrent("S15,90,"+sqr$)
!q%=output%
q%!4=18
q%!8=0
......@@ -866,8 +844,8 @@ DEF PROCcheckmouse(mousex%,mousey%,b%,handle%,icon%,ob%)
SYS SetI,,q%
q%!4=24
SYS SetI,,q%
WHEN 13
PROCkillcurrent("S15,90,45")
WHEN 8
PROCkillcurrent("S16,90,"+sqr$)
!q%=output%
q%!4=18
q%!8=0
......@@ -875,8 +853,8 @@ DEF PROCcheckmouse(mousex%,mousey%,b%,handle%,icon%,ob%)
SYS SetI,,q%
q%!4=24
SYS SetI,,q%
WHEN 14
PROCkillcurrent("S32,90,45")
WHEN 9
PROCkillcurrent("S32,90,"+sqr$)
!q%=output%
q%!4=18
q%!8=0
......@@ -884,67 +862,58 @@ DEF PROCcheckmouse(mousex%,mousey%,b%,handle%,icon%,ob%)
SYS SetI,,q%
q%!4=24
SYS SetI,,q%
WHEN 10,11
REM The dpi changed, simulate a colour click to force a mode recalc
FOR I%=2 TO 9
IFFNgeticonstate(output%,I%) PROCcheckmouse(0,0,b%,output%,I%,0):I%=10
NEXT
WHEN 15
REM 'Special'
PROCkillcurrent(FNdeducemode)
SYS SetI,,q%
SYS Caretpos%,output%,19,,,-1,LEN ($adspcl%)
!q%=output%
q%!4=7
q%!8=0
q%!12=1<<22
SYS SetI,,q%
q%!4=8
SYS SetI,,q%
q%!4=13
SYS SetI,,q%
q%!4=14
SYS SetI,,q%
FOR I%=6 TO 9
IF kernspt%>>I% AND1 q%!8=0 ELSE q%!8=1<<22
q%!4=I%
SYS SetI,,q%
NEXT
WHEN 16
REM 'Colour'
PROCkillcurrent(FNdeducemode)
!q%=output%
q%!4=7
q%!8=0
q%!12=1<<22
SYS SetI,,q%
q%!4=8
SYS SetI,,q%
q%!4=13
SYS SetI,,q%
q%!4=14
SYS SetI,,q%
FOR I%=6 TO 9
IF kernspt%>>I% AND1 q%!8=0 ELSE q%!8=1<<22
q%!4=I%
SYS SetI,,q%
NEXT
WHEN 17
REM 'Monochrome'
PROCkillcurrent(FNdeducemode)
!q%=output%
q%!4=7
q%!8=1<<22
q%!12=1<<22
SYS SetI,,q%
q%!4=8
SYS SetI,,q%
q%!4=13
SYS SetI,,q%
q%!4=14
SYS SetI,,q%
FOR I%=6 TO 9
q%!4=I%
SYS SetI,,q%
NEXT
IF LEFT$($admode%,1) = "S" THEN
IF RIGHT$($admode%,2) = "45" THEN
PROCkillcurrent("15")
!q%=output%
q%!4=18
q%!8=0
q%!12=1<<21
SYS SetI,,q%
q%!4=24
SYS SetI,,q%
ELSE
PROCkillcurrent("28")
!q%=output%
q%!4=18
q%!8=0
q%!12=1<<21
SYS SetI,,q%
q%!4=24
SYS SetI,,q%
ENDIF
!q%=output%
q%!4=18
q%!8=0
q%!12=1<<21
SYS SetI,,q%
q%!4=24
SYS SetI,,q%
ENDIF
WHEN 18
!q%=output%
......@@ -1347,39 +1316,43 @@ DEF FNdeducemode
:
REM
DEF PROCshowscaletofit
LOCAL m,x,y
LOCAL m,x,y,dpi%,col%
$admode%=FNdeducemode
CASE ?admode% OF
WHEN ASC "S"
IF VAL MID$($admode%,5)>VAL MID$($admode%,8) x=6 ELSE x=0
IF VAL MID$($admode%,2)>16 x+=5 ELSE x+=4
IF VAL MID$($admode%,5)>VAL MID$($admode%,8) dpi%=45 ELSE dpi%=90
col%=6+INSTR("12151632",MID$($admode%,2,2))DIV2
SYS &35,-1,11 TO ,,tofitx%
SYS &35,-1,12 TO ,,tofity%
WHEN ASC "J"
SYS &35,-1,11 TO ,,tofitx%
SYS &35,-1,12 TO ,,tofity%
x = 12 : REM So no radio button is selected.
dpi%=90 : col%=12 : REM So no radio button is selected.
OTHERWISE
m=VAL $admode%
SYS &35,m,11 TO ,,tofitx%
SYS &35,m,12 TO ,,tofity%
SYS &35,m,4 TO ,,x
SYS &35,m,5 TO ,,y
IF y>x x=6 ELSE x=0
IF y>x dpi%=45 ELSE dpi%=90
SYS &35,m,9 TO ,,y
x+=y
col%=2+y
ENDCASE
tofitx%+=1
tofity%+=1
$adscale%=FNmsg2("ScaleFill",STR$tofitx%,STR$tofity%)
q%!12=1<<21
!q%=output%
FOR I%=0 TO 11
IF I%=x q%!8=1<<21 ELSE q%!8=0
q%!4=I%+3
q%!4=10 : IF dpi%=45 THEN q%!8=1<<21 ELSE q%!8=0
SYS SetI,,q%
q%!4=11 : IF dpi%=90 THEN q%!8=1<<21 ELSE q%!8=0
SYS SetI,,q%
FOR I%=2 TO 9
IF I%=col% q%!8=1<<21 ELSE q%!8=0
q%!4=I%
SYS SetI,,q%
NEXT
IF x=12 q%!8=0:q%!4=24:SYS SetI,,q%
IF col%=12 q%!8=0:q%!4=24:SYS SetI,,q%
ENDPROC
:
REM
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment