While I am here another question.
Previously I was trying to create a checkboard pattern the computer monitor with dark and light tiles.
I which I was able to do by accident. Because it did not work as I thought.
I have added the debug to here, the working code is below.
The debug screen shows:
J start
1
-2
1
-2 and so on
If I start with j := 0 see code . I get columns not a checkerboard
and the debug shows:
J start
0
-1
0
-1 and so on
What is going on??? Why in the first example does j go from 1 to -2
when doing a !j and I get the checkerboard. And
Why does j do what I expect in the second example but I don't get the
checkerboard pattern, I get columns?? - especially since when I use j, I
am just checking if it is equal to 1??
Code:CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 '512x384 tiles = gr#tiles OBJ gr : "vga graphics ASM" debug : "FullDuplexSerial" PUB MainLoop|i,j gr.start gr.pointcolor(1) debug.start(31, 30, 0, 57600) waitcnt(clkfreq * 5 + cnt) j := 1 '<---------- SEE HERE IS THE PROBLEM (if I change to 0 ---------------- debug.str(string("J start")) debug.Tx(13) debug.dec(j) repeat i from 0 to tiles - 1 '16 columns x 12 rows = 192 if(i//16 == 0) !j '<------------ HERE I USE IT -------------------------- debug.Tx(13) debug.dec(j) if(j == 1) '<------------ HERE I USE IT -------------------------- if(i//2 == 0) gr.color(i,$00FF) 'wht on blk else gr.color(i,$FF00) 'blk on wht else if(i//2 == 0) gr.color(i,$FF00) 'blk on wht else gr.color(i,$00FF) 'wht on blk repeat
Post Edited (reppig) : 11/5/2009 3:26:03 PM GMT



Reply With Quote

Bookmarks