-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"zombie mode" does exist on the gba #364
Comments
here's metroid zero mission with the bug i described when using the code above: how it should sound: screen_record-2024-02-25_16.08.18.mp4how it sounds with zombie mode: screen_record-2024-02-25_16.09.11.mp4so while it does exist, it's not exactly as it's implemented above (or on the wiki) for the gba... |
So, as I understand this only proves that "Zombie" mode exists in GBC mode on GBA (SP), right? It is very possible that GBA mode doesn't actually use the same set of PSGs as CGB mode but rather a reimplementation. |
To be clear: this is the issue that prompted my removal of "Zombie" mode emulation: But I haven't done any dedicated/extra testing to figure out if it actually exists in any capacity. |
i managed to get zombie mode to happen on my gba in gba mode. sadly i can't make sense of the audio output as it's not consistent. It does play in a loop of sorts, it repeats every 8(?) seconds, with the last 5-8 seconds being the same output (volume = 15). i've tried a few other methods of triggering zombie mode, but i've only been successful in changing the mode to trigger it /*
test: write to env with period = 0, mode alternating
hw: volume changes!
*/
#include <tonc.h>
enum {
ENVELOPE_SUB = 0 << 11,
ENVELOPE_ADD = 1 << 11,
};
int main(void) {
irq_init(NULL);
irq_enable(II_VBLANK);
REG_SNDSTAT = SSTAT_ENABLE;
REG_SNDDSCNT = SDS_DMG100;
REG_SNDDMGCNT = SDMG_LVOL(7) | SDMG_RVOL(7) | SDMG_LSQR1 | SDMG_RSQR1;
int mode = ENVELOPE_ADD;
REG_SND1CNT = (15 << 12) | mode | (0 << 8);
REG_SND1FREQ = SFREQ_RESET | SFREQ_RATE(416);
int wait = 60;
while (1) {
if (--wait == 0) {
mode = mode == ENVELOPE_ADD ? ENVELOPE_SUB : ENVELOPE_ADD;
REG_SND1CNT = (15 << 12) | mode | (0 << 8);
wait = 60;
}
VBlankIntrWait();
}
} |
during the intro (both of them), both square channels will have a volume of 15, along with left/right volume of 8 (7 + 1). the game then writes to envelope which causes the volume to be incremented, so volume is now 16, which gets masked down to 0.
i have tested this on my gba sp, the square channels are silenced as they overflow to 0. not sure the exact way this works, but according to the wiki, this behaviour is true across all systems:
i am not sure the exact way in which zombie mode works. implementing it how the wiki describes (which is for dmg) breaks metroid zero intro when the ship lands.
The text was updated successfully, but these errors were encountered: