Skip to content

M-Film: film simulation for Canon EOS cameras with Magic Lantern. 72 film stocks (Portra, Velvia, Tri-X, CineStill…), a film-camera interface and an in-camera darkroom that develops your RAWs. 5D Mark III, 6D, 600D, 650D, 700D, EOS M and more.

Film mode: Basic (no rewinding) or Realistic (rewind first), in System

Claude0e773e670e8d
diff --git a/docs/MANUAL.th.md b/docs/MANUAL.th.md
index dc60a1e..415a969 100644
--- a/docs/MANUAL.th.md
+++ b/docs/MANUAL.th.md
@@ -59,6 +59,9 @@ System > Support M·FILM แสดง QR code ของลิงก์โดเ
(ปิดได้ที่ System > PLAY shows prints only) ตั้งในเมนู Canon เองครั้งเดียว: Image quality = RAW
และ Image review = Off (ถ้ายังไม่ได้ตั้ง กล้องจะขึ้นข้อความเตือนตอนโหลดม้วน; ML ไม่เปลี่ยนค่าพวกนี้เอง
เพราะการเขียนค่า quality ของ Canon โดยตรงเสี่ยงทำให้เฟิร์มแวร์รวน)
+- **โหมดฟิล์ม** (System > Film mode): **Basic** (ค่าเริ่มต้น) ไม่ต้องกรอฟิล์ม ถ่ายครบม้วนแล้วส่งเข้าห้องมืดได้เลย
+ ม้วนที่ถ่ายครบแต่ยังอยู่ในกล้องก็ล้างได้ จะจบกลางม้วนใช้ Finish roll ที่หน้า Roll
+ **Realistic** ต้องกรอฟิล์มกลับก่อนถึงจะล้างได้ เหมือนกล้องฟิล์มจริง ใน log ของม้วนเหมือนกันทั้งสองโหมด
- ถ่ายครบม้วน กล้องจะเปิดหน้าถามเองหลังรูปสุดท้าย ~1.5 วินาที (หรือกด SET ตอนม้วนหมด)
กรอกลับกลางม้วนที่หน้า Roll ก็ถามแบบเดียวกัน
- ล้างด้วย CPU ของกล้องเอง (`fos_dev.c`): อ่าน CR2 ถอดรหัส lossless JPEG ทีละส่วน
diff --git a/docs/ROADMAP.th.md b/docs/ROADMAP.th.md
index 49efd14..960602f 100644
--- a/docs/ROADMAP.th.md
+++ b/docs/ROADMAP.th.md
@@ -14,7 +14,7 @@
- **ต่อไป:** ขอผู้ทดสอบส่งค่า Debug → *Free Memory* จาก ML ปกติ แล้วขยายพื้นที่จองให้แต่ละรุ่นแบบที่ทำกับ 6D (#8)
เริ่มจาก 70D ที่หน่วยความจำเหมือน 6D
-## 3. โหมด Basic / Realistic (ตั้งค่าใน System)
+## 3. โหมด Basic / Realistic (ตั้งค่าใน System) ✅
- **Basic** (ค่าเริ่มต้น): ไม่ต้องกรอฟิล์ม ถ่ายครบม้วนแล้วม้วนจบเองและส่งเข้าห้องมืดได้เลย ถ้าจะจบกลางม้วนใช้ "Finish roll" แทน Rewind
- **Realistic**: เหมือนตอนนี้ ต้องกรอฟิล์มกลับก่อนถึงจะล้างได้
- ใน log ของม้วน (`ROLL_nnn.TXT`) Basic เขียนบรรทัดจบม้วนให้เอง Darkrooms บนคอมจึงอ่านได้เหมือนเดิม
diff --git a/ml-dev/filmos/fos.h b/ml-dev/filmos/fos.h
index f11c0a0..87b9088 100644
--- a/ml-dev/filmos/fos.h
+++ b/ml-dev/filmos/fos.h
@@ -104,6 +104,7 @@ enum
FS_HUD, FS_LEDS, FS_FOCUS, FS_WIND,
FS_APKEYS, FS_LENS_WIDE, FS_FSTOP,
FS_STARTUP, FS_PLAYLOCK, FS_BOOTANIM, FS_DEBUG,
+ FS_MODE, /* film mode: 0 Basic (a finished roll goes straight to the darkroom), 1 Realistic (rewind it first) */
FS_FILM, FS_EXP,
FS_SCR_STD, /* screen colour: 0 Canon's conversion, 1 Rec.709 */
FS_SCR_SAT, FS_SCR_WARM, FS_SCR_BRIGHT, /* -FOS_SCR_STEPS..FOS_SCR_STEPS */
diff --git a/ml-dev/filmos/fos_dark.c b/ml-dev/filmos/fos_dark.c
index 0058dd4..2556a6e 100644
--- a/ml-dev/filmos/fos_dark.c
+++ b/ml-dev/filmos/fos_dark.c
@@ -64,7 +64,12 @@ static int roll_index(int number)
* (developing again skips the prints already made) */
/* developed: every frame printed, and every print in DCIM as a JPEG */
static int is_developed(const struct fos_lab_roll *r) { return r->sheet && r->developed >= r->shot && r->jpegs >= r->developed; }
-static int is_waiting(const struct fos_lab_roll *r) { return !is_developed(r) && !r->in_camera && r->shot > 0; }
+/* Basic mode: a finished roll still in the camera waits too; developing it finishes it (fos_port_action) */
+static int finished_in_camera(const struct fos_lab_roll *r) { return r->in_camera && !ui_realistic() && r->shot >= r->exposures; }
+static int is_waiting(const struct fos_lab_roll *r)
+{
+ return !is_developed(r) && (!r->in_camera || finished_in_camera(r)) && r->shot > 0;
+}
static int has_prints(const struct fos_lab_roll *r) { return r->sheet || r->developed > 0; }
/* about how long a frame takes, measured while developing */
@@ -127,7 +132,8 @@ static void dark_bake()
char b[96], eta[32];
int frames, waiting = count_waiting(&frames);
if (!nrolls)
- snprintf(b, sizeof(b), "No rolls yet " T_MDASH " finish one, rewind it, and it waits here.");
+ snprintf(b, sizeof(b), ui_realistic() ? "No rolls yet " T_MDASH " finish one, rewind it, and it waits here."
+ : "No rolls yet " T_MDASH " finish one, and it waits here.");
else if (waiting)
{
format_eta(eta, sizeof(eta), frames, 0);
@@ -192,7 +198,11 @@ static void dark_develop()
int nm = count_marked();
dark_queue_clear();
for (int i = nrolls - 1; i >= 0; i--)
- if (is_waiting(&rolls[i]) && (!nm || marked[i])) dark_queue_add(rolls[i].number);
+ if (is_waiting(&rolls[i]) && (!nm || marked[i]))
+ {
+ if (finished_in_camera(&rolls[i])) fos_port_action(FA_REWIND, 0, 0); /* out of the camera first */
+ dark_queue_add(rolls[i].number);
+ }
ui_go(SCR_DEVELOP, 0, GO_FADE);
}
@@ -214,7 +224,9 @@ void dark_key(int k)
break;
case FK_SET: case FK_RIGHT:
if (!r) break;
- if (r->in_camera) ui_toast("Still in the camera " T_MDASH " rewind it first");
+ if (r->in_camera && !finished_in_camera(r))
+ ui_toast(ui_realistic() ? "Still in the camera " T_MDASH " rewind it first"
+ : "Still in the camera " T_MDASH " finish it on the Roll page first");
else if (is_waiting(r) && k == FK_SET) marked[dk_sel] ^= 1;
else if (has_prints(r)) ui_go(SCR_PRINTS, r->number, GO_FADE);
break;
@@ -270,7 +282,7 @@ static void dark_row(int i, int y)
snprintf(b, sizeof(b), "Roll %03d " T_DOT " %d frame%s " T_DOT " %s", r->number, r->shot, r->shot == 1 ? "" : "s", short_date(when));
fos_text(cv, &fos_font_sm, x + 42, y + 48, b, C_TEXT3, OPAQUE, 0);
fcol c;
- if (r->in_camera) { snprintf(b, sizeof(b), "IN CAMERA"); c = C_TEXT3; }
+ if (r->in_camera && !finished_in_camera(r)) { snprintf(b, sizeof(b), "IN CAMERA"); c = C_TEXT3; }
else if (is_developed(r)) { snprintf(b, sizeof(b), "DEVELOPED"); c = C_TEXT3; }
else if (r->developed) { snprintf(b, sizeof(b), "%d OF %d DEVELOPED", r->developed, r->shot); c = C_ACCENT; }
else { snprintf(b, sizeof(b), "TO DEVELOP"); c = C_ACCENT; }
@@ -299,7 +311,7 @@ void dark_draw()
fos_clip(cv, 0, DK_Y, FOS_W, DK_Y + DK_ROWS * DK_ROW);
if (!nrolls)
{
- fos_text_c(cv, &fos_font_md, 360, DK_Y + 120, "Shot rolls appear here once they are rewound.", C_TEXT3, OPAQUE, 0);
+ fos_text_c(cv, &fos_font_md, 360, DK_Y + 120, ui_realistic() ? "Shot rolls appear here once they are rewound." : "Shot rolls appear here once they are finished.", C_TEXT3, OPAQUE, 0);
*cv = save;
return;
}
diff --git a/ml-dev/filmos/fos_pages.c b/ml-dev/filmos/fos_pages.c
index 597cc06..0282106 100644
--- a/ml-dev/filmos/fos_pages.c
+++ b/ml-dev/filmos/fos_pages.c
@@ -90,7 +90,7 @@ static void film_card()
if (left > 0)
snprintf(b, sizeof(b), "%d shot " T_DOT " %d left", shot, left);
else
- snprintf(b, sizeof(b), "End of roll " T_DOT " rewind to load");
+ snprintf(b, sizeof(b), ui_realistic() ? "End of roll " T_DOT " rewind to load" : "End of roll " T_DOT " ready to develop");
fos_text_c(cv, &fos_font_sm, cx, sy + 36, b, left > 0 ? C_TEXT2 : C_RED, OPAQUE, 0);
}
@@ -202,7 +202,7 @@ static void home_row(int i, int y, int selected)
switch (i)
{
case H_FILM:
- snprintf(sub, sizeof(sub), "%s", roll_active() ? "Change film (rewinds this roll)" : "Choose a stock and load a roll");
+ snprintf(sub, sizeof(sub), "%s", roll_active() ? (ui_realistic() ? "Change film (rewinds this roll)" : "Change film (finishes this roll)") : "Choose a stock and load a roll");
break;
case H_ROLL:
if (ui_roll.loaded)
@@ -225,7 +225,7 @@ static void home_row(int i, int y, int selected)
snprintf(sub, sizeof(sub), "%s", fos_port_lens_name());
break;
case H_SYSTEM:
- snprintf(sub, sizeof(sub), "Screen colour, start screen, Canon menu");
+ snprintf(sub, sizeof(sub), "%s mode " T_DOT " screen colour " T_DOT " Canon menu", ui_realistic() ? "Realistic" : "Basic");
break;
}
int x = LIST_X + 20;
@@ -302,6 +302,7 @@ struct item
static const char *const wind_choices[] = { "Off", "Reminder", "Locks shutter" };
static const char *const apkey_choices[] = { "Dial in Av", "Up / Down", "Menu only" };
static const char *const start_choices[] = { "Off", "When no film", "Always" };
+static const char *const mode_choices[] = { "Basic", "Realistic" };
static const struct item finder_items[] =
{
@@ -321,6 +322,7 @@ static const struct item lens_items[] =
static const struct item system_items[] =
{
+ { "Film mode", IT_CHOICE, FS_MODE, mode_choices, 2, "Basic: a finished roll goes straight to the darkroom. Realistic: rewind it first." },
{ "Start screen", IT_CHOICE, FS_STARTUP, start_choices, 3, "The film shelf when the camera turns on." },
{ "Boot animation", IT_TOGGLE, FS_BOOTANIM, 0, 0, "The aperture opening on the name at power on." },
{ "Screen colour", IT_PAGE, PAGE_SCREEN, 0, 0, "Match these colours to what you see around you." },
@@ -347,7 +349,7 @@ static const struct { const char *title; const char *sub; const struct item *ite
{
{ "Viewfinder", "What you see in LiveView while you shoot", finder_items, 4 },
{ "Lens", "Aperture for manual lenses", lens_items, 4 },
- { "System", "Screen colour, start up and the Canon menu", system_items, 9 },
+ { "System", "Film mode, screen colour, start up and the Canon menu", system_items, 10 },
{ "Screen colour", "Live: the whole film OS changes as you go", screen_items, 5 },
};
@@ -896,7 +898,7 @@ static void roll_bake()
ui_bg_plain();
ui_to_bg(1);
ui_status_bar("ROLL");
- struct hint h1[] = { { "SET", "Rewind roll" }, { "MENU", "Back" } };
+ struct hint h1[] = { { "SET", ui_realistic() ? "Rewind roll" : "Finish roll" }, { "MENU", "Back" } };
struct hint h2[] = { { "SET", "Load film" }, { "MENU", "Back" } };
if (ui_roll.loaded) ui_hints(h1, 2); else ui_hints(h2, 2);
ui_to_bg(0);
@@ -922,7 +924,7 @@ void roll_key(int k)
{
asking_rewind = 0;
rewinding = 1;
- rewind_t = 0;
+ rewind_t = ui_realistic() ? 0 : 1500; /* Basic: no rewinding to watch */
rewind_then = k == FK_SET;
rewind_number = ui_roll.number;
fos_port_action(FA_REWIND, 0, 0);
@@ -1079,7 +1081,7 @@ void roll_draw()
fos_text(cv, &fos_font_md, x + 140, y, b, C_TEXT3, OPAQUE, 0);
}
- if (rewinding)
+ if (rewinding && ui_realistic())
{
float t = clampf(rewind_t / 900.0f, 0, 1);
fos_text_c(cv, &fos_font_lg, 360, 420, "Rewinding" T_ELLIPSIS, FC(RAMP_GRAY, (int) (240 * ease_out(t))), OPAQUE, 0);
@@ -1088,13 +1090,14 @@ void roll_draw()
int left = ui_roll.exposures - ui_roll.shot;
if (left > 0)
{
- snprintf(b, sizeof(b), "Rewind roll %03d?", ui_roll.number);
+ snprintf(b, sizeof(b), ui_realistic() ? "Rewind roll %03d?" : "Finish roll %03d?", ui_roll.number);
snprintf(body, sizeof(body), "%d frames stay unexposed. Develop it now, or load a new roll first.", left);
}
else
{
snprintf(b, sizeof(b), "Roll %03d is finished", ui_roll.number);
- snprintf(body, sizeof(body), "Rewind it, then develop it now or load a new roll first.");
+ snprintf(body, sizeof(body), ui_realistic() ? "Rewind it, then develop it now or load a new roll first."
+ : "Develop it now, or load a new roll first.");
}
ui_sheet3(sheet.x, b, body, "Develop now", "New roll", left > 0 ? "Cancel" : "Not now");
}
diff --git a/ml-dev/filmos/fos_shelf.c b/ml-dev/filmos/fos_shelf.c
index 12e1e2f..f629205 100644
--- a/ml-dev/filmos/fos_shelf.c
+++ b/ml-dev/filmos/fos_shelf.c
@@ -675,7 +675,7 @@ static void chips_layout()
static void draw_static(int alpha)
{
struct hint h[] = { { "<>", "Film" }, { "^v", "Shelf" }, { "INFO", "Exposures" },
- { "SET", roll_in_progress() ? "Rewind & load" : "Load" }, { "MENU", "Back" },
+ { "SET", roll_in_progress() ? (ui_realistic() ? "Rewind & load" : "Finish & load") : "Load" }, { "MENU", "Back" },
{ "PLAY", "Sample" } };
if (alpha >= OPAQUE) ui_hints(h, has_samples ? 6 : 5);
/* the shelves, this one lit */
@@ -849,10 +849,10 @@ static void draw_info()
static void draw_sheet()
{
char t[48], b[96];
- snprintf(t, sizeof(t), "Rewind roll %03d?", ui_roll.number);
+ snprintf(t, sizeof(t), ui_realistic() ? "Rewind roll %03d?" : "Finish roll %03d?", ui_roll.number);
snprintf(b, sizeof(b), "%d of %d frames on %s are still unexposed. They will be lost.",
ui_roll.exposures - ui_roll.shot, ui_roll.exposures, fos_films[ui_roll.film].name);
- ui_sheet(sheet.x, t, b, "Rewind and load", "Keep shooting");
+ ui_sheet(sheet.x, t, b, ui_realistic() ? "Rewind and load" : "Finish and load", "Keep shooting");
}
/* SET: the leader is drawn out of the canister across the stage, the
diff --git a/ml-dev/filmos/fos_ui.h b/ml-dev/filmos/fos_ui.h
index b5f0d35..0b55b62 100644
--- a/ml-dev/filmos/fos_ui.h
+++ b/ml-dev/filmos/fos_ui.h
@@ -29,6 +29,10 @@ extern uint8_t *ui_bg; /* background of the current screen, same la
extern int ui_now; /* ms */
extern struct fos_roll ui_roll;
+/* film mode (System > Film mode): Realistic rewinds a roll before it can be developed, like a film
+ * camera; Basic just finishes it (the same in the roll's log), with no rewind to explain */
+#define ui_realistic() (fos_port_get(FS_MODE) == 1)
+
/* set when something else drew over the canvas (the shutter, a screen
* change): screens that redraw only what moved must redraw it all */
extern int ui_clobbered;
diff --git a/ml-dev/filmos/sim/sim.c b/ml-dev/filmos/sim/sim.c
index c719277..bb71c4e 100644
--- a/ml-dev/filmos/sim/sim.c
+++ b/ml-dev/filmos/sim/sim.c
@@ -37,7 +37,7 @@ static int nev, next_ev, end_t = 4000;
static int settings[FS_COUNT] = {
[FS_HUD] = 1, [FS_LEDS] = 1, [FS_FOCUS] = 1, [FS_WIND] = 1,
[FS_APKEYS] = 0, [FS_LENS_WIDE] = 6, [FS_FSTOP] = 10,
- [FS_STARTUP] = 2, [FS_PLAYLOCK] = 1, [FS_BOOTANIM] = 1, [FS_DEBUG] = 0,
+ [FS_STARTUP] = 2, [FS_PLAYLOCK] = 1, [FS_BOOTANIM] = 1, [FS_DEBUG] = 0, [FS_MODE] = 0,
[FS_FILM] = 0, [FS_EXP] = 0,
};
static struct fos_roll roll = { 1, 12, 1, 36, 14, 0, "2026-10-21 18:02", 3,
@@ -182,6 +182,7 @@ int main(int argc, char **argv)
if (argc < 3) { fprintf(stderr, "usage: sim script outdir\n"); return 1; }
outdir = argv[2];
if (strcmp(outdir, "-")) mkdir(outdir, 0755);
+ if (getenv("FOS_MODE")) settings[FS_MODE] = atoi(getenv("FOS_MODE")); /* 1: Realistic */
int open = FOS_OPEN_SHELF;
FILE *f = fopen(argv[1], "r");
if (!f) { perror(argv[1]); return 1; }
diff --git a/ml-dev/fork/src/filmroll.c b/ml-dev/fork/src/filmroll.c
index 50b8ffb..71944fe 100644
--- a/ml-dev/fork/src/filmroll.c
+++ b/ml-dev/fork/src/filmroll.c
@@ -64,6 +64,7 @@ static CONFIG_INT("filmroll.playlock", play_lock, 1);
static CONFIG_INT("filmroll.startup", startup_picker, 2); /* 0 off, 1 when no film, 2 always */
static CONFIG_INT("filmroll.bootanim", boot_anim, 1);
static CONFIG_INT("filmroll.debug", debug_log, 1);
+static CONFIG_INT("filmroll.mode", film_mode, 0); /* 0 Basic, 1 Realistic (FS_MODE) */
static CONFIG_INT("filmroll.lens_wide", lens_widest, 6); /* index into fos_fstops: f/1.8 */
static CONFIG_INT("filmroll.fstop", manual_fstop, 6);
static CONFIG_INT("filmroll.ap_keys", aperture_keys, 0); /* 0 wheel in Av, 1 up/down, 2 menu only */
@@ -836,6 +837,7 @@ static int *setting_var(int s)
case FS_PLAYLOCK: return &play_lock;
case FS_BOOTANIM: return &boot_anim;
case FS_DEBUG: return &debug_log;
+ case FS_MODE: return &film_mode;
case FS_FILM: return &film_sel;
case FS_EXP: return &exp_sel;
case FS_SCR_STD: return &scr_std;