├── .gitignore ├── BurnEEPROM_ATtiny85 ├── BurnEEPROM_ATtiny85.ino ├── mario_theme.h └── music_notes.h ├── EAGLE files ├── ATtinyMario schematic_fullboard.brd ├── ATtinyMario schematic_fullboard.sch └── folder.md ├── LICENSE ├── README.md ├── TinyMario.atsln └── TinyMario ├── Debug └── TinyMario.hex ├── TinyMario.componentinfo.xml ├── TinyMario.cproj ├── bricks.h ├── font.h ├── font_digits.h ├── main.c ├── mario.h ├── mario_tiles.h ├── oled_lib.c └── oled_lib.h /.gitignore: -------------------------------------------------------------------------------- 1 | debug.log 2 | -------------------------------------------------------------------------------- /BurnEEPROM_ATtiny85/BurnEEPROM_ATtiny85.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include "music_notes.h" 3 | #include "mario_theme.h" 4 | 5 | struct melody{ 6 | uint16_t* melody; //+ 0 7 | uint8_t* noteDurations; // +2 8 | uint8_t numNotes; // +3 9 | uint8_t progmem; // + 4 10 | }; 11 | 12 | struct music_table{ 13 | uint16_t startpos; 14 | uint8_t len; 15 | }; 16 | 17 | #define NUM_ENTRIES 10 18 | 19 | struct music_table music_entries[NUM_ENTRIES]; 20 | 21 | const struct melody theme_music[]={{Melody_Intro, NoteDurations_Intro, sizeof(Melody_Intro)>>1,1}, // 0 22 | {Melody_Refrain, NoteDurations_Refrain, sizeof(Melody_Refrain)>>1,1}, // 1 23 | {Melody_Part2_1, NoteDurations_Part2_1, sizeof(Melody_Part2_1)>>1,0}, // 2 24 | {Melody_Part2_2, NoteDurations_Part2_2, sizeof(Melody_Part2_2)>>1,0}, // 3 25 | {Melody_Part2_3, NoteDurations_Part2_3, sizeof(Melody_Part2_3)>>1,0}, // 4 26 | {Melody_Part3_1, NoteDurations_Part3_1, sizeof(Melody_Part3_1)>>1,1}, // 5 27 | {CoinSound, CoinSound_Durations,sizeof(CoinSound)>>1,0}, // 6 - Coin sound effect 28 | {JumpSound, JumpSound_Durations,sizeof(JumpSound)>>1,1},// 7 - Jump sound effect 29 | {HitHeadSound, HitHead_Durations,sizeof(HitHeadSound)>>1,1},// 8 - Hit head sound effect 30 | {PauseSound, PauseSound_Durations,sizeof(PauseSound)>>1,0}// 9 - Pause sound effect 31 | }; 32 | 33 | uint8_t *pos; 34 | uint8_t buffer_P[100]; 35 | 36 | // Play back variables: 37 | struct toneController{ 38 | uint8_t music_index=0, music_pos=0, music_note=0,noteordelay=0; 39 | uint16_t current_delay=0; 40 | uint8_t soundeffect; // 0 = Music, 1=Sound effect (affects play priority and loop behaviour) 41 | }; 42 | 43 | struct toneController MusicController; 44 | 45 | const uint8_t music_seq[] ={0,1,1,2,3,2,4,2,3,2,4,5}; // 12 elements: 0-11. Go back to position 1 on overflow. 46 | 47 | #define SPEAKER 4//3 //4 // Can use hardware Timer1 OC1B 48 | 49 | extern volatile uint8_t *tone_timer_pin_register; 50 | extern volatile long tone_timer_toggle_count; 51 | uint8_t dummy_register; 52 | 53 | ///////////////////////////////////////////// end playback variables 54 | 55 | 56 | void setup() { 57 | // put your setup code here, to run once: 58 | burnEEPROM(); 59 | DDRB|=(1<music_pos=0; // First position in music sequence, i.e. 0,1,2,3 etc ) 68 | controller->music_index = music_seq[controller->music_pos];//pgm_read_byte(&music_seq[0]+music_pos); // melody 0 (=intro 69 | controller->music_note = 0; // First note of music_index melody 70 | controller->noteordelay=1; //simulate end of a delay to start the note 71 | } 72 | 73 | uint8_t* burnmusic(uint8_t entry) 74 | { 75 | uint16_t *melody; 76 | uint8_t *noteDurations; 77 | uint8_t progmem, len; 78 | 79 | uint8_t duration,power; 80 | 81 | // Extract the good stuff 82 | melody = theme_music[entry].melody; 83 | noteDurations = theme_music[entry].noteDurations; 84 | progmem = theme_music[entry].progmem; 85 | len = theme_music[entry].numNotes; 86 | 87 | // Sort the table entry out 88 | music_entries[entry].len = len; 89 | music_entries[entry].startpos = pos; 90 | eeprom_write_block(&music_entries[entry],entry*sizeof(music_table),sizeof(music_table)); 91 | 92 | // Write notes in next pos 93 | if (progmem) 94 | { 95 | memcpy_P(&buffer_P[0],melody,len*2); 96 | } 97 | else 98 | { 99 | memcpy(&buffer_P[0], melody,len*2); 100 | } 101 | 102 | // melody in buffer_P 103 | 104 | for (uint8_t i=0;isoundeffect==0 && tone_timer_toggle_count==0)) 165 | { 166 | if (controller->noteordelay==0) // 0 = NOTE just ended, therefore now delay 167 | { 168 | // Note ended, start a delay 169 | controller->current_delay = (controller->current_delay * 0.30f); 170 | 171 | if (controller->soundeffect==0) // Music 172 | { 173 | tone(SPEAKER, 100, controller->current_delay); // do a low tone instead of using millis and switch off the pin! 174 | 175 | tone_timer_pin_register = &dummy_register; // don't do software toggle of the pin :) 176 | PORTB&=~(1<music_note++; 181 | entry_pos = controller->music_index*sizeof(music_table); 182 | entry_pos+=2; 183 | numNotes = eeprom_read_byte(entry_pos); // next position is numNotes 184 | 185 | if (controller->music_note>=numNotes) //theme_music[controller->music_index].numNotes) // exceeded notes in this melody part 186 | { 187 | controller->music_note=0; 188 | controller->music_pos++; // advance sequence position 189 | 190 | if (controller->soundeffect==0 && controller->music_pos>=12) // In music handler, and sequence has overflowed. 191 | { 192 | controller->music_pos=1; // We are in the music handler 193 | } 194 | controller->music_index = music_seq[controller->music_pos];//pgm_read_byte(&music_seq[0]+music_pos); 195 | 196 | } 197 | controller->noteordelay=1; //delay is next 198 | } // end note ended 199 | else if (controller->noteordelay==1) // 1 = DELAY 200 | { 201 | // Delay ended, play next note 202 | 203 | entry_pos = controller->music_index*sizeof(music_table); 204 | melody = eeprom_read_word((uint16_t*)entry_pos); // EEPROM position in entry table 205 | entry_pos+=2; 206 | numNotes = eeprom_read_byte(entry_pos); // next position is numNotes 207 | //noteDurations = (uint8_t*)(melody +(numNotes));//melody + (uint16_t)numNotes; // noteDurations follows the melody in EEPROM 208 | 209 | uint16_t ms=1000,freq; 210 | 211 | freq = eeprom_read_word(melody+controller->music_note); 212 | 213 | uint8_t note; 214 | note = freq >> 13;// Extract 2,4,8,16th,32nd note etc from freq 215 | // 2 = 1, 4 = 2, 8 = 3, etc. 216 | freq &= 0x1FFF; 217 | 218 | controller->current_delay = ms>>note; // shift rather than divide. 219 | 220 | //entry_pos = noteDurations+controller->music_note; 221 | //controller->current_delay = (ms / (uint16_t) eeprom_read_byte(noteDurations+controller->music_note)); 222 | 223 | if (controller->soundeffect==0) // Music 224 | { 225 | tone(SPEAKER, freq, controller->current_delay); 226 | } 227 | 228 | controller->noteordelay=0; 229 | }// end delay ended 230 | } // wnd time delay lapsed 231 | } 232 | -------------------------------------------------------------------------------- /BurnEEPROM_ATtiny85/mario_theme.h: -------------------------------------------------------------------------------- 1 | // https://github.com/mikemalburg/arduino_annoyotrons_piezo/blob/master/annoy_piezo_mario_overworld/annoy_piezo_mario_overworld.ino 2 | 3 | static const uint16_t CoinSound[] = 4 | { 5 | NOTE_B5, NOTE_E6 6 | }; 7 | 8 | static const uint8_t CoinSound_Durations[] = 9 | { 10 | 8,4 11 | }; 12 | 13 | static const uint16_t PauseSound[] = 14 | { 15 | NOTE_E6, NOTE_C6,NOTE_E6, NOTE_C6 16 | }; 17 | 18 | static const uint8_t PauseSound_Durations[] = 19 | { 20 | 16,16,16,16 21 | }; 22 | 23 | /* 24 | static const uint16_t JumpSound[] PROGMEM = 25 | { 26 | NOTE_GS4, NOTE_GS3, NOTE_A3, NOTE_AS3, NOTE_B3, NOTE_C4, NOTE_CS4,NOTE_D4, NOTE_DS4, NOTE_E4, NOTE_F4, NOTE_FS4, NOTE_G4, NOTE_GS4 27 | }; 28 | 29 | static const uint8_t JumpSound_Durations[] PROGMEM= 30 | { 31 | 128,32,128,128,128,128,128,128,128,128,128,128,128,128 32 | };*/ 33 | 34 | static const uint16_t HitHeadSound[] PROGMEM= 35 | { 36 | NOTE_C3 37 | }; 38 | 39 | static const uint8_t HitHead_Durations[] PROGMEM= 40 | { 41 | 16 42 | }; 43 | 44 | static const uint16_t JumpSound[] PROGMEM = 45 | { 46 | NOTE_C6, NOTE_G6, NOTE_C7 47 | }; 48 | 49 | static const uint8_t JumpSound_Durations[] PROGMEM= 50 | { 51 | 32,32,32 52 | }; 53 | 54 | static const uint16_t Melody_Intro[]PROGMEM = 55 | { 56 | NOTE_E4, NOTE_E4, 0, NOTE_E4, 57 | 0, NOTE_C4, NOTE_E4, 0, 58 | NOTE_G4, 0, 0, 59 | NOTE_G3, 0, 0, 60 | 61 | }; 62 | static const uint8_t NoteDurations_Intro[] PROGMEM= 63 | { 64 | 8, 8, 8, 8, 65 | 8, 8, 8, 8, 66 | 8, 4, 8, 67 | 8, 4, 8, 68 | }; 69 | 70 | static const uint16_t Melody_Refrain[] PROGMEM= 71 | { 72 | // Refrain 73 | NOTE_C4, 0, NOTE_G3, 74 | 0, NOTE_E3, 0, 75 | NOTE_A3, 0, NOTE_B3, 76 | 0, NOTE_AS3, NOTE_A3, 0, 77 | 78 | NOTE_G3, NOTE_E4, NOTE_G4, 79 | NOTE_A4, 0, NOTE_F4, NOTE_G4, 80 | 0, NOTE_E4, 0, NOTE_C4, 81 | NOTE_D4, NOTE_B3, 0 82 | }; 83 | 84 | static const uint8_t NoteDurations_Refrain[] PROGMEM = 85 | { 86 | 8, 4, 8, 87 | 4, 8, 4, 88 | 8, 8, 8, 89 | 8, 8, 8, 8, 90 | 91 | 4, 4, 4, 92 | 8, 8, 8, 8, 93 | 8, 8, 8, 8, 94 | 8, 8, 4 95 | }; 96 | 97 | // Pages: 2 - 3 98 | static const uint16_t Melody_Part2_1[] = 99 | { 100 | 0, NOTE_G4, NOTE_FS4, 101 | NOTE_F4, NOTE_DS4, 0, NOTE_E4, 102 | 0, NOTE_GS3, NOTE_A4, NOTE_C4, 103 | 0, NOTE_A4, NOTE_C4, NOTE_D4, 104 | }; 105 | static const uint8_t NoteDurations_Part2_1[] = 106 | { 107 | 4, 8, 8, 108 | 8, 8, 8, 8, 109 | 8, 8, 8, 8, 110 | 8, 8, 8, 8, 111 | }; 112 | 113 | static const uint16_t Melody_Part2_2[] = 114 | { 115 | 0, NOTE_G4, NOTE_FS4, 116 | NOTE_F4, NOTE_DS4, 0, NOTE_E4, 117 | 0, NOTE_C5, 0, NOTE_C5, 118 | NOTE_C5, 0, 0, 119 | 120 | }; 121 | static const uint8_t NoteDurations_Part2_2[] = 122 | { 123 | 4, 8, 8, 124 | 8, 8, 8, 8, 125 | 8, 8, 8, 8, 126 | 8, 8, 4 127 | }; 128 | 129 | static const uint16_t Melody_Part2_3 [] = 130 | { 131 | 0, NOTE_DS4, 0, 132 | 0, NOTE_D4, 0, 133 | NOTE_C4, 0, 0, 134 | 0 135 | }; 136 | static const uint8_t NoteDurations_Part2_3 [] = 137 | { 138 | 4, 8, 8, 139 | 8, 8, 4, 140 | 8, 8, 4, 141 | 2 142 | }; 143 | 144 | // Page 4 145 | static const uint16_t Melody_Part3_1[] PROGMEM= 146 | { 147 | NOTE_C4, NOTE_C4, 0, NOTE_C4, 148 | 0, NOTE_C4, NOTE_D4, 0, 149 | NOTE_E4, NOTE_C4, 0, NOTE_A4, 150 | NOTE_G3, 0, 0, 151 | 152 | NOTE_C4, NOTE_C4, 0, NOTE_C4, 153 | 0, NOTE_C4, NOTE_D4, NOTE_E4, 154 | 0, 155 | 156 | NOTE_C4, NOTE_C4, 0, NOTE_C4, 157 | 0, NOTE_C4, NOTE_D4, 0, 158 | NOTE_E4, NOTE_C4, 0, NOTE_A4, 159 | NOTE_G4, 0, 0, 160 | NOTE_E4, NOTE_E4, 0, NOTE_E4, 161 | 0, NOTE_C4, NOTE_E4, 0, 162 | NOTE_G4, 0, 0, 163 | NOTE_G3, 0, 0, 164 | 165 | }; 166 | static const uint8_t NoteDurations_Part3_1[] PROGMEM= 167 | { 168 | 8, 8, 8, 8, 169 | 8, 8, 8, 8, 170 | 8, 8, 8, 8, 171 | 8, 8, 4, 172 | 173 | 8, 8, 8, 8, 174 | 8, 8, 8, 8, 175 | 2, 176 | 177 | 8, 8, 8, 8, 178 | 8, 8, 8, 8, 179 | 8, 8, 8, 8, 180 | 8, 8, 4, 181 | 8, 8, 8, 8, 182 | 8, 8, 8, 8, 183 | 8, 8, 4, 184 | 8, 8, 4, 185 | 186 | 187 | }; 188 | -------------------------------------------------------------------------------- /BurnEEPROM_ATtiny85/music_notes.h: -------------------------------------------------------------------------------- 1 | // Available Notes 2 | #define NOTE_B0 31 3 | #define NOTE_C1 33 4 | #define NOTE_CS1 35 5 | #define NOTE_D1 37 6 | #define NOTE_DS1 39 7 | #define NOTE_E1 41 8 | #define NOTE_F1 44 9 | #define NOTE_FS1 46 10 | #define NOTE_G1 49 11 | #define NOTE_GS1 52 12 | #define NOTE_A1 55 13 | #define NOTE_AS1 58 14 | #define NOTE_B1 62 15 | #define NOTE_C2 65 16 | #define NOTE_CS2 69 17 | #define NOTE_D2 73 18 | #define NOTE_DS2 78 19 | #define NOTE_E2 82 20 | #define NOTE_F2 87 21 | #define NOTE_FS2 93 22 | #define NOTE_G2 98 23 | #define NOTE_GS2 104 24 | #define NOTE_A2 110 25 | #define NOTE_AS2 117 26 | #define NOTE_B2 123 27 | #define NOTE_C3 131 28 | #define NOTE_CS3 139 29 | #define NOTE_D3 147 30 | #define NOTE_DS3 156 31 | #define NOTE_E3 165 32 | #define NOTE_F3 175 33 | #define NOTE_FS3 185 34 | #define NOTE_G3 196 35 | #define NOTE_GS3 208 36 | #define NOTE_A3 220 37 | #define NOTE_AS3 233 38 | #define NOTE_B3 247 39 | #define NOTE_C4 262 40 | #define NOTE_CS4 277 41 | #define NOTE_D4 294 42 | #define NOTE_DS4 311 43 | #define NOTE_E4 330 44 | #define NOTE_F4 349 45 | #define NOTE_FS4 370 46 | #define NOTE_G4 392 47 | #define NOTE_GS4 415 48 | #define NOTE_A4 440 49 | #define NOTE_AS4 466 50 | #define NOTE_B4 494 51 | #define NOTE_C5 523 52 | #define NOTE_CS5 554 53 | #define NOTE_D5 587 54 | #define NOTE_DS5 622 55 | #define NOTE_E5 659 56 | #define NOTE_F5 698 57 | #define NOTE_FS5 740 58 | #define NOTE_G5 784 59 | #define NOTE_GS5 831 60 | #define NOTE_A5 880 61 | #define NOTE_AS5 932 62 | #define NOTE_B5 988 63 | #define NOTE_C6 1047 64 | #define NOTE_CS6 1109 65 | #define NOTE_D6 1175 66 | #define NOTE_DS6 1245 67 | #define NOTE_E6 1319 68 | #define NOTE_F6 1397 69 | #define NOTE_FS6 1480 70 | #define NOTE_G6 1568 71 | #define NOTE_GS6 1661 72 | #define NOTE_A6 1760 73 | #define NOTE_AS6 1865 74 | #define NOTE_B6 1976 75 | #define NOTE_C7 2093 76 | #define NOTE_CS7 2217 77 | #define NOTE_D7 2349 78 | #define NOTE_DS7 2489 79 | #define NOTE_E7 2637 80 | #define NOTE_F7 2794 81 | #define NOTE_FS7 2960 82 | #define NOTE_G7 3136 83 | #define NOTE_GS7 3322 84 | #define NOTE_A7 3520 85 | #define NOTE_AS7 3729 86 | #define NOTE_B7 3951 87 | #define NOTE_C8 4186 88 | #define NOTE_CS8 4435 89 | #define NOTE_D8 4699 90 | #define NOTE_DS8 4978 91 | -------------------------------------------------------------------------------- /EAGLE files/ATtinyMario schematic_fullboard.brd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | AUDIO 159 | GND 160 | Vcc 161 | Vcc 162 | Vcc 163 | GND 164 | GND 165 | SDA 166 | SCL 167 | Vcc 168 | GND 169 | SCL 170 | SDA 171 | 172 | 173 | 174 | <h3>ATMEL ATtiny 25 / 45 /48</h3> 175 | <p><br /><b><u>Supplied Packages:</u></b><br /> 176 | <b>P</b> &nbsp; = PDIP 08 30mil<br /> 177 | <b>S</b> &nbsp; = SOIC 08 EIAJ 208mil<br /> 178 | <b>SS</b> = SOIC 08 JEDEC 150mil<br /> 179 | <b>X</b>> &nbsp; = TSSOP 08 4.4mm</p> 180 | 181 | <p><u><b>Revisions / Changelog</b></u><br /> 182 | &bull; &nbsp;5.0.0 [EAGLE 5]<br /> 183 | </p> 184 | 185 | <hr /> 186 | 187 | <author> 188 | <p><u>Author:</u><br /> 189 | Dipl.-Ing. FH Rainer Bayer<br /> 190 | HHN Hochschule Heilbronn (Heilbronn University), <i>rainer.bayer@hs-heilbronn.de</i><br /> 191 | Ingenieurbüro ing-rb, <i>mail@ing-rb.de</i></p></author> 192 | 193 | 194 | <b>DIL08 300mil</b> 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | >NAME 214 | >VALUE 215 | 216 | 217 | 218 | 219 | 220 | 221 | <b>PIN HEADER</b> 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | >NAME 232 | >VALUE 233 | 234 | 235 | 236 | 237 | >NAME 238 | >VALUE 239 | 240 | 241 | <b>TO-92</b><p> 242 | grid 5.08 mm 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | >NAME 258 | >VALUE 259 | 260 | 261 | 262 | 263 | <h3>SparkFun Resistors</h3> 264 | This library contains resistors. Reference designator:R. 265 | <br> 266 | <br> 267 | We've spent an enormous amount of time creating and checking these footprints and parts, but it is <b> the end user's responsibility</b> to ensure correctness and suitablity for a given componet or application. 268 | <br> 269 | <br>If you enjoy using this library, please buy one of our products at <a href=" www.sparkfun.com">SparkFun.com</a>. 270 | <br> 271 | <br> 272 | <b>Licensing:</b> Creative Commons ShareAlike 4.0 International - https://creativecommons.org/licenses/by-sa/4.0/ 273 | <br> 274 | <br> 275 | You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage. 276 | 277 | 278 | <h3>AXIAL-0.3</h3> 279 | <p>Commonly used for 1/4W through-hole resistors. 0.3" pitch between holes.</p> 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | >Name 291 | >Value 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | <b>EAGLE Design Rules</b> 348 | <p> 349 | Die Standard-Design-Rules sind so gewählt, dass sie für 350 | die meisten Anwendungen passen. Sollte ihre Platine 351 | besondere Anforderungen haben, treffen Sie die erforderlichen 352 | Einstellungen hier und speichern die Design Rules unter 353 | einem neuen Namen ab. 354 | <b>EAGLE Design Rules</b> 355 | <p> 356 | The default Design Rules have been set to cover 357 | a wide range of applications. Your particular design 358 | may have different requirements, so please make the 359 | necessary adjustments and save your customized 360 | design rules under a new name. 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 | 984 | 985 | 986 | 987 | 988 | 989 | 990 | 991 | 992 | 993 | -------------------------------------------------------------------------------- /EAGLE files/folder.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ATtiny85Mario 2 | 3 | ![ATtiny85 Mario](https://1.bp.blogspot.com/-czGPkAP6zps/XhzPi6E_isI/AAAAAAAAA2w/S9NqXxgfAWMCNwzo1DuLqfwZ18h-fWzTQCLcBGAsYHQ/s1600/Mario_ATtiny85.jpg) 4 | 5 | Read about the software and hardware of ATtiny85Mario here: 6 | https://shepherdingelectrons.blogspot.com/2020/01/tinymario.html 7 | 8 | and the construction of a handset to play ATtiny85Mario in: 9 | 10 | https://shepherdingelectrons.blogspot.com/2020/03/attiny-mario-handset.html 11 | 12 | ![mario animation](https://1.bp.blogspot.com/-wQc9w1t_zNc/Xm0aSpYDvUI/AAAAAAAAA5U/FX9NpMwJBkk7XVnXdGtJghxoaZgVtxxPwCLcBGAsYHQ/s1600/mario_gif2.gif) 13 | 14 | Mario-style game with sound effects and music on twin OLED displays driven by ATtiny85 AVR. Having fun with the multiple challenges of working with small system constraints! :-) 15 | 16 | 17 | 18 | **TinyMario** 19 | Source code for Mario. For music and sound effects to work, the EEPROM must be correctly burned first (see BurnEEPROM_ATtiny85 sketch) 20 | 21 | - OLED code is derived from bitbang2's super fast code: 22 | https://github.com/bitbank2/oled_turbo 23 | - Mario theme music is taken from Mike Marburg's transcription of the score: 24 | https://github.com/mikemalburg/arduino_annoyotrons_piezo/tree/master/annoy_piezo_mario_overworld 25 | - Mario animation pixel art: 26 | https://www.hackster.io/138689/pixel-art-on-oled-display-7f8697 27 | 28 | **BurnEEPROM_ATtiny85** 29 | 30 | Arduino sketch to compress the music and sound effects, then burn to ATTiny85 EEPROM 31 | -------------------------------------------------------------------------------- /TinyMario.atsln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Atmel Studio Solution File, Format Version 11.00 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "TinyMario", "TinyMario\TinyMario.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E6511B9C-4046-4F8F-9D33-89EAF0169AEA}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|AVR = Debug|AVR 13 | Release|AVR = Release|AVR 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR 17 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR 18 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR 19 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR 20 | EndGlobalSection 21 | GlobalSection(SolutionProperties) = preSolution 22 | HideSolutionNode = FALSE 23 | EndGlobalSection 24 | EndGlobal 25 | -------------------------------------------------------------------------------- /TinyMario/Debug/TinyMario.hex: -------------------------------------------------------------------------------- 1 | :100000008EC0A8C0A7C0A6C0A5C0A4C0A3C0A2C0DF 2 | :10001000A1C070C4E1C49EC09DC09CC09BC0777746 3 | :1000200077777767570700000000FF0000000000A7 4 | :100030007ECFFF7E00003C7EE7FFFFFF7E3C7776B1 5 | :1000400075707767570700183C66663C1800589C27 6 | :100050003C3E3E137FB7B77F533E9E5C1C188063C7 7 | :10006000E097F00FE80FEC1F1E17BF3B3FDA3FDAB7 8 | :10007000BF7B1E37EC1FE897F067E00780030000A6 9 | :100080000000E038E0312033202D607D307CB06C02 10 | :10009000F0FC60FCC07D806D00C800000000000026 11 | :1000A0000000000C200C201960BD30F8B0FCF03CC2 12 | :1000B000607CC07D806100C0000000000000000086 13 | :1000C00000000000000010009058B07418FE58F0B6 14 | :1000D00078FE30F0E03EC01C000000000000000090 15 | :1000E0000000000C107C906CB06C187E583E78308C 16 | :1000F00030BEE0FEC0FE006C000C000000000000FE 17 | :1001000000000000003020B820FD60E1303CB03C31 18 | :10011000F0E060FCC0BD8039000000000000112448 19 | :100120001FBECFE5D2E0DEBFCDBF10E0A0E6B0E05D 20 | :10013000EEEEFCE102C005900D92A23CB107D9F7AA 21 | :1001400021E0A2ECB0E001C01D92A33AB207E1F7B2 22 | :1001500059DACBCD55CFCF93C82F2DE036E649E104 23 | :1001600050E06091C7007091C8008091C9009091E3 24 | :10017000CA0033DDDC01CB01815A9C40A149B34C5C 25 | :10018000BC01CD01882799276093C7007093C800F0 26 | :100190008093C9009093CA002C2F30E040E050E0DB 27 | :1001A00055DD862FCF91089590E120E030E08770F3 28 | :1001B00067E8379887B966B9369A3699FECF44B161 29 | :1001C00055B1240F351F9150A1F7C90124E0969530 30 | :1001D00087952A95E1F708952F923F924F925F926B 31 | :1001E0006F927F928F929F92AF92BF92CF92DF9247 32 | :1001F000EF92FF920F931F93CF93DF93CDB7DEB7AC 33 | :1002000067970FB6F894DEBF0FBECDBF6C015B01E0 34 | :10021000F42E3801803891050CF091C0842F90E0C5 35 | :1002200044275527481B590B4C155D050CF087C01A 36 | :10023000603471050CF083C0D7FE06C05C2D51956B 37 | :10024000598BC12CD12C01C0198AA601480F591F06 38 | :10025000413851051CF030E8F32EFC18B7FE0DC0F4 39 | :10026000B194A194B10853E0B594A7945A95E1F7DD 40 | :1002700011E01A0DA12CB12C01C010E0822E869441 41 | :1002800086948694A501420F511D413451054CF0CE 42 | :10029000950143E0359527954A95E1F708E0021B63 43 | :1002A00001C0082D212F30E03B8B2A8B3989232E6A 44 | :1002B000312C912CAC01415051095D8B4C8B8F2D11 45 | :1002C00090E09C01221933093F8B2E8B1017B8F553 46 | :1002D000412E512CB2014A895B89641B750B83E066 47 | :1002E000660F771F8A95E1F76A0D7B1DC601E0DB7B 48 | :1002F00049894F15E8F4242F30E0E11002C0C9010C 49 | :1003000004C08C899D89821B930BB40155DC840D3C 50 | :10031000951DF301E80FF91FE49122193309A1E0BB 51 | :10032000B0E0AC0FBD1FA20FB31FEC934F5FE1CF46 52 | :100330006E897F89CE010196D4DB1F5FC7CF679698 53 | :100340000FB6F894DEBF0FBECDBFDF91CF911F91E6 54 | :100350000F91FF90EF90DF90CF90BF90AF909F9064 55 | :100360008F907F906F905F904F903F902F90089567 56 | :10037000282F30E0C90166E170E01EDCFC01E95A7B 57 | :10038000FE4F83E0848781E1818B17868081918194 58 | :1003900001969183808308959C018091630184304C 59 | :1003A00059F080917901843051F080918F0184302F 60 | :1003B000E1F482E090E005C080E090E002C081E0DE 61 | :1003C00090E066E170E0F8DBFC01E95AFE4F83E063 62 | :1003D000220F331F8A95E1F7318320831382128223 63 | :1003E00081E08787108A118A148608956F927F9220 64 | :1003F0008F929F92AF92BF92CF92DF92EF92FF9235 65 | :100400000F931F93CF93DF938C01C82FCF7383E09B 66 | :10041000A2DE25E0922E980E8C2E712CEC2EF12C63 67 | :100420008FE0E80EF11C66246394CC24C394D12C95 68 | :10043000580188E0A80EB11CC82DD0E0EC16FD06CE 69 | :100440000CF443C0C650DF4F188285E084DE811172 70 | :1004500001C06882711036C0892D883058F4960129 71 | :10046000082E01C0220F0A94EAF79881292B2883CD 72 | :100470008F5FF3CF8AE06FDE811109C084E06BDE0D 73 | :1004800001151105C1F092E0792E780E14C085E0B7 74 | :1004900062DE811110C00115110569F082E05BDE9A 75 | :1004A000811105C086E0891528F0939404C081E08D 76 | :1004B000891508F49A9480E14EDE811104C0C501CB 77 | :1004C0006BDF01C07A948394B7CFDF91CF911F91F6 78 | :1004D0000F91FF90EF90DF90CF90BF90AF909F90E3 79 | :1004E0008F907F906F900895CF9340E050E060E050 80 | :1004F00070E08CE354DA80E01DDB40E050E060E027 81 | :1005000070E08DE34CDA80E015DBE1E4F1E023E01C 82 | :10051000248B82E0858BA7E5B1E054962C93549709 83 | :1005200055968C93559794E01C969C931C979A969D 84 | :100530002C939A979B968C939B9792969C939297C9 85 | :100540002093970180939801D8969C9325E030E002 86 | :100550003183208313821282148685871786108A3E 87 | :10056000118AC1E0C687C38BE4EEF0E0C48BC58B73 88 | :100570009487BC9AB99A80E090E038DF80E190E0FF 89 | :1005800035DF80E290E032DF80E390E02FDF88E12A 90 | :1005900090E09093A2018093A101EAE3F1E016823A 91 | :1005A000C093A0011092E300118210821282C383D3 92 | :1005B0001ABC19BE10BE1CBC18BECF9108959091F4 93 | :1005C000E300911111C01092CD001092CE00109254 94 | :1005D000CF001092D00010929B0180939A0181E08D 95 | :1005E00080939D018093E30008954F925F926F92F4 96 | :1005F0007F928F929F92AF92BF92CF92DF92EF92B3 97 | :10060000FF920F93CF93DF936B017C0149015A0155 98 | :10061000672B682B692B41F4D0E0CCE2CC2EDD2493 99 | :10062000D394E12CF12C01C0D1E060E074E284EFBE 100 | :1006300090E0A7019601220F331F441F551F06DBD0 101 | :10064000002311F0C1E03DC0213081E038074105B1 102 | :100650005105F0F1A3E05695479537952795AA9552 103 | :10066000D1F7213081E038074105510598F1F3E0D9 104 | :100670005695479537952795FA95D1F7213081E022 105 | :1006800038074105510540F1E2E056954795379509 106 | :100690002795EA95D1F7213081E0380741055105CA 107 | :1006A000E8F072E056954795379527957A95D1F7FA 108 | :1006B000C5E015C0CF3099F0CF5F56954795379577 109 | :1006C00027952F3F31054105510509F098F707C0DF 110 | :1006D000C1E005C0C2E003C0C3E001C0C4E029011D 111 | :1006E0003A0181E0481A510861087108C501B40156 112 | :1006F000660F771F881F991FA7019601011113C06C 113 | :100700006CDA28EE33E040E050E0A0DA2093CD0030 114 | :100710003093CE004093CF005093D000DD2329F1D9 115 | :1007200082E18ABD29C059DA28EE33E040E050E08A 116 | :100730008DDA2093D1003093D2004093D3005093B0 117 | :10074000D40060E271EA87E090E0A70196017EDACA 118 | :100750002093D5003093D6004093D7005093D80013 119 | :10076000DD2381F080E18CBD11C08AB582608ABD35 120 | :100770008AB58F7E8ABDC198C3BF12BE49BC89B7F6 121 | :1007800080610AC08CB580718CBDC498C068C0BF40 122 | :100790001FBC4DBC89B7806289BFDF91CF910F919B 123 | :1007A000FF90EF90DF90CF90BF90AF909F908F9091 124 | :1007B0007F906F905F904F900895FF920F931F93DB 125 | :1007C000CF93DF93FC01F680F1100DC04091D10072 126 | :1007D0005091D2006091D3007091D400452B462BEC 127 | :1007E000472BB1F081C0F1E0FF127EC04091CD00F7 128 | :1007F0005091CE006091CF007091D000452B462BD8 129 | :10080000472B09F071C02091E300213009F06CC042 130 | :10081000EC018B81811136C08C819D8163E070E099 131 | :1008200001DA7D836C839B0140E050E0F11002C04F 132 | :1008300001E001C000E060E070E0CB01D6DE1A818B 133 | :100840001F5F1A83888190E063E070E0B5D902965B 134 | :100850002FDA1817A0F01A8289818F5F89839E8111 135 | :10086000913019F41092E30004C08C3010F081E054 136 | :100870008983E981F0E0E758FF4F8081888381E038 137 | :100880008B8332C0813081F5888190E063E070E035 138 | :1008900093D916DAF11005C0009161001091620041 139 | :1008A00002C008EE13E02A8130E0220F331F820FCE 140 | :1008B000931F06DABC017F71892F9927829586954F 141 | :1008C0008770980102C0369527958A95E2F73D8397 142 | :1008D0002C8340E050E080E090E0F11002C001E0A5 143 | :1008E00001C000E082DE1B82DF91CF911F910F914A 144 | :1008F000FF9008951F920F920FB60F9211244F93FD 145 | :100900005F936F937F938F939F93AF93BF938091E8 146 | :10091000D1009091D200A091D300B091D400892B46 147 | :100920008A2B8B2B81F18091D1009091D200A091E4 148 | :10093000D300B091D400181619061A061B061CF530 149 | :100940008091D1009091D200A091D300B091D400B9 150 | :100950000197A109B1098093D1009093D200A0938F 151 | :10096000D300B093D4008091D1009091D200A09197 152 | :10097000D300B091D400892B8A2B8B2B21F48CB51A 153 | :100980008F7E8CBD1CC04091D5005091D6006091E7 154 | :10099000D7007091D8008091D9009091DA00A09191 155 | :1009A000DB00B091DC00840F951FA61FB71F80935A 156 | :1009B000D9009093DA00A093DB00B093DC00BF91E4 157 | :1009C000AF919F918F917F916F915F914F910F9018 158 | :1009D0000FBE0F901F9018951F920F920FB60F9297 159 | :1009E00011248F939F93AF93BF938091CD009091EB 160 | :1009F000CE00A091CF00B091D000892B8A2B8B2BF9 161 | :100A000091F18091CD009091CE00A091CF00B09156 162 | :100A1000D000181619061A061B062CF58091CD0079 163 | :100A20009091CE00A091CF00B091D0000197A10984 164 | :100A3000B1098093CD009093CE00A093CF00B093E6 165 | :100A4000D0008091CD009091CE00A091CF00B091C8 166 | :100A5000D000892B8A2B8B2B31F48AB58F7E8ABDEF 167 | :100A600089B78F7E89BFBF91AF919F918F910F9072 168 | :100A70000FBE0F901F901895AF92CF92EF92FF92FA 169 | :100A80000F931F93480F591F4017510784F00C0D07 170 | :100A9000111D081719075CF0260F371F2E153F058B 171 | :100AA00034F0EA0CF11C81E0E616F7060CF480E065 172 | :100AB0001F910F91FF90EF90CF90AF900895E0912C 173 | :100AC0004101F0914201DF011C96A817B907C4F05B 174 | :100AD0003396840F911DE817F90794F48091430130 175 | :100AE00090914401AC01445F5F4F4617570744F0B3 176 | :100AF00049505109620F711D81E0461757070CF0EC 177 | :100B000080E008958F73E82FF0E0E650FF4F4081BA 178 | :100B100050E021E030E0822FBA01022E02C075952C 179 | :100B200067950A94E2F760FF04C0213049F08250D3 180 | :100B300008952F5F3F4F2830310569F788E0089509 181 | :100B400080E00895FC019585992391F080898F5F5D 182 | :100B5000808B87FD04C0913011F482E0858782810B 183 | :100B600093818135910524F084E0848788E027CD46 184 | :100B70000895EF920F931F9380914E01811131C020 185 | :100B800080914D01811111C0609143017091440128 186 | :100B90008091410190914201E091E100F091E200E9 187 | :100BA000E0904F010EEF10E041C08150823008F01C 188 | :100BB00042C02091520160914301709144018091A3 189 | :100BC000410190914201E091E100F091E200E0905A 190 | :100BD0004F01233018F40EED10E028C00EEB10E0AA 191 | :100BE00025C0813089F46091430170914401809166 192 | :100BF000410190914201E091E100F091E200E0902A 193 | :100C00004F010EE910E012C08230A9F46091430157 194 | :100C1000709144018091410190914201E091E10085 195 | :100C2000F091E200E0904F010EE710E020E140E19A 196 | :100C30008E1B9F0BD1DA1F910F91EF9008951F9398 197 | :100C4000CF93DF93CDB7DEB760970FB6F894DEBFD2 198 | :100C50000FBECDBF142F9C01240F311D1216130699 199 | :100C60002CF58038910514F597FF03C0180F80E02C 200 | :100C700090E09C01210F311D2138310514F010E85E 201 | :100C8000181B9B01295F3F4F2734310578F477FF0C 202 | :100C900002C060E070E00CD7CE01019620E1FC01BB 203 | :100CA00011922A95E9F7612F70E01BD760960FB675 204 | :100CB000F894DEBF0FBECDBFDF91CF911F91089595 205 | :100CC000DF92EF92FF920F931F93CF93DF93442312 206 | :100CD00011F013E001C012E08F73282F30E0A9015A 207 | :100CE00046505F4F7A01FA01008100FF41C0D62EC5 208 | :100CF00009DF8830E9F18D15D8F1C82FD0E0812FB8 209 | :100D000090E08D0D911DC817D90794F50E7FF7015E 210 | :100D1000008386E054DC8091CB008F5F8093CB0012 211 | :100D20008091E1009091E20080589F4F2091410115 212 | :100D3000309142018217930718F48DE38093990153 213 | :100D400033E0CC0FDD1F3A95E1F700E010E040E121 214 | :100D5000BE01C80124E0880F991F2A95E1F76FDFD3 215 | :100D60000F5F1F4F0830110591F78CE380939901B5 216 | :100D7000DF91CF911F910F91FF90EF90DF90089539 217 | :100D8000DF92EF92FF920F931F93CF93DF93EC01CB 218 | :100D90008889893F14F489EF888BDF84E881F981A1 219 | :100DA000ED0DF11DD7FCFA9588892A813B81280F2A 220 | :100DB000311D87FD3A951A8AAF01452F550F550B06 221 | :100DC0004595CF0103E0959587950A95E1F7182F92 222 | :100DD0001F73B90183E0759567958A95E1F7022F36 223 | :100DE00007708E2F8770F82E8C89DB01BB270023BC 224 | :100DF00021F090E0880F991F019601C0880FAA95F5 225 | :100E0000EAF737FD0CC02133310514F4E62E09C092 226 | :100E1000188A80E0A6E0EA2E20E330E002C080E0FD 227 | :100E2000E12C8E7F612F70E01D14E4F4AD89A10FD9 228 | :100E3000AF73B0E0A650BF4F9C91892399F1542F16 229 | :100E40004427550FF3E0660F771FFA95E1F7460F39 230 | :100E5000571F59834883112311F0115001C01FE31C 231 | :100E600082E01DC0DD2001F1DB01A650BF4F9C9147 232 | :100E70008923C1F01F5F103419F44F5F5F4F10E0FA 233 | :100E8000542F4427550F812F90E073E0880F991F4E 234 | :100E90007A95E1F7480F591F5983488388E08A8B78 235 | :100EA0001F8602C0F983E8836E2D70E04889E12F28 236 | :100EB000F0E047FD3FC08D89680F711D81E090E033 237 | :100EC00001C0880F6A95EAF78E7FE650FF4F908148 238 | :100ED0009823A1F4E1E0E10FEF73F0E0E650FF4F5B 239 | :100EE0009081982359F4FF20E9F0E2E0E10FEF73DD 240 | :100EF000F0E0E650FF4F90818923A1F0188A1D860B 241 | :100F000085E08E1510F446E0E42E8E2D90E033E05F 242 | :100F1000880F991F3A95E1F79B838A838A898460B9 243 | :100F20008A8B42C041113EC08D8581113BC082E059 244 | :100F30008D8738C081E090E00E2C01C0880F0A94A4 245 | :100F4000EAF78E7FE650FF4F90819823A1F4E1E00D 246 | :100F5000E10FEF73F0E0E650FF4F9081982359F4D2 247 | :100F6000FF2001F1E2E0E10FEF73F0E0E650FF4F08 248 | :100F700090818923B9F0188A82E08D87E3948E2DC1 249 | :100F800090E023E0880F991F2A95E1F79B838A83DD 250 | :100F90008B89882311F088E012DB8A8981608A8B33 251 | :100FA000188A02C03B832A838B898823B9F0402F9B 252 | :100FB0006E2D812F85DE402F6E2D81E0810F80DE2A 253 | :100FC000FF2061F0402F6E2D82E0810FDF91CF91E5 254 | :100FD0001F910F91FF90EF90DF9072CEDF91CF9134 255 | :100FE0001F910F91FF90EF90DF9008950F931F9343 256 | :100FF000CF93DF938B01C82FD0E0CC0FDD1FC60F3E 257 | :10100000D71F8C819D81FB01208131814091E100BE 258 | :101010005091E200241B350B688579852817390724 259 | :1010200029F4228133812617370751F040E107DE8A 260 | :1010300068857985685F7F4F40E18C819D81FFDD08 261 | :10104000F801808191812091E1003091E200821BC2 262 | :10105000930B9D838C838281938199878887DF910D 263 | :10106000CF911F910F9108951F93CF93DF9380E04D 264 | :101070009BD8EC0183E098D89C018AE094E08C1B1B 265 | :101080009D0BE6E1F0E0BF01CDD5162F8091C600A3 266 | :10109000811168C0C9010B96BF01C4D5EB019B014A 267 | :1010A000332760FF08C082E080934D0181E0809388 268 | :1010B0004F0183E012C062FF07C081E080934D01C1 269 | :1010C00010924F018DEF09C080915001181614F451 270 | :1010D000815003C0882319F08F5F8093500121FF56 271 | :1010E0000CC080914E01811110C089EF8093510195 272 | :1010F00081E080934E0187E062DAC11106C08091E1 273 | :101100004E01811102C010924D0111FF2BC0809140 274 | :10111000F000843039F51092F500809141019091F2 275 | :1011200042019C01205F3F4F3093E5002093E40093 276 | :1011300020914301309144013093E7002093E60071 277 | :1011400023E02093F4002093F3001092F00020910C 278 | :101150004F01211107C02DEF2093F3009093E5007C 279 | :101160008093E4008091C60012FF18C0811110C066 280 | :1011700089E025DA60E181E883D48DE380939901E9 281 | :1011800060E181E87DD48CE38093990181E003C024 282 | :101190008230C1F483E08093C60014C0813011F422 283 | :1011A00082E0F9CF833071F41092C6006FEF81E8CE 284 | :1011B00067D48DE3809399016FEF81E861D48CE36C 285 | :1011C00080939901DF91CF911F910895CF92DF9283 286 | :1011D000EF920F931F93CF936C01C62F8091DD0088 287 | :1011E0009091DE0097FF06C0482F419570E0C60140 288 | :1011F000089608C0009739F070E0482F9601281B28 289 | :10120000390BC9011CDD80916000813031F46C2FF5 290 | :1012100070E0E12C06E310E011C0823011F0843060 291 | :1012200031F46C2F70E0E12C0EE210E007C0833047 292 | :1012300049F46C2F70E0E12C06E210E028E048E071 293 | :10124000C601CAD7CF911F910F91EF90DF90CF9039 294 | :1012500008952F923F924F925F926F927F928F925A 295 | :101260009F92AF92BF92CF92DF92EF92FF920F9335 296 | :101270001F93CF93DF9300D01F92CDB7DEB720919D 297 | :10128000E1003091E2003B832A83C90123E0969577 298 | :1012900087952A95E1F7382F3F73F32E8A819B813A 299 | :1012A00087709927332349F02FEF230F48EF5FEF23 300 | :1012B000481B590B5B834A8309C0EE27FF27E81BB5 301 | :1012C000F90BFB83EA83EF2B31F020E0F1E1FF0D16 302 | :1012D000F983F22E02C020E12983312C5981F516C1 303 | :1012E00008F09FC08091DD009091DE0097FF02C062 304 | :1012F00081E003C0892B21F08FEF8F0D8F73382E83 305 | :101300008F2D8F7390E0AC0146505F4F5A01FA0168 306 | :1013100080818170282ECC24C394D12C832D90E021 307 | :101320009C0126503F4F49014A805B8038E0430EC4 308 | :10133000511CF501808190E00C2C02C09595879599 309 | :101340000A94E2F780FF5DC04091DD005091DE001D 310 | :10135000360183E0660C771C8A95E1F757FF0FC0D2 311 | :10136000F401808190E00C2C02C0959587950A9439 312 | :10137000E2F780FD04C04195B301C20160DC209119 313 | :10138000DD003091DE001216130694F4F401808122 314 | :1013900090E00C2C02C0959587950A94E2F780FDA9 315 | :1013A00007C0422FB3018A819B81821B930B47DCCC 316 | :1013B000F501808190E096012150310902C0959598 317 | :1013C00087952A95E2F7E12C80FD03C00EE110E03D 318 | :1013D00002C00EE310E028E048E0B3018A819B815F 319 | :1013E000FBD6222071F0F1E0CF1202C060E005C010 320 | :1013F0006EEF6C0D660F660F660F8A819B81E6DECD 321 | :10140000212C2FEFC21AD20A38E0C316D10409F0FA 322 | :1014100090CF4A815B81485F5F4F5B834A83F3943F 323 | :101420005DCF0F900F900F90DF91CF911F910F9193 324 | :10143000FF90EF90DF90CF90BF90AF909F908F90F4 325 | :101440007F906F905F904F903F902F900895EF9214 326 | :10145000FF920F931F93CF93DF93F82E8091E100BB 327 | :101460009091E200F11020C02091DF003091E00067 328 | :10147000A901481B590BCA014930510514F088E0F5 329 | :1014800090E09093DE008093DD008091DD009091EC 330 | :10149000DE00883F9F4F34F488EF9FEF9093DE008B 331 | :1014A0008093DD008CE307C080589F4F9093E2004B 332 | :1014B0008093E1008DE380939901CBDE8091F00071 333 | :1014C000843019F18091E6009091E7008034910515 334 | :1014D000E0F464EE70E08F2D89DD8091F5008A35AF 335 | :1014E000A0F46091E6007091E7008091E400909193 336 | :1014F000E500E091E100F091E200E12C06E410E06B 337 | :1015000028E048E08E1B9F0B67D661E471E08F2DC9 338 | :101510006DDD2FDBC7E5D1E08C85843049F1BE015C 339 | :101520008F2D64DD3C85E091E100F091E200298996 340 | :101530006A817B8188819981333049F0EE24E3947C 341 | :10154000243008F4E12C0EE510E020E108C0685FCB 342 | :101550007F4F24FF09C0E12C0EE410E028E040E1B9 343 | :101560008E1B9F0B39D604C040E18E1B9F0B67DB9F 344 | :10157000669681E0C939D80779F68091E1009091AB 345 | :10158000E200F11005C09093E0008093DF0009C0F5 346 | :10159000805891099093E2008093E1008CE380935E 347 | :1015A0009901DF91CF911F910F91FF90EF900895D6 348 | :1015B000FF920F931F93CF93DF93142F70E090E06F 349 | :1015C00077D2D3E0C4E68AE0F82E812F6C2F1ED3A9 350 | :1015D000082F90E066E070E0EFD266E070E08B5795 351 | :1015E0009F4F7FD2802F6C2FDED2181B8C2F6F2D38 352 | :1015F0000DD3C82FD15049F7DF91CF911F910F9193 353 | :10160000FF90089571D77894BB24B39455245A94CD 354 | :10161000B0E28B2EB3E09B2EC4EF6C2E7724739434 355 | :10162000D3E04D2E1DEF312E0AE5202E1DDD8091D9 356 | :10163000C600811124C181E491E0A2DB8091F00019 357 | :10164000843091F184EE90E09BDB8091E6009091F4 358 | :10165000E700CF9740F02092F5001092E70010923B 359 | :10166000E6001092F4008091F60080FD4092F400B4 360 | :1016700082FD3092F40081FD3092F30083FF03C0BD 361 | :101680004092F30002C0882329F08091F500825E29 362 | :101690008093F5008091F5008F5F8093F50085368B 363 | :1016A00018F024E02093F00081E491E04BDAC7E5E4 364 | :1016B000D1E0D12C8C85843009F47CC0CE0160DB74 365 | :1016C000CE0140DA8A8981FF02C05F8602C083FDB5 366 | :1016D000BF8688819981181619061CF01982188214 367 | :1016E000BF86E881F981CF01A3E095958795AA95FA 368 | :1016F000E1F72091A1013091A2012A5D3F4F8217AD 369 | :10170000930708F05F8699899F5F998B8C8581117B 370 | :1017100004C09A3058F0198A09C0833009F04AC0D1 371 | :10172000993C08F447C084E08C8744C06A817B817F 372 | :1017300020E140E1CF01C3D9882399F08091510184 373 | :1017400018166CF480914E01823049F48D2D10D61C 374 | :1017500029EF20935101B0924E0187E001C088E04B 375 | :101760002ED78091F000811119C0E090E600F09032 376 | :10177000E7000091E4001091E5006A817B8158E068 377 | :10178000A52EE8E0CE2E20E130E040E150E0888157 378 | :10179000998172D9882311F08D2DEAD58091E100CD 379 | :1017A0009091E2008897288139812817390714F42D 380 | :1017B0008D2DDED5D394669683E0D8127BCF8091B1 381 | :1017C0005201863020F48F5F8093520102C0109244 382 | :1017D00052018091CC008F5F853018F48093CC004B 383 | :1017E0000CC01092CC00809160008F5F853018F49F 384 | :1017F0008093600002C0B09260008091CB008A505C 385 | :101800008A3028F4709262006092610004C0909265 386 | :101810006200809261008091410190914201813C7F 387 | :1018200091052CF41092E2001092E1000DC0805C52 388 | :1018300091092091E1003091E2002817390720F446 389 | :101840009093E2008093E1008091A1019091A20128 390 | :101850002091E1003091E20043E0369527954A95CA 391 | :10186000E1F72817390758F08896C0D58091A10173 392 | :101870009091A20140969093A2018093A10180E0F3 393 | :10188000E6DD4091CB0060E08AE092DE60E080E03F 394 | :1018900090E09CDC81E0DBDD8091C600811103C01B 395 | :1018A0008AE391E08AD78AE991E087D78091D900CD 396 | :1018B0009091DA00A091DB00B091DC004091C20071 397 | :1018C0005091C3006091C4007091C500841B950BBA 398 | :1018D000A60BB70B893A9146A105B105ECF28091B0 399 | :1018E000D9009091DA00A091DB00B091DC008093E8 400 | :1018F000C2009093C300A093C400B093C50096CEDD 401 | :10190000C09AC29AB89ABA9AC098C298880FC298D8 402 | :1019100098E0C09887FF01C0C09AC29AC298880F09 403 | :101920009150B9F7C098C29AC2980895FC016150CD 404 | :1019300008F41FC091918FEF890F8E3F58F0C09827 405 | :101940009F3F09F4C09AC29898E0C29AC2989150F9 406 | :10195000E1F70BC0C29828E0C09897FF01C0C09A79 407 | :10196000C29AC298990F2150B9F7C098C29AC298EA 408 | :10197000DECF0895C098C29AC09ABA98C0980895C8 409 | :101980001F93CF93DF93EB01142F80919901B8DF60 410 | :10199000612FCE01CBDFDF91CF911F91EBCFEF9283 411 | :1019A000FF920F931F93CF93DF93CDB7DEB76A9764 412 | :1019B0000FB6F894DEBF0FBECDBF8B017A0196E162 413 | :1019C000E3E6F0E0DE01119601900D929A95E1F7C1 414 | :1019D00080939901B898BA98C09AC29A8091990157 415 | :1019E00046E150E0BE016F5F7F4F90E0C9DFEF2816 416 | :1019F00061F01F8A87EA888F8091990142E050E068 417 | :101A0000BE01695E7F4F90E0BBDF012BB9F01F8AFA 418 | :101A100080EA888F8091990142E050E0BE01695EC2 419 | :101A20007F4F90E0ADDF80EC888F8091990142E09C 420 | :101A300050E0BE01695E7F4F90E0A2DF6A960FB66C 421 | :101A4000F894DEBF0FBECDBFDF91CF911F910F91F4 422 | :101A5000FF90EF900895CF93DF9300D0CDB7DEB71E 423 | :101A600019828A838091990142E050E0BE016F5F44 424 | :101A70007F4F90E085DF0F900F90DF91CF91089519 425 | :101A8000CF93DF9300D01F92CDB7DEB719828A8340 426 | :101A90006B838091990143E050E0BE016F5F7F4FFF 427 | :101AA00090E06EDF0F900F900F90DF91CF9108952F 428 | :101AB000CF93DF93EC01CB0123E0959587952A9591 429 | :101AC000E1F7806BC8DF8C2F8F70C5DF34E0D595D0 430 | :101AD000C7953A95E1F78C2F8F708061DF91CF9198 431 | :101AE000BACF0F931F93CF93DF93CDB7DEB7619734 432 | :101AF0000FB6F894DEBF0FBECDBF8B0120E4298363 433 | :101B0000AB01BC01CE010296C3D0A8014F5F5F4F6D 434 | :101B100080919901BE016F5F7F4F90E031DF619648 435 | :101B20000FB6F894DEBF0FBECDBFDF91CF911F91EE 436 | :101B30000F910895EF92FF920F931F93CF93DF932E 437 | :101B4000CDB7DEB760970FB6F894DEBF0FBECDBF3E 438 | :101B5000682F70E040E150E0CE010196A2D000E095 439 | :101B600010E0B80180E090E0A3DF88E0E82EF12CDF 440 | :101B700060E170E0CE010196B4DF81E0E81AF1087F 441 | :101B8000B9F7085F1F4F0034110559F760960FB67B 442 | :101B9000F894DEBF0FBECDBFDF91CF911F910F91A3 443 | :101BA000FF90EF900895002480FD060E660F11F05F 444 | :101BB0008695D1F7802D08950024552704C0080E7E 445 | :101BC000591F880F991F009729F076956795B8F3EC 446 | :101BD0007105B9F7802D952F0895EE27FF27AA27C5 447 | :101BE000BB2708C0A20FB31FE41FF51F220F331F2E 448 | :101BF000441F551F969587957795679598F3704084 449 | :101C0000A9F7009799F7BD01CF010895991B79E0D5 450 | :101C100004C0991F961708F0961B881F7A95C9F77C 451 | :101C200080950895AA1BBB1B51E107C0AA1FBB1FCB 452 | :101C3000A617B70710F0A61BB70B881F991F5A9558 453 | :101C4000A9F780959095BC01CD010895A1E21A2EC7 454 | :101C5000AA1BBB1BFD010DC0AA1FBB1FEE1FFF1F50 455 | :101C6000A217B307E407F50720F0A21BB30BE40BA0 456 | :101C7000F50B661F771F881F991F1A9469F76095E7 457 | :101C80007095809590959B01AC01BD01CF010895A1 458 | :101C9000FB01DC0102C001900D9241505040D8F789 459 | :101CA0000895DC0101C06D9341505040E0F7089564 460 | :101CB000E199FECF9FBB8EBBE09A99278DB3089523 461 | :101CC000A8E1B0E042E050E002C0DC01CB01FC0141 462 | :101CD000E199FECF06C0FFBBEEBBE09A31960DB294 463 | :0E1CE0000D9241505040B8F70895F894FFCF90 464 | :101CEE0001200300AEA83FD30040A1C8DA1281FF45 465 | :101CFE00A4A6D5808D14AF200200010102030204B8 466 | :101D0E000203020405003E5149453E0000427F4059 467 | :101D1E0000006251494946002249494936001814CB 468 | :101D2E00127F10002F49494931003C4A4949300081 469 | :101D3E00017109050300364949493600064949290A 470 | :021D4E001E0075 471 | :00000001FF 472 | -------------------------------------------------------------------------------- /TinyMario/TinyMario.componentinfo.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Device 8 | Startup 9 | 10 | 11 | Atmel 12 | 1.3.0 13 | C:/Program Files (x86)\Atmel\Studio\7.0\Packs 14 | 15 | 16 | 17 | 18 | C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATtiny_DFP\1.3.172\include 19 | 20 | include 21 | C 22 | 23 | 24 | include 25 | 26 | 27 | 28 | 29 | C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATtiny_DFP\1.3.172\include\avr\iotn85.h 30 | 31 | header 32 | C 33 | RcYmivGpgsCGGCzeWAIjcA== 34 | 35 | include/avr/iotn85.h 36 | 37 | 38 | 39 | 40 | C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATtiny_DFP\1.3.172\templates\main.c 41 | template 42 | source 43 | C Exe 44 | /N2+H6ynBWZRQKkZlcoBdQ== 45 | 46 | templates/main.c 47 | Main file (.c) 48 | 49 | 50 | 51 | C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATtiny_DFP\1.3.172\templates\main.cpp 52 | template 53 | source 54 | C Exe 55 | YXFphlh0CtZJU+ebktABgQ== 56 | 57 | templates/main.cpp 58 | Main file (.cpp) 59 | 60 | 61 | 62 | C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATtiny_DFP\1.3.172\gcc\dev\attiny85 63 | 64 | libraryPrefix 65 | GCC 66 | 67 | 68 | gcc/dev/attiny85 69 | 70 | 71 | 72 | 73 | ATtiny_DFP 74 | C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATtiny_DFP/1.3.172/Atmel.ATtiny_DFP.pdsc 75 | 1.3.172 76 | true 77 | ATtiny85 78 | 79 | 80 | 81 | Resolved 82 | Fixed 83 | true 84 | 85 | 86 | -------------------------------------------------------------------------------- /TinyMario/TinyMario.cproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 2.0 5 | 7.0 6 | com.Atmel.AVRGCC8.C 7 | dce6c7e3-ee26-4d79-826b-08594b9ad897 8 | ATtiny85 9 | none 10 | Executable 11 | C 12 | $(MSBuildProjectName) 13 | .elf 14 | $(MSBuildProjectDirectory)\$(Configuration) 15 | TinyMario 16 | TinyMario 17 | TinyMario 18 | Native 19 | true 20 | false 21 | true 22 | true 23 | 24 | 25 | true 26 | 27 | 2 28 | 0 29 | 0 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -mmcu=attiny85 -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.3.172\gcc\dev\attiny85" 48 | True 49 | True 50 | True 51 | True 52 | False 53 | True 54 | True 55 | 56 | 57 | NDEBUG 58 | 59 | 60 | 61 | 62 | %24(PackRepoDir)\atmel\ATtiny_DFP\1.3.172\include 63 | 64 | 65 | Optimize for size (-Os) 66 | True 67 | True 68 | True 69 | 70 | 71 | libm 72 | 73 | 74 | 75 | 76 | %24(PackRepoDir)\atmel\ATtiny_DFP\1.3.172\include 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -mmcu=attiny85 -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.3.172\gcc\dev\attiny85" 86 | True 87 | True 88 | True 89 | True 90 | False 91 | True 92 | True 93 | 94 | 95 | DEBUG 96 | 97 | 98 | 99 | 100 | %24(PackRepoDir)\atmel\ATtiny_DFP\1.3.172\include 101 | 102 | 103 | Optimize for size (-Os) 104 | True 105 | True 106 | Default (-g2) 107 | True 108 | 109 | 110 | libm 111 | 112 | 113 | 114 | 115 | %24(PackRepoDir)\atmel\ATtiny_DFP\1.3.172\include 116 | 117 | 118 | Default (-Wa,-g) 119 | 120 | 121 | 122 | 123 | 124 | compile 125 | 126 | 127 | compile 128 | 129 | 130 | compile 131 | 132 | 133 | compile 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /TinyMario/bricks.h: -------------------------------------------------------------------------------- 1 | 2 | static const unsigned char brick8x8[] PROGMEM= {0x77, 0x76, 0x75, 0x70, 0x77, 0x67, 0x57, 0x07}; 3 | static const unsigned char coin1[] PROGMEM= {0x3C, 0x7E, 0xE7, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C}; 4 | static const unsigned char coin2[] PROGMEM= {0x00, 0x00, 0x7E, 0xCF, 0xFF, 0x7E, 0x00, 0x00}; 5 | static const unsigned char coin3[] PROGMEM= {0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00}; 6 | static const unsigned char block8x8[] PROGMEM= {0xFF, 0x81, 0xBD, 0x85, 0x85, 0x85, 0x81, 0xFF}; 7 | //static const unsigned char grass8x8[] PROGMEM= {0x07, 0x1F, 0x7F, 0x07, 0x1F, 0x3F, 0x0F, 0x07}; 8 | static const unsigned char topbrick[] PROGMEM={0x77, 0x77, 0x77, 0x77, 0x77, 0x67, 0x57, 0x07}; 9 | -------------------------------------------------------------------------------- /TinyMario/font.h: -------------------------------------------------------------------------------- 1 | // 5x7 font (in 6x8 cell) 2 | const byte ucSmallFont[]PROGMEM = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x45,0x51,0x45,0x3e,0x00,0x3e,0x6b,0x6f, 3 | 0x6b,0x3e,0x00,0x1c,0x3e,0x7c,0x3e,0x1c,0x00,0x18,0x3c,0x7e,0x3c,0x18,0x00,0x30, 4 | 0x36,0x7f,0x36,0x30,0x00,0x18,0x5c,0x7e,0x5c,0x18,0x00,0x00,0x18,0x18,0x00,0x00, 5 | 0x00,0xff,0xe7,0xe7,0xff,0xff,0x00,0x3c,0x24,0x24,0x3c,0x00,0x00,0xc3,0xdb,0xdb, 6 | 0xc3,0xff,0x00,0x30,0x48,0x4a,0x36,0x0e,0x00,0x06,0x29,0x79,0x29,0x06,0x00,0x60, 7 | 0x70,0x3f,0x02,0x04,0x00,0x60,0x7e,0x0a,0x35,0x3f,0x00,0x2a,0x1c,0x36,0x1c,0x2a, 8 | 0x00,0x00,0x7f,0x3e,0x1c,0x08,0x00,0x08,0x1c,0x3e,0x7f,0x00,0x00,0x14,0x36,0x7f, 9 | 0x36,0x14,0x00,0x00,0x5f,0x00,0x5f,0x00,0x00,0x06,0x09,0x7f,0x01,0x7f,0x00,0x22, 10 | 0x4d,0x55,0x59,0x22,0x00,0x60,0x60,0x60,0x60,0x00,0x00,0x14,0xb6,0xff,0xb6,0x14, 11 | 0x00,0x04,0x06,0x7f,0x06,0x04,0x00,0x10,0x30,0x7f,0x30,0x10,0x00,0x08,0x08,0x3e, 12 | 0x1c,0x08,0x00,0x08,0x1c,0x3e,0x08,0x08,0x00,0x78,0x40,0x40,0x40,0x40,0x00,0x08, 13 | 0x3e,0x08,0x3e,0x08,0x00,0x30,0x3c,0x3f,0x3c,0x30,0x00,0x03,0x0f,0x3f,0x0f,0x03, 14 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x5f,0x06,0x00,0x00,0x07,0x03,0x00, 15 | 0x07,0x03,0x00,0x24,0x7e,0x24,0x7e,0x24,0x00,0x24,0x2b,0x6a,0x12,0x00,0x00,0x63, 16 | 0x13,0x08,0x64,0x63,0x00,0x36,0x49,0x56,0x20,0x50,0x00,0x00,0x07,0x03,0x00,0x00, 17 | 0x00,0x00,0x3e,0x41,0x00,0x00,0x00,0x00,0x41,0x3e,0x00,0x00,0x00,0x08,0x3e,0x1c, 18 | 0x3e,0x08,0x00,0x08,0x08,0x3e,0x08,0x08,0x00,0x00,0xe0,0x60,0x00,0x00,0x00,0x08, 19 | 0x08,0x08,0x08,0x08,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x02, 20 | 0x00,0x3e,0x51,0x49,0x45,0x3e,0x00,0x00,0x42,0x7f,0x40,0x00,0x00,0x62,0x51,0x49, 21 | 0x49,0x46,0x00,0x22,0x49,0x49,0x49,0x36,0x00,0x18,0x14,0x12,0x7f,0x10,0x00,0x2f, 22 | 0x49,0x49,0x49,0x31,0x00,0x3c,0x4a,0x49,0x49,0x30,0x00,0x01,0x71,0x09,0x05,0x03, 23 | 0x00,0x36,0x49,0x49,0x49,0x36,0x00,0x06,0x49,0x49,0x29,0x1e,0x00,0x00,0x6c,0x6c, 24 | 0x00,0x00,0x00,0x00,0xec,0x6c,0x00,0x00,0x00,0x08,0x14,0x22,0x41,0x00,0x00,0x24, 25 | 0x24,0x24,0x24,0x24,0x00,0x00,0x41,0x22,0x14,0x08,0x00,0x02,0x01,0x59,0x09,0x06, 26 | 0x00,0x3e,0x41,0x5d,0x55,0x1e,0x00,0x7e,0x11,0x11,0x11,0x7e,0x00,0x7f,0x49,0x49, 27 | 0x49,0x36,0x00,0x3e,0x41,0x41,0x41,0x22,0x00,0x7f,0x41,0x41,0x41,0x3e,0x00,0x7f, 28 | 0x49,0x49,0x49,0x41,0x00,0x7f,0x09,0x09,0x09,0x01,0x00,0x3e,0x41,0x49,0x49,0x7a, 29 | 0x00,0x7f,0x08,0x08,0x08,0x7f,0x00,0x00,0x41,0x7f,0x41,0x00,0x00,0x30,0x40,0x40, 30 | 0x40,0x3f,0x00,0x7f,0x08,0x14,0x22,0x41,0x00,0x7f,0x40,0x40,0x40,0x40,0x00,0x7f, 31 | 0x02,0x04,0x02,0x7f,0x00,0x7f,0x02,0x04,0x08,0x7f,0x00,0x3e,0x41,0x41,0x41,0x3e, 32 | 0x00,0x7f,0x09,0x09,0x09,0x06,0x00,0x3e,0x41,0x51,0x21,0x5e,0x00,0x7f,0x09,0x09, 33 | 0x19,0x66,0x00,0x26,0x49,0x49,0x49,0x32,0x00,0x01,0x01,0x7f,0x01,0x01,0x00,0x3f, 34 | 0x40,0x40,0x40,0x3f,0x00,0x1f,0x20,0x40,0x20,0x1f,0x00,0x3f,0x40,0x3c,0x40,0x3f, 35 | 0x00,0x63,0x14,0x08,0x14,0x63,0x00,0x07,0x08,0x70,0x08,0x07,0x00,0x71,0x49,0x45, 36 | 0x43,0x00,0x00,0x00,0x7f,0x41,0x41,0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x00,0x00, 37 | 0x41,0x41,0x7f,0x00,0x00,0x04,0x02,0x01,0x02,0x04,0x00,0x80,0x80,0x80,0x80,0x80, 38 | 0x00,0x00,0x03,0x07,0x00,0x00,0x00,0x20,0x54,0x54,0x54,0x78,0x00,0x7f,0x44,0x44, 39 | 0x44,0x38,0x00,0x38,0x44,0x44,0x44,0x28,0x00,0x38,0x44,0x44,0x44,0x7f,0x00,0x38, 40 | 0x54,0x54,0x54,0x08,0x00,0x08,0x7e,0x09,0x09,0x00,0x00,0x18,0xa4,0xa4,0xa4,0x7c, 41 | 0x00,0x7f,0x04,0x04,0x78,0x00,0x00,0x00,0x00,0x7d,0x40,0x00,0x00,0x40,0x80,0x84, 42 | 0x7d,0x00,0x00,0x7f,0x10,0x28,0x44,0x00,0x00,0x00,0x00,0x7f,0x40,0x00,0x00,0x7c, 43 | 0x04,0x18,0x04,0x78,0x00,0x7c,0x04,0x04,0x78,0x00,0x00,0x38,0x44,0x44,0x44,0x38, 44 | 0x00,0xfc,0x44,0x44,0x44,0x38,0x00,0x38,0x44,0x44,0x44,0xfc,0x00,0x44,0x78,0x44, 45 | 0x04,0x08,0x00,0x08,0x54,0x54,0x54,0x20,0x00,0x04,0x3e,0x44,0x24,0x00,0x00,0x3c, 46 | 0x40,0x20,0x7c,0x00,0x00,0x1c,0x20,0x40,0x20,0x1c,0x00,0x3c,0x60,0x30,0x60,0x3c, 47 | 0x00,0x6c,0x10,0x10,0x6c,0x00,0x00,0x9c,0xa0,0x60,0x3c,0x00,0x00,0x64,0x54,0x54, 48 | 0x4c,0x00,0x00,0x08,0x3e,0x41,0x41,0x00,0x00,0x00,0x00,0x77,0x00,0x00,0x00,0x00, 49 | 0x41,0x41,0x3e,0x08,0x00,0x02,0x01,0x02,0x01,0x00,0x00,0x3c,0x26,0x23,0x26,0x3c}; -------------------------------------------------------------------------------- /TinyMario/font_digits.h: -------------------------------------------------------------------------------- 1 | // 5x7 font (in 6x8 cell) 2 | const uint8_t ucSmallFont[] = { 3 | 0x00,0x3e,0x51,0x49,0x45,0x3e, //48 0 4 | 0x00,0x00,0x42,0x7f,0x40,0x00, //49 1 5 | 0x00,0x62,0x51,0x49,0x49,0x46, //50 2 6 | 0x00,0x22,0x49,0x49,0x49,0x36, //51 3 7 | 0x00,0x18,0x14,0x12,0x7f,0x10, //52 4 8 | 0x00,0x2f,0x49,0x49,0x49,0x31, //53 5 9 | 0x00,0x3c,0x4a,0x49,0x49,0x30, //54 6 10 | 0x00,0x01,0x71,0x09,0x05,0x03, //55 7 11 | 0x00,0x36,0x49,0x49,0x49,0x36, // 56 8 12 | 0x00,0x06,0x49,0x49,0x29,0x1e, //57 9 13 | }; 14 | -------------------------------------------------------------------------------- /TinyMario/main.c: -------------------------------------------------------------------------------- 1 | #define F_CPU 16000000L 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "mario.h" 8 | #include "mario_tiles.h" 9 | #include "bricks.h" 10 | #include "font_digits.h" 11 | #include "oled_lib.h" 12 | 13 | #define TEST_BUTTONS 1 14 | 15 | 16 | struct music_table { 17 | uint16_t startpos; 18 | uint8_t len; 19 | }; 20 | 21 | enum mario_state {idle, left, right, squash, dead}; 22 | enum mario_jumpstate {nojump, jumpup, jumpdown}; 23 | enum mario_direction {faceleft, faceright}; 24 | enum game_state {normal, paused, paused_ready, pause_return, mario_dying}; 25 | 26 | struct character { 27 | int16_t x, y; 28 | int16_t oldx[2], oldy[2]; 29 | enum mario_state state; 30 | enum mario_jumpstate jumpstate; 31 | enum mario_direction dir; 32 | int8_t vx, vy; 33 | uint8_t frame; 34 | uint8_t collision; 35 | uint8_t coincollector; 36 | uint8_t mask; 37 | uint8_t w; 38 | }; 39 | 40 | #define MAX_GOOMBAS 3 41 | 42 | struct character mario, goomba[MAX_GOOMBAS], fireball; 43 | 44 | struct toneController { 45 | uint8_t music_index, music_pos, music_note, noteordelay; 46 | uint16_t current_delay; 47 | uint8_t soundeffect; // 0 = Music, 1=Sound effect (affects play priority and loop behaviour) 48 | }; 49 | 50 | struct toneController MusicController; 51 | struct toneController SoundEffectController; 52 | 53 | #define COIN_SOUND 6 54 | #define JUMP_SOUND 7 55 | #define HITHEAD_SOUND 8 56 | #define PAUSE_SOUND 9 57 | 58 | #define FIREBALL_SPEED 3 59 | 60 | const uint8_t music_seq[] = {0, 1, 1, 2, 3, 2, 4, 2, 3, 2, 4, 5}; // 12 elements: 0-11. Go back to position 1 on overflow. 61 | 62 | // soundeffect = 0: 1 passed onto myTone: Timer1 is used for Music - SPEAKER 63 | // soundeffect = 1: 0 passed onto myTone: Timer0 is used for sound effects - SPEAKER2 64 | 65 | //#define SINGLE_SPEAKER // means we want to mix MUSIC and SOUND_EFFECTS in hardware (using SOUND_EFFECTS pin PB1), else have a pin for each 66 | 67 | #define MUSIC_SPEAKER 4 // IC pin 3: PB4, Timer 1, OC1B - MUSIC (was speaker) 68 | #define SOUNDEFFECT_SPEAKER 1// IC pin 6: PB1, Timer 0, OCOB - Sound effects (was speaker 2) 69 | 70 | #define LEFT_OLED_ADDRESS 0x3C; 71 | #define RIGHT_OLED_ADDRESS 0x3D; // swapped 72 | #define OLED_CONTRAST 0xFF //0x7F 73 | 74 | #define BUTTON_LEFT 4 75 | #define BUTTON_A 2 76 | #define BUTTON_RIGHT 1 77 | 78 | #define BUTTON2_DOWN 1 79 | #define BUTTON2_B 2 80 | #define BUTTON2_SELECT 4 81 | 82 | #define WORLD_MAX_LEN 63 83 | 84 | #define ADC0 0 85 | #define ADC1 1 86 | #define ADC2 2 87 | #define ADC3 3 88 | 89 | #define TEMPO_DEFAULT 800 90 | #define TEMPO_FAST 500 91 | 92 | uint8_t screen[WORLD_MAX_LEN + 1], soundeffectplaying = 0; 93 | 94 | uint16_t viewx = 0, old_viewx = 0, rviewx_trigger, MusicSpeed = TEMPO_DEFAULT, mario_acc_timer = 0; 95 | int delta_viewx = 0; 96 | 97 | volatile long mymicros=0,ISR_micro_period=0; 98 | volatile long tone_timer1_toggle_count=0, tone_timer0_toggle_count = 0; 99 | 100 | uint8_t coinframe = 1, cointimer = 0, coincount = 0; 101 | uint32_t curr_seed = 0; 102 | enum game_state gamestate = normal; 103 | 104 | void drawSprite(int16_t, int16_t, uint8_t, uint8_t, const unsigned char *, uint8_t); 105 | void getWorld(uint16_t); 106 | void drawScreen(void); 107 | void playSoundEffect(uint8_t); 108 | void initMusic(struct toneController *); 109 | void handleMusic(struct toneController *); 110 | void mytone(unsigned long, unsigned long, uint8_t); 111 | void handlemap_collisions(struct character *); 112 | void collidecoins(uint8_t, uint8_t, uint8_t); 113 | uint8_t collideThings(int, int, int, int, int, int, uint8_t, uint8_t); 114 | uint8_t collideMario(int, int, uint8_t, uint8_t); 115 | uint8_t findcoiny(uint8_t); 116 | void animate_character(struct character *); 117 | void draw_mario(void); 118 | void blank_character(uint8_t, struct character *); 119 | void vblankout(int, int, uint8_t); 120 | void readbuttons(void); 121 | void drawCoin(int, uint8_t); 122 | void updateDisplay(uint8_t); 123 | void oledWriteInteger(uint8_t, uint8_t, uint8_t); 124 | void setup(void); 125 | uint16_t readADC(uint8_t); 126 | uint8_t next_random(uint8_t); 127 | void killGoomba(uint8_t g_id); 128 | void spawnGoomba(uint16_t); 129 | 130 | void setup() { 131 | //_delayms(50); 132 | oledInit(0x3c, 0, 0); 133 | oledFill(0); 134 | oledInit(0x3d, 0, 0); 135 | oledFill(0); 136 | 137 | //oledFill(0b00001111); 138 | 139 | mario.mask = 3; //fireball.mask = 3; 140 | mario.w = 2;//fireball.w = 2; 141 | 142 | for (uint8_t i=0;i trigger*8 getWorld element in certain position. 181 | //drawScreen(); 182 | 183 | MusicController.soundeffect = 0; 184 | SoundEffectController.soundeffect = 1; 185 | soundeffectplaying = 0; 186 | initMusic(&MusicController); 187 | 188 | // Change music speaker to a hardware pin that Timer1 supports - i.e. pin4 = PB4 189 | TCCR0A = 0;//notone0A(); 190 | TIMSK = 0; 191 | 192 | TCCR1 = 0 ; 193 | GTCCR = 0; 194 | TIFR = 0; 195 | 196 | //goomba.x = 100; goomba.y = 0; 197 | //goomba.vx = 1; goomba.state=dead; 198 | 199 | } 200 | 201 | 202 | int main(void) 203 | { 204 | static long loop_micros=0; 205 | 206 | setup(); 207 | 208 | sei(); 209 | 210 | while (1) 211 | { 212 | readbuttons(); 213 | 214 | if (gamestate == normal) 215 | { 216 | handlemap_collisions(&mario); // Check for collisions with Mario and the world 217 | 218 | if (fireball.state!=dead) 219 | { 220 | handlemap_collisions(&fireball); 221 | if (fireball.y<0 || fireball.y>=63) {fireball.frame=90;fireball.y=0;fireball.vy=0;} 222 | 223 | // 1 = UP, 2=RIGHT, 4=DOWN, 8=LEFT 224 | if (fireball.collision &1) fireball.vy=FIREBALL_SPEED; 225 | if (fireball.collision &4) fireball.vy=-FIREBALL_SPEED; 226 | if (fireball.collision &2) fireball.vx=-FIREBALL_SPEED; 227 | if (fireball.collision &8) fireball.vx=FIREBALL_SPEED; 228 | 229 | if (fireball.collision!=0) fireball.frame+=30; 230 | 231 | fireball.frame++; 232 | if (fireball.frame>100) fireball.state=dead; 233 | } 234 | 235 | animate_character(&mario); // just applies gravity, could be done elsewhere (i.e. handlemap_collisions physics?) 236 | 237 | for (uint8_t g=0;g>3) >= rviewx_trigger+38) goomba[g].vx=-1; // if goomba attempst to walk off the edge of the known universe 252 | goomba[g].frame++; 253 | if (goomba[g].state==idle && goomba[g].frame >= 10) goomba[g].frame = 0; 254 | if (goomba[g].state==squash && goomba[g].frame>200) goomba[g].state=dead; 255 | } // end enemy not dead 256 | 257 | if (goomba[g].state==idle) 258 | { 259 | if (collideMario(goomba[g].x, goomba[g].y, 16, 16)) 260 | { 261 | if (mario.vy > 0 && mario.jumpstate==jumpdown) {killGoomba(g);mario.vy = -7;mario.jumpstate = jumpup;playSoundEffect(JUMP_SOUND);} 262 | else playSoundEffect(HITHEAD_SOUND); 263 | } 264 | if (fireball.state==idle && collideThings(goomba[g].x, goomba[g].y, 16,16,fireball.x, fireball.y,8,8)) killGoomba(g); 265 | if (goomba[g].x<((int16_t)viewx-40)) killGoomba(g); 266 | } 267 | } // end goomba loop 268 | 269 | 270 | 271 | if (mario.frame++ >= 6) mario.frame = 0; 272 | 273 | cointimer++; // Animate coin 274 | if (cointimer >= 5) 275 | { 276 | cointimer = 0; 277 | coinframe++; 278 | if (coinframe >= 5) coinframe = 1; 279 | } 280 | 281 | if (coincount >= 10 && coincount < 20) MusicSpeed = TEMPO_FAST; else MusicSpeed = TEMPO_DEFAULT; 282 | 283 | if (mario.x <= 192) viewx = 0; 284 | else if (viewx < mario.x - 192) viewx = mario.x - 192; // Do we need to change the viewport coordinate? 285 | 286 | uint16_t blockx = viewx >> 3; // viewx / 8; 287 | if (blockx >= rviewx_trigger) // convert viewx to blocks 288 | { 289 | getWorld(rviewx_trigger + 40); 290 | 291 | rviewx_trigger += 16; 292 | } 293 | 294 | } // gamestate == normal 295 | 296 | updateDisplay(0); // Draw screen 297 | oledWriteInteger(10, 0, coincount); 298 | 299 | drawCoin(0, 0); 300 | updateDisplay(1); 301 | 302 | // 1E6 / fps 303 | 304 | if (gamestate == normal) handleMusic(&MusicController); 305 | handleMusic(&SoundEffectController); 306 | 307 | while (mymicros-loop_micros<=25000) // 40 fps 308 | { 309 | if (gamestate == normal) handleMusic(&MusicController); 310 | handleMusic(&SoundEffectController); 311 | } 312 | loop_micros = mymicros; 313 | 314 | } 315 | 316 | } 317 | 318 | uint8_t next_random(uint8_t range) 319 | { 320 | curr_seed = (curr_seed*1664525 + 1013904223) % 65536; 321 | return (uint8_t) (curr_seed % range); 322 | } 323 | 324 | uint16_t readADC(uint8_t adcpin) 325 | { 326 | uint16_t value=0; 327 | 328 | for (uint8_t i=0;i<16;i++) 329 | { 330 | ADCSRA &=~(1<>4; // divide by eight, average 345 | } 346 | 347 | void drawSprite(int16_t x, int16_t y, uint8_t w, uint8_t h, const unsigned char *buf, uint8_t flip) 348 | { 349 | // Do clipping: 350 | //if (x<0) x=0 351 | 352 | // Assume don't need clipping for now 353 | //ssd1306_send_command3(renderingFrame | (y >> 3), 0x10 | ((x & 0xf0) >> 4), x & 0x0f); 354 | //uint8_t offset_y = y & 0x07; 355 | 356 | int16_t sx, sy; 357 | unsigned char *pos = (unsigned char*)buf; 358 | uint8_t start_height=0, stop_height=h/8, xoff = 0, xw = w; 359 | // i.e. for write_higeht 16 means 2 lots of 8 bits. 360 | 361 | if (x >= 128 || x <= -w) return; 362 | if (y>63) return; 363 | if (x < 0) { 364 | xoff = -x; 365 | x = 0; 366 | } 367 | if (x + w > 128) xw = 128 - x; 368 | 369 | uint8_t temp[16]; 370 | 371 | if (y<0) 372 | { 373 | start_height=1+((-y)>>3); // i.e. -7 to -1 (inclusive): start_height = 1 374 | y=0; 375 | } 376 | 377 | if (y+h>64) stop_height = 8-(y>>3); 378 | 379 | for (uint8_t j = start_height; j < stop_height; j++) // goes from 0 to 1 (across y-axis) 380 | { 381 | sx = x ; 382 | sy = y + (j-start_height) * 8; 383 | 384 | // SetCursor 385 | //ssd1306_send_command3(renderingFrame | (sy >> 3), 0x10 | ((sx & 0xf0) >> 4), sx & 0x0f); 386 | oledSetPosition(sx, sy); 387 | 388 | //ssd1306_send_data_start(); 389 | 390 | // Copy into local buffer forwards or backwards, then pass on :) 391 | 392 | for (uint8_t i = xoff; i < xw; i++) // i.e. i goes 0 to 15 (across x axis) if not clipped 393 | { 394 | if (flip == 0) pos = (unsigned char*)buf + j + (i * (h>>3)); 395 | else pos = (unsigned char*)buf + j + ((w - 1 - i) * (h>>3)); // h/8 396 | temp[i - xoff] = pgm_read_byte(pos); 397 | } 398 | 399 | // cursor is incremented auto-magically to the right (x++) per write 400 | 401 | oledWriteDataBlock(temp, xw - xoff); 402 | 403 | } 404 | } 405 | 406 | void killGoomba(uint8_t g_id) 407 | { 408 | goomba[g_id].state = squash; 409 | goomba[g_id].frame=17; 410 | goomba[g_id].vx=0; 411 | goomba[g_id].x++;//.x++ forces a blank replot 412 | } 413 | void spawnGoomba(uint16_t pos) 414 | { // Check here for goomba availability 415 | for (uint8_t g=0;g1) floor--; 462 | } 463 | if (!next_random(16)) spawnGoomba((uint16_t)vx+8);// spawn half way across screen so there are no boundary issues on the right 464 | } 465 | else gap--; 466 | } 467 | 468 | } 469 | 470 | void drawScreen() 471 | { 472 | uint8_t starti, stopi, wrapped_i=0, coin = 0, pipe = 0; 473 | int xoffset; 474 | 475 | starti = (viewx >> 3) & WORLD_MAX_LEN; // wrap round (could be WORLD_BUFFER - 1) 476 | xoffset = -(viewx & 0x07); 477 | stopi = starti + 16; 478 | 479 | if (starti > 0) { 480 | starti--; // Handles blanking blacking out edge when *just* disappeared off screen 481 | xoffset -= 8; 482 | } 483 | 484 | if (xoffset != 0) stopi++; // Need to add an extra brick on the right because we are not drawing left brick fully 485 | 486 | for (uint8_t i = starti; i < stopi; i++) // limit of 256 487 | { 488 | if (delta_viewx < 0) wrapped_i = (i + 1) & WORLD_MAX_LEN; // wrap round (could be WORLD_BUFFER - 1) 489 | else if (delta_viewx > 0) wrapped_i = (i - 1) & WORLD_MAX_LEN; 490 | 491 | coin = 0; 492 | if (screen[i & WORLD_MAX_LEN] & (1 << 0)) coin = 1; 493 | 494 | for (uint8_t y = 1; y < 8; y++) 495 | { 496 | if (screen[i & WORLD_MAX_LEN] & (1 << y)) // There is a block here 497 | { 498 | if (delta_viewx < 0) // screen is scrolling right and we are within array limit 499 | if (!(screen[wrapped_i] & (1 << y))) vblankout(xoffset + 8, y << 3, -delta_viewx); // View moving to the right, blocks scrolling to the left, 500 | // therefore blank out smearing trail to the right of block 501 | // but only if there isn't a block there. 502 | if (delta_viewx > 0) 503 | if (!(screen[wrapped_i] & (1 << y))) vblankout(xoffset - delta_viewx, y << 3, delta_viewx); 504 | 505 | if ((y == 5 || y == 6) && pipe != 0) // it's a pipe column 506 | { 507 | if (y == 5 && pipe == 2) drawSprite(xoffset - 8, y << 3, 16, 16, &mario_pipe2[0], 0); 508 | //drawSprite(xoffset, y<<3,8,8,&block8x8[0], 0); 509 | } 510 | else 511 | { // don't draw bricks on pipes 512 | //if (y == 7) drawSprite(xoffset, y << 3, 8, 8, &block8x8[0], 0); 513 | //else 514 | if ((screen[i & WORLD_MAX_LEN] & (1 << (y - 1))) == 0) // y>0 and nothing above, draw grassy brick 515 | drawSprite(xoffset, y << 3, 8, 8, &topbrick[0], 0); 516 | else drawSprite(xoffset, y << 3, 8, 8, &brick8x8[0], 0); // else brick is default 517 | } 518 | 519 | if (coin) 520 | { 521 | if (y == 1) drawCoin(xoffset, (y - 1) << 3); 522 | else drawCoin(xoffset, (y - 2) << 3); 523 | coin = 0; 524 | } 525 | } 526 | //else vblankout(xoffset,y<<3,8); 527 | } 528 | xoffset += 8; 529 | } 530 | } 531 | 532 | void playSoundEffect(uint8_t num) 533 | { 534 | if (soundeffectplaying) return; // only one at once 535 | // 6 - coin collect sound 536 | 537 | tone_timer0_toggle_count = 0; // stop current sound 538 | 539 | SoundEffectController.music_pos = 0; 540 | SoundEffectController.music_index = num; 541 | SoundEffectController.noteordelay = 1; 542 | 543 | soundeffectplaying = 1; 544 | } 545 | 546 | void initMusic(struct toneController *controller) 547 | { 548 | controller->music_pos = 0; // First position in music sequence, i.e. 0,1,2,3 etc ) 549 | controller->music_index = music_seq[controller->music_pos];//pgm_read_byte(&music_seq[0]+music_pos); // melody 0 (=intro 550 | controller->music_note = 0; // First note of music_index melody 551 | controller->noteordelay = 1; //simulate end of a delay to start the note 552 | } 553 | 554 | void handleMusic(struct toneController *controller)//, uint8_t channel_id) 555 | { 556 | uint16_t *melody; 557 | uint8_t numNotes; 558 | uint8_t *entry_pos; 559 | 560 | // soundeffect = 1: Timer0 is used for music - SPEAKER2 561 | // soundeffect = 0: Timer1 is used for sound effects - SPEAKER 562 | 563 | if ((controller->soundeffect == 0 && tone_timer1_toggle_count == 0) || (controller->soundeffect == 1 && tone_timer0_toggle_count == 0 && soundeffectplaying == 1)) 564 | { 565 | if (controller->noteordelay == 0) // 0 = NOTE just ended, therefore now delay 566 | { 567 | // Note ended, start a delay 568 | controller->current_delay = (controller->current_delay/3); 569 | 570 | if (controller->soundeffect == 0) mytone(0, controller->current_delay,1); 571 | else mytone(0, controller->current_delay,0); 572 | 573 | // Advance to next note position 574 | controller->music_note++; // sizeof(music_table) 575 | numNotes = eeprom_read_byte((uint8_t *)(controller->music_index * 3) + 2); // next position is numNotes 576 | 577 | if (controller->music_note >= numNotes) // exceeded notes in this melody part 578 | { 579 | controller->music_note = 0; 580 | controller->music_pos++; // advance sequence position 581 | 582 | if (controller->soundeffect == 1) // we are in the sound effect handler 583 | { 584 | soundeffectplaying = 0; // Global, control is passed back onto music handler, music will restart at next tone. 585 | } 586 | else if (controller->music_pos >= 12) // In music handler, and sequence has overflowed. 587 | { 588 | controller->music_pos = 1; // We are in the music handler 589 | } 590 | controller->music_index = music_seq[controller->music_pos];//pgm_read_byte(&music_seq[0]+music_pos); 591 | } 592 | controller->noteordelay = 1; //delay is next 593 | } // end note ended 594 | else if (controller->noteordelay == 1) // 1 = DELAY 595 | { 596 | // Delay ended, play next note 597 | entry_pos = (uint8_t *)(controller->music_index * 3);//sizeof(music_table); 598 | melody = (uint16_t *)eeprom_read_word((uint16_t*)entry_pos); // EEPROM position in entry table 599 | entry_pos += 2; 600 | 601 | //numNotes = eeprom_read_byte(entry_pos); // next position is numNotes 602 | //noteDurations = (uint8_t*)(melody + (numNotes)); // noteDurations follows the melody in EEPROM 603 | 604 | uint16_t ms = 1000, freq; 605 | 606 | if (controller->soundeffect == 0) ms = MusicSpeed; // Music speed might change 607 | 608 | freq = eeprom_read_word(melody + controller->music_note); // duration is now encoded into top 3 bits of frequency. 609 | uint8_t note; 610 | note = freq >> 13;// Extract 2,4,8,16th,32nd note etc from freq 611 | freq &= 0x1FFF; 612 | controller->current_delay = ms>>note; // shift rather than divide. 613 | 614 | if (controller->soundeffect == 0) mytone(freq, controller->current_delay,1); 615 | else mytone(freq, controller->current_delay,0); // Sound effects 616 | 617 | controller->noteordelay = 0; 618 | }// end delay ended 619 | } // wnd time delay lapsed 620 | } 621 | 622 | void mytone(unsigned long frequency, unsigned long duration, uint8_t timer) // Hard coded for pin PB1 (OCR0A) 623 | { 624 | uint32_t ocr; 625 | uint8_t prescalarbits = 0b001; 626 | uint8_t output = 1; 627 | 628 | // soundeffect = 0: 1 passed onto myTone: Timer1 is used for Music - SPEAKER 629 | // soundeffect = 1: 0 passed onto myTone: Timer0 is used for sound effects - SPEAKER2 630 | 631 | // timer = 0 - use timer 0 and SPEAKER2 pin 632 | // timer = 1 - use timer 1 and SPEAKER pin 633 | 634 | // Try music on PB1, using OC1A (rather than OC1B on PB4) 635 | 636 | if (frequency == 0) 637 | { // Means we want to switch off the pin and do a pause, but not output to the hardware pin 638 | output = 0; frequency = 300; // A dummy frequency - timings are calculated but no pin output. 639 | } 640 | 641 | ocr = F_CPU / (2 * frequency); 642 | 643 | if (timer==0) 644 | { 645 | if (ocr > 256) 646 | { 647 | ocr >>= 3; //divide by 8 648 | prescalarbits = 0b010; // ck/8 649 | if (ocr > 256) 650 | { 651 | ocr >>= 3; //divide by a further 8 652 | prescalarbits = 0b011; //ck/64 653 | if (ocr > 256) 654 | { 655 | ocr >>= 2; //divide by a further 4 656 | prescalarbits = 0b100; //ck/256 657 | if (ocr > 256) 658 | { 659 | // can't do any better than /1024 660 | ocr >>= 2; //divide by a further 4 661 | prescalarbits = 0b101; //ck/1024 662 | } // ck/1024 663 | }// ck/256 664 | }// ck/64 665 | }//ck/8*/ 666 | } //timer==0 667 | else 668 | { 669 | prescalarbits = 1; 670 | while (ocr > 0xff && prescalarbits < 15) { 671 | prescalarbits++; 672 | ocr>>=1; 673 | } 674 | } 675 | 676 | ocr -= 1; 677 | 678 | if (timer==0) 679 | { 680 | tone_timer0_toggle_count = (2 * frequency * duration) / 1000; 681 | } 682 | else 683 | { 684 | // timer1 scalar code here 685 | tone_timer1_toggle_count = (2 * frequency * duration) / 1000; 686 | // Music uses timer1 and is on continuously so use as a crude timer 687 | ISR_micro_period = 500000L / frequency; // 1E6 / (2*frequency), because ISR is called 2 times every period. 688 | } 689 | 690 | if (output) 691 | { 692 | if (timer==0) 693 | { 694 | TCCR0A = (1 << COM0B0) | (1 << WGM01); // = CTC // Fast PWM | (1< 0) 757 | { 758 | tone_timer1_toggle_count--; 759 | if (tone_timer1_toggle_count == 0) 760 | { 761 | // turn off tone 762 | #ifdef SINGLE_SPEAKER 763 | TCCR1 &= (1 < 0) 778 | { 779 | tone_timer0_toggle_count--; 780 | if (tone_timer0_toggle_count == 0) 781 | { 782 | // turn off tone 783 | //TCCR0A = 0; 784 | TCCR0A &= ~(1<coincollector) 800 | //{ 801 | if (player->vy < -7) player->vy = -7; // 802 | //} 803 | //else if (player->vy<-1) player->vy = -1; //non-coin collectors (i.e. goombas) have limited gravity 804 | 805 | newmario_x = player-> x + player->vx; 806 | newmario_y = player->y + player->vy; 807 | player->collision = 0; // 1 = UP, 2=RIGHT, 4=DOWN, 8=LEFT 808 | 809 | //if ((newmario_x-(int16_t)viewx)<0) newmario_x=viewx; 810 | 811 | cellx_zone = (newmario_x >> 9); // 0-31 = 0, 32-63=1, 64-95=2, 96-127=3. >>8 = 3 + (log2 WORLD_BUFFER); 812 | 813 | // 0-63 = 0, 64-127 = 1 ... therefore 64*8 = 2^6 * 2^3 = 2^9 = 512 814 | cellx = (newmario_x >> 3) & WORLD_MAX_LEN; 815 | celly = newmario_y >> 3; // generate bit-mask for byte describing y-column in screen data. 816 | uint8_t yoffset = newmario_y & 0x07, xoffset = newmario_x & 0x07; 817 | 818 | //ybitmask = 1 << celly; 819 | if (yoffset==0) ybitmask = (player->mask) << celly; 820 | else ybitmask = ((player->mask<<1)+1)<48) // can't fall off the bottom of the screen! 827 | { 828 | newmario_y = 48; 829 | player->vy = 0; 830 | 831 | celly = 6; 832 | ybitmask = 0; 833 | } 834 | 835 | ybitmask&=~(1<<0); // means no collisions with row0 836 | 837 | uint8_t check_cell, check_cell2; 838 | 839 | if (player->vx > 0) // Check Mario's righthand side if he tried to move to the right 840 | { 841 | check_cell = (cellx + player->w) & WORLD_MAX_LEN; // WORLD_BUFFER - 1 842 | 843 | //if (screen[check_cell]&ybitmask || screen[check_cell] & (ybitmask << 1) || (yoffset != 0 && screen[check_cell] & (ybitmask << 2))) 844 | if (screen[check_cell]&ybitmask) // that's all 845 | { // clip 846 | // Strictly we should update cellx_zone to be relevant to the zone of the block that caused the collision 847 | player->x = (cellx_zone << 9) + (cellx << 3); 848 | if (cellx == 0) cellx = WORLD_MAX_LEN; else cellx -= 1; // handle wrap 849 | player->collision |= 2; // 1 = UP, 2=RIGHT, 4=DOWN, 8=LEFT 850 | player->vx = 0; 851 | } 852 | else 853 | { 854 | player->x = newmario_x; 855 | } 856 | } 857 | else if (player->vx < 0) 858 | { 859 | //player->x=newmario_x; 860 | // if (screen[cellx]&ybitmask || screen[cellx] & (ybitmask << 1) || (yoffset != 0 && screen[cellx] & (ybitmask << 2))) 861 | if (screen[cellx]&ybitmask) 862 | { // clip 863 | ///cellx=(cellx+1) & 31; // if collided with left, push back to the right - handle wrap 864 | cellx++; 865 | if (cellx > WORLD_MAX_LEN) { 866 | cellx = 0; 867 | cellx_zone++; 868 | } 869 | player->x = (cellx_zone << 9) + (cellx << 3); // Strictly we should update cellx_zone to be relevant to the zone of the block that caused the collision 870 | player->collision |= 8; // 1 = UP, 2=RIGHT, 4=DOWN, 8=LEFT 871 | player->vx = 0; 872 | } 873 | else 874 | { 875 | player->x = newmario_x; 876 | } 877 | 878 | } 879 | 880 | // 881 | // celly+2 should be valid at this point 882 | 883 | ybitmask = 1 << (celly+player->w); 884 | ybitmask&=~(1<<0); // means no collisions with row 0 885 | 886 | if (player->vy > 0 || player->vy == 0) // going down 887 | { 888 | check_cell = (cellx + 1) & WORLD_MAX_LEN; 889 | check_cell2 = (cellx + 2) & WORLD_MAX_LEN; 890 | //if ((celly + 2 >= 8) || screen[cellx] & ybitmask || screen[check_cell] & ybitmask || (xoffset != 0 && screen[check_cell2] & ybitmask)) 891 | if (screen[cellx] & ybitmask || screen[check_cell] & ybitmask || (xoffset != 0 && screen[check_cell2] & ybitmask)) 892 | { // clip 893 | player->vy = 0; player->jumpstate = nojump; 894 | if (celly + 2 >= 8) celly = 6; 895 | player->y = (celly << 3); 896 | player->collision |= 4; // 1 = UP, 2=RIGHT, 4=DOWN, 8=LEFT 897 | player->vy = 0; 898 | } 899 | else 900 | { 901 | if (player->vy == 0 && player->jumpstate == nojump) { 902 | player->jumpstate = jumpdown; 903 | } 904 | player->y = newmario_y; // allow new vertical position 905 | } 906 | } 907 | else if (player->vy < 0) // Have we hit our head? 908 | { 909 | ybitmask = 1 << (celly); 910 | ybitmask&=~(1<<0); // means no collisions with row 0 911 | 912 | //player->y=newmario_y;// allow new vertical position 913 | check_cell = (cellx + 1) & WORLD_MAX_LEN; // WORLD_BUFFER -1 914 | check_cell2 = (cellx + 2) & WORLD_MAX_LEN; // WORLD_BUFFER -1 915 | 916 | if (screen[cellx] & (ybitmask) || screen[check_cell] & (ybitmask) || (xoffset != 0 && screen[check_cell2] & (ybitmask))) 917 | { // clip 918 | player->vy = 0; player->jumpstate = jumpdown; 919 | celly += 1; 920 | player->y = (celly << 3); 921 | if (player->coincollector) playSoundEffect(HITHEAD_SOUND); 922 | player->collision |= 1; // 1 = UP, 2=RIGHT, 4=DOWN, 8=LEFT 923 | player->vy = 0; 924 | } 925 | else 926 | { 927 | //if (mario.vy==0 && mario.jumpstate==nojump) {mario.jumpstate=jumpdown;} 928 | player->y = newmario_y; // allow new vertical position 929 | } 930 | } 931 | // Coin collision 932 | 933 | // mario is at: cellx, cellx+1 (and if xoffset!=0, cellx+2) 934 | // and at: celly, celly+1 (and if yoffset!=0, celly+2) 935 | 936 | if (player->coincollector) 937 | { 938 | collidecoins(cellx, celly, yoffset); 939 | collidecoins(cellx + 1, celly, yoffset); 940 | if (xoffset != 0) collidecoins(cellx + 2, celly, yoffset); 941 | } 942 | } 943 | 944 | void collidecoins(uint8_t cx, uint8_t celly, uint8_t yoffset) 945 | { 946 | uint8_t coiny = 8, h; 947 | 948 | h = 2; if (yoffset != 0) h = 3; 949 | 950 | cx = cx & WORLD_MAX_LEN; 951 | 952 | if (screen[cx] & 1) // Is there a coin in this column? 953 | { 954 | coiny = findcoiny(cx); 955 | if (coiny != 8) 956 | { 957 | //if (collideMarioblock(cx, coiny)) 958 | if (coiny >= celly && coiny < (celly + h)) 959 | { 960 | screen[cx] &= 254; 961 | playSoundEffect(COIN_SOUND); 962 | coincount++; 963 | 964 | //starti = (viewx >> 3) & 31; 965 | //vblankout((cx<<3)-(viewx & 127), coiny*8,16); 966 | 967 | // This function is only called when screen = 0, address 0x3D (left screen) 968 | if (mario.x > (viewx + 128)) oled_addr = RIGHT_OLED_ADDRESS;//0x3C; // right hand side screen 969 | for (uint8_t x = 0; x < 8; x++) vblankout(x << 4, coiny * 8, 16); 970 | oled_addr = LEFT_OLED_ADDRESS;//0x3D; //set address back to be safe 971 | } 972 | } 973 | } 974 | 975 | } 976 | 977 | uint8_t collideThings(int mx, int my, int mw, int mh, int tx, int ty, uint8_t w, uint8_t h) 978 | { 979 | if ((mx + mw) < tx || mx > (tx + w)) return 0; 980 | if ((my + mh) < ty || my > (ty + h)) return 0; 981 | 982 | return 1; 983 | } 984 | 985 | uint8_t collideMario(int tx, int ty, uint8_t w, uint8_t h) 986 | { 987 | if ((mario.x + 8 + 4) < tx || (mario.x + 4) > (tx + w)) return 0; 988 | if ((mario.y + 8 + 4) < ty || (mario.y + 4) > (ty + h)) return 0; 989 | 990 | return 1; 991 | } 992 | 993 | uint8_t findcoiny(uint8_t cx) 994 | { 995 | for (uint8_t y = 1; y < 8; y++) 996 | { 997 | if (screen[cx & WORLD_MAX_LEN] & (1 << y)) // There is a block here 998 | { 999 | if (y == 1) return 0; //drawCoin(xoffset, (y-1)<<3); 1000 | else return y - 2; //drawCoin(xoffset, (y-2)<<3); 1001 | } // if found block 1002 | } // for y 1003 | return 8; // 8 means couldn't find a coin. 1004 | } 1005 | 1006 | void animate_character(struct character *player) 1007 | { 1008 | 1009 | // Jumping 1010 | if (player->jumpstate != nojump) 1011 | { 1012 | player->vy += 1; // Gravity 1013 | if (player->vy >= 0 && player->jumpstate == jumpup) player->jumpstate = jumpdown; // flip state for animation 1014 | if (player->y>80) {player->state=dead; playSoundEffect(HITHEAD_SOUND);} 1015 | } 1016 | else // idle, left or right 1017 | { 1018 | //player->frame++;//1-mario.frame; // animate frame 1019 | 1020 | } 1021 | } 1022 | 1023 | void draw_mario() 1024 | { 1025 | // Drawing *************************************** 1026 | if (mario.jumpstate == nojump) // idle, left or right 1027 | { 1028 | if (mario.state == idle) drawSprite(mario.x - viewx, mario.y, 16, 16, &mario_idle[0], mario.dir); 1029 | else if (mario.state == left || mario.state == right) 1030 | { 1031 | if (mario.frame < 3) drawSprite(mario.x - viewx, mario.y, 16, 16, &mario_walk1[0], mario.dir); 1032 | else drawSprite(mario.x - viewx, mario.y, 16, 16, &mario_walk2[0], mario.dir); 1033 | } // end: left or right walking 1034 | } // end: not jumping 1035 | else if (mario.jumpstate == jumpup) drawSprite(mario.x - viewx, mario.y, 16, 16, &mario_jump1[0], mario.dir); 1036 | else if (mario.jumpstate == jumpdown) drawSprite(mario.x - viewx, mario.y, 16, 16, &mario_jump2[0], mario.dir); 1037 | } 1038 | 1039 | void blank_character(uint8_t screen_id, struct character *player) 1040 | { 1041 | //static int oldmario_x, oldmario_y; //initialised 1042 | 1043 | 1044 | //if (screen_id==0) // left - for now do this, later will have to store for each screen 1045 | //{ 1046 | 1047 | if ((player->x - (int16_t)viewx) != player->oldx[screen_id] || (player->y != player->oldy[screen_id])) // Blankout old mario position sprite if we've moved 1048 | { 1049 | vblankout(player->oldx[screen_id], player->oldy[screen_id], 16); 1050 | vblankout(player->oldx[screen_id], player->oldy[screen_id] + 8, 16); 1051 | } 1052 | 1053 | //oldmario_x = mario.x-(int16_t)viewx; oldmario_y = mario.y; 1054 | player->oldx[screen_id] = player->x - (int16_t)viewx; 1055 | player->oldy[screen_id] = player->y; 1056 | //} 1057 | } 1058 | 1059 | void vblankout(int sx, int sy, uint8_t w)//, uint8_t h) 1060 | { 1061 | // Set cursor @ top left corner 1062 | 1063 | if (sx + w <= 0 || sx >= 128) return; // No amount of vertical strip will be visible 1064 | 1065 | if (sx < 0) { 1066 | w = sx + w; 1067 | sx = 0; 1068 | } 1069 | if (sx + w > 128) { 1070 | w = 128 - sx; 1071 | } 1072 | 1073 | if (sy<-7 || sy>63) return; 1074 | if (sy<0) sy=0; // i.e. between -7 and -1 1075 | 1076 | //ssd1306_send_command3(renderingFrame | (sy >> 3), 0x10 | ((sx & 0xf0) >> 4), sx & 0x0f); 1077 | 1078 | oledSetPosition(sx, sy); 1079 | //ssd1306_send_data_start(); 1080 | 1081 | uint8_t temp[16] = {0}; 1082 | 1083 | oledWriteDataBlock(temp, w); 1084 | 1085 | /* 1086 | for (uint8_t i=0; i 0) mario.vx -= 1; 1125 | else if (mario.vx < 0) mario.vx += 1; 1126 | } 1127 | 1128 | // Jumping 1129 | if ((buttons & BUTTON_A) && mario.jumpstate == nojump) { 1130 | mario.vy = -7; // Only start jumping if not currently jumping 1131 | mario.jumpstate = jumpup; 1132 | playSoundEffect(JUMP_SOUND); 1133 | } 1134 | 1135 | // Idle if not jumping and no keys pressed 1136 | if (buttons == 0 && mario.jumpstate == nojump) mario.state = idle; 1137 | 1138 | if (buttons2 & BUTTON2_B) // Fire!!! 1139 | { 1140 | if (fireball.state==dead) 1141 | { 1142 | fireball.frame=0; 1143 | fireball.x=mario.x+16; fireball.y=mario.y; fireball.vy=FIREBALL_SPEED; fireball.vx=FIREBALL_SPEED; fireball.state=idle; 1144 | if (mario.dir==faceleft) {fireball.vx=-FIREBALL_SPEED;fireball.x=mario.x;} 1145 | } 1146 | } 1147 | } // end gamestate == normal 1148 | 1149 | 1150 | if (buttons2 & BUTTON2_SELECT) 1151 | { 1152 | if (gamestate == normal) 1153 | { 1154 | playSoundEffect(PAUSE_SOUND); 1155 | oledWriteCommand2(0x81, 16); 1156 | oled_addr = RIGHT_OLED_ADDRESS;//0x3C; 1157 | oledWriteCommand2(0x81, 16); 1158 | oled_addr = LEFT_OLED_ADDRESS;//0x3D; 1159 | gamestate = paused; 1160 | } 1161 | else if (gamestate == paused_ready) { 1162 | gamestate = pause_return; 1163 | } 1164 | } // buttons2 == 0 (released pause button) 1165 | else if (gamestate == paused) 1166 | { 1167 | gamestate = paused_ready; 1168 | } 1169 | else if (gamestate == pause_return) 1170 | { 1171 | gamestate = normal; 1172 | oledWriteCommand2(0x81, OLED_CONTRAST); 1173 | oled_addr = RIGHT_OLED_ADDRESS;//0x3C; 1174 | oledWriteCommand2(0x81, OLED_CONTRAST); 1175 | oled_addr = LEFT_OLED_ADDRESS;//0x3D; 1176 | } 1177 | 1178 | } 1179 | 1180 | void drawCoin(int sx, uint8_t sy) 1181 | { 1182 | // Do coin(s) 1183 | 1184 | if (delta_viewx < 0) vblankout(sx + 8, sy, -delta_viewx); 1185 | else if (delta_viewx > 0) vblankout(sx - delta_viewx, sy, delta_viewx); 1186 | 1187 | if (coinframe == 1) 1188 | drawSprite(sx, sy, 8, 8, &coin1[0], 0); 1189 | else if (coinframe == 2 || coinframe == 4) 1190 | drawSprite(sx, sy, 8, 8, &coin2[0], 0); 1191 | else if (coinframe == 3) 1192 | drawSprite(sx, sy, 8, 8, &coin3[0], 0); 1193 | } 1194 | 1195 | void updateDisplay(uint8_t screen_id) 1196 | { 1197 | 1198 | if (screen_id == 0) // Left screen 1199 | { 1200 | delta_viewx = old_viewx - viewx; // -ve means moving to right, +ve means moving to left. 1201 | if (delta_viewx > 8) delta_viewx = 8; // Limit delta_viewx 1202 | if (delta_viewx < -8) delta_viewx = -8; 1203 | oled_addr = LEFT_OLED_ADDRESS;//0x3D; 1204 | } 1205 | else // right hand screen (0x3c) 1206 | { 1207 | viewx = viewx + 128; 1208 | oled_addr = RIGHT_OLED_ADDRESS;//0x3C; 1209 | } 1210 | 1211 | drawScreen(); // Draws level scenery, coins, etc. 1212 | 1213 | // Draw fireball, goomba and other sprites etc 1214 | if (fireball.state!=dead) 1215 | { 1216 | if (fireball.y>=0 && fireball.y<=63) // only if on screen 1217 | { 1218 | blank_character(screen_id, &fireball); 1219 | if (fireball.frame<90) drawSprite(fireball.x-viewx, fireball.y,8,8,&fire[0],0); // this makes sure we blank before making dead 1220 | } 1221 | } 1222 | 1223 | blank_character(screen_id, &mario); 1224 | draw_mario(); 1225 | 1226 | for (uint8_t g=0; g 3)); 1232 | else if ((goomba[g].frame>>4)&1) drawSprite(goomba[g].x - viewx, goomba[g].y+8, 16, 8, &squashed[0], 0); 1233 | else vblankout(goomba[g].x - viewx,goomba[g].y+8,16); 1234 | } 1235 | } 1236 | 1237 | if (screen_id == 0) old_viewx = viewx; // left screen 1238 | else { 1239 | viewx = viewx - 128; // restore previous viewx 1240 | oled_addr = LEFT_OLED_ADDRESS;//0x3D; 1241 | } 1242 | } 1243 | 1244 | void oledWriteInteger(uint8_t x, uint8_t y, uint8_t number) 1245 | { 1246 | uint8_t n, n_div = 100; 1247 | oledSetPosition(x, y); 1248 | 1249 | for (uint8_t i = 0; i < 3; i++) 1250 | { 1251 | n = number / n_div; // 0-255, so n is never > 10 1252 | oledWriteDataBlock(&ucSmallFont[n * 6], 6); // write character pattern 1253 | number = number - n_div * n; 1254 | n_div = n_div / 10; // 100 --> 10 --> 1 1255 | } 1256 | } 1257 | 1258 | -------------------------------------------------------------------------------- /TinyMario/mario.h: -------------------------------------------------------------------------------- 1 | #define mario_w 16 2 | #define mario_h 16 3 | 4 | static const unsigned char mario_idle[] PROGMEM = { 5 | 0, 0, 0, 0, 0, 0, 0, 48, 32, 184, 32, 253, 96, 225, 48, 60, 176, 60, 240, 224, 96, 252, 192, 189, 128, 57, 0, 0, 0, 0, 0, 0}; 6 | 7 | /* 8 | static const unsigned char mario_idle[] PROGMEM = { 9 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x01, 0xE0, 0x0F, 10 | 0x70, 0x02, 0xD8, 0x00, 0x18, 0x06, 0x00, 0x00, 0xB0, 0x05, 0xB8, 0x0D, 11 | 0xB8, 0x1D, 0xF8, 0x1F, 0x60, 0x06, 0x70, 0x0E, 12 | };*/ 13 | 14 | static const unsigned char mario_walk1[] PROGMEM = { 15 | 0, 0, 0, 0, 0, 12, 16, 124, 144, 108, 176, 108, 24, 126, 88, 62, 120, 48, 48, 190, 224, 254, 192, 254, 0, 108, 0, 12, 0, 0, 0, 0}; 16 | 17 | static const unsigned char mario_walk2[] PROGMEM= {0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 144, 88, 176, 116, 24, 254, 88, 240, 120, 254, 48, 240, 224, 62, 192, 28, 0, 0, 0, 0, 0, 0}; 18 | 19 | static const unsigned char mario_jump1[] PROGMEM= {0, 0, 0, 0, 0, 12, 32, 12, 32, 25, 96, 189, 48, 248, 176, 252, 240, 60, 96, 124, 192, 125, 128, 97, 0, 192, 0, 0, 0, 0, 0, 0}; 20 | 21 | static const unsigned char mario_jump2[] PROGMEM= {0, 0, 0, 0, 224, 56, 224, 49, 32, 51, 32, 45, 96, 125, 48, 124, 176, 108, 240, 252, 96, 252, 192, 125, 128, 109, 0, 200, 0, 0, 0, 0}; 22 | 23 | static const unsigned char goomba1[] PROGMEM ={ 24 | 0x80, 0x63, 0xE0, 0x97, 0xF0, 0x0F, 0xE8, 0x0F, 0xEC, 0x1F, 0x1E, 0x17, 25 | 0xBF, 0x3B, 0x3F, 0xDA, 0x3F, 0xDA, 0xBF, 0x7B, 0x1E, 0x37, 0xEC, 0x1F, 26 | 0xE8, 0x97, 0xF0, 0x67, 0xE0, 0x07, 0x80, 0x03, }; 27 | 28 | static const unsigned char squashed[] PROGMEM = { 29 | 0x58, 0x9C, 0x3C, 0x3E, 0x3E, 0x13, 0x7F, 0xB7, 0xB7, 0x7F, 0x53, 0x3E, 30 | 0x9E, 0x5C, 0x1C, 0x18}; 31 | 32 | static const unsigned char fire[] PROGMEM = { 33 | 0x00, 0x18, 0x3C, 0x66, 0x66, 0x3C, 0x18, 0x00, }; 34 | -------------------------------------------------------------------------------- /TinyMario/mario_tiles.h: -------------------------------------------------------------------------------- 1 | /*static const unsigned char mario_pipe[] PROGMEM= { 2 | 0xFF, 0xFF, 0x01, 0xE0, 0x01, 0xE0, 0x01, 0xE0, 0x01, 0xE0, 0xFF, 0xFF, 3 | 0x02, 0x60, 0x02, 0x60, 0x02, 0x60, 0x02, 0x60, 0x02, 0x60, 0x02, 0x60, 4 | 0xFC, 0x3F, 0x02, 0x60, 0x02, 0x60, 0x02, 0x60, 5 | };*/ 6 | 7 | static const unsigned char mario_pipe2[] PROGMEM= { 8 | 63, 0, 255, 239, 255, 255, 33, 16, 33, 16, 33, 16, 33, 16, 33, 16, 33, 16, 33, 16, 33, 16, 33, 16, 33, 16, 33, 16, 225, 239, 63, 0}; 9 | -------------------------------------------------------------------------------- /TinyMario/oled_lib.c: -------------------------------------------------------------------------------- 1 | // Modified from the excellent code here: https://github.com/bitbank2/oled_turbo 2 | // Shrink-ified to fit onto the ATtiny85 by [ShepherdingElectrons] 2020 3 | 4 | #include 5 | #include /* memcpy */ 6 | 7 | #include "oled_lib.h" 8 | 9 | ///////////////////////////////////////////////////////////////////////////////////////////////////////// 10 | // 11 | // Transmit a byte and ack bit 12 | // 13 | inline void i2cByteOut(uint8_t b) // This is only called from i2Cbegin, before tones are started so don't need to worry about 14 | { 15 | uint8_t i; 16 | 17 | CLEAR_SCL; 18 | 19 | for (i = 0; i < 8; i++) 20 | { 21 | CLEAR_SDA; 22 | if (b & 0x80) 23 | SET_SDA; 24 | 25 | SET_SCL; 26 | CLEAR_SCL; 27 | 28 | b <<= 1; 29 | } // for i 30 | // ack bit 31 | 32 | CLEAR_SDA; 33 | SET_SCL; 34 | CLEAR_SCL; 35 | 36 | } /* i2cByteOut() */ 37 | 38 | void i2cBegin(uint8_t addr) 39 | { 40 | SET_SDA; 41 | SET_SCL; 42 | 43 | OUTPUT_SDA; 44 | OUTPUT_SCL; 45 | 46 | CLEAR_SDA; 47 | CLEAR_SCL; 48 | 49 | i2cByteOut(addr << 1); // send the slave address 50 | } /* i2cBegin() */ 51 | 52 | void i2cWrite(uint8_t *pData, uint8_t bLen) 53 | { 54 | uint8_t i, b; 55 | 56 | while (bLen--) 57 | { 58 | b = *pData++; 59 | if (b == 0 || b == 0xff) // special case can save time 60 | { 61 | CLEAR_SDA; 62 | 63 | if (b & 0x80) 64 | SET_SDA; 65 | 66 | CLEAR_SCL; 67 | 68 | for (i = 0; i < 8; i++) 69 | { 70 | SET_SCL; 71 | CLEAR_SCL; 72 | } // for i 73 | } 74 | else // normal byte needs every bit tested 75 | { 76 | CLEAR_SCL; 77 | 78 | for (i = 0; i < 8; i++) 79 | { 80 | CLEAR_SDA; 81 | if (b & 0x80) 82 | SET_SDA; 83 | 84 | SET_SCL; 85 | CLEAR_SCL; 86 | 87 | b <<= 1; 88 | } // for i 89 | 90 | } 91 | 92 | CLEAR_SDA; 93 | SET_SCL; 94 | CLEAR_SCL; 95 | } // for each byte 96 | } /* i2cWrite() */ 97 | 98 | // 99 | // Send I2C STOP condition 100 | // 101 | void i2cEnd() 102 | { 103 | 104 | CLEAR_SDA; 105 | SET_SCL; 106 | SET_SDA; 107 | 108 | asm("cbi 0x17, 2\n"); // 0x17 = DDRB &= ~(1<<2); 109 | asm("cbi 0x18, 0\n"); // DDRB &= ~(1<<0); 110 | } /* i2cEnd() */ 111 | 112 | // Wrapper function to write I2C data on Arduino 113 | void I2CWrite(int iAddr, unsigned char *pData, int iLen) 114 | { 115 | i2cBegin(oled_addr); 116 | i2cWrite(pData, iLen); 117 | i2cEnd(); 118 | } /* I2CWrite() */ 119 | 120 | 121 | void oledInit(uint8_t bAddr, int bFlip, int bInvert) 122 | { 123 | unsigned char uc[4]; 124 | unsigned char oled_initbuf[] = {0x00, 0xae, 0xa8, 0x3f, 0xd3, 0x00, 0x40, 0xa1, 0xc8, 125 | 0xda, 0x12, 0x81, 0xff, 0xa4, 0xa6, 0xd5, 0x80, 0x8d, 0x14, 126 | 0xaf, 0x20, 0x02 127 | }; 128 | // unsigned char oled_initbuf[]={0x00, 0xA3, 0xC8,0xA1,0xA8, 0x3F,0xDA, 0x12, 0x8D, 0x14, 0xA5,0xAF}; 129 | 130 | oled_addr = bAddr; 131 | I2CDDR &= ~(1 << BB_SDA); 132 | I2CDDR &= ~(1 << BB_SCL); // let them float high 133 | I2CPORT |= (1 << BB_SDA); // set both lines to get pulled up 134 | I2CPORT |= (1 << BB_SCL); 135 | 136 | I2CWrite(oled_addr, oled_initbuf, sizeof(oled_initbuf)); 137 | if (bInvert) 138 | { 139 | uc[0] = 0; // command 140 | uc[1] = 0xa7; // invert command 141 | I2CWrite(oled_addr, uc, 2); 142 | } 143 | if (bFlip) // rotate display 180 144 | { 145 | uc[0] = 0; // command 146 | uc[1] = 0xa0; 147 | I2CWrite(oled_addr, uc, 2); 148 | uc[1] = 0xc0; 149 | I2CWrite(oled_addr, uc, 2); 150 | } 151 | } /* oledInit() */ 152 | 153 | // Send a single byte command to the OLED controller 154 | void oledWriteCommand(unsigned char c) 155 | { 156 | unsigned char buf[2]; 157 | 158 | buf[0] = 0x00; // command introducer 159 | buf[1] = c; 160 | I2CWrite(oled_addr, buf, 2); 161 | } /* oledWriteCommand() */ 162 | 163 | void oledWriteCommand2(unsigned char c, unsigned char d) 164 | { 165 | unsigned char buf[3]; 166 | 167 | buf[0] = 0x00; 168 | buf[1] = c; 169 | buf[2] = d; 170 | I2CWrite(oled_addr, buf, 3); 171 | } /* oledWriteCommand2() */ 172 | 173 | // 174 | // Sets the brightness (0=off, 255=brightest) 175 | // 176 | void oledSetContrast(unsigned char ucContrast) 177 | { 178 | oledWriteCommand2(0x81, ucContrast); 179 | } /* oledSetContrast() */ 180 | 181 | // 182 | // Send commands to position the "cursor" (aka memory write address) 183 | // to the given row and column 184 | // 185 | void oledSetPosition(int x, int y) 186 | { 187 | ////ssd1306_send_command3(renderingFrame | (y >> 3), 0x10 | ((x & 0xf0) >> 4), x & 0x0f); 188 | /* oledWriteCommand(0xb0 | (y >> 3)); //x); // go to page Y 189 | oledWriteCommand(0x10 | ((x & 0xf)>>4)); // upper col addr 190 | oledWriteCommand(0x00 | (x & 0xf)); // // lower col addr*/ 191 | 192 | oledWriteCommand(0xb0 | y >> 3); // go to page Y 193 | oledWriteCommand(0x00 | (x & 0xf)); // // lower col addr 194 | oledWriteCommand(0x10 | ((x >> 4) & 0xf)); // upper col addr 195 | //iScreenOffset = (y*128)+x; 196 | } 197 | 198 | void oledWriteDataBlock(const uint8_t *ucBuf, int iLen) 199 | { 200 | unsigned char ucTemp[17]; // 16 bytes max width + 1 201 | 202 | ucTemp[0] = 0x40; // data command 203 | memcpy(&ucTemp[1], ucBuf, iLen); 204 | 205 | I2CWrite(oled_addr, ucTemp, iLen + 1); 206 | // Keep a copy in local buffer 207 | } 208 | 209 | void oledFill(unsigned char ucData) 210 | { 211 | int x, y; 212 | unsigned char temp[16] = {0}; 213 | 214 | memset(temp, ucData, 16); 215 | for (y = 0; y < 8; y++) 216 | { 217 | oledSetPosition(0, y * 8); // set to (0,Y) 218 | for (x = 0; x < 8; x++) 219 | { 220 | oledWriteDataBlock(temp, 16); 221 | } // for x 222 | } // for y 223 | } /* oledFill() */ 224 | ///////////////////////////////////////////////////////////////////////////////////////////////////////// 225 | -------------------------------------------------------------------------------- /TinyMario/oled_lib.h: -------------------------------------------------------------------------------- 1 | 2 | #define CLEAR_SCL asm("cbi 0x18, 2\n") // 0x18 = PORTB, i.e. PORTB &= ~(1<<2); 3 | #define CLEAR_SDA asm("cbi 0x18, 0\n") // PORTB &= ~ (1<<0); 4 | #define SET_SCL asm("sbi 0x18, 2\n") // 5 | #define SET_SDA asm("sbi 0x18, 0\n") 6 | 7 | #define OUTPUT_SCL asm("sbi 0x17, 2\n") // 0x17 = DDRB, 2 = PB2 = SCL 8 | #define OUTPUT_SDA asm("sbi 0x17, 0\n") // 0x17 = DDRB, 0 = PB0 = SDA 9 | 10 | #define INPUT_SCL asm("cbi 0x17, 2\n") // DDRB &= ~(1<<2); 11 | #define INPUT_SDA asm("cbi 0x17, 0\n") // DDRB &= ~(1<<0); 12 | 13 | //#define DIRECT_PORT 14 | #define I2CPORT PORTB 15 | // A bit set to 1 in the DDR is an output, 0 is an INPUT 16 | #define I2CDDR DDRB 17 | 18 | // Pin or port numbers for SDA and SCL 19 | #define BB_SDA 0 //2 20 | #define BB_SCL 2 //3 21 | 22 | //#define I2C_CLK_LOW() I2CPORT &= ~(1 << BB_SCL) //compiles to cbi instruction taking 2 clock cycles, extending the clock pulse 23 | 24 | uint8_t oled_addr; 25 | 26 | //inline void i2cByteOut(uint8_t); 27 | void i2cBegin(uint8_t); 28 | void i2cWrite(uint8_t *, uint8_t); 29 | void i2cEnd(void); 30 | void I2CWrite(int, unsigned char*, int); 31 | void oledInit(uint8_t, int, int); 32 | void oledWriteCommand(unsigned char); 33 | void oledWriteCommand2(unsigned char, unsigned char); 34 | void oledSetContrast(unsigned char); 35 | void oledSetPosition(int, int); 36 | void oledWriteDataBlock(const uint8_t *, int); 37 | void oledFill(unsigned char); 38 | void oledWriteCommand(unsigned char c); 39 | --------------------------------------------------------------------------------