This is just a very simple, but potentially useful, tool that I knocked up just now to demonstrate the RPIX% command. Its task in life is to magnify any 64x64 pixel part of the screen. There are plenty of things one could do to add features and to improve those that are. Error trapping is minimal!
Invoke with, for example: EX "dev4_scr_rpx_Mag_bas"; 5
for a 5X magnification.
(Default here is 4X, or whatever you set in the code directly.) Further instructions in the code,
below.
Reguires ptrmen_cde and my RPIX% command (although for this simple application one could easily devise a replacement for RPIX% using PEEK/PEEK_W)
100 rem Simple magnifyer tool 110 rem V0.01, pjw, June 10th 2019 120 rem Needs ptrmen_cde 130 : 140 rem DO to move display 150 rem HIT to magnify area under sprite 160 rem ESC to quit 170 : 180 COLOUR_NATIVE 190 : 200 IF LEN(CMD$) = 0 THEN 210 mg% = 4: rem Magnification factor 2, 3, 4.. 220 ELSE 230 mg% = CMD$ 240 END IF 250 : 260 LRESPR 'dev4_scr_rpx_RPIX_BIN' 270 spr = SP_SQU64 280 : 290 rem Init 300 ch = FOPEN("con") 310 wx% = SCR_XLIM(#ch): wy% = SCR_YLIM(#ch) 320 WINDOW#ch; wx%, wy%, 0, 0: OUTL 330 SPRS#ch; spr 340 : 350 sx% = PEEK_W(spr + 4): sy% = PEEK_W(spr + 6) 360 vx% = sx% * mg%: vy% = sy% * mg% 370 px% = wx% - vx%: py% = 0 380 ym% = wy% - sy%: rem Max y 390 : 400 scr = WSAIN(#ch; vx%, vy%) 410 WSASV#ch; scr, vx%, vy%, px%, py% 420 MoveDisplay px%, py% 430 : 440 rem Do it! 450 tv% = 8 + 1: x% = -1: y% = x%: t% = x% 460 REPeat lp 470 RDPT#ch; tv%, x%, y%, t% 480 k% = tv% DIV 256 490 SELect ON k% 500 = 0: rem Moving pointer 510 = 1: IF y% > ym% THEN 520 BEEP 99, 1: Magnify x%, ym% - sy% 530 ELSE 540 Magnify x%, y% 550 END IF 560 = 2: MoveDisplay x%, y% 570 = 27: EXIT lp 580 = REMAINDER : BEEP 999, 100 590 END SELect 600 END REPeat lp 610 QUIT 620 : 630 : 640 DEFine PROCedure Magnify(xx%, yy%) 650 LOCal x%, y%, c% 660 : 670 FOR y% = 0 TO sy% - 1 680 FOR x% = 0 TO sx% - 1 690 c% = RPIX%(#ch; xx% + x%, yy% + y%) 700 BLOCK#ch; mg%, mg%, px% + x% * mg%, py% + y% * mg%, c% 710 END FOR x% 720 END FOR y% 730 END DEFine Magnify 740 : 750 : 760 DEFine PROCedure MoveDisplay(xx%, yy%) 770 WSARS#ch; scr\ vx%, vy%, px%, py% 780 : 790 px% = xx% 800 IF xx% + sx% * mg% > wx%: px% = wx% - sx% * mg% 810 : 820 py% = yy% 830 IF yy% + sy% * mg% > wy%: py% = wy% - sy% * mg% 840 : 850 WSASV#ch; scr, vx%, vy%, px%, py% 860 BLOCK#ch; vx%, vy%, px%, py%, -1 870 END DEFine MoveDisplay 880 : 890 : 900 : 910 rem + ************************************************************************ + 920 rem *< Help routines and Data >* 930 rem + ************************************************************************ + 940 : 950 DEFine FuNction SP_SQU64 960 LOCal dad 970 rem dev4_scr_rpx_squ64_spr, 64x64, mode 16, square 980 : 990 dad = ALCHP(544) 1000 : 1010 POKE_W dad + 0, 528, 224, 64, 64, 0, 0, 0, 12, 0, 270 1020 POKE_W dad + 20, 0, 0, 21068, 17713, 0, 4096, 15872, -256, -256, -256 1030 POKE_W dad + 40, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256 1040 POKE_W dad + 60, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256 1050 POKE_W dad + 80, -256, -256, -256, -256, -256, -256, -256, -256, -1, -32000 1060 POKE_W dad + 100, -1, -32000, -1, -32000, -1, -32000, -1, -32000, -1, -32000 1070 POKE_W dad + 120, -1, -32000, -1, -32000, -1, -32000, -1, -32000, -1, -32000 1080 POKE_W dad + 140, -1, -32000, -1, -32000, -1, -32000, -1, -32000, -1, -32000 1090 POKE_W dad + 160, -1, -32000, -1, -32000, -1, -32000, -1, -32000, -1, -32000 1100 POKE_W dad + 180, -1, -32000, -1, -32000, -1, -32000, -1, -32000, -1, -32000 1110 POKE_W dad + 200, -1, -32000, -1, -32000, -1, -32000, -1, -32000, -1, -32000 1120 POKE_W dad + 220, -1, 15872, -256, -256, -256, -256, -256, -256, -256, -256 1130 POKE_W dad + 240, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256 1140 POKE_W dad + 260, -256, -256, -256, -256, -256, -256, -256, -256, -256, -256 1150 POKE_W dad + 280, -256, -256, -256, 21068, 17713, 0, 4096, -16129, -15616, -1 1160 POKE_W dad + 300, -15616, -1, -15616, -1, -15616, -1, -15616, -1, -15616, -1 1170 POKE_W dad + 320, -15616, -1, -15616, -1, -15616, -1, -15616, -1, -15616, -1 1180 POKE_W dad + 340, -15616, -1, -15616, -1, -15616, -1, -15616, -1, -15616, -1 1190 POKE_W dad + 360, -15616, -1, -15616, -1, -15616, -1, -15616, -1, -15616, -1 1200 POKE_W dad + 380, -15616, -1, -15616, -1, -15616, -1, -15616, -1, -15616, -1 1210 POKE_W dad + 400, -15616, -1, -15616, -1, -15616, -1, -15616, -1, -15616, -1 1220 POKE_W dad + 420, -15616, -1, -15616, -1, -15616, -1, -15616, -1, -15616, -1 1230 POKE_W dad + 440, -15616, -1, -15616, -1, -15616, -1, -15616, -1, -15616, -1 1240 POKE_W dad + 460, -15616, -1, -15616, -1, -15616, -1, -15616, -1, -15616, -1 1250 POKE_W dad + 480, -15616, -1, -15616, -1, -15616, -1, -15616, -1, -15616, -1 1260 POKE_W dad + 500, -15616, -1, -15616, -1, -15616, -1, -15616, -1, -15616, -1 1270 POKE_W dad + 520, -15616, -1, -15616, -1, -15616, -1, -15616, -1, -15616, -1 1280 POKE_W dad + 540, -15616, -16129 1290 : 1300 RETurn dad 1310 END DEFine SP_SQU64 1320 :