Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Micro MMPaint for Maximite Color
Author | Message | ||||
Raros Regular Member Joined: 06/02/2012 Location: ItalyPosts: 55 |
Hi For fun i did this graphics program, Micro MMPaint for Maximite Color using a serial mouse. View post: http://www.thebackshed.com/forum/forum_posts.asp?TID=5499&PN =2 (Hey Geoff I'm sorry for the image is not offensive!) Is not yet complete! I should add error checking for working with the sd-card, add text at graphics, file management with visualization of the directory in combination with a menu activated with the right mouse button for operations such as info, rename, load and kill, using sprites (I already did some tests and it's great). Fill areas of the screen with a color I have no idea how to do...... However, it is usable. The menu button is fairly intuitive. Button top-left: Free design (default). Line and multi-line in mode sequentially. Boxes and boxes filled. Circle and filled circle. BLIT copy portions of the screen with preview. Mouse speed. Swap the color of the Foreground and Background. Choosing the color of the Foreground. The second set of buttons is: Clear screen with the background set. Load and Save BMP. The format MMP saves and loads portions of the screen with PEEK and POKE: Header: 4 bytes "MMP" + 1 free byte. 4 bytes X and Y coordinates initial 2-byte length (maxlenght = 480/8 * 369 lines useful = 22,140) Image: xx bytes in the following sequence: 3R-3G-3B-2R-2G-2B-1R-1G-1B-0R-0G-0B-7R-7G-7B-6R-6G... ...59R-59G-59B-58R-58G-58B-57R-57G-57B-56R-56G-56B First line of pixel RGB etc. Read from the buffer video is easy. Example: Open "file.mmp" For output As #2
................ For t = 0 To Lenght Print #2,Chr$(Peek(RVIDEO,t));Chr$(Peek(GVIDEO,t));Chr$(Peek(BVIDE O,t)); Next t Close 2 End For the time being suspended due to a small bug (PEEK) and The Big Geoff fix in the next release. View post: http://www.thebackshed.com/forum/forum_posts.asp?TID=5523&PN =2 With Load BMP can be specified with the mouse the coordinates of loading. The X and Y coordinates Finally, the 'Dialog Box' indicates the operations to be done. At any time you can abort any command by clicking anywhere on the menu. 2013-02-03_031020_Micro_MMPaint.zip (Sorry for my bad english > Google translator) Raros |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9307 |
Clever boy!!!! Well done - yet another amazing bit of software for the MM. Smoke makes things work. When the smoke gets out, it stops! |
||||
Raros Regular Member Joined: 06/02/2012 Location: ItalyPosts: 55 |
Thank Grogster. I forgot to mention that with the ESC key to exit the program! |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9307 |
BTW - how did an Italian find his way to the MM? I am just curious where you found out about it. I am also very impressed with your mouse interface - I see that being a great feature of others' MM programs in the future. Smoke makes things work. When the smoke gets out, it stops! |
||||
MOBI Guru Joined: 02/12/2012 Location: AustraliaPosts: 819 |
Can the mouse interface be used as a directional interface for games i.e joy stick? David M. |
||||
Raros Regular Member Joined: 06/02/2012 Location: ItalyPosts: 55 |
Certainly. But we must add the routines and management serial port. You have to change this basic program: ********** Maximite Mouse serial v4b by Raros *********** ' Test mouse serial 'microsoft mode' compatible ' with chip HT6513B (4PIN), MM8370 (4PIN), EC3567A1 (4PIN),.... ' Interfacing with SP3222E (RS-232 Transceiver 3v-5.5v). ' SP3222E to Maximite: ' pin12(T1in) to MMpin16 - pin13(R1out) to MMpin15 - power gnd/3.3v ' pin11(T2in) to Gnd. ' SP3222E to RS-232 Male: ' pin8(T2out) to rs232pin7 - pin14(R1in) to rs232pin2 ' pin15(T1out) to rs232pin3 and Gnd to rs232pin5 ' Maximite COM1: pin 15 and 16 ' ********************************************************* Cls Print:Print:Print Tab(20)"View (B)inary or (D)ecimal" Answer: view$ = Inkey$:If view$ = "" Then GoTo Answer view$ = UCase$(view$) If view$ = "B" Then Cls:Print Tab(30)"BINARY View":Print Rem "COMn: baud, buf, int, intlevel, FC, DE, OC" Open "COM1: 1200, 256, BINARY, 3" As #1 ElseIf view$ = "D" Then Cls:Print Tab(30)"DECIMAL View":Print Rem "COMn: baud, buf, int, intlevel, FC, DE, OC" Open "COM1: 1200, 256, DECIMAL, 3" As #1 Else GoTo Answer EndIf Do While Inkey$ = "" : Loop End BINARY: ' A$ = (LButton 32)/(RButton 16)/(NegativeY 8)/(NegativeX 2) ' B$ = MovX --xxxxxx ' C$ = MovY --xxxxxx A$ = Input$(1,#1) If (Asc(A$) And 192) <> 192 Then IReturn ' Sync: first byte is 11xxxxxx B$ = Input$(1,#1):C$ = Input$(1,#1) Print Bin$(Asc(A$)), Bin$(Asc(B$)), Bin$(Asc(C$)) IReturn DECIMAL: ' A$ = (LButton 32)/(RButton 16)/(NegativeY 8)/(NegativeX 2) ' B$ = MovX --xxxxxx ' C$ = MovY --xxxxxx A$ = Input$(1,#1) If (Asc(A$) And 192) <> 192 Then IReturn ' Sync: first byte is 11xxxxxx B$ = Input$(1,#1):C$ = Input$(1,#1) Print (Asc(A$) And 32)/32; Tab(10)(Asc(A$) And 16)/16; Print Tab(20)((Asc(B$) And 63) - (32 * (Asc(A$) And 2))); Print Tab(30)((Asc(C$) And 63) - (8 * (Asc(A$) And 8))) IReturn Raros |
||||
Raros Regular Member Joined: 06/02/2012 Location: ItalyPosts: 55 |
Or this: ' ********** Maximite Mouse serial v6c by Raros *********** ' Test mouse serial 'microsoft mode' compatible ' with chip HT6513B (4PIN), MM8370 (4PIN), EC3567A1 (4PIN),.... ' Interfacing with SP3222E (RS-232 Transceiver 3v-5.5v). ' SP3222E to Maximite: ' pin12(T1in) to MMpin16 - pin13(R1out) to MMpin15 - power gnd/3.3v ' pin11(T2in) to Gnd. ' SP3222E to RS-232 Male: ' pin8(T2out) to rs232pin7 - pin14(R1in) to rs232pin2 ' pin15(T1out) to rs232pin3 and Gnd to rs232pin5 ' Maximite COM1: pin 15 and 16 ' ********************************************************* Cls PointNum = 1: PointX = 0: PointY = 0:Color 2 Sprite Load "pointer5.spr" Sprite On PointNum,PointX,PointY Rem "COMn: baud, buf, int, intlevel, FC, DE, OC" Open "COM1: 1200, 256, Pointer, 3" As #1 Do While Inkey$ = "" : Loop Sprite Off PointNum:Color 7:Cls End Pointer: ' A$ = (LButton 32)/(RButton 16)/(NegativeY 8)/(NegativeX 2) ' B$ = MovX --xxxxxx ' C$ = MovY --xxxxxx A$ = Input$(1,#1) If (Asc(A$) And 192) <> 192 Then IReturn ' Sync: first byte is 11xxxxxx B$ = Input$(1,#1):C$ = Input$(1,#1) PointX = PointX + ((Asc(B$) And 63) - (32 * (Asc(A$) And 2))) If PointX < 0 Then PointX = 0 ElseIf PointX > 479 Then PointX = 479 EndIf PointY = PointY + ((Asc(C$) And 63) - (8 * (Asc(A$) And 8))) If PointY < 0 Then PointY = 0 ElseIf PointY > 431 Then PointY = 431 EndIf Locate 0,0:Print "Coordinates:"PointX" --"PointY" --"(Asc(A$) And 32)/32" " Sprite move PointNum, PointX, PointY ' ****** Draw ****** If (Asc(A$) And 32)/32 = 1 Then Pixel(PointX-1,PointY-1) = 6 IReturn '************ END ************************** The sprite: 2013-02-03_111820_Pointer5.zip Raros |
||||
MOBI Guru Joined: 02/12/2012 Location: AustraliaPosts: 819 |
Hmmm. I better dig through my junk boxes and look for a serial mouse. I probably have a few old ones covered in mouse poo somewhere. What else would you expect a mouse to be covered with?? David M. |
||||
paceman Guru Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
Great job Raros - I'm going to have to find an old serial mouse too - or buy one. Got to try this out! Greg |
||||
Raros Regular Member Joined: 06/02/2012 Location: ItalyPosts: 55 |
Hi Paceman Attention the mouse must be connected with a conductor to four wires. I have not tried those 5/6 wires. Probably must be connected to some other pin of coverter RS-232. I do not have these mouses. I have a mouse with chip HM8350 5-wire and it did not work: it is probably broken! |
||||
Print this page |