Hated Moron wrote: ↑Thu 16 Feb 2023, 20:21
BBC Micro-compatible modes, such as MODE 3 and MODE 7 (640 x 500 square pixels) which need to be legible whatever the monitor's size and resolution.
I should add that one of the big advantages of
BBC BASIC for SDL 2.0 over
BBC BASIC for Windows is the
@zoom% variable, which allows you to scale the 'logical' window that your BASIC program sees to a potentially much larger 'physical window' on the screen itself.
Indeed you can easily make your program adapt to whatever the physical window size is (even fullscreen) without having to change the working of the code at all, by incorporating an ON MOVE handler as follows:
Code: Select all
ON MOVE PROCresize(@msg%, @lparam%, @size.x%, @size.y%) : RETURN
...
DEF PROCresize(M%, L%, X%, Y%) IF M% <> 5 ENDPROC
LOCAL W%, H%
W% = L% AND &FFFF
H% = L% >>> 16
IF W%/H% > X%/Y% THEN
@zoom% = &8000 * H% / Y%
ELSE
@zoom% = &8000 * W% / X%
ENDIF
IF @zoom% < &8000 @zoom% = &8000
IF (@platform% AND 7) < 3 THEN
@panx% = (X% - W% * &8000 / @zoom%) / 2
@pany% = (Y% - H% * &8000 / @zoom%) / 2
ENDIF
ENDPROC
You can see this in action in programs like
tower.bbc supplied with BBCSDL v1.34a.