Live data from Hacker News

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

arstechnica.com

71–80 of 89 posts

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

#71

The issue with long runs of 0x00 is related to "clock recovery". > Some digital data streams, especially high-speed serial data streams (such as the raw stream of data from the magnetic head of a disk drive and serial communication networks such as Ethernet) are sent without an accompanying clock signal. The receiver generates a clock from an approximate frequency reference, and then phase-aligns the clock to the tra…

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.

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

#72
post #68

The most impressive part of all this is, IMHO, how the code was modified by the bootleggers to run the game off writable flash vs ROM plus volatile save memory haha.

This is a very common technique on bootleg Game Boy and Game Boy Advance games which bootleggers use to save a few cents on batteries. And in truth, it's not too difficult to make such a patch.

Bootleggers will write per-game patches which flush the save contents to writeable flash depending on a small amount of reverse engineering work to discover where in the code the game saves. However, since all official GBA games always save data using functions from the Nintendo SDK, it's fairly straightforward to hook those functions and make a generic patch for any GBA game to save on a batteryless bootleg cartridge.

I have written a patcher to do this which you can find here. https://github.com/metroid-maniac/gba-auto-batteryless-patch...

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

#73
post #71

The issue with long runs of 0x00 is related to "clock recovery". > Some digital data streams, especially high-speed serial data streams (such as the raw stream of data from the magnetic head of a disk drive and serial communication networks such as Ethernet) are sent without an accompanying clock signal. The receiver generates a clock from an approximate frequency reference, and then phase-aligns the clock to the tra…

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.

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

#74
post #20

This is insanely impressive. I'm sure many of the techniques used like the "majority vote" algorithm cited are underutilized across many industries.

If one is interested there is nearly 100 years now of sophisticated noisy signal recovery techniques. Magnetic storage media operates on the principal of this hack at baseline! https://en.wikipedia.org/wiki/Partial-response_maximum-likel... The same idea can apply here as GBA ROM material would be highly biased. Majority vote wastes a lot of information.

The problem with this signal is that it was never designed to be recovered in the first place (it only came about by chance), that's why it has the issue with long sequences of 0 bytes described in the article.

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

#75
post #56

Earlier quoted context omitted.

Given the ‘super compute in your pocket’ thing we say… super computers turned out to be terrible at playing music files without stopping. My iPhone will regularly forgot what I was listening to moments ago after I press pause. Insane.

Yeah this is so annoying! It especially seems to happen with 3rd party music player apps.

I thought everyone enjoyed being forced to watch an Apple Music advert when they just want to play a song stored on device!

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

#76
post #66

Earlier quoted context omitted.

They do a similar thing for GPS data recovery. It is so far below the noise floor that normally speaking the signal is not recoverable. But then you inject some (known) noise and suddenly the noise modulated by the (unknown) signal starts to drown out the noise in the rest of the system and that in turn allows you to recover bits from the signal.

https://ciechanow.ski/gps/

That's a great article, you should post it separately.

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

#77
post #53

Earlier quoted context omitted.

It's pretty uncommon and it's not a deliberate debugging tool. In this case, the GBA could, hypothetically, have had a way to "park" the architecture on a game crash, or "watchdog" the system (by tying state update somewhere that should run periodically to a non-maskable interrupt that reboots the machine if that state update stops happening). Simply because it costs more to do those things, the GBA doesn't (Nintendo…

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 could have used.

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

#79

Earlier quoted context omitted.

> I can't imagine how it would be possible to construct a jump call with an invalid value You can use the bx instruction to jump to any address stored in a register. > Additionally, what would happen if one of TheZZAZZGlitch's incorrectly reconstructed ROMs was run on a real GameBoy? It would crash, and eventually start playing the ROM on the speaker, the whole point of the video :)

Thanks for the explanation! So it sounds like the emulator is detecting the error 'out of band' with the emulated execution flow, and choosing to throw an error message rather than letting the execution continue. If it didn't catch the error, it sounds like it would glitch out in much the same way as the real GameBoy would. Is that right?

That's right. This sort of thing is more likely to indicate a discrepancy between the emulator and the real hardware, than actual game behaviour, so emulator developers choose to treat it like a crash. Some emulators have "continue anyway" buttons and some don't.

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

#80
post #16

Earlier quoted context omitted.

Would this be dependent on the audio file that was being played during the crash to start at address 0 of the ROM? It seems like it'd be highly unlikely you'd be able to get 100% of the ROM. Now if this was a hack where the thought was, "What if we dumped the whole ROM to the audio buffer, could we recover the complete ROM through audio analysis?"

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.
Post reply on HN