??? 01/10/05 09:28 Read: times Msg Score: -1 -1 Offensive/Flame |
#84630 - Display routine is not enough Responding to: ???'s previous message |
First, there was no need to quote the post in full length.
Amey Sane said:
Please reply as soon as possible. Techfest deadline approaching? My recommendation: give it up! Even the length of my list should indicate, this is NOT a beginner's task. But, as an another recommendation, don't give up trying to do the thing! - not for the techfest (and the price), but for your own benefit of learning new things. Amey Sane said:
I would be oblidged to learn more about how to write the display routine. Oh, I describe you how do I usually approach new problems. First, I make a cup of coffee. Then I start searching the net for ideas. A sip of coffee. Finding out I am surfing on a completely different (but very interesting) topic. Another sip of coffee. Sketching a diagram or writing some pseudocode to a piece of paper. Another sip of coffee. Searching for a piece of old and proven startup code. Sip of coffee. Making a new directory (for a new project), copying and renaming the old file. Starting the favourite editor (se) and erasing the irrelevant piece from the old code. Sip of coffee. Hastily writing the core algorithm. Sip of coffee. Assembling, simulating, debugging; several cycles. Work done, cup empty. The idea behind the drawing is to have a description, how the "pen" should ride - a set of coordinates. Something like: - move to 0,0 - draw a line to 10,0 - move to 10,10 - draw a line to 0,0 - repeat from beginning This I would represent as data in RAM: 0,0,10,0 10,10,0,0 endmark The endmark is anything out of the allowed range of coordinates (which is 0-10 here) - say, 0FFh. Alternatively, you can store the number of drawn lines and have no endmark. Now the drawing algorithm is in pseudocode: start: {main program - e.g. checking inputs, game algorithm etc.} set pointer to table beginning label: get x,y if x=endmark, goto start set DACs to x and y advance pointer switch z on ("pen down") get x,y set switch z off ("pen up") goto label There should be an initialisation, which copies a "basic" table to the RAM (which might be internal or external), including the endmark. Then, when the main program wants to draw an another line, it inserts it to the end of table and places the endmark after it. Removing a line is a more cumbersome task, the whole remainder of table after the removed line should be moved. But, as a beginner, you should perhaps read through tutorials, try running various example codes etc.etc.etc. Jan Waclawek |