diff --git a/STATUS.md b/STATUS.md index 65edf246..53f37638 100644 --- a/STATUS.md +++ b/STATUS.md @@ -78,7 +78,7 @@ Not all of them - only these we want to have implemented. | `$A004` | revision str | DONE | | | `$A533` | LINKPRG | DONE | | | `$A659` | set txt ptr | NOT DONE | | -| `$A68E` | RUNC | NOT DONE | | +| `$A68E` | RUNC | DONE | | | `$A7AE` | NEWSTT | NOT DONE | | | `$AB1E` | STROUT | DONE | | | `$BDCD` | LINPRT | DONE | temporary implementation | diff --git a/c64/basic/a68e.runc.s b/c64/basic/a68e.runc.s index dfec0e32..5daa4b22 100644 --- a/c64/basic/a68e.runc.s +++ b/c64/basic/a68e.runc.s @@ -1,5 +1,27 @@ -// XXX provide documentation and implementation +// Well-known BASIC routine, described in: +// +// - [CM64] Compute's Mapping the Commodore 64 - page 97 +// - https://www.c64-wiki.com/wiki/BASIC-ROM +// - https://csdb.dk/forums/?roomid=11&topicid=137233 +// + +// XXX use this routine to initialize TXTPTR RUNC: - STUB_IMPLEMENTATION() + // According to WIKI, we should load $7A/$7B with $2B-1/$2C-1), this does not makes sense. + // But CSDB claims, that it should 'set current character pointer to start of basic - 1' - this + // looks sane, also checked that the original BASIC routine does this (short test program) + + // Let's initialize TXTPTR using TXTTAB + + lda TXTTAB+0 + sec + sbc #$01 + sta TXTPTR+0 + + lda TXTTAB+1 + sbc #$00 + sta TXTPTR+1 + + rts