PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

Reading the keyboard is not ready, not all tokens are defined yet but I just ran my firt program

1 PRINT 123;
2 GOTO 1
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

The MC10 has 48 keys that are read unshifted.
The ZX Spectrum has 40 keys that are read unshifted.

This means that to read the 8 extra keys on the ZX Spectrum 2 keys need to be pressed.
All the keys (except BREAK) can be read with symbol shift + key, however...
The MC10 also uses a symbolshift key and other keys to make keywords.
Keywords can also be typed as lose letters so for some keywords the
keyboardroutine will read the ZX Spectrum character and you need to type the keyword
for that key letter by letter.

I am now working on the routine to skip ZX Spectrum character from the MC10 keywords.
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

The first keyword showed up after fixing another opcode.
Next to do add other values for keywords in a table to make keys react to them.

The table is already part of the code, but keys were disabled.
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

It took me a while to know how the MC10 defined the keys.
Especially the ZX Spectrum keys under symbol shift that are default on the MC10.

I finally have the keywordroutine working, now only changing a table to get all keywords.
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

Adding the SHIFTED keys was yet another struggle but it is now working too.

Only a few keys still missing to add.
+<>?*=

and a BREAK-key test

After that the keyboard is ready and I can try focussing on speeding up the emulator
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

Adding the final keys did not work as planned.

So I focused on the keyboardroutine that was still doing a check where from ROM it was called.
Still some ghostkeys appeared once in a while.

i was able to stabilize the routine and make it independent from where it was called.
Now ingame keyboardredading should always work too.

next to add the extra keys.
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

From tuesday till now (sunday) struggling to get 1 extra key to the keyboard.
When 1 will work all will work.

Now finally working and found out that there is a different bug eleswehere.
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

I coded a program to display all characters.
This would show all option of the screenroutine too.

I ran this code
1 FOR F=1TO255
2 PRINT CHR$(F);
3 NEXT F

It showed another bug, CHR$ is executed as CODE, so work to find the error.
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

I also ran the code at 20 Mhz on an emulator.

This is a good speed the emulator runs at
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

Image

Bug found and this is the output of the code.
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

BREAK key was the only TRS80 key missing, now all keys added.

Only an extra key for the menu needed.
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

Final issue with the keyboard was some keys added an extra ghost key.
I was able to find a fixed moment where it happened so I was able to
find the cause.

I will now start adding the menu and speedup the BASIC

A BETA version could be released if wanted......
User avatar
Quazar
Drutt
Posts: 31
Joined: Tue Jun 16, 2020 2:28 pm
Contact:

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Quazar »

Dr beep wrote: Sun Sep 24, 2023 8:55 pm A BETA version could be released if wanted......
Would be great to see!
Quazar - Developing for the SAM Coupé for 30+ Years!
Hardware, Software, 'SAM Revival' magazine -> www.samcoupe.com
Plus hardware for the ZX Spectrum, RC2014 and other general retro peripherals.
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

I will make it... btw with Mayhem you can get a good speed already.

I will add option back 2 basic first
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

Another opcode fixed, but not in the beta version.
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

First results of a tester shows some missing features due to lack of knowledge.

Working on that.
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

Added a menu and now working on the display of the MC10 keyboard as emulated on the ZX Spectrum.

After that I will work on the sound and loading.

Finally I will speed up the BASIC by translating parts of the ROM.
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

The keyboard picture is now added.

Loading next
zx_if1
Drutt
Posts: 48
Joined: Fri Jul 16, 2021 8:53 pm
Location: Peru
Contact:

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by zx_if1 »

Ok
I downloaded the beta
and the pdf manual too
now I go to try it
thanks
then I will write my observations next
zx_if1
Drutt
Posts: 48
Joined: Fri Jul 16, 2021 8:53 pm
Location: Peru
Contact:

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by zx_if1 »

Ok
cest magnifique!
set and reset work good
the bad: print@ and sound crashed the emulator
all freezed
mem crash all too
Last edited by zx_if1 on Wed Sep 27, 2023 3:14 pm, edited 1 time in total.
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

print@ is solved, sound is known too, but soynd was not added yet.
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

Although not exact the same sound as on the MC10, the emulator has sound.
zx_if1
Drutt
Posts: 48
Joined: Fri Jul 16, 2021 8:53 pm
Location: Peru
Contact:

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by zx_if1 »

ok
but INPUT is not accepted yet
caused error
and MEM crashed all
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: PROJECT : A TRS80 MC10 emulator on the ZX Spectrum

Post by Dr beep »

Input and mem had the same bug as print@

Wait for new release.
Post Reply