gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > POGO plugin - JPEG

#66514 - pure_ev1l - Wed Jan 11, 2006 2:37 pm

I am a fairly good programmer which has had a large increase in spare time resently and have just ordered a gba cart. put them all together and I have developed a desire to fill in the blanks of POGO shell.

a good jpeg viewer is needed.... fould one that can re-encode it so its viewable, but thats s*** as the point to jpeg is size.

basicly, all I have found is alot of ppl saying its not possible, which I think is bull after looking into it myself... but I need alittle help...

A) how do you code into plugins? I bet its very simple but I just dont know the basics to the gba as I have only started learning like 4-5 days ago.

B) I have researched the jpeg format heavily (last nite) and I need a few bits of info:

best source I found (and one of the only ones) was http://www.answers.com/topic/jpeg

and to decode it says I need to do the following steps to seperate 8x8 pixel squares tell me if I'm wrong and help explain the bits I dont get if possible:

1) Entropy decoding using Huffman method:
what format is the data saved? byte by byte? after looking at another explanation it seems its in varying sized words with a stop code on end when the rest of the data is not needed so that it is variable length, is this right?

2)adding the difference of the DC coefficient back in
where is this DC coefficent saved in the file, there would need to be one for each 8x8 pixel block, so start / end I guess?

3)multiplying it by the quantization matrix
this bit got me lost. as the explanation of this bit was sparse, what exactly is quatization and where can you retreive those numbers in the jpg?

4) adding 128 to eash element
peice of piss.

5) do this to each channel (brightness, blue, red)
ok, this seems easy to understand, my only question is that it does different compession leves on different channels, any idea where this comes into play? think its the quantization part, not sure.

6)convert back to rgb (or bgr...lol...stupid gba's)
I'm not a total idiot, this shud pose no problem

ok. before you go off on one about how there isn't enough ram...blah blah blah... leave that to me, I think I can cope ;-)... going to use a index to store pointers to locations in jpeg eg line ends or what not, so the gba doesn't need to process whole jpg at once when scrolling or zooming. you may be able to visibly see it decoding, but there is obviously going to be some problem.

ANY input in appreciated as I will release the plugin when it works

#66540 - headspin - Wed Jan 11, 2006 8:16 pm

Someone has already made a plugin, and released the source...

http://www.emuboards.com/invision/index.php?showtopic=18046

You can get Burton Radon's original source from here...

http://members.iinet.net.au/~freeaxs/gbacomp/files/gba-jpeg.zip

Write your own jpeg viewer from scratch? Are you crazy! Check out the code above O_o
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game

#66542 - pure_ev1l - Wed Jan 11, 2006 8:22 pm

damn, and I was getting somewhere, why didn't someone tell me sooner!

got the headers 1/2 way decoded. but I had a fair way to go, so better now rather than a week down the line, thanx :)

I had oredy tryed it, but as I aint got a cart yet I tryed it on visual boy advance or what ever its called.

which I have been noticing that gba games and (jpg as thats why I started writting this) dont run on pogoshell emulated.

is this normal?

#66549 - tepples - Wed Jan 11, 2006 10:09 pm

pure_ev1l wrote:
which I have been noticing that gba games and (jpg as thats why I started writting this) dont run on pogoshell emulated.

To run .gba programs or plug-ins in .gba format, your emulator needs to support the Visoly bankswitching commands used by F2A cards. VisualBoyAdvance does not. To get PogoShell plug-ins to work in VBA, you'll need to convert them to .mb format plug-ins, which load entirely into RAM before running. This involves a re-linking (with gba_mb.specs) and possibly a retooling of how the decoder handles in-memory buffers (as you have less EWRAM available with a .mb program).
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#66552 - pure_ev1l - Wed Jan 11, 2006 10:23 pm

ah ok, I get it. thanx.

just 2 little questions for now before I leave this thread:

1) to write pogo plugins am I right in thinking that you check 0x0203FC00 (to 04) for the value 0xFAB0BABE and if that is correct then the compiled code has been called by pogo then if you read 0x0203FC00 - 4 it tells you the memory address of the file it wants you to process? (also how do you escape to pogo?)

2) getting a flash card this week, so you dont have to answer this, is the jpg viewer any good? does it zoom? (if it doesn't I may consider moding it, but I'll but it on the back burner as I am making a game)

this forum is really great, very helpfull, well layed out, and ... nuf said :-)

#78807 - spinal_cord - Sun Apr 09, 2006 11:10 pm

Has anyone tried to make a JPG viewer for GBAMP? it would be more useful than a bmp viewer.