![]() |
Forum Index : Microcontroller and PC projects : FLASH command?
Author | Message | ||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9486 |
How possible or impossible would it be, to have a FLASH command for the full-size colour MM, for flashing text on and off? Flashing text is a fabulous attention getter. You could have something like FLASH +CLR$(Red) "Alert!" or FLASH @(50,100) +CLR$(Red) "Alert!" Is this something that would be do-able? I'm sure that Geoff will chime in here at some point, but I post this publicly, to find out if anyone else would like that feature. Smoke makes things work. When the smoke gets out, it stops! |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
I think you could make that work with a sprite. Although not as easy as using text. Microblocks. Build with logic. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9486 |
Please do tell.... Smoke makes things work. When the smoke gets out, it stops! |
||||
paceman Guru ![]() Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
Or just loop it through a Flash/Print@ function with a timer interrupt. |
||||
psergiu![]() Regular Member ![]() Joined: 09/02/2013 Location: United StatesPosts: 83 |
I don't trink it is very easily implemented due to the way in which MaxiMite displays video on a screen. How flashing is implemented on other devices: A PC video card (CGA,EGA,VGA & compatible), in text mode, allocates 2 bytes for each character on the screen. 80*25*2=4KB. The 1st byte is the attribute value, the 2nd one is the ASCII char to be displayed. Bit 7 of the attribute byte is Flash. If you want to print a flashing "A" you put 0x8F in the 1st byte and and 0x41 in the 2nd. When the video frame is rendered, the video card will read the video RAM, will draw the letter A according to the font bitmap in ROM and if the Flash bit is on, it knows that it should flash that char. All letters on the screen flash at once, the video card keeps a count that every X video frames it should either display the char or not. A Sinclair Spectrum has 256*192/8 =6KB allocated for a 1 bit Video bitmap and another 32*24=768 bytes for colour attributes. Bit 7 of the attributes, again, is Flash. If you want to print a flashing "A", the PRINT command will render the character A in the video ram according to the font bitmap in ROM and will set bit 7 of the corresponding attribute byte. While you could be able to draw chars of any size and in any position, you are constrained to a 8x8 font and a 32x24 grid that overlaps perfectly the "attribute squares". Similar to the VGA text mode, at every X vertical refreshes, the video out logic will reverse foreground & background colours. Maximite has 3 bit-planes for the video memory: Red, Green & Blue and only 1 bit-plane for the B&W models and modes. When you PRINT an "A", Maximite will draw-it in the font and size of your liking in the video RAM, flipping the required bits in the colour planes. But, as you see, there's no way for the Maximite to know that your "A" should be flashing or not. There isn't a ASCII grid like in the VGA text mode. There are no attribute "squares". Once printed, your letter becomes an area of pixels somewhere in the middle of the screen and Maximite has no information on what needs to be done with it when it's sent down the video cable. The only way of having a Flash attribute on Maximite is by allocating a new video ram bit-plane that will hold the information for each pixel on the screen if it should be flashing or not. And this is not very practical. So you'd better make a timer interrupt and flash the message yourself. |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3269 |
Psergiu, your explanation is perfect. Geoff EDIT: You could always use a timer to call a subroutine to print the text, then erase it, then print it, then erase it, etc. It would use up some processing time but not a lot. Geoff Graham - http://geoffg.net |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9486 |
Thanks, everyone, but especially to psergiu for that excellent explination. It was just a thought - no big deal, but I might look into the function idea suggested by paceman. EDIT: Geoff beat me to the congrats for psergiu!!!! ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
paceman Guru ![]() Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
@ Psergiu: Yes, ditto with the explanation, thanks Psergiu - I certainly learnt something there. @ Grogster: My suggestion was a bit short Grogs - as Geoff said, you'll obviously need to do the erase each time too. Greg |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9486 |
Understood. I am playing with the idea, and it involves using a timer, which is used to set how fast the flash is(based on Geoff's post edit), but I acknowledge your comment that the function or sub will need to deal with showing and clearing the text. EDIT: I will incorporate things like flash-rate, text position, things to flash at all or not... A work in progress, but I will post some code soon-ish, for the forum to evaluate. As Geoff mentioned, this concept WILL gobble a little of the processing speed(if Geoff does not mind my paraphrasing him for a moment!), but it will PROBABALY be acceptable. Smoke makes things work. When the smoke gets out, it stops! |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |