Search found 19 matches

by bjones
Mon Apr 06, 2020 11:21 am
Forum: Newbie Help Center
Topic: Help with 16 bit compare. is it even possible?
Replies: 4
Views: 1604

Re: Help with 16 bit compare. is it even possible?

At its most basic level, comparing two numbers is really just subtracting one from the other and checking if the result is positive, negative, or zero, and multi-byte subtraction is trivial on the 6502: SEC # initialize carry flag to 1 for subtraction LDA var1+0 SBC var2+0 # subtract the lowest byt...
by bjones
Mon Apr 06, 2020 6:33 am
Forum: Newbie Help Center
Topic: Help with 16 bit compare. is it even possible?
Replies: 4
Views: 1604

Help with 16 bit compare. is it even possible?

So basically this has to do with drawing or not drawing sprites. The problem is that i cannot think of good way to compare 16bit positions. For example: the current camera spans from X high: 1 and X low 100 which makes the edge of the screen X high: 2 to X low: 100. my current draw routine cannot ac...
by bjones
Sat Jan 04, 2020 7:04 am
Forum: Newbie Help Center
Topic: BG tile collison when scrolling feed back
Replies: 4
Views: 3296

Re: BG tile collison when scrolling feed back

i think i uderstand you guys now, Ive been treating my sprite objects on a screen only basis where as i should treat them as " in the world " like you would building a game for todays platforms but instead its just translating 8 bit positioning to 16. if i track them using a 16bit world position the...
by bjones
Sat Jan 04, 2020 5:35 am
Forum: Newbie Help Center
Topic: BG tile collison when scrolling feed back
Replies: 4
Views: 3296

Re: BG tile collison when scrolling feed back

so the main thing here is collisions with the tiles. I can render the scene just as you described no problem, but for speed I want to check the tiles in 16 x 16 blocks rather than 8 x 8. this causes issues of collision blocks wrapping when half way off the screen to the other side. maybe theres a tr...
by bjones
Fri Jan 03, 2020 1:51 pm
Forum: Newbie Help Center
Topic: BG tile collison when scrolling feed back
Replies: 4
Views: 3296

BG tile collison when scrolling feed back

Hi, I am now implementing collision for my background tiles in my side scrolling game and I think I may be over complicating this. my set up: - I keep the high and low bytes of the current scroll variable. - I have an array of 16 x 16 positions for my collsion tiles with a variable for which scroll ...
by bjones
Wed Dec 04, 2019 6:25 am
Forum: Newbie Help Center
Topic: Question about negative numbers
Replies: 8
Views: 3864

Re: Question about negative numbers

I actual went back last night and greatly simplified the whole thing. This only works if you align your entities x position to the right most position and not the center. basically if your enitity's high byte is 0 then draw any sprite that is equal to or greater than your base X postion. If your if ...
by bjones
Tue Dec 03, 2019 12:17 pm
Forum: Newbie Help Center
Topic: Question about negative numbers
Replies: 8
Views: 3864

Re: Question about negative numbers

Yeah so I implemented a smooth meta-sprite scroll offscreen the exact way I mentioned before and it works well. basically you just check to see in the base entity + size touches the edge of the screen ( basically if x + width or y + height sets the carry ) and if so check each individual sprites to ...
by bjones
Mon Dec 02, 2019 11:12 am
Forum: Newbie Help Center
Topic: Question about negative numbers
Replies: 8
Views: 3864

Re: Question about negative numbers

ahh so there is a negative flag nice.

so for metasprites scrolling offscreen I guess you have to do a caculation for each individual sprite to see if its off screen or not, if its within the sprtie size range so each sprite ( as smoothly as possible ) gets put into the offscreen positions?
by bjones
Mon Dec 02, 2019 8:57 am
Forum: Newbie Help Center
Topic: Question about negative numbers
Replies: 8
Views: 3864

Question about negative numbers

This I think is really simple but I just wanted to run it by someone to make sure. An entity postion should be stored in 4 bytes if the entity can scroll off screen correct? x high and low, y high and low. basically, if it is beyond the right side of the screen ( over 255 )you can add the carry to t...
by bjones
Tue Nov 26, 2019 6:34 am
Forum: Newbie Help Center
Topic: Nested loops and working with X and Y
Replies: 5
Views: 3526

Re: Nested loops and working with X and Y

yeah I just implemented the top approach right after I posted. What makes the second one better?
by bjones
Tue Nov 26, 2019 6:16 am
Forum: Newbie Help Center
Topic: Nested loops and working with X and Y
Replies: 5
Views: 3526

Nested loops and working with X and Y

Okay so I need some information how to store and restore the x and y index value. I have tried using txa and tax but that doesnt seem to work. I hav'nt tried using those in conjuction wih pha though. Basically I want to be able to have nested loops beyond just 2. the only way i can see doing that is...
by bjones
Sat Nov 23, 2019 9:34 pm
Forum: Newbie Help Center
Topic: Status bar questions and help
Replies: 8
Views: 3734

Re: Status bar questions and help

nevermind i figured it out. I added the whole preserving AYX
pla
tay
pla
tax
pla

to the nmi as well as the irq handler



thanks again
by bjones
Sat Nov 23, 2019 8:18 pm
Forum: Newbie Help Center
Topic: Status bar questions and help
Replies: 8
Views: 3734

Re: Status bar questions and help

okay ive got it thanks buuuuttt, lol
im getting some weird like random tile glitching on the scrolling sections now.

any ideas?
by bjones
Thu Nov 21, 2019 8:36 pm
Forum: Newbie Help Center
Topic: Status bar questions and help
Replies: 8
Views: 3734

Re: Status bar questions and help

just a simple reset scroll (below). I guess I am more interested in how the standard way of doing this. is it really just drawing it separately each frame after you draw your background? or is there other tricks?

Code: Select all

 lda #$00
	sta $2005
  LDA #$00  
	sta $2005
by bjones
Thu Nov 21, 2019 2:46 pm
Forum: Newbie Help Center
Topic: Status bar questions and help
Replies: 8
Views: 3734

Re: Status bar questions and help

when the IRQ hits the line i selected I just set the scroll to 0 in the irq handler. Which works until the tables flip unless the status bar is in both tables because I copy the tables back and forth to keep the scrolling going. lda scroll_x bne :+ lda nametable eor #$01 sta nametable :