Previous Page | Next Page

2sfcruft by unknownfile at 2:53 PM EST on February 26, 2007
Ah yes, time to revise this crap for the last time, now shall we?

Version byte 0x45

Reserved section specification:
The reserved section will be gzip compressed.

A "mini" savestate is a sparsed file, which is created using saveclean (to be released). It will compare two savestates against each other, and the data found to be the same will be changed into null data. This data is then gzip compressed.

When the 2sflib is loaded, it will load the ROM as per usual, and will pause once the ARM9 and ARM7 EXE's are loaded. The savestate in the LIB is then loaded into memory but is not loaded. The loaded data is then patched with the sparse data. Bytes found to be zero will be skipped.

After this is done, boom, we have EMULATION!!@!@@1904712u0hfiaw

As for a player, I'll start with Desmume 2sf and will move outwards into Winamp from there.

Oh, by the way, RAM tracing is going to be removed from Desmume 2sf in the next build, since the tracer does not read data in the executables. So there!

Another feature I'm thinking of implementing is something similar to SPC dumping. When a command is initiated, the emulator quickly checks through RAM space, and initiates a breakpoint at what it suspects to be SND_StartSeq. When the breakpoint is hit, GX_VBlankIntr will be patched into an infinite loop, and a savestate will be made. So that will try and take the learning curve for ripping off of this, eh?
by unknownfile at 12:25 PM EST on February 27, 2007
Last-second revision! Omfg!

Gzip compression must be retained to individual files (for gzread()/gzwrite()/gzopen()), so I will instead have savestates be zlib-compressed.

4 bytes: char identifier = { 'S', 'A', 'V', 'E', }
4 bytes: u32 savestate_compsize
4 bytes: u32 savestate_crc32

I hate having to revise this over and over but I need an efficient way to go about doing things.

And I am considering SR64 for savestates to avoid wasting time with reading 20.3 MB of null bytes.

And here's a mockup logo:




edited 12:33 PM EST February 27, 2007
by unknownfile at 5:29 PM EST on February 28, 2007
Here's some code to zlib-compress a savestate.

    fread(uncompbuf,1,0x15F91FE,savestate);
    savesize=sizeof(uncompbuf);
    printf("compressing savestate\n");
    if(compress2(reserved,&savesize,uncompbuf,savesize,9) !=Z_OK){
        printf("zlib compress failed!\n");
        return 1;
    } else {
        fwrite(reserved,1,savesize,tsffile);
        printf("compressed savestate, attempting to compress ROM\n");
        return 0;
    }
mk2sf completed! by unknownfile at 4:18 PM EST on March 2, 2007
You can snag mk2sf now! Now you can make your own 2sfs, whoopee!

Note that this version requires you to have a savestate, but I am not sure when I will have a stateless version ready. As of now the format requires a savestate to be loaded to save time with booting.

http://unknown.hcs64.com/2sf/mk2sf.cpp

Compile with whatever you like. Requires the zlib libraries to compile.
because I was in the shower when this came up by unknownfile at 9:29 PM EST on March 4, 2007
(21:02:00) SpaceDrake: Really good job on getting DS music emulation working, but something that made me boggle a bit: does the DS really use both processors at once for music processing?

Usually, the ARM9 processor will instruct the ARM7 processor to run the sequencer. Communication between the two processors, y'know...

Anyways, expect Desmume 2sf to support actual rips sometime in the future, though it is bound to be very buggy and stupid, knowing how good I am at C...
by unknownfile at 11:35 AM EST on March 5, 2007
Well, I've got a couple of school projects throughout March Break:

- English essay (still incomplete)
- History essay (3 pages minimum)
- Flash presentation (30-60 seconds)

I will do most of the work on that this week, and a bit on the weekend, providing that I decide not to be lazy.

However, I will be implementing 2sf support sometime throughout this week and March Break.
sidetracking a bit... by unknownfile at 9:46 PM EST on March 8, 2007
Meteos opening theme
by unknownfile at 2:57 PM EDT on March 11, 2007
Worked on a ROM cleaner. It worked well, although it probably corrupts the filesystem table when comparing...

Anyways, I managed to compress Kirby Canvas Curse's ROM from 64 MB to 800 kb. The savestates contain all of the sequence data that has already been loaded. On average, that data is 50 KB (with samples and all).
by unknownfile at 2:57 PM EDT on March 12, 2007
2sf.c is making progress, however, zlib uncompression isn't working very well. The code I am passing the command is

uncompress(&uncompressedcode,sizeof(uncompressedcode),code,codesize)

Thankfully zlib has good ways of going about safe error handling so this thing didn't blow up and die.

EDIT: 2sf.c on pastebin: blah

edited 6:31 PM EDT March 12, 2007
by unknownfile at 8:40 PM EDT on March 13, 2007
You can nab the source to DesMuMe 2sf nyah.

No, decompression and playback isn't implemented yet, it's just up here so you can see what's going on.

Previous Page | Next Page
Go to Page 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=http://www.google.com]Link[/url]

[img=https://www.hcs64.com/images/mm1.png]
Password
Subject
Message

HCS Forum Index
Halley's Comet Software
forum source