/** @file frontend_ringo.ino Experimental Licar frontend for Circuitmess Ringo (MAKERphone). */ #include #include #include #define LCR_SETTING_RESOLUTION_X LCDWIDTH #define LCR_SETTING_RESOLUTION_Y LCDHEIGHT #define LCR_SETTING_RESOLUTION_SUBDIVIDE 2 #define LCR_SETTING_MUSIC 0 #define LCR_SETTING_GHOST_MAX_SAMPLES 0 #define LCR_SETTING_MAP_MAX_BLOCKS 512 #define LCR_SETTING_MAX_MAP_VERTICES 800 #define LCR_SETTING_MAX_MAP_TRIANGLES 900 #define LCR_SETTING_REPLAY_MAX_SIZE 0 #define LCR_SETTING_CAR_SHADOW 0 #define LCR_SETTING_PARTICLES 0 #define LCR_SETTING_LOG_LEVEL 0 #define LCR_SETTING_LOD_DISTANCE 100 #define LCR_SETTING_CAR_ANIMATION_SUBDIVIDE 0 #define LCR_SETTING_FPS 25 #define LCR_SETTING_TEXTURE_SUBSAMPLE 8 #define LCR_SETTING_ENABLE_DATA_FILE 0 #define LCR_SETTING_ONLY_SMALL_MAPS 1 #include "game.h" MAKERphone mp; void LCR_drawPixel(unsigned long index, uint16_t color) { mp.display.drawPixel(index % LCDWIDTH,index / LCDWIDTH,color); } void LCR_sleep(uint16_t timeMs) { } uint8_t arrows; uint8_t LCR_keyPressed(uint8_t key) { switch (key) { #define b(button) (mp.buttons.timeHeld(button) > 0) case LCR_KEY_UP: return arrows & 0x04; break; case LCR_KEY_DOWN: return arrows & 0x08; break; case LCR_KEY_RIGHT: return arrows & 0x01; break; case LCR_KEY_LEFT: return arrows & 0x02; break; case LCR_KEY_A: return b(BTN_A); break; case LCR_KEY_B: return b(BTN_B); break; default: return 0; break; #undef b } } char LCR_getNextDataFileChar(void) { return 0; } void LCR_appendDataStr(const char *str) { return; } //Oscillator *osc; void setup() { mp.begin(); // osc = new Oscillator(SINE); // addOscillator(osc); // SFG_init(); LCR_gameInit(0,0); } void loop() { arrows = 0x00 | ((mp.buttons.getJoystickX() < 200)) << 0 | ((mp.buttons.getJoystickX() > 900)) << 1 | ((mp.buttons.getJoystickY() < 200)) << 2 | ((mp.buttons.getJoystickY() > 900)) << 3; // SFG_mainLoopBody(); LCR_gameStep(millis()); mp.update(); }