Live data from Hacker News

Modder re-creates Game Boy Advance games using the audio from crash sounds

arstechnica.com

81–89 of 89 posts

Re: Modder re-creates Game Boy Advance games using the audio from crash sounds

#81
post #80

Earlier quoted context omitted.

the sounds aren’t read directly from the rom - the buffer is in a fixed place in ram, and sounds from the rom get copied into there remember that it’s not like the music is just there as raw audio, the raw audio is just the sounds of the different instruments

That makes more sense, I thought they would just be pointers to ROM addresses for the samples.

No, they're read directly from the ROM.

Here's what's going on:

- reading from ROM is slow, relative to working RAM; the ROM is mapped to the same memory address space as the RAM, but reading a ROM address takes (I think 8?) clock ticks.

- so to do audio playback, the GBA "stripes" a chunk of data into RAM, sets a pointer to the beginning of that stripe, and then lets the audio chip pull data and update that pointer. When the pointer reaches the end of the stripe, an interrupt triggers that is supposed to pull in the next chunk of audio into the stripe (overwriting the current stripe contents) and reset the pointer.

... but if interrupts are disabled, then that doesn't happen, and the simpler logic in the audio chip just keeps incrementing the pointer forever and reading more data. It'll eventually get to the ROM addresses and pull directly from those (it's slow, but fast enough that it doesn't starve the chip; you just wouldn't run your audio this way in the game normally because you'd have 1/8th the amount of time to do everything else every frame of animation if the audio system were reading directly from ROM all the time. Also, reading from RAM lets you edit the samples to do audio effects).

Re: Modder re-creates Game Boy Advance games using the audio from crash sounds

#82
I've always found Nintendo's audio architectures to be fascinating.

The original NES had a sample generator that could do arbitrary waveforms and could be driven in two modes: one mode is you gave it a memory address and it'd start reading the bits in and treat them as an incredibly simple waveform (1 means 'go up one value', 0 means 'go down one value'... So to do a flat wave you'd do a run of 10101010etc.).

But you could also direct-drive the chip by continuously feeding it an "initial value" directly from the CPU, which was actually faster than the audio driver would read the bits from RAM itself... Problem is that doing so ate up all your CPU cycles, so you could only do it if you weren't doing anything else.

There were some games that took advantage of that: Battletoads had higher-fidelity drum-hits that they could play when action was paused, and they used it for the title screen, the extra-"crunchy" final hits on enemies (where all the action paused for a moment for dramatic effect), and the memorable pause music.

Here's a demo of the game switching between direct-drive and let-chip-read-samples mode to demonstrate (credit to Retro Game Audio for uploading the emulator-doctored video to show when the game is in the direct-drive subroutine). https://www.youtube.com/watch?v=JGT0FM3yh-w

Re: Modder re-creates Game Boy Advance games using the audio from crash sounds

#85
post #77
post #53

Earlier quoted context omitted.

The GBA does have an interrupt that occurs when cartridge is removed.

WOW how did I never know about this? https://gbadev.net/gbadoc/interrupts.html > It is possible to switch cartridges and have the routine resume execution on a completely different ROM. That would have been a heck of a game mechanic back in the early 2000s! Maybe I never saw it because game developers were tired of the “please insert disk 2” of the Playstation era. But it feels like a gimmick a Metal Gear Solid game…

The Game Boy Player will error out any time a cartridge is removed, and refuse to proceed.

Re: Modder re-creates Game Boy Advance games using the audio from crash sounds

#86

It’s stories like these that remind me I’m stupid and have a lot still to learn. My goodness this is amazing. Up there with audio key logging and things I read about but could never dream would be a real thing. I tip my hat sir. Reminded that I’m a mere mortal in the presence of greatness. The absurdity of recreating a game based on audio crashes sounds like something a mental patient would say but no, here we are in…

You’re not stupid because you don’t know how to reverse engineer a GBA game, unless you work for Nintendo and it’s part of your job description.

Stupid in the sense of dazed and unable to think clearly not lack of intelligence. Like, stunned stupid. You can have moments of stupidity and still be vastly intelligent. No one will call you stupid. Calling someone stupid is the first definition. I’m not a fan of that one. Claiming stupid on self is valid. When my girlfriend says “oh I’m stupid”, it’s not a remark about intelligence - it’s about clarity.

Re: Modder re-creates Game Boy Advance games using the audio from crash sounds

#87

Earlier quoted context omitted.

You’re not stupid because you don’t know how to reverse engineer a GBA game, unless you work for Nintendo and it’s part of your job description.

Stupid in the sense of dazed and unable to think clearly not lack of intelligence . Like, stunned stupid. You can have moments of stupidity and still be vastly intelligent. No one will call you stupid. Calling someone stupid is the first definition. I’m not a fan of that one. Claiming stupid on self is valid. When my girlfriend says “oh I’m stupid”, it’s not a remark about intelligence - it’s about clarity.

That makes a lot of sense, I appreciate the follow up.

Re: Modder re-creates Game Boy Advance games using the audio from crash sounds

#88
post #70
post #65

Earlier quoted context omitted.

The PCIe standards kept moving to longer codes, and nowadays they're able to do "1b/1b" (no header at all)

Not really accurate. The switch from NRZ to PAM4 actually massively increased the bit error rate. They switched away from the 8b/10b style line code and replaced it with forwards error correction. PCIe 6.0 uses 256 Byte frames, with 242 Bytes of data, 8 Bytes or CRC and 3 Bytes of error correction. So it actually has way more overhead than the older versions and their 128b/130b line coding, It's just at a slightly di…

Thanks! Did not know they added FEC, that makes more sense :)

Re: Modder re-creates Game Boy Advance games using the audio from crash sounds

#89
post #71

Earlier quoted context omitted.

This is probably irrelevant. The audio is analog (requires DAC to decode into bitstream) and is transmitted with some fixed frequency (44.1kHz or 48kHz), without any particular synchronization.

Nope. If you're trying to recover bits from a signal which is either high or low, and the signal stays high for a long time, unless your clocks are perfect (they won't be) you won't be able to tell just how many bits were in that long period of "high"s.

You're generally right, but I wasn't talking about the length of signals.

I was talking about if long period of "high" can be distinguished from long period of "low"--DC offsets.

Post reply on HN