While I posted this in the programming forums for others to use, I figure it'll be easier for me to find it later in my own blog if I need a backup of this thing or something. Right now it takes too many lines to position an object since I have the actual HMOVE separated from the positioning but it's at least a start. I guess the next thing I'll be doing is trying to integrate the hmove into the equation while keeping the time used constant. I'm guessing this is where the real pain starts for this kind of thing.
As an overview of what's happening in the picture, the solid yellow strip is where the cycle 73 positioning is going on. The red dot is P0, the 4 bars is P1. P1 is being positioned regularly with a standard hmove during the VBLANK. P0 is being positioned during the yellow strip. Both are getting their X position from the variable Xpos and thus should always line up. Moving left and right is limited in range from 0-159.
As an overview of what's happening in the picture, the solid yellow strip is where the cycle 73 positioning is going on. The red dot is P0, the 4 bars is P1. P1 is being positioned regularly with a standard hmove during the VBLANK. P0 is being positioned during the yellow strip. Both are getting their X position from the variable Xpos and thus should always line up. Moving left and right is limited in range from 0-159.
Attached Files
-
cycle73.zip (3.88K)
downloads: 87



Create a custom theme







Trying to place the HMOVE in the same line as the RESPx is going to be a difficult.
It is possible, as I believe the Juno First kernel does just that, but it requires a dozen or so mini-kernels and a way to jump between them (such as indirect jumps to RAM.) The advantage to the Juno First approach is that it does useful work during repositioning instead of a divide-by-15 loop in the middle of the kernel that wastes a whole line. The disadvantage is that, as I understand, the kernel takes up nearly an entire bank.
I can think of a simpler way to do it without using any RAM for a jump table, but you can't do useful work during repositioning. You can place a series of compares and branches to 13 alternative kernels and each mini-kernel will start with a RESPx and then have enough NOPs to fill in time until the HMOVE, then a JMP back to the main kernel.