Wickeycolumbus Posted March 31, 2008 Author Share Posted March 31, 2008 (edited) I have 36 wasted scan lines in vertical blank and 25 in overscan. Any chance I can read the paddles in one of these (perferably in overscan)? (the display part of my kernel seems to alredy have too many cycles) Thanks Edited March 31, 2008 by Wickeycolumbus Quote Link to comment Share on other sites More sharing options...
supercat Posted March 31, 2008 Share Posted March 31, 2008 I have 36 wasted scan lines in vertical blank and 25 in overscan. Any chance I can read the paddles in one of these (perferably in overscan)? (the display part of my kernel seems to alredy have too many cycles) If you can spare some cycles (probably 7-10) every 8 scan lines, you might be able to take care of the paddle in overscan or VBLANK. The number of cycles you'll need every 8 scan lines depends upon what you're doing with count registers and the like. Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted March 31, 2008 Share Posted March 31, 2008 If you can spare some cycles (probably 7-10) every 8 scan lines, you might be able to take care of the paddle in overscan or VBLANK. The number of cycles you'll need every 8 scan lines depends upon what you're doing with count registers and the like. Then you are limited to very few positions. Maybe just 4 or even less. But even if you use all 36 vblank lines, you still have only 36 positions. You could oversample and read multiple times each scanline, but then the paddle becomes very sensitive (and also might jitter a lot). Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted March 31, 2008 Author Share Posted March 31, 2008 I dont get what is wrong with my code... paddletest.zip Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted March 31, 2008 Share Posted March 31, 2008 I dont get what is wrong with my code... It seems that you try to check INPT0 while bit 7 in VBLANK is still set. Quote Link to comment Share on other sites More sharing options...
+batari Posted March 31, 2008 Share Posted March 31, 2008 If you can spare some cycles (probably 7-10) every 8 scan lines, you might be able to take care of the paddle in overscan or VBLANK. The number of cycles you'll need every 8 scan lines depends upon what you're doing with count registers and the like. Then you are limited to very few positions. Maybe just 4 or even less. But even if you use all 36 vblank lines, you still have only 36 positions. You could oversample and read multiple times each scanline, but then the paddle becomes very sensitive (and also might jitter a lot). When I read Supercat's response, I was wondering if he meant kernel cycles, then do something in VBLANK in addition to that, because yeah, 4 positions would be useless. Maybe he's suggesting getting a coarse reading in the kernel, then use that reading to determine when to discharge the cap again in the kernel at the right time, estimating that the next reading should take place in VBLANK, and if you hit it right, use that reading, if not, use the coarse reading. It seems to me that the coarse reading should rarely be needed and it would work fairly well. If you put the fine reading in VBLANK, it seems to me that you could get about 120 positions, which is not too bad. Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted March 31, 2008 Author Share Posted March 31, 2008 (edited) I dont get what is wrong with my code... It seems that you try to check INPT0 while bit 7 in VBLANK is still set. I changed the #$82 that I store into VBLANK and made it into a #$02. I still get the same results paddletest2.zip Edited March 31, 2008 by Wickeycolumbus Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted March 31, 2008 Share Posted March 31, 2008 I changed the #$82 that I store into VBLANK and made it into a #$02. I still get the same results Now you never set bit 7. Change the first existing write (before VSYNC) into $80. Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted March 31, 2008 Author Share Posted March 31, 2008 I really dont get this, I think i did what you said... paddletest3.zip Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted March 31, 2008 Share Posted March 31, 2008 I really dont get this, I think i did what you said... VBLANK seems correct now. But "paddle" is not at a good address (e.g.) $ea Also: 1. BPL also branches when the values are the same (think of A - B = 0, which is positive), so your code will NEVER reach line 66! 2. The additional check around line 45 is superfluous Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted March 31, 2008 Author Share Posted March 31, 2008 (edited) I really dont get this, I think i did what you said... VBLANK seems correct now. But "paddle" is not at a good address (e.g.) $ea Also: 1. BPL also branches when the values are the same (think of A - B = 0, which is positive), so your code will NEVER reach line 66! 2. The additional check around line 45 is superfluous what address does paddle have to be at? EDIT: I chaged the bne nopadchange to beq nopadchange. now I still have to figure out the bpl thing... Which line is line 45? (my text editor does not have a line counter) Edited March 31, 2008 by Wickeycolumbus Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted March 31, 2008 Author Share Posted March 31, 2008 This is what i have now, but is still does not work... Help Please! paddletest4.zip Quote Link to comment Share on other sites More sharing options...
supercat Posted March 31, 2008 Share Posted March 31, 2008 Maybe he's suggesting getting a coarse reading in the kernel, then use that reading to determine when to discharge the cap again in the kernel at the right time, estimating that the next reading should take place in VBLANK, and if you hit it right, use that reading, if not, use the coarse reading. It seems to me that the coarse reading should rarely be needed and it would work fairly well. The basic approach is something like this. Assume you have a variables called paddle_coarse (must stay frame to frame), one called paddle_pos (need not remain) Before the kernel, turn on VBLANK bit 7. During the busy part of the kernel, assuming you have a line counter that counts down once every 10 scan lines (for example), clear bit 7 of BLANK when the line counter equals paddle_coarse. After the busy part of the kernel, time how long it takes for the INPT0 pin to switch (0-30 scan lines). Store that count in paddle_pos. Then: paddle_pos = paddle_lookup[paddle_coarse] + paddle_pos if temp = 0 and paddle_coarse > 0 then paddle_coarse = paddle_coarse - 1 if temp1 < 10 and paddle_coarse > 0 then paddle_coarse = paddle_coarse - 1 if temp2 > 20 and paddle_coarse < coarse_max then paddle_coarse = paddle_coarse + 1 if temp == 30 and paddle_coarse < coarse_max then paddle_coarse = paddle_coarse + 1 The paddle_lookup table should compute paddle_coarse*10. The paddle will be limited to moving a maximum of 20 lines per frame, and on the first frame when it's moved sharply it may move less than that. On the other hand, the routine will give precise paddle readings with minimal overhead during the upper part of the kernel. Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted April 1, 2008 Share Posted April 1, 2008 This is what i have now, but is still does not work... Help Please! And what should it do when it works? Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted April 1, 2008 Author Share Posted April 1, 2008 This is what i have now, but is still does not work... Help Please! And what should it do when it works? it should have a sprite that is moved by the paddle. Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted April 5, 2008 Author Share Posted April 5, 2008 There is almost scoring in this version. both of the numbers go up when the ball is missed (the scoring is not yet individual) but it is a start. The AI sucks now because I shortened the playfield in favor of the score board (192 scan lines down to 175; score board is 15 scan lines, and there is a 3 scan line gap in between them. I still have not fixed the screen rolling. vong20080404.bin Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted April 5, 2008 Author Share Posted April 5, 2008 Fixed the numbers. vong20080404.bin Quote Link to comment Share on other sites More sharing options...
gambler172 Posted April 5, 2008 Share Posted April 5, 2008 Hi Wickey The Joystick control was good...... greetings Walter Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted April 5, 2008 Author Share Posted April 5, 2008 Hi WickeyThe Joystick control was good...... greetings Walter The joystick control is still there. I have not yet figured out how to use paddles. Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted April 12, 2008 Author Share Posted April 12, 2008 Ok, I got the screen to stop rolling, but i took out the centerline and the sound for now, for timing issues. They will be added in later. I did not fix the AI yet, but I will hopefully this weekend. I plan on testing this on the real thing soon (the first time I did this, the screen still rolled, so it was not playable). vong20080411.bin Quote Link to comment Share on other sites More sharing options...
+LS650 Posted April 12, 2008 Share Posted April 12, 2008 Good start... Quote Link to comment Share on other sites More sharing options...
gambler172 Posted April 12, 2008 Share Posted April 12, 2008 Hi Wickey looks good.Cannot wait,to see something,when you start it on the 7800. greetings Walter Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted April 16, 2008 Author Share Posted April 16, 2008 Fixed the 3. I really do not know why it was not working I had: .byte #%00111000 .byte #%00001000 .byte #%00111000 .byte #%00001000 .byte #%00111000 and then i just converted it to hex: .byte #$38 .byte #$08 .byte #$38 .byte #$08 .byte #$38 and It worked. Anyone know why it did not work when it was in binary? vong20080416.bin Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted April 18, 2008 Author Share Posted April 18, 2008 I did this yesterday, but I had no time to post it. I Got rid of the garbage near the score in PF0, changed the score loading routine (Now It is easier to make scores separate), and put a white border around the Score. vong20080417.bin Quote Link to comment Share on other sites More sharing options...
gambler172 Posted April 19, 2008 Share Posted April 19, 2008 Hi Wickey Keep on your good working.Did you try 7800 programming in the meantime? gretings Walter 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.