Synthpopalooza Posted June 28, 2009 Share Posted June 28, 2009 I haven't programmed an Atari 8-bit in about 20 years ... but I used to be quite good at Turbobasic. But here are some questions I have: First off, I have discovered Action. Are there any libraries out there which are good for player-missile graphics movement? Secondly, I have been thinking about trying to do an update of the Super Breakout game. This time I want to make it more like the 2600 version. The idea I have is to use a GRAPHICS 0.1 screen (mode 0, GTIA 1, 16 shades) with a display list interrupt on register 712 to shade the bricks (which will themselves have 16 shades). The question is, is there any facility to detect a collision between player/missiles and a GTIA playfield? If not, then is there a formula for translating a players position into a character position? That is, being able to take a player's position and read the character where it's located? Keeping in mind of course, this is for a Graphics 0 screen. The last question, is: Is it possible to have 2 DLI's running? I had thought about using a DLI on register 712, but also a GTIA (623) DLI so that the top line of text could be normal Graphics 0 (gtia mode 0). Would this be feasible? Quote Link to comment Share on other sites More sharing options...
Kr0tki Posted June 28, 2009 Share Posted June 28, 2009 The last question, is: Is it possible to have 2 DLI's running? I had thought about using a DLI on register 712, but also a GTIA (623) DLI so that the top line of text could be normal Graphics 0 (gtia mode 0). Would this be feasible? You can achieve the effect of multiple different DLIs by changing ANTIC's DLPTR register during a DLI. Use the VCOUNT register to make the DLPTR change on a specific scanline. Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted July 1, 2009 Author Share Posted July 1, 2009 Back to collisions: I know you can't detect collisions between a player and a GTIA mode 9 playfield. What if, you changed the GTIA register (623) to 0 during a VBLANK and then back to 64? Would the collison register during the time the screen changed to gtia 0? Quote Link to comment Share on other sites More sharing options...
MaPa Posted July 1, 2009 Share Posted July 1, 2009 (edited) I don't think so, the collision is checked on the fly when drawing each pixels on the screen IMHO. So during VBLANK there can't be any change of collision registers. Ad. player position to char conversion, of course you can calculate it, HPOS=48 when the top most bit of player is the first pixel in normal mode screen width and each char has four pixels ((HPOS-48)/4=X pos of char 0..39). The same works for Y position, but it depends on your display list and I don't know right now the exact number of the first player line in visible screen. Edited July 1, 2009 by MaPa Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted July 1, 2009 Author Share Posted July 1, 2009 I don't think so, the collision is checked on the fly when drawing each pixels on the screen IMHO. So during VBLANK there can't be any change of collision registers. Ad. player position to char conversion, of course you can calculate it, HPOS=48 when the top most bit of player is the first pixel in normal mode screen width and each char has four pixels ((HPOS-48)/4=X pos of char 0..39). The same works for Y position, but it depends on your display list and I don't know right now the exact number of the first player line in visible screen. Well, for the moment, I am only using a normal GRAPHICS 0 screen, not modified in any way, except for having the GTIA set to mode 1 (graphics 9) and a DLI on register 712 used to color the bricks. I also will use double-line resolution to save on memory, so 2 vertical lines of GRAPHICS 0 should equal the vertical size of a player pixel? And in actuality, the collision would be between the playfield and one of the missiles (which will be used as the ball). Quote Link to comment Share on other sites More sharing options...
MaPa Posted July 2, 2009 Share Posted July 2, 2009 Yes, in double line pmg resolution one line of pmg equals two lines of one character in gr.0. IMHO when GTIA mode is set (by setting upper two bits of gprior register to any non zero value) then no collision checking is made. The collision bits should be set up on the fly as the screen is drawing, pixel by pixel there is decision what should be displayed in depends of gprior register and simultaneously appropriate collision registers are set. But I just think so, don't know if it's true. Quote Link to comment Share on other sites More sharing options...
Rybags Posted July 2, 2009 Share Posted July 2, 2009 (edited) If you enact the Scanline 240 bug, you can have PMGs displayed in the normally black offscreen area, even during VSync. You need to put Antic in Wide mode though, otherwise the HSync pulses get sent at the wrong time, and you need to put it in Blank mode during VSync. Then after VSync you goto Wide mode again. But you need to the change to Blank at the correct time, otherwise an unwanted HSync gets generated and will foul up the display. Edited July 3, 2009 by Rybags Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted July 3, 2009 Author Share Posted July 3, 2009 Yes, in double line pmg resolution one line of pmg equals two lines of one character in gr.0. IMHO when GTIA mode is set (by setting upper two bits of gprior register to any non zero value) then no collision checking is made. The collision bits should be set up on the fly as the screen is drawing, pixel by pixel there is decision what should be displayed in depends of gprior register and simultaneously appropriate collision registers are set. But I just think so, don't know if it's true. I think there is collision checking for GTIA mode 2 (Graphics 10) but I am not sure. I'll probably just end up by using character position to detect collisons on this one. Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted July 8, 2009 Author Share Posted July 8, 2009 Success I think! Turns out the formula for Y position of player/missile in Graphics 0 (or any text mode with 23 rows) is: (YPOS-16)/4 using double line resolution, or /8 with single line. My collision routines are working! I'll keep posting about this project as it happens. Quote Link to comment Share on other sites More sharing options...
MaPa Posted July 8, 2009 Share Posted July 8, 2009 Success I think! Turns out the formula for Y position of player/missile in Graphics 0 (or any text mode with 23 rows) is: (YPOS-16)/4 using double line resolution, or /8 with single line. My collision routines are working! I'll keep posting about this project as it happens. You mean 24 rows right? Yes, the vertical position is something like (YPOS-16)/4 if you have standard modes, if you use your own display list you have to adjust according to it. In single line PMG mode it should be (YPOS-32)/8 IMHO (double the first 16 scanlinas above too). Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted July 10, 2009 Author Share Posted July 10, 2009 (edited) Success I think! Turns out the formula for Y position of player/missile in Graphics 0 (or any text mode with 23 rows) is: (YPOS-16)/4 using double line resolution, or /8 with single line. My collision routines are working! I'll keep posting about this project as it happens. You mean 24 rows right? Yes, the vertical position is something like (YPOS-16)/4 if you have standard modes, if you use your own display list you have to adjust according to it. In single line PMG mode it should be (YPOS-32)/8 IMHO (double the first 16 scanlinas above too). Very true. I have another question now! I plan on using each character block to represent two bricks, like so: ######## ######## ######## ######## top brick -------------- ######## ######## ######## ######## bottom brick So this means I will have 4 possible characters: Both bricks, top only, bottom only, and no bricks. My collision routine for (ypos-16)/4 works, but is there a way I can break it down further so I can tell whether the ball is touching the bottom part of the character or the top part? Edit: Just had an idea ... (ypos-16)/8 ... whether it's the top or bottom brick is dependent on whether (ypos-16)/8 returns an odd or even number? Edited July 10, 2009 by Synthpopalooza Quote Link to comment Share on other sites More sharing options...
Gury Posted June 22, 2019 Share Posted June 22, 2019 I resurrected this thread because it is proper place to point something out. I had in my mind that missiles can be set to different sizes by setting SIZEM (53260). I experimented a little and it worked well. But reading De Re Atari it mentions that something like that can't be accomplished: https://www.atariarchives.org/dere/chapt04.php 4 Quote Link to comment Share on other sites More sharing options...
Rybags Posted June 22, 2019 Share Posted June 22, 2019 Yes, that text in De Re is very much wrong. But one thing that should be pointed out - if using the missiles as a 5th player grouped together then you need to take the sizes into consideration when doing the H-positioning. Although usually you'd have them all set to the same size so all the offsets would be the same. 4 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.