Jump to content
IGNORED

Keypad and DPC+


KevKelley

Recommended Posts

I was playing around with some ideas but was having an issue with integrating the keypad code from this old thread. I am assuming that it isn't working properly because it is not set up for DPC+. 

 

Not sure if I was missing something or not. 

 

I had also considered using a paddle but thought trying to make a keypad game could be cool.

TROMBONE_09_27_2024.bas

  • Like 1
Link to comment
Share on other sites

My light are finally back on. Many things to do to get things back to normal (we probably lost most stuff in the refrigerator and freezer). In case I forget to come back to this thread, please PM me with the answer that you get so I can put it on the bB page.

 

 

Thanks.

  • Like 1
Link to comment
Share on other sites

36 minutes ago, Random Terrain said:

My light are finally back on. Many things to do to get things back to normal (we probably lost most stuff in the refrigerator and freezer). In case I forget to come back to this thread, please PM me with the answer that you get so I can put it on the bB page.

 

 

Thanks.

Okay. Hope everything is okay (apart from the food). 

  • Like 1
Link to comment
Share on other sites

15 hours ago, Random Terrain said:

My light are finally back on. Many things to do to get things back to normal (we probably lost most stuff in the refrigerator and freezer). In case I forget to come back to this thread, please PM me with the answer that you get so I can put it on the bB page.

 

 

Thanks.

You impacted by the hurricane too? 

  • Like 1
Link to comment
Share on other sites

11 minutes ago, Prizrak said:

You impacted by the hurricane too? 

 

I think it was a tropical storm by the time it came through and blew over a bunch of trees and caused flooding in various areas. We kind of live on a hill semi-near Charlotte, NC, so we didn't have any flooding problems.

  • Like 1
Link to comment
Share on other sites

On 9/28/2024 at 12:24 PM, KevKelley said:

I was playing around with some ideas but was having an issue with integrating the keypad code from this old thread. I am assuming that it isn't working properly because it is not set up for DPC+.

 

TL;DR I did some modifications, and the keypad demo code seems to be working with DPC+, at least via Stella. I didn't redraw the playfield that the existing demo uses for DPC+ because I was lazy, but the sprites move based on the detected button.

 

Longer explanation: the demo runs most of the keypad code in the vblank time interval, probably because the standard kernel has a decent number of free cycles in vblank. vblank is all but unusable in the DPC+ kernel due to lack of cycles, and because the bank where it would need to go (bank 1) is almost completely filled. I tried to solve issue #2 by switching to another bank from the vblank routine, but this caused problems, probably because of issue #1.

 

I then moved the inline statement to a bB routine which is called right before drawscreen. This appears to work in Stella at least. The downside is that it reduces your available per-frame cycles. How much? I'm not sure. It may or may not be practical for a DPC+ game (but I'm interested to hear either way). Let me know how well this works for you.

 

Edit: I forgot to mention that this requires the ASM files included in this package:

 

https://forums.atariage.com/applications/core/interface/file/attachment.php?id=135272

 

keydpc.bas

keydpc.bas.bin

  • Like 2
Link to comment
Share on other sites

5 hours ago, Karl G said:

I'm not sure. It may or may not be practical for a DPC+ game (but I'm interested to hear either way). Let me know how well

Thanks!

 

I will check it out. 
 

Basically my son has taken up trombone. I was a woodwind so I thought it would be fun to learn a bass brass instrument with no keys by making a kind of program to learn slide positions and notes. That is where the keypads came into play. 
 

I was gonna make him a program that would have the notes scroll across the bar and have the player use keypads to choose slide position and octave. I don’t think I would need nanosecond precision. 
 

If I couldn’t figure this one out I was gonna try a paddle to have the trombone slide go in or out and if that didn’t work just use the joystick. 

  • Like 2
Link to comment
Share on other sites

Everything works out perfectly! I had played around with some of the code before and played with it outside of the vblank and in different banks but didn't dig too deep.

 

With this template you fixed up I can plug in the data for my trombone program and I'm sure others might be able to find this useful too. Thanks!

  • Like 2
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...