/* Structures and functions to allow the ARM9 to send commands to the ARM7. Based on code from the MOD player example posted to the GBADEV forums. */ #include #include #include "command.h" void CommandInit() { memset(commandControl, 0, sizeof(CommandControl)); } void CommandFIFOInit() { Command* command = &commandControl->command[commandControl->currentCommand]; command->commandType = FIFO_INIT; commandControl->currentCommand++; commandControl->currentCommand &= MAX_COMMANDS-1; } void CommandFIFOSend() { Command* command = &commandControl->command[commandControl->currentCommand]; command->commandType = FIFO_SEND; commandControl->currentCommand++; commandControl->currentCommand &= MAX_COMMANDS-1; } void CommandFIFORecv() { Command* command = &commandControl->command[commandControl->currentCommand]; command->commandType = FIFO_RECV; commandControl->currentCommand++; commandControl->currentCommand &= MAX_COMMANDS-1; }