icbrkr Posted September 22, 2002 Share Posted September 22, 2002 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 Quote Link to comment Share on other sites More sharing options...
icbrkr Posted September 22, 2002 Author Share Posted September 22, 2002 Okay, maybe I should RTFM I did some playing, and managed to redefine a charset (ooo... I made a 2 color letter "A" ) and get it to display. Now it's just a matter of time before I write Quake for the 5200 Quote Link to comment Share on other sites More sharing options...
+Allan Posted September 23, 2002 Share Posted September 23, 2002 May we see your code? I would like to see how you did it on 5200BAS. Allan Quote Link to comment Share on other sites More sharing options...
icbrkr Posted September 23, 2002 Author Share Posted September 23, 2002 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 Quote Link to comment Share on other sites More sharing options...
skywalker2000 Posted September 23, 2002 Share Posted September 23, 2002 How would I be able to run what I am running? Lets say I made a silly print" Pac-Man " command. How would I get to run the program? Quote Link to comment Share on other sites More sharing options...
icbrkr Posted September 24, 2002 Author Share Posted September 24, 2002 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? Quote Link to comment Share on other sites More sharing options...
icbrkr Posted September 24, 2002 Author Share Posted September 24, 2002 .. figured out the Joystick port issue (reread some messages on the board..noticed it was the same values). I still need help on the spread out sprite, however. Quote Link to comment Share on other sites More sharing options...
calamari Posted September 24, 2002 Share Posted September 24, 2002 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 Quote Link to comment Share on other sites More sharing options...
icbrkr Posted September 24, 2002 Author Share Posted September 24, 2002 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 Quote Link to comment Share on other sites More sharing options...
skywalker2000 Posted September 24, 2002 Share Posted September 24, 2002 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.. But my question has been answered anyways. I did not notice I screwed up what I was trying to say. lol Quote Link to comment Share on other sites More sharing options...
icbrkr Posted September 24, 2002 Author Share Posted September 24, 2002 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? Quote Link to comment Share on other sites More sharing options...
Jetboot Jack Posted September 25, 2002 Share Posted September 25, 2002 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 Quote Link to comment Share on other sites More sharing options...
icbrkr Posted September 25, 2002 Author Share Posted September 25, 2002 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. Quote Link to comment Share on other sites More sharing options...
calamari Posted September 25, 2002 Share Posted September 25, 2002 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 Quote Link to comment Share on other sites More sharing options...
calamari Posted September 25, 2002 Share Posted September 25, 2002 I'm not sure how clear that was, so here is an example program: TEMPL=123:GOSUB PRINTVAR DO:LOOP PRINTVAR: RIGHT:RIGHT:RIGHT TEMPH=10 DO A=TEMPL:IF ZFLAG=TRUE THEN EXIT DO DIV8:A=A+48 PRINT CHR$(A):LEFT LOOP RETURN calamari Quote Link to comment Share on other sites More sharing options...
icbrkr Posted September 25, 2002 Author Share Posted September 25, 2002 I'll give it a try that way... could you also, for lower numbers, just write the values directly to video ram? In other words, poke $1000,1, etc for the letter A? This was possible on the C64, not sure if it's possible on the Atari. Brian Quote Link to comment Share on other sites More sharing options...
calamari Posted September 26, 2002 Share Posted September 26, 2002 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 Quote Link to comment Share on other sites More sharing options...
Jetboot Jack Posted September 26, 2002 Share Posted September 26, 2002 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 Quote Link to comment Share on other sites More sharing options...
calamari Posted September 27, 2002 Share Posted September 27, 2002 There is an example of how to use players in the River Racer game. I've updated it a little and added comments so the code is easier to understand. calamari Quote Link to comment Share on other sites More sharing options...
skywalker2000 Posted September 27, 2002 Share Posted September 27, 2002 Why is it so important to place things in surtain memory location. It's funny that I have no idea how to make a game but I was just moved to the I.T. department at my job. Quote Link to comment Share on other sites More sharing options...
skywalker2000 Posted September 27, 2002 Share Posted September 27, 2002 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. If I am completly off track, let me know Quote Link to comment Share on other sites More sharing options...
calamari Posted September 28, 2002 Share Posted September 28, 2002 I suggest that you read the Player & Missile graphics section of Atari System Reference Manual (not the 5200 one this time). Also read the Display list chapter of the same reference work. calamari Quote Link to comment Share on other sites More sharing options...
icbrkr Posted September 28, 2002 Author Share Posted September 28, 2002 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 Quote Link to comment Share on other sites More sharing options...
calamari Posted September 28, 2002 Share Posted September 28, 2002 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 Quote Link to comment Share on other sites More sharing options...
icbrkr Posted September 29, 2002 Author Share Posted September 29, 2002 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.