~AssemblyBandit~ http://briandm82.com ImageViewer v1.5 (Library Demo) This is a demo version, not all features will remain the same when the final v1.5 app is relased. Not all features are documented currently and are subject to change. All feedback is appreciated. IViewer is a flash app for the TI84+CSE to view images on your calculator. Use the Easy Image converter program to convert an image to an app var to be read by IViewer. Use the Developer Image Converter to save images as an appvar or an asm file to be imported into your program or game. This zip file includes this text doc, TI84C Easy Image Converter, TI84C Developer Image Converter, color.8xv, DevTest.8xv, EasyTest.8xv, BEAD.8xp, and IViewer.8ck. Load the 5 files to your TI84+C and run BEAD to test out the new library or run IViewer to view the sample images. EasyTest.8xv was created with the Easy Image Converter that uses 8 bit H=L mode. The image was sent straight to the program. DevTest.8xv was created using the Developer Image Converter using 8 bit normal mode. The image was first resized and reduced to 180 colors in Photoshop. Using the Developer Image Converter and preformatting your images will give the best results. For quick and simple images run the Easy Image Converter program and load a bmp, png, jpeg, gif, or tga file then click create to create an appvar that you can send straight to your calc. Note that if the image is larger than the screen, it is resized to 320x240 pixels. Complex images might not be able to fit into an appvar, resize them using an image program such as Paint.net if necessary. For more control over the file or to save as an asm file, use the Developer Image Converter. It's best to load an image that has been formatted with a specific number of colors using indexed mode in Photoshop or posterize in Paint.net. Pngs work best because they use lossless compression. *Image depth correlates with the number of colors in the image. Anything over 256 colors should be saved as 16 bits for quality. 18 bits can be used but not recommended due to size. *High color (18 bit) mode can be used for images <= 256 colors without size being affected as much. *Using 16 bit mode, high color is disabled because it is equivalent to 18 bit mode. 18 bit mode forces high color. 16 and 18 bit modes will not use a palette. If the color count is > 256 8 bit mode will force H=L mode at a loss of color information. H=L mode does not require a palette. *Export text to save an asm file of the images data that can be directly assembled as an appvar or added to program/application code. *Export an appvar that can be viewed with the IViewer app. *Select RLE to compress data. Use none for custom programs and applications. *Setting BGR mode will not affect the image if it is displayed in IViewer, it is for custom programs and applications. *If the image is < 160x120, Double Scale will be enabled allowing you to view an image on the calc at twice the size. Double Scale will not work with 16 or 18 bit modes. *After loading an image, Image Depths with a lower required color count will be disabled. *Select High Color to enable a 3 byte transfer mode that will allow the least significant bits of red and blue to be specified. Normally they are just a copy of the most significant bits. Note that the image displayed by the program is modified to display the image as it would appear on the calc and is updated during selections. Even though the program can see the extra pixels, personally I can't see the difference between 18 and 16 bit modes. *Select H=L mode to specify a default palette. This will match the images colors to those closest when the most significant color byte equals the least significant color byte. This allows programs to read and write the GRAM faster and eliminates the need for a palette, saving up to 512 bytes. Because there are only 256 possibilities in a byte, this will only allow up to 256 colors. *Select the background color to display if an image does not take up the full screens width/height. *Transparency mode can be enabled for use with the library. If you wanted to create a splash screen for a TIBASIC program, create an image and set the transparent pixels to straight black (RGB=$000000). To have a black color displayed, use (RGB=$000400). That will set the least significant bit in green and will look pretty close to black. In H=L mode, it looks like a very dark red. Select View to view the transparent pixels as pink, be sure transparency is enabled first. Library Usage: Check out the sample program BEAD to see how it is implemented, but basically call OpenLib(IVIEWER) to load the library, then set the variables and call ExecLib. Variables: N is used to set the function. X is for location and to define RED Y is for location and to define GREEN Str1 is for the image name W is to define BLUE Functions: N=0 Initialize() Initialize should be called after opening the library. It only needs to be called once. N=1 DrawImage(X location, Y location, Str1 image name) DrawImage will draw an image created with either Image Converter on the screen at X,Y. There is no clipping currently so it has to be drawn completely on the screen. If you make a mistake and your screen messes up, just turn the calc off and back on again. N=2 FillScreen(X red, Y green, W blue) FillScreen is used to fill the screen with a specific color. It uses High Color (18 bit) mode so the values you enter will be 'and'ed wth $fc. (255 will be reduced to 252) N=3 OSDefaultScreen() OSDefaultScreen will set the screen back to normal. N=12 ClearHomeScreen() This should be called before exiting the program. N=14 WriteText(X location, Y location, Str1 text) This will write black text with a white background at the x,y location. 40 chars max per line. The screen will go crazy if a character write is attempted out of the screens bounds. Future Revisions: These are the proposed functions, the ones prefixed with a plus have been implemented and can be used. The undocumented functions haven't been extensively tested, use at your own risk. ;+N 0=Initialize() ;(X version) version define will allow backwards compatability ;+N 1=DrawImage(X x, Y y, Str1 image name) ;+N 2=FillScreen(X red, Y green, W blue) ;(, H screen) screen define will allow filling only left or right side of screen for low res. ;+N 3=OSDefaultScreen() ;+N 4=HideScreen() ;+N 5=ShowScreen() ;+N 6=LowRes() ;+N 7=HighRes() ;+N 8=LowColorMode() ;+N 9=FullColorMode() ;+N 10=InvertScreen() ;+N 11=SwitchScreen() ;+N 12=ClearHomeScreen() ;+N 13=GetVersion() ;+N 14=WriteText(X x, Y y, Str1 text) ;N X=CopyBackground(X x, Y y, W width, H height, I id) ;N X=PasteBackground(I id) ;N X=PlayMovie(Str1 movie name) The transparency value might change to allow H=L mode to have straight black. The Developer Image Converter will get an option to enable High Speed mode in an image for the library. This will allow the image to be drawn through an optimized drawing routine to increase performance. There will be no choices in how the image is saved. Right now I'm thinking 16 bit uncompressed with transparency. This will only be for sprites up to 32x32? in size. I will probably add Pucrunch for compression. An Animated Gif Converter is currently being produced. Its still in beta and is being optimized to produce small animation files. However, the final version should feature multiple resoultion/bit options and there will be a library PlayMovie function for BASIC programs to use. Animations and images will be allowed to use multiple appvars. Sorry for the slow release... Email me with any bugs, questions, comments, suggestions, feature requests, or whatever at briandm82@briandm82.com Visit briandm82.com for the latest version and other projects. v1.5-Demo Re-Released 8-21-2013 WriteText library function added Optimized library setting in Developer Image Converter added Undocumented library functions enabled v1.5-Demo Released 8-8-2013 Library functions added Easy and Developer versions of Image Converter added Bit depth selection added High Color and H=L modes added Transparency added Background color selection added v1.1-Released 7-26-13 Bug fix Free RAM requirement removed v1.0-Released 7-1-2013