Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.
C calculatorcalculator-gamescasiochesscrossy-roaddrive-madfx-cg50gamesgeometry-dashgraphing-calculatorndlessnumworksnumworks-appsnumworks-calculatornumworks-gamenumworks-gamestetristi-84-plus-ceti-nspire
Doom: Always Run, and keys for the previous and next weapon
Mason363fa8393b1228f
diff --git a/games/doom/README.md b/games/doom/README.mdindex 5eeb015a..4a7bff9f 100644--- a/games/doom/README.md+++ b/games/doom/README.md@@ -80,6 +80,7 @@ Press a key on the title screen for the menu, then choose New Game, Knee-Deep in| x,n,t / var | Strafe left / right || alpha (held) | Run || 1 to 7 | Choose a weapon |+| ( / ) | The previous / next weapon you have || Toolbox | Automap: the map, the map over the game, the game || + / − | Screen size; on the automap, zoom || × / ÷ / 0 | Automap: follow you, grid, the whole map |@@ -94,7 +95,7 @@ In menus, the arrows choose, OK or EXE confirms and Back goes back. When the gam**Options, Keys** gives any key any action: choose an action, press the key (it shows each action's keys, on pages that Left and Right turn; THE KEYS AS THEY CAME puts them back). The keys and the options are kept in `doom.cfg`.-**Options, More Options**: Brightness (off and four levels, as vanilla's gamma), Map over the view (the automap's second mode), Secrets on the map (the walls of secret areas in their own colour), and Screen refresh (which way the calculator's panel is refreshed, see below).+**Options, More Options**: Brightness (off and four levels, as vanilla's gamma), Always run (as vanilla's autorun trick: you run without holding alpha), Map over the view (the automap's second mode), Secrets on the map (the walls of secret areas in their own colour), and Screen refresh (which way the calculator's panel is refreshed, see below).**Options, Cheats**: God mode (IDDQD), all weapons and keys (IDKFA), weapons and ammo (IDFA), no clipping (IDCLIP), warp (IDCLEV, Left and Right choose the level), a power (IDBEHOLD: invulnerability, strength, invisibility, radiation suit, the map, light amplification), the whole map (IDDT) and the chainsaw (IDCHOPPERS). The last line, or the ans key in the game, lets you type any code, IDMYPOS and IDSPISPOPD too: the letter keys type what is written above them in alpha, numbers are typed as they are.diff --git a/games/doom/src/doom/g_game.c b/games/doom/src/doom/g_game.cindex d5a49066..5970c552 100644--- a/games/doom/src/doom/g_game.c+++ b/games/doom/src/doom/g_game.c@@ -400,8 +400,14 @@ void G_BuildTiccmd (ticcmd_t* cmd, int maketic)// fraggle: support the old "joyb_speed = 31" hack which// allowed an autorun effect+#if NUMWORKS+ extern boolean nw_always_run;+#endifspeed = key_speed >= NUMKEYS|| is_gamekeydown(key_speed)+#if NUMWORKS+ || nw_always_run // (Options, More: always run)+#endif#if !NO_USE_JOYSTICK|| joybspeed >= MAX_JOY_BUTTONS|| joybuttons[joybspeed]diff --git a/games/doom/src/doom/m_menu.c b/games/doom/src/doom/m_menu.cindex ee165996..b3057fa5 100644--- a/games/doom/src/doom/m_menu.c+++ b/games/doom/src/doom/m_menu.c@@ -1032,6 +1032,7 @@ static const struct { const char *what; uint8_t actions[4]; } keys_page[] = {{"STRAFE (HELD)", {NA_STRAFE}},{"STRAFE LEFT, RIGHT", {NA_STRAFELEFT, NA_STRAFERIGHT}},{"RUN (HELD)", {NA_RUN}},+ {"PREVIOUS, NEXT WEAPON", {NA_PREVWEAPON, NA_NEXTWEAPON}},{"AUTOMAP", {NA_AUTOMAP}},{"SCREEN SIZE, MAP ZOOM", {NA_BIGGER, NA_SMALLER}},{"MAP: FOLLOW, GRID, ALL", {NA_FOLLOW, NA_GRID, NA_WHOLEMAP}},diff --git a/games/doom/src/m_controls.c b/games/doom/src/m_controls.cindex 176585f4..e61cc43f 100644--- a/games/doom/src/m_controls.c+++ b/games/doom/src/m_controls.c@@ -129,8 +129,8 @@ key_type_t key_weapon5 = '5';key_type_t key_weapon6 = '6';key_type_t key_weapon7 = '7';key_type_t key_weapon8 = '8';-key_type_t key_prevweapon = 0;-key_type_t key_nextweapon = 0;+key_type_t key_prevweapon = '['; // (the calculator's PREVIOUS WEAPON and NEXT WEAPON send these)+key_type_t key_nextweapon = ']';// Map control keys:diff --git a/games/doom/src/nw/i_input.c b/games/doom/src/nw/i_input.cindex 9fa9b397..8577dfd7 100644--- a/games/doom/src/nw/i_input.c+++ b/games/doom/src/nw/i_input.c@@ -12,7 +12,7 @@* x,n,t var strafe left, strafe right* toolbox the automap; in it, + and - zoom, x follows, / shows the grid, 0 shows the whole map,* 8 puts a mark, 9 takes them away- * 1 to 7 the weapons+ * 1 to 7 the weapons; ( and ) the previous and next one you have* + - the screen bigger, smaller* sqrt brightness* ln, log quick save, quick load@@ -37,6 +37,7 @@ int M_BackKey(void);boolean M_WantsEnter(void);boolean nw_home;+boolean nw_always_run;/* the Doom key each held key pressed (released with the same one), or NW_SENT_NONE for one that pressed none */#define NW_SENT_NONE 0x100static uint16_t sent[NK_COUNT];@@ -77,6 +78,8 @@ const nw_action_t nw_actions[NA_COUNT] = {[NA_MESSAGES] = {"MESSAGES ON, OFF", KEY_F8},[NA_DETAIL] = {"DETAIL HIGH, LOW", KEY_F5},[NA_CHEAT] = {"TYPE A CHEAT", 0},+ [NA_NEXTWEAPON] = {"NEXT WEAPON", ']'},+ [NA_PREVWEAPON] = {"PREVIOUS WEAPON", '['},};/* the calculator's keys, as the options and Read This! show them ("" for those that are not keys) */@@ -107,6 +110,7 @@ void nw_bindings_default(void) {{NK_PLUS, NA_BIGGER}, {NK_MINUS, NA_SMALLER}, {NK_MUL, NA_FOLLOW}, {NK_DIV, NA_GRID},{NK_ZERO, NA_WHOLEMAP}, {NK_EIGHT, NA_MARK}, {NK_NINE, NA_CLEARMARKS}, {NK_SQRT, NA_GAMMA},{NK_LN, NA_QUICKSAVE}, {NK_LOG, NA_QUICKLOAD}, {NK_PI, NA_PAUSE}, {NK_ANS, NA_CHEAT},+ {NK_LPAREN, NA_PREVWEAPON}, {NK_RPAREN, NA_NEXTWEAPON},};memset(nw_binding, NA_NONE, sizeof nw_binding);for (unsigned i = 0; i < sizeof def / sizeof def[0]; i++) nw_binding[def[i][0]] = def[i][1];diff --git a/games/doom/src/nw/nw.h b/games/doom/src/nw/nw.hindex 4da7693a..e31d47f8 100644--- a/games/doom/src/nw/nw.h+++ b/games/doom/src/nw/nw.h@@ -27,6 +27,7 @@ void nw_show_error(const char *msg);/* i_input.c: Home or On/Off is pressed (the moment is kept, then the app quits) */extern boolean nw_home;+extern boolean nw_always_run; /* Options, More: run without holding the run key */void nw_input_init(void);/* the calculator's keys (eadk_key_*) */enum {@@ -43,7 +44,8 @@ enum {NA_NONE, NA_FORWARD, NA_BACKWARD, NA_TURNLEFT, NA_TURNRIGHT, NA_FIRE, NA_USE, NA_STRAFE, NA_RUN,NA_STRAFELEFT, NA_STRAFERIGHT, NA_WEAPON1, NA_WEAPON2, NA_WEAPON3, NA_WEAPON4, NA_WEAPON5, NA_WEAPON6,NA_WEAPON7, NA_AUTOMAP, NA_MENU, NA_PAUSE, NA_BIGGER, NA_SMALLER, NA_FOLLOW, NA_GRID, NA_WHOLEMAP, NA_MARK,- NA_CLEARMARKS, NA_GAMMA, NA_QUICKSAVE, NA_QUICKLOAD, NA_MESSAGES, NA_DETAIL, NA_CHEAT, NA_COUNT+ NA_CLEARMARKS, NA_GAMMA, NA_QUICKSAVE, NA_QUICKLOAD, NA_MESSAGES, NA_DETAIL, NA_CHEAT, NA_NEXTWEAPON,+ NA_PREVWEAPON, NA_COUNT};typedef struct {const char *name;diff --git a/games/doom/src/nw/nw_menu.inc b/games/doom/src/nw/nw_menu.incindex 0ed7645a..61e43463 100644--- a/games/doom/src/nw/nw_menu.inc+++ b/games/doom/src/nw/nw_menu.inc@@ -215,7 +215,7 @@ static void M_NwCheats(int choice)}// ---------------------------------------------------------------- more-enum { more_bright, more_overlay, more_secrets, more_sync, more_end };+enum { more_bright, more_run, more_overlay, more_secrets, more_sync, more_end };// (the settings loaded: the screen size and detail they have)void M_NwViewLoaded(void)@@ -229,6 +229,7 @@ static void M_NwMoreItem(int choice)switch (itemOn){case more_bright: M_NwBrightness(choice); break;+ case more_run: nw_always_run = !nw_always_run; break;case more_overlay: nw_map_overlay = !nw_map_overlay; break;case more_secrets: nw_map_secrets = !nw_map_secrets; break;case more_sync:@@ -245,13 +246,14 @@ static void M_NwMoreItem(int choice)static const menuitem_t MoreMenu[] = {{2, VPATCH_NAME_INVALID, 'b', M_NwMoreItem},+ {2, VPATCH_NAME_INVALID, 'a', M_NwMoreItem},{2, VPATCH_NAME_INVALID, 'm', M_NwMoreItem},{2, VPATCH_NAME_INVALID, 's', M_NwMoreItem},{2, VPATCH_NAME_INVALID, 'r', M_NwMoreItem},};static void M_DrawNwMore(void);-menu_t MoreDef = {more_end, &OptionsDef, MoreMenu, M_DrawNwMore, 40, 40, 0};+menu_t MoreDef = {more_end, &OptionsDef, MoreMenu, M_DrawNwMore, 40, 30, 0};static void M_DrawNwMore(void){@@ -260,15 +262,17 @@ static void M_DrawNwMore(void)nw_value_x = 150;M_NwTitle("MORE OPTIONS");M_NwLine(&MoreDef, more_bright, "BRIGHTNESS", levels[usegamma]);+ M_NwLine(&MoreDef, more_run, "ALWAYS RUN", nw_always_run ? "ON" : "OFF");M_NwLine(&MoreDef, more_overlay, "MAP OVER THE VIEW", nw_map_overlay ? "ON" : "OFF");M_NwLine(&MoreDef, more_secrets, "SECRETS ON THE MAP", nw_map_secrets ? "PURPLE" : "OFF");M_NwLine(&MoreDef, more_sync, "SCREEN REFRESH", sync[nw_sync_off ? 2 : nw_scan_right_to_left]);static const char *const notes[] = {- "THE MAP KEY GOES FROM THE VIEW TO THE MAP,", "TO THE MAP OVER THE VIEW, THEN BACK.", "",+ "THE MAP KEY GOES FROM THE VIEW TO THE MAP,", "TO THE MAP OVER THE VIEW, THEN BACK.","THE PICTURE IS SENT AS THE CALCULATOR'S", "SCREEN REFRESHES: IF IT TEARS, TRY THE", "OTHER WAY ROUND.",};+ // (above the status bar)for (unsigned i = 0; i < sizeof notes / sizeof notes[0]; i++)- M_WriteText(16, MoreDef.y + LINEHEIGHT * more_end + 8 + 10 * i, notes[i]);+ M_WriteText(16, MoreDef.y + LINEHEIGHT * more_end + 6 + 10 * i + (i >= 2 ? 4 : 0), notes[i]);}static void M_NwMore(int choice)diff --git a/games/doom/src/nw/saves.c b/games/doom/src/nw/saves.cindex a10a85fe..972f3911 100644--- a/games/doom/src/nw/saves.c+++ b/games/doom/src/nw/saves.c@@ -157,10 +157,10 @@ void nw_resume_done(void) {/* ------------------------------------------------------------------ settings */boolean nw_first_start;-/* 'D', the version (2), messages, brightness, the map over the view, secrets on the map, the screen's refresh- * (left to right, right to left, none), the detail, the screen size, then each calculator key's action (NK_COUNT- * of them) */-#define CFG_LEN (9 + NK_COUNT)+/* 'D', the version (3), messages, brightness, the map over the view, secrets on the map, the screen's refresh+ * (left to right, right to left, none), the detail, the screen size, always run, then each calculator key's+ * action (NK_COUNT of them). Version 2 had no always run. */+#define CFG_LEN (10 + NK_COUNT)extern int nw_map_overlay, nw_map_secrets, nw_scan_right_to_left, nw_sync_off;extern isb_int8_t detailLevel, screenblocks;@@ -168,25 +168,31 @@ void nw_settings_load(void) {uint32_t len;const uint8_t *d = plat_load(CFG_NAME, &len);nw_first_start = !d;- if (!d || len < 4 || d[0] != 'D' || (d[1] != 1 && d[1] != 2)) return;+ if (!d || len < 4 || d[0] != 'D' || d[1] < 1 || d[1] > 3) return;showMessages = d[2] ? 1 : 0;usegamma = d[3] <= 4 ? d[3] : 0;- if (d[1] != 2 || len != CFG_LEN) return;+ if (d[1] == 1 || len != CFG_LEN - (d[1] == 2)) return;nw_map_overlay = d[4] != 0;nw_map_secrets = d[5] != 0;nw_scan_right_to_left = d[6] == 1;nw_sync_off = d[6] == 2;detailLevel = d[7] == 1;screenblocks = d[8] >= 3 && d[8] <= 11 ? d[8] : 10;- for (int k = 0; k < NK_COUNT; k++) nw_binding[k] = d[9 + k] < NA_COUNT ? d[9 + k] : NA_NONE;+ int at = 9;+ if (d[1] == 3) nw_always_run = d[at++] != 0;+ for (int k = 0; k < NK_COUNT; k++) nw_binding[k] = d[at + k] < NA_COUNT ? d[at + k] : NA_NONE;+ if (d[1] == 2) { /* (the weapon keys came after: on ( and ) if those do nothing) */+ if (nw_binding[NK_LPAREN] == NA_NONE) nw_binding[NK_LPAREN] = NA_PREVWEAPON;+ if (nw_binding[NK_RPAREN] == NA_NONE) nw_binding[NK_RPAREN] = NA_NEXTWEAPON;+ }M_NwViewLoaded();}void nw_settings_save(void) {- uint8_t d[CFG_LEN] = {'D', 2, (uint8_t)showMessages, (uint8_t)usegamma, (uint8_t)nw_map_overlay,+ uint8_t d[CFG_LEN] = {'D', 3, (uint8_t)showMessages, (uint8_t)usegamma, (uint8_t)nw_map_overlay,(uint8_t)nw_map_secrets, (uint8_t)(nw_sync_off ? 2 : nw_scan_right_to_left),- (uint8_t)detailLevel, (uint8_t)screenblocks};- memcpy(d + 9, nw_binding, NK_COUNT);+ (uint8_t)detailLevel, (uint8_t)screenblocks, (uint8_t)nw_always_run};+ memcpy(d + 10, nw_binding, NK_COUNT);uint32_t len;const uint8_t *old = plat_load(CFG_NAME, &len);if (old && len == sizeof d && !memcmp(old, d, sizeof d)) return;