If you PM me the latest assembly version I can decompile it manually.
And yes, I should write a decompiler one day
![Razz](images/smiles/icon_razz.gif)
![Smile](images/smiles/icon_smile.gif)
iSPRITES2
det(0
det(3
det(9,0
det(5,0
det(22,"1 //All pauses and det(17 instances were for bug seeking purposes
Pause
sum(1,"SPRITE","w+")->SLOT //Opens a var location to store the current sprite. Didn't use Alloc( because it needs to be used more than once
det(17,"2
Pause
sum(11,64,SLOT
det(17,"3
Pause
sum(18,SLOT)->SLOT //Changes SLOT into an address to the slot
det(17,"4
Pause
For(A,0,63 //This is where it crashes because the five below is never shown. What is wrong with this code?
255->*{SLOT+A}
End
det(17,"5 //The five that wasn't ever shown
Pause
8->SIZEX //SIZE meaning current sprite dims, SPR meaning current sprite cursor location, PAL meaning the same for the palette, PALETTE meaning which of the four 8x8 palettes is currently in use, CURMODE being which cursor is in use.
8->SIZEY
0->SPRX
0->SPRY
0->PALX
0->PALY
0->PALETTE
0->CURMODE
Lbl EP
iD*aw Editpage //All [r]s are replaced with [*] because I made this while the [r] bug was still there
0->A
Repeat max(SIZEX,SIZEY)*A>200 //This loop scales the sprite depending on its length and width to fit the screen properly. Scale (pixel width) is stored in SCALE.
A+1->A
End
A-1->SCALE
det(5,0 //Main screen drawing routines
det(2,84
det(36,240,0,80,240
det(2,83
det(36,0,231,320,9
det(20,1
det(21,255
det(18,"MODE to ente* File and Palette Menu",0,0
det(18,"D*aw Fill G*ab Cu*so* Palette",1,231
det(18,"Sp*ite",248,36
det(18,"Palette",248,106
For(A,0,7 //Draws the palette
For(B,0,7
det(2,32*A+8*PALETTE+B
det(36,248+8*B,159+8*A,8,8
End
End
det(2,255
det(35,18,18,SCALE*SIZEX+4,SCALE*SIZEY+4
For(A,1,SIZEY //Draws the sprite
For(B,1,SIZEX
det(2,*{SLOT+(A-1)*SIZEY+B-1}
det(36,B*SCALE+20,A+SCALE+20,SCALE,SCALE
End
End
Pause
iEvent Loop
Repeat K=15
0->K
det(2,240+7*not(CURMODE //Redraws anything that was likely changed after a keypress. Everything else is taken care of elsewhere.
det(35,SCALE*SPRX+21,SCALE*SPRY+21,SCALE-2,SCALE-2
det(2,240+7*CURMODE
det(35,PALX*8+249,PALY*8+160,6,6
PALY*32+PALX+8*PALETTE->PALCOL //PALCOL meaning one byte value of selected color
det(2,PALCOL
det(36,248,74,64,32
SPRY*SIZEX+SPRX->SPRCOL //SPRCOL meaning color of selected sprite pixel
det(2,SPRCOL
det(36,248,4,64,32
det(19,248,114
det(16,PALCOL,3
det(19,248,44
det(16,PALCOL,3
Repeat K
getKey->K
End
If K>0 and K<5 //If an arrow key was pressed, cover up current cursors
det(2,240+7*not(CURMODE
det(35,SCALE*SPRX+21,SCALE*SPRY+21,SCALE-2,SCALE-2
det(2,240+7*CURMODE
det(35,PALX*8+249,PALY*8+160,6,6
If K=1
iDown
If not(CURMODE
If SPRY+1<SIZEY
SPRY+1->SPRY
End
Else
If PALY<7
PALY+1->PALY
End
End
End
If K=2
iLeft
If not(CURMODE
If SPRX>0
SPRX-1->SPRX
End
Else
If PALX>0
PALX-1->PALX
End
End
End
If K=3
iRight
If not(CURMODE
If SPRX+1<SIZEX
SPRX+1->SPRX
End
Else
If PALX<7
PALX+1->PALX
End
End
End
If K=4
iUp
If not(CURMODE
If SPRY>0
SPRY-1->SPRY
End
Else
If PALY>0
PALY-1->PALY
End
End
End
End
If K=53
iD*aw //Set PALCOL to current sprite location
ΣySLOT+SPRY*SIZEX+SPRX,°PALCOL+3,1
det(36,SPRX*SCALE+20,SPRY*SCALE+20,SCALE,SCALE
End
If K=52
iFill //A bit of a convoluted fill routine. Suggestions greatly appreciated.
iFill all connected spaces with 256 until no change is made in an ite*ation, Then change eve*y 256 to PALCOL.
If SLOTB≠0 or SLOTBSIZE≠SIZEX*SIZEY
SIZEX*SIZEY->SLOTBSIZE
sum(1,"SPRITEB","w+")->SLOTB
sum(11,SLOTBSIZE,SLOTB
sum(18,SLOTB)->SLOTB
sum(1,"SPRITEC","w+")->SLOTC
sum(11,2*SLOTBSIZE,SLOTC
sum(18,SLOTC)->SLOTC
End
For(A,0,SIZEX*SIZEY-1
ΣySLOTB+2*A,SLOT+A,1
End
σySLOTB+2*SPRX*SPRY,2,256
Repeat FILLDONE
For(A,0,SLOTBSIZE-1
ΣySLOTC+2*A,SLOTB+2*A,2
End
For(A,0,SLOTBSIZE-1
If **{SLOTB+2*A}=256
If remainder(A,SIZEX)>0 and **{SLOTB-1+2*A}=PALCOL
σySLOTB-1+2*A,2,256
End
If remainder(A,SIZEX)<SIZEX-1 and **{SLOTB+1+2*A}=PALCOL
σySLOTB+1+2*A,2,256
End
If remainder(A,SIZEY)>0 and **{SLOTB-2*SIZEX}=PALCOL
σySLOTB-2*SIZEX,2,256
End
If remainder(A,SIZEY)<SIZEY-1 and **{SLOTB+2*SIZEX}=PALCOL
σySLOTB+2*SIZEX,2,256
End
End
End
1->FILLDONE
For(A,0,SLOTBSIZE-1
If **{SLOTB+2*A}≠**{SLOTC+2*A}
not(FILLDONE)->FILLDONE
End
End
End
For(A,0,SLOTBSIZE-1
If **{SLOTB+2*A}=256
ΣySLOT+A,°PALCOL,1
End
End
For(A,1,SIZEY
For(B,1,SIZEX
det(2,*{SLOT+(A-1)*SIZEY+B-1}
det(36,B*SCALE+20,A+SCALE+20,SCALE,SCALE
End
End
End
If K=51
iG*ab //Sets SPRCOL to PALCOL and resets palette coordinates
SPRCOL->PALCOL
remainder(PALCOL,8)->PALX
PALCOL/32->PALY
remainder(PALCOL,32)/8->PALETTE
For(A,0,7
For(B,0,7
det(2,32*A+8*PALETTE+B
det(36,248+8*B,159+8*A,8,8
End
End
End
If K=50
iCu*so* //Swaps current cursor (0=Sprite 1=Palette
not(CURMODE)->CURMODE
End
If K=49
iPalette
PALETTE+1->PALETTE
If PALETTE=4
0->PALETTE
End
End
If K=56
iD*op-down menu //After all these bugs are fixed, this will be a hub for importing sprites, exporting sprites, creating custom palettes, editing a sprite queue, and other things.
End
End
Advertisement