Jump to content
IGNORED

BASIC PMG


paladina

Recommended Posts

Hello, I am beginner in programming on 8bit Atari, I would like to learn the Basic and Turbo Basic 1.5.

 

1. Can anybody me please help with Player/Missle graphics tricks? How can I do, that I become 1 player with the same color on the same row or any other place. I send there my little demo,where I use 5 players. Can anybody help me to learn to use on more place this players?

 

2. Second things is how to interrupt the screen.

If I have Graphics mode 15 then I have 4 color

In one line (pixel line) I can only use 4 color, how Can I change that second line via DLI or so to change this color?

I need any program for example where

 

1.line color ABCD

2.line color EFGH

3.line color ABCD

4.line color EFGH

5.line color ABCD

....etc..

 

Thansk to good programmer who help me. John Paladina.

player5.zip

Link to comment
Share on other sites

you would need to use machine code routine to achieve that if I am understanding you right.

 

you can put own small machine language codes f.e. into $0600-$06ff and then call your routine with a=usr($0600) in turbo basic or a=usr(1536) in basic...

 

but DLIs or VBLs are not possible with basic commands.

Link to comment
Share on other sites

There is the list of program..

 

10 GR.8

20 POKE 559,62:POKE 53277,3:POKE 54279,96

30 COLOR 1

40 FOR I=0 TO 22:PLOT 37,I:DRAWTO 68,I:NEXT I

50 POKE 53248,60:POKE 704,68

60 FOR I=0 TO 6:READ A:POKE 24576+1024+50+I,A:NEXT I

70 REM PL1

80 POKE 53249,71:POKE 705,98

85 RESTORE 440

90 FOR I=0 TO 6:READ A:POKE 24576+1280+51+I,A:NEXT I

100 REM PL2

110 POKE 53250,81:POKE 706,118

115 RESTORE 440

120 FOR I=0 TO 6:READ A:POKE 24576+1536+52+I,A:NEXT I

140 REM PL3

150 POKE 53251,93:POKE 707,138

155 RESTORE 440

160 FOR I=0 TO 6:READ A:POKE 24576+1792+53+I,A:NEXT I

200 REM MISSLE PL

201 M=15

210 POKE 53252,100-M:POKE 53253,98-M:POKE 53254,96-M:POKE 5355,94-M:POKE 711,255

215 RESTORE 440

220 FOR I=0 TO 6:READ A:POKE 24576+768+54+I,A:NEXT I

440 DATA 255,129,129,129,129,129,255

500 ?"OK, HOW CAN I DO MORE PLAYER IN ONE ROW...?"

510 GOTO 510

 

I think its correct :D

pl5.zip

Link to comment
Share on other sites

There is the list of program..

 

10 GR.8

20 POKE 559,62:POKE 53277,3:POKE 54279,96

30 COLOR 1

40 FOR I=0 TO 22:PLOT 37,I:DRAWTO 68,I:NEXT I

50 POKE 53248,60:POKE 704,68

60 FOR I=0 TO 6:READ A:POKE 24576+1024+50+I,A:NEXT I

70 REM PL1

80 POKE 53249,71:POKE 705,98

85 RESTORE 440

90 FOR I=0 TO 6:READ A:POKE 24576+1280+51+I,A:NEXT I

100 REM PL2

110 POKE 53250,81:POKE 706,118

115 RESTORE 440

120 FOR I=0 TO 6:READ A:POKE 24576+1536+52+I,A:NEXT I

140 REM PL3

150 POKE 53251,93:POKE 707,138

155 RESTORE 440

160 FOR I=0 TO 6:READ A:POKE 24576+1792+53+I,A:NEXT I

200 REM MISSLE PL

201 M=15

210 POKE 53252,100-M:POKE 53253,98-M:POKE 53254,96-M:POKE 5355,94-M:POKE 711,255

215 RESTORE 440

220 FOR I=0 TO 6:READ A:POKE 24576+768+54+I,A:NEXT I

440 DATA 255,129,129,129,129,129,255

500 ?"OK, HOW CAN I DO MORE PLAYER IN ONE ROW...?"

510 GOTO 510

 

I think its correct :D

 

In BASIC (off of top of my head), to insert a simple DLI that changes player colors once you can do:

 

10 FOR T=1536 TO 1536+26-1:READ A:POKE T,A:NEXT T

20 POKE 512,0:POKE 513,6:POKE 54286,192

30 DL = PEEK(560)+256*PEEK(561):POKE DL+120,143

40 DATA 72,169,243,141,10,212,141,18,208,169,134,141,19,208,169,108,141,20,208,169,91,141,21,208,104,64

 

Need to extend it for more than one scanline.

  • Like 1
Link to comment
Share on other sites

ok boys, for fisrt a need TWO things, First is the scnaline... I upload DOC.ZIP where is DOC.LST and DOC.DAT. I need when I paint the picture the one line become for 4 color a the second for Other colors, I say Iam beginner :D but I think you will see what I am meaning :D

In this example you can see 4 color (3 of choosen pixel load and backround - this I will in one line...and in second line other colors..in program is this as A=182, but this color on secon line...understand??)

 

and for second..as gorila... how can I copy PLAYERS on more place? Player 0 on 10,10 then 15,19 then 30,50 - one color...Player 1 on 15,20 then 30,40 and soo... pleasy any example that I become what I need... PLEASE... thx. Jonh P.

DOC.zip

Link to comment
Share on other sites

ok boys, for fisrt a need TWO things, First is the scnaline... I upload DOC.ZIP where is DOC.LST and DOC.DAT. I need when I paint the picture the one line become for 4 color a the second for Other colors, I say Iam beginner :D but I think you will see what I am meaning :D

In this example you can see 4 color (3 of choosen pixel load and backround - this I will in one line...and in second line other colors..in program is this as A=182, but this color on secon line...understand??)

 

and for second..as gorila... how can I copy PLAYERS on more place? Player 0 on 10,10 then 15,19 then 30,50 - one color...Player 1 on 15,20 then 30,40 and soo... pleasy any example that I become what I need... PLEASE... thx. Jonh P.

 

I haven't read your DOC file but if you want to reposition same players, player 0 must have a different Y position so that 8*16 player 0 is at (10,Y) then its next incarnation has to be at (NewX,>=Y+16) otherwise software be complex and cause some flicker.

Link to comment
Share on other sites

What paladina has is a basic program reading in a graphics 15+16 picture .DAT format (I've attached his pic below). He wants a DLI to change colour on this screen.

 

The routine he has to read the file is also very slow, I only have a quick one to load pictures created in Graphics Art Department. What program did you use to create the .DAT file :?: I haven't looked at this, yet, but saw something in the 'Mapping the Atari' book for loading and saving graphics screens to disk. If anyone has anything suitable handy please post it :?:

 

Any recommendations on the best package for creating graphic screens/backgrounds for games :?: I've used the atari version of Envison for fonts but not yet for 'maps'/playfields, again if there is a basic loading routine for these too, may be useful.

 

He also wants a routine to split PMG's if this is possible under Turbo Basic :?:

I would like this too for my next project! Note: I used character graphics for Gorilla Warfare.

:)

post-19705-125906008248_thumb.png

Link to comment
Share on other sites

Paladina's routine is very slow.

To load graphics 15+16 Micropainter (.mic) screens I use this TBXL program:

100 GRAPHICS 15+16
110 DIM FILE$(15)
120 FILE$="D1:IMAGE.MIC"
130 S=PEEK(559):POKE 559,0:REM DISABLE SCREEN FOR FASTER SPEED
140 OPEN #%1,4,%0,FILE$
150 BGET #%1,DPEEK(88),7680
160 BGET #%1,712,%1
170 BGET #%1,708,%3
180 CLOSE #%1
190 POKE 559,S:REM ENABLE SCREEN

I make a 4 color 160x192 screen on PC with a paint program, I save in .bmp format, I convert to .mic with Graph2font program (remember to disable "smart colors" option and last 6 rows to save only 7680 bytes, screen + 4 colors values).

Edited by Philsan
Link to comment
Share on other sites

Thanks for speed up loading...but its other problem. Well well...the brainstorm...ok..lets again. I need a DLI or how it is to do more color in GR15.

 

If I have Graphics mode 15 then I have 4 color

In one line (pixel line) I can only use 4 color, how Can I change that second line via DLI or so to change this color?

I need any program for example where

 

1.line color ABCD

2.line color EFGH

3.line color ABCD

4.line color EFGH

5.line color ABCD

....etc..

 

And please the example do in the DOC.ATR, thx.

 

The easy example is for anybody that see what I need and mean. Please again and again..is there any programmer who can build me good little program to do this?? I can convert pictures to 8 color and that is THE POINT for color...beacuse I can only in ONE ROW 4 COLOR do, then I will it do via Second Line color colision.. one line for 4 color ABCD and second line for next 4color EFGH.

 

the example LINE(position y,color1,color2,color3,color4) or antyhing soo... ok? understand me what I need now please??

And finali I think I use Multipurpose PM engine to become more colors items on the final sreen...uf..i will see the easy way to maximum...when you help me,then I made games for Atari...but I need for fisrt help with this and learn it to use correct...lets see who can realy help me :D

John Paladina.

Link to comment
Share on other sites

1. Can anybody me please help with Player/Missle graphics tricks? How can I do, that I become 1 player with the same color on the same row or any other place. I send there my little demo,where I use 5 players. Can anybody help me to learn to use on more place this players?

I'm not sure what you want, but am I correct you want to reposition f.e. one player on a lower part of the screen? To do this you might need DLI. This is possible in basic and turbobasic (see atariksi's example). Maybe you could make a mockup picture (just in Paint) of what you want.

 

Or could you answer the following:

-do you want to reposition (change x-registers) at scanline-basis?

-do you want to reposition in the middle of a scanline?

-do you only want to reposition them, or do you also want to reload their colours?

Describe clearly what you exactly want.

 

 

2. Second things is how to interrupt the screen.

If I have Graphics mode 15 then I have 4 color

In one line (pixel line) I can only use 4 color, how Can I change that second line via DLI or so to change this color?

I need any program for example where

 

1.line color ABCD

2.line color EFGH

3.line color ABCD

4.line color EFGH

5.line color ABCD

....etc..

About the palette-swapping:

The 4 colour regs in use in graphics mode 15 (=antic mode E) are BK(Background) and PF(Playfield)0,1,2.

The background is also visible at the side-borders.

Are you sure you also want to change BK colour every mode-line?

 

Anyway, first you should realize that changing the palette every mode-line, using DLI, takes a lot of CPU-time. So, you should expect significant slow-down of your programm. However, do you need the effect full-screen? Or only a part of the screen?

Link to comment
Share on other sites

Anyway, here's a quick ML lesson, for doing some DLI's.

 

Let V, ADL and ADH be Values between 0 and 255.

 

Then

DATA 169,{V},141,{ADL},{ADH}

is equivalent to a basic-statement

POKE ADL+256*ADH,V

({V},{ADL} and {ADH} MUST be replaced by values,

f.e. 169,14,141,26,208: turns background to white)

 

Or, split up into logic parts:

169,{V}

means ACC=V

141,{ADL},{ADH}

means POKE ADL+256*ADH,ACC

 

 

Every DLI must start with 72 and end with 104,64.

 

! The magic first command (after 72) must be:

169,{V},141,10,212,141,{ADL},{ADH}

 

Always make sure the READ DATA part in the basic prog reads the right number of bytes.

 

Of course in DLI we need to write to hardware registers, not the shadow ones.

F.e. 53274 = 26+256*208 is colour of background.

Many others can be found in the docs.

 

Example: Reposition player 0 (to xpos. 133) code:

1000 DATA 72,169,133,141,10,212,141,0,208,104,64

This means POKE 53248,133

 

easy...

 

 

So, maybe you could find a solution by yourself using these basic steps.

  • Like 1
Link to comment
Share on other sites

Ok,thanks for decription from all...and question, is possible to do via DLI or VBI that I become in GR15 in one pixel line 6 color, standart are 3 (Color 0,1,2) and when I need to do many interrups for become in one line chage the colors on other that I become 6 color in line?

 

And its possible... there is demo that become 10 COLORS in one LINE!

 

How its work?? how its possible? Every one say its possible to do only 4 colors in one ROW...a thinks not so if I look at his picture demo...

 

and that is,what I need... more colors on ONE ROW...I do experiments wit double line - not good looking (idea from Aletarnate Reality), with PMG - too small...ok...is there any other chance to become 160*192 more colors? or any other ... I know that I become 256 colors in GR9..but its only 80*192..mayby if there will be a trick to degree it 90, then I become 192*80 with 16 colors in standart...it will be good too... A IDEA for realy good DLI, that can use anybody and via this DO GOOD COLOR GAMES or REMAKES....

 

Ok and finally more pictures to maximum example for people tha say to me IMPOSSIBLE...the mission IS POSIBBLE!

MOTOR - 160x192 pixel, 49 colors total (max 8 color in one row) - this i will

FLO30 - 256 color (max 20 color in one row)

FLO43 - 18 colors (9 in one line)

 

Ok.Its not only for me....lets programming and help every one me and others people to do ATARI IDEAS AND DREAMS :D

 

Thans for all and for every help :D John.

UNBASE.ZIP

post-24943-125931186977_thumb.gif

post-24943-125931188849_thumb.gif

post-24943-125931196044_thumb.gif

Link to comment
Share on other sites

 

Ok and finally more pictures to maximum example for people tha say to me IMPOSSIBLE...the mission IS POSIBBLE!

MOTOR - 160x192 pixel, 49 colors total (max 8 color in one row) - this i will

FLO30 - 256 color (max 20 color in one row)

FLO43 - 18 colors (9 in one line)

 

 

MOTOR - No, it is not in 160x192

FLO30 - 256 color, but the color resolution is much lower

FLO43 - The technique and the screen designed together

 

There is not an ultimate method to put more colors to the screen that the built in graphics modes offer. You wont be able to reach the 160 x 192 x 6color resolution.

More colors often gained by using sprite overlays. But you have 4P + 4M at a row. You can reposition them line by line (needs processor speed and machine language). With accurate timing (needs processor speed and machine language) you can multiply them horizontally.

 

So you can put more colors to the screen, but not anywhere.

Edited by jvas
Link to comment
Share on other sites

Maybe you should have a look at the 'graph2font' techniques.

When you use the tool, you won't need to learn ML coding. Only how to import the finished picture into basic.

Is it possible to load a g2f picture in Basic (TBXL) and then use it with your Multipurpose PM engine? (Obviously without using PM overlays).

Edited by Philsan
Link to comment
Share on other sites

Ok, there is FLOP43 to see it in action.. and how can repositing PMG as you say? any example??

 

No horizontal multiplication is needed, since 9 colors = 4 playfield colors + 5 PM colors.

The sprites are simple repositioned with a DLI in the area between "Magazín" and "Flop".

Link to comment
Share on other sites

This is great stuff, thanks atariksi and now analmux (tonight's study!)...

I was working out on paper the DLI atariksi posted from data statements to their m/c commands last night. I have plonked this code into my latest project and my players now change colour nicely :)

 

It took me a while, along with some hex to decimal conversion and Mapping the Atari, to suss out that this DLI is not storing the values in the more familiar colour registers (710 etc), I was wondering about shadow registers... Can someone explain these please :?:

Link to comment
Share on other sites

This is great stuff, thanks atariksi and now analmux (tonight's study!)...

I was working out on paper the DLI atariksi posted from data statements to their m/c commands last night. I have plonked this code into my latest project and my players now change colour nicely :)

 

It took me a while, along with some hex to decimal conversion and Mapping the Atari, to suss out that this DLI is not storing the values in the more familiar colour registers (710 etc), I was wondering about shadow registers... Can someone explain these please :?:

 

You shouldn't have to do any math conversions if you think about it as: GTIA is page 208, POKEY is page 210, PIA is page 211, and ANTIC is page 212. So the 141,lsb,msb is really 141,register #,chip page.

 

On Atari, shadow registers are just RAM copies of what gets written into the hardware locations during VBI. So locations for the colors 704..712 gets written to 53266..53274 (registers #18..26, GTIA).

  • Like 1
Link to comment
Share on other sites

...

Is it possible to load a g2f picture in Basic (TBXL) and then use it with your Multipurpose PM engine? (Obviously without using PM overlays).

It should be possible. My engine only works in VBI, not DLI.

 

If I'm correct, some DLIs are needed to make a G2F picture work. These DLIs change the fontpage. However, things could get more complex if charmode (antic 4 f.e.) is used, and more complex palette and PM xpos changes are desired. But G2F tool supports many export formats. You can separately export the fonts, the palettes, and (IIRC) also the interrupts. Then do some binary loads and INIT the interrupts. This should work in TBXL.

 

But, DLI should be the main thing making G2F pictures work. I never explored it in much detail, but I think there's also a VBI part, but we can easily make a chain of VBI-processes. This VBI-part is possibly there to initialize the first DLI-pointer and others, when the top part of the screen is drawn on the TV.

 

 

How to do it, I don't know exactly. I never tried to import into TBXL the data which is exported by the G2F editor. But I think it should be easy.

Link to comment
Share on other sites

Hey boy hey girl...subst..the dj...ah yeah...I think the ..hm...I was on many crossroads...and now a take the ATTACK of MIDDLE WAY... ok... I WILL LEARN THE DLI...its may way...in gr9 is possible to do 256 colors...a 16 on a row..ok...in this way I will on GR15 then LETS PARTY PROGRAMMER... not to hard to play a guitar if you can sign a song...ro so ( eh..Iam not good in english...but I TRY IT!)

 

OK, I give there DLI256. Its little program...but my head has brainstorm...I cannot it understand...then please lesson of number with easy details a remake it from GR9 TO GR15 ( 4 basic colors on one row- pixel line and via this interrups do next 4 colors ) He..who sad that impossible? I WAS NOT! I say IT IS POSSIBLE... I am maybe dreamer,..but from dreams become GREAT THINGS! is it true... then help me and maybe there come anybody who help in this way to José Pereira too.Hey...I see a Bomb Jack..what do you say to me??-- colors in row and a players :D

 

10 REM * DLI *›

 

20 GRAPHICS 9› - graphics mode..ok...change to 15+16 !!

 

30 FOR A=0 TO 79:COLOR INT(A/5)› - yeah..drawing

 

40 PLOT A,4:DRAWTO A,191:NEXT A› - yeah drawing

 

50 FOR I=1536 TO 1562:READ D:POKE I,D:NEXT I› - whups..there become my understang...I know this is memory SIDE6, where I put little program..but..what are the data i dont know...then help more?? I think there become adress,where I will change my colors? and how I can

find THE ADRESS of MY PIXEL...or so...fuu

60 DL=PEEK(560)+256*PEEK(561)› - whups...free space for DL memory?

 

70 FOR I=0 TO 14:READ B:POKE DL+B,143:NEXT I› - AH...other reading...fuu 0-14..its 15 row..ok..READ B from line 110,ok.hm..poke..ok..this poke change the color at point...hm.. hm..welll--from back- POKE DL+B,143 ..hm..143 is Antic code for grafic 9, its number 15 (15+128=143).Ok...i know this...second... READ, read from LINE 110...ou yeah...this numbers in data are the numbers of pixel row...yes?... :D happy that I anything know :D

 

80 POKE 161,0:POKE 512,0:POKE 513,6:POKE 54286,192› fuu...too much.. POKE 161,0...never see.. ou.. POKE 512,0 and 512,6..it adress to start my interrupt program... SIDE 6 :D and finaly POKE 54286,192 activate my DLI...he..what for DLI if I dont understand this :D...

 

90 GOTO 90› - it easy cycle :D

 

100 DATA 72,173,80,6,24,105,16,141,80,6,141,10,212,141› - hm..and Iam at end..well..any star...hm? no?..then realy good lessen please...from anybody..from star...or from STARGUNNER :D :D ... the number 72 is the begin of program..

 

105 DATA 26,208,201,240,208,5,169,0,141,80,6,104,64› -..he..the end 104,64 that means the end of interrupt program..hm?

 

110 DATA 17,29,41,53,65,77,89,104,116,128,140,152,164,176,188› - ok, line for READ B, numbers of rows :D I NEED ALL 192 PIXEL ROWS :D

 

fooo...where is my mead...ok..I must go for glass..ehm..no..better bottle of MEAD :D brainstorm... hm..grafik...4 colors...in row.. ehm...other way is to combine graphics modes .. ou... and WHY I NEED THIS? beacuse its dream to do more colors on one pixel line..or row...then i think via DLI I can do special DLI library... ehm...easy and universal...for everyone...THEN NO CRITICK AND HELP ME AND OTHERS AS STAR PROGRAMMER OR GUNNERS ;) ;) II......mead flood :P

 

Funny, lets play with Paladina :D

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