I've been resurrecting some of my old games I wrote when I was a kid in order to be able to upload them and share with my people I had a bug 30 years ago with reading the joystick, and the bug is still there amazingly ha!
I think there must be a register I need to reset or something. After reset and loading my game, the joystick will only read in the right direction. Up/down/left don't work, until I do a reset and run the game again. Since I was using HESMON, the monitor would come up and I could run my machine code again with the G command and the joystick would work properly.
How do you PROPERLY initialize the joystick port to be able to read it correctly???
reading the joystick
Moderator: Moderators
- Mike
- Herr VC
- Posts: 4901
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Your program most probably compares whole register values. In that case, these postings might be interesting to you:
http://www.sleepingelephant.com/ipw-web ... 1&start=15
Greetings,
Michael
http://www.sleepingelephant.com/ipw-web ... 1&start=15
Greetings,
Michael
Hi Mike,
In your sample you used the address 37151 to read the joy up/down/left/fire so the 37151 address replicate the address 37137...
From the Vic-20 Memory Map:
In your sample you used the address 37151 to read the joy up/down/left/fire so the 37151 address replicate the address 37137...
From the Vic-20 Memory Map:
Code: Select all
9111 37137 Port A output register
-(PA0) Bit 0=Serial CLK IN
-(PA1) Bit 1=Serial DATA IN
-(PA2) Bit 2=Joy 0
-(PA3) Bit 3=Joy 1
-(PA4) Bit 4=Joy 2
-(PA5) Bit 5 = Lightpen/Fire button
-(PA6) Bit 6=Cassette switch sense
-(PA7) Bit 7=Serial ATN out
911F 37151 Port A (Sense cassette switch)
Mega-Cart: the cartridge you plug in once and for all.
- Mike
- Herr VC
- Posts: 4901
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Not quite. 37137 also controls the Handshake of Port A, 37151 has no effect on Handshake. For the aforementioned use, it surely makes no difference. But in my variant, all necessary registers are placed nearby - thus were more easily to remember for me.nbla000 wrote:so the 37151 address replicate the address 37137...