Subject: [stella] Obviously doing something wrong... From: "Ruffin Bailey" <rufbo@xxxxxxxxxxxxx> Date: Sun, 24 Sep 2000 14:55:19 -0400 |
Welp, I've dug out my demo from two years ago (thanks again to Eckhard for fixing a few bugs), but all I had was Eckhard's dissembly of my bin from the archive so I've started in over-commenting again. Hoping to have a _very_ simple example of reading the joystick as an obvious next step to Nick's HtDaP. Anyhow, as things stand, Player Zero is ALWAYS moving right unless I move the stick to the left-- with nothing different if I move the stick to the right. I tried commenting out where I check for the right movement, and sure enough the movement stops. Isn't d7 the bit read by BMI & BPL? I'll quote the part of the code where I read the joystick, and include the whole shibang as an attachment. Mind you, I'm still hacking, so comments about how the player's going to disappear when he's on the same scan as the beginning of the platform in the PF is a bit premature. ;^) Just trying to figure out what bone-headed mistake I made with the joystick reads. Sorry in advance if this is some silly error that I woulda gotten with a little more patience... gotta run off to work to get ahead a few hours so I decided it was time to stop with the demo practice. Thanks! Ruffin Bailey PS Any particular reason that Thrust is $25 and not the usual $16 at Hozer? Any supercool docs or something? ;^) Here's the "crucial" code: ;===================================================== ; reset hmove with y for testing (remove later) (I already reset with A earlier) ;===================================================== ldy #$00 sty HMP0 ;===================================================== ; RIGHT ;===================================================== BMI LF06C ; if there's a zero in a bit, then we know that someone closed the switch with the joystick ; therefore, if there's a one, then the switch is still open. BMI is "Branch on Minus", which is ; defined as having bit 7 set as 1. So if we have a minus, we don't have a zero in d7 of swcha ; and shouldn't make the fellow move to the right. Jump over the next two lines. ; A plus (d7 = 0) means set the hmp0 to move the dude to the right. LDY #$F0 ; least amount of movement to the right STY HMP0 ; shove it into HMOVE for player zero LF06C: ROL ; This rolls the bits to the left. The carry flag gets whatever was in d7, d7 gets whatever was in d6, etc ; I can't remember if the acum's d0 gets what was in the carry flag right off the top of my head.
Attachment:
joy.das
Description: Binary data
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [[stella] PCAE and Win2k], Dan Iacovelli | Thread | [stella] Why write for the 2600, Glenn Saunders |
Re: [stella] Interlace, Erik Mooney | Date | Re: [stella] Interlace, Mark De Smet |
Month |