summaryrefslogtreecommitdiff
path: root/map65/libm65/m65_mod.f90
diff options
context:
space:
mode:
Diffstat (limited to 'map65/libm65/m65_mod.f90')
-rw-r--r--map65/libm65/m65_mod.f9021
1 files changed, 4 insertions, 17 deletions
diff --git a/map65/libm65/m65_mod.f90 b/map65/libm65/m65_mod.f90
index 7710293f..a7b8b581 100644
--- a/map65/libm65/m65_mod.f90
+++ b/map65/libm65/m65_mod.f90
@@ -11,6 +11,7 @@ subroutine m65c() bind(C)
use decode0_mod
use npar_ptrs_mod, only: nhsym, nrxlog, datetime, active_input_generation, nagain, ndiskdat, manualDecodeFlag
use debug_log, only: dbg, itoa, rtoa
+ use message_history_mod, only: clear_messages
use sec_midn_mod, only: sec_midn
integer :: npatience, nstandalone
integer, save :: nhsym_prev_m65c = -1
@@ -32,30 +33,16 @@ subroutine m65c() bind(C)
nrxlog = ibclr(nrxlog,1)
endif
if(iand(nrxlog,4).ne.0) then
- ! rewind alone only repositions to record 1 for writing; it does not
- ! shrink the file, so old history beyond whatever gets written this
- ! cycle would stay on disk and could resurface via display.f90's own
- ! rewind+read the same way the missing endfile there did (see
- ! set_map65RxLog in npar_ptrs_mod.f90 for how Erase reaches here).
- ! endfile makes this an immediate, real truncation to empty -- but it
- ! leaves the file positioned after the EOF marker it just wrote, and
- ! Fortran forbids further sequential I/O from there without
- ! repositioning first, so backspace right away to land back on that
- ! marker, ready for the next append.
- !
! An expired final request must not hide the next accumulation cycle.
if(nhsym.eq.nhsym1 .and. (nhsym_prev_m65c.ne.nhsym1 .or. &
previous_input_generation.ne.active_input_generation)) then
- call dbg('m65c: UNIT26 TRUNCATED (endfile) at t=' // rtoa(sec_midn()) // &
+ call dbg('m65c: message history cleared at t=' // rtoa(sec_midn()) // &
' nhsym=' // itoa(nhsym) // ' nrxlog=' // itoa(nrxlog))
- rewind(26)
- endfile(26)
- backspace(26)
+ call clear_messages()
else if (nhsym.eq.nhsym1) then
- call dbg('m65c: UNIT26 truncation SKIPPED (repeat call at nhsym1) at t=' // &
+ call dbg('m65c: message history clear skipped (repeat call at nhsym1) at t=' // &
rtoa(sec_midn()) // ' nrxlog=' // itoa(nrxlog))
endif
- if(nhsym.eq.nhsym2) backspace(26)
endif
nhsym_prev_m65c = nhsym
if(nagain.eq.0 .and. ndiskdat.eq.0 .and. manualDecodeFlag.eq.0) &