Function Screen() to get a character code from screen
Posted: Sat Sep 28, 2024 11:49 pm
If Commander X16 BASIC had the function SCREEN(ROW, COL) that exists in GWBASIC and QBASIC then one could easily make e.g. trackers that use the BASIC editor without using machine code. Example that uses machine code:
Making 8-bit Music From Scratch at the Commodore 64 BASIC Prompt
SCREEN() function in GWBASIC: http://www.antonis.de/qbebooks/gwbasman/screenf.html
SCREEN() function in QBasic: https://www.qbasic.net/en/reference/qb1 ... SCREEN.htm
You can use some form of PEEK() from screen memory, but that is more complicated than using a SCREEN() function. You still need to use machine code to get multitasking, i.e. being able to edit the music while it plays. You can use Stop-key (Ctrl+C or Ctrl+Break or Ctrl+ScrollLock) and CONT (continue) instead of multitasking.
I wrote this in GW-BASIC that is compatible with Linus Ã…kesson's tracker, but it has only one channel:
You have to use RUN 80 to get the tracker music on the screen and then RUN to play it. The source code is also on https://github.com/mobluse/x16-psg-musi ... WTRAKR.BAS . On X16 it could have more sound channels.
Making 8-bit Music From Scratch at the Commodore 64 BASIC Prompt
SCREEN() function in GWBASIC: http://www.antonis.de/qbebooks/gwbasman/screenf.html
SCREEN() function in QBasic: https://www.qbasic.net/en/reference/qb1 ... SCREEN.htm
You can use some form of PEEK() from screen memory, but that is more complicated than using a SCREEN() function. You still need to use machine code to get multitasking, i.e. being able to edit the music while it plays. You can use Stop-key (Ctrl+C or Ctrl+Break or Ctrl+ScrollLock) and CONT (continue) instead of multitasking.
I wrote this in GW-BASIC that is compatible with Linus Ã…kesson's tracker, but it has only one channel:
Code: Select all
10 GOTO 90 'TRACKER INSPIRED BY LTFKRYO'S FOR C64 EDITOR IN BASIC&MC.
20 N0=ASC("@") 'CODE IS PURE GWBASIC. BREAK EARLY USING CTRL+SCRLK!
30 FOR I=8 TO 79
40 N=SCREEN(7,I):C=SCREEN(4,I)
50 N$=CHR$(N):C$=CHR$(C):LOCATE 4,I:COLOR 15:PRINT C$;
60 IF N$<>" " AND N$<>":" THEN PLAY "N"+STR$(N-N0) ELSE PLAY "N0"
70 LOCATE 4,I:COLOR 7:PRINT C$;
80 NEXT:GOTO 30
90 COLOR 7:CLS:PRINT "RUN 20":PRINT TAB(8)"GWTRAKR":LIST 91- 'ONLY ONE CHANNEL
91 REM
92 REM +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---
93 REM : : : : : : : : : : : : : : : : : :
94 REM : : : : : : : : : : : : : : : : : :
95 REM AEFH:AEFH AEFH E:A E:C EECA AE H:HF EFH E A C A : : : :QSU:ZX
96 REM
97 REM B D G I K N P S U W Z
98 REM A C E F H J L M O Q R T V X Y