Jump to content
IGNORED

Need some help with ANTIC screen modes on the 5200, etc.


icbrkr

Recommended Posts

Okay, first off, I'm an old C64 programmer so unfortunately, I don't understand the concepts of "screen modes" the way Atari does them.

 

I'm messing with 5200BAS, as well as the Antic screen drawing util (which I would have killed for back in the day of C64 charset drawing :)). From what I'm understanding, I can #include this file into my PROGRAM.BAS file and it'll compile. I got this much accomplished, but how do I use this redefined character set? Or is that even what I'm looking at?

 

I guess more of the question I'm trying to ask is this: How do I create custom charsets, and how can I display them using 5200BAS?

 

I'm used to creating a charset and loading them into a spot in the C64's RAM and flipping a bit to use the newly defined charset.

 

Brian

Link to comment
Share on other sites

It's pretty basic...

 

I drew the character set using the ANTIC4 tool that Calamari wrote. I outputted it to ASM, and then copied just the character set out of the file it created (in this case, called game.char).

 

I used an #include to import it into my code at memlocation $9000 (you have $4000-BFFF free on a 32K cart so it could have been put anywhere in this range - I used $9000 because Calamari used it in an example he had on his page). Then I used the SET command to tell 5200bas where the new character set resided at (SET CHARSET=$9000). The rest of the code is me importing a screen and copying it over to video memory ($1000) and setting up the colors for the palette.

 

cls

title off

 

 

'---------------------------------------------------------------------

' Main

'---------------------------------------------------------------------

SCREEN 4

'SET SCREEN=$B000 newscreen

SET CHARSET=$9000 basechar

PALETTE 0,$00:PALETTE 1,$B4:PALETTE 2,$A8:PALETTE 3,$72:PALETTE 4,$B0

memcopy $B000,$1000,1024

 

 

 

 

 

 

 

'---------------------------------------------------------------------

' DATA

'---------------------------------------------------------------------

 

.ORG $9000 ; ANTIC 4 character set

MAZECHAR:

#INCLUDE game.char

 

.ORG $b000

MAINSCREEN:

#include screen.char

Link to comment
Share on other sites

I haven't a clue of what you're trying to ask :?

 

For everyone else -

 

By reading examples, I found that reading JOYX(0) and getting results of $0F and DC will return if the joystick is pushed left and right. What should I get for up and down when reading JOYY(0)?

 

Also,

 

I was able to create a sprite, but it looks, well, odd for what I originally designed. I created a simple arrow pointer, and though the design is still correct, there is an extra pixel between each pixel that I originally intended to draw.. in other words:

 

Instead of this:

 

AAAA

 

I get this:

 

A A A A

 

I did some reading and there was reference to single and double bytes, and I tried to configure it to use single (in case that was the cause of the spaces) but it didn't work. Ideas?

Link to comment
Share on other sites

Can you post a few lines of your sprite data? Make sure to use both the high and low nibble.. for example to have 8 dots across, use $FF. Using $0F or $F0 would only give 4 dots. $55 or $AA would only give every other dot.

 

There is also SIZEP0, SIZEP1, etc, to control the width (give a value 0-3)but those shouldn't leave empty spaces. For more info on SIZEP0 see Mapping the Atari, there is a good description of it starting at $D008 (which is $C008 in the 5200).

 

HTH,

calamari

Link to comment
Share on other sites

I'll do some more looking at how sprites are set up on the Atari. I did do the reading on the memory mapping of sprites and pointers, and I've got it all written down on a piece of paper next to me :) I think I'm confused by the "high and low" nibble. I'm used to writing a sprite (again, C64 programmer) by adding up the rows and using the combination of binary values to place into a memory location (ie, 8 dots = 255, $FF). I'll add everything up and try again.

 

Brian

Link to comment
Share on other sites

I haven't a clue of what you're trying to ask  :?  

 

For everyone else -  

 

By reading examples, I found that reading JOYX(0) and getting results of $0F and DC will return if the joystick is pushed left and right.   What should I get for up and down when reading JOYY(0)?

 

Also,

 

I was able to create a sprite, but it looks, well, odd for what I originally designed.  I created a simple arrow pointer, and though the design is still correct, there is an extra pixel between each pixel that I originally intended to draw.. in other words:

 

Instead of this:

 

AAAA

 

I get this:

 

A A A A

 

I did some reading and there was reference to single and double bytes, and I tried to configure it to use single (in case that was the cause of the spaces) but it didn't work.  Ideas?

 

 

 

 

I think I didn't ask that question the way I should have.. :ponder:

But my question has been answered anyways. I did not notice I screwed up what I was trying to say. lol

Link to comment
Share on other sites

I figured out now the difference between the C64 sprite drawing, and the Atari's.

 

The C64 does 8 pixels across, numbered 1 2 4 8 16 32 64 128

 

Whereas the Atari does 8 pixels numbered 8 4 2 1 8 4 2 1. Same concept, but that explains why my sprite was so messed up.

 

Now, to slow down the joystick input routine.. it's too fast :)

 

Also, is there a way to print a variable? In other words, Z=10: PRINT Z?

Link to comment
Share on other sites

Atari Sprites (or players) are not composed of 2 nibbles of data in paired 8,4,2,1 format, but are byte wide strips up to 255 bytes high...

 

The leftmost pixel of a Player is 128 and the rightmost 1 - a full solid horizontal line is 255 or 128+64+32+16+8+4+2+1...

 

Check out these reference pages:

 

http://www.atariarchives.org/agagd/chapter5.php

 

or

 

http://www.atariarchives.org/dere/chapt04.php

 

sTeVE

Link to comment
Share on other sites

This is what I thought as well, and I created the first sprite as such.

 

I went in and checked out Calamari's missile.inc example, and it was done in an 8,4,2,1 *2. (if it was all on pixels, it would be $FF 8+4+2+1 = $F * 2) When I switched to doing it this way, it worked fine? I'm not sure, but I'm happy it worked.

Link to comment
Share on other sites

Also, is there a way to print a variable?  In other words, Z=10: PRINT Z?

 

Not directly, but you can make your own printing routine by dividing by 10 and printing remainders:

 

For example: if Z=123, then 123/10=12 remainder 3 (see DIV8 and DIV16), so we print a 3 (in reality you'd have to convert the decimal number to ascii (add 48 ) or atascii, depending on where "0" is in your character set). Then you store the 12 back in Z and divide again, etc. So 12/10=1 remainder 2, print 2, store 1.. 1/10=0 remainder 1, print 1. The number is now zero so we're done printing. Of course that will print 321 rather than 123, so you use LEFT rather than RIGHT. Either that, opr store the remainders in an array and print them out backwards. Printing larger numbers will require a bit more work to juggle the two halves of the 16-bit number, but it's doable. That's how I'm printing how much cash you have won or lost in Solitaire.

 

calamari

Link to comment
Share on other sites

Yeah you can always write directly to screen memory if you want to (that's how I did PRINT ;)). You can even change the location of screen memory, using the SET statement. You aren't trapped in, the commands I made are just to make your life easier. Write your whole program in straight ASM, 5200BAS won't mind :)

 

calamari

Link to comment
Share on other sites

ickbrk,

 

Missles, not players- ah ha!

 

Well missiles are 4, 2 bit wide, objects each with independent horizontal position registers - not the same as the byte wide Players!

 

Calamari's example:

 

;-------------------------------------------------------------------------

; Missile Sprite ROM Graphics (2x256 each)

; M3 M2 M1 M0

;----------------------+8 4 2 1+8 4 2 1+----------------------------------

.BYTE $F7 ;. . . .| . . .|

.BYTE $57 ; . .| . . .|

.BYTE $F7 ;. . . .| . . .|

.BYTE $67 ; . . | . . .|

.BYTE $F7 ;. . . .| . . .|

 

This is for MISSILE objects not really the best way to treat PLAYER objects - the two are a bit different :)

 

I'd still recommend looking at the pages I put in a previous mail as a good understanding of PMG and then DLI techniques is the way you'll get solid performance from the Atari Sprite System...

 

sTeVE

Link to comment
Share on other sites

I was looking at the code in Racer52 and for a moment I understood how it worked. :)

 

I take it that surtain characters from the antic program will be located in these memory location. Or something like that. I mean, the program has to tell it somehow that it's a boat thats on the screen. :P

 

If I am completly off track, let me know ;)

Link to comment
Share on other sites

I spent the last couple of days wracking my brains about some code, but I figured out the problem when I went to post it here.

 

I just noticed that 5200BAS assembles its variables in $B000 by default. Of course for me, this just happens to be where I was storing my screens for the game. So, when I went to move my screen to $1000 for viewing, I took the code along with it :) So I had all sorts of words and values on my screen. Now, I think I'll be sitting down and writing a nice organized memory map for my game so I don't continue to place stuff where it shouldn't be :D

Link to comment
Share on other sites

Ahh.. yes any string literals you use will be placed starting at $B000. You can change this location with the SET statement. Other variables must be DEFINE'd. Just FYI, the string storage is "smart" meaning that if you print "YELLOW" then you print "LOW", it doesn't store "LOW" as a second string. print "YELL" would require a second string because of the termination character.

 

calamari

Link to comment
Share on other sites

I've spent about an hour debugging a joystick routine I thought I had written incorrectly.

 

It was checking for a button press, and while the button was pressed, it JMP'd to a routine and ran a bunch of comparision tests (ie, where is the pointer, does this game piece belong to you, etc). If I pressed the button too long while on a piece that did belong to you (which would jump to a separate routine), random bits of my charset would pop onto the screen and eventually the joystick routine would either quit going left or right, or up or down. I searched and searched but couldn't find anything wrong.

 

So then I jumped from emulating it with 5200 to JUM52. Lo and behold, it worked fine and I couldn't recreate the problem. Has anyone else had issues like this before? I'd hate to continue working on my code as if nothing was wrong but I'm thinking there might be an issue in the 5200 emulator. What does everyone else test their code in?

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