Repository navigation
Conversation
- abbreviation - shifted letter is needed - notation of remaining symbols consistent with cbm prg studio
…into basic-tokenizer-editor-abbreviation
…aced between program lines are ignored during tokenization
…andard from an editor I haven't encountered yet
…into basic-tokenizer-editor-abbreviation # Conflicts: # html/index.html
"additional entries found in COMPUTES!'s Gazette" moved to special.js file
… to analyze long lines of code
…into basic-tokenizer-editor-abbreviation # Conflicts: # html/index.html
clean short guide
… to the BASIC Tokenizer textarea to prevent visual distractions and ensure a proper coding experience.
…y notes. Switched // comments to !- within the BASIC template for CBM prg Studio compatibility. Standardized the external configuration file (SPECIAL.js logic/loader) for clarity.
- Replaced unreliable setTimeout with script.onload combined with jQuery readiness to eliminate race conditions. - Centralized editor and table initialization into initializeTokenizerUI() to ensure atomic UI updates. - Corrected loading order of jQuery and external assets in <head> to prevent reference errors. - Refactored renderSpecialTable to use .empty().append() for consistent UI refreshes when switching profiles. - Cleaned up redundant script blocks at the end of <body> to maintain a single source of truth for initialization.
Description: - Data: Reorganized SPECIAL token array to a full 0-255 PETSCII map, following the CBM prg Studio standard. - UI: Replaced the 16-column table with a high-density 8x32 grid for better space optimization. - Color: Integrated the Pepto PAL palette for authentic Commodore 64 color reproduction. - Accessibility: Implemented adaptive contrast logic to toggle white/black text based on background luminance. - Layout: Standardized spacing with 4px HEX-to-symbol gaps, 16px column gutters, and red vertical separators. - Stability: Fixed missing HEX assignments for alternate symbols and ensured strict monospace vertical alignment.
…tability to the C64. Key changes: 1. Added interactivity to renderSpecialTable(): - Special characters are now clickable and automatically inserted into the BASIC editor. - Insertion occurs at the current cursor position (selectionStart/End) instead of at the end of the text. - Added 'special-token' class and 'data-token' attributes for better DOM event handling. 2. Enhanced Editor UX: - Implemented scroll locking (preventScroll) and manual scroll position restoration to eliminate page "jumping" when selecting characters. - Added automatic focus on the editor after a symbol is selected. 3. Fixed a ReferenceError in parseBASIC: - Correctly synchronized the program's end address variables, ensuring stable code transmission to memory. 4. Organized technical documentation: - Refined internal comments within the rendering function (sections 1-4). Goal: To facilitate the input of PETSCII control characters and improve the overall consistency of the editor interface.
Terminate line processing immediately when 0x00 (NULL) is encountered.
Fixes incorrect line pointers in generated .prg files.
…on stub for initializeTokenizerUI.
…into basic-tokenizer-editor-abbreviation # Conflicts: # html/index.html
Limit the total number of special character repetitions
in a BASIC line to prevent excessive memory usage during expansion.
Repetition counts are validated before generating
the expanded string. If the combined count exceeds the safety limit,
tokenization is stopped and the program is not sent.
This applies to both supported repetition
formats: {space*3} and {3 space}.
|
Regarding the latest commit limiting the number of special character repetitions, I tested the following program: Each line tests a different case: 10 — a single CBMprgStudio-style repetition at the safety limit (999). This verifies both supported repetition syntaxes as well as the cumulative repetition-count check. The safety limit prevents the browser from attempting to expand extremely large repetition counts, which could consume excessive memory and cause the page or browser tab to become unresponsive. -- |
|
I've done quite a lot of compatibility testing of the Ultimate tokenizer, As an additional source of real-world test programs, I've been using the https://archive.org/details/commodore-64-games-book_202304/mode/1up https://archive.org/details/commodore-64-games-book-2_202409/mode/2up Transcribed versions of these and many other C64 book listings can also https://github.com/TypeInBooks/books/tree/master/commodore/c64 One thing worth noting is that the descriptions/instructions for some One more question regarding the PR: should I now keep this branch updated |
|
Hi @radius75 , excellent work! About the target branch:
This is as per the Github Flow model aka trunk based development: Only a single The above has been discussed with @GideonZ (except for the Thanks |
…into basic-tokenizer-editor-abbreviation
…into basic-tokenizer-editor-abbreviation
Review of da4b875 (BASIC editor / tokenizer profiles)Assessment: not ready to merge. The editor itself is usable and the error handling is good. Two problems remain: the profile files are not shipped by the updater, and the new test does not run on current master. I checked the branch merged onto Blocking1. On current master the editor works without any extra files, so this is a regression for every user who has not copied the files by hand. The author's comment of 2026-08-29 says the editor is not expected to go into the official firmware. If that is still the intent, this should not be merged to 2. Is the editor still easy to use?Yes, with two reservations. Layout at 1500x1100:
Line number 99999 gives Reservations:
The sidebar is existing layout, not part of this PR, so I would not hold the PR for it. Not verified
Other
|
|
Hi @radius75 , hope you are well. It's been a while :-) I left a review of your PR in my previous comment. I know this is taking quite a while, but it is targeted for 3.16 anyway, and we are still preparing to release 3.15c based on what I know. Thanks for addressing the findings. |
|
I've been thinking about your suggestion regarding the long welcome text. My idea is to split the current
I'd add a "Show profile examples" checkbox next to the existing "Uppercase" checkbox, unchecked by default. The checkbox state would be stored in Changing the checkbox would not immediately modify the editor content, avoiding accidental loss of a BASIC program the user is working on. The new setting would only take effect after reloading the page (F5 or Ctrl+F5). This way, users would see only a short profile identification by default, while the detailed instructions and BASIC examples would still be available when needed. What do you think? |
- Split profile content into `WELCOME_TEXT` and optional `BASIC_CODE`. - Add a "Show profile examples" checkbox, disabled by default. - Save the checkbox preference in `sessionStorage`. - Apply changes only after page reload to prevent overwriting user code. - Update profile documentation and add a checkbox tooltip. - Restore the BASIC Editor tab after F5 or Ctrl+F5 if it was previously active. - Return to Home when reloading from any other tab. - Preserve the active tab when using machine control buttons.
- Add a reload notice when the "Show profile examples" setting is changed. - Reuse the existing Clear BASIC dialog styling for the new notice. - Automatically close both dialogs when switching tabs. - Restore the Home page after returning from API Explorer instead of reopening the BASIC editor. - Prevent the Clear BASIC and Reload notice dialogs from overlapping by closing one before opening the other.
Remove leftover code from the former 160-character line length limiter. Line length is now checked after tokenization.
|
Nice one @radius75! Did you also address the issue that some of your files were not installed by any firmware updater? Could you please install your PR from scratch and verify, plus mention all the devices you tested it on? Thanks. |
|
@chrisgleissner I tested the firmware installation on my Ultimate II+ only. I first emptied The installed files match the source content. The only difference is LF line endings instead of CRLF in my local copies, which makes the installed files slightly smaller. |
|
Many thanks for that test @radius75 , much appreciated! @GideonZ From my perspective, this PR is ready to be merged, after many review cycles and much great work by @radius75 over the past 10 months. Given this is a new feature and not a bug fix, I suggest this could go in after 3.15c will have been tagged and we are ready to onboard 3.16-related changes. |
…into basic-tokenizer-editor-abbreviation
…into basic-tokenizer-editor-abbreviation
…into basic-tokenizer-editor-abbreviation









The changes introduced here continue the work discussed in #450. Detailed technical descriptions are included in the commit messages.
Description
This PR improves the Ultimate BASIC editor and tokenizer with an interactive PETSCII table, BASIC keyword abbreviations, external mapping profiles, and clearer error handling.
Key enhancements
Interactive PETSCII table and tooltips
$00–$FF.Special character tags
{white}and{sh a}.{space*3}and{3 space}.External profiles
special.jsselects the mapping profile to load.cbm_prg_studio.jsprovides the default keywords, special characters, tooltips, and startup text.Shorter startup text and editor navigation
WELCOME_TEXTand optionalBASIC_CODE.sessionStorageand applied after a page reload.BASIC keywords and abbreviations
REM, and withinDATAuntil an unquoted colon.Validation and program upload
0–65535.Line pointers and null bytes
0x00byte stops processing the current source line. Content following it is not included.Firmware updater integration
.jsresources.special.jsandcbm_prg_studio.jsalongside the web interface.Validation
/Flash/htmldirectory correctly created both JavaScript files.How to test
{delete}and{white}, then upload the program and check the output.special.js, reload the page, and verify the table and startup text.65535, and oversized tokenized lines prevent upload.AI assistance and further review
This code were developed with AI - ChatGPT GPT6.1 Sol Light - assistance. Review of the tokenizer and memory pointer logic is welcome. Tooltip descriptions and character mappings may need further corrections based on wider testing.
Sample test code in CBMprgStudio format:
Closes #450