Jump to content
IGNORED

Changing a double line res. p/m graphics routine into single line res.?


Philsan

Recommended Posts

For single-line, the base has to be on a 2K boundary, not 1K.

 

You'll also need to change offsets and counters of 128 to 256.

 

There's also calculations in there with 512, they need to be changed to 1024.

 

200 A=4*(INT(PEEK(742)/4)-1)

 

That line establishes PMBASE on the 1K boundary below the top of free RAM. So just change the 4s to 8s to align on 2K instead of 1K.

Change the -1 to -2 to reserve 2K.

 

Probably more, but you should be able to work it out.

 

That's a kinda dirty way of doing PMGs in BASIC anyway. It's usually better to just move the screen lower in RAM and use the very top of RAM for PMGs - that way they're well protected from the OS or BASIC just overwriting them.

Link to comment
Share on other sites

Thanks for your attention, in particular to Rybags.

He changed for me Compute's P/M routine to single line resolution and improved it to protect memory.

Perhaps this routine (it runs in Atari Basic and Turbo-Basic XL) can be useful for newbies.

 

5 REM PMSAMPLE1-SINGLE LINE RESOL.
10 DIM PM1$(256),PM2$(256),PM3$(256)
12 MEMTOP=PEEK(740)
14 POKE 106,MEMTOP-16
16 GRAPHICS 15+16
20 SIZE1=16:SIZE2=8
30 DIM SHIP$(SIZE1),ALIEN$(SIZE2)
40 DIM CLEAR$(256)
50 FOR ROWS=1 TO SIZE1
60 READ DOTS
70 SHIP$(ROWS,ROWS)=CHR$(DOTS)
80 NEXT ROWS
90 DATA 0,0,0,0,0
100 DATA 16,56,56,124,108,68
110 DATA 0,0,0,0,0
120 FOR ROWS=1 TO SIZE2
130 READ DOTS
140 ALIEN$(ROWS,ROWS)=CHR$(DOTS)
145 POKE 53248,X0
150 NEXT ROWS
160 DATA 60,126,219,126,36,36,66,129
170 FOR ROWS=1 TO 256
180 CLEAR$(ROWS,ROWS)=CHR$(0)
190 NEXT ROWS
200 A=MEMTOP-8
210 POKE 54279,A
220 VSA=256*PEEK(135)+PEEK(134)
230 BOA=256*PEEK(141)+PEEK(140)
240 PM=256*A+1024
250 DISP=PM-BOA
260 ADD=2
270 FOR T=1 TO 3
280 PMHIGH=INT(DISP/256)
290 PMLOW=DISP-256*PMHIGH
300 POKE VSA+ADD,PMLOW
310 POKE VSA+ADD+1,PMHIGH
320 DISP=DISP+256:ADD=ADD+8
330 NEXT T
340 PM1$=CLEAR$:PM2$=CLEAR$:PM3$=CLEAR$
350 POKE 559,62:POKE 53277,3
360 COLR1=25:COLR2=11:COLR3=74
370 POKE 704,COLR1:POKE 705,COLR2:POKE 706,COLR3
380 X1=125:X2=75:X3=175
390 POKE 53248,X1:POKE 53249,X2:POKE 53250,X3
400 Y1=95:Y2=65:Y3=65
410 PM1$(Y1)=SHIP$:PM2$(Y2)=ALIEN$:PM3$(Y3)=ALIEN$
420 IF STICK(0)<8 THEN X1=X1+3
430 IF STICK(0)>8 AND STICK(0)<13 THEN X1=X1-3
440 IF STICK(0)=14 THEN Y1=Y1-3
450 IF STICK(0)=13 THEN Y1=Y1+3
460 POKE 53248,X1:PM1$(Y1)=SHIP$
470 IF STICK(1)<8 THEN X2=X2+2
480 IF STICK(1)>8 AND STICK(1)<13 THEN X2=X2-2
490 POKE 53249,X2
500 IF STICK(2)<8 THEN X3=X3+2
510 IF STICK(2)>8 AND STICK(2)<13 THEN X3=X3-2
520 POKE 53250,X3
530 GOTO 420

P107L1SL.zip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...