From 981376568cb8ca793856cd3df3b79477a26cee8b Mon Sep 17 00:00:00 2001 From: theflynn49 <{ID}+{username}@users.noreply.github.com> Date: Fri, 29 Sep 2023 01:10:40 +0200 Subject: [PATCH] Set legacy mode 1 for compatibility with VDP 1.04RC2 Fix P command in E)dit mode before keyin Remove legacy mode upon exit --- README.md | 11 +++-------- main.c | 18 +++++++++--------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index e7d853f..bcb7ce9 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,16 @@ # FSUDOKU -Version 1.1RC2 2023/09 +Version 1.1 2023/09 A simple game of Sudoku or alike for the AGON Light It works with - the agon-light-emulator from astralaster, +- the fab-agon-emulator from tomm - VDP/MOS 1.03/1.03 (on the emulator above) - VDP/MOS 1.04RC1/1.04RC1 (on AgonLight2 from Olimex) -- VDP/MOS 1.04RC1/1.04RC2 (id) - -On these environments : -- the fab-agon-emulator from tomm -- VDP 1.04RC2 - -You must enable the Legacy Modes with "VDU 23,0,&C1,1" because it uses the old modes the VDP. +- VDP/MOS 1.04RC2/1.04RC2 (uses legacy mode 1) ### Intent diff --git a/main.c b/main.c index 1a7417b..6dbbe5f 100644 --- a/main.c +++ b/main.c @@ -2,8 +2,8 @@ #include #include -#define TGT_VERSION " Version 1.1 2023/09 " -#define VERSION " Version 1.1RC2 23/09 " +#define VERSION " Version 1.1 2023/09 " +#define TGT_VERSION " Version 1.1RC2 23/09 " extern int generate_puzzle() ; extern int solve(int findall, int savefirst, int limit) ; @@ -324,9 +324,9 @@ void pr_error_type() tab(bias_X+4*9+15, bias_Y+15); color(menu_fg00, menu_bg00) ; switch(error_type) { - case 0 : printf("None ") ; break ; - case 1 : printf("Sudoku ") ; break ; - case 2 : printf("All ") ; break ; + case 0 : printf("None ") ; break ; + case 1 : printf("Sudoku") ; break ; + case 2 : printf("All ") ; break ; } } @@ -805,6 +805,7 @@ int mainEditloop() break ; case 'p' : case 'P' : gener_in_process ^= 1 ; + reset_constraints(1) ; drawNotes(grid) ; break ; case 'l' : @@ -904,7 +905,7 @@ int mainloop() case 'P' : if (notes_in==0) { memcpy(notes, grid, sizeof(grid)) ; - reset_constraints(1) ; // fallthrough + reset_constraints(1) ; notes_in=1 ; printInfo("Hit P again to get your notes back") ; } else { @@ -1145,7 +1146,7 @@ int main(int argc, char *argv[]) srand(time(NULL)) ; nb=100 ; while(rand()<0x100) if (nb--<=0) break ; - printf("\x16\x01 \n") ; // force mode 1 + rst18l("\x17\x00\xC1\x01 \x16\x01 \n", 27) ; // force legacy mode and mode 1 initCharSet() ; translate_grid(grid0S, sol_grid) ; translate_grid(grid0, grid) ; @@ -1158,7 +1159,6 @@ int main(int argc, char *argv[]) while(mainMenu()) ; color(15,0x80) ; - printf("\x0c %uld\n", time(NULL) ) ; - printf(" %uld\n", time(NULL) ) ; + rst18l(" \x17\x00\xC1\x00 \x16\x01 \x0C\r\n", 14) ; // remove legacy mode and set mode 1 return 0 ; }