(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-16-24 01:40 AM
Acmlm's Board - I3 Archive - - Posts by MathOnNapkins
Pages: 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
User Post
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-09-06 12:32 AM, in Extra tracks in Mario Kart DS! Link
I was looking at a Nintendo forum thread the other day complaining about Parasyte. It was quite hilarious. It said that he was a hacker, and would cheat to make you lose in online play and all other sorts of ridiculous accusations that I don't believe Parasyte would do... unless your were being a dick to him in the first place.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-09-06 12:45 AM, in Rydain++ Link
The sad thing is that when I saw Rydain(27) I thought this thread title exactly. I need to stop thinking like a nerd . Anyways happy B-day.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-09-06 04:23 AM, in Decompressing graphics Link
Bleh... that turned out uglier than expected. I got sort of wrapped up in this and said, hey, why not just extract all the icons that are available? So figuring out how the icon sets were split up was what I looked at next. I was also sort of wrong about how they were compressed. It's a little funkier than what I said earlier.

[update]

Anyways I'm about 90% done with a program that will do this. It's funny b/c if I don't mess with the ASL, ROL, and other crap, it still decompresses fine, but the color indices are slightly different. If you're willing to make a backup and stick with the colors the original uses, it might not be so hard to recompress or decompress this stuff.


(edited by MathOnNapkins on 01-09-06 03:34 AM)
(edited by MathOnNapkins on 01-09-06 06:30 AM)
(edited by MathOnNapkins on 01-09-06 09:22 AM)
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-09-06 08:36 AM, in This is crap. Link
Whenever I am subjected to a French bashing extravaganza, I always wait for the classic line - the line about WW1 and 2. If they invoke that, I know what's ahead is probably utter garbage and misinformation. I'm mean wtf, that was 60 fucking years ago.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-09-06 12:21 PM, in Decompressing graphics Link
Yep, about 95% now. I've gotta work out a bug in the recompression... but it decompresses just find apparently. And yes it will extract all 0xB0 (176) sprites from that region. All menu items basically.

[update] so yeah I'm done as far as I can tell. Demonstration picture:


Get the program and source at http://mypage.iu.edu/~dwaggone/secretmana.rar




(edited by MathOnNapkins on 01-09-06 12:54 PM)
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-09-06 04:48 PM, in Decompressing graphics Link
Not a big deal, really. So I take it you figured out how to work it pretty well.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-10-06 06:56 AM, in Decompressing graphics Link
ChaoJeff: Snes9x should run Sim City just fine, last I checked. Are you talking about Sim City 2000, a much later release? B/c that would make a whole lot more sense. I checked and it ran one copy of Snes2000 ("simcity2002.zip") I had just fine, but the "Simcity 2000 (U).zip" didn't seem to work. You might have just gotten a bad dump like I did. I'm running GSD version 9 release 8, based on Snes9x version 1.43.




JLukas: The compression is nothing special really. The ratio of compressed to decompressed data is always 3:4. Basically each sprite tile consists of 0x18 bytes, which can be divided into 3 byte subsections. When I look at 4bpp graphics in a hex editor, to me the most intuitive way is to view each 8 pixel line as a square. Luckily the developers at Squaresoft shared my point of view so it was fairly easy to understand what they were doing. Demonstration using random hex values:

$000000: FF 7F 0F 07 FF 7F 0F 07 FF 7F 0F 07 FF 7F 0F 07
$000010: 3F 1F 03 01 3F 1F 03 01 3F 1F 03 01 3F 1F 03 01

(For simplicity's sake, #$XX will refer to a literal value, whereas $XX will refer to a memory location with the given address.)

The first line of the image data is determined by the values at $00, $01, $10, and $11. The next line is determined by that of $02, $03, $12, and $13. If you look at the example above you can see that each line is therefore a 2 byte by 2 byte square.

Suppose we wanted the color index of the first (top left pixel). We'll take {FF 7F, 3F 1F} and examine the left most bit (MSB) of each byte. With #$FF the left most bit has value 1. With #$7F the MSB is 0, same for #$3F and #$1F. Thus the color index for the top left pixel is 1. Why? The MSB of $00 corresponds to bit zero of the color index, the MSB of $01 corresponds to bit one of the color index, the MSB of $10 ... corresponds to bit two of the color index. We can then see that the color index for the next pixel to the right would be 1 + (1 << 1) + (0 << 2) + (0 << 3) = 3. (Note: instead of using the MSB, for the second pixel we use the next bit to the right. For the third pixel you use the next bit to the right after that, and so on.)

Now what if each line always looked like this:

XX YY
ZZ 00, where the letters are arbitrary bits, but the fourth byte is always zero. This effectively reduces the size of the tile's colors to 3bpp (ranging from 0 to 7). But that leaves lots of redundant space, so why not compress the data into 3 byte chunks instead of 4 byte chunks? That's exactly what squaresoft did, but they made it a little more complicated.

They store it in a 3bpp format with color indices ranging from 0 to 6. 7 corresponds to 0 before any addition is done ( that's coming up). They made it more complicated by making some of the sprites have all their indices increase by 0, 5, or A, depending on the sprite. Why would you do this? It's easy to see - Tiles of the first type use the color 0 (transparent) and colors 1 through 6. Tiles of the next type use the color 0, and colors 5 through B, the last type uses the color 0, and colors A through F. Thus you only need one palette entry (16 colors) to handle three different kinds of sprites. Very economical, b/c you can not only save space on graphics by compressing them in the rom, you can partition a palette entry as well.

Anyways, when I did my decompression routine, I ignored the possibility that the finished product might have 5 or A added to all its indices. Why? B/c the relationship between all the color values would stay the same, and thus still be recognizeable in the tile editor. In the rom the tiles are stored in a neutral format that doesn't really know if it has 0, 5, or A added to them later, so it doesn't really matter.

I know I'm rambling quite a bit, but here's a diagram of what happens:

Sample compressed first line of a tile: FF F0 F0

First what happens is this gets written to the rectangular grid:

FF F0
F0 00

Then we go through each pixel, starting from left to right, and calculate the color index. The color indices going from left to right should be 7, 7, 7, 7, 1, 1, 1, 1

The decompression algorithm asks us to change 7's into zeroes. Anything else gets left alone. The result:

0F 00
00 00

Recompressing is simply changing sevens back into zeroes, then ignoring the fourth byte and packing it back into three byte segments. The LSR, ROL, ASL bullcrap is basically an algorithm that does that. It's probably not the cleanest way to do it. If I were writing code to handle this, I think I'd probably use TSB and TRB and what not.

The code in the .cpp source file basically does what the game does, just in C/C++ syntax.


(edited by MathOnNapkins on 01-10-06 06:24 AM)
(edited by MathOnNapkins on 01-10-06 06:39 AM)
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-10-06 07:06 AM, in Emulators with stabler Debugging for rom hacking Link
I don't really know what you're referring to as "compression". A graphics viewer would be very possible for an SNES emu/debugger, it's just that no one has really coded it into an existing emu. Though... there are utilities that will let you view them via SaveState. VSNES does this I think. All the code is traceable. While GSD isn't perfect, it is good enough to do what I need it to do most of the time. The few things I wish it had are breakpoints on VRAM and ARAM addresses, and breakpoints on a range of addresses. There's probably a few others, but the above two problems usually cause me lots of wasted time.

You might look for BSNES in the future, but it's an emu that is still in a formative stage.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-10-06 07:14 AM, in She's like heroin.. maybe. Link
People who do hard drugs tend to dissociate their "drug friends" from their normal friends, so I don't find it all unbelievable that someone could mask such a behavior for a year or more. However, as you said it does sound sketchy, and I'd have her drug tested, b/c heroin is no pissant drug like pot. It can really fuck up a person's life. You'd be doing her a favor before she has to hit rock bottom and run out of options for escaping the lifestyle.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-10-06 07:28 AM, in COTMK 1/2 - Cancelled. Link
So if I burnt your house down you'd just decide to stay homeless? I've never liked that kind of attitude. But yeah, backups can help you from getting discouraged. I get pissed if I lose a day's work, let alone a month's work or more.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-10-06 07:17 PM, in Bsnes (Snes emulators) Link
The author is byuu aka byuusama or byuusan. Try reading some of his posts on the Zsnes dev forums some time, along with those of Anomie. You will likely be left scratching your head after the first post you read. The amount of technical detail they go into in terms of timing is remarkable. If anyone could make an accurate emulator, it's this guy.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-10-06 10:37 PM, in Decompressing graphics Link
Traces are helpful, in fact that's what I did at first. But when I found that wasn't helping I just decided to look at the ram in the GSD hex editor using $18C0 as my base. It was quite easy to see what they were doing, by just repeatedly hitting the step into button.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-11-06 09:57 AM, in Bumping Prevention... Link
Originally posted by Xkeeper
1. The 'bump limit' is very different depending on the forum
2. Not all forums are subject to bumping rules
3. It would also scare away people from potentially posting useful information
4. It's easier to just hit "Close Thread"


1. So make a limit depending on the forum
2. bumplimitenabled = false?
3. anyone with useful information wouldn't be afraid to post it even with a warning. You could also have a custom warning message per forum to keep it relevant.
4. It's more staff overhead to have to close/trash a thread someone decided to bump, plus it would prevent the temporary clutter and confusion of other users having to look at a bumped thread.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-11-06 10:05 AM, in I Hate my Job Link
Fired? What were you doing that you would get fired? O_o
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-11-06 12:12 PM, in Futurama coming back ? Link
If futurama does come back I hope that the writing is better. I can watch the show but I don't usually laugh out loud b/c a lot of the humor is nerd-oriented or dry. I heard the writers were all like PhDs in math and/or science, and if that's true I wouldn't be surprised.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-12-06 01:15 PM, in A revelation I've had... Link
Okay, have fun trying . I don't really know where you go to find info about decompressing MP3 data.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-12-06 01:38 PM, in A revelation I've had... Link
I had a creeping feeling someone was going to mention that. But I couldn't remember if it was an MP3 decompressor specifically. Although he offers an mp3 on the site, I doesn't really give technical details on what goes on in the game image.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-13-06 03:39 AM, in Weird Web Ads... Link
This is from an e-mail I just got:



-Sensattional revolution in meedicine!

-E-nlarge your p-enis up to 10 cm or up to 4 inches!

-It's herbal solution what hasn't side effect, but has 100% guaranteed results!

-Don't loose your chance and but know wihtout doubts, you will be impressed with results!

Clisk h-ere: http://espinariona.info



I think I'd like a sensattional revolution in spelling and grammar. Then I may try product be impressively.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-13-06 05:32 AM, in Emulators with stabler Debugging for rom hacking Link
I told you in the other thread that it works. Simcity, the original, works. It's apparently a problem with your dump or your computer. I mean, I'm not playing through the whole game to see if some obscure thing can crash it, however, from the looks of it it appears to be running just fine in:

GSDep9r8, Snes9x Version 1.43.

Why are you acting like one unrelated thing Hyperhacker said is validating some problem you have? For reference I'm running Win98 SE, with an Athlon 3000XP, 512MB RAM, etc.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6296 days
Last view: 6296 days
Posted on 01-13-06 07:56 PM, in A revelation I've had... Link
That's not Ice Man, that's Spliff .

Unless anyone is willing to research mp3 or ogg and implement it to see if it could work, I don't see the point of us discussing this. My rule of thumb is that 1Megabyte ~= 1 Minute of Playback. The maximum cart size is 6Megabytes. Hence, you might get really high quality audio but what's the point? That also ignores the space you would need for the complex decompression code, and the code to be inserted into the SPC700, all of which would have to be stored in one or more banks of ROM.

If you care enough about doing streamed audio, talk to d4s or maybe disassemble Tales of Phantasia to see what's going on.
Pages: 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
Acmlm's Board - I3 Archive - - Posts by MathOnNapkins


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.034 seconds; used 452.88 kB (max 587.62 kB)