You need to write to P0, P1 and then P0 again if you want to change the ouptut of both players while VDEL is enabled.
The mechanism isn't very complicated once you understand the basics:
There are 2 registers for each player in the TIA: "new" (the one at the top in the stella debugger) and "old" (at the bottom).
When you write to GRPx in your code, 2 things happen:
1 - the value you're writing is stored in the "new" register
2 - the content of the "new" register of the other player is copied in the "old" register
The key part is that this mechanism is always in place, no matter if VDEL is enabled or not.
What VDEL does is just select which one of the two registers is used for the actual output to the screen. If VDEL is enabled, the "old" register is used, if it's disabled, the "new" one will be shown instead.
So, suppose that the value of both GRP0_new and GRP1_new is $F0. If VDEL is enabled, the actual output for the two players is whatever is stored in their "old" registers.
If you want the output to be $01 for both, you proceed like this:
- store $01 to GRP0
GRP0_new is now $01, GRP0_old stays the same it was before, while GRP1_new ($F0) is copied to GRP1_old.
- store $01 to GRP1
GRP1_new is now $01, GRP1_old stays as it was ($F0), GRP0_new ($01) is copied to GRP0_old.
- store "anything" to GRP0
GRP0_new takes the new value, GRPO_old stays $01, GRP1_new ($01) is copied to GRP1_old.
Now the ouptut is $01 for both players.
Edited by alex_79, Sun Aug 5, 2018 12:16 AM.