+Muddyfunster Posted July 3, 2020 Share Posted July 3, 2020 (edited) I think I already know the answer to this question through trial and error and experimenting but thought it a good idea to pop it hear incase i'm missing a trick I assume that once set, set zoneheight 8 set doublewide on -can not be changed for different screens ? to change something to add some text for in 320 for example I'd use a "topscreen" routine instead? Background : I want to use a nice small font (like "font" or "alphabet_4_wide") for a short status display but I find with doublewide on, this does not display correctly so I have to revert to a less elegant 8 pixel font with chunkier letters on screen. Assume I cannot change these settings between screens, so have the main game in zoneheight8 and doublewide and pause screen in zoneheight 16 and doublewide off for example? conclusion so far is that zone heights and doublewide cannot be adjusted after being set ? Is there any known workaround for this or am I missing something in my understanding of these commands ? Is there a way to use then thinner fonts with a doublewide setup using char tiles. Thanks Edited July 3, 2020 by Muddyfunster Quote Link to comment Share on other sites More sharing options...
+SmittyB Posted July 3, 2020 Share Posted July 3, 2020 The zoneheight can't be changed on the fly in 7800BASIC because it affects a lot of the underlying structures in the code that you don't really see. As for doublewide I remember similar problems getting text to display properly because I wanted doublewide on for most graphics but not for the text. It's been a long time since, but I think I found that I could import the text graphics before the set doublewide on command and it at least improved the results I was getting. In Spire of the Ancients I'm also directly changing the graphics modes and doublewide setting on the fly by writing directly to CTRL and its copy sCTRL. I don't know how much of 7800BASIC I might be breaking by doing that but it seems to work for me at least. This page is the best reference if you want to go down that route and if @RevEng doesn't point something I'm missing ? http://7800.8bitdev.org/index.php/7800_Software_Guide#CTRL_.28.243C.29 I'm glossing over a load of detail because I'm not able to type this up on a PC at the moment. Happy to go into more detail / answer follow up questions when I can. 2 Quote Link to comment Share on other sites More sharing options...
+Muddyfunster Posted July 3, 2020 Author Share Posted July 3, 2020 Thanks @SmittyB That's given me something to think about Quote Link to comment Share on other sites More sharing options...
RevEng Posted July 3, 2020 Share Posted July 3, 2020 As always, SmittyB's answer is on the money. To make this plain, the supported usage is to have zoneheight and doublewide set once at the beginning of your program. Anything else is considered under the hood hacking. zoneheight affects the way graphics are laid-out in ROM, the dma hole positioning, and how the plot* functions convert a Y coordinate to a zone position (and sub-position). Setting double-wide enables compile-time differences in the functions responsible for storing and plotting character strings, due to character indexes being double what they would otherwise be. I try not to hard-code things into 7800basic, but these are two cases where doing so was a clear win for performance, rom-size, and support headaches. So far as under the hood advice... You can change the display mode with the "displaymode" command at any time. As SmittyB said, you can turn off double-wide characters by modifying CTRL and sCTRL. The problem remains that the character plotting routines won't work with your single-wide indexes. You can use "extrawide" data instead of turning on doublewide, but you'd take a hit in performance for any characters that need to be wide. (Maria needs to do twice the look-ups). If you really need to change to zoneheight=8 for your text, you'll need to change the heights encoded within the display list itself to accomplish that. You'd need to create the font at 16 pixels tall, with the top 8 being blank; there's no reasonable way to mix the rom layout for graphics intended for different zone heights in 7800basic, even under the hood. 2 Quote Link to comment Share on other sites More sharing options...
+SmittyB Posted July 3, 2020 Share Posted July 3, 2020 I remember now that it was importing tile maps that change depending on if you import them before or after the doublewide command rather than the graphics near the top of the code. 2 Quote Link to comment Share on other sites More sharing options...
+Muddyfunster Posted July 3, 2020 Author Share Posted July 3, 2020 Thanks for the explanations both, very informative and helpful 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.