introduction_to_programming_the_beamracer
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
introduction_to_programming_the_beamracer [2020/07/11 23:10] – [Initialization] laubzega | introduction_to_programming_the_beamracer [2020/10/08 14:45] – [Local Memory] laubzega | ||
---|---|---|---|
Line 24: | Line 24: | ||
< | < | ||
- | VREG_CTRL1 | + | VREG_CONTROL |
- | LDX VREG_CTRL1 | + | LDX VREG_CONTROL |
INX | INX | ||
BNE BEAMRACER_ALREADY_ACTIVE | BNE BEAMRACER_ALREADY_ACTIVE | ||
LDX #$42 | LDX #$42 | ||
- | STX VREG_CTRL1 | + | STX VREG_CONTROL |
LDX #$52 | LDX #$52 | ||
- | STX VREG_CTRL1 | + | STX VREG_CONTROL |
- | LDX VREG_CTRL1 | + | LDX VREG_CONTROL |
BEQ BEAMRACER_FOUND_AND_ACTIVATED | BEQ BEAMRACER_FOUND_AND_ACTIVATED | ||
RTS ; sadly, no BeamRacer... | RTS ; sadly, no BeamRacer... | ||
Line 67: | Line 67: | ||
LDA #$20 | LDA #$20 | ||
STA VREG_ADR0H | STA VREG_ADR0H | ||
- | LDA #$01 ; advance LRAM pointer by one on every transfer | + | LDA #$01 ; advance LRAM pointer by one after every transfer |
STA VREG_STEP0 | STA VREG_STEP0 | ||
LDX #0 | LDX #0 | ||
Line 77: | Line 77: | ||
</ | </ | ||
- | On some occasions you may also want to read from LRAM with the CPU. There is an extra step involved, as many 6510 addressing modes result in a bus READ access before the requested WRITE occurs, which could lead to confusing results if not used with care. Register | + | On some occasions you may also want to read from LRAM with the CPU. There is an extra step involved, as many 6510 addressing modes result in a bus READ access before the requested WRITE occurs, which could lead to confusing results if not used with care. Register |
< | < | ||
- | LDA VREG_CTRL1 | + | LDA VREG_CONTROL |
ORA # | ORA # | ||
- | STA VREG_CTRL1 | + | STA VREG_CONTROL |
LDA #$00 | LDA #$00 | ||
Line 144: | Line 144: | ||
<code vasyl> | <code vasyl> | ||
- | dlist: | ||
WAIT 48,13 | WAIT 48,13 | ||
MOV $20, 1 | MOV $20, 1 | ||
Line 151: | Line 150: | ||
MOV $20, 0 | MOV $20, 0 | ||
END ; this is a handy alias for instruction "WAIT 511, | END ; this is a handy alias for instruction "WAIT 511, | ||
- | dlend: | ||
</ | </ | ||
Line 163: | Line 161: | ||
<code vasyl> | <code vasyl> | ||
- | dlist: | ||
WAIT 48, 0 | WAIT 48, 0 | ||
MOV $20,15 | MOV $20,15 | ||
Line 171: | Line 168: | ||
MOV $20,15 | MOV $20,15 | ||
END | END | ||
- | dlend: | ||
</ | </ | ||
Line 178: | Line 174: | ||
<code vasyl> | <code vasyl> | ||
- | dlist: | ||
WAIT 48, 0 ; starting line | WAIT 48, 0 ; starting line | ||
MOV | MOV | ||
Line 186: | Line 181: | ||
MOV | MOV | ||
END | END | ||
- | dlend: | ||
</ | </ | ||
Line 212: | Line 206: | ||
<code vasyl> | <code vasyl> | ||
- | dlist: | ||
WAIT 48, 0 ; starting line | WAIT 48, 0 ; starting line | ||
loop: | loop: | ||
Line 225: | Line 218: | ||
BRA loop ; loop endlessly | BRA loop ; loop endlessly | ||
END ; never reached | END ; never reached | ||
- | dlend: | ||
</ | </ | ||
Line 249: | Line 241: | ||
To make a counter run, we now need to use instruction " | To make a counter run, we now need to use instruction " | ||
- | <code vasyl [highlight_lines_extra=" | + | <code vasyl [highlight_lines_extra=" |
- | dlist: | + | |
WAIT 48, 0 ; starting line | WAIT 48, 0 ; starting line | ||
SETA | SETA | ||
Line 265: | Line 256: | ||
BRA loop ; will be skipped when counter 0 reaches 0 | BRA loop ; will be skipped when counter 0 reaches 0 | ||
END | END | ||
- | dlend: | ||
</ | </ | ||
introduction_to_programming_the_beamracer.txt · Last modified: 2021/09/10 01:49 by silverdr