Jump to content
IGNORED

PMmove + PicLoadA ML routines in the same program


Philsan

Recommended Posts

I would like to use PMmove (to move 5 players) and PicLoad (to load Atari Artist - touch tablet graphics 15 files) ML routines in the same Turbo-Basic XL program.

As you can see in the listing and entering the file "test.lst" in the attached .atr, my program does load a picture and then moves the 5 players.

My problem is that I don't know how to load other pictures without crashing the computer or damaging the players data.

I think it's a problem of memory pointer that can easily solved by many programmers of this forum!

Thank you

 

5 DIM X(5),Y(5),DX(5),DY(5)

6 DIM SCR$(14)

8 SCR$="D:SCREEN01.PIC"

10 EXEC PICLOAD

15 EXEC PMSETUP

20 FOR N=1 TO 5

30 X(N)=60+INT(RND*120):Y(N)=60+INT(RND*120):DX(N)=-1+INT(RND*2)*2:DY(N)=-1+INT(RND*2)*2

(I DON'T KNOW HOW TO AVOID THE AUTOMATIC SMILE FACE!)

40 NEXT N

50 DO

60 FOR N=1 TO 5

70 Z=USR(PMMOVE,N,PMBASE,8,X(N),Y(N))

80 X(N)=X(N)+DX(N):IF X(N)<49 OR X(N)>199 THEN DX(N)=-DX(N)

90 Y(N)=Y(N)+DY(N):IF Y(N)<33 OR Y(N)>215 THEN DY(N)=-DY(N)

95 NEXT N

96 LOOP

8010 PROC PMSETUP

8020 PMPAGE=184:POKE 106,PMPAGE

8022 POKE 54279,PMPAGE

8030 BLOAD "D:PMMOVE.OBJ"

8040 PMBASE=PMPAGE*256

8050 POKE 559,62:POKE 623,17:POKE 704,68:POKE 705,24:POKE 706,136:POKE 707,212:POKE 711,170:POKE 53277,3

8060 PMMOVE=45056

8070 POKE PMBASE,0

8080 MOVE PMBASE,PMBASE+1,2047

8090 FOR N=PMBASE TO PMBASE+7

8100 READ A:POKE N,A

8110 NEXT N

8120 ENDPROC

8130 DATA 60,126,231,195,195,231,126,60

9000 PROC PICLOAD

9003 POKE 106,$B0

9005 GRAPHICS 15+16

9007 SCREEN=DPEEK(88)

9010 BLOAD "D:PICLOADA.OBJ"

9014 X=USR($B900,ADR(SCR$),SCREEN)

9020 ENDPROC

Picload_PMmove.zip

Edited by Philsan
Link to comment
Share on other sites

The pmmove routine there is not memory specific and can be moved to another location. Not sure of its exact length.

 

However I did make a customized version of the routine which works with a graphic 8,9,10,11, or 15 screen. However the PMBASE is now locked at $9800 which below the screen area. The routine loads to that location also, remember the first 3 pages of a Player/Missile area is unused. The routine does use a few bytes under the Missile page to save the prior memory location and sizes so the players can be quickly deleted before drawing a new player. The $9800 is not protected, so if you turbo basic program with variables becomes too large, it could interfere with the routine.

 

(The 5th player now lines up with the rest of the players, not sure if anyone noticed that issue)

pmdemo.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...