Jump to content
IGNORED

My first Homebrew: Vong


Wickeycolumbus

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by Wickeycolumbus
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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