Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 05/11/2014 in Blog Entries

  1. 2 points
    Normally paddles are read with a routine like this: bit INPT0 ;3 @3 bmi .paddleDone-1 ;2³ @5/6 sty padZero ;3 @8.paddleDone: If the branch is taken it jumps between the opcode and operand of the 'sty padZero' instruction. The trick is to make the ram location of 'padZero' the same as an opcode that takes 2 cycles. That way the routine takes 8 cycles no matter what. There are several ram locations which could be chosen for 'padZero'. Some of the better ones include $EA (NOP opcode), $D8 (CLD opcode), $B8 (CLV opcode). You need to have X or Y as a line counter to make that optimized routine work. For CAA (Circus AtariAge) I didn't have either X or Y available. I'm using Y to skipdraw two objects (each with a different scanline counter that gets loaded into Y). I'm also using X with LAX (indirect),Y to pre-load for an upcoming line when it gets busy in the kernel. I looked for a way to make a paddle routine without using X or Y. I also required it to have constant cycles since a lot of places in the CAA kernel are already fully packed without a WSYNC... for several lines. An unique constraint of CAA allowed me to construct a routine without using X or Y. The constraint was I simply needed less than 128 samples to get the full range of movement for the seesaw: The routine essentially looks like this (for one paddle), with padZero pre-loaded to $7F: lda #$7F ;2 @2 cmp INPT0 ;3 @5 adc padZero ;3 @8 sta padZero ;3 @11 I don't care about bit 7. Only values 128-255 use bit 7, and I need only 118 samples. It can be set or cleared by the routine on different scanlines and that's okay. Ultimately I deal with the result like this: lda #$7F eor padZero asl lsr ; clears carry too adc #OFFSET_FOR_SEESAW sta hposSeeSaw Turning the paddle right moves the seesaw right, as it should be. I added a similar routine for reading 'padOne' as I'm reading both paddles every frame. I've thought about reading paddles every other scanline or so, and alternating frames (read only one paddle per frame). In the end I decided to write a kernel for maximum resolution. In future blog entries I might comment on some the trials and tribulations I had with early HMOVE's and paddle reads, and how it affected design decisions.
  2. 1 point
    I think it's best to consult a lawyer before you post anything. You never know how someone is going to interpret what you say. Every sentence needs to be expanded into at least 5 paragraphs so your meaning will be obvious to even the most dense. A mob can form quickly and you can be labeled an a-hole or a troll before you've had a chance to respond. Your attempts to explain what you thought was obvious in the first place and your call for people to look back at what you said can be seen as "classic troll behavior." A mob can create a troll or an a-hole out of thin air. Even if you're lucky enough to have it all cleared up, you'll usually end up with some damage while the mob goes off on their merry way without a scratch. Mobs are worse than real trolls. They do more damage because mobs are usually made up of pillars of the community; honorable men and women. The quickly formed "upright citizens brigade" goes on a little crusade hacking and slashing, raping and pillaging, drinking from golden chalices full of warm human blood, then they go back to their self-righteous, self-satisfied lives where they are convinced that they have never committed an evil act, as blood trickles down their chins. Related Link: Flame Warriors: The Swarm Random Terrain _
×
×
  • Create New...