2022-02-20 14:10:13 +00:00
|
|
|
extern "C" {
|
|
|
|
#include "iopins.h"
|
|
|
|
#include "emuapi.h"
|
|
|
|
}
|
2023-05-27 14:25:40 +00:00
|
|
|
#include "t4_dsp.h"
|
|
|
|
extern T4_DSP tft;
|
2022-02-20 14:10:13 +00:00
|
|
|
|
|
|
|
// ****************************************************
|
|
|
|
// the setup() method runs once, when the sketch starts
|
|
|
|
// ****************************************************
|
|
|
|
void setup() {
|
|
|
|
emu_init();
|
|
|
|
}
|
|
|
|
|
2023-05-27 14:25:40 +00:00
|
|
|
static void vbl(void) {
|
|
|
|
uint16_t bClick = emu_DebounceLocalKeys();
|
|
|
|
emu_Input(bClick);
|
|
|
|
}
|
2022-02-20 14:10:13 +00:00
|
|
|
|
|
|
|
// ****************************************************
|
|
|
|
// the loop() method runs continuously
|
|
|
|
// ****************************************************
|
|
|
|
void loop(void)
|
|
|
|
{
|
|
|
|
if (menuActive()) {
|
|
|
|
uint16_t bClick = emu_DebounceLocalKeys();
|
|
|
|
int action = handleMenu(bClick);
|
|
|
|
char * filename = menuSelection();
|
2023-05-27 14:25:40 +00:00
|
|
|
if (action == ACTION_RUN1) {
|
|
|
|
emu_start(16666,nullptr);
|
2022-02-20 14:10:13 +00:00
|
|
|
emu_Init(filename);
|
|
|
|
}
|
|
|
|
delay(20);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
uint16_t bClick = emu_DebounceLocalKeys();
|
|
|
|
emu_Input(bClick);
|
2023-05-27 14:25:40 +00:00
|
|
|
emu_Step();
|
2022-02-20 14:10:13 +00:00
|
|
|
}
|
|
|
|
}
|