CPCWiki forum

General Category => Programming => Topic started by: milamber on 01:18, 30 May 11

Title: Shrinking the screen in Basic
Post by: milamber on 01:18, 30 May 11
Using Out &bc00,x & Out bd00,x changes the size of the screen but effects the visuals.

Ive tried the width alteration using the Out command and the system crashes!

I mention this as Ive found that sprites Called also are effected - they split!

Is there a method to return text & graphics to normal after altering the display?

Ive written a program along the lines of Jet Set Willy that only uses 16 character spaces in Mode 0.  I then started tinkering with shrinkng
the display to speed things up - yes, its all in basic.

I`m using Hisoft Turbo Basic with a mixture of machine code routines to move the sprites.

One thing i did find whilst messing with the Out command was a border within a border!  One large and one small after executing a crafty Out cammand.



 
Title: Re: Shrinking the screen in Basic
Post by: AMSDOS on 10:38, 30 May 11
Do you mean like:


for x=0 to &28:out &bc00,1;out &bd00,x:call &bd19:next x


That's how one would go about from going from a blank screen to restoring the screen fully. Ikari Warriors uses a technique like this for example.

Oh you want a Smaller screen without the scrambled images, I know what you mean, though don't know a lot how one would apply that using that method using BASIC routines, all a matter of calculationing where the image has to go to next.

Maybe easier to use the Firmware to setup a Graphics Window.

GRA WIN WIDTH (&BBCF) & GRA WIN HEIGHT (&BBD2) could be used to setup that window & GRA CLEAR WINDOW (&BBDB) could be used to clear what's in that Window. Of course if you were trying to Shrink the Screen to allow more memory to use other things in that space then yeah it might be a problem, if that's what's needed perhaps you could set your GRA WIN in the top corner and hide some lines near the bottom of the screen without scrambling the screen?  :-\
Title: Re: Shrinking the screen in Basic
Post by: redbox on 19:53, 30 May 11
Quote from: milamber on 01:18, 30 May 11
Is there a method to return text & graphics to normal after altering the display?


All of the firmware routines (which are used by BASIC) are written for a screen being 80 characters wide and that's why it all goes wrong.


The only way to do it is to write your own routines, which of course means using assembler.
Title: Re: Shrinking the screen in Basic
Post by: milamber on 20:42, 30 May 11
Thanks for the help guys much appreciated.
Title: Re: Shrinking the screen in Basic
Post by: ZbyniuR on 15:20, 14 October 17
Unshrink screen without scrambled. ;)

FOR x=0 TO 25:OUT &BC00,6:OUT &BD00,x:OUT &BC00,7:OUT &BD00,x\2+18:FOR a=1 to 20:NEXT:NEXT

You can try with only 2 first OUTs to. :)
Powered by SMFPacks Menu Editor Mod