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.
C analog-photographycamera-firmwarecanoncanon-5d-mark-ivcanon-5dmark2canon-6dcanon-eoscr2darkroomeos-mfilm-emulationfilm-lookfilm-photographyfilm-simulationfujifilm-recipeskodak-portralutmagic-lanternphotographyraw
Viewfinder: an Exposure simulation switch, so LiveView is bright enough to focus a manual lens (#66)
Claude1a5a4358e5e0
diff --git a/README.md b/README.mdindex cf2297f..a1238bf 100644--- a/README.md+++ b/README.md@@ -62,6 +62,11 @@ the roll, then develop it and see what you got.Every RAW is kept, so nothing is lost: you can develop the same roll again with another film later.+**Focusing a manual lens.** Loading a roll sets the camera to the film's ISO, and LiveView shows the exposure+the frame will get: with a slow film, or an adapted lens stopped down, it can be too dark to focus. Turn off+*Settings → Viewfinder → Exposure simulation* and LiveView stays bright enough to focus, whatever the exposure.+(Not on the 600D and 1100D: Magic Lantern can't set it there.)+### How big the prints areThe camera's darkroom makes small prints, sized for the camera's screen, so it can develop a frame in thediff --git a/README.th.md b/README.th.mdindex 25f44c2..a1d99a3 100644--- a/README.th.md+++ b/README.th.md@@ -61,6 +61,10 @@ M-Film เปลี่ยนเมนูของกล้องเป็นหไฟล์ RAW ยังเก็บไว้ครบทุกรูป ไม่มีอะไรหาย จะเอาม้วนเดิมไปล้างใหม่ด้วยฟิล์มอื่นทีหลังก็ได้+**โฟกัสเลนส์แมนนวล** ใส่ฟิล์มแล้วกล้องจะตั้ง ISO ตามฟิล์ม และ LiveView จะแสดงแสงตามที่รูปจะได้จริง+ถ้าฟิล์มช้า หรือหรี่รูรับแสงของเลนส์แปลงไว้ ภาพอาจมืดจนโฟกัสไม่ได้ ปิด *Settings → Viewfinder → Exposure simulation*+แล้ว LiveView จะสว่างพอให้โฟกัสได้ ไม่ว่าค่าแสงจะเป็นเท่าไร (ไม่มีใน 600D และ 1100D เพราะ Magic Lantern ตั้งค่านี้ไม่ได้)+### รูปที่ล้างได้ใหญ่แค่ไหนห้องมืดในกล้องทำรูปขนาดเล็ก เท่ากับจอของกล้อง เพื่อให้ล้างได้ในหน่วยความจำอันน้อยนิดของกล้อง ถ้าอยากได้รูปความละเอียดเต็มdiff --git a/TESTING.md b/TESTING.mdindex 1b63529..ec54d56 100644--- a/TESTING.md+++ b/TESTING.md@@ -69,6 +69,8 @@ Go through these and note what happens (a photo of the screen helps a lot):- [ ] **Trash** opens Home; **PLAY** opens the prints instead of Canon's playback.- [ ] Load a roll and shoot a few frames **through the viewfinder**, and a few in **LiveView**.Does the frame count go up? Is the HUD drawn in LiveView?+- [ ] With a manual (adapted) lens, turn off *Viewfinder → Exposure simulation*. Is LiveView bright enough+ to focus? Does the HUD's meter needle still move when you half-press?- [ ] Rewind the roll and **develop it in the camera** (Darkroom). Do prints come out? How long per frame?- [ ] Open the card in **Darkrooms** on a computer: are the rolls and films there?diff --git a/docs/MANUAL.th.md b/docs/MANUAL.th.mdindex a710368..f965954 100644--- a/docs/MANUAL.th.md+++ b/docs/MANUAL.th.md@@ -62,6 +62,12 @@ System > Support M·FILM แสดง QR code ของลิงก์โดเ- **กล้อง DSLR ตอนถ่ายผ่านช่องมอง** (ไม่ได้เปิด LiveView): จอหลังแสดง "ฝาบนกล้องฟิล์ม" แทนหน้าข้อมูลของ Canonชัตเตอร์, ค่า f และนับรูปเป็นตัวเลข LED สีแดง, เข็มวัดแสงตอนกดชัตเตอร์ครึ่งเดียว, ฟิล์มกับ ISOปิดได้พร้อม HUD (Viewfinder > Viewfinder HUD) ไม่มีใน EOS M+- **Exposure simulation** (Viewfinder > Exposure simulation, #66): **On** LiveView แสดงแสงตามที่รูปจะได้จริง+ (ISO ของฟิล์มที่ตั้งตอนโหลดม้วน และรูรับแสงของเลนส์) **Off** Canon ปรับ LiveView ให้สว่างพอโฟกัสได้+ ไม่ว่าค่าแสงจะเป็นเท่าไร เหมาะกับเลนส์แมนนวลที่หรี่รูรับแสงไว้ หรือฟิล์มช้าในที่แสงน้อย+ เป็นค่าเดียวกับ Exposure simulation ของ Canon (ExpSim ในเมนู Magic Lantern) ถ้ายังไม่เคยตั้งที่นี่+ กล้องใช้ค่าของ Canon ตามเดิม ตั้งแล้ว M-Film ใส่ค่านี้กลับทุกครั้งที่เปิด LiveView และหลังโหลดม้วน+ เข็มวัดแสงใน HUD อ่านค่าวัดแสงของ Canon ไม่ใช่ความสว่างบนจอ ไม่มีใน 600D และ 1100D (Magic Lantern ตั้งค่านี้ไม่ได้)- **โหมดฟิล์ม** (System > Film mode): **Basic** (ค่าเริ่มต้น) ไม่ต้องกรอฟิล์ม ถ่ายครบม้วนแล้วส่งเข้าห้องมืดได้เลยม้วนที่ถ่ายครบแต่ยังอยู่ในกล้องก็ล้างได้ จะจบกลางม้วนใช้ Finish roll ที่หน้า Roll**Realistic** ต้องกรอฟิล์มกลับก่อนถึงจะล้างได้ เหมือนกล้องฟิล์มจริง ใน log ของม้วนเหมือนกันทั้งสองโหมดdiff --git a/ml-dev/filmos/fos.h b/ml-dev/filmos/fos.hindex 46df99e..e7856d4 100644--- a/ml-dev/filmos/fos.h+++ b/ml-dev/filmos/fos.h@@ -110,6 +110,8 @@ enumFS_SCR_SAT, FS_SCR_WARM, FS_SCR_BRIGHT, /* -FOS_SCR_STEPS..FOS_SCR_STEPS */FS_SCR_FLIP, /* swivel screens: 0 as Canon's hinge says, 1 normal, 2 upside down, 3 mirrored;the port answers -1 on a camera that can't, and the item isn't shown */+ FS_EXPSIM, /* LiveView's exposure simulation: 1 on (the exposure the frame gets), 0 off (bright+ enough to focus a manual lens); -1 where Magic Lantern can't set it: not shown */FS_COUNT};#define FOS_SCR_STEPS 6diff --git a/ml-dev/filmos/fos_pages.c b/ml-dev/filmos/fos_pages.cindex b8436dd..7c7ea0e 100644--- a/ml-dev/filmos/fos_pages.c+++ b/ml-dev/filmos/fos_pages.c@@ -311,6 +311,8 @@ static const struct item finder_items[] ={ "LEDs on half-press", IT_TOGGLE, FS_LEDS, 0, 0, "Like a real SLR: the readout lights only while metering." },{ "Focusing screen", IT_TOGGLE, FS_FOCUS, 0, 0, "A split-image circle and microprism collar (decoration only)." },{ "Wind lever", IT_CHOICE, FS_WIND, wind_choices, 3, "After each frame press SET to wind on. Locking is experimental." },+ /* the last row: pages_fit leaves it out where the camera can't */+ { "Exposure simulation", IT_TOGGLE, FS_EXPSIM, 0, 0, "On: LiveView shows the exposure you'll get. Off: bright, to focus a manual lens." },};static const struct item lens_items[] =@@ -351,18 +353,19 @@ static const struct item screen_items[] =static struct { const char *title; const char *sub; const struct item *items; int n; } pages[] ={- { "Viewfinder", "What you see in LiveView while you shoot", finder_items, 4 },- { "Lens", "Aperture for manual lenses", lens_items, 4 },+ { "Viewfinder", "What you see in LiveView while you shoot", finder_items, NITEMS(finder_items) },+ { "Lens", "Aperture for manual lenses", lens_items, NITEMS(lens_items) },{ "System", "Film mode, screen colour, start up and the Canon menu", system_items, NITEMS(system_items) },- { "Screen colour", "Live: the whole film OS changes as you go", screen_items, 5 },+ { "Screen colour", "Live: the whole film OS changes as you go", screen_items, NITEMS(screen_items) },};static int page, page_sel, page_top;#define P_KNOBS 12 /* one per row: more rows than any page has */static struct spring page_hl, page_scroll, knob[P_KNOBS];-/* The System page without what this camera can't do (the port answers -1- * for it: screen orientation on a fixed screen), worked out once. */+/* The pages without what this camera can't do (the port answers -1 for it:+ * screen orientation on a fixed screen, exposure simulation where Magic+ * Lantern can't set it), worked out once. */static struct item system_here[NITEMS(system_items)];static void pages_fit()@@ -379,6 +382,8 @@ static void pages_fit()}pages[PAGE_SYSTEM].items = system_here;pages[PAGE_SYSTEM].n = n;+ /* the Viewfinder page's last row: no copy needed (memory at boot) */+ if (fos_port_get(FS_EXPSIM) < 0) pages[0].n--;}static int help_fade; /* ms since the selection changed */@@ -599,6 +604,11 @@ static void preview_finder()fos_convex(cv, q, 3, FC(RAMP_GRAY, 12), OPAQUE);}fos_fill(cv, sx, horizon + 8, sw, sy + sh - horizon - 8, FC(RAMP_GRAY, 12));+ /* exposure simulation (the last row, where there is one) off: Canon+ * brightens LiveView, whatever the exposure */+ int es = pages[0].n - 1;+ if (pages[0].items[es].setting == FS_EXPSIM && knob[es].x < 0.99f)+ fos_blend(cv, sx, sy, sw, sh, FC(RAMP_GRAY, 255), (int) ((1 - knob[es].x) * 72));float hud = knob[0].x, leds_half = knob[1].x, focus = knob[2].x;int wind = fos_port_get(FS_WIND);diff --git a/ml-dev/filmos/preview/viewfinder.png b/ml-dev/filmos/preview/viewfinder.pngindex 72cdec3..2d7e7df 100644Binary files a/ml-dev/filmos/preview/viewfinder.png and b/ml-dev/filmos/preview/viewfinder.png differdiff --git a/ml-dev/filmos/sim/sim.c b/ml-dev/filmos/sim/sim.cindex e087b1b..4314f40 100644--- a/ml-dev/filmos/sim/sim.c+++ b/ml-dev/filmos/sim/sim.c@@ -38,7 +38,7 @@ 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_MODE] = 0,- [FS_FILM] = 0, [FS_EXP] = 0, [FS_SCR_FLIP] = 0,+ [FS_FILM] = 0, [FS_EXP] = 0, [FS_SCR_FLIP] = 0, [FS_EXPSIM] = 1,};static struct fos_roll roll = { 1, 12, 1, 36, 14, 0, "2026-10-21 18:02", 3,{ { 14, "21:47", "2" }, { 13, "21:40", "2" }, { 12, "21:33", "2.8" } } };@@ -183,6 +183,8 @@ int fos_port_get(int s){/* the screen orientation is only on swivel screens: not on the EOS M, unless FOS_SWIVEL=1 */if (s == FS_SCR_FLIP && !getenv("FOS_SWIVEL")) return -1;+ /* exposure simulation: FOS_NOEXPSIM=1 is a camera Magic Lantern can't set it on (600D, 1100D) */+ if (s == FS_EXPSIM && getenv("FOS_NOEXPSIM")) return -1;return s >= 0 && s < FS_COUNT ? settings[s] : 0;}void fos_port_set(int s, int v)diff --git a/ml-dev/fork/src/filmos_mod.h b/ml-dev/fork/src/filmos_mod.hindex 96d224e..9215125 100644--- a/ml-dev/fork/src/filmos_mod.h+++ b/ml-dev/fork/src/filmos_mod.h@@ -25,6 +25,7 @@ MODULE_CONFIGS_START()MODULE_CONFIG(scr_warm)MODULE_CONFIG(scr_bright)MODULE_CONFIG(scr_flip)+ MODULE_CONFIG(expsim_set)MODULE_CONFIG(roll_loaded)MODULE_CONFIG(roll_number)MODULE_CONFIG(roll_film)diff --git a/ml-dev/fork/src/filmroll.c b/ml-dev/fork/src/filmroll.cindex b072e00..8d88749 100644--- a/ml-dev/fork/src/filmroll.c+++ b/ml-dev/fork/src/filmroll.c@@ -89,6 +89,7 @@ static CONFIG_INT("filmroll.scr_sat", scr_sat, 0); /* -6..6 */static CONFIG_INT("filmroll.scr_warm", scr_warm, 0);static CONFIG_INT("filmroll.scr_bright", scr_bright, 0);static CONFIG_INT("filmroll.scr_flip", scr_flip, 0); /* 0 Canon's hinge, 1 normal, 2 upside down, 3 mirrored */+static CONFIG_INT("filmroll.expsim", expsim_set, -1); /* LiveView's exposure simulation: 1 on, 0 off, -1 as Canon has it *//* roll state, kept across power cycles */static CONFIG_INT("filmroll.loaded", roll_loaded, 0);@@ -289,6 +290,67 @@ static void apply_film(int index)lens_set_rawiso(iso_to_raw(f->iso));}+/* Exposure simulation (Viewfinder > Exposure simulation, #66). On, LiveView+ * shows the exposure the frame will get: at a slow film's ISO (loading a roll+ * sets it) and with a manual lens stopped down, too dark to focus. Off, Canon+ * shows LiveView at a brightness you can focus by, whatever the exposure. It+ * is Canon's own setting (PROP_LIVE_VIEW_VIEWTYPE), which Magic Lantern's+ * ExpSim item sets; that menu is gone (see the top), so it is here. Until it+ * is set here Canon's is left as it is; once it is, it goes back in when it+ * changes, when LiveView starts and after a roll is loaded. The HUD's meter+ * is Canon's reading of the exposure (get_ae_value), not of the picture on+ * the screen; that Canon keeps metering with it off wants checking on a+ * camera (the log has the reading each time it is set). Magic Lantern can't+ * set it on the 600D and 1100D (no CONFIG_EXPSIM): there the item isn't shown. */+static volatile int expsim_due = 0; /* set it at the next chance */++static int expsim_get()+{+#ifdef CONFIG_EXPSIM+ return expsim_set >= 0 ? expsim_set : get_expsim() != 0;+#else+ return -1;+#endif+}++/* called from the main loop */+static void expsim_step()+{+#ifdef CONFIG_EXPSIM+ static int was_lv = 0, tries = 0, wait_until = 0;+ int now = get_ms_clock();+ if (lv && !was_lv)+ {+ expsim_due = 1;+ wait_until = now + 1000; /* LiveView started: once it has settled */+ }+ was_lv = lv;+ if (!expsim_due) return;+ if (expsim_set < 0)+ {+ expsim_due = 0;+ return;+ }+ /* photo LiveView only (the 5D Mark II's movie display is its own), between pictures */+ if (!lv || is_movie_mode() || !job_state_ready_to_take_pic() || now - wait_until < 0)+ return;+ int want = expsim_set ? 1 : 0;+ if (get_expsim() != want && tries < 5)+ {+ tries++;+ set_expsim(want);+ dbg("expsim: %s, Canon's now %d (try %d), meter %d", want ? "on" : "off", get_expsim(), tries, get_ae_value());+ if (get_expsim() != want)+ {+ wait_until = get_ms_clock() + 1000;+ return;+ }+ }+ expsim_due = 0;+ tries = 0;+#endif+}+/* each frame is saved with a full-size RAW (RAW, or RAW+JPEG), so the* darkroom can develop it; a JPEG, mRAW or sRAW alone it can't */static int saves_raw()@@ -644,6 +706,7 @@ static void ui_task(int open)if (ui_after & AFTER_APPLY){apply_film(roll_film);+ expsim_due = 1;beep();film_capture_check();}@@ -1107,6 +1170,7 @@ static int *setting_var(int s)case FS_SCR_WARM: return &scr_warm;case FS_SCR_BRIGHT: return &scr_bright;case FS_SCR_FLIP: return &scr_flip;+ case FS_EXPSIM: return &expsim_set;}return 0;}@@ -1116,6 +1180,7 @@ int fos_port_get(int s)int *v = setting_var(s);if (s == FS_FSTOP) return current_fstop();if (s == FS_SCR_FLIP && !CAN_FLIP) return -1;+ if (s == FS_EXPSIM) return expsim_get();return v ? *v : 0;}@@ -1125,6 +1190,7 @@ void fos_port_set(int s, int value)if (v) *v = value;hud_dirty = 1;if (s == FS_SCR_FLIP) flip_step(1);+ if (s == FS_EXPSIM) expsim_due = 1;/* screen colour: the whole film OS changes at once */if (s == FS_SCR_STD || s == FS_SCR_SAT || s == FS_SCR_WARM || s == FS_SCR_BRIGHT){@@ -1929,6 +1995,7 @@ static void filmroll_task(){hud_step(); /* every 100 ms */flip_step(0);+ expsim_step();}#if !FOS_LV_ONLYelse if (plate_overdrawn())