1010
Check-in [36b8d8890e]
Not logged in
Public Repositories
mwm's Repositories

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a couple of places that you could use the menu/paging system to resume a done game with new pieces.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:36b8d8890e1a591bb774b996a258252e2f449336
User & Date: mwm 2016-11-08 13:20:09
Context
2016-11-09
11:42
Integrate the DONE & MENU menu handling check-in: 0f10991731 user: mwm tags: trunk
2016-11-08
13:20
Fix a couple of places that you could use the menu/paging system to resume a done game with new pieces. check-in: 36b8d8890e user: mwm tags: trunk
2016-11-07
14:46
Move help pages to PROGMEM to save RAM. check-in: 0719801f3f user: mwm tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Tiny-1010.ino.

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
...
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521

void
loop(void) {
     const shape *const s = &shapes[game.waiting[selected]];
     const byte can_place = draw_game();

     arduboy.pollButtons();
     if (arduboy.justPressed(B_BUTTON)) {
          prompt = PAUSED;
          state = MENU;
          selected = RESUME;
          return;
     }

     switch (state) {
     case INIT:
          if (arduboy.justPressed(A_BUTTON)) {
               arduboy.initRandomSeed();
               state = MENU;
          }
          break;
     case MENU:
          if (arduboy.justPressed(A_BUTTON)) {
               do_menu();
          } else if (arduboy.justPressed(LEFT_BUTTON)) {
               if (selected)
................................................................................
     case PAGING:
          if (arduboy.justPressed(LEFT_BUTTON) && selected)
              selected -= 1;
          else if (arduboy.justPressed(RIGHT_BUTTON)
                   && selected < sizeof(help) / sizeof(char *) - 1)
               selected += 1;
          else if (arduboy.justPressed(UP_BUTTON)) {
               state = MENU;
               selected = HELP;
          }
          break;
     case SELECTING:
          if (arduboy.justPressed(UP_BUTTON))
               do {
                    if (selected)







|










|







 







|







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
...
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521

void
loop(void) {
     const shape *const s = &shapes[game.waiting[selected]];
     const byte can_place = draw_game();

     arduboy.pollButtons();
     if (arduboy.justPressed(B_BUTTON) && state != MENU && state != DONE) {
          prompt = PAUSED;
          state = MENU;
          selected = RESUME;
          return;
     }

     switch (state) {
     case INIT:
          if (arduboy.justPressed(A_BUTTON)) {
               arduboy.initRandomSeed();
               state = prompt == PAUSED ? MENU : DONE;
          }
          break;
     case MENU:
          if (arduboy.justPressed(A_BUTTON)) {
               do_menu();
          } else if (arduboy.justPressed(LEFT_BUTTON)) {
               if (selected)
................................................................................
     case PAGING:
          if (arduboy.justPressed(LEFT_BUTTON) && selected)
              selected -= 1;
          else if (arduboy.justPressed(RIGHT_BUTTON)
                   && selected < sizeof(help) / sizeof(char *) - 1)
               selected += 1;
          else if (arduboy.justPressed(UP_BUTTON)) {
               state = prompt == PAUSED ? MENU : DONE;
               selected = HELP;
          }
          break;
     case SELECTING:
          if (arduboy.justPressed(UP_BUTTON))
               do {
                    if (selected)