Posted Fri May 13, 2011 11:57 PM
Posted Sat May 14, 2011 2:52 AM
Posted Sat May 14, 2011 4:49 PM
JAC!, on Fri May 13, 2011 11:57 PM, said:
Posted Sat May 14, 2011 5:28 PM
ScumSoft, on Sat May 14, 2011 2:52 AM, said:
STA RESP0 sleep 3 STA RESP0 ; the reset occurs during the START signal for the first extra copy
STA RESP0 sleep 8 STA RESP0 ; the reset occurs during the START signal for the second extra copy
STA RESP0 sleep 19 STA RESP0 ; the reset occurs during the START signal for the third extra copyMichael
Posted Sat May 14, 2011 7:02 PM
JAC!, on Fri May 13, 2011 11:57 PM, said:
Posted Sun May 15, 2011 12:29 AM
Wickeycolumbus, on Sat May 14, 2011 7:02 PM, said:
Posted Sun May 15, 2011 1:14 AM
Edited by JAC!, Sun May 15, 2011 1:14 AM.
Posted Sun May 15, 2011 1:55 AM
JAC!, on Sun May 15, 2011 1:14 AM, said:
Posted Sun May 15, 2011 2:00 AM
Edited by ScumSoft, Sun May 15, 2011 2:03 AM.
Posted Sun May 15, 2011 2:28 AM
ScumSoft, on Sun May 15, 2011 2:00 AM, said:
; somewhere during vblank... LDA #3 STA NUSIZ0 STA NUSIZ1 ; also set GRP0, GRP1, COLUP0, and COLUP1 ; then in the loop for the active lines... STA RESP0 sleep 3 STA RESP0 sleep 7 STA RESP1 sleep 3 STA RESP1 sleep 7 STA RESP0 sleep 3 STA RESP0 sleep 7 STA RESP1 sleep 3 STA RESP1You should get 10 single-wide players, all spaced 8 pixels apart (the second set of player1 sprites will wrap around to the left side of the screen and get covered up by player0):
Posted Sun May 15, 2011 3:22 AM
Posted Sun May 15, 2011 2:26 PM
ScumSoft, on Sun May 15, 2011 3:22 AM, said:
---------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+- ?????????????000000000000000000000000000000000000000011111111111111111111111111 ?????????????000011112222333344445555666677778888999900001111222233334444555566 ---------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+- STA RESP0^^^^-76543210---ssss-76543210---ssss-76543210---.... +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 0000000000000000000000000000001111111111111111111111111111112222222222222222222 0001112223334445556667778889990001112223334445556667778889990001112223334445556 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+The top 4 lines are a ruler depicting the counts of player0's position counter; each count lasts 4 color clocks. A plus indicates the start of a count, and a minus indicates another color clock in the current count. The numbers are read down-- the first row is the 10s digit, and the second row is the 1s digit. The question marks indicate unknown counts before RESP0 is strobed.
STA RESP0^^^^-76543210---ssss-76543210---ssss-76543210---.... +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ .........sleep 3..STA RESP0^^^^-76543210---ssss-76543210---ssss-76543210---.... ................................00000000........00000000........00000000.......This next figure dispenses with the rulers, except for a line of pluses and minuses for the cycles. If you wait 3 cycles after STA RESP0 and then do another STA RESP0, the reset signal from the second STA RESP0 occurs during the START signal for the near copy from the previous STA RESP0. Although RESP0 doesn't trigger a START for the main copy, the main copy is drawn anyway, thanks to the START signal for the previous RESP0's near copy. So you get all 3 copies of player0.
STA RESP0^^^^-76543210---ssss-76543210---ssss-76543210--- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- .........sleep 3..STA RESP0^^^^-76543210---ssss-76543210---ssss-76543210--- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- ...........................sleep 7..............STA RESP1^^^^-76543210---ssss-76543210---ssss-76543210--- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- .........................................................sleep 3..STA RESP1^^^^-76543210---ssss-76543210---ssss-76543210--- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- ................................00000000........00000000........00000000........11111111........11111111........11111111...You have to wait 7 cycles after the second RESP0, then strobe RESP1 twice like you did RESP0-- strobe RESP1, wait 3 cycles, then strobe RESP1 again. You get 3 copies of player0 spaced 8 clocks apart, then 3 copies of player1 spaced 8 clocks apart, with 8 clocks between player0 and player1.
STA RESP0 ; ......... sleep 3 ; ......... STA RESP0 ; ......... sleep 7 ; .....00000000........ STA RESP1 ; 00000000. sleep 3 ; .......00 STA RESP1 ; 000000... sleep 7 ; .....11111111........ STA RESP0 ; 11111111. sleep 3 ; .......11 STA RESP0 ; 111111... sleep 7 ; .....00000000........ STA RESP1 ; 00000000. sleep 3 ; .......00 STA RESP1 ; 000000...This shows the RESP0 and RESP1 instructions, along with the sleep instructions, with the players shown in the comments. The main copy of player0 gets drawn during the first sleep 7 instruction, and the close copy of player0 gets drawn during the first STA RESP1 instruction. You'd have time during the sleep 7 to load and store the graphics for the close copy of player0, but you can't store new graphics for the middle (third) copy of player0 before it starts to draw. Likewise with player1. If you pre-load GRP0 and GRP1 during HBLANK, you'd have time to update them during the sleep 7 instructions so the first near copies would be different than the main copies. And you could use the sleep 3 instructions to update GRP0 and GRP1 again if needed, assuming the data were already loaded into the A, X, or Y registers. But there's just no way to update the third copies of player0 and player1 to make them unique-- at best, you'd get the first few pixels of the third copy being equal to the first few pixels of the second copy. So this trick has limited applications.
Posted Sun May 15, 2011 2:34 PM
---1-0-1-0-1-0----- --1-0-I-0-1-0-1---- ---0-1-0-1-0-1----- --0-1-O-1-0-1-0----Where "I" and "O" are the spots were RESP1 and RESP0 are hit, respectively, and "1" and "0" are the places the other copies of player 1 and 0 show up.
Posted Sun May 15, 2011 6:13 PM
supercat, on Sun May 15, 2011 2:34 PM, said:
0 members, 0 guests, 0 anonymous users