Pseudo 3D Starfield

Here you can ask questions or provide insights about how to use efficiently 6502 assembly code on the Oric.
Post Reply
User avatar
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK

Pseudo 3D Starfield

Post by Twilighte » Tue Mar 11, 2008 5:36 pm

I'm looking for good 6502 examples of pseudo 3D starfields. I guess i'll also look at C64 or BBC games with 3D starfields in them too, if only to capture the code they used.
The accumulative methods i am experimenting with atm are not accurate or variable enough.

For example i am currently using a fractional stepping method in order to move the trajectory in all angles, but 8 bit fractional stepping is not sufficient..

Code: Select all

lda reference
adc frac
sta reference
Depending on FRAC this provides a sequence of regular 1's amongst 0's like 0000100001 in the Carry flag

Code: Select all

lda XOffset
adc #00
sta XOffset
Add this to XOffset which ranges 0-119 and then branch to add or subtract from 120 will provide the x position of the star.
Then by increasing the frac value i am able to increase the regularity of carry's and so increase the velocity of the star.
however wherther it be the random routine i am using to store the original FRAC for both x and Y trajectories or the limits of 8 bit fractional stepping i only ever get a limited number of trajectories and the result looks false.

What is most annoying is that i was sure i have done a good 3D starfield many years ago but have since lost the source.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest