Postby dml » Mon Mar 28, 2016 8:47 am
The STE extension seems to work fine. You just need to be aware that while 'logic' and 'physic' continue to function for drawing purposes, 'physic' is no longer the physical screen. The physical screen is the one you specify to the 'hard inter' service. This is the only way to get around the display scrolling limitations of 'physic'.
This re-coded version works for me. It's not how I would actually implement scrolling (and the program itself is a bit poorly defined) but it should serve as a working example at least. (I honestly couldn't remember any STOS commands and couldn't find any usable docs online so I'd recommend redoing things from scratch)
10 key off : curs off : hide : mode 0
15 rem *************************************************
16 rem * create fake playfield in VBUF1,VBUF2
17 rem *************************************************
20 reserve as work 1,512000 : bload "c:\stos\level1.dat",start(1)
30 reserve as work 3,512000 : bload "c:\stos\level1.dat",start(3)
35 rem *************************************************
36 rem * load HUD image for blit every frame
37 rem *************************************************
40 D=depack(start(1))
50 reserve as screen 2 : load "c:\stos\playarea.pi1",2 : get palette (2)
55 rem *************************************************
56 rem * init hardscroll stuff
57 rem *************************************************
60 X=hard physic(start(1))
70 hard screen size 320,3200,0
80 hard screen offset 0,0
90 hard inter on
100 logic=back
110 rem *************************************************
120 rem * initialize the buffer names and start-Y
130 rem *************************************************
140 TY=3000 : VBUF1 = 1 : VBUF2 = 3 : VDISP = VBUF1
150 rem *************************************************
160 if TY<0 then TY=0
170 hard screen offset 0,TY
180 if inkey$=" " then goto 330
190 rem *************************************************
200 rem * blit clips at Y>=200, so offset buffer
201 rem * addr to the correct Y pos in the playfield
210 rem *************************************************
220 VLOG=start(VDISP)+(160*TY) : rem 'hard' log screen
230 blit start(2),0,0,80,200,VLOG,0,0
240 rem *************************************************
250 rem * swap the 'hard' framebuffers manually
250 rem * and inform STOS of the new physic
260 rem *************************************************
270 if VDISP = VBUF1 then VDISP = VBUF2 else VDISP = VBUF1
280 X=hard physic(start(VDISP)) : wait vbl
290 rem *************************************************
300 dec TY
310 goto 160
320 rem *************************************************
330 hard inter off : default
Last edited by
dml on Mon Mar 28, 2016 5:01 pm, edited 1 time in total.