Open tom-seddon opened 2 years ago
Pi modes: https://www.riscosopen.org/wiki/documentation/show/Screen%20Modes - max # rows is 75
Ideally, support that in all builds. Find unused space in the workspace and use that.
There will probably be a practical limit, probably 127 or 128 rows (annoying to deal with a table of words larger than that...), so the ROM should behave gracefully in that case. Just fail to use the whole screen, I suppose, possibly by setting a text window in edit mode (so it can use the existing logic). Command mode can use the whole screen, it's just doing TTY-style stuff.
It'd be OK then for the non-HI ROM to have lower limits than the HI ROM. Just needs to not break.
The HI ROM has 200+ bytes free. Could use that? Or just steal 256 bytes from somewhere. Pretend the HI ROM starts at $b700 and now there's an extra 256 bytes. Probably won't be a problem in practice.
I filled 400-7FF with AA before starting basic editor.
After running for a while, here's what I see:
>> m 400 7ff
0400 03 45 4e 44 20 20 20 20 20 20 20 20 20 20 20 20 .END
0410 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0420 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0430 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0440 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0450 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0460 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0470 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0480 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0490 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
04a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
04b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
04c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
04d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
04e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
04f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0500 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0510 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0520 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0530 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0540 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0550 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0560 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0570 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0580 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0590 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
05a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
05b0 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
05c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
05d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
05e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
05f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0600 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
0610 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
0620 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
0630 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
0640 aa aa aa 46 46 46 46 46 46 46 46 46 46 46 46 46 ...FFFFFFFFFFFFF
0650 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 FFFFFFFFFFFFFFFF
0660 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 FFFFFFFFFFFFFFFF
0670 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 FFFFFFFFFFFFFFFF
0680 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 FFFFFFFFFFFFFFFF
0690 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 FFFFFFFFFFFFFFFF
06a0 46 46 46 46 46 46 46 00 00 f2 aa 00 aa 00 aa 00 FFFFFFF.........
06b0 4c a8 90 00 00 00 49 01 00 0a 80 07 64 e1 64 18 L.....I.....d.d.
06c0 1e 0b 42 0b 42 0b 89 0b 8e 0b b4 0b cd 0b e6 0b ..B.B...........
06d0 fe 0b 0c 0c 2b 0c 39 0c 51 0c 64 0c 72 0c 89 0c ....+.9.Q.d.r...
06e0 bb 0c da 0c da 0c 22 0d 27 0d 2c 0d 31 0d 3a 0d ......".'.,.1.:.
06f0 3f 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?...............
0700 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 GGGGGGGGGGGGGGGG
0710 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 GGGGGGGGGGGGGGGG
0720 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 GGGGGGGGGGGGGGGG
0730 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 GGGGGGGGGGGGGGGG
0740 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 GGGGGGGGGGGGGGGG
0750 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 GGGGGGGGGGGGGGGG
0760 47 47 47 47 0d aa aa aa aa aa aa aa aa aa aa aa GGGG............
0770 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
0780 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 HHHHHHHHHHHHHHHH
0790 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 HHHHHHHHHHHHHHHH
07a0 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 HHHHHHHHHHHHHHHH
07b0 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 HHHHHHHHHHHHHHHH
07c0 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 HHHHHHHHHHHHHHHH
07d0 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 HHHHHHHHHHHHHHHH
07e0 48 48 48 48 0d aa aa aa aa aa aa aa aa aa aa aa HHHH............
07f0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
It looks like &700 is used for the input buffer at the > prompt
The CHANGE command uses input buffers at &700 and &780
The FIND command uses an input buffer at &643 - I wonder if there is a good reason this is different?
If you could move the FIND buffer to &780, that would then free up $600..$69F for the line_ptr table, which would work for up to 80 lines.
Dave
Still chipping away at the code trying to figure out where the used workspace genuinely is, and make sure I've caught all the places where it's loading the LSB and MSB of a relevant address. (I've already found several I'd missed!)
$600...$643 is looking pretty unused so far, and the buffers at $700 and $780 appear to be 100 bytes each. So it's looking like there are probably options even without having to merge existing buffers.
Looks like this bit is clearing the screen - https://github.com/tom-seddon/basic_editor/blob/0d88b6e3bf0290a4b62fc3ac48730a61e7d12f9b/mainpart.s65#L5462 - it pre-fills 80 chars of ' '
so it can re-use print_n_chars
, but it should just do an oswrch
loop and accommodate any width that way.
Note https://github.com/tom-seddon/basic_editor/blob/0d88b6e3bf0290a4b62fc3ac48730a61e7d12f9b/mainpart.s65#L5982
There is something at $700, but I've never previously had any reason to wonder what it is, or how much more of it there might be...
More investigation required.
You can get 33+ rows using the pi copro in native frame buffer mode. And I suppose you might be able to get it with !65Host on an Arc too.