Skip to content

Commit

Permalink
Set legacy mode 1 for compatibility with VDP 1.04RC2
Browse files Browse the repository at this point in the history
Fix P command in E)dit mode before keyin
Remove legacy mode upon exit
  • Loading branch information
theflynn49 authored and theflynn49 committed Sep 28, 2023
1 parent 91cbe9a commit 9813765
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
18 changes: 9 additions & 9 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include <stdio.h>
#include <string.h>

#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) ;
Expand Down Expand Up @@ -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 ;
}
}

Expand Down Expand Up @@ -805,6 +805,7 @@ int mainEditloop()
break ;
case 'p' :
case 'P' : gener_in_process ^= 1 ;
reset_constraints(1) ;
drawNotes(grid) ;
break ;
case 'l' :
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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) ;
Expand All @@ -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 ;
}

0 comments on commit 9813765

Please sign in to comment.