Search found 314 matches

by Khaz
Wed Mar 11, 2015 7:46 pm
Forum: SNESdev
Topic: clean method of doing collision with tiles
Replies: 33
Views: 6610

Re: clean method of doing collision with tiles

But then you'd have to compensate for getting kicked upwards before you're pushed back out of a wall, for one thing. I did horizontal first and basically just patched around normal collision on the frame that you land to preserve your speed and such. Seems like a substantial workaround either way. T...
by Khaz
Tue Mar 10, 2015 2:37 pm
Forum: SNESdev
Topic: SNES Programing Help 2
Replies: 91
Views: 18315

Re: SNES Programing Help 2

Huh, I forgot about the effect that BIT had on the N and V flags. Sounds handy, you can test three conditions with a single instruction... ... except that it's setting Z based on the accumulator, but V and N based on the value at the operand address, which makes it confusing and weird to me... I can...
by Khaz
Mon Mar 09, 2015 7:51 pm
Forum: SNESdev
Topic: SNES Programing Help 2
Replies: 91
Views: 18315

Re: SNES Programing Help 2

Sorry to steer this conversation off topic a little... Helping you is literally the topic. :wink: I know there's a better way to do this, and at some point, I want to also have sprites flipped vertically, and that means I'd have to copy the routine 4 times... I know I could look to see if the bit w...
by Khaz
Mon Mar 09, 2015 4:47 pm
Forum: SNESdev
Topic: SNES Programing Help 2
Replies: 91
Views: 18315

Re: SNES Programing Help 2

Yeah, I'm using direct page to iterate through my list of objects, hence all the ".b" instructions.

Thanks for the input!
by Khaz
Mon Mar 09, 2015 2:14 pm
Forum: SNESdev
Topic: SNES Programing Help 2
Replies: 91
Views: 18315

Re: SNES Programing Help 2

That's what the carry/borrow part of ADC/SBC is for, to let you easily carry/borrow lower portions of a multi-byte(/multi-word, for SNES) addition/subtraction. I'm not sure if this was being addressed to my comment but if so: Do you mean to say I'm doing things as intended or are you proposing a fa...
by Khaz
Sun Mar 08, 2015 10:23 pm
Forum: SNESdev
Topic: SNES Programing Help 2
Replies: 91
Views: 18315

Re: SNES Programing Help 2

In my setup velocity is two bytes where the hi byte represents actual pixels/frame, and position is 3 bytes where the middle represents actual pixels. I branch based on whether velocity is positive or negative, add the sub-velocity to the sub-position in 16-bit mode, then bcc or bcs appropriately to...
by Khaz
Sat Mar 07, 2015 8:41 am
Forum: SNESdev
Topic: SNES Programing Help 2
Replies: 91
Views: 18315

Re: SNES Programing Help 2

Heh. I'm quite content doing literally everything in Hex. It's only taken a couple months or so for it to become second nature to me, and that way there's never any misunderstanding about what my code is doing. In most cases it's even easier than thinking in decimal: A standard tile is $10 or 16, so...
by Khaz
Fri Mar 06, 2015 5:24 am
Forum: SNESdev
Topic: clean method of doing collision with tiles
Replies: 33
Views: 6610

Re: clean method of doing collision with tiles

tokumaru wrote:So much complexity and we didn't even get to the slopes yet.
I should mention just in case it wasn't obvious that the method I use DOES handle smooth slopes.
by Khaz
Thu Mar 05, 2015 11:06 pm
Forum: SNESdev
Topic: SNES Programing Help 2
Replies: 91
Views: 18315

Re: SNES Programing Help 2

What I mean is, store the address of the metasprite table as a variable inside the object. Every frame, have your build metasprite routine look up the metasprite table at that address and draw it. This way you don't have to decide every frame which metasprite to draw. You just update that address wh...
by Khaz
Thu Mar 05, 2015 8:05 pm
Forum: SNESdev
Topic: SNES Programing Help 2
Replies: 91
Views: 18315

Re: SNES Programing Help 2

The bullet isn't circular though, so velocity isn't the only thing changing. What else is changing? But how can it tell if it is -16 or if it is 65528? (I think the second number is correct) It is both. Just try adding both of those to a two byte number and you'll get the same result. Is there a go...
by Khaz
Thu Mar 05, 2015 7:17 pm
Forum: SNESdev
Topic: SNES Programing Help 2
Replies: 91
Views: 18315

Re: SNES Programing Help 2

X and Y are both already being used in the metasprite routine, that is why. I don't plan on jumping to the routine outside of it. In that case, that's the beautiful part of my earlier suggestion of using direct page. Once you get that set up, you can just have metasprite routine call the X and Y po...
by Khaz
Thu Mar 05, 2015 6:49 pm
Forum: SNESdev
Topic: SNES Programing Help 2
Replies: 91
Views: 18315

Re: SNES Programing Help 2

lda ObjectTable+2,y sta MetaspriteXPosition lda ObjectTable+4,y sta MetaspriteYPosition stz MetaspriteDirection jsr start_metasprite ; jump to start_metasprite to build metasprites Why not just have start_metasprite reference the X and Y positions in the object variables directly, instead of copyin...
by Khaz
Thu Mar 05, 2015 3:47 pm
Forum: SNESdev
Topic: clean method of doing collision with tiles
Replies: 33
Views: 6610

Re: clean method of doing collision with tiles

Figure I might as well add my experience on this, I spent a lot of time on my own collision detection. I started off using the method from Sonic 1 as a base, having two vertical sensor lines on either side and one horizontal one, using this as a reference: http://info.sonicretro.org/SPG:Solid_Tiles ...
by Khaz
Wed Mar 04, 2015 7:30 pm
Forum: SNESdev
Topic: Need a beta tester for real SNES Hardware
Replies: 16
Views: 5517

Re: Need a beta tester for real SNES Hardware

Tried out the new Tetris and it works perfectly. Thanks! Can't really comment on how the L-hold-delay feels though as I'm not used to that feature.

Looking forward to seeing the next game!
by Khaz
Mon Mar 02, 2015 8:21 pm
Forum: SNESdev
Topic: Need a beta tester for real SNES Hardware
Replies: 16
Views: 5517

Re: Need a beta tester for real SNES Hardware

Ahh there we go, it works perfectly now!
Easy, I'll code it up tomorrow. Not sure where the slot will be on the screen tho.
That would be quite awesome of you, thanks!