I'm close to getting it to work. The result is just turning out skewed. I'll post the code to see if someone else can get it to work before me.Got it to work!
.TEST
ClrDraw
ClrDraw^r
[3C42A59999A5423C]→Pic1
[C0C0000000000000]→Pic2
Pt-On(0,0,Pic1)
DispGraph
0→C→D
For(A,0,7)
For(B,0,7)
If pxl-Test(B,A)
Pt-On(B+C+10,A+D,Pic2)
End
C+1→C
End
0→C+D+1→D
End
DispGraph^r
I realize some may not be optimized.
Note: Technically you don't have to use both buffers. I just did because it avoids colliding of pictures. It just depends where you want the end to display.
P.S. I would like to point out out the time when I made my first successful Axe program/routine
Edit: If you want x8 magnification (like graphmastur did) you only have to make a few tweaks to my code. Once I figure it out you will be able to make any sized magnification with simple tweaks of mine, I just have to make sure I'm right.
Anywho, the tweak for x8.
-Change
[C0C0000000000000]→Pic2 to
[FFFFFFFFFFFFFFFF]→Pic2.
-Change
Pt-On(B+C+10,A+D,Pic2) to
Pt-On(B+C+17,A+D,Pic2).
-Change
C+1→C to
C+7→C.
-Change
0→C+D+1→D to
0→C+D+7→D.
Edit: Ok, so ya. This method does work with any level of magnification. (Well up to x8 since I use sprites to display the magnified version. You could do more if you started displaying multiple sprites for one magnified block.)
Here is what you do:
-You change the hex code into a block of either 1*1, 2*2, 3*3, 4*4, 5*5, 6*6, 7*7, or 8*8 (which ever level of magnification you want).
--x1:
[8000000000000000]→Pic2--x2:
[C0C0000000000000]→Pic2--x3:
[E0E0E00000000000]→Pic2--x4:
[F0F0F0F000000000]→Pic2--x5:
[F8F8F8F8F8000000]→Pic2--x6:
[FCFCFCFCFCFC0000]→Pic2--x7:
[FEFEFEFEFEFEFE00]→Pic2--x8:
[FFFFFFFFFFFFFFFF]→Pic2-Change the constant in the first part of the
Pt-On( (that is in the
For( loop) to 8+Level of Magnification+1.
--x1:
Pt-On(B+C+10,A+D,Pic2)--x2:
Pt-On(B+C+11,A+D,Pic2)--x3:
Pt-On(B+C+12,A+D,Pic2)--x4:
Pt-On(B+C+13,A+D,Pic2)--x5:
Pt-On(B+C+14,A+D,Pic2)--x6:
Pt-On(B+C+15,A+D,Pic2)--x7:
Pt-On(B+C+16,A+D,Pic2)--x8:
Pt-On(B+C+17,A+D,Pic2)-Change the constant that is added to the variable
C to Level of Magnification-1.
--x1:
C+0→C (Could technically take out at this point.)
--x2:
C+1→C--x3:
C+2→C--x4:
C+3→C--x5:
C+4→C--x6:
C+5→C--x7:
C+6→C--x8:
C+7→C-Change the constant that is added to the variable
D to Level of Magnification-1.
--x1:
0→C+D+0→D (Can simplify to
0→C+D→D.)
--x2:
0→C+D+1→D--x3:
0→C+D+2→D--x4:
0→C+D+3→D--x5:
0→C+D+4→D--x6:
0→C+D+5→D--x7:
0→C+D+6→D--x8:
0→C+D+7→DExample:
.MAGX6
ClrDraw
ClrDraw^r
[3C42A59999A5423C]→Pic1
[FCFCFCFCFCFC0000]→Pic2
Pt-On(0,0,Pic1)
DispGraph
0→C→D
For(A,0,7)
For(B,0,7)
If pxl-Test(B,A)
Pt-On(B+C+15,A+D,Pic2)
End
C+5→C
End
0→C+D+5→D
End
DispGraph^r
I just realized that
DispGraphr isn't technically used for displaying the back buffer (it works in this case though). Is there a command that does just display the back buffer? Or is
DispGraphr used for this as long as it isn't in a loop?