Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: AssemblyBandit on July 25, 2013, 09:20:44 pm

Title: IViewer
Post by: AssemblyBandit on July 25, 2013, 09:20:44 pm
I've been updating IViewer recently. v1.1 is out now after I received a bug report by a user named Sean. v1.1 also removes the ram limitation, you can run the app even if you have 0 bytes of ram available. The next version will include an Easy Converter that will allow someone to just load an image and create an appvar without having to format the image or change any settings. The image will use a default 256 color palette based off the mac os palette. Then there will be the Developer Converter that will allow all settings to be manually adjusted. This can be used for viewing sprites/backgrounds/titles and can create an assembly file to be added straight into the program. I also plan to add huffman compression and I was thinking about including an IViewer assembly program that can be called by BASIC and other assembly programs to display title screens and images for them. I don't know if it would be fast enough to be used for sprites, but I'll create some speed test videos to help judge that. The N,X, and Y variables will be used to determine image and location. Does anyone have some requests or suggestions?

*Thanks to tr1p1ea, the Easy converter will now use his convention removing the need to even have a palette at all. His palette is better than both Windows and the Mac OS. Congratulations! tr1p1ea beats Bill Gates and Steve Jobs and his name will appear in the app somewhere (probably replacing my blog address)!
Title: Re: IViewer
Post by: DJ Omnimaga on July 25, 2013, 10:27:34 pm
Good to see new updates. 256 colors seems pretty nice since it's much smaller. I also like the ASM program that can be called by BASIC, but speed-wise it would only run fast if it worked via a parser hook rather than the Asm() command, since the Asm() command search the program through the VAT before executing it, meaning that it's really slow when you are low on RAM. However for simple image display I guess this would be fine. People would just not be able to create pre-rendered rail shooter games and such stuff :P
Title: Re: IViewer
Post by: tr1p1ea on July 25, 2013, 11:11:36 pm
Well it is an APP so perhaps openlib/execlib can be used?

As for the colour idea it actually belongs to a few people, it was one of those ideas that was being thrown around in early 84C discussions. So credit to me just wouldnt be right :).
Title: Re: IViewer
Post by: AssemblyBandit on July 25, 2013, 11:14:42 pm
DJ:Thanks for the info! I know nothing about a (the?) parser hook but I'll definitely look into it. It was only yesterday that I learned I couldn't call an app in a BASIC program (at least I don't think I can). I've used hooks on the 86 before, though I never bothered on the 84.

tr1p1ea: You were the one to inform me of it, what other 'ideas' have I missed? (I got on the 84c thing a few months late :()
Title: Re: IViewer
Post by: tr1p1ea on July 25, 2013, 11:18:16 pm
The parser hook is what lots of ASM libs use on the 83+ etc since you can intercept certain tokens and do with as you wish.

The only problem is that it can be difficult for hooks to coexist.

On the 84+ and on there is OpenLib and ExecLib which can be used to call library routines in an APP from a BASIC program: http://tibasicdev.wikidot.com/execlib
Title: Re: IViewer
Post by: DJ Omnimaga on July 25, 2013, 11:23:45 pm
@Tr1p1ea Oh I guess Openlib could be used as well. Of course that's assuming it's fast enough to call, though.

@AssemblyBandit there were a few 84+CSE topics made when the calc was about to come out or had come out to discuss discoveries and ASM discussion. One was mainly about the 160x240 mode and ideas of its use and the other was just to ensure that most info is gathered together on WikiTI and that people won't start making plenty of ASM libs and routines that conflicts with each others like on older models.

160x240 discovery http://ourl.ca/18523
160x240 video http://ourl.ca/18606
84C consortium http://ourl.ca/18366
General resources (links) http://ourl.ca/18682

There is also other discussion on Cemetech.
Title: Re: IViewer
Post by: AssemblyBandit on July 25, 2013, 11:24:03 pm
tr1p1ea: that sounds like the route to take, can assembly programs call library routines as well?

DJ Omnimaga: Thanks for the links, I had found the 160x240 mode post and I had also read about 'z addressing' but I could never find the root of it and I didn't know what people were talking about. I never seen it in the data sheet, I'm guessing its something for BASIC?

*Sorry* I'm not replying fast enough and I had to change things around a little. :(
Title: Re: IViewer
Post by: DrDnar on July 25, 2013, 11:24:15 pm
As far as I know, the only documentation on how apps provide support for the ExecLib is in the USB8X source. BrandonW may or may not be able to shed some light on the issue. It may prove more informative to disassemble the relevant code in the OS yourself. (And don't forget to document your findings on the Wiki!)
Title: Re: IViewer
Post by: tr1p1ea on July 25, 2013, 11:28:32 pm
Yes ASM programs can call library routines quite easily. I have example code at home somewhere, ill see if i can find it.
Title: Re: IViewer
Post by: AssemblyBandit on July 25, 2013, 11:35:46 pm
DrDnar: Will do! I also received my oscope today, so I still want to go over the hardware stuff too. I noticed the HW2 int to be acting a little crazy at times and I want to get to the bottom of it. I will probably be video recording everything then transcribing because I tend to forget alot by the time I write it down.
Title: Re: IViewer
Post by: Sorunome on July 26, 2013, 04:27:45 am
Oh, you finally made a topic about this? :D
Now I can tell you how awesome it is: It is awesome :D
Title: Re: IViewer
Post by: AssemblyBandit on July 29, 2013, 02:57:02 am
Thanks Sorunome! I have finished the Easy and Developer versions of the Image Converter and have implemented huffman compression, selectable image depth, h=l mode, high color mode, and background color selection. Now I just have to update the app, do some bug testing, then I'll make a video. Maybe I'll be finished sometime today or tomorrow.
Title: Re: IViewer
Post by: AssemblyBandit on August 02, 2013, 02:29:27 am
Some new equates for the library hook on the ti84+c:
$4f48 = enable lib hook
$4f51 = disable lib hook
$9e61 = hook address

I'll add it to WikiTI soon.
Title: Re: IViewer
Post by: DJ Omnimaga on August 04, 2013, 01:31:40 am
tr1p1ea: that sounds like the route to take, can assembly programs call library routines as well?

DJ Omnimaga: Thanks for the links, I had found the 160x240 mode post and I had also read about 'z addressing' but I could never find the root of it and I didn't know what people were talking about. I never seen it in the data sheet, I'm guessing its something for BASIC?

*Sorry* I'm not replying fast enough and I had to change things around a little. :(
Z-address can be used in ASM too, but few people ever used it because it doesn't work in most emulators IIRC. In BASIC, people used it to create earthquake effects in 84+ games, but also can be used for scrolling. The difference on the older 84+ is that it wrapped the screen around vertically instead of horizontally.

Also if I recally correctly, tr1p1ea wanted to add a picture function in xLIB, but since it's dedicated for game use, he wanted people to save as much space as possible, so pics are 80x60 (scaled up).
Title: Re: IViewer
Post by: AssemblyBandit on August 04, 2013, 04:59:55 am
I have removed the huffman compression (a few days ago), I didn't realize that Jimmy Mardell's compressor is 64k max. Compressing an image in parts barely compresses better than RLE so I just took it out for the time being. Pucrunch has the best compression ratio but its compressor is also limited to 64k. I will come up with a better solution later. I was wondering, is xLib an actual library or does it use the parser hook? (in other words, did tr1p1ea already have the equates I found?) DJ, I'm almost finished with the latest version of IViewer. I've been adding library functions so that it can display images from TIBASIC and asm programs. I suck at BASIC programming, so I def need some feedback on it. I haven't finished it completely yet (about half way done) but here's a list of the functions I'm implementing or already have:
 :w00t:
Initialize(version)
DrawImage(x,y,image name)
DrawSprite(x,y,image name)
FillScreen(red,green,blue,screen)
CopyBackground(x,y,width,height,id)
PasteBackground(id)
WriteText(x,y,text)
HideScreen()
ShowScreen()
LowRes()
HighRes()
LowColor()
FullColor()
InvertScreen()
SwitchScreen()
OSDefaultScreen()
GetVersion()

I can't wait till I test it out, I pray it will be fast enough  XD I will release it today no matter how far I get, maybe it will be finished so I can make a video demonstrating what its capable of.
Title: Re: IViewer
Post by: tr1p1ea on August 04, 2013, 06:11:01 am
xLIB uses the parser hook, which definitely has its advantages, but also its disadvantages.

I see that you are looking at the library hook for use with openlib/execlib? This is a good idea and something that i have been thinking about as well.
Title: Re: IViewer
Post by: AssemblyBandit on August 07, 2013, 02:07:39 am
Here's a demo on the BASIC Library, I have one more bug to remove before I release a demo here. It's been a pain trying to debug this! In the video I draw an image named 'COLOR', but I have another image that is the exact same thing named 'HCOLOR'. It will not draw 'HCOLOR' for some reason. They both draw in the IViewer app but 'HCOLOR' will not work with the library  :banghead:

Title: Re: IViewer
Post by: DJ Omnimaga on August 07, 2013, 02:16:57 am
O.O

Wow that might be pretty useful actually. Do you think you might eventually implement lower color depth formats for those who want smaller files? Also can it draw anywhere on the screen?
Title: Re: IViewer
Post by: AssemblyBandit on August 07, 2013, 02:24:56 am
It draws any image that you create with the Developer Image Converter. At the minimum you can have a 1bit image (any two colors out of 262144) compressed with RLE. The AppVar would probably be next to nothing in size. It can draw an image anywhere on screen but right now there is no clipping so it has to stay somewhere on the screen. I'll make another demo video in a minute and try to make a pong game with it to demonstrate its speed.
Title: Re: IViewer
Post by: TIfanx1999 on August 07, 2013, 02:57:28 am
That's pretty nice AssemblyBandit. Also, I've never seen ExecLib used before, but it looks like it's very nice and simple. :)
Title: Re: IViewer
Post by: AssemblyBandit on August 07, 2013, 03:07:56 am
Thanks DJ Omnimaga and Art_of_camelot. Here's a video demonstrating the speed. I'm not too impressed with it  :'(

Title: Re: IViewer
Post by: TIfanx1999 on August 07, 2013, 03:16:02 am
Speed doesn't seem too bad, but I wonder how it'd be with more objects moving. I think a test with a bunch sprites simultaneously moving the same amount of pixel(like in space invaders aliens for example) would be a good test. The flickering is kind of annoying. :/ I wonder what's causing it. ???
Title: Re: IViewer
Post by: AssemblyBandit on August 07, 2013, 03:27:58 am
I'll make a better test tomorrow. The flicker comes from the slow time it takes from drawing over it with black pixels to redrawing the sprite. It will be a little faster with no flicker once I implement low res (160x240) mode.
Title: Re: IViewer
Post by: TIfanx1999 on August 07, 2013, 03:29:22 am
I see. Sounds good. :)
Title: Re: IViewer
Post by: tr1p1ea on August 07, 2013, 04:01:06 am
Impressive! The speed will come when you brainstorm optimisations etc. Its good that the functionality is there!
Title: Re: IViewer
Post by: Sorunome on August 07, 2013, 04:10:07 am
That's looking awesome :O
And /that/ is how OpenLib and ExecLib are supposed to work ^^ I never knew that as i never saw a asm lib that uses those. :)
Title: Re: Re: IViewer
Post by: DJ Omnimaga on August 07, 2013, 02:46:27 pm
Is it faster when using 1, 2, 4, 8 and 16 bits images by the way? Also the speed in your vid doesn't seem too bad for simple moving stuff around.

Also is ExecLib faster than Asm(prgmNAME) (which had to search the VAT then copy the program to a RAM area everytime)?
That's looking awesome :O
And /that/ is how OpenLib and ExecLib are supposed to work ^^ I never knew that as i never saw a asm lib that uses those. :)
yeah back then people avoided using them because on the 83+ and 83+SE there are no OpenLib/ExecLib commands, meaning their programs would have been incompatible.
Title: Re: IViewer
Post by: AssemblyBandit on August 08, 2013, 04:05:07 am
DJ: I'm going optimize the regular drawing routines and add a specific routine just for drawing library images. I can't say these images will be small but they will be fast  ;D.

Because there's already XLib and Celtic for speed and ease, I want to focus this more on higher quality images to be used with them and BASIC but also be a reasonable option to make study cards or simple games.

Thanks tr1p1ea and Sorunome!

Found that bug, here's a demo...  :w00t:

Theres another bug: If a name is one char it won't be found in the library.
Title: Re: Re: IViewer
Post by: DJ Omnimaga on August 11, 2013, 12:13:30 pm
Gonna try the demo ASAP. And yeah another game idea could be a trading card game or even a game with prerendered sceneries like Myst, Illusiat 5 or Final Fantasy VII
Title: Re: IViewer
Post by: AssemblyBandit on August 11, 2013, 02:05:02 pm
I might put out another demo but I am leaving out the 160 mode and keeping it the way it is. I added an optimized drawing routine to draw small sprites like cursors and stuff faster. I'll release the final version soon.
Title: Re: Re: IViewer
Post by: DJ Omnimaga on August 11, 2013, 06:40:49 pm
Cool to hear :). Also those who absolutely wants a 160 mode just have to use LCDTOOL then run it before using your program. :P
Title: Re: IViewer
Post by: tr1p1ea on August 12, 2013, 12:22:42 am
Wow nice work! I think that a dedicated lib for higher image quality and colour depth is a great idea (and not something that anyone else is currently doing).

The speed is still good imo, and DJ is right about 160 mode.

That being said, there is sure to be a large demand for true colour images/games on the 84C.

I know this may be ot a little, but have you put any thought into video? :D.
Title: Re: IViewer
Post by: AssemblyBandit on August 12, 2013, 12:46:46 am
tr1p1ea: The more colors, the larger the size, but with 3.5MB of Flash you can fit a lot in! As for video, I will try to get something working, just the thought kinda scares me though :( It will have to be a very low resolution with limited colors, maybe something that will convert gif animations?
Title: Re: IViewer
Post by: tr1p1ea on August 12, 2013, 12:47:46 am
Actually an animated gif function would be great! You can share meme's on calc :).
Title: Re: IViewer
Post by: AssemblyBandit on August 21, 2013, 09:02:42 pm
I'm pausing it again to finish Frogger, here's an updated version, nothing major, WriteText and an Optimized mode has been added and all previously disabled functions have been enabled. Today I got a jump on an Animated Gif Converter which will allow 'movies' to be played on the calc. I'm also optimizing it so that for simple animations high resolution videos might actually be an option :D
Title: Re: Re: Re: IViewer
Post by: DJ Omnimaga on August 22, 2013, 12:57:04 am
tr1p1ea: The more colors, the larger the size, but with 3.5MB of Flash you can fit a lot in! As for video, I will try to get something working, just the thought kinda scares me though :( It will have to be a very low resolution with limited colors, maybe something that will convert gif animations?
videos would have to be appvars running from archive for sure.
Title: Re: IViewer
Post by: DJ Omnimaga on August 30, 2013, 01:28:00 am
Featured on ticalc.org! Congrats :D http://www.ticalc.org/archives/news/articles/14/148/148375.html
Title: Re: IViewer
Post by: AssemblyBandit on August 30, 2013, 01:56:42 am
Thanks, awesome! I'm still finishing Frogger, but IViewer v1.5 should be released on 9-2-13. I've been using the Developer Converter to convert all Froggers images and I'm pretty happy with it.
Title: Re: IViewer
Post by: Sorunome on August 30, 2013, 03:56:27 am
Wha, congrats assembly! Now your prog will probably get even more recognition :P
Title: Re: IViewer
Post by: TIfanx1999 on September 01, 2013, 08:06:59 pm
Congrats on the feature! :)
Title: Re: IViewer
Post by: DJ Omnimaga on September 02, 2013, 07:08:19 pm
Oh nice. Is the Developer Converter some tool that converts to multiple formats and code or was it a community tool?
Title: Re: IViewer
Post by: AssemblyBandit on September 02, 2013, 08:57:26 pm
Thanks Sorunome, Art_of_camelot, and DJ!

The Developer Converter allows you to select how to convert the image mainly to be put into an assembly program. For instance, if you wrote a game that draws its sprites using the 3 byte transfer instead of the normal 2, you can load your sprite, select the 18 bit option, convert it, and it will export the sprites text into an asm file that you can copy or add to your program. I tried to include every possible option and theres a lot to choose from, thats why I also created the Easy Converter, so that someone who doesn't know/care how the display works can convert images for their calc. When its finished, I will make some videos on the different scenarios showing how it works. I even forget what I'm suppose to be doing sometimes and I wrote it! Unfortunately, its still not finished yet, and I don't even have a clue when its going to be done. Frogger took a little more time than expected and pushed Tunnel and IViewer back. Tunnel should be finished tonight though.

*Before I forget, the names IViewer and mViewer for the Inspire are just a coincidence, I didn't know about mViewer until after I made IViewer. I don't know what the m stands for, but I'm glad the developer used it!
Title: Re: IViewer
Post by: DJ Omnimaga on September 02, 2013, 09:57:07 pm
Well I think the names are fine, since in the TI community nowadays, most people prefix simpler use programs (text/image viewers, for instance) with a calc letter, such as nDoom (Nspire), cgDoom (FX-cg10/20), zDoom (83+), etc. Not sure where the m from mViewer comes from, tho.
Title: Re: IViewer
Post by: tr1p1ea on September 02, 2013, 10:07:37 pm
IViewer, Image Viewer ... seems pretty logical to me so its fine.

Also the conversion utility should prove very valuable for many programmers im sure.
Title: Re: IViewer
Post by: TIfanx1999 on September 03, 2013, 04:35:40 am
Multi-media Viewer Maybe? Dunno.
Title: Re: IViewer
Post by: DJ Omnimaga on September 14, 2013, 02:14:23 am
By the way, when drawing images, do the content remains on the graph screen as if the pixels were turned ON? Just wondering if Pxl-test is useable with them.

Also the routines could be handy for hybrid BASIC games, although for tilemaps it might be on the slow side.
Title: Re: IViewer
Post by: AssemblyBandit on September 14, 2013, 03:01:48 am
All drawing is done straight to the screen, to allow the OS to read it would limit the number of colors from over 200,000 to under 20 :( However I've created a ReadPixel function that will return the color of a pixel at a location. I may add a tilemap routine in the future. Here's an updated list of functions that work with the IViewer library:

N 0=Initialize(X version)
N 1=DrawImage(X x, Y y, R var[0-8], Str1-9 image name)
N 2=FillScreen(R red, X green, Y blue , T screen (0=full,1=left,2=right))
N 3=CopyBackground(X x, Y y, R id [0-4], T Size[8,16,32])
N 4=PasteBackground(X x, Y y, R id [0-4], T Size[8,16,32])
N 5=WriteText(X x, Y y, T char color, R background color, str0 text)
N 6=HideScreen()
N 7=ShowScreen()
N 8=LowRes()
N 9=HighRes()
N 10=LowColorMode()
N 11=FullColorMode()
N 12=InvertScreen()
N 13=SwitchScreen()
N 14=OSDefaultScreen()
N 15=ClearHomeScreen()
N 16=GetVersion()-returns version in Ans
N 17=ReadPixel(X x, Y y)-returns R red, X blue, Y green
N 18=ScrollScreen(X value)
N 19=VarToText(R value)-returns the variable as a text string in str0

Here's a video demonstrating the copy an paste background functions:


I've seen a couple games being developed with it and they're look pretty good. Once its complete I may start a competition to see what it can do. I really need to finish it so I can get back to making some games!
Title: Re: IViewer
Post by: Sorunome on September 14, 2013, 03:49:26 am
wha, that is awesome! Great job! :D
Title: Re: IViewer
Post by: DJ Omnimaga on October 17, 2013, 01:51:55 pm
Wow I missed this, this looks actually fast, particularly filling the screen. Tilemaps would most likely be fast enough with Iviewer.
Title: Re: IViewer
Post by: AssemblyBandit on October 17, 2013, 04:37:37 pm
Thanks, I still haven't finished it or even worked on it in a while! I'll throw up a private video of the image converter grabbing data for gif animations and modify this post.
Title: Re: IViewer
Post by: DJ Omnimaga on October 17, 2013, 04:44:32 pm
By the way, this doesn't use any parser hook, right? Can Iviewer games still be used even if DCSE is installed? With the original xLIB APP for monochrome calcs, there were many complaints because xLIB hooks screwed with Symbolic and Omnicalc.
Title: Re: IViewer
Post by: AssemblyBandit on October 17, 2013, 05:02:36 pm
This uses ExecLib and I haven't tested it with DCSE, but it should work. I *think* multiple libs can be opened and called in a program.

Here is a debug version of my unfinished Animated GIF Converter. As I click, the frame advances and the converter only saves the parts of the image that change from frame to frame to reduce the file size and increase the speed. The difference threshold is custom so lower qualities and sizes can be selected:

Title: Re: IViewer
Post by: Sorunome on October 18, 2013, 06:04:05 pm
awesome as usual! :D
Title: Re: IViewer
Post by: DJ Omnimaga on October 24, 2013, 02:18:59 am
Very nice, and glad you are implementing the WabbitEmu way of doing animated GIFs. I hate how large VirtualDub GIFs can get because it overwrites the entire GIF every frame.

Just one thing, though: If that is implemented on-calc, I assume there will be issues with GIFs suddenly speeding up then slowing down, right?
Title: Re: IViewer
Post by: AssemblyBandit on October 25, 2013, 12:40:48 am
I'm going to try to have it acknowledge the millis frame request if it can keep up. Complex/fast animations will lag behind probably. I wish I had an on calc demo but I have to rewrite most of the app to get it to work. The converter itself is almost ready though. I should be putting more work into it but I think of games faster than I can make them :(
Title: Re: IViewer
Post by: Sorunome on October 25, 2013, 09:28:29 am
[...] but I think of games faster than I can make them :(
Be happy while you still are that way, eventually you'll run out of ideas :/
Title: Re: IViewer
Post by: Streetwalrus on October 25, 2013, 09:38:50 am
Be happy while you still are that way, eventually you'll run out of ideas :/
Yeah, I know that right. D:
Title: Re: IViewer
Post by: AssemblyBandit on October 25, 2013, 04:54:22 pm
Got a few of them coming eventually...

mario,moonlander,cydia,code zombie,kill hunt,they,dragster
Title: Re: IViewer
Post by: tpt1234567890 on October 29, 2013, 05:50:58 pm
Awesome job, dude!
Title: Re: IViewer
Post by: AssemblyBandit on October 29, 2013, 06:51:01 pm
Thanks tpt1234567890!
Title: Re: IViewer
Post by: DJ Omnimaga on October 30, 2013, 04:46:30 pm
mario,moonlander,cydia,code zombie,kill hunt,they,dragster

Not DOOM? O.O

Just kidding, the ideas seems nice, although I assume that the first is a long way off, since it would be a lot of work lol.