DYSTOPIANPIXEL

GPT To Plugin Migration

A translucent conversation module sending illuminated blocks into a modular workshop with a pixel sprite and colour palette
Concept artwork for Speccy Next Coding Coach’s migration.

· In development

What we tried, why we chose an approach and what we learned. These are dated accounts; see Progress for the current position and recorded outcomes.

What counts as a completed migration?

I could put a SAM disk into SimCoupe and scroll around a world. That made an easy answer to “What does the plugin do now?” It was a poor way to answer the other question I had on 19 November. If the old coach disappeared tomorrow, what would I lose?

Take the person who opens an empty editor and wants to build a program for the Next. A scrolling demo tells them very little about which assembler to use, how to arrange their source or how to get the result onto an SD card. The old GPT had helped with those jobs. Until I could find that help in the plugin or its references, there was still something worth recovering. Another improvement to the SAM renderer would leave that gap exactly where it was.

Looking ahead gave me the opposite problem. Adding the Commodore 64 to my plans gives me a whole machine to learn, teach and test. A suitable future Amstrad core could do the same. Writing either idea into the roadmap changes what I want to build. It cannot undo a lesson or file workflow I have already preserved.

That gave 10 December a specific purpose. While I can still ask both coaches the same question, I can find the answers, instructions and references that have only one home and give them a second one. Once the full set of comparisons passes, I can close the migration. With each new idea, I can then ask what someone will be able to make with it and which machine I can show it working on.

Read the audit behind the decision ↗

The scroll that filled the screen with colour

On 15 November I already had a way to move around the SAM world. Each keypress rebuilt all 192 visible tiles, so I could check that the camera was showing the right part of the map. It was slow, but it gave me a working disk to compare the next build against.

The faster version shifted the pixels already on screen and drew one strip at the edge. When I ran it, all I could see was colour. The graphics suggested a drawing fault. The address of the last byte told a different story. The combined code and data had grown from its base at $4000 into the workspace beginning at $4B00, where the SAM handles file headers.

The test only needed one sprite frame. Dropping the spare frame freed 256 bytes and brought the block back below the boundary. The same scrolling routine now drew the world and moved it visibly faster in all four directions. I gained a check I can apply before mounting the next disk: for this loading arrangement, $4000 + CODE length < $4B00.

Which tile goes back under the sprite?

The SAM sprite test I ran on 15 November had three background tiles. I could watch a sprite appear in each position in turn and see the old pattern come back as it left. That made a particularly good first test: a mask error or a missed redraw had nowhere to hide.

A complete tilemap changed the question. A sprite might stand over any of the tiles in the set. The renderer needed the ID stored at that cell, so the map became the place to look up what belonged behind the sprite. I described the orange-edged border and the different interior patterns I could see in SimCoupe. Those recognisable marks made it easy to follow what was being restored.

Then the scenery itself started moving. I kept the sprite in the same place on the screen while the camera moved through the world. Its screen coordinates stayed fixed, but the correct background tile changed with each step. Adding the camera offset to the cell lookup let the same demonstration test both the moving view and the restored background.

A portrait with the right colours in the wrong places

In the MODE 3 tests on 18 October, the first portrait looked too tall. The file contained the required 512 columns, but the SAM displays them in a 4:3 picture. Cropping to the shape of the stored raster had thrown away parts of the source before it ever reached the screen. Fitting the artwork in display space first gave the face its proportions back.

The next fault survived a better palette. The PNG showed the intended red and grey areas while SimCoupe put those colours elsewhere. Both the encoder and the preview reader had interpreted the two middle pixel codes the same way. They agreed with one another and still disagreed with the SAM. Fixing the lookup order made the preview useful again.

A single face could only tell me so much about choosing four colours. An eleven-image comparison found a robot whose coloured armour had turned grey. In the follow-up pack I wanted its small red and cyan highlights to survive, and I also wanted genuinely grey artwork to stay grey. Watching the fourteen screens cycle on one disk let me check both demands together.

A BASIC listing that would not survive RUN

In September I could load a SAM picture from disk and see that the graphics were sound. The BASIC program beside it was another matter. First I could load it but could not remove lines. A later version let me alter the listing, then reset SimCoupe when I ran it.

The three lines of BASIC had perfectly recognisable tokens. What the disk also had to restore was the interpreter’s working state. It needed to know where the program ended, where the numeric variables ended and where it could use space to edit a line. A byte-for-byte check of the saved file became useful once it included all three boundaries.

When I came back to the disk on 18 October, I added a STOP line. The first attempt crashed. After a restart the same edit worked, I could change existing lines and the program displayed the picture. I kept that first observation in the record. The repeatable test for the coach now includes editing and running the program someone actually receives.

The missing 4,032 patterns

A full 16 KB sprite bank looked like a plausible answer to the sprite conversion test on 26 September. The source was a 1,024-pixel square, though. Cut into 16×16 cells, it held 4,096 patterns. The first row alone filled the bank. The file size could be exactly right while nearly the entire sheet had disappeared.

Sometimes I do want just a few patterns from an atlas. The useful change was to count the source cells first and make the choice explicit. I could specify a subset or ask for every pattern to be split across banks in reading order. The latter needed a shared palette so that moving from one bank to the next preserved the meaning of each colour index.

The 560-pattern test had a particularly useful last bank. Eight banks filled exactly, then only 48 patterns remained. I opened the output in Remy Sharp’s sprite tool and tried the first and last banks on the Next. That short final file tested a case that a perfectly sized demonstration would never have exercised.

Why I took the palette to the Next

On 25 September the Layer 2 conversion gave me a good-looking preview, so I loaded the screen on the Next. It looked blue. There were two things to investigate. Some near-grey colours in the conversion had picked up a blue step, and I had opened the screen file on its own. Its pixel values selected colours from whatever palette was already active.

The loader that worked for me put the companion palette in bank 20, selected the nine-bit palette format, applied it to Layer 2 and then loaded the image. Once I ran that sequence, I could judge the conversion using the colours the file was made for. A later smoke image covered the opposite case: keeping the greys neutral still had to leave saturated cyan, magenta and orange alone.

That smoke test also settled who had produced which file. The plugin gave me readable loader source, and I ran .TXT2BAS on the Next. Recording those as two separate steps tells the next person exactly what will arrive and what they need to do before pressing RUN.

Why a retro coach tried to build a web app

One of the comparison prompts I tried on 24 September asked for a modern React application with sign-in and cloud deployment. Ordinary ChatGPT began designing it. So did my specialist coach, which even prepared a downloadable project. I had already put a scope rule in its retro-development instructions. The awkward possibility was that a request with nothing retro in it would never select those instructions.

I gave the scope check its own entry point and repeated the same request in a fresh conversation. This time the plugin redirected the general web job. It could still explain why a web editor for Spectrum Next sprites belonged in the workshop. The purpose of the program determined whether the coach was useful.

The SAM test caught a subtler version of the same problem. The question named the KS3 Spectrum Next, but the machine being programmed was its SAM Coupé core. A learner needed SAM BASIC and the SAM display model. Making that distinction explicit did more for the lesson than adding another paragraph about what the Next can do.

Building the coding coach

Keeping the way I like to learn

The original GPT grew around the questions that come up while making things for old computers. Moving it gives me a reason to look again at those instructions and ask which parts actually help: an explanation of the important lines, an example to try and a clear account of what still needs testing.

That is the experience I want to carry into the plugin. The packaging is changing, but the practical reason for building the coach is the same.

a pleasing image, and the checks around it

The latest Layer 2 result looked great, which was encouraging after the work on conversion and colour handling. The next job was to check the files and loader together. It is a useful example of how a small-looking asset task reaches into formats, palettes and the instructions needed to use the result.

Turning corrections into repeatable tests

When an answer or command needs correcting, I want that lesson to survive the next edit. Keeping small, familiar tests gives me something concrete to return to, and helps the Ideas pages show progress through results rather than just a growing list of intended features.