Index: tools/genlang =================================================================== --- tools/genlang (revision 14594) +++ tools/genlang (working copy) @@ -529,6 +529,18 @@ /* this contains the concatenation of all strings, separated by \\0 chars */ extern const unsigned char language_builtin[]; +#include "${prefix}_enum.h" + +MOO + ; + + close(HFILE); + + open(HFILE, ">${prefix}_enum.h") || + die "couldn't create file ${prefix}_enum.h\n"; + + print HFILE <lcd_update(); } +static short oldx, oldy = 0; /* ---- Switch mark on board ---- */ void cb_switch ( short x , short y ) { + if (rb->talk_menus_enabled() && (x != oldx || y != oldy)) { + short c, r; + short l, piece, p_color; + + rb->do_shutup(); + cr2xy(x, y, &c, &r); + l = locn[r][c]; + piece = board[l]; + p_color = color[l]; + if (piece != no_piece) { + rb->talk_id (VOICE_WHITE + p_color, true); + if (piece >= pawn && piece <= king) { + rb->talk_id (VOICE_PAWN + piece - 1, true); + } + } + rb->talk_id (VOICE_CHAR_A + c, true); + rb->talk_id (VOICE_ONE + r, true); + oldx = x; + oldy = y; + } rb->lcd_set_drawmode ( DRMODE_COMPLEMENT ); rb->lcd_drawrect ( XOFS + x*TILE_WIDTH + 1 , YOFS + ( 7 - y )*TILE_HEIGHT +1 , @@ -994,6 +1016,7 @@ /* Add the ply to the PGN history (in algebraic notation) */ pgn_append_ply(rb, game, opponent, move_buffer, mate); + rb->talk_spell(move_buffer, true); rb->splash ( 0 , "Thinking..." ); #ifdef HAVE_ADJUSTABLE_CPU_FREQ rb->cpu_boost ( true ); @@ -1007,6 +1030,10 @@ */ if (move_buffer[0] != '\0'){ pgn_append_ply(rb, game, computer, move_buffer, mate); + rb->talk_id(VOICE_CHAR_A + move_buffer[0] - 'a', false); + rb->talk_id(VOICE_ONE + move_buffer[1] - '1', true); + rb->talk_id(VOICE_CHAR_A + move_buffer[2] - 'a', true); + rb->talk_id(VOICE_ONE + move_buffer[3] - '1', true); } else { pgn_set_result(rb, game, mate); } Index: apps/lang/english.lang =================================================================== --- apps/lang/english.lang (revision 14594) +++ apps/lang/english.lang (working copy) @@ -11241,3 +11241,115 @@ usbstack: "Device Driver" + + id: VOICE_WHITE + desc: spoken only, for announcing chess piece color + user: + + *: "" + + + *: "" + + + *: "White" + + + + id: VOICE_BLACK + desc: spoken only, for announcing chess piece color + user: + + *: "" + + + *: "" + + + *: "Black" + + + + id: VOICE_PAWN + desc: spoken only, for announcing chess piece names + user: + + *: "" + + + *: "" + + + *: "Pawn" + + + + id: VOICE_KNIGHT + desc: spoken only, for announcing chess piece names + user: + + *: "" + + + *: "" + + + *: "Knight" + + + + id: VOICE_BISHOP + desc: spoken only, for announcing chess piece names + user: + + *: "" + + + *: "" + + + *: "Bishop" + + + + id: VOICE_ROOK + desc: spoken only, for announcing chess piece names + user: + + *: "" + + + *: "" + + + *: "Rook" + + + + id: VOICE_QUEEN + desc: spoken only, for announcing chess piece names + user: + + *: "" + + + *: "" + + + *: "Queen" + + + + id: VOICE_KING + desc: spoken only, for announcing chess piece names + user: + + *: "" + + + *: "" + + + *: "King" + + Index: apps/plugin.c =================================================================== --- apps/plugin.c (revision 14594) +++ apps/plugin.c (working copy) @@ -235,6 +235,18 @@ mkdir, rmdir, + /* talking */ + is_voice_queued, + talk_id, + talk_file, + talk_number, + talk_value, + talk_spell, + talk_menus_enabled, + talk_disable_menus, + talk_enable_menus, + do_shutup, + /* kernel/ system */ PREFIX(sleep), yield, Index: apps/plugin.h =================================================================== --- apps/plugin.h (revision 14594) +++ apps/plugin.h (working copy) @@ -324,6 +324,18 @@ int (*mkdir)(const char *name); int (*rmdir)(const char *name); + /* talking */ + bool (*is_voice_queued)(void); /* Are there more voice clips to be spoken? */ + int (*talk_id)(long id, bool enqueue); /* play a voice ID from voicefont */ + int (*talk_file)(const char* filename, bool enqueue); /* play a thumbnail from file */ + int (*talk_number)(long n, bool enqueue); /* say a number */ + int (*talk_value)(long n, int unit, bool enqueue); /* say a numeric value */ + int (*talk_spell)(const char* spell, bool enqueue); /* spell a string */ + bool (*talk_menus_enabled)(void); /* returns true if menus should be voiced */ + void (*talk_disable_menus)(void); /* disable voice menus (temporarily, not persisted) */ + void (*talk_enable_menus)(void); /* re-enable voice menus */ + int (*do_shutup)(void); /* kill voice unconditionally */ + /* kernel/ system */ void (*PREFIX(sleep))(int ticks); void (*yield)(void);