Merge pull request #12 from poevoid/master

Static changes, fix drawBitmap Rows issue
This commit is contained in:
Mr.Blinky 2021-08-22 13:58:35 +02:00 committed by GitHub
commit 6acc22dfda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 103 additions and 105 deletions

View File

@ -10,17 +10,16 @@
//========== class Arduboy2Base ========== //========== class Arduboy2Base ==========
//======================================== //========================================
uint8_t Arduboy2Base::sBuffer[]; uint8_t Arduboy2Base::sBuffer[];
Arduboy2Base::Arduboy2Base() uint8_t Arduboy2Base::currentButtonState = 0;
{ uint8_t Arduboy2Base::previousButtonState = 0;
currentButtonState = 0;
previousButtonState = 0;
// frame management // frame management
setFrameRate(60); uint16_t Arduboy2Base::frameCount = 0;
frameCount = 0; uint8_t Arduboy2Base::eachFrameMillis = 16;
justRendered = false; uint8_t Arduboy2Base::thisFrameStart;
} uint8_t Arduboy2Base::lastFrameDurationMs;
bool Arduboy2Base::justRendered = false;
// functions called here should be public so users can create their // functions called here should be public so users can create their
// own init functions if they need different behavior than `begin` // own init functions if they need different behavior than `begin`
@ -839,6 +838,7 @@ void Arduboy2Base::drawBitmap
int8_t yOffset = y & 7; int8_t yOffset = y & 7;
int8_t sRow = y >> 3; int8_t sRow = y >> 3;
uint8_t rows = h >> 3; uint8_t rows = h >> 3;
if (h % 8 != 0) rows++;
for (int a = 0; a < rows; a++) { for (int a = 0; a < rows; a++) {
int bRow = sRow + a; int bRow = sRow + a;
if (bRow > (HEIGHT/8)-1) break; if (bRow > (HEIGHT/8)-1) break;
@ -1176,15 +1176,14 @@ void Arduboy2Base::swapInt16(int16_t& a, int16_t& b)
//========== class Arduboy2 ========== //========== class Arduboy2 ==========
//==================================== //====================================
Arduboy2::Arduboy2() int16_t Arduboy2::cursor_x = 0;
{ int16_t Arduboy2::cursor_y = 0;
cursor_x = 0; uint8_t Arduboy2::textColor = 1;
cursor_y = 0; uint8_t Arduboy2::textBackground = 0;
textColor = 1; uint8_t Arduboy2::textSize = 1;
textBackground = 0; bool Arduboy2::textWrap = false;
textSize = 1; //bool Arduboy2::textRaw = false;
textWrap = 0;
}
// bootLogoText() should be kept in sync with bootLogoShell() // bootLogoText() should be kept in sync with bootLogoShell()
// if changes are made to one, equivalent changes should be made to the other // if changes are made to one, equivalent changes should be made to the other

View File

@ -218,7 +218,7 @@ class Arduboy2Base : public Arduboy2Core
friend class Arduboy2Audio; friend class Arduboy2Audio;
public: public:
Arduboy2Base(); //Arduboy2Base();
/** \brief /** \brief
* An object created to provide audio control functions within this class. * An object created to provide audio control functions within this class.
@ -229,7 +229,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see Arduboy2Audio * \see Arduboy2Audio
*/ */
Arduboy2Audio audio; static Arduboy2Audio audio;
/** \brief /** \brief
* Initialize the hardware, display the boot logo, provide boot utilities, etc. * Initialize the hardware, display the boot logo, provide boot utilities, etc.
@ -247,7 +247,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see boot() * \see boot()
*/ */
void begin(); static void begin();
/** \brief /** \brief
* Turn the RGB LED and display fully on to act as a small flashlight/torch. * Turn the RGB LED and display fully on to act as a small flashlight/torch.
@ -275,7 +275,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see begin() boot() safeMode() * \see begin() boot() safeMode()
*/ */
void flashlight(); static void flashlight();
/** \brief /** \brief
* Handle buttons held on startup for system control. * Handle buttons held on startup for system control.
@ -293,7 +293,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see begin() boot() * \see begin() boot()
*/ */
void systemButtons(); static void systemButtons();
/** \brief /** \brief
* Display the boot logo sequence using `drawBitmap()`. * Display the boot logo sequence using `drawBitmap()`.
@ -311,7 +311,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see begin() boot() bootLogoShell() Arduboy2::bootLogoText() * \see begin() boot() bootLogoShell() Arduboy2::bootLogoText()
*/ */
void bootLogo(); static void bootLogo();
/** \brief /** \brief
* Display the boot logo sequence using `drawCompressed()`. * Display the boot logo sequence using `drawCompressed()`.
@ -323,7 +323,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see bootLogo() begin() boot() * \see bootLogo() begin() boot()
*/ */
void bootLogoCompressed(); static void bootLogoCompressed();
/** \brief /** \brief
* Display the boot logo sequence using `Sprites::drawSelfMasked()`. * Display the boot logo sequence using `Sprites::drawSelfMasked()`.
@ -347,7 +347,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see bootLogo() begin() boot() Sprites * \see bootLogo() begin() boot() Sprites
*/ */
void bootLogoSpritesOverwrite(); static void bootLogoSpritesOverwrite();
/** \brief /** \brief
* Display the boot logo sequence using `SpritesB::drawSelfMasked()`. * Display the boot logo sequence using `SpritesB::drawSelfMasked()`.
@ -359,7 +359,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see bootLogo() begin() boot() SpritesB * \see bootLogo() begin() boot() SpritesB
*/ */
void bootLogoSpritesBSelfMasked(); static void bootLogoSpritesBSelfMasked();
/** \brief /** \brief
* Display the boot logo sequence using `SpritesB::drawOverwrite()`. * Display the boot logo sequence using `SpritesB::drawOverwrite()`.
@ -371,7 +371,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see bootLogo() begin() boot() SpritesB * \see bootLogo() begin() boot() SpritesB
*/ */
void bootLogoSpritesBOverwrite(); static void bootLogoSpritesBOverwrite();
/** \brief /** \brief
* Display the boot logo sequence using the provided function * Display the boot logo sequence using the provided function
@ -414,11 +414,11 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see bootLogo() boot() Arduboy2::bootLogoExtra() * \see bootLogo() boot() Arduboy2::bootLogoExtra()
*/ */
void bootLogoShell(void (*drawLogo)(int16_t)); static void bootLogoShell(void (*drawLogo)(int16_t));
// Called by bootLogoShell() to allow derived classes to display additional // Called by bootLogoShell() to allow derived classes to display additional
// information after the logo stops scrolling down. // information after the logo stops scrolling down.
virtual void bootLogoExtra(); static void bootLogoExtra();
/** \brief /** \brief
* Wait until all buttons have been released. * Wait until all buttons have been released.
@ -437,7 +437,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see begin() boot() * \see begin() boot()
*/ */
void waitNoButtons(); static void waitNoButtons();
/** \brief /** \brief
* Clear the display buffer. * Clear the display buffer.
@ -447,7 +447,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see display(bool) * \see display(bool)
*/ */
void clear(); static void clear();
/** \brief /** \brief
* Copy the contents of the display buffer to the display. * Copy the contents of the display buffer to the display.
@ -458,7 +458,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see display(bool) * \see display(bool)
*/ */
void display(); static void display();
/** \brief /** \brief
* Copy the contents of the display buffer to the display. The display buffer * Copy the contents of the display buffer to the display. The display buffer
@ -478,7 +478,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see display() clear() * \see display() clear()
*/ */
void display(bool clear); static void display(bool clear);
/** \brief /** \brief
* Set a single pixel in the display buffer to the specified color. * Set a single pixel in the display buffer to the specified color.
@ -502,7 +502,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \return WHITE if the pixel is on or BLACK if the pixel is off. * \return WHITE if the pixel is on or BLACK if the pixel is off.
*/ */
uint8_t getPixel(uint8_t x, uint8_t y); static uint8_t getPixel(uint8_t x, uint8_t y);
/** \brief /** \brief
* Draw a circle of a given radius. * Draw a circle of a given radius.
@ -512,7 +512,7 @@ class Arduboy2Base : public Arduboy2Core
* \param r The radius of the circle in pixels. * \param r The radius of the circle in pixels.
* \param color The circle's color (optional; defaults to WHITE). * \param color The circle's color (optional; defaults to WHITE).
*/ */
void drawCircle(int16_t x0, int16_t y0, uint8_t r, uint8_t color = WHITE); static void drawCircle(int16_t x0, int16_t y0, uint8_t r, uint8_t color = WHITE);
/** \brief /** \brief
* Draw a filled-in circle of a given radius. * Draw a filled-in circle of a given radius.
@ -522,7 +522,7 @@ class Arduboy2Base : public Arduboy2Core
* \param r The radius of the circle in pixels. * \param r The radius of the circle in pixels.
* \param color The circle's color (optional; defaults to WHITE). * \param color The circle's color (optional; defaults to WHITE).
*/ */
void fillCircle(int16_t x0, int16_t y0, uint8_t r, uint8_t color = WHITE); static void fillCircle(int16_t x0, int16_t y0, uint8_t r, uint8_t color = WHITE);
/** \brief /** \brief
* Draw a line between two specified points. * Draw a line between two specified points.
@ -536,7 +536,7 @@ class Arduboy2Base : public Arduboy2Core
* Bresenham's algorithm. * Bresenham's algorithm.
* The start and end points can be at any location with respect to the other. * The start and end points can be at any location with respect to the other.
*/ */
void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint8_t color = WHITE); static void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint8_t color = WHITE);
/** \brief /** \brief
* Draw a rectangle of a specified width and height. * Draw a rectangle of a specified width and height.
@ -547,7 +547,7 @@ class Arduboy2Base : public Arduboy2Core
* \param h The height of the rectangle. * \param h The height of the rectangle.
* \param color The color of the pixel (optional; defaults to WHITE). * \param color The color of the pixel (optional; defaults to WHITE).
*/ */
void drawRect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color = WHITE); static void drawRect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color = WHITE);
/** \brief /** \brief
* Draw a vertical line. * Draw a vertical line.
@ -557,7 +557,7 @@ class Arduboy2Base : public Arduboy2Core
* \param h The height of the line. * \param h The height of the line.
* \param color The color of the line (optional; defaults to WHITE). * \param color The color of the line (optional; defaults to WHITE).
*/ */
void drawFastVLine(int16_t x, int16_t y, uint8_t h, uint8_t color = WHITE); static void drawFastVLine(int16_t x, int16_t y, uint8_t h, uint8_t color = WHITE);
/** \brief /** \brief
* Draw a horizontal line. * Draw a horizontal line.
@ -567,7 +567,7 @@ class Arduboy2Base : public Arduboy2Core
* \param w The width of the line. * \param w The width of the line.
* \param color The color of the line (optional; defaults to WHITE). * \param color The color of the line (optional; defaults to WHITE).
*/ */
void drawFastHLine(int16_t x, int16_t y, uint8_t w, uint8_t color = WHITE); static void drawFastHLine(int16_t x, int16_t y, uint8_t w, uint8_t color = WHITE);
/** \brief /** \brief
* Draw a filled-in rectangle of a specified width and height. * Draw a filled-in rectangle of a specified width and height.
@ -578,14 +578,14 @@ class Arduboy2Base : public Arduboy2Core
* \param h The height of the rectangle. * \param h The height of the rectangle.
* \param color The color of the pixel (optional; defaults to WHITE). * \param color The color of the pixel (optional; defaults to WHITE).
*/ */
void fillRect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color = WHITE); static void fillRect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color = WHITE);
/** \brief /** \brief
* Fill the screen buffer with the specified color. * Fill the screen buffer with the specified color.
* *
* \param color The fill color (optional; defaults to WHITE). * \param color The fill color (optional; defaults to WHITE).
*/ */
void fillScreen(uint8_t color = WHITE); static void fillScreen(uint8_t color = WHITE);
/** \brief /** \brief
* Draw a rectangle with rounded corners. * Draw a rectangle with rounded corners.
@ -597,7 +597,7 @@ class Arduboy2Base : public Arduboy2Core
* \param r The radius of the semicircles forming the corners. * \param r The radius of the semicircles forming the corners.
* \param color The color of the rectangle (optional; defaults to WHITE). * \param color The color of the rectangle (optional; defaults to WHITE).
*/ */
void drawRoundRect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t r, uint8_t color = WHITE); static void drawRoundRect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t r, uint8_t color = WHITE);
/** \brief /** \brief
* Draw a filled-in rectangle with rounded corners. * Draw a filled-in rectangle with rounded corners.
@ -609,7 +609,7 @@ class Arduboy2Base : public Arduboy2Core
* \param r The radius of the semicircles forming the corners. * \param r The radius of the semicircles forming the corners.
* \param color The color of the rectangle (optional; defaults to WHITE). * \param color The color of the rectangle (optional; defaults to WHITE).
*/ */
void fillRoundRect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t r, uint8_t color = WHITE); static void fillRoundRect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t r, uint8_t color = WHITE);
/** \brief /** \brief
* Draw a triangle given the coordinates of each corner. * Draw a triangle given the coordinates of each corner.
@ -622,7 +622,7 @@ class Arduboy2Base : public Arduboy2Core
* A triangle is drawn by specifying each of the three corner locations. * A triangle is drawn by specifying each of the three corner locations.
* The corners can be at any position with respect to the others. * The corners can be at any position with respect to the others.
*/ */
void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t color = WHITE); static void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t color = WHITE);
/** \brief /** \brief
* Draw a filled-in triangle given the coordinates of each corner. * Draw a filled-in triangle given the coordinates of each corner.
@ -635,7 +635,7 @@ class Arduboy2Base : public Arduboy2Core
* A triangle is drawn by specifying each of the three corner locations. * A triangle is drawn by specifying each of the three corner locations.
* The corners can be at any position with respect to the others. * The corners can be at any position with respect to the others.
*/ */
void fillTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t color = WHITE); static void fillTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t color = WHITE);
/** \brief /** \brief
* Draw a bitmap from an array in program memory. * Draw a bitmap from an array in program memory.
@ -688,7 +688,7 @@ class Arduboy2Base : public Arduboy2Core
* that allows them to be directly written to the screen. It is recommended * that allows them to be directly written to the screen. It is recommended
* you use `drawBitmap()` when possible. * you use `drawBitmap()` when possible.
*/ */
void drawSlowXYBitmap(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t w, uint8_t h, uint8_t color = WHITE); static void drawSlowXYBitmap(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t w, uint8_t h, uint8_t color = WHITE);
/** \brief /** \brief
* Draw a bitmap from an array of compressed data. * Draw a bitmap from an array of compressed data.
@ -733,7 +733,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see sBuffer * \see sBuffer
*/ */
uint8_t* getBuffer(); static uint8_t* getBuffer();
/** \brief /** \brief
* Seed the random number generator with a random value. * Seed the random number generator with a random value.
@ -749,7 +749,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see generateRandomSeed() * \see generateRandomSeed()
*/ */
void initRandomSeed(); static void initRandomSeed();
/** \brief /** \brief
* Set the frame rate used by the frame control functions. * Set the frame rate used by the frame control functions.
@ -777,7 +777,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see nextFrame() setFrameDuration() * \see nextFrame() setFrameDuration()
*/ */
void setFrameRate(uint8_t rate); static void setFrameRate(uint8_t rate);
/** \brief /** \brief
* Set the frame rate, used by the frame control functions, by giving * Set the frame rate, used by the frame control functions, by giving
@ -797,7 +797,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see nextFrame() setFrameRate() * \see nextFrame() setFrameRate()
*/ */
void setFrameDuration(uint8_t duration); static void setFrameDuration(uint8_t duration);
/** \brief /** \brief
* Indicate that it's time to render the next frame. * Indicate that it's time to render the next frame.
@ -824,7 +824,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see setFrameRate() setFrameDuration() nextFrameDEV() * \see setFrameRate() setFrameDuration() nextFrameDEV()
*/ */
bool nextFrame(); static bool nextFrame();
/** \brief /** \brief
* Indicate that it's time to render the next frame, and visually indicate * Indicate that it's time to render the next frame, and visually indicate
@ -851,7 +851,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see nextFrame() cpuLoad() setFrameRate() * \see nextFrame() cpuLoad() setFrameRate()
*/ */
bool nextFrameDEV(); static bool nextFrameDEV();
/** \brief /** \brief
* Indicate if the specified number of frames has elapsed. * Indicate if the specified number of frames has elapsed.
@ -878,7 +878,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see setFrameRate() nextFrame() * \see setFrameRate() nextFrame()
*/ */
bool everyXFrames(uint8_t frames); static bool everyXFrames(uint8_t frames);
/** \brief /** \brief
* Return the load on the CPU as a percentage. * Return the load on the CPU as a percentage.
@ -901,7 +901,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see setFrameRate() nextFrame() * \see setFrameRate() nextFrame()
*/ */
int cpuLoad(); static int cpuLoad();
/** \brief /** \brief
* Test if the all of the specified buttons are pressed. * Test if the all of the specified buttons are pressed.
@ -922,7 +922,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see anyPressed() notPressed() * \see anyPressed() notPressed()
*/ */
bool pressed(uint8_t buttons); static bool pressed(uint8_t buttons);
/** \brief /** \brief
* Test if any of the specified buttons are pressed. * Test if any of the specified buttons are pressed.
@ -944,7 +944,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see pressed() notPressed() * \see pressed() notPressed()
*/ */
bool anyPressed(uint8_t buttons); static bool anyPressed(uint8_t buttons);
/** \brief /** \brief
* Test if the specified buttons are not pressed. * Test if the specified buttons are not pressed.
@ -966,7 +966,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see pressed() anyPressed() * \see pressed() anyPressed()
*/ */
bool notPressed(uint8_t buttons); static bool notPressed(uint8_t buttons);
/** \brief /** \brief
* Poll the buttons and track their state over time. * Poll the buttons and track their state over time.
@ -1001,7 +1001,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see justPressed() justReleased() * \see justPressed() justReleased()
*/ */
void pollButtons(); static void pollButtons();
/** \brief /** \brief
* Check if a button has just been pressed. * Check if a button has just been pressed.
@ -1023,7 +1023,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see pollButtons() justReleased() * \see pollButtons() justReleased()
*/ */
bool justPressed(uint8_t button); static bool justPressed(uint8_t button);
/** \brief /** \brief
* Check if a button has just been released. * Check if a button has just been released.
@ -1051,7 +1051,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see pollButtons() justPressed() * \see pollButtons() justPressed()
*/ */
bool justReleased(uint8_t button); static bool justReleased(uint8_t button);
/** \brief /** \brief
* Test if a point falls within a rectangle. * Test if a point falls within a rectangle.
@ -1098,7 +1098,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see writeUnitID() readUnitName() * \see writeUnitID() readUnitName()
*/ */
uint16_t readUnitID(); static uint16_t readUnitID();
/** \brief /** \brief
* Write a unit ID to system EEPROM. * Write a unit ID to system EEPROM.
@ -1112,7 +1112,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see readUnitID() writeUnitName() * \see readUnitID() writeUnitName()
*/ */
void writeUnitID(uint16_t id); static void writeUnitID(uint16_t id);
/** \brief /** \brief
* Read the unit name from system EEPROM. * Read the unit name from system EEPROM.
@ -1158,7 +1158,7 @@ class Arduboy2Base : public Arduboy2Core
* \see writeUnitName() readUnitID() Arduboy2::bootLogoExtra() * \see writeUnitName() readUnitID() Arduboy2::bootLogoExtra()
* ARDUBOY_UNIT_NAME_BUFFER_SIZE ARDUBOY_UNIT_NAME_LEN Arduboy2::font5x7 * ARDUBOY_UNIT_NAME_BUFFER_SIZE ARDUBOY_UNIT_NAME_LEN Arduboy2::font5x7
*/ */
uint8_t readUnitName(char* name); static uint8_t readUnitName(char* name);
/** \brief /** \brief
* Write a unit name to system EEPROM. * Write a unit name to system EEPROM.
@ -1189,7 +1189,7 @@ class Arduboy2Base : public Arduboy2Core
* \see readUnitName() writeUnitID() Arduboy2::bootLogoExtra() * \see readUnitName() writeUnitID() Arduboy2::bootLogoExtra()
* ARDUBOY_UNIT_NAME_BUFFER_SIZE ARDUBOY_UNIT_NAME_LEN Arduboy2::font5x7 * ARDUBOY_UNIT_NAME_BUFFER_SIZE ARDUBOY_UNIT_NAME_LEN Arduboy2::font5x7
*/ */
void writeUnitName(const char* name); static void writeUnitName(const char* name);
/** \brief /** \brief
* Read the "Show Boot Logo" flag in system EEPROM. * Read the "Show Boot Logo" flag in system EEPROM.
@ -1205,7 +1205,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see writeShowBootLogoFlag() bootLogo() * \see writeShowBootLogoFlag() bootLogo()
*/ */
bool readShowBootLogoFlag(); static bool readShowBootLogoFlag();
/** \brief /** \brief
* Write the "Show Boot Logo" flag in system EEPROM. * Write the "Show Boot Logo" flag in system EEPROM.
@ -1221,7 +1221,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see readShowBootLogoFlag() bootLogo() * \see readShowBootLogoFlag() bootLogo()
*/ */
void writeShowBootLogoFlag(bool val); static void writeShowBootLogoFlag(bool val);
/** \brief /** \brief
* Read the "Show Unit Name" flag in system EEPROM. * Read the "Show Unit Name" flag in system EEPROM.
@ -1237,7 +1237,7 @@ class Arduboy2Base : public Arduboy2Core
* \see writeShowUnitNameFlag() writeUnitName() readUnitName() * \see writeShowUnitNameFlag() writeUnitName() readUnitName()
* Arduboy2::bootLogoExtra() * Arduboy2::bootLogoExtra()
*/ */
bool readShowUnitNameFlag(); static bool readShowUnitNameFlag();
/** \brief /** \brief
* Write the "Show Unit Name" flag in system EEPROM. * Write the "Show Unit Name" flag in system EEPROM.
@ -1253,7 +1253,7 @@ class Arduboy2Base : public Arduboy2Core
* \see readShowUnitNameFlag() writeUnitName() readUnitName() * \see readShowUnitNameFlag() writeUnitName() readUnitName()
* Arduboy2::bootLogoExtra() * Arduboy2::bootLogoExtra()
*/ */
void writeShowUnitNameFlag(bool val); static void writeShowUnitNameFlag(bool val);
/** \brief /** \brief
* Read the "Show LEDs with boot logo" flag in system EEPROM. * Read the "Show LEDs with boot logo" flag in system EEPROM.
@ -1268,7 +1268,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see writeShowBootLogoLEDsFlag() * \see writeShowBootLogoLEDsFlag()
*/ */
bool readShowBootLogoLEDsFlag(); static bool readShowBootLogoLEDsFlag();
/** \brief /** \brief
* Write the "Show LEDs with boot logo" flag in system EEPROM. * Write the "Show LEDs with boot logo" flag in system EEPROM.
@ -1284,7 +1284,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see readShowBootLogoLEDsFlag() * \see readShowBootLogoLEDsFlag()
*/ */
void writeShowBootLogoLEDsFlag(bool val); static void writeShowBootLogoLEDsFlag(bool val);
/** \brief /** \brief
* A counter which is incremented once per frame. * A counter which is incremented once per frame.
@ -1319,7 +1319,7 @@ class Arduboy2Base : public Arduboy2Core
* *
* \see nextFrame() everyXFrames() * \see nextFrame() everyXFrames()
*/ */
uint16_t frameCount; static uint16_t frameCount;
/** \brief /** \brief
* The display buffer array in RAM. * The display buffer array in RAM.
@ -1360,7 +1360,7 @@ class Arduboy2Base : public Arduboy2Core
protected: protected:
// helper function for sound enable/disable system control // helper function for sound enable/disable system control
void sysCtrlSound(uint8_t buttons, uint8_t led, uint8_t eeVal); static void sysCtrlSound(uint8_t buttons, uint8_t led, uint8_t eeVal);
// functions passed to bootLogoShell() to draw the logo // functions passed to bootLogoShell() to draw the logo
static void drawLogoBitmap(int16_t y); static void drawLogoBitmap(int16_t y);
@ -1371,29 +1371,29 @@ class Arduboy2Base : public Arduboy2Core
static void drawLogoSpritesBOverwrite(int16_t y); static void drawLogoSpritesBOverwrite(int16_t y);
// draw one or more "corners" of a circle // draw one or more "corners" of a circle
void drawCircleHelper(int16_t x0, int16_t y0, uint8_t r, uint8_t corners, static void drawCircleHelper(int16_t x0, int16_t y0, uint8_t r, uint8_t corners,
uint8_t color = WHITE); uint8_t color = WHITE);
// draw one or both vertical halves of a filled-in circle or // draw one or both vertical halves of a filled-in circle or
// rounded rectangle edge // rounded rectangle edge
void fillCircleHelper(int16_t x0, int16_t y0, uint8_t r, static void fillCircleHelper(int16_t x0, int16_t y0, uint8_t r,
uint8_t sides, int16_t delta, uint8_t color = WHITE); uint8_t sides, int16_t delta, uint8_t color = WHITE);
// helper for drawCompressed() // helper for drawCompressed()
struct BitStreamReader; struct BitStreamReader;
// swap the values of two int16_t variables passed by reference // swap the values of two int16_t variables passed by reference
void swapInt16(int16_t& a, int16_t& b); static void swapInt16(int16_t& a, int16_t& b);
// For button handling // For button handling
uint8_t currentButtonState; static uint8_t currentButtonState;
uint8_t previousButtonState; static uint8_t previousButtonState;
// For frame functions // For frame functions
uint8_t eachFrameMillis; static uint8_t eachFrameMillis;
uint8_t thisFrameStart; static uint8_t thisFrameStart;
bool justRendered; static bool justRendered;
uint8_t lastFrameDurationMs; static uint8_t lastFrameDurationMs;
// ----- Map of EEPROM addresses for system use----- // ----- Map of EEPROM addresses for system use-----
@ -1452,7 +1452,6 @@ class Arduboy2 : public Print, public Arduboy2Base
friend class Arduboy2Ex; friend class Arduboy2Ex;
public: public:
Arduboy2();
/** \class Print /** \class Print
* \brief * \brief
@ -1607,7 +1606,7 @@ class Arduboy2 : public Print, public Arduboy2Base
* \see Print write() setTextColor() setTextBackground() setTextSize() * \see Print write() setTextColor() setTextBackground() setTextSize()
* font5x7 * font5x7
*/ */
void drawChar(int16_t x, int16_t y, unsigned char c, uint8_t color, uint8_t bg, uint8_t size); static void drawChar(int16_t x, int16_t y, unsigned char c, uint8_t color, uint8_t bg, uint8_t size);
/** \brief /** \brief
* Set the location of the text cursor. * Set the location of the text cursor.
@ -1627,7 +1626,7 @@ class Arduboy2 : public Print, public Arduboy2Base
* *
* \see setCursorX() setCursorY() getCursorX() getCursorY() * \see setCursorX() setCursorY() getCursorX() getCursorY()
*/ */
void setCursor(int16_t x, int16_t y); static void setCursor(int16_t x, int16_t y);
/** \brief /** \brief
* Set the X coordinate of the text cursor location. * Set the X coordinate of the text cursor location.
@ -1642,7 +1641,7 @@ class Arduboy2 : public Print, public Arduboy2Base
* *
* \see setCursor() setCursorY() getCursorX() getCursorY() * \see setCursor() setCursorY() getCursorX() getCursorY()
*/ */
void setCursorX(int16_t x); static void setCursorX(int16_t x);
/** \brief /** \brief
* Set the Y coordinate of the text cursor location. * Set the Y coordinate of the text cursor location.
@ -1657,7 +1656,7 @@ class Arduboy2 : public Print, public Arduboy2Base
* *
* \see setCursor() setCursorX() getCursorX() getCursorY() * \see setCursor() setCursorX() getCursorX() getCursorY()
*/ */
void setCursorY(int16_t y); static void setCursorY(int16_t y);
/** \brief /** \brief
* Get the X coordinate of the current text cursor position. * Get the X coordinate of the current text cursor position.
@ -1670,7 +1669,7 @@ class Arduboy2 : public Print, public Arduboy2Base
* *
* \see getCursorY() setCursor() setCursorX() setCursorY() * \see getCursorY() setCursor() setCursorX() setCursorY()
*/ */
int16_t getCursorX(); static int16_t getCursorX();
/** \brief /** \brief
* Get the Y coordinate of the current text cursor position. * Get the Y coordinate of the current text cursor position.
@ -1683,7 +1682,7 @@ class Arduboy2 : public Print, public Arduboy2Base
* *
* \see getCursorX() setCursor() setCursorX() setCursorY() * \see getCursorX() setCursor() setCursorX() setCursorY()
*/ */
int16_t getCursorY(); static int16_t getCursorY();
/** \brief /** \brief
* Set the text foreground color. * Set the text foreground color.
@ -1692,7 +1691,7 @@ class Arduboy2 : public Print, public Arduboy2Base
* *
* \see setTextBackground() getTextColor() * \see setTextBackground() getTextColor()
*/ */
void setTextColor(uint8_t color); static void setTextColor(uint8_t color);
/** \brief /** \brief
* Get the currently set text foreground color. * Get the currently set text foreground color.
@ -1701,7 +1700,7 @@ class Arduboy2 : public Print, public Arduboy2Base
* *
* \see setTextColor() * \see setTextColor()
*/ */
uint8_t getTextColor(); static uint8_t getTextColor();
/** \brief /** \brief
* Set the text background color. * Set the text background color.
@ -1710,7 +1709,7 @@ class Arduboy2 : public Print, public Arduboy2Base
* *
* \see setTextColor() getTextBackground() * \see setTextColor() getTextBackground()
*/ */
void setTextBackground(uint8_t bg); static void setTextBackground(uint8_t bg);
/** \brief /** \brief
* Get the currently set text background color. * Get the currently set text background color.
@ -1719,7 +1718,7 @@ class Arduboy2 : public Print, public Arduboy2Base
* *
* \see setTextBackground() * \see setTextBackground()
*/ */
uint8_t getTextBackground(); static uint8_t getTextBackground();
/** \brief /** \brief
* Set the text character size. * Set the text character size.
@ -1737,7 +1736,7 @@ class Arduboy2 : public Print, public Arduboy2Base
* *
* \see getTextSize() * \see getTextSize()
*/ */
void setTextSize(uint8_t s); static void setTextSize(uint8_t s);
/** \brief /** \brief
* Get the currently set text size. * Get the currently set text size.
@ -1746,7 +1745,7 @@ class Arduboy2 : public Print, public Arduboy2Base
* *
* \see setTextSize() * \see setTextSize()
*/ */
uint8_t getTextSize(); static uint8_t getTextSize();
/** \brief /** \brief
* Set or disable text wrap mode. * Set or disable text wrap mode.
@ -1765,7 +1764,7 @@ class Arduboy2 : public Print, public Arduboy2Base
* *
* \see getTextWrap() * \see getTextWrap()
*/ */
void setTextWrap(bool w); static void setTextWrap(bool w);
/** \brief /** \brief
* Get the currently set text wrap mode. * Get the currently set text wrap mode.
@ -1774,12 +1773,12 @@ class Arduboy2 : public Print, public Arduboy2Base
* *
* \see setTextWrap() * \see setTextWrap()
*/ */
bool getTextWrap(); static bool getTextWrap();
/** \brief /** \brief
* Clear the display buffer and set the text cursor to location 0, 0 * Clear the display buffer and set the text cursor to location 0, 0
*/ */
void clear(); static void clear();
/** \brief /** \brief
* The font used for text functions. * The font used for text functions.
@ -1824,12 +1823,12 @@ class Arduboy2 : public Print, public Arduboy2Base
static const PROGMEM uint8_t font5x7[]; static const PROGMEM uint8_t font5x7[];
protected: protected:
int16_t cursor_x; static int16_t cursor_x;
int16_t cursor_y; static int16_t cursor_y;
uint8_t textColor; static uint8_t textColor;
uint8_t textBackground; static uint8_t textBackground;
uint8_t textSize; static uint8_t textSize;
bool textWrap; static bool textWrap;
}; };
extern volatile unsigned long timer0_millis; extern volatile unsigned long timer0_millis;