Bug? Simple_numbers.dec decstr memory corruption
TransistorToaster
Posts: 149
Hello,
This memory corruption I encountered makes really no sense. I am basically working off from the graphics_demo.spin file where I just put in my own code to display what I need on the screen. For debugging purposes, I removed all cogs from my code such that I am only left with 1 tv cog, 1 graphics cog and the main cog. Here, the second text display function actually modifies the value of the previous one. I am probably missunderstanding something fundamental in object creation, the stack or some configuration with the TV ad GRAPHICS objects.
Any ideas please?
This memory corruption I encountered makes really no sense. I am basically working off from the graphics_demo.spin file where I just put in my own code to display what I need on the screen. For debugging purposes, I removed all cogs from my code such that I am only left with 1 tv cog, 1 graphics cog and the main cog. Here, the second text display function actually modifies the value of the previous one. I am probably missunderstanding something fundamental in object creation, the stack or some configuration with the TV ad GRAPHICS objects.
Any ideas please?
OBJ tv : "tv" gr : "graphics" simple_numbers: "Simple_Numbers" PUB start | i, j, k, kk, dx, dy, pp, pq, rr, numx, numchr repeat k=200 gr.text(80,50,simple_numbers.dec(k)) k=200 gr.text(160,50,simple_numbers.dec(f )) f:=f+1
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Jeff Martin
· Sr. Software Engineer
· Parallax, Inc.
PUB text(x, y, string_ptr)
Draw text
string_ptr - address of zero-terminated string (it may be necessary to call .finish
immediately afterwards to prevent subsequent code from clobbering the
string as it is being drawn
So, you should call finish each time after text
PUB finish
Wait for any current graphics command to finish
use this to insure that it is safe to manually manipulate the bitmap
Thanks for your advice.