Hey, this is my first post here, so i guess i'l do a little introduction. I'm mike, i'm 16 and i'v been doing C++ for around 5 years, dabbled in some java, x86 assembly, php, javascript. I've always wanted to learn z80 assembly ever since i starting writing programs in BASIC for my TI-84.
Now to my question:
I've been studying "learn ti-83+ assembly in 28 days", and I can't seem to wrap my head around how to take a sprite like this:
Code:
and copy it to PlotSScreen at a given X and Y. Since the project im currently working on (Pong) doesnt really require alot of graphics, i plan on a XOR routine. I could just find someone else's sprite routine, but i want to actually understand the logic behind the code.
Here is what i had in mind for a routine:
1. Let C = 0. this denotes what row we're on
2. Find Starting Byte - ([y+(c*y)]*12) + (x/8)
3. Copy Row C of Data from ball to PlotSScreen
4. Repeat steps 1 - 4 incrementing C untill C >= the height of the sprite(8 for ball)
The only problem i have is that i'm not sure how to handle when x%8 != 0. I know i have to shift bits but im not sure how to do that.
Any help would be appreciated!
Now to my question:
I've been studying "learn ti-83+ assembly in 28 days", and I can't seem to wrap my head around how to take a sprite like this:
Code:
ball:
.DB %00111100
.DB %01111110
.DB %11110111
.DB %11110011
.DB %11111111
.DB %11111111
.DB %01111110
.DB %00111100
and copy it to PlotSScreen at a given X and Y. Since the project im currently working on (Pong) doesnt really require alot of graphics, i plan on a XOR routine. I could just find someone else's sprite routine, but i want to actually understand the logic behind the code.
Here is what i had in mind for a routine:
1. Let C = 0. this denotes what row we're on
2. Find Starting Byte - ([y+(c*y)]*12) + (x/8)
3. Copy Row C of Data from ball to PlotSScreen
4. Repeat steps 1 - 4 incrementing C untill C >= the height of the sprite(8 for ball)
The only problem i have is that i'm not sure how to handle when x%8 != 0. I know i have to shift bits but im not sure how to do that.
Any help would be appreciated!