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
Celeste: an option to show the room's code, for bug reports
Mason Chen641be34478b6
diff --git a/games/celeste/README.md b/games/celeste/README.mdindex 5b429abc..c9703229 100644--- a/games/celeste/README.md+++ b/games/celeste/README.md@@ -73,6 +73,7 @@ In menus, OK or EXE confirms and Back goes back. You can change the keys in Opti* **No music:** the calculator has no speaker.* **A few effects are simpler:** some glows, color filters and screen distortions are left out, and the Epilogue's last picture is shown at half size.* **Farewell isn't here:** the free chapter added after the game's release doesn't fit.+* **Reporting a bug:** turn on Options, then Room Code, and the corner of the screen shows which room you are in.* **The game's cheat code works:** in the Prologue, walk left from the start into the hidden room, then press left, right, var, toolbox, up, up, down, left, toolbox and OK (toolbox is the grab key: use yours if you changed it). Every chapter opens with all its checkpoints, B-sides and C-sides, and the chapter panel gets a Room list to start anywhere.## Creditsdiff --git a/games/celeste/src/celeste.h b/games/celeste/src/celeste.hindex 64779a36..4f41026c 100644--- a/games/celeste/src/celeste.h+++ b/games/celeste/src/celeste.h@@ -211,6 +211,7 @@ void gfx_camera(float x, float y); /* world position of the view'sextern int g_camx, g_camy; /* floored */void gfx_hud(bool on); /* following draws ignore the camera */void gfx_present_all(void); /* letterbox and full redraw next frame */+void gfx_top_label(const char *s); /* a line of text in the top bar ("": none) */static inline uint16_t rgb(uint32_t c) { return (uint16_t)(((c >> 8) & 0xF800) | ((c >> 5) & 0x7E0) | ((c >> 3) & 0x1F)); }uint16_t blend565(uint16_t d, uint16_t s, int a); /* a: 0..256 */static inline uint16_t scale565(uint16_t c, int a) { /* c * a / 256 */diff --git a/games/celeste/src/game.c b/games/celeste/src/game.cindex 9dd1ea1b..d1c2e669 100644--- a/games/celeste/src/game.c+++ b/games/celeste/src/game.c@@ -104,5 +104,13 @@ void game_draw(void) {gfx_zoom(1, 0, 0);menu_render();wipe_render();+ { /* the room's code in the top bar (Options: for bug reports): the map's area and side, then the room */+ char code[24] = "";+ if (g_in_level && (g_save.options & OPT_ROOM)) {+ code[0] = (char)('0' + g_session.area), code[1] = (char)('A' + g_session.mode), code[2] = ' ';+ strncpy(code + 3, level_room_name(), sizeof code - 4);+ }+ gfx_top_label(code);+ }gfx_end();}diff --git a/games/celeste/src/gfx.c b/games/celeste/src/gfx.cindex 627a3809..e4270648 100644--- a/games/celeste/src/gfx.c+++ b/games/celeste/src/gfx.c@@ -6,6 +6,7 @@* pushes the strip to the screen. */#include <stdlib.h>#include "celeste.h"+#include "text.h"#define STRIP_H 15#define NSTRIPS (VIEW_H / STRIP_H)@@ -18,6 +19,8 @@ static float camx, camy;static bool hud, ui; /* hud: screen coordinates; ui: the interface (drawn after the zoom) */static uint16_t clear_color;static bool letterbox_dirty = true;+static char top_label[24]; /* a line in the top bar (the room's code), redrawn when it changes */+static bool top_dirty;enum { OP_TEX, OP_PART, OP_AFFINE, OP_RECT, OP_LINE, OP_PIXEL, OP_CUSTOM, OP_SCALED, OP_MASK, OP_TILES };@@ -55,6 +58,11 @@ void gfx_hud(bool on) { hud = ui = on; }void gfx_screen(bool on) { hud = on, ui = false; }void gfx_clear(uint16_t c) { clear_color = c; }void gfx_present_all(void) { letterbox_dirty = true; }+void gfx_top_label(const char *s) {+ if (!strncmp(s, top_label, sizeof top_label - 1)) return;+ strncpy(top_label, s, sizeof top_label - 1);+ top_dirty = true;+}#ifdef HOST#include <stdio.h>@@ -934,6 +942,7 @@ void gfx_end(void) {plat_fill(0, 0, SCREEN_W, VIEW_Y, 0);plat_fill(0, VIEW_Y + VIEW_H, SCREEN_W, SCREEN_H - VIEW_Y - VIEW_H, 0);letterbox_dirty = false;+ top_dirty = top_label[0] != 0;}ep_pal = 0xFFFF;g_res_can_load = false; /* the strip is the LZMA ring: nothing loads while strips are drawn */@@ -957,6 +966,12 @@ void gfx_end(void) {replay(y0, y1, 2);plat_push(0, VIEW_Y + y0, VIEW_W, STRIP_H, g_strip);}+ if (top_dirty) { /* (after the strips: the strip is free again) */+ for (int i = 0; i < VIEW_W * STRIP_H; i++) g_strip[i] = 0;+ text_into(g_strip, 0, STRIP_H, top_label, 4 * 6, STRIP_H * 3, 0, 0.5f, 0.7f, rgb(0xA0A0A0), 255);+ plat_push(0, (VIEW_Y - STRIP_H) / 2, VIEW_W, STRIP_H, g_strip);+ top_dirty = false;+ }g_res_can_load = true;g_res_drawing = false;}diff --git a/games/celeste/src/level.h b/games/celeste/src/level.hindex d4b16045..dc35cf9a 100644--- a/games/celeste/src/level.h+++ b/games/celeste/src/level.h@@ -178,7 +178,8 @@ typedef struct {ModeStats modes[AREAS][3];uint16_t cassettes; /* AreaStats.Cassette, a bit per area */uint8_t unlocked_areas, last_area, last_mode, revealed_ch9, summit_gems, key_sheet_seen;- uint8_t has_session, assists, options, flags; /* options: 1 no screen shake, 2 no flashes, 12 speedrun clock;+ uint8_t has_session, assists, options, flags; /* options: 1 no screen shake, 2 no flashes, 12 speedrun clock,+ 16 the room's code shown (OPT_ROOM);flags (SaveData.Flags): 1 MetTheo, 2 TheoKnowsName */uint32_t total_deaths, total_golden, total_jumps, total_wall_jumps, total_dashes, time;uint8_t bind[4]; /* jump, dash, grab, talk: EADK keys */@@ -189,6 +190,7 @@ typedef struct {uint8_t pad_[2];uint32_t checksum;} SaveData;+#define OPT_ROOM 16extern SaveData g_save;#define g_session (g_save.session)diff --git a/games/celeste/src/menu.c b/games/celeste/src/menu.cindex cbc2d517..ee960f2e 100644--- a/games/celeste/src/menu.c+++ b/games/celeste/src/menu.c@@ -466,12 +466,14 @@ static void options_draw(void) {menu_item(ui_str("OPTIONS_DISABLE_SHAKE"), on_off(!(g_save.options & OPT_SHAKE)), 2, 420 + ITEM_H * 2, false);menu_item(ui_str("OPTIONS_DISABLE_FLASH"), on_off(g_save.options & OPT_FLASH), 3, 420 + ITEM_H * 3, false);menu_item(ui_str("OPTIONS_SPEEDRUN"), ui_str(clocks[g_save.options >> 2 & 3]), 4, 420 + ITEM_H * 4, false);+ menu_item("Room Code", on_off(g_save.options & OPT_ROOM), 5, 420 + ITEM_H * 5, false); /* (for bug reports) */}static void options_update(void) {int d = dir_pressed(1);- if (d) M.sel = (int8_t)((M.sel + d + 5) % 5);+ if (d) M.sel = (int8_t)((M.sel + d + 6) % 6);int h = dir_pressed(0);bool ok = confirm();+ if (M.sel == 5 && (h || ok)) g_save.options ^= OPT_ROOM;if (M.sel == 2 && (h || ok)) g_save.options ^= OPT_SHAKE;if (M.sel == 3 && (h || ok)) g_save.options ^= OPT_FLASH;if (M.sel == 4 && (h || ok)) {