diff --git a/TODO.txt b/TODO.txt index 64b97c5..d3c716a 100644 --- a/TODO.txt +++ b/TODO.txt @@ -40,7 +40,8 @@ fuck issue trackers :D - on arduinos for some reason straight triangles (floor, walls, ...) on map don't fucking display, they seem to not be added at all, but maybe it's - something with the "instability" due to low memory... + something with the "instability" due to low memory... HOWEVER on ringo (enough + mem) it does the same thing, is some kinda shitbug - replay loading BUG! somehow map2 replay was saves with hash 05ef0ab1 instead of correct 3c5ba5dd once, WTF, check where hash gets modified diff --git a/frontend_ringo/frontend_ringo.ino b/frontend_ringo/frontend_ringo.ino new file mode 100644 index 0000000..7ae17da --- /dev/null +++ b/frontend_ringo/frontend_ringo.ino @@ -0,0 +1,97 @@ +/** + @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(); +} diff --git a/game.h b/game.h index 5aff626..f270cee 100644 --- a/game.h +++ b/game.h @@ -1301,8 +1301,8 @@ void LCR_gameDraw3DView(void) LCR_rendererSetGhostTransform(carTransform,carTransform + 3); } else - LCR_rendererSetGhostVisibility(0); #endif + LCR_rendererSetGhostVisibility(0); if (LCR_game.cameraMode != LCR_CAMERA_MODE_FREE && LCR_game.state != LCR_GAME_STATE_RUN_FINISHED)