Learning Prop Video Help
IRobot2
Posts: 164
I am looking for a good place to start learning video for the prop. Specifically I want to make basic shapes and such that can be manipulated according to inputs (think control panel Start/Stop and other indicators).
This last weekend I have been trying to learn from objects in the OBEX like Chicps Graphics object and Demo and Jim Fouchs GraphicsPaletteHelper. I also did my best to use the manual to reference what I did not understand. Typically I jump into objects, change a few things and see what happens. I usually learn very well that way but either I am a bit slower in the head than the rest of you or I am missing some type of tutorial because I cannot seem to grasp what is going on.
So my question is Is there a better way to learn how to do basic graphics on the prop other than looking the few examples in the obex? I would love some type of basic tutorial (Like the Prop Education Labs text), or SIMPLE or broken down objects that start out making only a box or single button. Is this out there some where?
This last weekend I have been trying to learn from objects in the OBEX like Chicps Graphics object and Demo and Jim Fouchs GraphicsPaletteHelper. I also did my best to use the manual to reference what I did not understand. Typically I jump into objects, change a few things and see what happens. I usually learn very well that way but either I am a bit slower in the head than the rest of you or I am missing some type of tutorial because I cannot seem to grasp what is going on.
So my question is Is there a better way to learn how to do basic graphics on the prop other than looking the few examples in the obex? I would love some type of basic tutorial (Like the Prop Education Labs text), or SIMPLE or broken down objects that start out making only a box or single button. Is this out there some where?
Comments
I felt exactly like you when I started to look at it few months before
Have you take a look at the TV.spin code? It's quite simple. It's only to display text, but it show how the signal is sent to the TV.
I tried to understand it, but did not succeed, so I'm not "simply" using it...
JM
Other than getting the Hydra, or at least the book, is there somthing that can break out the basics for me?
I am not new to the prop, but I know video/graphics has to lure many people into trying it out. How would some one that picks up a Demo board for the first time go about doing any thing other than running a graphics demo? Even though I never had used video before, I have told many people of the props capabilities with video and such. I feel that if any one came back and asked me how to go about doing it, I would have to shrug my shoulders. I think I am making it way more difficult than it is.
@JM: Well it is nice to see that some one else is in the same boat. But it also scares me. If people like you and I "simply" stop using it because there is no easy way to learn it, think about all the other people that have tried and gave up too. We could be missing out on a lot of tallent from all the people that just gave up.
Please note: although the video capabilities of the Propeller are impressive, they do have certain inherent limitations:
1. Max 8 pins per pixel (VGA) or 3 pins per pixel & 16 hues (TV). Note: some pins may be used for signalling. On the demoboard (a standard output) this means 64 colors for VGA outpu and ~100 colors for TV output.
2. The Propeller has 32K of HUB RAM which is shared by SPIN applications & data, shared data, and frame buffers. A 160x120x8bpp frame buffer will use 19K. Tile and sprite based drivers have higher resolution but have additional restrictions.
Colors and display area methods have been added to make a few things easier.
When you get your graphics_demo.spin working on your setup, you can run this one to see the differences in the display, read the comments, and hopefully explore some basic graphics along the way.
http://forums.parallax.com/showpost.php?p=920189&postcount=1
Thank You! Your revised and commented code does make it quite a bit easier to figure out what is going on. This at least got me on the right path. I have found a few questions that I could not seem to figure out though.
1) When I take away code that creates the triangles/lines and text, I still get an upwards pointing arrow with a line underneath towards the upper right corner. I cannot figure out where this is coming from in the code.
EDIT: I found lines 189-193 that take away the line and arrow, but now I am confused of how that actually made a line and arrorow with the "set_tile_address". ?? Did I simply hide it instead of deleting it?
2.) How do I make text bigger? I found the color and width, but I guess there is only a default map of the characters at a certain size? How would I go about changing this? The big counting number references “@numchr” . I cannot seem to find that either. I was going to look to see how that was created bigger than the other text.
3.) How to make a filled in circle? I see many shapes and I was able to draw a few lines and box to put text in. But circles/dots seem much harder. Do I have to make a series of arks and try to fill them in somehow?
Thanks for all of your help. I am a lot better off than I was a few days ago. -Alex
The "screen" is just an array filled with address and color palette pointers.
The set_tile_address method simply redefines one of those to point to the ROM. That's what makes the character appear, and that's why I did it.
The graphics screen, where the actual shapes are, is just a sequential series of addresses. Each tile points to a small set of those, 64 bytes per tile.
Later on, a portion of the screen is cloned. That's done by simply changing the tile address pointers.
Many drivers have a screen pointer, which then calculates addresses on the fly. Most often these are linear, where there are X bytes per line, for Y lines = Z screen.
This driver defines the screen in terms of tiles, where each tile can display 64 bytes from anywhere in the HUB memory, with that address being 64 byte aligned.
Why that alignment? 10 bits of the 16 bit tile address pointer is used to create the HUB memory address that contains the pixels. The other 6 bits are used to index the color palette, so that tile has the colors assigned to it.
To create a filled circle, I believe you need to draw a circle, then use the fill command in graphics.spin. Look at that SPIN program for arguments. I've not used it, but it's there.
The text is actually a vector font that can be scaled!
Dealing with the text works a lot like dealing with lines and such. There is a textmode method in graphics.spin that you can use to set the text MODE.
PUB textmode(x_scale, y_scale, spacing, justification)
Feed that some new values, then draw some text to see the impact.
colorwidth (color, width) sets the mode for lines and other shapes.
It's worth setting this up, with just a screen and a few commands in it so you can run through all the stuff that graphics.spin does. (it does a lot more than people think)