Soooo following the Firmware Hovercards and after @Devlin 's suggestion, I went ahead and implemented similar hovercards for BASIC keywords!
Due to their similarity to natural language I had to limit them to code blocks only:
10 MODE 1: BORDER 0: CLS
20 INK 0, 0: INK 1, 26: INK 2, 6
30 ENV 1, 5, 1, 5: SOUND 1, 239, 50, 12, 1
40 ORIGIN 320, 200: DEG
50 FOR a = 0 TO 345 STEP 15
60 CALL &BD19: REM Sync to vertical flyback
70 DRAWR 100 * COS(a), 80 * SIN(a), 1
80 MOVER -100 * COS(a), -80 * SIN(a)
90 NEXT a
100 LOCATE 1, 24: PRINT "Press any key to reset palette...";
110 CALL &BB18: REM Wait for keypress
120 CALL &BC02: REM Reset inks to defaults
Ta-daaaah!
In order for this to work, though, I also had to make sure it only works in BASIC code blocks. And although I have tried to make the forum system to automatically identify BASIC in preformatted text, this doesn’t always work (I should deal with it at some point). So, make sure you choose BASIC when entering a BASIC program:
And that’s it.
Feeback is always welcome!
PS this was much easier to do than I’d originally thought, due to the work on the FW parser and the BASIC code blocks having already been done. That said, the biggest hurdle was scraping the BASIC commands from the wiki itself, because of anti-bot protection ![]()
PS2 Sources used to put together the BASIC outline:
- Locomotive BASIC Reference Manual (Used for exact statement syntax, parameter brackets, and version differences (BASIC 1.0 vs 1.1).
- AMSDOS Firmware & Reference Manual (Soft 158): Used for the 13 native Resident System Extension (|) disc commands, drive switching, and syntax parameters.
- CPCWiki Locomotive BASIC Category: documentation and ROM token tables used to verify edge-case commands (like
COPYCHR$andWINDOW SWAP) and hardware register interactions.
…fed into Gemini which spewed out the json needed for the parser.
