I tried to make orange background colour by displaying red and yellow on screen, alternatively, each 20000 cycles (should match to VBLs).
But it keeps blinking, on emulators and on a real machine as well.
As I'm not assembler expert, here's the program I made... I already fixed a few mistakes but can't find anymore now. Any help would be great, unless someone already tried and tells me it's impossible (but Jede told me Twilighte had done that already...)
Thanks!
Code: Select all
sei
lda #11 Cy=2
sta adresse Cy=4 // #8D and screen address
--- tempo1 ---
ldx #18 Cy=2 // 25 loops
ldy #9E Cy=2 // 158 loops
DEY Cy=2
BPL #FD Cy=3; 2 cycles on the last one since there's no branching // FD=-3
DEX Cy=2
NOP Cy=2
STA #00 Cy=3 // just to spend 3 cycles without affecting the registers 85 00
BPL #FA Cy=3; 2 cycles on the last one since there's no branching // FA=-6
NOP Cy=2
NOP Cy=2
NOP Cy=2
NOP Cy=2
NOP Cy=2
NOP Cy=2
NOP Cy=2
NOP Cy=2
--- fin tempo1 ---
lda #13 Cy=2
sta adresse Cy=4 // #8D and screen address
--- tempo2 ---
ldx #18 Cy=2 // 25 loops
ldy #9E Cy=2 // 158 loops
DEY Cy=2
BPL #FD Cy=3; 2 cycles on the last one since there's no branching // FD=-3
DEX Cy=2
NOP Cy=2
STA #00 Cy=3 // just to spend 3 cycles without affecting the registers 85 00
BPL #FA Cy=3; 2 2 cycles on the last one since there's no branching // FA=-6
BPL #0 Cy=3
NOP Cy=2
NOP Cy=2
NOP Cy=2
NOP Cy=2
NOP Cy=2
--- fin tempo2 ---
JMP to the 1st STA Cy = 3
Tempo 1 cycles:
Intro (starting at the 1st LDA): 10
loop: 19974
(Total small loop: 158*5 - 1 = 789;
Total big loop: (789+10)*25 - 1 = 19974)
+ 8 NOPs = 20000
Tempo 2 cycles:
Intro: 10
loop: 19974
(Total small loop: 158*5 - 1 = 789;
Total big loop: (789+10)*25 - 1 = 19974)
+ final JMP 3
+ BPL0 and 5 NOPS = 20000