Basically, the program I've been working on uses a SCREEN 0 text screen that is always a minimum of 80 characters x 50 lines, and could conceiveably be as large as 80 chars x 200 lines when using QB64. The usual size is between 66 and 130 lines depending on the screen resolution, available desktop space and _FONT used.
Here's the problem : I'm currently using the code below to BSAVE a copy of a certain segment of the video memory for SCREEN 0 which has already been calculated using the 'offset' and 'length' variables.
Next, the subroutine at line 1400 resets the screen size to either a 50 line screen (using a different _FONT), or... a more than 50 line screen. The actual number of lines will vary as described above.
After the new SCREEN 0 text screen has been established at 1400 (using the WIDTH command), the new screen will be blank, so the BLOAD statement is used to write the previously saved screen data to the beginning segment of the new SCREEN 0 video memory at &HB800 and then the KILL command deletes the temporary file that was used.
offset = (LN - 48) * 160: length = LN * 160
'
BSAVE "tmpscrn.tmp", offset
, length
Everything works just like I want it to, but... I don't really like having to save and then delete a file from disk each time the routine is used.I'm pretty sure that one or more of the _MEM commands can be used to do all of this in QB64, but even after reading the info here :
https://www.qb64.org/articles/articlemem.txt I just can't figure out exactly how to go about doing it. I'm thinking that the BSAVE and BLOAD lines just need to be replaced with the proper variant of _MEM such as _MEMIMAGE and/or _MEMCOPY or _MEMGET and _MEMPUT, but who knows?
Thanks in advance for any help that can be provided.