Some newbie problems with propeller, please help!
morfellu
Posts: 5
Hey guys,
Im new to this forum and im here to find some help. Im doing a college work, its just a simple sudoku developed with the propeller.
In my main program I use the graphics, TV, mouse and keyboard objects. The problem is I think I dont have enough memory in the chip because:
If I try to run the program loading only the graphics,tv and keyboard objects, it works, but when i try to run all the 4 objects I got a black screen and nothing happens. If i load tv, graphics and mouse instead keyboard It also works ok. The problem is loading the 4 objects at once.
u think its a memory problem? Should I use any cogs?
thanks in advance and sorry my newbinessss [noparse]:([/noparse]
Im new to this forum and im here to find some help. Im doing a college work, its just a simple sudoku developed with the propeller.
In my main program I use the graphics, TV, mouse and keyboard objects. The problem is I think I dont have enough memory in the chip because:
If I try to run the program loading only the graphics,tv and keyboard objects, it works, but when i try to run all the 4 objects I got a black screen and nothing happens. If i load tv, graphics and mouse instead keyboard It also works ok. The problem is loading the 4 objects at once.
u think its a memory problem? Should I use any cogs?
thanks in advance and sorry my newbinessss [noparse]:([/noparse]
Comments
I doubt you are using up the memory because there are some intense demos in the Hydra forum. Check that you are intiailizing each driver properly.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter
tdswieter.com
One little spark of imagination is all it takes for an idea to explode
when I hit F8 I see I have 6008 longs of free memory, so its not a memory problem?
About initializing the drivers ..., i think im doing well because I can use them separately, but not together. I mean if I only use the keyboard i can play the sudoku with keyboard, and when I load the mouse I can also play ok. So the drivers initialize correctly, at least they do it separately.
What can I do? I read in some other forum, that I can have free memory when I hit F8, but then In execution time you can run out of memory, could it be?
This is a preliminary version, so the sudoku game function is not yet properlly implemented, but at least I should be able to move around the cells with my mouse or keyboard!
please help!
from using too much memory. What happens with _free and _stack not commented out ?
I don't know what parameters are required in this list but you cannot just comment them out on a whim.
I have some info on Graphics here:
http://www.rayslogic.com/propeller/Programming/GraphicsDemo.htm
Also, another student is doing the exact same thing· (maybe one of your classmates?).· Look here:
http://forums.parallax.com/showthread.php?p=693838
I have changed the bitmap_base = $5000 value, and now i can compile and execute my program with keyboard and mouse at once, but the new problem is that the screen is flickering all the time, it seems like the processor is not fast enough to do the repeat cycle and I can see the flickering? u know what I mean ? what can i do ?
thanks in advance
Some options:
1. draw only changes. Adapt your main loop to display the screen, then only draw those things that are different. For a game like this, that's a few numeric characters, which will both localize the flicker and diminish it. (probably the easiest approach)
2. decouple the drawing from the main program loop. Draw whatever you want, but do it when the television / monitor beam is not scanning the screen. The result will be a slower display, but one that has a whole lot less flicker. (somewhat harder)
3. Consider using other graphics means and methods. A tile based driver is more work, but will consume a lot less memory. I posted an 8x8 NTSC driver here that's another alternative. It's been enhanced by Hippy too, for color and PAL display. Break your game elements into discrete tiles, build them up, then display them on the screen. This can be double buffered, which then gets rid of your flicker and memory problems. (hardest, but yields the greatest overall improvement!)
eg: the numbers displayed then consume a coupla bytes of screen memory, instead of all the bytes required to display them as full-on bitmap graphics. Draw speed is faster too, in that your program really only needs to manipulate a small number of memory elements to rebuild the display as a whole. Finally, everything is stored maybe once or twice, instead of many times.
BTW: You can do tiles with the reference Parallax drivers. Each tile of screen memory can be pointed to any other place in memory, not just to form a bitmapped screen. One could point the graphics routines to an area of memory, not being displayed, draw all the unique graphics elements, then point each screen memory tile to that region of memory, as needed, to form the dynamic game display. That's somewhat complex, but totally doable with that driver set.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Post Edited (potatohead) : 12/18/2007 4:56:48 PM GMT
Could you explain me the point 2. of your comment? I really dont understand it. Thank you