jkotlinski / durexforth

Modern C64 Forth
Other
233 stars 28 forks source link

bug: 'v v' wipes wordlist #366

Closed jkotlinski closed 2 years ago

jkotlinski commented 3 years ago

Repro:

v v
:q 
words

What happens: words?

Expected: wordlist is printed

jkotlinski commented 3 years ago

it's unclear how to solve this in a good way.

Whammo commented 3 years ago

Is it so large that it overwrites the wordlist?

jkotlinski commented 3 years ago

I suppose so.

Whammo commented 3 years ago

It might be tricky, but there has been a suggestion to move the wordlist to the 4K RAM under i/o.

jkotlinski commented 3 years ago

Related: #311

Whammo commented 3 years ago

Doesn't TOP! enable moving the wordlist out of the way?

Whammo commented 3 years ago

Yes it does. $cbff TOP! v v

good stuff

jkotlinski commented 2 years ago

A good solution for this would be to rewrite "v" so that it does not use unbounded memory. However that is a pretty big undertaking.

jkotlinski commented 2 years ago

Actually! There is a solid way to solve this problem, without much work at all.

Before v actually loads a file, read the disk directory to see how big the file is (in blocks, each block holding 254 bytes). If the file is too big for the buffer, ABORT" too big".

jkotlinski commented 2 years ago

https://github.com/jkotlinski/durexforth/pull/395

^ this seems to work. sadly, there's not room on the cartridge (yet)

jkotlinski commented 2 years ago

A related thing now. Editor text buffer sits very awkwardly. It starts at $7000, and gets squeezed between HERE (grows up) and LATEST (grows down). Wouldn't it make sense to move it to $a000-$cbff ?

...of course, one would probably want to use $a000-$cbff for Other Things. But in that case, it's OK to not use the text editor? Alternatively, one could limit text editor buffer to $a000-$bfff, keeping $c000-$cbff free.