Jump to content
IGNORED

Tltle Screen Graphics - HELP!


Recommended Posts

Is there anyone willing to create a Joust/Ms.Pac-man style title screen graphic for my game Gwobby Strikes Back! ?: After learning some new tricks I now have a few hundred bytes free to play with again! I could go down the character set route but I wonder if a smallish graphic could be loaded into RAM and I could change my display list somehow to point to it.

 

Has anyone got an example Turbo BASIC (or atari BASIC) program that loads a graphic and it remains in RAM :?:

 

Some general comments on how this is done in machine code for games such as Joust would be helful too :ponder:

 

Thanks :)

Link to comment
Share on other sites

Is there anyone willing to create a Joust/Ms.Pac-man style title screen graphic for my game Gwobby Strikes Back! ?: After learning some new tricks I now have a few hundred bytes free to play with again! I could go down the character set route but I wonder if a smallish graphic could be loaded into RAM and I could change my display list somehow to point to it.

 

Has anyone got an example Turbo BASIC (or atari BASIC) program that loads a graphic and it remains in RAM :?:

 

Some general comments on how this is done in machine code for games such as Joust would be helful too :ponder:

 

Thanks :)

 

Well, try something like this:

 

Create your screen, in whatever graphics mode you want ... you can put it to disk like: OPEN #2,8,0,"d:screen.pic":BPUT #2,DPEEK(88),<<LENGTH>>:Close #2

 

once you have a screen saved, then run my CONVERT.BAS program (located in another thread on here) which can convert your pic into either data statements or string assignments. String assignments is best, as this program will actually reference the variable name table to make S$ point to DPEEK(88) ... so doing S$="xxxx" will actually cause changes to the screen. Plus its alot faster than DATA statements.

 

Or if you don't wanna mess with the variable name table (which you would only really need to do in Atari BASIC), do MOVE ADR(S$),DPEEK(88),<<LENGTH>> from TurboBASIC

 

Also, if you want to create a title screen in text mode (as opposed to bitmap) my TEXTDRAW.TUR utility can come in handy. Or you can also create screens using G2F and then import the .scr file into your program using CONVERT.BAS

 

Alternatively, if you just want to load your screen from a disk file, something like this:

 

GRAPHICS 15+16:OPEN #1,4,0,"D:SCREEN.PIC":BGET #1,DPEEK(88),40*192:CLOSE #1

 

Which might be more memory efficient ... no need to store the pic as part of your program.

 

Now if you are using a modified display list, those tricks above will still work ... change DPEEK(88) to wherever screen memory starts for your graphics ... DPEEK(88)+row*40 if you are using graphics modes 8-11 or 15, or if you are in 40 column text mode

 

 

 

 

Link to comment
Share on other sites

  • 2 weeks later...

once you have a screen saved, then run my CONVERT.BAS program (located in another thread on here) which can convert your pic into either data statements or string assignments. String assignments is best, as this program will actually reference the variable name table to make S$ point to DPEEK(88) ... so doing S$="xxxx" will actually cause changes to the screen. Plus its alot faster than DATA statements.

 

Or if you don't wanna mess with the variable name table (which you would only really need to do in Atari BASIC), do MOVE ADR(S$),DPEEK(88),<<LENGTH>> from TurboBASIC

Interesting. I would love to avoid to load images from disk in my games.

Could you attach or link your CONVERT.BAS program?

Link to comment
Share on other sites

once you have a screen saved, then run my CONVERT.BAS program (located in another thread on here) which can convert your pic into either data statements or string assignments. String assignments is best, as this program will actually reference the variable name table to make S$ point to DPEEK(88) ... so doing S$="xxxx" will actually cause changes to the screen. Plus its alot faster than DATA statements.

 

Or if you don't wanna mess with the variable name table (which you would only really need to do in Atari BASIC), do MOVE ADR(S$),DPEEK(88),<<LENGTH>> from TurboBASIC

Interesting. I would love to avoid to load images from disk in my games.

Could you attach or link your CONVERT.BAS program?

 

 

Here in this thread:

 

http://www.atariage....__fromsearch__1

 

A couple things you need to remember:

 

If you choose to use strings, you MUST make sure that you arrange your program so that the DIM S$ command is in the first line of your program. Also make sure you LIST to disk, NEW, and ENTER the program back from disk so that the variable name table is correct.

 

What the string function will do is, it assigns the string S$ to whatever memory location you want to use (for example, screen memory or your character set) so that any functions performed on S$ immediately get transferred to the screen or wherever ... a form of block PEEK and POKE.

 

Then you will want to modify the program after you have converted the screen to a string, to where the screen gets set to your proper graphics mode, and this should happen before the commands which modify the variable name table (which is at PEEK(130)+256*PEEK(131)) ... the first variable which is referenced in this table should be S$ and there is a poke in the generated code which will set the variable's memory address equal to wherever you want, say PEEK(88)+256*PEEK(89) for your screen.

 

Your generated code should look something like this after you use CONVERT.BAS (this is an example using a redefined Graphics 0 font):

 


3000 POKE 756,PEEK(106)-8
3009 VT=PEEK(134)+PEEK(135)*256
3010 SF=PEEK(140)+PEEK(141)*256
3020 S=(PEEK(106)-*256-SF
3030 HS=INT(S/256):LS=S-HS*256
3040 POKE VT+2,LS:POKE VT+3,HS
4010 S$(1)="        <<<  fff"
4020 S$(20)=CHR$(34):S$(21)="    66ÿlþØØ 8|À||8 ÆÎ8pæÆ 8l8pÞÌv     0```0 00 Û~<~Û  ~   	 "
4030 S$(106)="  < 		 0`À |ÆÎÖæÆ| 8< |Æ0`þ |ÆÆ| <lÌþ þÀüÆ| |ÀüÆÆÆ| þ0`À |ÆÆ|ÆÆ| |Æ"
4040 S$(203)="Æ~p        00`0  ~  ~   00 <f  |ÆÆÞÜÀ~ |ÆÆþÆÆÆ üÆÆüÆÆü |ÆÀÀÀÆ| üÆÆÆÆÆü þÀÀ"
4050 S$(300)="øÀÀþ þÀÀøÀÀÀ |ÆÀÀÎÆ| ÆÆÆþÆÆÆ << Æ| ÆÌØðØÌÆ ÀÀÀÀÀÀü ÆîþÖÆÆÆ ÆæöþÞÎÆ |ÆÆÆÆÆ| üÆÆÆüÀÀ |ÆÆÆ"
4060 S$(397)="ÆÎ~üÆÆÆüÌÆ |ÆÀ|Æ| ~ ÆÆÆÆÆÆ| ÆÆll88 ÆÆÆÖ|ll Æî|8|îÆ ÌÌxx000 þ0`þ <00000< À`0 <"
4070 S$(494)="<  8lÆ 		ÿ Dîþþ|8 øø   øø   øø8pàÀÀàp8?ÿ    "
4080 S$(591)="€Ààðøüþÿ    ðððð    ÿÿ            ÿÿ    ðððð88îî8       ÿÿ   ÿÿ 8|þþ|8 	ÿÿÿ"
4090 S$(688)="ÿÀÀÀÀÀÀÀÀ   ÿÿÿÿ   ðððððððð   öÌæÌð08| |8  0`þ`0   þ  8|þ|8   |~Æ~ "
4100 S$(785)="ÀÀüÆÆÆü   |ÆÀÆ| ~ÆÆÆ~   |ÆþÀ| 600~00   ~ÆÆ~üÀÀüÆÆÆÆ  8<  Æ|``flxlf 8<   ìþÖÆÆ  "
4110 S$(882)=" üÆÆÆÆ   |ÆÆÆ|   üÆÆüÀÀ  ~ÆÆ~  ÜöÀÀÀ   |À|| 0ü0006   ÆÆÆÆ~   ÆÆl|8   ÆÖþ|l   Æî|îÆ   ÆÆÆ~ü  "
4120 S$(979)="ü0`ü 8|þT| þðøÜÎ ~þ~ ÀðüþüðÀ "
4999 RETURN 

 

You will notice that CONVERT.BAS makes allowances for CHR$(34) (double quotes) and CHR$(155) (carriage return) by automatically inserting those assignments into your code should these characters be encountered in your file.

 

Important lines:

 

3009: VT is the address of the variable name table

3010: SF is the offset location of the first variable in the variable name table, in this case S$

 

Lines 3020 to 3040 use the string offset to cause the memory address of S$ to be set to the location of your RAM character set, which is (PEEK(106)-8)*256

 

Lines 4010 - 4120 are obviously the modifed font converted to ATASCII character data, the S$ string assignments will automatically POKE the ATASCII data contained in quotes, into your character set RAM.

 

This should be the very first line of your program:

0 CLR:DIM S$(1024):S$(1024)="":GOSUB 3000

 

Which will clear the variable name table and ensure S$ is the first variable encountered in the table.

 

 

 

 

The code above is for a modified character set. In your case, you will want to modify this code for screen graphics.

 

For example, if you want to use GRAPHICS 0 for your screen, line 0 should have DIM S$(960) which is the length of a string big enough to hold an entire GRAPHICS 0 screen (40x24=960).

 

At line 3000, replace the poke with a GRAPHICS call for whatever mode you want to use, or set up your display list here.

 

Change line 3020 to:

3020 S=PEEK(88)+256*PEEK(89)-SF

 

This command will ensure that ADR(S$) gets set to SAVMSC (pointed to by 88 and 89) so that S$="" causes the data immediately to get POKEd to your screen.

 

WARNING: do NOT attempt to make any changes to S$ or do other commands in immediate mode after your program with this code has been run. Immediate mode commands will shift the variable name table and undoubtedly hang your Atari.

 

 

CONVERT.BAS also allows you to convert your screen (or other) file into DATA statements, although this takes longer to load ... the generated code has a FOR NEXT loop which will READ the DATA and then POKE it into the appropriate screen location. I much prefer string offsets, as the effect is immediate.

 

Also, this can be used for ML or binary code, and if you tell CONVERT.BAS that the file is binary code, the first six bytes of the file are automatically stripped, and you can modify your generated program code to load the ML code anywhere in memory.

 

Hope this helps! The font used in this program was generated by this program itself. :) how neat is that? Have a look through the code.

 

  • Like 1
Link to comment
Share on other sites

Synthpopalooza, could you make the attached COOKTITL.LST (made by CONVERT.BAS program from a .MIC file) display a GRAPHICS 15+16 screen?

 

Done! All I did was change the line where the variable S is refrenced:

 

S=0-SF

 

To this:

 

SCR=PEEK(88)+256*PEEK(89):S=SCR-SF

 

This is what sets your string S$ to point to screen memory. Ideally, you want your Graphics 15+16 call to go before the beginning of this routine so that screen memory is set properly.

 

It's also good practice to move your DIM statement to the first line of your program to ensure that variable S$ goes into the Variable name table first. I also added the GRAPHICS call before going to the initialization routine. Your screen comes up immediately :)

 

run "D:COOKTITL.BAS"

Convert.atr

Link to comment
Share on other sites

It works but the result is different from original (apart colors I have to set manually).

Image is shifted and dots are present in the lower right part.

post-12528-129776445001_thumb.png post-12528-129776445128_thumb.png

I attach again the .atr image now including the original .mic file too.

 

I see the problem!

 

When you ran CONVERT.BAS, you selected "Yes" for binary file. That should not be done for your pic as it will strip out the first 6 bytes! This caused the image to shift to the left 6 bytes, fortunately I have fixed this problem.

 

again, RUN "D:COOKTITL.BAS"

 

Convert (1).atr

 

 

 

 

 

 

  • Like 1
Link to comment
Share on other sites

It works but the result is different from original (apart colors I have to set manually).

Image is shifted and dots are present in the lower right part.

post-12528-129776445001_thumb.png post-12528-129776445128_thumb.png

I attach again the .atr image now including the original .mic file too.

 

I see the problem!

 

When you ran CONVERT.BAS, you selected "Yes" for binary file. That should not be done for your pic as it will strip out the first 6 bytes! This caused the image to shift to the left 6 bytes, fortunately I have fixed this problem.

 

again, RUN "D:COOKTITL.BAS"

 

Convert (1).atr

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

Thank you very much!

Another question.

If I want to swap between different images, what I have to do?

I think something should be changed in "CONVERT.BAS" program to output to another string instead of default "S".

 

Well the thing is, once the routine is initialized, long as you don't go out of Graphics 15+16, any operations involving S$ will immediately reflect on the screen! S$ can be set equal to your new graphics screen, or you can even use string subset commands like S$(start,end) to only change a portion of the screen.

 

So run CONVERT.BAS again on your next screen file, choose a different line number range... once the list file is generated, NEW and ENTER it back in, and remove all lines with commands other than S$="" ... so the only lines left will be basically the operations on S$. That means, the first few lines with the DIM statement and the POKEs and all that, and the last line with the POKE 140 and POKE 141 need to be removed. The only thing left will be the S$ string assignments. And also leave the RETURN command in there too.

 

Oh, and remember to select "N" when it asks you if this is a binary file.

 

LIST the new program to DISK, then ENTER it with your program loaded, and it should work. Doing a GOSUB to your new routine will put the new picture on screen.

 

If for any reason you need the string to be something besides S$ it is a simple matter to modify CONVERT.BAS ... though I don't have the listing handy at the moment, it should be an easy matter of looking through the code and finding the commands which print your program lines to disk, and changing "S{:content:}quot; to whatever string variable you want.

Edited by Synthpopalooza
  • Like 1
Link to comment
Share on other sites

 

 

If for any reason you need the string to be something besides S$ it is a simple matter to modify CONVERT.BAS ... though I don't have the listing handy at the moment, it should be an easy matter of looking through the code and finding the commands which print your program lines to disk, and changing "S{:content:}quot; to whatever string variable you want.

 

The lines which need to be modified in CONVERT.BAS are 1080, 1140, and 1210: Replace S$ in those lines with whatever you'd like the variable name to be.

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