News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_nrgroom

BASIC windows and screen switching

Started by nrgroom, 20:33, 12 November 13

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nrgroom

Howdy folks.

After recently getting my Amstrad powered up again (thanks to the folks on the Hardware board), i've started delving into BASIC programming.

I'm working on a pretty basic game in mode 1, where the game takes up the entire screen. There are some interactions with characters on the screen, and I need to have a pop-up window to show some text, and ask questions, which i'm happy with, using the window command to have a smaller window appear with the required text in.

Once i've finished with the window however, is there any easy way to make it disappear, and replace the now blank area with the contents that were previously shown there (ie the screen as it was before the window popped up?

If there isn't an easy way, I could always do it in mode 1 with a blank section either at the side or bottom of the screen, but i'd prefer to use as much of the screen for the game as I can.

Any advice/guidance gratefully received.

Thanks


Bruce Abbott

Once you start using a window the previous contents will be lost, so if you want to 'restore' it you have two options:-

1. Redraw the part of the screen that was overwritten.

2. Save that part of the screen before using the window, then restore it afterwards.

The easiest way may be to simply redraw the whole screen again, but if for some reason you don't want to do that the second option may be preferable.

If you have a 6128 then you could run BANKMAN.BAS and use |SCREENCOPY to copy part of your screen to and from a backup screen in the extended memory.
   


nrgroom

Thanks Bruce.

My main problem is in the time it will take to scan what was there, then later re-draw, so I think i'm gonna have to go with a different mode.

I'll try a scan-and-redraw, to see if it works okay, though.


fano

I'd say the most adapted way would be to restore only the modified part.That depends about how much memory you still have but a little asm routine could do fastly and easily the job.You may take a look if this does already exist in type ins (is the correct word for listing?).If not , it is not a difficult work and someone here could write this for you  ;)
"NOP" is the perfect program : short , fast and (known) bug free

Follow Easter Egg products on Facebook !

AMSDOS

It might be worth having a look at the Window Saver program from AA17. It sets up 2 RSXes "W.SAVE" & "W.LOAD", the first 4 parameters work in the same manner as the BASIC Window with a 5th parameter which is the address of the window. It recommends setting up the Windows between &4000 & &6000 and the size of the window you setup determines the amount of memory used, so if a whole screen is setup as a window it takes up the full &4000, so some caution when using this program, perhaps have a monitor to check how much memory you need for your windows you need and don't waste memory by making the whole screen a window.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

redbox

Quote from: AMSDOS on 08:54, 13 November 13
It might be worth having a look at the Window Saver program from AA17. It sets up 2 RSXes "W.SAVE" & "W.LOAD", the first 4 parameters work in the same manner as the BASIC Window with a 5th parameter which is the address of the window.

Great recommendation.

Be careful to use the "WINSAVER.BAS" version (the original type-in) on the DSK file as this worked when I tried it where as the "WINDOW.BAS/BIN" files didn't.


Powered by SMFPacks Menu Editor Mod