XREG / XPEEK / XPOKE / XDEEK / XDOKE
Opened this issue · 2 comments
rumbledethumps commented
Support for extended memory makes graphics and sound programming more approachable from BASIC.
XREG dev, chan, addr, data0, ...
data = XPEEK(addr)
XPOKE addr, data
netzerohero commented
See related ram-memory-peek and xram-peek efforts in @jthwho's RP6502-Shell, and his two c-functions:
void ram_reader(uint8_t *buf, uint16_t addr, uint16_t size) {
uint8_t *data = (uint8_t *)addr;
for(; size; size--) *buf++ = *data++;
return;
}
void xram_reader(uint8_t *buf, uint16_t addr, uint16_t size) {
RIA.step0 = 1;
RIA.addr0 = addr;
for(; size; size--) *buf++ = RIA.rw0;
return;
}
netzerohero commented
Approach, do in a separate git-branch:
Model XPOKE/XPEEK from existing PEEK/POKE code:
- Add new XPOKE/XPEEK commands to token-system; do XPEEK 1st:
a. POKE (and DOKE) is a "primary command token" type.
b. PEEK (and DEEK) is a "functions token" type; "functions tokens" require an extra "pre process routine table" entry.
c. TAB_ASCX: and LBB_xxx: table entries needed for the two new "X" commands patterned after PEEK and POKE. - Implement the execution-code LAB_XPOKE and LAB_XPEEK patterned from POKE/PEEK needed to access pico's xram.
- Repeat above for XDOKE and XDEEK - for double-bytes (16-bit versions).
- Code XREG last, learning from above.