************************************************************************* * * * ** ** **** ***** * * * * * * * * * * * * * * ** *** * * * * * * * * * * * **** ***** * * * * MGE - My Grob Editor - v 1.0 * * (c) September 1996 * * * * I¤igo Serna Robledo Telephone: 34 - 7 - (9)4 - 430.40.28 * * Avda. de los Chopos 41, 2C E-mail: imaseroi@s835cc.bi.ehu.es * * 48.990 - GETXO ( BIZKAIA ) * * BASQUE COUNTRY * * SPAIN * * * ************************************************************************* CONTENTS ======== 0. Overview 1. Disclaimer 2. Various 2.1 Ackowledgements 2.2 Installing & Deleting the Library 3. MGE 3.1 Genesis 3.2 Use of Program a. Required Arguments b. The Program 3.3 Some Comments 3.4 Source 3.5 History and Possible New Improvements 4. Known Bugs and Compatibility 5. The Author 0. OVERVIEW =========== Well, this is a program named MGE ( My Grob Editor ), in its version 1.0. It is a 131x64 GROB Editor for HP 48 G(X) calculators ( SX users? Keep on readin' ... ). In some way, MGE is similar to GRAPHEDIT ( August 1993, Randy Ding ), HPPAINT ( December 1994, Francois Darras ), or the calculator internal one, but - I hope - more complete. 1. DISCLAIMER ============= There is no warranty of any kind, so use this program at your own risk. Nevertheless, I've not had any problem with my calculator. Please, refer to Compatibility section in this document. One more thing, this program is free, you can't sell it, but if you do that, you must pay me the 200% of the money you get (!). 2. VARIOUS ========== 2.1 Acknowledgements -------------------- I must thank to some people for their titanic work in HP 48 world, and other people for his sympathy and helps in newsgroups or in IRC #hp48 channel: Mika Heiskanen, Sebastien Carlier, Mozzgy, Alonzo Gariepy (*), Jean-Francois Morreeuw (dbv), Stephen Jannin, Alberto Martin, Krik, ugh, Xavier Courant (Atlas) ... and, as I surely forget someone, to everybody who make programs for HP48 too ... * By the way, do you know that Alonzo is in Bilbao ( my town ) now- days? :))))))))))))))))))))))))) I also have to salute Randy Ding and Robert Tiismus, from who I've taken some code to complete MGE. - From Randy Ding's GRAPHEDIT, I've taken the Fill routines and most of patterns. The ShowBox routine is hims too. - From Robert Tiismus' GROBFLIP pack, I've taken VFlip and DFlip, the routines to mirror and rotate images. Though I have yet not ask them for permission for including above routines in this program, I hope they don't matter ... I thought in coding the routines myself, but why not to use these, if these routines are good and quick enough? Moreover cause HP48 software isn't mainly commercial, and - at least as I think in HP 48 world - these programs are to be used freely by people ( you know, gnu philosophy ). 2.2 Installing & Deleting the Library ------------------------------------- Here, I just have to say one thing: "if you don't know how to transfer and install a library into your calculator, I don't understand what are you doing now ... go quickly and read the manual first !!!!!!!" 3. MGE ====== 3.1 Genesis ----------- Since some time ago, I was thinking in coding a new Grob Editor because existing ones lack of some utilities I thought very useful, such as text capabilities, move to position, filling ... This September 1996, once I finished my exams ( well, the truth is that BEFORE, ... so my results in exams have been very bad :( I gathered all my power and soul and started to code this program, taking GRAPHEDIT and HPPAINT as models, and extracting from them some useful ideas. After two weeks of hard work, only nourished by wine and chocolate, MGE arose. MGE - acronymous for 'My Grob Editor' - stayed in front of my eyes, with his weak nibbles, saying 'aita, aita' ( Basque word for 'father' :). A few more days were needed to fix one or two bugs (btw, knows anyone the 'exact' differences between makerom and usrlib libra- ries? ;-), but once all diseases were gone by, here I have the oppor- tunity to show you ..... MMMMMMM GGGGGGG EEEEEEE !!!!!!!!!!!!!!!!!!!! ( Yes, yes, I also think I need a few days of rest ;-) 3.2 Use of Program ------------------ a. REQUIRED ARGUMENTS MGE admits several ways to start the program: 1 - nothing in stack a. MGE checks if exists a valid grob in PICT (GBUFF), using it. If it doesn't exist a blank 131x64 grob is created and used and then 1b b. A blank subgrob is created 2 - 1 argument in stack a. If not a grob => 1 b. If grob 131x64 => use it, blank subgrob created c. If grob < 131x64 => use it as subgrob, then 1a 3 - 2 or more arguments in stack a. If not a grob => 1 b. If grob < 131x64 => 2c c. If grob 131x64 => use it as grob, and looks 2nd level in stack i. If not grob => like 1b ii. If grob > 131x64 => like 1b iii. If grob <= 131x64 => use it as subgrob b. PROGRAM In starting program, you can see the MAIN MENU and the 57 first lines of the grob you are editing ( or a blank grob ). You can also see the cursor, with a '+' form ( inverted the pixels of it which are over a 'solid' portion of the edited grob ). In this main screen you can use the next keys: . Move Cursor ------------- VAR CursUP NXT CursLEFT CursDOWN CursRIGHT SQRT(x) 1/x e.g. VAR moves cursor UP and LEFT at the same time, etc. If DOT+ is active, then the cursor will draw pixels with its movement. DOT- same, but erase pixels instead. If any of these keys is pressed at same time than RIGHTSHIFT, then the cursor will move to the edge limit of the indicated direction. . Step Size ----------- You can control the Step Size of cursor movement with the '0' .. '9' keys ('0' = 10 pixels). Hence, if you move cursor with DOT+ or DOT- actived, you'll draw or erase pixels with the selected step. . Toggles Modes --------------- +/- : toggle cursor on / off EEX : toggle main menu on / off . Menu Keys ----------- A: toggle DOT+ mode. If it is active, when moving cursor, the pixel under cursor is drawed. B: idem for DOT-, but erasing pixels. C: ->(x,y). This is used to displace cursor to a desired position. It admits entrances like the next ones: 1) '23.4[SPC]7' => move cursor to absolute (x,y) coords 2) '@-10[SPC]-6' => move cursor relatively (-10,-6) respect current cursor position 3) '24[angle=RS+SPC]45' => take entrance as polar coords, 24 as radius and 45 as angle move cursor to absolute coords 4) '@-24[angle=RS+SPC]-45' => similar, but relative coords. Be in mind next: - the origin (0,0) is the upper-left corner of grob, - the end is (130,63) - coords must be in decimal, and corresponds to pixels - / corresponds to angle > 0 and \ for angles < 0 - if limits are exceeded => 0 or 130 (x) / 63 (y) - negatives coords are admitted - if no valid coords are introduced, then MGE notifies you - in polar coords, angle must be in degrees D: Undo. Note that this work for drawing forms, subgrob, fill ... but not for cursor movements with DOT+ or DOT- ... E: Info Screen. In this screen you can see a little author note, cursor position (x,y), mark position (mx,my), cursor stepsize, selected fill pattern grob, a subgrob fragment, and infor- mation about date, time and free avalaible memory. The Info Screen remains visible only while you mantain 'E' key pressed. A NOTE ABOUT MEM: the showed memory isn't exact, it's just an aproximation. This is due to I've had not to use a Garbage Collector, 'cos it would slow considerably the display of this information when MGE be run on a port > 2 :( F: Menu. This key drives you to another menus ... but I'll mention this after. . Other Keys ------------ ENTER : xor the pixel under the cursor position ( if on => off, if off => on). * : Set MARK at cursor position. SPC : Show a box between MARK and CURSOR positions, but only while SPC key is still pressed. + : Turns display off. ON to turns on. ' : The grob area between MARK and CURSOR is selected as subgrob. You can make some things with it ... In fact, this is a hot key for SUB. STO: Paste subgrob in grob at CURSOR position. In fact, this is a hot key for REPL. <= (DROP) : Exit program. MGE leaves 2 objects in stack 2: subgrob 1: grob MGE also copies grob in PICT when exits. MENU ('F' key in Main Menu) =========================== When 'F' key is pressed in main screen ( visible menu or not ), you access to other submenus. The new SubMenus are displayed thought menu was not active. The Cursor and Mark positions are also showed. To select one of them, just press the corresponding menu key. If a no valid key is pressed MGE returns to main screen and menu. These are the avalaible submenus and their contents: FILE: Clear: Clear grob. You can use Undo to recover it. Invert: Invert grob ( xor the whole grob ) You can use Undo to recover it. Load: Load a Grob131x64. The choosing grob process is done by G(X) 'choose', so this can crash if executed on a SX. Nevertheless this is the only reason I know that make MGE not to work on a S(X). You can use Undo to recover previous grob. Save: Save the grob in current directory. You have to specify the grob name. Note that you can write a filename like 'sd#[1/x][SQRT(x)]...' and maybe you wont' be able to purge it using PURGE command !! Quit: ??? ( I've forgotten it ... ) As occurs with <= key (DROP), you'll get 2 objects in stack ( subgrob and grob), and grob will be copied to PICT too. BLOCK1: Sub: Select grob area between cursor and mark positions ( or vice versa ) as subgrob. There is a hot key (') avalaible. Repl: Paste subgrob in grob at cursor position. Hot key is STO. You can use Undo to undo action ( curiously, ehhh? ) VFlip: Vertical mirror of subgrob. DFlip: Diagonal mirror of subgrob. This last two routines are coded by Robert Tiismus. Info: Show some useful info about subgrob: mx, my, subgrob heigth and width, and a image of subgrob. BLOCK2: Zero: Clear the grob area indicated between cursor and mark. You can use Undo ... Neg: Invert the grob area between cursor and mark. You can use ... Gor: Put subgrob in grob at cursor position, OR-ing subgrob and grob pixels. You can ... ( I'm tired !!!!!!!!!!!! ) Gxor: Idem but XOR-ing pixels. You ... And: Idem but AND-ing pixels. ... DRAW: Text: Paste a text in the grob at cursor position. First you have to write the text, and then you will be asked for the size 1, 2 or 3 ( 1 is biggest ... ) It uses calc internal fonts. Do you know you can use Undo to ...?????? Line: Draw a line between mark and cursor positions. You ... Box: Draw a box between mark and cursor positions. You ... Circle: Draw a circle with mark as center and the distance between mark and cursor as radius. You ... Arc: Same as circle but arc. It draws arcs counterclockwise. You have to introduce end angle, which must be in degrees. Relative coords are ok. (e.g. @210). -30 = 330 You can use Undo ... FILL: Fill: Fill area at cursor position using selected pattern. This code belongs to Randy Ding. You can use .. Pattern: Fill area after selecting a pattern. Keys: cursor to move, ENTER and F to select and ON and E to cancel. You can do what you want ... User Pattern: Select the 10x10 upper-left pixel area of grob as user pattern, but don't fill (use Fill). 3.3 Some Comments ----------------- * The ID number of MGE 1.0 library is 974, its size is 12416.5 bytes, and its CRC cheksum #956Eh. * The total size is divided in the next way: 30% ML ( main draw routine, fill, mirror, and others ) 20% grobs ( info screen, patterns, menus ) 50% SysRPL ( init data and, mainly, menu handling ) * As I've mentioned above, you can save grobs with so 'rare' names that you can't purge them after using PURGE command. Be careful with this!!! * The free memory avalaible in Info is not exact due to I've had to avoid the use of a Garbage Collector because it slows the Info display if MGE run under port > 2. * Perhaphs the only thing that makes MGE incompatible for SX is the 'choose' GX command used in Load ... * I haven't coded all program in ML due to several reasons: program size, speed and easiness of programming ... At last I've decided to program the kernel of MGE ( see 'draw.s' file in source ), and other simpler things, in ML, but I've programmed the menu environment and menu key handler in SysRPL for programming-speed reasons, and also due to these last things aren't speed-dependant. It will be an unreasonable thing coding them in ML. * The LINE, BOX, CIRCLE and ARC drawing used methods are those of internal ROM. Line and Box ones are quite quick, but not Circle and Arc's. Also maybe anyone of you has noticed that these routines only works on PICT grob, so this is the reason for which you can see a 'screen-change' when MGE is drawing them (same for Fill). I've decided to use internal routines instead of writing new ML routines for two main reasons: time and size. Size because I don't want this program be very big ( no more than 15 kbs ), and time 'cos I want to release this first version of MGE as far as I can. But, who knows, maybe in next version ... * A trick: if you DFlip and then VFlip a subgrob, you'll rotate it 90 degrees ( read GROBFLIP document, there is more combi- nations ... ) 3.4 Source ---------- As I like to do, I've included the commented source with this mge10.zip pack ( the mge10.s file ). Source can be directly compiled using JAZZ ( I've used version 6.3 of this superb compiler. Thanx one more time, Mika ). It generates a library. 3.5 History and Possible New Improvements ----------------------------------------- HISTORY Ver 1.0 At this moment this is the only released ( and programmed!!! ) version of MGE. It was coded during the last two weeks of September 1996. But the public release had to last till second week of October. ( I'm writting this doc the October 4th ). POSSIBLE NEW IMPROVEMENTS If I have time and wishes, perhaphs I make some improvements and addings to MGE 1.0. These are some: . ML replacements of Line, Box, Circle, and Arc. . New capabilities for drawing Ellipses and Splines. . Fix the 'save-problem' above mentioned. . Rewrite Load to work on S(X)'s. . Introduce the capability to admit an external font. ( I've heard that Mika and some others have assumed an agreement to manage this ... but my connection with internet - the Unix computer of my university - is broken, so I'll have to wait to know more about this !!! :(((( . Capability to draw/erase lines, circles ... according to Dot+/Dot- flags and, even, add a toggle-pixel flag. 4. KNOWN BUGS AND COMPATIBILITY =============================== Well, I think I've mentioned all before, but ... BUGS ---- The only thing I find that can be named as 'bug' is the 'save- problem' which I've commented before. If you find some, tell me, please. COMPATIBILITY ------------- MGE 1.0 works perfectly in my GX rev. P in any port (0..33) and with card merged or no, with card ... I haven't tested it, but I think the only reason what made MGE 1.0 incompatible with SX is the 'Load'. So, I think, you can run MGE in a SX without problems always you don't use 'Load' ... ... but remenber that I am not responsible if this isn't true ... 5. The Author ============= Well, if you have any comments to do, or find a bug, or have some any ideas for improvements, or have a lot of money and you want to share it, or ... You can contact with me at: Mail: I¤igo Serna Robledo Avda. de los Chopos 41, 2C 48990. Getxo - BIZKAIA - BASQUE COUNTRY SPAIN Telephone: 34 - 7 - (9)4 - 430 40 28 Email: imaseroi@s835cc.bi.ehu.es NOTE: The above email address is inaccesible now ( As I've mentioned before, the 's835cc' computer is broken since August till ??? ) At the ends of October I supposse I'll have an ok email, but I don't know if it will be in a machine with the same address. Meanwhile you can contact with me at the next friend addresses: 'zigor@bipv02.bi.ehu.es' or 'albertom@bipv02.bi.ehu.es' Comment that emails are for me in 'subject', please. IRC: Generally, I use to appear in IRC #hp48 channel too, with the nicks 'imaseroi', 'inigo', 'imaseroi2', ... but till 'my' computer be running again ... WELL, NOTHING MORE, THAT I'M TIRED OF WRITING THIS DOCUMENT, GREETINGS: I¤igo Serna Fri 04.10.1996 23:05:57