diff --git a/assets/bg.png b/assets/bg.png index 677cb2f..ceff098 100644 Binary files a/assets/bg.png and b/assets/bg.png differ diff --git a/src/sound.c b/src/sound.c index a17a63f..a54ea9c 100644 --- a/src/sound.c +++ b/src/sound.c @@ -184,15 +184,38 @@ const uint16_t eerie_reg_vals[] = { 1369, 1497, 1589, 1709, 1733, 1709, 1589, 1497 }; -// Title theme: lamento tragico discendente. 4 frasi da 8 note che scendono da -// La4 fino a La2, con respiri (R) e salti drammatici. Armonizza con la -// progressione Dm - C - Bb - A (come il finale), impostando il tono sinistro -// di "A Scream from the Dark" fin dal menu. -const uint16_t title_melody[32] = { - N_A3, R, N_F3, R, N_D3, N_E3, R, N_A2, // 1. Dm: A3..A2, respiro - N_F3, R, N_D3, R, N_C3, N_B3, R, N_A2, // 2. C: F3..A2, caduta - N_E3, N_D3, R, N_A2, N_B2, R, N_A2, R, // 3. Bb (AS2): E3..A2, sospeso - N_D3, R, N_C3, N_B2, R, N_A2, N_E2, R // 4. A: D3..E2, abisso +const uint16_t title_melody[112] = { + N_D3, R, N_F3, R, N_A3, R, N_F3, R, + N_A3, N_F3, N_D3, R, N_C3, R, N_D3, R, + N_AS3, R, N_D4, N_F4, R, N_D4, N_AS3, R, + N_F3, R, N_A3, N_C4, R, N_A3, N_F3, R, + N_C3, R, N_E3, N_G3, R, N_E3, N_C3, R, + N_D3, R, N_F3, N_A3, R, N_A3, N_F3, R, + N_A3, R, N_CS4, N_E4, R, N_E4, N_CS4, R, + N_D4, N_F4, N_A4, R, N_C5, N_A4, N_F4, R, + N_G3, R, N_AS3, N_D4, R, N_AS3, N_G3, R, + N_A3, R, N_E4, N_CS4, R, N_A3, N_E4, R, + N_D4, N_F4, N_A4, N_F4, R, N_D4, N_C4, R, + N_AS3, N_A3, R, N_G3, R, N_F3, R, N_E3, + N_D3, R, N_C3, R, N_AS2, R, N_A2, R, + N_D3, R, R, R, R, R, R, R +}; + +const uint16_t title_bass[112] = { + N_D3, R, R, R, N_D3, R, R, R, + N_A2, R, R, R, N_A2, R, R, R, + N_AS2, R, R, R, N_AS2, R, R, R, + N_F2, R, R, R, N_F2, R, R, R, + N_C3, R, R, R, N_C3, R, R, R, + N_D3, R, R, R, N_D3, R, R, R, + N_A2, R, R, R, N_E3, R, R, R, + N_D3, R, R, R, N_A2, R, R, R, + N_G2, R, R, R, N_D3, R, R, R, + N_A2, R, R, R, N_E3, R, R, R, + N_D3, R, R, R, N_A2, R, R, R, + N_AS2, R, N_A2, R, N_G2, R, N_F2, R, + N_D3, R, N_C3, R, N_AS2, R, N_A2, R, + N_D3, R, R, R, R, R, R, R }; const uint16_t finale_ch1_seq[192] = { @@ -367,26 +390,35 @@ void play_victory_step(uint8_t step) { void play_music_tick(void) { if (app_state == 0) { // TITLE SCREEN title_music_timer++; - if (title_music_timer >= 30) { // 30 frames per note + if (title_music_timer >= 30) { // 30 frames per note (somber) title_music_timer = 0; - uint16_t n = title_melody[title_music_step]; - NR10_REG = 0; - NR11_REG = 0x80; - NR12_REG = 0x63; // soft fade - NR13_REG = n & 0xFF; - NR14_REG = (n >> 8) | 0x80; - - // Add a slow bass note every 4 steps - if (title_music_step % 4 == 0) { - NR21_REG = 0x80; - NR22_REG = 0x77; - uint16_t bn = n / 2; // Octave lower (divide frequency logic) - NR23_REG = bn & 0xFF; - NR24_REG = (bn >> 8) | 0x80; + uint8_t step = title_music_step; + // CH1: melody (sustained, haunting envelope) + uint16_t n = title_melody[step]; + if (n != R) { + NR10_REG = 0; + NR11_REG = 0x80; + NR12_REG = 0x87; // vol 8, fade up, period 7 (sustained) + NR13_REG = n & 0xFF; + NR14_REG = (n >> 8) | 0x80; + } + // CH2: independent bass line (deep plucked) + uint16_t b = title_bass[step]; + if (b != R) { + NR21_REG = 0x80; + NR22_REG = 0xA3; // vol 10, fade down, period 3 (deep plucked) + NR23_REG = b & 0xFF; + NR24_REG = (b >> 8) | 0x80; + } + // CH4: sparse toll at chord changes (every 8 steps) for atmosphere + if (step % 8 == 0) { + NR41_REG = 0x01; + NR42_REG = 0x82; // soft, slow fade + NR43_REG = 0x70; // deep low toll + NR44_REG = 0x80; } - title_music_step++; - if (title_music_step >= 32) title_music_step = 0; + if (title_music_step >= 112) title_music_step = 0; } return; }