fix hot code reload

This commit is contained in:
Jeremy Penner 2021-01-13 20:56:51 -05:00
parent dc4bd72d16
commit 049d388365
6 changed files with 2 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View file

@ -350,7 +350,6 @@
(local iblock self.next-free.iblock)
(var block (self:block iblock))
(local file-entry (self:generate-file-entry iblock filename type aux bytes))
(print (length file-entry) file-entry)
(set block (splice block self.next-free.entry.entry-offset file-entry))
(self:set-block iblock block)
(self:update-volume-header {:file-count (+ self.root.file-count 1)}))

View file

@ -11,7 +11,6 @@
; never want to overlap with 0x2000 from lower memory, so either direction is safe
(local dstpage-first (hi org.addr))
(local dstpage-last (hi (+ org.addr (length org.bytes) -1)))
(print srclabel dstpage-first dstpage-last)
[:block
[:computed :srchi #(+ ($1:lookup-addr :ld-src) 2)]
[:computed :dsthi #(+ ($1:lookup-addr :st-dst) 2)]

View file

@ -45,7 +45,7 @@
[:vm :hires
:lit :level1 :load-level
(vm:forever
(vm:hotswap-sync :reload-level)
(vm:hotswap-sync :lit :level6 :load-level)
:interactive-eval-checkpoint
:handle-key
)

View file

@ -111,14 +111,13 @@
(coroutine.yield)
(or result "<no result>"))
(fn Machine.dbgcmd [self cmd ?handlers]
(print "dbgcmd??" cmd)
(self:eval (.. "(manager.machine.debugger:command \"" cmd "\")")) ?handlers)
(fn Machine.continue [self] (self:dbgcmd :go))
(fn Machine.step [self] (self:dbgcmd :s))
(fn Machine.set-bp [self addr ?action]
; todo: handle setting the same breakpoint more than once?
(tset self.breakpoints addr {:action ?action})
(self:eval (.. "(-> (. manager.machine.devices ::maincpu) (: :debug) (: :bpset " (tostring addr) "))")
(self:eval (.. "(-> (. manager.machine.devices ::maincpu :debug) (: :bpset " (tostring addr) "))")
{:value #(tset (. self.breakpoints addr) :id (tonumber $2))}))
(fn Machine.clear-bp [self addr]
(local bpid (-?> self.breakpoints (. addr) (. :id)))