// NAME: Last 5 Turn BG Swap
// GAMES: MP3_USA
// EXECUTION: Direct

#include "ultra64.h"

// Symbols for turn counts
#define TOTAL_TURNS (*(volatile unsigned char*)0x800CD05A)
#define CURRENT_TURNS (*(volatile unsigned char*)0x800CD05B)

// Changes the board background
extern void func_800E69BC(int bgIndex);

void main() {
    // Access turn counts directly
    int total_turns = TOTAL_TURNS;
    int current_turns = CURRENT_TURNS;

    // Calculate the difference
    int difference = total_turns - current_turns;

    // Check if the difference is less than or equal to 5
    if (difference <= 5) {
        // Change the background to ADDITIONAL_BG_1
        func_800E69BC(ADDITIONAL_BG_1);
    }
}