| View previous topic :: View next topic |
| Author |
Message |
kuwanger Member

Joined: 11 Mar 2004 Posts: 278
|
Posted: Sun Sep 03, 2006 8:43 am Post subject: SMSAdvance 2.0 fork |
|
|
I'm currently working on a small fork of SMSAdvance 2.0. It's chiefly focused on adding partial compression support. I've currently got a rather preliminary version working. It still needs some work, though, in making "go multiboot" work correctly. And at some point, I need someone to test out the link transfer, as I haven't a second gameboy to try it out with.
In any case, this is just a preliminary header for when I make my first release. I just wanted to post now (instead of when I make my first release) because I should be able to release it rather soon (once I have the go multiboot working, I'll need beta testers).
Having said that, I am curious about one thing. Does anyone here know of END_OF_EXRAM is 0x7000 less than PCMWAV? It's not really that important (I don't plan on using more than 128KB of RAM for the decompression buffers). I'm just curious. _________________ Kuwanger Projects Like stag beetles in tubes |
|
| Back to top |
|
 |
GoopyMonkey Member

Joined: 19 Feb 2006 Posts: 198
|
Posted: Sun Sep 03, 2006 10:24 am Post subject: |
|
|
I'm looking forward to it. And by "partial compression support", do you mean that it will compress the roms (partially) to make the file size smaller? That would be excellent for all GBAMP SD users who can only use emulators under the file size limit (can't remember what it is).
I thought SMS roms could not be compressed.  _________________
| Titney wrote: | | portable jesus anyone? |
Picture yourself in a boat on a river, with tangerine trees and marmalade skies. |
|
| Back to top |
|
 |
kuwanger Member

Joined: 11 Mar 2004 Posts: 278
|
Posted: Sun Sep 03, 2006 11:05 am Post subject: |
|
|
By partical compression, I mean only part of a ROM (well, all of a 128KB ROM) will be compressed. This won't have an effect on what ROMs are loadable as there's not enough space to store the compressed ROM and uncompressed parts of ROM in memory. And it's not that SMS files were uncompressable. It's that it's not possible to compress them in their entirety. At best, one can compress up to N banks where N is the amount of banks that would fit in RAM. Anything more and you start having to worry about paging in banks whenever there's a request for one, and that leads to worst case thrashing to load in banks. Technically, I'm sure *some* roms wouldn't thrash much, if at all, but I'm not interested in designing a compression scheme that only works well on some ROMs. _________________ Kuwanger Projects Like stag beetles in tubes |
|
| Back to top |
|
 |
GoopyMonkey Member

Joined: 19 Feb 2006 Posts: 198
|
Posted: Sun Sep 03, 2006 11:11 am Post subject: |
|
|
So if I tried to load a 129kb rom, it would give me the normal white screen error? Or would it temporarily shrink part of it to reduce it by a kilobyte or two?
Sounds good for normal users either way. _________________
| Titney wrote: | | portable jesus anyone? |
Picture yourself in a boat on a river, with tangerine trees and marmalade skies. |
|
| Back to top |
|
 |
Titney Administrator

Joined: 05 Feb 2004 Posts: 4018 Location: Earth
|
|
| Back to top |
|
 |
Dwedit Moderator

Joined: 26 Feb 2004 Posts: 2204 Location: Chicago!
|
Posted: Mon Sep 04, 2006 3:28 am Post subject: |
|
|
Since SMS roms have no header, why would they have trailing bytes to inflate the size beyond 128k? Something tells me that if the size of that file isn't exactly 131072 bytes, something is really wrong with it. _________________ Here come the fortune cookies! Here come the fortune cookies!
They're wearing paper hats! |
|
| Back to top |
|
 |
Dwedit Moderator

Joined: 26 Feb 2004 Posts: 2204 Location: Chicago!
|
Posted: Mon Sep 04, 2006 3:30 am Post subject: |
|
|
If you combine your fork with smsadvance gbamp, you might get more space to work with, since that version was designed for minimizing memory use. It also has less features though, and needs a small fix for the changes made to the cpu in savestates.
If you just use its memory map, remove the corrected BG Tile layer and stuff, you could get lots more ram to hold rom data. _________________ Here come the fortune cookies! Here come the fortune cookies!
They're wearing paper hats! |
|
| Back to top |
|
 |
kuwanger Member

Joined: 11 Mar 2004 Posts: 278
|
Posted: Mon Sep 04, 2006 4:55 am Post subject: |
|
|
Okay, I've gotten far enough that I'm willing to make a beta release. I ended up offering two compression schemes. One uses up 128KB. The other only 16KB (it should be able to use 32KB, but I'm still working out why only 32KB works)*. There has been modifications all over the place, so this needs some extensive testing, especially involving state loading/saving and sram loading/saving. Ie, USE AT YOUR OWN RISK. And it'd be a good idea to backup saves.
Anyways, here it is.
Unofficial SMSAdvance Homepage
Be sure to read the included readme.txt in the binary distribution. Also, be aware that you'll need to d/l apack and extract it into the directory to actually use the compression. You'll also need python.
Use sms.hack.py to maximize the compression on a particular ROM or sm2.py if you'd rather not have as many pauses.
One final note is, my own testing over a large-ish number of ROMs indicates that you'll be able to achieve from a 50% compression ratio (for 128KB roms) down to a 10% compression ratio (for really big roms). Using sm2.py and you'll see compression ratios half or less of that. In any case, enjoy. And feel free to make any comments/suggestions along with any bug reports.
*Edit: This should be fixed now. So, those who have downloaded already should go and redownload smsadvance. And be sure to recompress with the new sm2.py to save a bit more space.
@Dwedit: I'd rather keep all the sram features, personally. Bank truncation does cause a pretty significant improvement on space even if there's no actual RAM to decompress into. _________________ Kuwanger Projects Like stag beetles in tubes
Last edited by kuwanger on Tue Sep 05, 2006 1:48 am; edited 1 time in total |
|
| Back to top |
|
 |
GoopyMonkey Member

Joined: 19 Feb 2006 Posts: 198
|
Posted: Mon Sep 04, 2006 12:13 pm Post subject: |
|
|
OK, I have read the readme instructions, but nothing has happened when I use the DOS command. I don't get an SMH file or reduced file size, I just get the normal results (although Wonder Boy 3 (UE) + SMSAdvance is down to 256KB). I currently have no SD card to test this with, so is there supposed to be a different file appearing or something? Or will it finally fit inside of my GBAMP SD? _________________
| Titney wrote: | | portable jesus anyone? |
Picture yourself in a boat on a river, with tangerine trees and marmalade skies. |
|
| Back to top |
|
 |
kuwanger Member

Joined: 11 Mar 2004 Posts: 278
|
Posted: Mon Sep 04, 2006 3:18 pm Post subject: |
|
|
@GoopyMonkey: Could you be more specific on what you mean/did/what happens? And as I explained, this won't change the ability to run files on the gbamp. If you want to effect that, you can look at Dwedit's version. This is primarily to allow people to shrink files so they can fit more files on their flash carts. _________________ Kuwanger Projects Like stag beetles in tubes |
|
| Back to top |
|
 |
patters Member

Joined: 09 Feb 2006 Posts: 51 Location: London
|
Posted: Mon Sep 04, 2006 5:46 pm Post subject: |
|
|
I've not noticed any problems on a quick test. It seems to work fine with SG-1000 and Game Gear roms too. I'll flash to hardware later and have a play.
If you want to compress a load of files in Windows, make a file called compress.bat with the following contents:
| Code: | @echo off
for %%i in (*.sms) do sms.hack.py "%%i" "%%~ni.smh"
for %%i in (*.gg) do sms.hack.py "%%i" "%%~ni.ggh"
for %%i in (*.sg) do sms.hack.py "%%i" "%%~ni.sgh" |
Last edited by patters on Mon Sep 04, 2006 5:51 pm; edited 1 time in total |
|
| Back to top |
|
 |
Dwedit Moderator

Joined: 26 Feb 2004 Posts: 2204 Location: Chicago!
|
Posted: Mon Sep 04, 2006 5:50 pm Post subject: |
|
|
One more change that could be made would be to make the emulator run from ROM instead of ewram, but it would lose all multiboot support, but would get more space in ram. _________________ Here come the fortune cookies! Here come the fortune cookies!
They're wearing paper hats! |
|
| Back to top |
|
 |
patters Member

Joined: 09 Feb 2006 Posts: 51 Location: London
|
Posted: Tue Sep 05, 2006 9:21 pm Post subject: |
|
|
| I've noticed that Mickey Mouse crashes on game start in this version when it tries to draw the Mickey sprite. The graphics start overflowing and the rom resets. I compressed it using the smh compression. |
|
| Back to top |
|
 |
Dwedit Moderator

Joined: 26 Feb 2004 Posts: 2204 Location: Chicago!
|
Posted: Tue Sep 05, 2006 10:56 pm Post subject: |
|
|
Some games need certain pages to be contiguous. If the first rom page is distant from the rest, some games will crash eventualy, like Sonic 1 in the jungle zone. _________________ Here come the fortune cookies! Here come the fortune cookies!
They're wearing paper hats! |
|
| Back to top |
|
 |
kuwanger Member

Joined: 11 Mar 2004 Posts: 278
|
Posted: Tue Sep 05, 2006 11:31 pm Post subject: |
|
|
Sounds like I've got a work left to do, then. :/ _________________ Kuwanger Projects Like stag beetles in tubes |
|
| Back to top |
|
 |
|