<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://bloggingadeadhorse.com/arduboyWiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sublinear</id>
	<title>Arduboy Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://bloggingadeadhorse.com/arduboyWiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sublinear"/>
	<link rel="alternate" type="text/html" href="https://bloggingadeadhorse.com/arduboyWiki/index.php/Special:Contributions/Sublinear"/>
	<updated>2026-10-23T00:58:16Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://bloggingadeadhorse.com/arduboyWiki/index.php?title=Reducing_PROGMEM_and_RAM_Usage&amp;diff=449</id>
		<title>Reducing PROGMEM and RAM Usage</title>
		<link rel="alternate" type="text/html" href="https://bloggingadeadhorse.com/arduboyWiki/index.php?title=Reducing_PROGMEM_and_RAM_Usage&amp;diff=449"/>
		<updated>2024-07-20T01:55:06Z</updated>

		<summary type="html">&lt;p&gt;Sublinear: Fix link to Compiler Explorer&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
The [[What is the Arduboy|Arduboy]] only has 28KiB or 29KiB (FX) of PROGMEM and 2.5KiB of RAM. While making a game, these can run out very quickly. This page aims to help you recover some of your precious PROGMEM and RAM.&lt;br /&gt;
&lt;br /&gt;
== Tips for Reducing PROGMEM ==&lt;br /&gt;
&lt;br /&gt;
* Look through your code in [[Ardens]] for large functions that shouldn&#039;t be there. Here is a step-by-step example: (Note: this will only work with .elf files, .hex files don&#039;t provide enough information.)&lt;br /&gt;
** Launch Ardens and drag your .elf file on it.  &lt;br /&gt;
** Open the disassembly tab (Windows&amp;gt;Debugger&amp;gt;Disassembly)[[File:Open Disassembly Tab.png|thumb|206x206px|Opening the disassembly tab.]]&lt;br /&gt;
** Click on the &amp;quot;Jump to Function&amp;quot; dropdown.[[File:Example Function Dropdown in Ardens.png|thumb|269x269px|The example contents of the Jump to Function dropdown. Note the amount of floating-point functions present.]]&lt;br /&gt;
** Scan the dropdown for anything unexpected.&lt;br /&gt;
** In our example, there are a huge amount of float functions that are taking up a lot of space. &lt;br /&gt;
** How can we fix this? In our source code, we can change x from a float to a uint8_t:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;Arduboy2.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arduboy2 arduboy;&lt;br /&gt;
&lt;br /&gt;
-- float x;&lt;br /&gt;
&lt;br /&gt;
++ uint8_t x;&lt;br /&gt;
&lt;br /&gt;
void setup() {&lt;br /&gt;
&lt;br /&gt;
    arduboy.begin();&lt;br /&gt;
    arduboy.setFrameRate(10);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop() {&lt;br /&gt;
&lt;br /&gt;
    if (!arduboy.nextFrame()) return;&lt;br /&gt;
&lt;br /&gt;
    arduboy.clear();&lt;br /&gt;
    x++;&lt;br /&gt;
&lt;br /&gt;
    arduboy.print(x / 10);&lt;br /&gt;
    arduboy.display();&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
** That small modification will save us thousands of bytes!&lt;br /&gt;
* Use https://godbolt.org/z/8vhWqj8KE (pre-configured with correct settings) to see the assembly that the provided code will generate. You don&#039;t need to know assembly, the most important thing is if you see a function call to do an arithmetic operation, you may be able to avoid it. This is helpful to avoid division and mod, as discussed below.&lt;br /&gt;
* Use &amp;lt;code&amp;gt;arduboy.boot();&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;arduboy.safeMode();&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;arduboy.begin();&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;arduboy.systemButtons();&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;arduboy.waitNoButtons();&amp;lt;/code&amp;gt; can also be added for convenience (turning on and off sound at bootup). Note that this will get rid of the scrolling logo.&lt;br /&gt;
* Use &amp;lt;code&amp;gt;Arduboy2Base&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;Arduboy2&amp;lt;/code&amp;gt; if you don’t use text.&lt;br /&gt;
** You can also switch to [https://github.com/BotiKis/Arduboy-TinyFont TinyFont] or [https://github.com/filmote/Font3x5 Font3x5]/[https://github.com/filmote/Font4x6 Font4x6], which use less bytes.&lt;br /&gt;
* Use smaller integer sizes when possible. For example, instead of using &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;/ &amp;lt;code&amp;gt;int16_t&amp;lt;/code&amp;gt; for a screen position, you can use &amp;lt;code&amp;gt;int8_t&amp;lt;/code&amp;gt;. Because the [[What is the Arduboy|Arduboy]] has an 8-bit CPU, anything larger adds extra instructions/functions.&lt;br /&gt;
* Avoid using floats! The [[What is the Arduboy|Arduboy]] has no hardware floating point, so 5+KiB can be included to do it in software. [[Fixed point]] is much faster and smaller&lt;br /&gt;
* Avoid using division/mod whenever possible; the [[What is the Arduboy|Arduboy]] does not have hardware division, so code is included to do it in software. This not only increases PROGMEM, it slows your program down. Here are some alternatives to division/mod:&lt;br /&gt;
** Use powers of 2 when dividing/using mod; the compiler can optimize these into shifts/bitwise ands, which are very fast. For example, try to use &amp;lt;code&amp;gt;x /= 4;&amp;lt;/code&amp;gt; instead of of &amp;lt;code&amp;gt;x /= 3;&amp;lt;/code&amp;gt;This becomes especially important when you are working with a tile map: It&#039;s best to use tiles with powers of 2.&lt;br /&gt;
** Instead of using mod to wrap a number (unless you can do it with a power of 2), use an if statement. For example, instead of writing &amp;lt;code&amp;gt;x %= 3&amp;lt;/code&amp;gt;,  write  &amp;lt;code&amp;gt;if (x &amp;gt; 2) x = 0;&amp;lt;/code&amp;gt;.&lt;br /&gt;
* As a last resort, you can remove the USB stack by adding the &amp;lt;code&amp;gt;ARDUBOY_NO_USB&amp;lt;/code&amp;gt; macro in your code in global scope. This gains you an extra 3KiB of PROGMEM to use. &#039;&#039;&#039;Be aware of the fact that this makes it very hard to upload a new game onto a non-FX [[What is the Arduboy|Arduboy]], as the uploader cannot put it into bootloader mode.&#039;&#039;&#039; The &amp;lt;code&amp;gt;ARDUBOY_NO_USB&amp;lt;/code&amp;gt; macro helps by giving the option to put the [[What is the Arduboy|Arduboy]] back into bootloader mode when the down button is held as the [[What is the Arduboy|Arduboy]] is turned on. There also is a function in the Arduboy2 library called &amp;lt;code&amp;gt;[https://mlxxxp.github.io/documents/Arduino/libraries/Arduboy2/Doxygen/html/classArduboy2Core.html#adc24b0f64d1a1ead904a1bdbaf8a776b arduboy.exitToBootloader()]&amp;lt;/code&amp;gt;. [[What is the Arduboy#Arduboy FX|FX-enabled Arduboys]] do not have this problem as by holding up and down for multiple seconds or turning off and on again will put it into bootloader mode and allow uploads to continue. It is highly recommended when posting a game to tell others in bold letters: &amp;quot;This game removes the USB stack. [If FX is not required] Press down while turning on to go into bootloader mode.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Tips for Reducing RAM ==&lt;br /&gt;
&lt;br /&gt;
* Put PROGMEM on arrays/data that will not change. Note you will have to use &amp;lt;code&amp;gt;pgm_read_byte(&amp;amp;array[index])&amp;lt;/code&amp;gt; or some variant of it (see documentation [https://www.nongnu.org/avr-libc/user-manual/group__avr__pgmspace.html here]).&lt;br /&gt;
* Declare variables &amp;lt;code&amp;gt;constexpr&amp;lt;/code&amp;gt; if they do not change.&lt;br /&gt;
* Put string literals in PROGMEM by surrounding them with the &amp;lt;code&amp;gt;F(&amp;quot;string literal here&amp;quot;)&amp;lt;/code&amp;gt; macro. Pharap&#039;s [https://github.com/Pharap/FlashStringHelperDemo FlashStringHelper] library is very helpful when dealing with strings in PROGMEM.&lt;br /&gt;
* Use locals instead of globals when possible. Locals are stored on the stack and exist only in a scope, while globals are stored for the entire lifetime of the program.&lt;br /&gt;
* Pack variables into bits as much as possible. For example, instead of using an array of 8 bools, use 1 byte with each bit representing a bool. Reading and writing bits can be done with &amp;lt;code&amp;gt;bitRead(number, bit)&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bitWrite(number, bit, value)&amp;lt;/code&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Sublinear</name></author>
	</entry>
	<entry>
		<id>https://bloggingadeadhorse.com/arduboyWiki/index.php?title=Main_Page&amp;diff=443</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://bloggingadeadhorse.com/arduboyWiki/index.php?title=Main_Page&amp;diff=443"/>
		<updated>2024-07-09T23:09:09Z</updated>

		<summary type="html">&lt;p&gt;Sublinear: /* Tutorials */ Added link to Reducing PROGMEM and RAM Usage&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Getting started ==&lt;br /&gt;
&lt;br /&gt;
* [[What is the Arduboy|What is the Arduboy?]]&lt;br /&gt;
** [[What is the Arduboy#Arduboy Variants|Arduboy Variants]]&lt;br /&gt;
* [[Installing Games]]&lt;br /&gt;
* [[Developing Games]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Don&#039;t know where to start at all? See the official [https://www.arduboy.com/quick-start Quickstart guide] for a simplified overview. &lt;br /&gt;
&lt;br /&gt;
There is also a [https://community.arduboy.com/t/quick-start-guide/2790 Legacy Quickstart guide] that might be of some use (made for older Arduboy variants but still mostly relevant)&lt;br /&gt;
&lt;br /&gt;
== Community ==&lt;br /&gt;
&lt;br /&gt;
Come chat with the community and show off your games at https://community.arduboy.com/! The bulk of the Arduboy community exists on the forums; there isn&#039;t an official Discord/etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Main Arduboy website:&#039;&#039;&#039; https://www.arduboy.com/&lt;br /&gt;
* &#039;&#039;&#039;Community website:&#039;&#039;&#039; https://community.arduboy.com/&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
* [[Ardens]] - Debugger, profiler, and emulator&lt;br /&gt;
* [[Arduboy Toolset]] - Various tools for uploading, converting, etc&lt;br /&gt;
* [[Cart Builder]] - Home for the official flashcart + all games made available for it&lt;br /&gt;
* [[Arduboy-Python-Utilities]] - Command line python tools for uploading, converting, etc&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
* Misc.&lt;br /&gt;
** [[Reducing PROGMEM and RAM Usage]]&lt;br /&gt;
* State Machines&lt;br /&gt;
** [[State%20Machines|Introduction]]&lt;br /&gt;
** [[State Machines - Organising Variables|Organising Variables]]&lt;br /&gt;
* High Scores&lt;br /&gt;
** [[High Score - Getting Started|Getting Started]]&lt;br /&gt;
** [[High Score - High Scores and Slots|High Scores and Slots]]&lt;br /&gt;
** [[High Score - Capturing The Players Initials|Capturing The Players Initials]]&lt;br /&gt;
** [[High Score - Creating a New Entry in the Correct Location|Creating a New Entry in the Correct Location]]&lt;br /&gt;
** [[High Score - Writing it to the EEPROM|Writing it to the EEPROM]]&lt;br /&gt;
* Frogger&lt;br /&gt;
** [[Frogger Getting Started|Getting Started]]&lt;br /&gt;
** [[Frogger - Implementing the Cars|Implementing the Cars]]&lt;br /&gt;
** [[Frogger - Mixing up the Car Movements|Mixing up the Car Movements]]&lt;br /&gt;
** [[Frogger - Adding the Frog|Adding the Player&#039;s Frog]]&lt;br /&gt;
** [[Frogger - Collision Detection and Explosion Graphics|Collision Detection and Explosion Graphics]]&lt;br /&gt;
** [[Frogger - Adding Logs and Turtles|Adding Logs and Turtles]]&lt;br /&gt;
** [[Frogger - Turtle Submerge Logic|Turtle Submerge Logic]]&lt;br /&gt;
** [[Frogger - Adding Home Logic|Adding Home Logic]]&lt;br /&gt;
** [[Frogger - Adding Score Logic|Adding Score Logic]]&lt;br /&gt;
** [[Frogger - Adding a Title and Game Over Screen|Adding a Title and Game Over Screen]]&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [[Flashcart Format]]&lt;/div&gt;</summary>
		<author><name>Sublinear</name></author>
	</entry>
	<entry>
		<id>https://bloggingadeadhorse.com/arduboyWiki/index.php?title=Reducing_PROGMEM_and_RAM_Usage&amp;diff=442</id>
		<title>Reducing PROGMEM and RAM Usage</title>
		<link rel="alternate" type="text/html" href="https://bloggingadeadhorse.com/arduboyWiki/index.php?title=Reducing_PROGMEM_and_RAM_Usage&amp;diff=442"/>
		<updated>2024-07-09T23:00:46Z</updated>

		<summary type="html">&lt;p&gt;Sublinear: Added page for Reducing PROGMEM and RAM Usage.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
The [[What is the Arduboy|Arduboy]] only has 28KiB or 29KiB (FX) of PROGMEM and 2.5KiB of RAM. While making a game, these can run out very quickly. This page aims to help you recover some of your precious PROGMEM and RAM.&lt;br /&gt;
&lt;br /&gt;
== Tips for Reducing PROGMEM ==&lt;br /&gt;
&lt;br /&gt;
* Look through your code in [[Ardens]] for large functions that shouldn&#039;t be there. Here is a step-by-step example: (Note: this will only work with .elf files, .hex files don&#039;t provide enough information.)&lt;br /&gt;
** Launch Ardens and drag your .elf file on it.  &lt;br /&gt;
** Open the disassembly tab (Windows&amp;gt;Debugger&amp;gt;Disassembly)[[File:Open Disassembly Tab.png|thumb|206x206px|Opening the disassembly tab.]]&lt;br /&gt;
** Click on the &amp;quot;Jump to Function&amp;quot; dropdown.[[File:Example Function Dropdown in Ardens.png|thumb|269x269px|The example contents of the Jump to Function dropdown. Note the amount of floating-point functions present.]]&lt;br /&gt;
** Scan the dropdown for anything unexpected.&lt;br /&gt;
** In our example, there are a huge amount of float functions that are taking up a lot of space. &lt;br /&gt;
** How can we fix this? In our source code, we can change x from a float to a uint8_t:&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;Arduboy2.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arduboy2 arduboy;&lt;br /&gt;
&lt;br /&gt;
-- float x;&lt;br /&gt;
&lt;br /&gt;
++ uint8_t x;&lt;br /&gt;
&lt;br /&gt;
void setup() {&lt;br /&gt;
&lt;br /&gt;
    arduboy.begin();&lt;br /&gt;
&lt;br /&gt;
    arduboy.setFrameRate(10);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop() {&lt;br /&gt;
&lt;br /&gt;
    if (!arduboy.nextFrame())&lt;br /&gt;
&lt;br /&gt;
        return;&lt;br /&gt;
&lt;br /&gt;
    arduboy.clear();&lt;br /&gt;
&lt;br /&gt;
    x++;&lt;br /&gt;
&lt;br /&gt;
    arduboy.print(x / 10);&lt;br /&gt;
&lt;br /&gt;
    arduboy.display();&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
** That small modification will save us thousands of bytes!&lt;br /&gt;
* Use [https://godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(filename:&#039;1&#039;,fontScale:14,fontUsePx:&#039;0&#039;,j:1,lang:c%2B%2B,selection:(endColumn:2,endLineNumber:7,positionColumn:2,positionLineNumber:7,selectionStartColumn:2,selectionStartLineNumber:7,startColumn:2,startLineNumber:7),source:&#039;//+Type+your+code+here,+or+load+an+example.%0A%23include+%3Cstdint.h%3E%0A%0Auint8_t+div_thousand(uint32_t+x)+%7B%0A%0A++++return+x+/+1024%3B%0A%7D&#039;),l:&#039;5&#039;,n:&#039;1&#039;,o:&#039;C%2B%2B+source+%231&#039;,t:&#039;0&#039;)),k:50,l:&#039;4&#039;,n:&#039;0&#039;,o:&#039;&#039;,s:0,t:&#039;0&#039;),(g:!((h:compiler,i:(compiler:avrg1410,filters:(b:&#039;0&#039;,binary:&#039;1&#039;,binaryObject:&#039;1&#039;,commentOnly:&#039;0&#039;,debugCalls:&#039;1&#039;,demangle:&#039;0&#039;,directives:&#039;0&#039;,execute:&#039;1&#039;,intel:&#039;0&#039;,libraryCode:&#039;0&#039;,trim:&#039;1&#039;,verboseDemangling:&#039;0&#039;),flagsViewOpen:&#039;1&#039;,fontScale:14,fontUsePx:&#039;0&#039;,j:1,lang:c%2B%2B,libs:!(),options:&#039;-O2+-mmcu%3Datmega32u4&#039;,overrides:!(),selection:(endColumn:1,endLineNumber:1,positionColumn:1,positionLineNumber:1,selectionStartColumn:1,selectionStartLineNumber:1,startColumn:1,startLineNumber:1),source:1),l:&#039;5&#039;,n:&#039;0&#039;,o:&#039;+AVR+gcc+14.1.0+(Editor+%231)&#039;,t:&#039;0&#039;)),k:50,l:&#039;4&#039;,n:&#039;0&#039;,o:&#039;&#039;,s:0,t:&#039;0&#039;)),l:&#039;2&#039;,n:&#039;0&#039;,o:&#039;&#039;,t:&#039;0&#039;)),version:4 Godbolt] to see the assembly that the provided code will generate. You don&#039;t need to know assembly, the most important thing is if you see a function call to do an arithmetic operation, you may be able to avoid it. This is helpful to avoid division and mod, as discussed below.&lt;br /&gt;
* Use &amp;lt;code&amp;gt;arduboy.boot();&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;arduboy.safeMode();&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;arduboy.begin();&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;arduboy.systemButtons();&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;arduboy.waitNoButtons();&amp;lt;/code&amp;gt; can also be added for convenience (turning on and off sound at bootup). Note that this will get rid of the scrolling logo.&lt;br /&gt;
* Use &amp;lt;code&amp;gt;Arduboy2Base&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;Arduboy2&amp;lt;/code&amp;gt; if you don’t use text.&lt;br /&gt;
** You can also switch to [https://github.com/BotiKis/Arduboy-TinyFont TinyFont] or [https://github.com/filmote/Font3x5 Font3x5]/[https://github.com/filmote/Font4x6 Font4x6], which use less bytes.&lt;br /&gt;
* Use smaller integer sizes when possible. For example, instead of using &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;/ &amp;lt;code&amp;gt;int16_t&amp;lt;/code&amp;gt; for a screen position, you can use &amp;lt;code&amp;gt;int8_t&amp;lt;/code&amp;gt;. Because the [[What is the Arduboy|Arduboy]] has an 8-bit CPU, anything larger adds extra instructions/functions.&lt;br /&gt;
* Avoid using floats! The [[What is the Arduboy|Arduboy]] has no hardware floating point, so 5+KiB can be included to do it in software. [[Fixed point]] is much faster and smaller&lt;br /&gt;
* Avoid using division/mod whenever possible; the [[What is the Arduboy|Arduboy]] does not have hardware division, so code is included to do it in software. This not only increases PROGMEM, it slows your program down. Here are some alternatives to division/mod:&lt;br /&gt;
** Use powers of 2 when dividing/using mod; the compiler can optimize these into shifts/bitwise ands, which are very fast. For example, try to use &amp;lt;code&amp;gt;x /= 4;&amp;lt;/code&amp;gt; instead of of &amp;lt;code&amp;gt;x /= 3;&amp;lt;/code&amp;gt;This becomes especially important when you are working with a tile map: It&#039;s best to use tiles with powers of 2.&lt;br /&gt;
** Instead of using mod to wrap a number (unless you can do it with a power of 2), use an if statement. For example, instead of writing &amp;lt;code&amp;gt;x %= 3&amp;lt;/code&amp;gt;,  write  &amp;lt;code&amp;gt;if (x &amp;gt; 2) x = 0;&amp;lt;/code&amp;gt;.&lt;br /&gt;
* As a last resort, you can remove the USB stack by adding the &amp;lt;code&amp;gt;ARDUBOY_NO_USB&amp;lt;/code&amp;gt; macro in your code in global scope. This gains you an extra 3KiB of PROGMEM to use. &#039;&#039;&#039;Be aware of the fact that this makes it very hard to upload a new game onto a non-FX [[What is the Arduboy|Arduboy]], as the uploader cannot put it into bootloader mode.&#039;&#039;&#039; The &amp;lt;code&amp;gt;ARDUBOY_NO_USB&amp;lt;/code&amp;gt; macro helps by giving the option to put the [[What is the Arduboy|Arduboy]] back into bootloader mode when the down button is held as the [[What is the Arduboy|Arduboy]] is turned on. There also is a function in the Arduboy2 library called &amp;lt;code&amp;gt;[https://mlxxxp.github.io/documents/Arduino/libraries/Arduboy2/Doxygen/html/classArduboy2Core.html#adc24b0f64d1a1ead904a1bdbaf8a776b arduboy.exitToBootloader()]&amp;lt;/code&amp;gt;. [[What is the Arduboy#Arduboy FX|FX-enabled Arduboys]] do not have this problem as by holding up and down for multiple seconds or turning off and on again will put it into bootloader mode and allow uploads to continue. It is highly recommended when posting a game to tell others in bold letters: &amp;quot;This game removes the USB stack. [If FX is not required] Press down while turning on to go into bootloader mode.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Tips for Reducing RAM ==&lt;br /&gt;
&lt;br /&gt;
* Put PROGMEM on arrays/data that will not change. Note you will have to use &amp;lt;code&amp;gt;pgm_read_byte(&amp;amp;array[index])&amp;lt;/code&amp;gt; or some variant of it (see documentation [https://www.nongnu.org/avr-libc/user-manual/group__avr__pgmspace.html here]).&lt;br /&gt;
* Declare variables &amp;lt;code&amp;gt;constexpr&amp;lt;/code&amp;gt; if they do not change.&lt;br /&gt;
* Put string literals in PROGMEM by surrounding them with the &amp;lt;code&amp;gt;F(&amp;quot;string literal here&amp;quot;)&amp;lt;/code&amp;gt; macro. Pharap&#039;s [https://github.com/Pharap/FlashStringHelperDemo FlashStringHelper] library is very helpful when dealing with strings in PROGMEM.&lt;br /&gt;
* Use locals instead of globals when possible. Locals are stored on the stack and exist only in a scope, while globals are stored for the entire lifetime of the program.&lt;br /&gt;
* Pack variables into bits as much as possible. For example, instead of using an array of 8 bools, use 1 byte with each bit representing a bool. Reading and writing bits can be done with &amp;lt;code&amp;gt;bitRead(number, bit)&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bitWrite(number, bit, value)&amp;lt;/code&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Sublinear</name></author>
	</entry>
	<entry>
		<id>https://bloggingadeadhorse.com/arduboyWiki/index.php?title=File:Example_Function_Dropdown_in_Ardens.png&amp;diff=441</id>
		<title>File:Example Function Dropdown in Ardens.png</title>
		<link rel="alternate" type="text/html" href="https://bloggingadeadhorse.com/arduboyWiki/index.php?title=File:Example_Function_Dropdown_in_Ardens.png&amp;diff=441"/>
		<updated>2024-07-09T21:59:13Z</updated>

		<summary type="html">&lt;p&gt;Sublinear: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This shows the contents of the Jump to Function dropdown in Ardens.&lt;/div&gt;</summary>
		<author><name>Sublinear</name></author>
	</entry>
	<entry>
		<id>https://bloggingadeadhorse.com/arduboyWiki/index.php?title=File:Open_Disassembly_Tab.png&amp;diff=440</id>
		<title>File:Open Disassembly Tab.png</title>
		<link rel="alternate" type="text/html" href="https://bloggingadeadhorse.com/arduboyWiki/index.php?title=File:Open_Disassembly_Tab.png&amp;diff=440"/>
		<updated>2024-07-09T21:53:22Z</updated>

		<summary type="html">&lt;p&gt;Sublinear: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A screenshot of how to open the disassembly tab in Ardens.&lt;/div&gt;</summary>
		<author><name>Sublinear</name></author>
	</entry>
</feed>