# LocoPad, a web-based code editor for CPC devs

**URL:** <https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645>\
**Category:** CPCWiki related\
**Tags:** featured, announcement\
**Created:** [October 2, 2026, 6:35am UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645 "2026-10-02T06:35:08Z")\
**Posts on this page:** 19\
**Page:** 3

<div class="post-metadata">

**Author:** ![ervin](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/ervin/32/87_2.png) [@ervin](https://forum.cpcwiki.eu/u/ervin)\
**Post date:** [October 8, 2026, 10:45pm UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/41 "2026-10-08T22:45:26Z")

</div>

I’m certainly ok with it being included as a project.

I don’t know about the code’s status either, but the game has been available for decades online with the source code freely accessible. 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![SagaDS](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/sagads/32/160_2.png) [@SagaDS](https://forum.cpcwiki.eu/u/SagaDS)\
**Post date:** [October 9, 2026, 6:56am UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/42 "2026-10-09T06:56:23Z")

</div>

An another parallel point: snippets are really nice addition for beginners. But maybe we could make them as fast as possible for BASIC. Some examples:

- Direction handling can use less IF THEN and do only mathematic
- Collision can work without SQR, etc…

Can we provide some ‘faster’ implementations in parallel of easy to understand ones?

---

<div class="post-metadata">

**Author:** ![Gryzor](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/gryzor/32/7_2.png) [@Gryzor](https://forum.cpcwiki.eu/u/Gryzor)\
**Post date:** [October 9, 2026, 7:05am UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/43 "2026-10-09T07:05:25Z")

</div>

The purpose of the snippets addition was not to offer really useful snippets from the go, but to showcase the ability to do so.

So, anyone who could offer such snippets would be welcome to do so and I’ll incorporate them very easily!

---

<div class="post-metadata">

**Author:** ![Briggsy](https://forum.cpcwiki.eu/letter_avatar_proxy/v4/letter/b/e56c9b/32.png) [@Briggsy](https://forum.cpcwiki.eu/u/Briggsy)\
**Post date:** [October 9, 2026, 9:33am UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/44 "2026-10-09T09:33:34Z")

</div>

This is really great, and good to see it being developed - it will make it far easier to write CPC stuff on the go and that should result in more CPC entries for the 10 liners compos 😄 (although you will have to add token counting per line for this mode of development, it’s not just 255 characters, there’s a token limit too IIRC).

Would be great to integrate one of the BASIC compilers but I know that there are compatibility issues with full basic coverage. IIRC there was one recently written and talked about here (have been stupidly busy this year ☹ )

And then Locomotive BASIC 2 / 2.1 support with labels and subroutines and so on (for the CPC that would have to be used with a compiler only I guess, or (for labels) line number substitution on export)

---

<div class="post-metadata">

**Author:** ![Gryzor](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/gryzor/32/7_2.png) [@Gryzor](https://forum.cpcwiki.eu/u/Gryzor)\
**Post date:** [October 9, 2026, 11:16am UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/45 "2026-10-09T11:16:40Z")

</div>

I’ve got a few features I’m working on, seems every time I implement something I think of something else! So thanks for the great ideas to push the next release further back 😃

> [@Briggsy](#):
>
> add token counting per line

Yeah, that’s very easy to do, on both counts, and I’ll take a look at stuff like 10-liner compo rules to see if there’s something useful there (in terms of limitations etc).

> [@Briggsy](#):
>
> integrate one of the BASIC

yeah, that’s a tough one unless there’s already a Wasm-assembled compiler out there already? Because porting one is definitely outside my skill level. True, I could Claude my way through something, but I lack the knowledge to properly test it afterwards.

> [@Briggsy](#):
>
> Locomotive BASIC 2 / 2.1

Huh. Haven’t ever touched that. Is there really interest for it?

Thanks again for your comments =)

---

<div class="post-metadata">

**Author:** ![Briggsy](https://forum.cpcwiki.eu/letter_avatar_proxy/v4/letter/b/e56c9b/32.png) [@Briggsy](https://forum.cpcwiki.eu/u/Briggsy)\
**Post date:** [October 9, 2026, 2:36pm UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/46 "2026-10-09T14:36:29Z")

</div>

Maybe it would be good in the IDE to support labels for GOSUB and GOTO at least, even if at dsk generation these are replaced with the actual line numbers at the time.

100 .start\_loop: PRINT “Processing data…”

…

200 IF A = 0 THEN GOTO .start\_loop

Obviously this starts making a source file that different from the runnable ascii dsk basic file, so if you want the IDE source on the disk then that’s another file to save I guess (filename.src maybe).

---

<div class="post-metadata">

**Author:** ![SagaDS](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/sagads/32/160_2.png) [@SagaDS](https://forum.cpcwiki.eu/u/SagaDS)\
**Post date:** [October 9, 2026, 2:39pm UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/47 "2026-10-09T14:39:28Z")

</div>

I tried it, but take care of something: there is a bad " at the end of listing that seems to provoke some issues with the copy / paste. I have modified my parser so it accepts it… But not sure that is a good way to do it.

I have pushed a version of CPCBasicator in repository that goes to the end of source without error. Now I need to compare with official tokenized version taken from emulator and test if runtime is ok or not.

The copy paste of the full source in WinApe seems to produce some errors (I have the line 5880 - 5890 truncated)… Maybe there is a need to do it in chunks.

---

<div class="post-metadata">

**Author:** ![Gryzor](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/gryzor/32/7_2.png) [@Gryzor](https://forum.cpcwiki.eu/u/Gryzor)\
**Post date:** [October 10, 2026, 4:59am UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/48 "2026-10-10T04:59:51Z")

</div>

This is an interesting idea, but I think that implementing it would move this in another direction. Once we’re doing stuff like that, is it BASIC and more?

What we _could_ do is introduce some tools like bookmarking for routines etc, but I don’t think many would use it…?

---

<div class="post-metadata">

**Author:** ![eto](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/eto/32/24_2.png) [@eto](https://forum.cpcwiki.eu/u/eto)\
**Post date:** [October 17, 2026, 4:15pm UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/49 "2026-10-17T16:15:11Z")

</div>

I just played around with it and it works nicely. One thing I recognized is that if I press ESC that I can’t stop the current BASIC program for e.g. debugging as the whole emulator will close. Is that something that can be changed?

---

<div class="post-metadata">

**Author:** ![Gryzor](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/gryzor/32/7_2.png) [@Gryzor](https://forum.cpcwiki.eu/u/Gryzor)\
**Post date:** [October 17, 2026, 5:31pm UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/50 "2026-10-17T17:31:28Z")

</div>

Hmm, not sure exactly what you mean? Pressing esc doesn’t really shut down the emulator? Something else?

---

<div class="post-metadata">

**Author:** ![SagaDS](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/sagads/32/160_2.png) [@SagaDS](https://forum.cpcwiki.eu/u/SagaDS)\
**Post date:** [October 17, 2026, 6:42pm UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/51 "2026-10-17T18:42:30Z")

</div>

Esc should be a BREAK to stop the basic program. But here it stops the emulator.

That’s why I used WinApe to get SULTAN tokenized, because with autorun in Locopad and Esc exiting, I cannot load and save it to make the tokenized version.

---

<div class="post-metadata">

**Author:** ![Gryzor](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/gryzor/32/7_2.png) [@Gryzor](https://forum.cpcwiki.eu/u/Gryzor)\
**Post date:** [October 17, 2026, 7:00pm UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/52 "2026-10-17T19:00:22Z")

</div>

🤦‍♂️

That was so stupid.

Yeah, I’ll fix it, of course.

---

<div class="post-metadata">

**Author:** ![Gryzor](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/gryzor/32/7_2.png) [@Gryzor](https://forum.cpcwiki.eu/u/Gryzor)\
**Post date:** [October 18, 2026, 10:18am UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/53 "2026-10-18T10:18:10Z")

</div>

Ok, fixed and replaced with shift+ESC. Sorry about that, it was pretty silly on my part.

---

<div class="post-metadata">

**Author:** ![Gryzor](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/gryzor/32/7_2.png) [@Gryzor](https://forum.cpcwiki.eu/u/Gryzor)\
**Post date:** [October 19, 2026, 7:32am UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/54 "2026-10-19T07:32:37Z")

</div>

Hello everyone!

I’m happy to announce **[LocoPad v1.5](https://www.cpcwiki.eu/locopad)** with a few exciting features 🙂

1. **LocoPad Goes AI!!!** :

2. **Locomotive BASIC 2 Language Support** :

3. **ABASC Z80 Compiler Suite (**@Fragarco**)** :

4. **Native Bytecode Tokenizer & Instant Boot (**@SagaDS\*\*)\*\* :

5. **BASIC Minifier & Crunch Suite** :

6. **BASIC 10-Liners Compo Assistant** :

7. **Floppy Disk (.DSK) & Cassette Tape (.CDT) Tools**:

8. **Companion Studios** :

9. **Workspace Management & Themes** :

10. **Various bugs** fixed (such as ESC closing the emulator instead of BREAKing the program running)

* * *

### Acknowledgements

- **Francisco Garcia (_fragarco_)**: For the open-source **ABASC** compiler suite vendored in `tools/abasc/` powering native Z80 machine code generation.
- **Juan Carlos González Amestoy** : For **RetroVirtualMachine** and the **RVMPlayer** WebAssembly core providing in-browser CPC 6128 emulation.
- **Xavier Jollet (_SagaDS_)**: For **CPCBasicator** , from which LocoPad’s authentic AMSDOS bytecode tokenizer and token mapping were ported.
- **Ervin** : For contributing the complete 659-line _Sultan’s Maze_!!!

* * *

I’ve now ran out of ideas for features. Please test it and let me know what you think!

---

<div class="post-metadata">

**Author:** ![Gryzor](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/gryzor/32/7_2.png) [@Gryzor](https://forum.cpcwiki.eu/u/Gryzor)\
**Post date:** [October 19, 2026, 10:09am UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/55 "2026-10-19T10:09:40Z")

</div>

Apologies, AI wasn’t working because of CF issues, had to bust the cache to make it load properly.

---

<div class="post-metadata">

**Author:** ![SagaDS](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/sagads/32/160_2.png) [@SagaDS](https://forum.cpcwiki.eu/u/SagaDS)\
**Post date:** [October 19, 2026, 12:51pm UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/56 "2026-10-19T12:51:57Z")

</div>

Thanks Gryzor for this milestone. It’s a huge one.

Some points:

It is not clear how to add the generated screen artwork inside the project.  
‘Add to project’ creates the 1KB scr file in DSK with the loader inside (not the graphism)… If I download the scr file, how should I add it to project?

I like the minifier interface, clear and easy to understand. Small possible improvement (but big development like always): pack DATA statements into less lines (have to keep track of RESTORE statements first to not mess things).

On other hands, here are my first test issues (I used SULTAN.BAS as a base):

Minifier has an issue with Data Strings with double quotes. Check the words data after variable minifying. All word are transformed in A0-Z9: huge bug to correct.  
Also, I noticed that some lines that finished with a GOSUB/GOTO are marked as ‘do not pack next line’… Why? I understand for IF THEN ELSE and Lines that are used as a target for a GOTO / GOSUB, RESUME, but not for this case.

‘Variables’ reports hexa values &A000 as variable A000.  
Also it does not take into account defint / defreal / defstr: in SULTAN there is a DEFINT a-z so A (line 80) should be seen as Integer. By default all variables are Float if I remember well.  
REMAIN() and SQ() are considered as array but they are Basic functions.  
Some strings that are used on same line so are reported as single used.  
It seems that SULTAN declares its dim variables with bracket???(line 170) I didn’t know it was possible. Variables don’t see them.

Linter is not really Locomotive BASIC aware, no?  
CLS issue, TAG issue, PRINT issue, next.f issue (I know this one 🙂 ). It seems that ‘:’ is treated as a label identifier for this linter.

One editor does not have a search feature? Using Ctrl+F3 inside CodeMirror 8 doesn’t seem to search things, as I don’t know this editor, it’s maybe ‘normal’. I switched to the other one 🙂

---

<div class="post-metadata">

**Author:** ![Gryzor](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/gryzor/32/7_2.png) [@Gryzor](https://forum.cpcwiki.eu/u/Gryzor)\
**Post date:** [October 19, 2026, 2:03pm UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/57 "2026-10-19T14:03:24Z")

</div>

Thanks so much for this feedback! Greatly appreciated 🙂

It’s obvious where the problem lies with most of these issues so I’ll try to fix them today and will get back to you. The scr content is a code regression, I already have this working.

Will get back to you soon (crossing fingers, that is)

---

<div class="post-metadata">

**Author:** ![eto](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/eto/32/24_2.png) [@eto](https://forum.cpcwiki.eu/u/eto)\
**Post date:** [October 26, 2026, 8:35pm UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/59 "2026-10-26T20:35:13Z")

</div>

I’m probably blind - how can I add a binary to my project? I have a RSX which I want to include in my BASIC program and I can’t find a way to add the BIN to the project.

---

<div class="post-metadata">

**Author:** ![Gryzor](https://forum.cpcwiki.eu/user_avatar/forum.cpcwiki.eu/gryzor/32/7_2.png) [@Gryzor](https://forum.cpcwiki.eu/u/Gryzor)\
**Post date:** [October 27, 2026, 7:21am UTC](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645/60 "2026-10-27T07:21:43Z")

</div>

That’s a design oversight on my part, but:

1. just drag and drop one onto the workspace
2. the Import button imports bin files as well
3. drag and drop a dsk image onto the workspace, locate your bin file and import it.

Haven’t used it extensively, but it works.

[Previous page](https://forum.cpcwiki.eu/t/locopad-a-web-based-code-editor-for-cpc-devs/645.md?page=2)
