#include "pico.h" #include "pico/stdlib.h" #include "hardware/gpio.h" #include "hardware/irq.h" #include "hardware/dma.h" #include "hardware/sync.h" extern "C" { #include "iopins.h" #include "emuapi.h" } #include "keyboard_osd.h" #include "v20.h" #include #include "pico_dsp.h" volatile bool vbl=true; bool repeating_timer_callback(struct repeating_timer *t) { uint16_t bClick = emu_DebounceLocalKeys(); emu_Input(bClick); if (vbl) { vbl = false; } else { vbl = true; } return true; } PICO_DSP tft; static int skip=0; #include "hardware/clocks.h" #include "hardware/vreg.h" int main(void) { // vreg_set_voltage(VREG_VOLTAGE_1_05); // set_sys_clock_khz(125000, true); // set_sys_clock_khz(150000, true); // set_sys_clock_khz(133000, true); // set_sys_clock_khz(200000, true); // set_sys_clock_khz(210000, true); /// set_sys_clock_khz(240000, true); // set_sys_clock_khz(225000, true); // set_sys_clock_khz(250000, true); #ifdef HAS_USBPIO set_sys_clock_khz(140000, true); #else set_sys_clock_khz(250000, true); *((uint32_t *)(0x40010000+0x58)) = 2 << 16; //CLK_HSTX_DIV = 2 << 16; // HSTX clock/2 #endif emu_init(); char * filename; #ifdef FILEBROWSER while (true) { if (menuActive()) { uint16_t bClick = emu_DebounceLocalKeys(); int action = handleMenu(bClick); filename = menuSelection(); if (action == ACTION_RUN) { break; } tft.waitSync(); } } #endif emu_start(); emu_Init(filename); tft.startRefresh(); struct repeating_timer timer; add_repeating_timer_ms(25, repeating_timer_callback, NULL, &timer); while (true) { //uint16_t bClick = emu_DebounceLocalKeys(); //emu_Input(bClick); emu_Step(); } } static unsigned short palette16[PALETTE_SIZE]; void emu_SetPaletteEntry(unsigned char r, unsigned char g, unsigned char b, int index) { if (index