Could someone please look over my code?
SONIC the Hedgehog
Posts: 321
So I haven't really gotten into propeller assembly enough to use it for this simple......program you could say.
So I've been making a graphics demo. I used the AiGeneric driver that Oldbitcollecter used in the lightcycle demo as a starting point. And I'd like a professional opinion as to why or why not my code would work so I may improve upon it, thanks!
So I've been making a graphics demo. I used the AiGeneric driver that Oldbitcollecter used in the lightcycle demo as a starting point. And I'd like a professional opinion as to why or why not my code would work so I may improve upon it, thanks!
' ' File: Sonic on prop graphic demo CON clkmode =xtal1 +pl16x ** * * * *xinfreq** =5_000_000 ** * * * *UpdateTime = 24_000_000 VAR byte CogLaunch[1000] OBJ* *text * : *"aigeneric_driver_g" PUB CogLauncher cognew(VidDatBuf1, @CogLaunch[0]) cognew(VidDatBuf2, @CogLaunch[500]) PUB DisplayBuffer Repeat ** waitcnt(clkfreq/UpdateTime + cnt) ** text.UpdateScreen PUB VidDatBuf1 *text.pokechar(6,4,21,"#") **text.pokechar(7,4,21,"#") ** text.pokechar(8,3,21,"#") **text.pokechar(8,4,21,"#") **text.pokechar(8,5,21,"#") **text.pokechar(9,3,21,"#") **text.pokechar(9,4,21,"#") **text.pokechar(9,5,21,"#") **text.pokechar(10,3,21,"#") **text.pokechar(10,4,21,"#") * **text.pokechar(10,5,21,"#") **text.pokechar(11,3,21,"#") **text.pokechar(11,4,21,"#") **text.pokechar(11,5,21,"#") **text.pokechar(11,6,21,"#") **text.pokechar(12,2,21,"#") **text.pokechar(12,3,21,"#") **text.pokechar(12,4,21,"#") **text.pokechar(12,5,21,"#") **text.pokechar(12,6,21,"#") **text.pokechar(12,7,21,"#") **text.pokechar(13,2,21,"#") **text.pokechar(13,3,21,"#") **text.pokechar(13,4,21,"#") **text.pokechar(13,5,21,"#") **text.pokechar(13,6,21,"#") ** text.pokechar(13,7,21,"#") **text.pokechar(14,2,21,"#") **text.pokechar(14,3,21,"#") **text.pokechar(14,4,21,"#") **text.pokechar(14,5,21,"#") **text.pokechar(14,6,21,"#") **text.pokechar(14,7,21,"#") **text.pokechar(15,2,21,"#") **text.pokechar(15,3,21,"#") **text.pokechar(15,4,21,"#") *text.pokechar(15,5,6,"#") ' ' sonics ear left **text.pokechar(15,6,6,"#") ' ' sonics ear left **text.pokechar(15,7,6,"#") ' ' sonics ear left **text.pokechar(16,2,21,"#") **text.pokechar(16,3,21,"#") **text.pokechar(16,4,6,"#") ' ' sonics ear left **text.pokechar(16,5,6,"#") ' ' sonics ear left **text.pokechar(16,6,6,"#") ' ' sonics ear left **text.pokechar(16,7,6,"#") ' ' sonics ear left ** text.pokechar(17,2,21,"#") **text.pokechar(17,3,21,"#") **text.pokechar(17,4,21,"#") **text.pokechar(17,5,7,"#")* text.pokechar(17,6,6,"#") ' ' sonics ear left **text.pokechar(17,7,6,"#") ' ' sonics ear left *text.pokechar(18,2,21,"#") **text.pokechar(18,3,21,"#") **text.pokechar(18,4,21,"#") *text.pokechar(18,5,21,"#")* *text.pokechar(18,6,21,"#")* *text.pokechar(18,7,6,"#") ' ' sonics ear left *text.pokechar(19,3,21,"#") **text.pokechar(19,4,21,"#") *text.pokechar(19,5,21,"#")* *text.pokechar(19,6,21,"#")* *text.pokechar(19,7,21,"#")* *text.pokechar(20,4,21,"#") *text.pokechar(20,5,21,"#")* *text.pokechar(20,6,21,"#")* *text.pokechar(20,7,21,"#") PUB VidDatBuf2 *text.pokechar(21,4,21,"#") *text.pokechar(21,5,21,"#")* *text.pokechar(21,6,21,"#")* *text.pokechar(21,7,21,"#") *text.pokechar(22,5,21,"#")* *text.pokechar(22,6,21,"#")* *text.pokechar(22,7,21,"#") *text.pokechar(23,5,21,"#")* *text.pokechar(23,6,21,"#")* *text.pokechar(23,7,21,"#") *text.pokechar(24,6,21,"#")* *text.pokechar(24,7,21,"#") text.pokechar(25,5,21,"#") *' ' sonic's right ear *text.pokechar(25,6,21,"#") ' ' sonic's right ear *text.pokechar(25,7,21,"#") ' ' sonic's right ear text.pokechar(26,4,21,"#") *' ' sonic's right ear *text.pokechar(26,5,21,"#")*' ' sonic's right ear *text.pokechar(26,6,21,"#")*' ' sonic's right ear *text.pokechar(26,7,21,"#")*' ' sonic's right ear *text.pokechar(20,8,21,"#") *text.pokechar(21,8,21,"#")* *text.pokechar(22,8,21,"#")* *text.pokechar(23,8,21,"#") *text.pokechar(24,8,21,"#")* *text.pokechar(25,8,21,"#") *text.pokechar(26,8,21,"#") text.pokechar(20,9,21,"#") *text.pokechar(21,9,21,"#")* *text.pokechar(22,9,21,"#")* *text.pokechar(23,9,21,"#") *text.pokechar(24,9,21,"#")* *text.pokechar(25,9,21,"#") *text.pokechar(26,9,21,"#")
Comments
-Phil
-browz
CON*
** * * * *clkmode =xtal1 +pl16x
** * * * *xinfreq** =5_000_000
** * * * *UpdateTime = 24_000_000
VAR
byte CogLaunch[1000]
OBJ*
*text * : *"aigeneric_driver_g"
PUB CogLauncher
cognew(VidDatBuf1, @CogLaunch[0])
cognew(VidDatBuf2, @CogLaunch[500])
PUB DisplayBuffer
Repeat
** waitcnt(clkfreq/UpdateTime + cnt)
** text.UpdateScreen
PUB VidDatBuf1
*text.pokechar(6,4,21,"#")
**text.pokechar(7,4,21,"#")
** text.pokechar(8,3,21,"#")
**text.pokechar(8,4,21,"#")
**text.pokechar(8,5,21,"#")
**text.pokechar(9,3,21,"#")
**text.pokechar(9,4,21,"#")
**text.pokechar(9,5,21,"#")
**text.pokechar(10,3,21,"#")
**text.pokechar(10,4,21,"#") *
**text.pokechar(10,5,21,"#")
**text.pokechar(11,3,21,"#")
**text.pokechar(11,4,21,"#")
**text.pokechar(11,5,21,"#")
**text.pokechar(11,6,21,"#")
**text.pokechar(12,2,21,"#")
**text.pokechar(12,3,21,"#")
**text.pokechar(12,4,21,"#")
**text.pokechar(12,5,21,"#")
**text.pokechar(12,6,21,"#")
**text.pokechar(12,7,21,"#")
**text.pokechar(13,2,21,"#")
**text.pokechar(13,3,21,"#")
**text.pokechar(13,4,21,"#")
**text.pokechar(13,5,21,"#")
**text.pokechar(13,6,21,"#")
** text.pokechar(13,7,21,"#")
**text.pokechar(14,2,21,"#")
**text.pokechar(14,3,21,"#")
**text.pokechar(14,4,21,"#")
**text.pokechar(14,5,21,"#")
**text.pokechar(14,6,21,"#")
**text.pokechar(14,7,21,"#")
**text.pokechar(15,2,21,"#")
**text.pokechar(15,3,21,"#")
**text.pokechar(15,4,21,"#")
*text.pokechar(15,5,6,"#") ' ' sonics ear left
**text.pokechar(15,6,6,"#") ' ' sonics ear left
**text.pokechar(15,7,6,"#") ' ' sonics ear left
**text.pokechar(16,2,21,"#")
**text.pokechar(16,3,21,"#")
**text.pokechar(16,4,6,"#") ' ' sonics ear left
**text.pokechar(16,5,6,"#") ' ' sonics ear left
**text.pokechar(16,6,6,"#") ' ' sonics ear left
**text.pokechar(16,7,6,"#") ' ' sonics ear left
** text.pokechar(17,2,21,"#")
**text.pokechar(17,3,21,"#")
**text.pokechar(17,4,21,"#")
**text.pokechar(17,5,7,"#")*
text.pokechar(17,6,6,"#") ' ' sonics ear left
**text.pokechar(17,7,6,"#") ' ' sonics ear left
*text.pokechar(18,2,21,"#")
**text.pokechar(18,3,21,"#")
**text.pokechar(18,4,21,"#")
*text.pokechar(18,5,21,"#")*
*text.pokechar(18,6,21,"#")*
*text.pokechar(18,7,6,"#") ' ' sonics ear left
*text.pokechar(19,3,21,"#")
**text.pokechar(19,4,21,"#")
*text.pokechar(19,5,21,"#")*
*text.pokechar(19,6,21,"#")*
*text.pokechar(19,7,21,"#")*
*text.pokechar(20,4,21,"#")
*text.pokechar(20,5,21,"#")*
*text.pokechar(20,6,21,"#")*
*text.pokechar(20,7,21,"#")
PUB VidDatBuf2
*text.pokechar(21,4,21,"#")
*text.pokechar(21,5,21,"#")*
*text.pokechar(21,6,21,"#")*
*text.pokechar(21,7,21,"#")
*text.pokechar(22,5,21,"#")*
*text.pokechar(22,6,21,"#")*
*text.pokechar(22,7,21,"#")
*text.pokechar(23,5,21,"#")*
*text.pokechar(23,6,21,"#")*
*text.pokechar(23,7,21,"#")
*text.pokechar(24,6,21,"#")*
*text.pokechar(24,7,21,"#")
text.pokechar(25,5,21,"#") *' ' sonic's right ear
*text.pokechar(25,6,21,"#") ' ' sonic's right ear
*text.pokechar(25,7,21,"#") ' ' sonic's right ear
text.pokechar(26,4,21,"#") *' ' sonic's right ear
*text.pokechar(26,5,21,"#")*' ' sonic's right ear
*text.pokechar(26,6,21,"#")*' ' sonic's right ear
*text.pokechar(26,7,21,"#")*' ' sonic's right ear
*text.pokechar(20,8,21,"#")
*text.pokechar(21,8,21,"#")*
*text.pokechar(22,8,21,"#")*
*text.pokechar(23,8,21,"#")
*text.pokechar(24,8,21,"#")*
*text.pokechar(25,8,21,"#")
*text.pokechar(26,8,21,"#")
text.pokechar(20,9,21,"#")
*text.pokechar(21,9,21,"#")*
*text.pokechar(22,9,21,"#")*
*text.pokechar(23,9,21,"#")
*text.pokechar(24,9,21,"#")*
*text.pokechar(25,9,21,"#")
*text.pokechar(26,9,21,"#")
And I put it here outside of the code block and still see asterisks.....
But in order to get it on my computer I email it to myself, then copy and paste it again into the spin tool. Maybe it has something to do with the format of the font.
PlainText editor.