Bad Apple demo on SNES (alternate version)

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Stef
Posts: 259
Joined: Mon Jul 01, 2013 11:25 am

Bad Apple demo on SNES (alternate version)

Post by Stef » Tue Sep 20, 2016 1:47 pm

Hey,

Just discovered this :
http://www.smwcentral.net/?p=viewthread&t=85373&page=1

A different version from the one made by psycopathicteen but it has some interests.
It's very close in fact except that:
- it plays at 15 FPS instead of 30 FPS but it uses a not optimal LZ2 compression scheme so that explains.
- it has very good audio quality (32 Khz) using HDMA streaming successfully as far i can tell.

It may be a good solution to mix the psycopathicteen version (GFX part) and this one (sound part) to have a full working one.
I know there is still some slowdown issues to fix but i guess the audio HDMA can help for that too :)

93143
Posts: 1314
Joined: Fri Jul 04, 2014 9:31 pm

Re: Bad Apple demo on SNES (alternate version)

Post by 93143 » Tue Sep 20, 2016 4:26 pm

I remember seeing that. Extremely impressive until you realize it's 15 fps and letterboxed... still pretty good.

IIRC psycopathicteen's version uses DMA to speed up decompression, which would make it incompatible with HDMA on a 1/1/1 due to the lockup bug.

On the other hand, there were ideas being kicked around for improving it around the time the last version came out (and the thread was hijacked by NES discussion). He and tepples were discussing improvements to the video codec, and I had suggested using most of audio RAM as a giant buffer so as to allow the CPU to fill the buffer during slack time and ignore it during demanding segments. The last implemented improvement that I know of was unrolling the APU-side streaming loop, and it's not clear what, if anything, became of the rest of that discussion. Maybe he got tired of working on it...?

psycopathicteen
Posts: 2980
Joined: Wed May 19, 2010 6:12 pm

Re: Bad Apple demo on SNES (alternate version)

Post by psycopathicteen » Wed Sep 21, 2016 2:58 pm

the video streaming routine is just LZ2 decompression on-the-fly (decompression may take up to 4 frames. on frame 0 i start it, frame 2 i upload the first half [i assume it's been decompressed already], and frame 3 i upload the second half). the decompression routine is the optimized one included in LM (aka this), so i cannot take credit for it.
It sounds like it doesn't even do any decompression on the 4th frame, it just waits.

I wonder if he/she has the tiles arranged vertically or horizontally? Arranging them vertically would compress better.

Stef
Posts: 259
Joined: Mon Jul 01, 2013 11:25 am

Re: Bad Apple demo on SNES (alternate version)

Post by Stef » Thu Sep 22, 2016 1:37 am

Ah i forgot you were using DMA for decompression...
Doing 100% software decompression has a big impact on decompression performance ?
I wonder what bring the biggest advantage:
- DMA for video decompression
- HDMA for audio streaming

About the alternate version, yeah the LZ2 compression scheme is definitely not really efficient.
In fact it takes more time but it also decompression half amount of data finally so the compression ratio itself is much more worst than 30 FPS version... At least that allowed to have 32 Khz audio =)
Last edited by Stef on Thu Sep 22, 2016 8:00 am, edited 1 time in total.

User avatar
Drew Sebastino
Formerly Espozo
Posts: 3503
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: Bad Apple demo on SNES (alternate version)

Post by Drew Sebastino » Thu Sep 22, 2016 6:40 am

I'd definitely be interested in seeing a version exclusive to non 1 CPU SNES's that utilizes both. Does anyone know many 1/1/1 SNES's there are out there compared to other versions? 2/1/3 seems to be the most common (it's what I have).

tepples
Posts: 22286
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Bad Apple demo on SNES (alternate version)

Post by tepples » Thu Sep 22, 2016 6:45 am

Mine is 1/1/1.

93143
Posts: 1314
Joined: Fri Jul 04, 2014 9:31 pm

Re: Bad Apple demo on SNES (alternate version)

Post by 93143 » Thu Sep 22, 2016 10:39 am

The thing is, as far as I can tell the latest version leaves potential optimizations on the table. As long as that remains true (assuming it is), I don't think it's a good idea to sacrifice compatibility in order to achieve something that might be attainable some other way.

@psycopathicteen: Do you consider your version finished, or do you hope to do more work on it at some point?

psycopathicteen
Posts: 2980
Joined: Wed May 19, 2010 6:12 pm

Re: Bad Apple demo on SNES (alternate version)

Post by psycopathicteen » Fri Sep 23, 2016 7:53 pm

Last time Tepples was going to make a decompressor that limits the number of indexed slivers per frame, because indexed slivers took the longest.

93143
Posts: 1314
Joined: Fri Jul 04, 2014 9:31 pm

Re: Bad Apple demo on SNES (alternate version)

Post by 93143 » Mon Sep 26, 2016 11:41 am

I see. It wasn't clear to me from the thread whose court the ball was in. If that's the case, perhaps at some point after CoPH is done we might see some movement.

psycopathicteen
Posts: 2980
Joined: Wed May 19, 2010 6:12 pm

Re: Bad Apple demo on SNES (alternate version)

Post by psycopathicteen » Tue Sep 27, 2016 4:50 pm

I got it down to only 2 or 3 lag frames, by unrolling the tile decompression loop.

93143
Posts: 1314
Joined: Fri Jul 04, 2014 9:31 pm

Re: Bad Apple demo on SNES (alternate version)

Post by 93143 » Tue Sep 27, 2016 8:22 pm

...wow. That's quite an improvement.

What's the audio sample rate? Still 12 kHz?

...

Now that I re-read my last post, it kinda sounds like a passive-aggressive attempt to hurry you both up. I apologize if I sound like I have a sense of entitlement about this - really, I just wanted information.

But hey - progress is cool too...

psycopathicteen
Posts: 2980
Joined: Wed May 19, 2010 6:12 pm

Re: Bad Apple demo on SNES (alternate version)

Post by psycopathicteen » Thu Sep 29, 2016 1:06 pm

I'll speed up the sample streaming code by feeding 4 bytes at a time instead of 2. I'm also thinking of using IMA-ADPCM because it compresses slightly smaller.

93143
Posts: 1314
Joined: Fri Jul 04, 2014 9:31 pm

Re: Bad Apple demo on SNES (alternate version)

Post by 93143 » Thu Sep 29, 2016 1:31 pm

Wouldn't that stick you with filter 0 and thus 4-bit PCM? Or is the SPC700 powerful enough to decode IMA ADPCM directly to the echo buffer?

If you end up with excess streaming capacity, I suppose you could do a version bigger than 8 MB. If I recall correctly, the MD version exists in two sizes, and since there are (I think) no flash carts that can handle 8 MB but not 12 MB, hardware compatibility isn't an issue.

But I suppose your goal here is probably to reduce the data rate rather than the ROM size...

User avatar
Señor Ventura
Posts: 176
Joined: Sat Aug 20, 2016 3:58 am

Re: Bad Apple demo on SNES (alternate version)

Post by Señor Ventura » Fri Sep 30, 2016 4:20 am

93143 wrote:...wow. That's quite an improvement.

What's the audio sample rate? Still 12 kHz?
I also have that impression of that is using the older samples.

psycopathicteen
Posts: 2980
Joined: Wed May 19, 2010 6:12 pm

Re: Bad Apple demo on SNES (alternate version)

Post by psycopathicteen » Sat Oct 01, 2016 5:26 pm

I got it running at 16khz, but I didn't switch the samples yet, so the sound is speeded up.

Post Reply