ozmoo
                                
                                 ozmoo copied to clipboard
                                
                                    ozmoo copied to clipboard
                            
                            
                            
                        Proposal: Smooth scrolling
Hello! I have some smooth-scrolling code which I've been working on integrating into Ozmoo. If there is interest, I can submit a PR for review. Currently it supports c64 only, though I would probably plan to try to use the same code for c128 40-column mode next.
Attaching a short demo video and a build of mini-zork:
c64_minizork.zip
https://user-images.githubusercontent.com/62519170/194211882-f6eb3fd7-90f2-4fb2-a3fe-93a57701bee4.mp4
Hi, sorry about the delay. Your demo looks very nice and I just had a quick look at the PR. Thanks for submitting it and improving Ozmoo. We'll have a closer look at it and get back to you.
The soft scrolling looks really good, and it’s quite tempting. We do have some questions though: We suspect it’s using a secondary screen RAM for the status line. If this is to be used for z4+ games, that screen RAM would have to be a full 1 KB. That’s a lot of RAM.
- Do you intend for this to be usable for z4+ games, where we have no idea how big the upper window will be at build time, and the game may change the size of the upper window at any point (and games frequently do this)?
- Could you describe the impact the soft scrolling feature would have, in terms of memory used?
- Any other tradeoffs?
- Is the splitscreen stable while loading from disk?
We’d also be glad to see the files you changed, just as they look now. We understand this isn’t the final, polished version. This way we could form a better opinion before you go to the trouble of making a more final version for a PR.
The scrolling is all managed in-place; the only additional memory is for the code itself and the handful of byte variables it uses.
I don't believe that changing the window size during play will be a problem, but I'd very much like to add such a game to my testing if you can point me to an example. (I'm basically familiar with a few of the Infocom classics, and have also used Border Zone in my tests since it uses a multi-line status area and a clock. If that one does it, I probably just didn't play through it enough to see.)
It is probably going to add a few hundred bytes to the interpreter size, as a build option. (Initially I think this was 800 bytes, but I've been rearranging and refining the code so it will actually be a good bit less than that.)
Scrolling smoothly is slower overall of course, since the text "moves" one pixel per frame. But the effect is pleasant, and reading while scrolling is easier. Some processing can also happen during the smooth scrolling since it is performed by a raster interrupt.
When not actually scrolling no changes are made to the screen. I inserted code prior to disk I/O and disabling interrupts to wait for any in-progress smooth-scroll to complete in order to prevent any jittering. In the video I attached above (recorded from VICE), there is disk loading happening during the pause between 0:14 ("The small mailbox contains") and 0:16 ("A leaflet"). I've been testing without an REU configured in order to cause more disk access.
I'll post the code in a draft PR for viewing the changes.
Your PR looks very promising, and I think we can merge it when it is polished. I suggest concentrating just on the smooth scroll for now, and leave less important optimizations, such as the ones you suggested in screenkernal.asm for later. It is very good that you have made this feature optional.
There is a potential problem if this were to be extended to C128. C128 in 40 column mode is also using an IRQ to enable 2MHz in the upper and lower border areas, and changing to 1MHz when showing text. This has to be merged with your smooth scroll routine, but of course still work as before if smooth scroll is not used. Not impossible to solve, but something to be aware of. Are you planning to include C128 support before submitting the real PR?
As for more testing, I think you should try Curses, which has a quote box in the beginning and a custom toolbar (https://ifdb.org/viewgame?id=plvzam05bmz3enh8). You can also test Vacation Gone Awry (https://ifdb.org/viewgame?id=w7siqe43yn0rb2pd) and type “sw.nw.take game.play it”. You can try the “statusline” command in that game to dynamically change the status line in various ways.
Thanks much for the suggestions!
I had seen the C128 raster interrupt, and in principle don't think it should be difficult to integrate the functionalities. My thought was to get the feature done for C64, submit it, and then work on C128 support. If you'd rather receive both together then I could always do these stages on my end and then submit the final combined result.
I don't think that it is necessary. You can finish the PR for C64 first, and once we're happy with it and have it merged you can continue with the C128 version if you want to. The IRQ problem is solvable. Thanks a lot for contributing! It will be a nice addition.
Hi again, I hope I didn't discourage you. We're still very interested in your smooth scroll and want to merge it if upload a PR that you're happy with.
Not at all; thanks for following up. I did quite a bit of work on the code and started some deeper testing, then ran into a busy period and haven't had as much time to work on it. I hope to get back into it this week.
I did have some trouble building Vacation for the C64, even with an unmodified tree:  ERROR: Dynamic memory is too big (37888 bytes), would pass end of normal RAM. Maximum dynmem size is 36864 bytes.
Do you know if some specific build options might be needed, or perhaps an older version of the game file?
Sorry, I suggested Vacation, but it can't be built for C64. My bad.
You could try it with something like The Job, which opens a menu if you type HELP. ( https://ifdb.org/viewgame?id=g5rflxpmycdl67ps ). The menu is in the top window. When you select a menu item which displays some text, like "Instructions", the top window height changes again and the main text is printed in the lower window.
I guess we can close this issue since the feature is merged and will be included in the next release, probably soonish. Thanks again
Release 12, with smooth scrolling, was released yesterday: https://intfiction.org/t/ozmoo-release-12/44499/12 Thanks again!
Awwesome, congrats on another release!